scanner: fix eof token position (#9432)
parent
aa4e22c287
commit
b9cbb4f177
|
@ -0,0 +1,3 @@
|
||||||
|
vlib/v/parser/tests/fn_decl_unexpected_eof.vv:1:12: error: unexpected eof, expecting `}`
|
||||||
|
1 | fn main() {
|
||||||
|
| ^
|
|
@ -0,0 +1 @@
|
||||||
|
fn main() {
|
|
@ -191,7 +191,7 @@ fn (s &Scanner) new_eof_token() token.Token {
|
||||||
kind: .eof
|
kind: .eof
|
||||||
lit: ''
|
lit: ''
|
||||||
line_nr: s.line_nr + 1
|
line_nr: s.line_nr + 1
|
||||||
col: 1
|
col: s.current_column()
|
||||||
pos: s.pos
|
pos: s.pos
|
||||||
len: 1
|
len: 1
|
||||||
tidx: s.tidx
|
tidx: s.tidx
|
||||||
|
@ -576,7 +576,7 @@ pub fn (mut s Scanner) buffer_scan() token.Token {
|
||||||
}
|
}
|
||||||
return s.all_tokens[cidx]
|
return s.all_tokens[cidx]
|
||||||
}
|
}
|
||||||
return s.new_token(.eof, '', 1)
|
return s.new_eof_token()
|
||||||
}
|
}
|
||||||
|
|
||||||
[inline]
|
[inline]
|
||||||
|
|
Loading…
Reference in New Issue