mirror of
https://github.com/MorizzG/rlox.git
synced 2025-12-06 04:12:42 +00:00
fixed off by one
This commit is contained in:
parent
8c7d55b842
commit
d040d92052
1 changed files with 2 additions and 2 deletions
|
|
@ -80,7 +80,7 @@ impl Display for LoxError {
|
|||
writeln!(f, "{len} lexer error{}:", plural(len))?;
|
||||
|
||||
if len > 1 {
|
||||
for lexer_error in lexer_errors[..len - 2].iter() {
|
||||
for lexer_error in lexer_errors[..len - 1].iter() {
|
||||
writeln!(f, "{lexer_error}")?;
|
||||
}
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ impl Display for LoxError {
|
|||
writeln!(f, "{len} parser error{}:", plural(len))?;
|
||||
|
||||
if len > 1 {
|
||||
for lexer_error in parser_errors[..len - 2].iter() {
|
||||
for lexer_error in parser_errors[..len - 1].iter() {
|
||||
writeln!(f, "{lexer_error}")?;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue