Skip to content

Commit 63ab523

Browse files
authored
Merge pull request ststeiger#296 from fishrdev/literalscanning
Ignore single backslash when scanning literal string
2 parents bc8f86d + d7f9a15 commit 63ab523

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

PdfSharpCore/Pdf.IO/Lexer.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,8 @@ public Symbol ScanLiteralString()
500500
{
501501
// Octal character code.
502502
if (ch >= '8')
503-
ParserDiagnostics.HandleUnexpectedCharacter(ch);
503+
break; // Since the first possible octal character is not valid,
504+
// the backslash is ignored.
504505

505506
int n = ch - '0';
506507
if (char.IsDigit(_nextChar)) // Second octal character.
@@ -521,12 +522,6 @@ public Symbol ScanLiteralString()
521522
}
522523
ch = (char)n;
523524
}
524-
else
525-
{
526-
//TODO
527-
// Debug.As sert(false, "Not implemented; unknown escape character.");
528-
ParserDiagnostics.HandleUnexpectedCharacter(ch);
529-
}
530525
break;
531526
}
532527
break;

0 commit comments

Comments
 (0)