mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
scanner: add an error for unfinished string literals (#6519)
This commit is contained in:
parent
11b16a63cf
commit
0f1ed1ca09
2
vlib/v/checker/tests/unfinished_string.out
Normal file
2
vlib/v/checker/tests/unfinished_string.out
Normal file
@ -0,0 +1,2 @@
|
||||
vlib/v/checker/tests/unfinished_string.vv:2:1: error: unfinished string literal
|
||||
1 | a := '
|
1
vlib/v/checker/tests/unfinished_string.vv
Normal file
1
vlib/v/checker/tests/unfinished_string.vv
Normal file
@ -0,0 +1 @@
|
||||
a := '
|
@ -1193,7 +1193,7 @@ fn (mut s Scanner) ident_string() string {
|
||||
for {
|
||||
s.pos++
|
||||
if s.pos >= s.text.len {
|
||||
break
|
||||
s.error('unfinished string literal')
|
||||
}
|
||||
c := s.text[s.pos]
|
||||
prevc := s.text[s.pos - 1]
|
||||
|
Loading…
Reference in New Issue
Block a user