mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
scanner: fix nested multiline comments (#17859)
This commit is contained in:
parent
88de0decf6
commit
33ba24e933
@ -1071,7 +1071,7 @@ fn (mut s Scanner) text_scan() token.Token {
|
||||
s.inc_line_number()
|
||||
continue
|
||||
}
|
||||
if s.expect('/*', s.pos) {
|
||||
if s.expect('/*', s.pos) && s.text[s.pos + 2] != `/` {
|
||||
nest_count++
|
||||
continue
|
||||
}
|
||||
|
@ -1,5 +1,19 @@
|
||||
fn test_nested_multiline_comments() {
|
||||
fn test_nested_multiline_comments_1() {
|
||||
/*//println(os.args)
|
||||
*/
|
||||
assert true
|
||||
}
|
||||
|
||||
fn test_nested_multiline_comments_2() {
|
||||
tt()
|
||||
assert true
|
||||
}
|
||||
|
||||
/*
|
||||
fn tt() {
|
||||
}
|
||||
//*/
|
||||
|
||||
fn tt() {
|
||||
println('hello, world')
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user