mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
fix: Integer underflow in lexer error message formatting
This commit is contained in:
@@ -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\
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user