pub enum IdentExpr<'a> {
Unresolved(&'a str),
Local(Handle<Local>),
}Expand description
An identifier that resolves to some declaration.
This does not cover context-dependent names: attributes, built-in values, and so on. We map those to their Naga IR equivalents as soon as they’re parsed, so they never need to appear as identifiers in the AST.
Variants§
Unresolved(&'a str)
An identifier referring to a module-scope declaration or predeclared object.
We need to collect the entire module before we can resolve this, to distinguish between predeclared objects and module-scope declarations that appear after their uses.
Whenever you create one of these values, you almost certainly want to
insert the &str into ExpressionContext::unresolved, to ensure
that indexing knows that the name’s declaration must be lowered before
the one containing this use. Using Parser::ident_expr to build
IdentExpr will take care of that for you.
Local(Handle<Local>)
An identifier that has been resolved to a non-module-scope declaration.