Before error type refactor

This commit is contained in:
2025-12-08 22:50:20 -07:00
parent 6afeec6da2
commit 115a57128c
6 changed files with 195 additions and 937 deletions

View File

@@ -8,6 +8,7 @@ quick-error = { workspace = true }
tokenizer = { path = "../tokenizer" }
helpers = { path = "../helpers" }
lsp-types = { workspace = true }
thiserror = "2"
[dev-dependencies]

View File

@@ -111,7 +111,7 @@ macro_rules! self_matches_current {
pub struct Parser<'a> {
tokenizer: TokenizerBuffer<'a>,
current_token: Option<Token>,
current_token: Option<Token<'a>>,
pub errors: Vec<Error>,
}
@@ -126,12 +126,11 @@ impl<'a> Parser<'a> {
/// Calculates a Span from a given Token reference.
fn token_to_span(t: &Token) -> Span {
let len = t.original_string.as_ref().map(|s| s.len()).unwrap_or(0);
Span {
start_line: t.line,
start_col: t.column,
start_col: t.span.start,
end_line: t.line,
end_col: t.column + len,
end_col: t.span.end,
}
}