This is a lexer that is useful for templating languages, where the
surrounding text may be of a different syntax. eg. PHP+HTML
The PHP lexer has been changed accordingly.
Fixes#80
This was done to speed up incremental compilation when working on
lexers. That is, modifying a single lexer will no longer require
recompiling all lexers.
This is a (slightly) backwards breaking change in that lexers are no
longer exported directly in the lexers package. The registry API is
"aliased" at the old location.
This PR converts the simple string lexing in the mysql, sql, and
transactsql lexers to an expanded node, bringing their behavior inline
with the postgres lexer.
The rationale for this change is that currently, when using Chroma to
lex a partial SQL query with these three lexers (for example, while in
the middle of writing a database query), a string will not be matched by
the mysql, sql, and transactsql lexers until the closing single or
double-quote is encountered.
This behavior can be seen by running the following in a terminal:
$ echo "select 'aoeu 0x9" |chroma -l sql
$ echo "select 'aoeu 0x9'" |chroma -l sql
With the mysql, sql, and transactsql lexers, the above two lines will
have dramatically different output. Comparatively, if using the postgres
lexer instead of the sql lexer, the above will output both lines
identically (excluding the closing quote).
This change will make for a better and more consistent user experience
in any package using chroma to highlight partial, incomplete, or
incorrect SQL, and is arguably "more correct", as all SQL lexers will
now behave the same (at least with regards to single/double-quoted
strings or quoted identifiers).