Community
Participate
Working Groups
Comments look better when distinctively colored in an editor. LPG provides support for this, provided the comments are parsed as adjuncts (an auxiliary style of token adjoining real tokens). OCLLexer.g suppresses this support by invoking skipToken() for parsed comments. The attached patch creates adjuncts for comments allowing any tool that exploits the parser stream representation to locate the comments as Adjunct objects. Impact: no functional change to existing use, a small execution time/memory cost proportionate to usage with comments. Existing small snippet usage is unlikely to use comments at all. Full scale document usage may welcome comments and should not find the cost significant. Derived applications can use a derived OCLLexer that reimplements makeComment as skipToken.
Created attachment 144624 [details] Patch to support comment lexing Another try at attaching the patch.
Simple and useful change for the editor, why no +1ing ? ;P Cheers, Adolfo.
'cause I didn't see this one ^^ +1 :)
Ed, One more thing, shouldn't the generated Lexer's classes also be included ?. Cheers, Adolfo.
The patch is so trivial, it's probably easier to deliver it with bug 242153.
Committed to HEAD.
Closing after over 18 months in resolved state.