Struct Parser

Source
pub struct Parser<'arena> { /* private fields */ }

Implementations§

Source§

impl<'arena> Parser<'arena>

Source

pub fn new( src: BumpVec<'arena, u8>, file: SourceFile, bump: &'arena Bump, ) -> Self

Source

pub fn from_str(src: &str, file: SourceFile, bump: &'arena Bump) -> Self

Source

pub fn apply_job_settings(&mut self, settings: JobSettings)

Source

pub fn register_plugin_macros(&mut self, names: &[impl AsRef<str>])

Source

pub fn provide_timestamps( &mut self, now: u64, input_modified_time: Option<u64>, reproducible_override: Option<u64>, )

Source

pub fn set_resolver(&mut self, resolver: Box<dyn IncludeResolver>)

Source

pub fn cell_parser( &mut self, src: BumpVec<'arena, u8>, offset: u32, ) -> Parser<'arena>

Source

pub fn parse(self) -> Result<ParseResult<'arena>, Vec<Diagnostic>>

Source§

impl<'arena> Parser<'arena>

Source

pub fn line_heading_level(&self, line: &Line<'_>) -> Option<u8>

Source

pub fn section_start_level( &self, lines: &ContiguousLines<'arena>, meta: &ChunkMeta<'arena>, ) -> Option<u8>

Source

pub fn adjust_leveloffset(leveloffset: &mut i8, value: &AttrValue)

Source§

impl<'arena> Parser<'arena>

Source

pub fn push_toc_node( &mut self, authored_level: u8, semantic_level: u8, heading: &InlineNodes<'arena>, as_ref: Option<&BumpString<'arena>>, special_sect: Option<SpecialSection>, )

Trait Implementations§

Source§

impl<'arena> From<Parser<'arena>> for ParseResult<'arena>

Source§

fn from(parser: Parser<'arena>) -> Self

Converts to this type from the input type.
Source§

impl<'arena> HasArena<'arena> for Parser<'arena>

Source§

fn bump(&self) -> &'arena Bump

Source§

fn token( &self, kind: TokenKind, lexeme: &str, loc: SourceLocation, ) -> Token<'arena>

Auto Trait Implementations§

§

impl<'arena> !Freeze for Parser<'arena>

§

impl<'arena> !RefUnwindSafe for Parser<'arena>

§

impl<'arena> !Send for Parser<'arena>

§

impl<'arena> !Sync for Parser<'arena>

§

impl<'arena> Unpin for Parser<'arena>

§

impl<'arena> !UnwindSafe for Parser<'arena>

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