Class DynamicCaptureOrError
java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.common.TypedSymbolAccess
org.ek9lang.compiler.phase3.DynamicCaptureOrError
- All Implemented Interfaces:
Consumer<EK9Parser.DynamicVariableCaptureContext>
final class DynamicCaptureOrError
extends TypedSymbolAccess
implements Consumer<EK9Parser.DynamicVariableCaptureContext>
Resolves the variables to be captured and defines new variable symbols against the appropriate scopes.
A NAMED capture '(name: value)' introduces a new variable, so it obeys the same naming rule as every other variable: it may not reuse a function or type name (E01030/E01040). That is checked here, while the capture scope is still open and can see the module's functions and types - once closed, nothing later can (front-end audit FE57). An unnamed capture reuses a name that was already checked where it was declared.
-
Field Summary
Fields inherited from class RuleSupport
errorListener, symbolsAndScopes -
Constructor Summary
ConstructorsConstructorDescriptionDynamicCaptureOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, SymbolFactory symbolFactory) Define new variables in the capture scope as they are resolved. -
Method Summary
Methods inherited from class TypedSymbolAccess
emitTypeNotResolvedError, getRecordedAndTypedSymbol, isProcessingScopePure, recordATypedSymbol
-
Constructor Details
-
DynamicCaptureOrError
DynamicCaptureOrError(SymbolsAndScopes symbolsAndScopes, ErrorListener errorListener, SymbolFactory symbolFactory) Define new variables in the capture scope as they are resolved.
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceConsumer<EK9Parser.DynamicVariableCaptureContext>
-