From 032ea0f4f84a2d3bd14bcf6366344463a4455a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20D=C3=A4schle?= Date: Wed, 9 Dec 2020 20:09:07 +0100 Subject: [PATCH] scanner: fix silent mode string parsing (#7220) --- .github/workflows/ci.yml | 12 ++++++++++++ vlib/v/scanner/scanner.v | 1 + 2 files changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03a907b42e..24cbe2001f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -595,3 +595,15 @@ jobs: with: name: client wss path: ${{github.workspace}}/reports_wss/clients/index.html + + parser-silent-hello-world: + name: Parser silent mode - examples/hello_world.v + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + - name: Build local v + run: make -j4 + - name: Run test-parser + run: | + ./v test-parser examples/hello_world.v diff --git a/vlib/v/scanner/scanner.v b/vlib/v/scanner/scanner.v index 0316d417e3..acd3ca66c9 100644 --- a/vlib/v/scanner/scanner.v +++ b/vlib/v/scanner/scanner.v @@ -1020,6 +1020,7 @@ fn (mut s Scanner) ident_string() string { s.pos++ if s.pos >= s.text.len { s.error('unfinished string literal') + break } c := s.text[s.pos] prevc := s.text[s.pos - 1]