Struct Analyzer

Source
pub struct Analyzer<'a> {
    pub shared: SharedState<'a>,
    /* private fields */
}

Fields§

§shared: SharedState<'a>

Implementations§

Source§

impl Analyzer<'_>

Source

pub fn convert_to_function_access_kind( function_ref: &FunctionRef, ) -> ExpressionKind

Source

pub fn lookup_associated_function( &self, ty: &Type, function_name: &str, ) -> Option<FunctionRef>

Source

pub fn convert_to_function_access_expr( &self, associated_function_info: &FunctionRef, ast_node: &Node, ) -> Expression

Source

pub fn analyze_range( &mut self, min_expr: &Expression, max_expr: &Expression, mode: &RangeMode, ast_node: &Node, ) -> Result<Expression, Error>

§Errors
Source§

impl Analyzer<'_>

Source§

impl Analyzer<'_>

Source

pub fn try_find_constant( &self, qualified_constant_identifier: &QualifiedConstantIdentifier, ) -> Option<&ConstantRef>

Source§

impl Analyzer<'_>

Source

pub fn analyze_alias_type_definition( &mut self, ast_alias: &AliasType, ) -> Result<AliasType, Error>

§Errors
Source

pub fn analyze_anonymous_struct_type( &mut self, ast_struct: &AnonymousStructType, ) -> Result<AnonymousStructType, Error>

§Errors
Source

pub fn analyze_anonymous_struct_type_fields( &mut self, ast_struct_fields: &[StructTypeField], ) -> Result<SeqMap<String, StructTypeField>, Error>

§Errors
Source

pub fn convert_to_type_variables( &mut self, ast_type_variables: &[TypeVariable], ) -> Vec<String>

Source

pub fn set_type_variables_to_extra_symbol_table( &mut self, type_variables: &[String], )

§Panics
Source

pub fn analyze_named_struct_type_definition( &mut self, ast_struct_def: &NamedStructDef, ) -> Result<(), Error>

§Errors
Source

pub fn debug_definition(&self, definition: &Definition)

Source

pub fn analyze_definition(&mut self, ast_def: &Definition) -> Result<(), Error>

§Errors
Source

pub fn analyze_impl_functions( &mut self, attach_to_type: Type, functions: &[&Function], ) -> Result<(), Error>

§Errors
Source§

impl Analyzer<'_>

Source

pub fn analyze_complex_literal_to_expression( &mut self, ast_node: &Node, ast_literal_kind: &LiteralKind, context: &TypeContext<'_>, ) -> Result<Expression, Error>

§Errors
Source

pub fn create_err(&self, kind: ErrorKind, ast_node: &Node) -> Error

Source

pub fn create_err_resolved( &self, kind: ErrorKind, resolved_node: &Node, ) -> Error

Source§

impl Analyzer<'_>

Source

pub fn analyze_anonymous_struct_literal( &mut self, node: &Node, ast_fields: &Vec<FieldExpression>, rest_was_specified: bool, context: &TypeContext<'_>, ) -> Result<Expression, Error>

§Errors
§Panics
Source§

impl Analyzer<'_>

Source

pub fn analyze_map_type( &mut self, ast_key_type: &Type, ast_value_type: &Type, ) -> Result<(Type, Type), Error>

§Errors
Source

pub fn analyze_slice_type(&mut self, ast_type: &Type) -> Result<Type, Error>

§Errors
Source

pub fn analyze_type(&mut self, ast_type: &Type) -> Result<Type, Error>

§Errors
Source§

impl<'a> Analyzer<'a>

Source

pub const fn scopes(&self) -> &FunctionScopeState

Source§

impl<'a> Analyzer<'a>

Source

pub fn new( state: &'a mut ProgramState, modules: &'a Modules, core_symbol_table: SymbolTableRef, source_map: &'a SourceMap, module_path: &[String], file_id: FileId, ) -> Self

Source

pub fn analyze_start_chain_expression_get_mutability( &mut self, ast_expression: &Expression, expected_type: Option<&Type>, ) -> Result<(Expression, bool), Error>

§Errors
Source

pub fn debug_expression(&self, expr: &Expression)

Source

pub fn analyze_main_expression( &mut self, ast_expression: &Expression, ) -> Result<InternalMainExpression, Error>

Source

pub fn analyze_expression( &mut self, ast_expression: &Expression, context: &TypeContext<'_>, ) -> Result<Expression, Error>

§Errors
Source

pub fn analyze_expression_internal( &mut self, ast_expression: &Expression, context: &TypeContext<'_>, ) -> Result<Expression, Error>

§Errors
Source

pub fn analyze_struct_field( &mut self, field_name: &Node, tv: Type, ) -> Result<(AnonymousStructType, usize, Type), Error>

§Panics
§Errors
Source

pub fn analyze_variable_assignment( &mut self, variable: &Variable, source_expression: &MutableOrImmutableExpression, ) -> Result<Expression, Error>

§Errors
Source

pub const fn create_expr( &self, kind: ExpressionKind, ty: Type, ast_node: &Node, ) -> Expression

Source

pub fn create_expr_resolved( &self, kind: ExpressionKind, ty: Type, ast_node: &Node, ) -> Expression

Auto Trait Implementations§

§

impl<'a> Freeze for Analyzer<'a>

§

impl<'a> RefUnwindSafe for Analyzer<'a>

§

impl<'a> !Send for Analyzer<'a>

§

impl<'a> !Sync for Analyzer<'a>

§

impl<'a> Unpin for Analyzer<'a>

§

impl<'a> !UnwindSafe for Analyzer<'a>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more