diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24cbe2001f..7cad8a56ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -596,8 +596,8 @@ jobs: name: client wss path: ${{github.workspace}}/reports_wss/clients/index.html - parser-silent-hello-world: - name: Parser silent mode - examples/hello_world.v + parser-silent: + name: Parser silent mode runs-on: ubuntu-latest timeout-minutes: 30 steps: @@ -607,3 +607,4 @@ jobs: - name: Run test-parser run: | ./v test-parser examples/hello_world.v + ./v test-parser examples/hanoi.v diff --git a/vlib/v/scanner/scanner.v b/vlib/v/scanner/scanner.v index acd3ca66c9..9f6162b053 100644 --- a/vlib/v/scanner/scanner.v +++ b/vlib/v/scanner/scanner.v @@ -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