work
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user