alex / rply

An attempt to port David Beazley's PLY to RPython, and give it a cooler API.
BSD 3-Clause "New" or "Revised" License
381 stars 60 forks source link

Added flags to LexerGenerator #38

Closed MarkusH closed 9 years ago

MarkusH commented 9 years ago

This commit allows specifying regex flags when adding new rules to a lexer generator, for both, token and ignore patterns

alex commented 9 years ago

Are all flags processed at regex compile time, or are they needed at evaluation time as well? (I'm thinking about the RPython specific regex paths)

alex commented 9 years ago

This probably needs a note somewhere in the docs, but assuming the flags are all handled at re.compile time, this patch looks great to me. Thanks!

alex commented 9 years ago

It looks like you do need to pass flags down through the RPython layer, let me know if there are any questions about that.

I believe the places you need to update are:

MarkusH commented 9 years ago

Hey @alex . I have absolutely no clue about RPython, but I'll try my best :)

alex commented 9 years ago

Can you add a note to the docs somewhere? After that, I can merge it, thanks!

MarkusH commented 9 years ago

Done. Thank you for your support.

alex commented 9 years ago

Thanks!