Extended Objective-C grammar to accept Unicode characters in identifiers.

This commit is contained in:
Jan van Nunen
2015-09-11 15:04:52 +02:00
parent 933002de34
commit aa87701ee5
3 changed files with 54 additions and 2 deletions

View File

@ -548,9 +548,19 @@ TOKEN : { <EXPORTED_CALLBACK : "EXPORTED_CALLBACK"> }
TOKEN :
{
< IDENT : <IDENT_NONDIGIT> ( <IDENT_NONDIGIT> | <DIGIT>)* >
< IDENT : <IDENT_NONDIGIT> ( <IDENT_NONDIGIT> | <DIGIT>)* >
| <#IDENT_NONDIGIT : <NONDIGIT> | <UNIVERSAL_CHARACTER_NAME> > // "may include other implementation-defined characters"
| <#NONDIGIT : ["a"-"z"] | ["A"-"Z"] | "_" | "$" >
| <#NONDIGIT : ["a"-"z"] | ["A"-"Z"] | "_" | "$" | <NONDIGIT_UNICODE> >
| <#NONDIGIT_UNICODE : [ /* source: http://stackoverflow.com/questions/30933785 */
"\u0024",
"\u0041"-"\u005a",
"\u005f",
"\u0061"-"\u007a",
"\u00c0"-"\u00d6",
"\u00d8"-"\u00f6",
"\u00f8"-"\u00ff",
"\u0100"-"\u1fff"
] >
| <#UNIVERSAL_CHARACTER_NAME : ("\\u" <HEX_QUAD>) | ("\\U" <HEX_QUAD> <HEX_QUAD>) >
}