mabragor/lol-re — pull request #2 by EuAndreh (2014-12-23 15:24:53+00:00)
Title: Merge perlre and lol-re

This pull request adds the syntax.lisp file, merging perlre and lol-re projects, fixing [#882](https://github.com/quicklisp/quicklisp-projects/issues/822) from quicklisp-projects.

A few chages were made to the original perlre project:
1. Instead of changing the readtable at load-time, it uses the [cl-syntax](https://github.com/m2ym/cl-syntax) library to handle the `*readtable*`;
2. A few arg names were chaged for a better name (in my opinion): `stm`, `strm` and alike changed to `stream`, etc.;
3. Changed from `lol:defmacro!` to `defmacro-enhance:defmacro!`: the former changes the readtable when loading and is less portable, while the latter is more widely used (even already being used by the lol-re library);
4. The decision between `#'REGEX-REPLACE` and `#'REGEX-REPLACE-ALL` was changed from run-time (inside the lambda form) to read-time;
5. The if match macro was completly reformulated: is used an eval to run all the real code at run-time. All the variables that one can want to group-capture ($1, $2, etc.) are decided at run-time: a regex for parsing regexes is used to find matching parentheses inside the regex. According to the amount of matches that are found, it binds that amount of (local) variables.

Still need to add some docstrings add tutorial in the README. I'll do it soonl