Commit Graph
6 Commits
Author SHA1 Message Date
Kenneth Shaw 48a2af1145 Update UsingByGroup documentation
Bringing into line the documentation with the changed API for
UsingByGroup.
2022-10-06 11:14:26 +11:00
Kenneth Shaw 7dbcddc70e Change Text token to TextWhitespace token in SQL lexers
For consistency with other lexers, convert the Text token on whitespace
to TextWhitespace.
2021-01-26 17:02:28 +11:00
Kenneth Shaw 95d0a9381b Fix Dollar-Quoted Strings (postgres + cql)
This commit refactors code from the markdown lexer into the chroma
package, and alters the PostgreSQL and CQL lexers to make use of it.

Additionally, an example markdown with the various sublexers is added.
2018-06-12 09:16:18 +07:00
Kenneth Shaw 2eb5cacd01 Add Cassandra CQL lexer
Adds a lexer (based off PostgreSQL) for Cassandra CQL support.
2018-06-09 07:42:49 +07:00
Kenneth Shaw 9401ea963f Expand single and double quote string lexing in mysql, sql, and transactsql lexers
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).
2017-11-24 13:44:34 +11:00
Kenneth Shaw edf15b0aff Fix order output of chroma cli tool
Changes output for the chroma cli tool for styles and formatters so that
the output on --list is always in the same order.
2017-10-10 03:39:58 +07:00