scanner: fix when string literal ends after } (#7237)
parent
f6a2dba7ff
commit
8b3ffb9be2
|
@ -596,8 +596,8 @@ jobs:
|
||||||
name: client wss
|
name: client wss
|
||||||
path: ${{github.workspace}}/reports_wss/clients/index.html
|
path: ${{github.workspace}}/reports_wss/clients/index.html
|
||||||
|
|
||||||
parser-silent-hello-world:
|
parser-silent:
|
||||||
name: Parser silent mode - examples/hello_world.v
|
name: Parser silent mode
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
|
@ -607,3 +607,4 @@ jobs:
|
||||||
- name: Run test-parser
|
- name: Run test-parser
|
||||||
run: |
|
run: |
|
||||||
./v test-parser examples/hello_world.v
|
./v test-parser examples/hello_world.v
|
||||||
|
./v test-parser examples/hanoi.v
|
||||||
|
|
|
@ -719,7 +719,11 @@ fn (mut s Scanner) text_scan() token.Token {
|
||||||
// s = `hello $name !`
|
// s = `hello $name !`
|
||||||
// s = `hello ${name} !`
|
// s = `hello ${name} !`
|
||||||
if s.is_enclosed_inter {
|
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 {
|
if s.text[s.pos] == s.quote {
|
||||||
s.is_inside_string = false
|
s.is_inside_string = false
|
||||||
s.is_enclosed_inter = false
|
s.is_enclosed_inter = false
|
||||||
|
|
Loading…
Reference in New Issue