GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
LaTeX
Browse code
Added OrientDB SQL lexer
master
1 parent
73d4d2c
commit
65cc0d8980dfbcbf3193878a5f11035fd7d06602
Nigel Stanger
authored
on 27 Aug 2020
Patch
Showing
1 changed file
minted/orientdb.py
Ignore Space
Show notes
View
minted/orientdb.py
0 → 100644
# -*- coding: utf-8 -*- """ OrientDB SQL lexer ~~~~~~~~~~~ Pygments lexer for OrientDB SQL. """ from pygments.lexers.sql import SqlLexer from pygments.token import Name, Keyword __all__ = ['OrientDBLexer'] class OrientDBLexer(SqlLexer): name = 'OrientDB' aliases = ['orientdb'] filenames = ['*.sql'] # just to have one if you whant to use EXTRA_KEYWORDS = ['property', 'extends', 'link', 'mandatory', 'edge', 'to', 'traverse', 'unwind', 'inE'] def get_tokens_unprocessed(self, text): for index, token, value in SqlLexer.get_tokens_unprocessed(self, text): if token is Name and value in self.EXTRA_KEYWORDS: yield index, Keyword, value else: yield index, token, value
Show line notes below