File tree 1 file changed +4
-2
lines changed
compiler/src/dotty/tools/dotc/parsing
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,7 @@ object JavaScanners {
439
439
}
440
440
oct.asInstanceOf [Char ]
441
441
end octal
442
+ var skip = false
442
443
def greatEscape : Char =
443
444
nextChar()
444
445
if '0' <= ch && ch <= '7' then octal
@@ -455,11 +456,12 @@ object JavaScanners {
455
456
case '\\ ' => '\\ '
456
457
case CR | LF if inTextBlock =>
457
458
if ! scanOnly then nextChar()
459
+ skip = true
458
460
0
459
461
case _ =>
460
462
if ! scanOnly then error(" invalid escape character" , charOffset - 1 )
461
463
ch
462
- if x != 0 then nextChar()
464
+ if ! skip then nextChar()
463
465
x
464
466
end greatEscape
465
467
@@ -470,7 +472,7 @@ object JavaScanners {
470
472
val res = ch
471
473
nextChar()
472
474
res
473
- if c != 0 && ! scanOnly then putChar(c)
475
+ if ! skip && ! scanOnly then putChar(c)
474
476
end getlitch
475
477
476
478
/** Read a triple-quote delimited text block, starting after the first three double quotes.
You can’t perform that action at this time.
0 commit comments