Lexer

Struct Lexer 

Source
pub struct Lexer { /* private fields */ }

Implementations§

Source§

impl Lexer

Source

pub fn new(block: Vec<Block>, init: bool) -> Self

Source

pub fn eob(&self) -> bool

Source

pub fn text(&self) -> String

Source

pub fn pos(&self) -> usize

Source

pub fn advance(&mut self) -> bool

Source

pub fn match_(&mut self, regexp: &str) -> Option<String>

Source

pub fn keyword(&mut self, regexp: &str) -> Option<String>

Source

pub fn error(&self, msg: &str) -> Result<()>

Source

pub fn eol(&mut self) -> bool

Source

pub fn expect_eol(&mut self) -> Result<()>

Source

pub fn expect_noblock(&mut self, stmt: &str) -> Result<()>

Source

pub fn expect_block(&mut self, stmt: &str) -> Result<()>

Source

pub fn subblock_lexer(&mut self, init: bool) -> Lexer

Source

pub fn string(&mut self) -> Option<String>

Source

pub fn integer(&mut self) -> Option<String>

Source

pub fn float(&mut self) -> Option<String>

Source

pub fn word(&mut self) -> Option<String>

Source

pub fn audio_filename(&mut self) -> Option<String>

Source

pub fn stop_arguments(&mut self) -> (Option<String>, Option<f32>)

Source

pub fn name(&mut self) -> Option<String>

Source

pub fn simple_expression(&mut self) -> Result<Option<String>>

Source

pub fn require(&mut self, thing: &str) -> Result<String>

Source

pub fn rest(&mut self) -> String

Source

pub fn get_location(&self) -> usize

Source

pub fn checkpoint(&self) -> LexerState

Source

pub fn revert(&mut self, state: LexerState)

Auto Trait Implementations§

§

impl Freeze for Lexer

§

impl RefUnwindSafe for Lexer

§

impl Send for Lexer

§

impl Sync for Lexer

§

impl Unpin for Lexer

§

impl UnwindSafe for Lexer

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.