mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
33ba24e933
commit
a9bb6865fd
@ -1063,9 +1063,9 @@ fn (mut s Scanner) text_scan() token.Token {
|
||||
// Skip comment
|
||||
for nest_count > 0 && s.pos < s.text.len - 1 {
|
||||
s.pos++
|
||||
if s.pos >= s.text.len {
|
||||
s.line_nr--
|
||||
s.error('comment not terminated')
|
||||
if s.pos >= s.text.len - 1 {
|
||||
s.line_nr = start_line
|
||||
s.error('unterminated multiline comment')
|
||||
}
|
||||
if s.text[s.pos] == scanner.b_lf {
|
||||
s.inc_line_number()
|
||||
|
7
vlib/v/scanner/tests/comments_not_terminated_err.out
Normal file
7
vlib/v/scanner/tests/comments_not_terminated_err.out
Normal file
@ -0,0 +1,7 @@
|
||||
vlib/v/scanner/tests/comments_not_terminated_err.vv:5:2: error: unterminated multiline comment
|
||||
3 | }
|
||||
4 |
|
||||
5 | /*
|
||||
| ^
|
||||
6 | fn tt() {
|
||||
7 | }
|
7
vlib/v/scanner/tests/comments_not_terminated_err.vv
Normal file
7
vlib/v/scanner/tests/comments_not_terminated_err.vv
Normal file
@ -0,0 +1,7 @@
|
||||
fn main() {
|
||||
println('hello, world')
|
||||
}
|
||||
|
||||
/*
|
||||
fn tt() {
|
||||
}
|
Loading…
Reference in New Issue
Block a user