summaryrefslogtreecommitdiffstats
path: root/mycli/lexer.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-08 11:28:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-08 11:28:14 +0000
commitb678a621c57a6d3fdfac14bdbbef0ed743ab1742 (patch)
tree5481c14ce75dfda9c55721de033992b45ab0e1dc /mycli/lexer.py
parentInitial commit. (diff)
downloadmycli-upstream/1.22.2.tar.xz
mycli-upstream/1.22.2.zip
Adding upstream version 1.22.2.upstream/1.22.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mycli/lexer.py')
-rw-r--r--mycli/lexer.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/mycli/lexer.py b/mycli/lexer.py
new file mode 100644
index 0000000..4b14d72
--- /dev/null
+++ b/mycli/lexer.py
@@ -0,0 +1,12 @@
+from pygments.lexer import inherit
+from pygments.lexers.sql import MySqlLexer
+from pygments.token import Keyword
+
+
+class MyCliLexer(MySqlLexer):
+ """Extends MySQL lexer to add keywords."""
+
+ tokens = {
+ 'root': [(r'\brepair\b', Keyword),
+ (r'\boffset\b', Keyword), inherit],
+ }