mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.scanner: fix error messages with unexpected token ?
(#11428)
This commit is contained in:
parent
bee5e7de03
commit
79c2bca401
5
vlib/v/parser/tests/unexpected_token.out
Normal file
5
vlib/v/parser/tests/unexpected_token.out
Normal file
@ -0,0 +1,5 @@
|
||||
vlib/v/parser/tests/unexpected_token.vv:2:10: error: unexpected token `?`
|
||||
1 | fn main() {
|
||||
2 | println(?)
|
||||
| ^
|
||||
3 | }
|
3
vlib/v/parser/tests/unexpected_token.vv
Normal file
3
vlib/v/parser/tests/unexpected_token.vv
Normal file
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println(?)
|
||||
}
|
@ -771,7 +771,7 @@ fn (mut s Scanner) text_scan() token.Token {
|
||||
return s.new_token(.mod, '', 1)
|
||||
}
|
||||
`?` {
|
||||
return s.new_token(.question, '', 1)
|
||||
return s.new_token(.question, '?', 1)
|
||||
}
|
||||
scanner.single_quote, scanner.double_quote {
|
||||
start_line := s.line_nr
|
||||
|
Loading…
Reference in New Issue
Block a user