Sphinx ScyllaDB Theme 1.0 is now released 🥳
Learn more
Menu

Custom Lexers

Submodules

sphinx_scylladb_theme.lexers.cql module

CQL pygments lexer

Lexer for the Cassandra Query Language (CQL). This is heavily inspired from the pygments SQL lexer (and the Postgres one in particular) but adapted to CQL keywords and specificities.

class sphinx_scylladb_theme.lexers.cql.CQLLexer(**options)

Bases: pygments.lexer.RegexLexer

Lexer for the Cassandra Query Language.

aliases = ['cql']
filenames = ['*.cql']
flags = 2
get_tokens_unprocessed(text, *args)

Split text into (tokentype, text) pairs.

stack is the inital stack (default: ['root'])

mimetypes = ['text/x-cql']
name = 'Cassandra Query Language'
tokens = {'multiline-comments': [('/\\*', Token.Comment.Multiline, 'multiline-comments'), ('\\*/', Token.Comment.Multiline, '#pop'), ('[^/*]+', Token.Comment.Multiline), ('[/*]', Token.Comment.Multiline)], 'quoted-ident': [('[^"]+', Token.Literal.String.Name), ('""', Token.Literal.String.Name), ('"', Token.Literal.String.Name, '#pop')], 'root': [('\\s+', Token.Text), ('--.*\\n?', Token.Comment.Single), ('//.*\\n?', Token.Comment.Single), ('/\\*', Token.Comment.Multiline, 'multiline-comments'), ('(ASCII|BIGINT|BLOB|BOOLEAN|COUNTER|DATE|DECIMAL|DOUBLE|EMPTY|FLOAT|INET|INT|SMALLINT|TEXT|TIME|TIMESTAMP|TIMEUUID|TINYINT|UUID|VARCHAR|VARINT)\\b', Token.Name.Builtin), (<pygments.lexer.words object>, Token.Keyword), ('[+*/<>=~!@#%^&|`?-]+', Token.Operator), ('\\$\\d+', Token.Name.Variable), ('[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}', Token.Literal.Number), ('0x[0-9a-fA-F]+', Token.Literal.Number), ('([0-9]*\\.[0-9]*|[0-9]+)(e[+-]?[0-9]+)?', Token.Literal.Number.Float), ('[0-9]+', Token.Literal.Number.Integer), ("((?:E|U&)?)(')", <function bygroups.<locals>.callback>, 'string'), ('((?:U&)?)(")', <function bygroups.<locals>.callback>, 'quoted-ident'), ('(?s)(\\$)([^$]*)(\\$)(.*?)(\\$)(\\2)(\\$)', <function language_callback>), ('[a-z_]\\w*', Token.Name), ('[;:()\\[\\]{},.]', Token.Punctuation)], 'string': [("[^']+", Token.Literal.String.Single), ("''", Token.Literal.String.Single), ("'", Token.Literal.String.Single, '#pop')]}

sphinx_scylladb_theme.lexers.ditaa module

class sphinx_scylladb_theme.lexers.ditaa.DitaaLexer(**options)

Bases: pygments.lexers.shell.BashLexer

Module contents