Struct ezno_parser::Module
source · pub struct Module {
pub items: Vec<StatementOrDeclaration>,
pub source: SourceId,
}
Fields§
§items: Vec<StatementOrDeclaration>
§source: SourceId
Implementations§
source§impl Module
impl Module
pub fn to_string_with_source_map( &self, settings: &ToStringOptions, fs: &impl FileSystem ) -> (String, SourceMap)
pub fn length(&self, settings: &ToStringOptions) -> usize
pub fn from_file( path: impl AsRef<Path>, settings: ParseOptions, cursors: Vec<(usize, EmptyCursorId)>, fs: &mut impl FileSystem ) -> Result<Self, FromFileError>
source§impl Module
impl Module
pub fn visit<TData>( &self, visitors: &mut (impl VisitorReceiver<TData> + ?Sized), data: &mut TData, settings: &VisitSettings )
pub fn visit_mut<TData>( &mut self, visitors: &mut (impl VisitorMutReceiver<TData> + ?Sized), data: &mut TData, settings: &VisitSettings )
Trait Implementations§
source§impl ASTNode for Module
impl ASTNode for Module
fn to_string_from_buffer<T: ToString>( &self, buf: &mut T, settings: &ToStringOptions, depth: u8 )
source§fn get_position(&self) -> Cow<'_, Span>
fn get_position(&self) -> Cow<'_, Span>
Returns position of node as span AS IT WAS PARSED. May be none if AST was doesn’t match anything in source
fn from_reader( reader: &mut impl TokenReader<TSXToken, Span>, state: &mut ParsingState, settings: &ParseOptions ) -> ParseResult<Self>
source§fn from_string(
source: String,
settings: ParseOptions,
source_id: SourceId,
offset: Option<usize>,
cursors: Vec<(usize, EmptyCursorId)>
) -> ParseResult<Self>
fn from_string( source: String, settings: ParseOptions, source_id: SourceId, offset: Option<usize>, cursors: Vec<(usize, EmptyCursorId)> ) -> ParseResult<Self>
From string, with default impl to call abstract method from_reader
source§fn to_string(&self, settings: &ToStringOptions) -> String
fn to_string(&self, settings: &ToStringOptions) -> String
Returns structure as valid string
source§impl<'a> From<&'a mut Module> for BlockLikeMut<'a>
impl<'a> From<&'a mut Module> for BlockLikeMut<'a>
Auto Trait Implementations§
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
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