simpl-dev / simpl

Tool for creating domain-specific languages
http://research.cyber.ee/simpl/
5 stars 0 forks source link

Simple terminal rules as keywords #5

Closed Rots closed 13 years ago

Rots commented 13 years ago

with the following rule, the literal 'END' should be recognized as a keyword (and colored accordingly):

terminal End: 'END';

Rots commented 13 years ago

It should also recognize keywords in rules like: terminal Bool : 'BOOL' | 'BOOLEAN';

margusf commented 13 years ago

The option rules pose a little problem. Currently keywords are string constants that are composed of characters. So, does the next rule represent keyword?

terminal Bool : 'BOOL' | '+++';

The "keywordness" can only be determined with granularity of the rule.

For simple rules, this is doable.

margusf commented 13 years ago

Fixed in bebd40c38cbdd032b738914faa4bcbe6c3d0aff5. Currently only works for simple rules where the terminal rule only contains one string literal.

terminal End: 'END';

More complex rules require quite complicated heuristics (and changes to Simpl internals).

margusf commented 13 years ago

Fix released as 1.1.2

Rots commented 13 years ago

works with simple rules