Open EliotVU opened 1 year ago
Weird, as far as UT2004 goes, the string is actually escaped:
SpecialChars(0)=(Plain="&",Coded="&")
SpecialChars(1)=(Plain="\"",Coded=""")
SpecialChars(2)=(Plain=" ",Coded=" ")
SpecialChars(3)=(Plain="<",Coded="<")
SpecialChars(4)=(Plain=">",Coded=">")
SpecialChars(5)=(Plain="©",Coded="©")
SpecialChars(6)=(Plain="™",Coded="™")
SpecialChars(7)=(Plain="®",Coded="®")
SpecialChars(8)=(Plain="'",Coded="'")
I had this happen in the following file, that does not seem to contain special characters: DeusExText.zip
I had this happen in the following file, that does not seem to contain special characters: DeusExText.zip
Did a quick check from interest - extension starts to work when you comment exec
directive line.
@Shtoyan or by appending function test();
after the exec line seems to work too, I suppose this is because ANTLR is then able to find an alternative rule to match :|
FYI: This is caused by the hacky-code in the ANTLR parser https://github.com/EliotVU/UnrealScript-Language-Service/blob/22b6fbb79476f374c2d7b7c5884cacb7bc1e946c/grammars/UCParser.g4#L12 https://github.com/EliotVU/UnrealScript-Language-Service/blob/22b6fbb79476f374c2d7b7c5884cacb7bc1e946c/grammars/UCParser.g4#L239
Unfortunately I have to admit I'm unable to fix this issue in a way that ANTLR would understand.
A proper solution to this #directive parsing would be to switch the lexer's channel when a statement directive has been detected, but ANTLR is incapable of this as far as I know.
No way to just ignore all #directives
during parsing/lexing?
Describe the bug
When the parser stumbles on special characters it will fail with the following error:
Appears to be caused by the following code, when an unescaped string literal is proceeded by an eventual hash character:
Screenshots
No response