We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50b73ab commit fdbd40dCopy full SHA for fdbd40d
1 file changed
vlib/v/scanner/scanner.v
@@ -605,7 +605,7 @@ pub fn (mut s Scanner) scan() token.Token {
605
[direct_array_access; inline]
606
pub fn (s &Scanner) peek_token(n int) token.Token {
607
idx := s.tidx + n
608
- if idx >= s.all_tokens.len {
+ if idx >= s.all_tokens.len || idx < 0 {
609
return s.new_eof_token()
610
}
611
t := s.all_tokens[idx]
0 commit comments