This commit is contained in:
2026-04-17 18:51:12 -04:00
parent 2f91e454dd
commit b3f77076d4
20 changed files with 244 additions and 192 deletions
+8 -6
View File
@@ -1,4 +1,6 @@
use super::{Lit, Span, Spanned};
use crate::parser::cursor::LitTy;
use super::{Span, Spanned};
use std::{iter::Peekable, str::CharIndices};
def_tokens! {
@@ -39,7 +41,7 @@ def_tokens! {
}
other {
Ident(String),
Lit(Lit),
Lit(LitTy),
}
}
@@ -128,7 +130,7 @@ impl Iterator for Tokens<'_> {
span.end = *i;
self.chars.next();
}
Lit::Number(s).into()
LitTy::Number(s).into()
}
'"' => {
let mut s = String::new();
@@ -138,7 +140,7 @@ impl Iterator for Tokens<'_> {
s.push(c);
span.end = i;
}
Lit::String(s).into()
LitTy::String(s).into()
}
_ => {
let mut s = c.to_string();
@@ -150,8 +152,8 @@ impl Iterator for Tokens<'_> {
self.chars.next();
}
match s.as_str() {
"true" => Lit::Bool(true).into(),
"false" => Lit::Bool(false).into(),
"true" => LitTy::Bool(true).into(),
"false" => LitTy::Bool(false).into(),
_ => from_str(s),
}
}