Class CaptureEvaluationScope
IdentifierReferenceOrError) and the "read it through a capture"
wording of an unresolved name inside a dynamic body (IdentifierReferenceOrError, IdentifierOrError).
The running code is the nearest dynamic function or class on the scope stack, else the nearest method or function. A capture list is the one place that differs (Steve, 2026-10-08, CAPTURES a/b): it is visited with its dynamic construct already on the stack, yet each capture expression is evaluated where the construct is CREATED, so it is judged outside that construct - '(limit: pivot)' in a method of the type that holds 'pivot', and an inner dynamic class capturing its enclosing dynamic function's capture. A capture SHARES the object, as a method returning the property would.
Whether the running code HOLDS a field is identity, never a name: one of its captures (CapturedVariables)
or one of its own properties (OwnProperty; a method's are its aggregate's). Only outerFieldNamed(ParseTree, String)
matches by name - it words the error for a name that did not resolve, and an unresolved name has nothing else.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final recordA field of the code around a dynamic body, and whether that body is a dynamic class's (else a function's). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) booleanisAccessibleWhereEvaluated(org.antlr.v4.runtime.tree.ParseTree node, ISymbol propertyField) True when the code that evaluatesnodeholds the property field (a capture or an own property).(package private) Optional<CaptureEvaluationScope.OuterField> outerFieldNamed(org.antlr.v4.runtime.tree.ParseTree node, String name) Inside a dynamic function or class body (not its capture list): the property or capture callednameof the code AROUND it - the nearest construct outward that has one.
-
Constructor Details
-
CaptureEvaluationScope
CaptureEvaluationScope(SymbolsAndScopes symbolsAndScopes)
-
-
Method Details
-
isAccessibleWhereEvaluated
True when the code that evaluatesnodeholds the property field (a capture or an own property). Where there is no running code to judge against, it is accessible (as it always was). -
outerFieldNamed
Optional<CaptureEvaluationScope.OuterField> outerFieldNamed(org.antlr.v4.runtime.tree.ParseTree node, String name) Inside a dynamic function or class body (not its capture list): the property or capture callednameof the code AROUND it - the nearest construct outward that has one. A dynamic construct is pulled out to module level, so those fields are never in its scope; reading one directly stays an error (CAPTURES c), and this is what lets the error name the fix.
-