mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
scanner: fix eof token position (#9432)
This commit is contained in:
parent
aa4e22c287
commit
b9cbb4f177
3
vlib/v/parser/tests/fn_decl_unexpected_eof.out
Normal file
3
vlib/v/parser/tests/fn_decl_unexpected_eof.out
Normal file
@ -0,0 +1,3 @@
|
||||
vlib/v/parser/tests/fn_decl_unexpected_eof.vv:1:12: error: unexpected eof, expecting `}`
|
||||
1 | fn main() {
|
||||
| ^
|
1
vlib/v/parser/tests/fn_decl_unexpected_eof.vv
Normal file
1
vlib/v/parser/tests/fn_decl_unexpected_eof.vv
Normal file
@ -0,0 +1 @@
|
||||
fn main() {
|
@ -191,7 +191,7 @@ fn (s &Scanner) new_eof_token() token.Token {
|
||||
kind: .eof
|
||||
lit: ''
|
||||
line_nr: s.line_nr + 1
|
||||
col: 1
|
||||
col: s.current_column()
|
||||
pos: s.pos
|
||||
len: 1
|
||||
tidx: s.tidx
|
||||
@ -576,7 +576,7 @@ pub fn (mut s Scanner) buffer_scan() token.Token {
|
||||
}
|
||||
return s.all_tokens[cidx]
|
||||
}
|
||||
return s.new_token(.eof, '', 1)
|
||||
return s.new_eof_token()
|
||||
}
|
||||
|
||||
[inline]
|
||||
|
Loading…
Reference in New Issue
Block a user