Skip to content

Commit 03d55b0

Browse files
committed
Provisional tweak
1 parent 450d233 commit 03d55b0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/parsing/JavaScanners.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ object JavaScanners {
439439
}
440440
oct.asInstanceOf[Char]
441441
end octal
442+
var skip = false
442443
def greatEscape: Char =
443444
nextChar()
444445
if '0' <= ch && ch <= '7' then octal
@@ -455,11 +456,12 @@ object JavaScanners {
455456
case '\\' => '\\'
456457
case CR | LF if inTextBlock =>
457458
if !scanOnly then nextChar()
459+
skip = true
458460
0
459461
case _ =>
460462
if !scanOnly then error("invalid escape character", charOffset - 1)
461463
ch
462-
if x != 0 then nextChar()
464+
if !skip then nextChar()
463465
x
464466
end greatEscape
465467

@@ -470,7 +472,7 @@ object JavaScanners {
470472
val res = ch
471473
nextChar()
472474
res
473-
if c != 0 && !scanOnly then putChar(c)
475+
if !skip && !scanOnly then putChar(c)
474476
end getlitch
475477

476478
/** Read a triple-quote delimited text block, starting after the first three double quotes.

0 commit comments

Comments
 (0)