Skip to main content

Builder

Struct Builder 

Source
struct Builder<'ast> {
    symbols: Vec<Symbol>,
    occurrences: Vec<Occurrence>,
    scopes: Vec<HashMap<&'ast str, SymbolId>>,
    blocks: Vec<Span>,
}

Fields§

§symbols: Vec<Symbol>§occurrences: Vec<Occurrence>§scopes: Vec<HashMap<&'ast str, SymbolId>>

Innermost last. The first scope holds the top-level declarations.

§blocks: Vec<Span>

The blocks enclosing the statement being resolved, innermost last.

Implementations§

Source§

impl<'ast> Builder<'ast>

Source

fn declare_item(&mut self, item: &'ast Item) -> Declared

Source

fn declare_callable( &mut self, name: &'ast Ident, kind: SymbolKind, params: &[TypedName], body: &Block, ) -> Declared

Source

fn resolve_item(&mut self, item: &'ast Item, declared: &Declared)

Source

fn resolve_callable_body( &mut self, params: &'ast [TypedName], ids: &[SymbolId], body: &'ast Block, )

Source

fn resolve_block(&mut self, block: &'ast Block)

Source

fn resolve_stmt(&mut self, stmt: &'ast StmtKind)

Source

fn resolve_if(&mut self, if_stmt: &'ast IfStmt)

Source

fn resolve_expr(&mut self, expr: &'ast Expr)

Source

fn resolve_callee(&mut self, callee: &'ast Expr) -> Option<SymbolId>

Resolves what is being called, returning its symbol when it is declared in the file.

Source

fn resolve_args(&mut self, callee: Option<SymbolId>, args: &'ast [Arg])

Argument labels of a call to a declared struct, function or view refer to its fields or parameters.

Source

fn resolve_name( &mut self, name: &str, span: Span, name_use: NameUse, ) -> Option<SymbolId>

Source

fn resolve_type_annotation(&mut self, ty: Option<&TypeExpr>)

Source

fn resolve_type(&mut self, ty: &TypeExpr)

Source

fn lookup(&self, name: &str) -> Option<SymbolId>

Source

fn member(&self, parent: SymbolId, name: &str) -> Option<SymbolId>

Source

fn declare_global(&mut self, name: &'ast Ident, kind: SymbolKind) -> SymbolId

Declares a top-level name. When a name is declared twice, the first one wins.

Source

fn declare( &mut self, name: &Ident, kind: SymbolKind, parent: Option<SymbolId>, visibility: Visibility, ) -> SymbolId

Source

fn bind(&mut self, name: &'ast str, id: SymbolId)

Source

fn unresolved(&mut self, span: Span, kind: Unresolved)

Source

fn occur(&mut self, span: Span, role: Role)

Auto Trait Implementations§

§

impl<'ast> Freeze for Builder<'ast>

§

impl<'ast> RefUnwindSafe for Builder<'ast>

§

impl<'ast> Send for Builder<'ast>

§

impl<'ast> Sync for Builder<'ast>

§

impl<'ast> Unpin for Builder<'ast>

§

impl<'ast> UnsafeUnpin for Builder<'ast>

§

impl<'ast> UnwindSafe for Builder<'ast>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.