pub enum Source {
Program(Program),
Library(Library),
}Expand description
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)
Trait Implementations§
Source§impl Parse for Source
impl Parse for Source
Source§type Error = ParseError
type Error = ParseError
The concrete type of errors which are produced by the parser Read more
Source§type Token = Result<(SourceIndex, Token, SourceIndex), ParseError>
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
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,
fn parse<S>(
parser: &Parser,
diagnostics: &DiagnosticsHandler,
source: S,
) -> Result<Self, Self::Error>where
S: Source,
Source§fn parse_tokens<S: IntoIterator<Item = Result<(SourceIndex, Token, SourceIndex), ParseError>>>(
diagnostics: &DiagnosticsHandler,
codemap: Arc<CodeMap>,
tokens: S,
) -> Result<Self, Self::Error>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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