Re: [code] Lexer creation problem.

From: Mitchell <>
Date: Sat, 7 Nov 2015 11:49:02 -0500 (EST)

Hi Michael,

On Sat, 7 Nov 2015, Michael Richter wrote:

> Is there any way to have a pattern that highlights two different parts and
> ignores boilerplate? Maybe some trick with grammars and captures? I'm not
> sure what the relationship between LPeg and the lexers is just yet.
> As an example of what I mean:
> In the string " :S(LABEL1)F(LABEL2)\n" I want LABEL1 and LABEL2
> highlighted, but not ":S(", ")F(", or ")".

Lexers start lexing at the beginning of a line, so you should be able to
use something like:

   ':S(' * token(l.KEYWORD, 'LABEL1') *
     ')F(' * token(l.KEYWORD, 'LABEL2') * ')'


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Sat 07 Nov 2015 - 11:49:02 EST

This archive was generated by hypermail 2.2.0 : Sun 08 Nov 2015 - 06:27:34 EST