[racket] Question about parser-tools/lex

From: Danny Yoo (dyoo at hashcollision.org)
Date: Thu Oct 18 16:39:50 EDT 2012

>> There may be a more direct way to express this within the
>> parser-tools/lex library.  But since we have general power in each of
>> the lexer actions, we can do this too.
>> Hope this helps!
> Thanks a lot ! This works as expected.
> I feel ashamed, I did not even think about doing it this way.
> I was obstinately trying to express this using the lexer syntax, stupid me.

No problem!  The lexer library has always been a little weird to me,
so glad to help a fellow programmer wrangle it.  I don't think, for
example, that there's a direct way to express patterns that look-ahead
into the input port through the lexer patterns; that's why I put the
code in the action associated to the pattern.  Maybe there is a smart
way to do it, but I'm not feeling inspired at the moment.

Posted on the users mailing list.