pub struct Tokenizer {
pub items: Vec<Token>,
/* private fields */
}Expand description
A tokenizer for Excel worksheet formulas.
Fields§
§items: Vec<Token>Implementations§
Source§impl Tokenizer
impl Tokenizer
Sourcepub fn new(formula: &str) -> Result<Self, TokenizerError>
pub fn new(formula: &str) -> Result<Self, TokenizerError>
Create a new tokenizer and immediately parse the formula.
Sourcepub fn new_best_effort(formula: &str) -> Self
pub fn new_best_effort(formula: &str) -> Self
Recover malformed syntax without returning a Result.
Check Self::admission_error before using output: resource rejection
produces empty output rather than a silently truncated formula.
Sourcepub fn new_best_effort_with_dialect(
formula: &str,
dialect: FormulaDialect,
) -> Self
pub fn new_best_effort_with_dialect( formula: &str, dialect: FormulaDialect, ) -> Self
Create a new tokenizer with best-effort parsing for the specified dialect.
Sourcepub fn new_with_dialect(
formula: &str,
dialect: FormulaDialect,
) -> Result<Self, TokenizerError>
pub fn new_with_dialect( formula: &str, dialect: FormulaDialect, ) -> Result<Self, TokenizerError>
Create a new tokenizer for the specified formula dialect.
pub fn from_token_stream(stream: &TokenStream) -> Self
Sourcepub fn admission_error(&self) -> Option<&TokenizerError>
pub fn admission_error(&self) -> Option<&TokenizerError>
Why an infallible best-effort/stream constructor could not admit input.
Sourcepub fn dialect(&self) -> FormulaDialect
pub fn dialect(&self) -> FormulaDialect
Return the dialect used when tokenizing this formula.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tokenizer
impl RefUnwindSafe for Tokenizer
impl Send for Tokenizer
impl Sync for Tokenizer
impl Unpin for Tokenizer
impl UnsafeUnpin for Tokenizer
impl UnwindSafe for Tokenizer
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