dsl: add Str token
Some checks are pending
/ build (push) Waiting to run

This commit is contained in:
🪞👃🪞 2025-05-02 19:16:28 +03:00
parent 2b208e3c49
commit 0d4ba4a54e
3 changed files with 43 additions and 25 deletions

View file

@ -35,6 +35,7 @@ use crate::*;
Num(usize),
Sym(&'a str),
Key(&'a str),
Str(&'a str),
Exp(usize, TokenIter<'a>),
}
@ -80,6 +81,11 @@ impl<'a> Token<'a> {
token.value = Sym(token.slice_source(self.source));
token
}
pub const fn grow_str (self) -> Self {
let mut token = self.grow();
token.value = Str(token.slice_source(self.source));
token
}
pub const fn grow_exp (self) -> Self {
let mut token = self.grow();
if let Exp(depth, _) = token.value {