pub struct Tokenizer<'a> { /* private fields */ }
Expand description
Tokenizer for an R program.
Transforms an R program into an array of language tokens.
Implementations§
Source§impl<'a> Tokenizer<'a>
impl<'a> Tokenizer<'a>
Sourcepub fn tokenize(&mut self) -> Vec<CommentedToken<'_>>
pub fn tokenize(&mut self) -> Vec<CommentedToken<'_>>
Returns an array of tokens.
§Examples
use tergo_tokenizer::tokenizer::Tokenizer;
let r_program = r#"
a <- 7
print(a + 1)
"#;
let mut tokenizer = Tokenizer::new(r_program);
let tokens = tokenizer.tokenize();
println!("{tokens:?}");
Auto Trait Implementations§
impl<'a> Freeze for Tokenizer<'a>
impl<'a> RefUnwindSafe for Tokenizer<'a>
impl<'a> Send for Tokenizer<'a>
impl<'a> Sync for Tokenizer<'a>
impl<'a> Unpin for Tokenizer<'a>
impl<'a> UnwindSafe for Tokenizer<'a>
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