Source

Enum Source 

Source
pub enum Source {
    Program(Program),
    Library(Library),
}
Expand description

This structure is used to represent parsing arbitrary AirScript files which may or may not contain a root module.

All of the details described in the documentation for Program and Library apply to their respective variants here.

Variants§

§

Program(Program)

The source code which was parsed produced a valid Program, i.e. it contained a root module, and optionally, one or more library modules.

§

Library(Library)

The source code which was parsed did not contain a root module, and so does not constitute a valid Program on its own. However, we were still able to produce a library of modules, which can be combined with a root module to produce a Program later.

Trait Implementations§

Source§

impl Debug for Source

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Parse for Source

Source§

type Parser = SourceParser

The concrete type of the parser implementation Read more
Source§

type Error = ParseError

The concrete type of errors which are produced by the parser Read more
Source§

type Config = ()

The concrete type representing the parser configuration. Read more
Source§

type Token = Result<(SourceIndex, Token, SourceIndex), ParseError>

The concrete type of the lexical token consumed by the parser Read more
Source§

fn root_file_error(source: Error, path: PathBuf) -> Self::Error

Constructs an instance of Self::Error when a [std:::io::Error] is raised Read more
Source§

fn parse<S>( parser: &Parser, diagnostics: &DiagnosticsHandler, source: S, ) -> Result<Self, Self::Error>
where S: Source,

Parses a [T] from the given Source. Read more
Source§

fn parse_tokens<S: IntoIterator<Item = Result<(SourceIndex, Token, SourceIndex), ParseError>>>( diagnostics: &DiagnosticsHandler, codemap: Arc<CodeMap>, tokens: S, ) -> Result<Self, Self::Error>

Parses a [T] from the given token stream. Read more

Auto Trait Implementations§

§

impl Freeze for Source

§

impl RefUnwindSafe for Source

§

impl Send for Source

§

impl Sync for Source

§

impl Unpin for Source

§

impl UnwindSafe for Source

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

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.