Module context

Module context 

Source
Expand description

ScopeContext tracks our knowledge of the scope types used in script and validates its consistency.

Structs§

ScopeContext
The ScopeContext represents what we know about the scopes leading to the Block currently being validated.
Signature
The essential characteristics of a ScopeContext for the purpose of deciding whether an event has already been evaluated with a similar-enough ScopeContext.
StashedBuilder
Information about a temporarily suspended scope-building operation. This is used in constructs like squared_distance(prev.capital_province), where the builder scope opened by squared_distance needs to be preserved while prev.capital_province is evaluated in the original scope.

Enums§

Reason
This enum records the reason why we think a certain scope has the type it does. It is used for error reporting.
ScopeEntry 🔒
ScopeEntry is a description of what we know of a scope’s type and its connection to other scopes.
Temporary

Constants§

MAX_SCOPE_NAME_LIST 🔒
When reporting an unknown scope, list alternative scope names if there are not more than this.
PREV 🔒
Backref index to pass to refer to the prev scope.
THIS 🔒
Backref index to pass to refer to the this scope.

Functions§

scope_type_from_name 🔒
Deduce a scope type from a scope’s name. This leads to better error messages.