pub struct Verifier { /* private fields */ }Expand description
ActionScript 3 and MXML verifier.
Verifier performs type checking and maps nodes to something in
the semantic model.
§Verifying
A set of programs can be verified by invoking verify_programs():
verifier.verify_programs(program_list, mxml_list);A single expression can be verified by invoking verify_expression():
verifier.verify_expression(&expression, Some(context_type));§Scopes
Enter and exit scopes by invoking enter_scope() and exit_scope() respectively.
Such methods may alter the parent() field of the scope to use the enclosing
scope as the parent.
verifier.enter_scope(&scope);
verifier.exit_scope();§Symbol solving
As programs are verified, the host.node_mapping() object is filled
with mappings from program nodes to something in the semantic model.
// expression: Rc<Expression>
let thingy: Option<Thingy> = host.node_mapping().get(&expression);Implementations§
Source§impl Verifier
impl Verifier
pub fn new(host: &Rc<SemanticHost>) -> Self
Sourcepub fn invalidated(&self) -> bool
pub fn invalidated(&self) -> bool
Indicates whether an error was found while verifying the program.
Sourcepub fn verify_programs(
&mut self,
programs: Vec<Rc<Program>>,
mxml_list: Vec<Rc<Mxml>>,
)
pub fn verify_programs( &mut self, programs: Vec<Rc<Program>>, mxml_list: Vec<Rc<Mxml>>, )
§Panics
Panics if the verifier is already invalidated before verifying.
Sourcepub fn verify_expression(
&mut self,
exp: &Rc<Expression>,
context: &VerifierExpressionContext,
) -> Option<Thingy>
pub fn verify_expression( &mut self, exp: &Rc<Expression>, context: &VerifierExpressionContext, ) -> Option<Thingy>
Verifies an expression. Returns None if verification failed.
§Panics
Panics if the verifier is already invalidated before verifying.