optionalScope property

ReferenceScope? get optionalScope

Implementation

ReferenceScope? get optionalScope {
  AstNode? node = this;

  while (node != null) {
    final scope = node.meta<ReferenceScope>();
    if (scope != null) return scope;
    node = node.parent;
  }

  return null;
}