mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
scanner: fix when string literal ends after } (#7237)
This commit is contained in:
@@ -719,7 +719,11 @@ fn (mut s Scanner) text_scan() token.Token {
|
||||
// s = `hello $name !`
|
||||
// s = `hello ${name} !`
|
||||
if s.is_enclosed_inter {
|
||||
s.pos++
|
||||
if s.pos < s.text.len - 1 {
|
||||
s.pos++
|
||||
} else {
|
||||
s.error('unfinished string literal')
|
||||
}
|
||||
if s.text[s.pos] == s.quote {
|
||||
s.is_inside_string = false
|
||||
s.is_enclosed_inter = false
|
||||
|
||||
Reference in New Issue
Block a user