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 simple lexer extension for Oracle SQL.
master
1 parent
997d905
commit
4f4692c81a4fce5a29ae0850d7736d023cc4d5c7
Nigel Stanger
authored
on 21 Mar 2018
Patch
Showing
1 changed file
minted/oracle.py
Ignore Space
Show notes
View
minted/oracle.py
0 → 100644
# -*- coding: utf-8 -*- """ Oracle SQL lexer ~~~~~~~~~~~ Pygments lexer for Oracle SQL. :copyright: Copyright 2012 Hugo Maia Vieira :license: BSD, see LICENSE for details. """ from pygments.lexers.sql import SqlLexer from pygments.token import Name, Keyword __all__ = ['OracleLexer'] class OracleLexer(SqlLexer): name = 'Oracle' aliases = ['oracle'] filenames = ['*.sql'] # just to have one if you whant to use EXTRA_KEYWORDS = ['partition', 'over', 'model', 'pivot', 'unpivot', 'rank', 'first_value', 'last_value', 'row_number', 'nulls', 'range', 'unbounded', 'preceding', 'following', 'nth_value', 'dense_rank', 'lag', 'lead', 'listagg', 'dimension'] 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