##// END OF EJS Templates
fix some tests
fix some tests

File last commit:

r8620:66b7dfea
r8622:0ea9ae00
Show More
lexers.py
22 lines | 904 B | text/x-python | PythonLexer
MinRK
add IPython lexer for pygments
r7912 #-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from pygments.lexers import PythonLexer, BashLexer
from pygments.lexer import bygroups, using
from pygments.token import Keyword, Operator, Name, Text
#-----------------------------------------------------------------------------
# Classes
#-----------------------------------------------------------------------------
class IPythonLexer(PythonLexer):
name = 'IPython'
aliases = ['ip', 'ipython']
filenames = ['*.ipy']
tokens = PythonLexer.tokens.copy()
tokens['root'] = [
(r'(\%+)(\w+)\s+(\.*)(\n)', bygroups(Operator, Keyword, using(BashLexer), Text)),
(r'(\%+)(\w+)\b', bygroups(Operator, Keyword)),
(r'^(!)(.+)(\n)', bygroups(Operator, using(BashLexer), Text)),
] + tokens['root']