Feat: optimizations

This commit is contained in:
2026-02-05 23:15:46 +01:00
parent 5a83c4c1d1
commit 53167e35b6
22 changed files with 175 additions and 215 deletions

View File

@@ -45,7 +45,7 @@ fn tokenize(input: &str) -> Vec<Token> {
}
s.push(ch);
}
tokens.push(Token::Str(s, SourceSpan { start, end }));
tokens.push(Token::Str(s, SourceSpan { start: start as u32, end: end as u32 }));
continue;
}
@@ -66,8 +66,8 @@ fn tokenize(input: &str) -> Vec<Token> {
tokens.push(Token::Word(
";".to_string(),
SourceSpan {
start: pos,
end: pos + 1,
start: pos as u32,
end: (pos + 1) as u32,
},
));
continue;
@@ -85,7 +85,7 @@ fn tokenize(input: &str) -> Vec<Token> {
chars.next();
}
let span = SourceSpan { start, end };
let span = SourceSpan { start: start as u32, end: end as u32 };
// Normalize shorthand float syntax: .25 -> 0.25, -.5 -> -0.5
let word_to_parse = if word.starts_with('.')