Skip to content

[Bug]: Parser breaks on documents with special characters #162

@EliotVU

Description

@EliotVU

Describe the bug

When the parser stumbles on special characters it will fail with the following error:

Processing pending document "file:///c%3A/.../Engine/Classes/PlaylistParserBase.uc":1, source:change.
Invalidating document "PlaylistParserBase".
building document PlaylistParserBase
PredictionMode SLL has failed, rolling back to LL.
An error was thrown while parsing document: "file:///c%3A/.../Engine/Classes/PlaylistParserBase.uc" Error: cannot consume EOF
    at UCTokenStream.consume (c:\Projecten\UnrealScriptLang\out\server.js:28905:19)
    at UCParser.skipLine (c:\Projecten\UnrealScriptLang\out\server.js:5417:25)
    at UCParser.directive (c:\Projecten\UnrealScriptLang\out\server.js:5544:22)
    at UCParser.member (c:\Projecten\UnrealScriptLang\out\server.js:5711:30)
    at UCParser.program (c:\Projecten\UnrealScriptLang\out\server.js:5581:42)
    at UCDocument.build (c:\Projecten\UnrealScriptLang\out\server.js:20658:34)
    at indexDocument (c:\Projecten\UnrealScriptLang\out\server.js:24237:18)
    at Object.next (c:\Projecten\UnrealScriptLang\out\server.js:26656:41)

Appears to be caused by the following code, when an unescaped string literal is proceeded by an eventual hash character:

     ...
     SpecialChars(1)=(Plain=""",Coded=""")
     ...
     SpecialChars(6)=(Plain="�",Coded="™")

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions