-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escape quotes #1871
Comments
It's a warning, not error. Just remove useless escape literal: |
antlr4.7 has the same error, remove backslash fail too. |
the 2 issues are unrelated
the UUID error is cause by incompatible tool and runtime version
use the latest tool and runtime from pypi
… Le 15 mai 2017 à 21:14, Kalle Rutanen ***@***.***> a écrit :
The following worked in version 4.5.3, but not in 4.7:
grammar SymbolStructure;
document : '\"';
The error is invalid escape sequence. If I remove the backslash, then the grammar builds.
I have a larger grammar which uses an escaped quote. Removing the backslash leads ANTLR to fail at runtime to
File "...\site-packages\antlr4\atn\ATNDeserializer.py", line 118, in checkUUID
" (expected " + str(SERIALIZED_UUID) + " or a legacy UUID).", uuid, SERIALIZED_UUID)
Exception: ('Could not deserialize ATN with UUID: 59627784-3be5-417a-b9eb-8131a7286089 (expected
aadb8d7e-aeef-4415-ad2b-8204d6cf042e or a legacy UUID).', UUID('59627784-3be5-417a-b9eb-
8131a7286089'), UUID('aadb8d7e-aeef-4415-ad2b-8204d6cf042e'))
The same grammar builds and runs fine with 4.5.3.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#1871>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ADLYJHh5fg-2p_-jivKP3L4j-RS_RyKvks5r6E_BgaJpZM4NbHc1>.
|
I got the warning too: fragment ESC : '\\' ([\'\\/bfnrt] | UNICODE) ;
String : '\'' (ESC | ~[\'\\])* '\''; What is wrong here? |
Remove escaping for single quotes: |
@parrt I believe this can be closed. The "invalid escape sequence" warning is fixed by removing unnecessary backslashes, and the UUID error at runtime is resolved by using the same (matching) version of the ANTLR tool and runtime library. |
The following worked in version 4.5.3, but not in 4.7:
The error is
invalid escape sequence
. If I remove the backslash, then the grammar builds.I have a larger grammar which uses an escaped quote. Removing the backslash leads ANTLR to fail at runtime to
The same grammar builds and runs fine with 4.5.3.
The text was updated successfully, but these errors were encountered: