| Summary: | [CommonTerminals] Make ID rule a JavaIdentifier | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Sven Efftinge <sven.efftinge> | ||||
| Component: | Xtext | Assignee: | Jan Koehnlein <jan> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | dennis.huebner, jan, sebastian.zarnekow | ||||
| Version: | 2.0.0 | Flags: | sven.efftinge:
indigo+
|
||||
| Target Milestone: | M5 | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Sven Efftinge
*** Bug 236892 has been marked as a duplicate of this bug. *** This didn't make it into M4. Preliminary scheduled for M5. Implemented for Xtype (and thereby for Xbase). I wouldn't like to do that for common terminals as it could infer some unexpected lexer ambiguities in client grammars, e.g. when they use '$' or some character above \u007f as a separators. Created attachment 186491 [details]
Sample JavaIdentifierIDValueConverter
Reverted, as this change made the guillemots (french quotes) of Xtend2 valid characters of an identifier, thus breaking the syntax.
This demonstrates that it's not such a good idea to have a tolerant lexer rule with a stricter value converter in a base language, as we cannot predict which kind of symbols inheriting languages are going to use.
Clients who need all allowed special characters in their identifiers and can rule out that there's a lexical conflict can still have them by overriding the ID rule themselves, e.g. as
terminal ID:
'^'?('a'..'z'|'A'..'Z'|'_'|'$'|'\u0080'..'\ufffd')
('a'..'z'|'A'..'Z'|'_'|'$'|'0'..'9'|'\u0080'..'\ufffd')*;
and binding an IDValueConverter that does the fine checking as the attached one.
See comment #4 Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |