Skip to main content

LanguageAST

Enum LanguageAST 

Source
pub enum LanguageAST<'input> {
    Section {
        non_section_key_values: Vec<KeyValueAST<'input>>,
        sections: Vec<(SectionAST<'input>, Vec<KeyValueAST<'input>>, Range<usize>)>,
        span: Range<usize>,
    },
    Value {
        value: Option<ValueAST<'input>>,
    },
    Empty {
        span: Range<usize>,
    },
}

Variants§

§

Section

Fields

§non_section_key_values: Vec<KeyValueAST<'input>>
§sections: Vec<(SectionAST<'input>, Vec<KeyValueAST<'input>>, Range<usize>)>
§span: Range<usize>
§

Value

Fields

§value: Option<ValueAST<'input>>
§

Empty

Fields

§span: Range<usize>

Trait Implementations§

Source§

impl<'input> AST<'input> for LanguageAST<'input>

Source§

fn span(&self) -> Range<usize> ⓘ

UTF-8 byte span
Source§

fn take_value( &self, section_name_stack: &mut Vec<(Cow<'input, str>, Range<usize>, Range<usize>, bool), &Bump>, validator: &mut ValueTypeChecker<'_, '_, '_, 'input, 'input>, )

Source§

fn take_token(&self, tokens: &mut BTreeMap<usize, (ASTTokenKind, Range<usize>)>)

Source§

fn take_formatter_token_space(&self, tokens: &mut Vec<FormatterTokenInfo>)

Source§

impl<'input> Debug for LanguageAST<'input>

Source§

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

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

impl<'input> Parser<'input, LanguageAST<'input>> for LanguageParser

Source§

fn parse( &self, lexer: &mut GeneratorLexer<'input, '_>, errors: &mut Vec<GeneratedParseError>, ) -> Option<LanguageAST<'input>>
where Self: Sized,

Source§

fn first_token_kinds(&self) -> impl Iterator<Item = GeneratorTokenKind>

Source§

fn map_formatter_token_kind( &self, map: &mut HashMap<GeneratorTokenKind, FormatterTokenKind>, )

Source§

impl<'input> ParserGenerator<'input, LanguageAST<'input>, LanguageParser> for LanguageStyle

Auto Trait Implementations§

§

impl<'input> Freeze for LanguageAST<'input>

§

impl<'input> RefUnwindSafe for LanguageAST<'input>

§

impl<'input> Send for LanguageAST<'input>

§

impl<'input> Sync for LanguageAST<'input>

§

impl<'input> Unpin for LanguageAST<'input>

§

impl<'input> UnsafeUnpin for LanguageAST<'input>

§

impl<'input> UnwindSafe for LanguageAST<'input>

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.