Merge pull request #524 from hkrutzer/fix-underflow

fix: Integer underflow in lexer error message formatting
This commit is contained in:
Anand Krishnamoorthi
2025-12-15 14:37:11 -06:00
committed by GitHub
2 changed files with 11 additions and 2 deletions

View File

@@ -203,7 +203,7 @@ impl Source {
let line_str = format!("{line}");
let line_num_width = line_str.len() + 1;
let col_spaces = col as usize - 1;
let col_spaces = (col as usize).saturating_sub(1);
format!(
"\n--> {}:{}:{}\n{:<line_num_width$}|\n\

View File

@@ -75,4 +75,13 @@ cases:
}
query: data.test
error: expects numeric argument.
- note: multiline-member-access-should-error
data: {}
modules:
- |
package test
output := regex.
match("^a", "b")
query: data.test
error: invalid whitespace between . and identifier