pub struct Parser {
pub resolve_modules: bool,
pub tokens: Vec<Token>,
pub token_index: usize,
pub current_module: String,
pub previous: Option<Token>,
}Fields§
§resolve_modules: bool§tokens: Vec<Token>§token_index: usize§current_module: String§previous: Option<Token>Implementations§
Source§impl Parser
impl Parser
pub fn new() -> Self
pub fn set_current_module(&mut self, module_path: String)
pub fn advance(&mut self) -> Option<&Token>
pub fn peek_is(&self, expected: &str) -> bool
pub fn peek_nth(&self, n: usize) -> Option<&Token>
pub fn peek_nth_kind(&self, n: usize) -> Option<TokenKind>
pub fn advance_if(&mut self, kind: TokenKind) -> bool
pub fn match_token(&mut self, kind: TokenKind) -> bool
pub fn previous_clone(&self) -> Option<Token>
pub fn parse_block( &self, tokens: Vec<Token>, global_store: &mut GlobalStore, ) -> Vec<Statement>
pub fn parse_tokens( &mut self, tokens: Vec<Token>, global_store: &mut GlobalStore, ) -> Vec<Statement>
pub fn check_token(&self, kind: TokenKind) -> bool
pub fn peek_kind(&self) -> Option<TokenKind>
pub fn parse_map_value(&mut self) -> Option<Value>
pub fn parse_array_value(&mut self) -> Option<Value>
pub fn peek(&self) -> Option<&Token>
pub fn peek_clone(&self) -> Option<Token>
pub fn expect(&mut self, kind: TokenKind) -> Result<&Token, String>
pub fn collect_block_tokens(&mut self, base_indent: usize) -> Vec<Token>
pub fn collect_until<F>(&mut self, condition: F) -> Vec<Token>
pub fn is_eof(&self) -> bool
pub fn parse_block_until_next_else( &mut self, base_indent: usize, global_store: &mut GlobalStore, ) -> Vec<Statement>
pub fn parse_condition_until_colon(&mut self) -> Option<Value>
pub fn parse_block_until_else_or_dedent( &mut self, base_indent: usize, global_store: &mut GlobalStore, ) -> Vec<Statement>
Trait Implementations§
impl StructuralPartialEq for Parser
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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