pub struct ExpressionCompilationContext<'a> {
pub component_def: &'a ComponentDefinition,
pub template: &'a mut Vec<TemplateNodeDefinition>,
pub scope_stack: Vec<HashMap<String, PropertyDefinition>>,
pub uid_gen: RangeFrom<usize>,
pub expression_specs: &'a mut HashMap<usize, ExpressionSpec>,
pub active_node_def: TemplateNodeDefinition,
pub all_components: HashMap<String, ComponentDefinition>,
pub type_table: &'a TypeTable,
}
Fields§
§component_def: &'a ComponentDefinition
Current component definition, i.e. the Component
that houses
any compiled expressions and related property definitions
template: &'a mut Vec<TemplateNodeDefinition>
Container for mutable list of TemplateNodeDefinitions,
scope_stack: Vec<HashMap<String, PropertyDefinition>>
Static stack of addressable properties, by string Enables resolution of scope-nested symbolic identifiers, including shadowing
uid_gen: RangeFrom<usize>
Generator used to create monotonically increasing, compilation-unique integer IDs Used at least for expression vtable id generation
expression_specs: &'a mut HashMap<usize, ExpressionSpec>
Mutable reference to a traversal-global map of ExpressionSpecs, to be appended to as expressions are compiled during traversal
active_node_def: TemplateNodeDefinition
The current template node whose expressions are being compiled. For example <SomeNode some_property={/* some expression */} />
all_components: HashMap<String, ComponentDefinition>
All components, by ID
type_table: &'a TypeTable
Type table, used for looking up property types by string type_ids
Implementations§
source§impl<'a> ExpressionCompilationContext<'a>
impl<'a> ExpressionCompilationContext<'a>
sourcepub fn resolve_symbol_as_prop_def(
&self,
symbol: &str
) -> Option<Vec<PropertyDefinition>>
pub fn resolve_symbol_as_prop_def( &self, symbol: &str ) -> Option<Vec<PropertyDefinition>>
for an input symbol like i
or self.num_clicks
traverse the self-attached scope_stack
and return a copy of the related PropertyDefinition
, if found.
For