Struct ezno_checker::synthesis::EznoParser

source ·
pub struct EznoParser;

Trait Implementations§

source§

impl ASTImplementation for EznoParser

§

type ParseOptions = ParseOptions

§

type ParseError = (ParseError, SourceId)

§

type ParserRequirements = ()

Custom allocator etc
§

type Module<'_a> = Module

§

type OwnedModule = Module

TODO temp item. Some modules can have references
§

type DefinitionFile<'_a> = Module

§

type TypeAnnotation<'_a> = TypeAnnotation

§

type TypeParameter<'_a> = TypeParameter

§

type Expression<'_a> = Expression

§

type Block<'_a> = Block

List of statements and declarations
§

type MultipleExpression<'_a> = MultipleExpression

§

type ClassMethod<'_a> = FunctionBase<ClassFunctionBase>

§

type VariableField<'_a> = VariableField

Used in for of, for in and function parameters
§

type ForStatementInitiliser<'_a> = ForLoopStatementinitialiser

source§

fn module_from_string( source_id: SourceId, string: String, options: Self::ParseOptions, _parser_requirements: &mut Self::ParserRequirements ) -> Result<Self::Module<'static>, Self::ParseError>

source§

fn definition_module_from_string( source_id: SourceId, string: String, _parser_requirements: &mut Self::ParserRequirements ) -> Result<Self::DefinitionFile<'static>, Self::ParseError>

source§

fn synthesise_module<T: ReadFromFS>( module: &Self::Module<'_>, _source_id: SourceId, module_environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, Self> )

source§

fn synthesise_definition_file<T: ReadFromFS>( file: Self::DefinitionFile<'_>, source: SourceId, root: &RootContext, checking_data: &mut CheckingData<'_, T, Self> ) -> (Names, LocalInformation)

source§

fn synthesise_expression<U: ReadFromFS>( expression: &Self::Expression<'_>, expecting: TypeId, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, U, Self> ) -> TypeId

Expected is used for eagerly setting function parameters
source§

fn expression_position<'_a>(expression: &'_a Self::Expression<'_a>) -> Span

source§

fn type_parameter_name<'_a>( parameter: &'_a Self::TypeParameter<'_a> ) -> &'_a str

source§

fn type_annotation_position<'_a>( annotation: &'_a Self::TypeAnnotation<'_a> ) -> Span

source§

fn synthesise_type_annotation<T: ReadFromFS>( annotation: &Self::TypeAnnotation<'_>, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, Self> ) -> TypeId

source§

fn parse_options( is_js: bool, parse_comments: bool, lsp_mode: bool ) -> Self::ParseOptions

source§

fn owned_module_from_module(m: Self::Module<'static>) -> Self::OwnedModule

source§

fn synthesise_multiple_expression<'_a, T: ReadFromFS>( expression: &'_a Self::MultipleExpression<'_a>, expected_type: TypeId, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, Self> ) -> TypeId

Expected is used for eagerly setting function parameters
source§

fn synthesise_for_loop_initialiser<'_a, T: ReadFromFS>( for_loop_initialiser: &'_a Self::ForStatementInitiliser<'_a>, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, Self> )

Don’t need to return anything. All information recorded via changed to environment
source§

fn declare_and_assign_to_fields<'a, T: ReadFromFS>( field: &'a Self::VariableField<'a>, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, Self>, arguments: VariableRegisterArguments )

For for in and for of loops
source§

fn parameter_constrained<'a>(parameter: &'a Self::TypeParameter<'a>) -> bool

source§

fn synthesise_block<'a, T: ReadFromFS>( block: &'a Self::Block<'a>, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, Self> )

source§

impl<U: FunctionBased + 'static> SynthesisableFunction<EznoParser> for FunctionBase<U>
where U::Body: SynthesisableFunctionBody,

source§

fn get_position(&self) -> Span

For debugging only
source§

fn get_name(&self) -> Option<&str>

For debugging only
source§

fn has_body(&self) -> bool

source§

fn type_parameters<T: ReadFromFS>( &self, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, EznoParser> ) -> Option<GenericTypeParameters>

THIS FUNCTION IS EXPECTED TO PUT THE TYPE PARAMETERS INTO THE ENVIRONMENT WHILE SYNTHESISING THEM
source§

fn this_constraint<T: ReadFromFS>( &self, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, EznoParser> ) -> Option<TypeId>

source§

fn super_constraint<T: ReadFromFS>( &self, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, EznoParser> ) -> Option<TypeId>

For object literals
source§

fn parameters<T: ReadFromFS>( &self, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, EznoParser>, expected_parameters: Option<&SynthesisedParameters> ) -> SynthesisedParameters

THIS FUNCTION IS EXPECTED TO PUT THE PARAMETERS INTO THE ENVIRONMENT WHILE SYNTHESISING THEM
source§

fn return_type_annotation<T: ReadFromFS>( &self, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, EznoParser> ) -> Option<ReturnType>

source§

fn body<T: ReadFromFS>( &self, environment: &mut Environment<'_>, checking_data: &mut CheckingData<'_, T, EznoParser> )

Returned type is extracted from events, thus doesn’t expect anything in return
source§

fn id(&self, source_id: SourceId) -> FunctionId

Auto Trait Implementations§

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

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

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

§

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>,

§

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.