
Plex: a parser and lexer generator as a Rust syntax extension - luu
https://github.com/goffrie/plex
======
therobot24
Probably want to choose a better name seeing as plex.tv is pretty well known.
Or maybe it's named to be confusing, "I built Plex", i dunno

~~~
higherpurpose
Indeed, I thought the Plex guys started using Rust.

------
ghc
So, just to clarify...is this a port of the venerable Python lexer generator
called Plex?
[https://pypi.python.org/pypi/plex/](https://pypi.python.org/pypi/plex/)

------
JustSomeNobody
Not to be confused with the media server.

Come on, pick a better name.

------
valisystem
There's also rustlex [1] that have been around for a while and provides rust
stable v1.0 support through syntex [2]. I use it for a handlebars
implementation [3].

[1]
[https://github.com/LeoTestard/rustlex](https://github.com/LeoTestard/rustlex)

[2] [https://github.com/erickt/rust-syntex](https://github.com/erickt/rust-
syntex)

[3] [https://github.com/nicolas-cherel/rumblebars](https://github.com/nicolas-
cherel/rumblebars)

------
doomrobo
The C comment example seems more simply solved using non-greedy matching. Is
that not done because the parser absolutely does not support non-greedy (or
minimal-munch) matching?

~~~
profquail
The parsing of C-style comments is a sort of standard example to demonstrate
some additional features you have available when your lexer-generator is
implemented using regular expression derivatives.

See section 5 of "Regular Expression Derivatives, Re-examined" for details:
[http://www.mpi-sws.org/~turon/re-deriv.pdf](http://www.mpi-sws.org/~turon/re-
deriv.pdf)

------
detrino
Unless you are Greg Ewing, you should probably choose a new name.

------
McElroy
Rename it to parl

