38
34
'MakoHtmlLexer', 'MakoXmlLexer', 'MakoJavascriptLexer',
39
35
'MakoCssLexer', 'JspLexer', 'CheetahLexer', 'CheetahHtmlLexer',
40
36
'CheetahXmlLexer', 'CheetahJavascriptLexer',
41
'EvoqueLexer', 'EvoqueHtmlLexer', 'EvoqueXmlLexer']
37
'EvoqueLexer', 'EvoqueHtmlLexer', 'EvoqueXmlLexer',
38
'ColdfusionLexer', 'ColdfusionHtmlLexer']
44
41
class ErbLexer(Lexer):
246
243
(r'\.[a-zA-Z0-9_]+', Name.Variable),
247
244
(r':?"(\\\\|\\"|[^"])*"', String.Double),
248
245
(r":?'(\\\\|\\'|[^'])*'", String.Single),
249
(r'([{}()\[\]+\-*/,:]|[><=]=?)', Operator),
246
(r'([{}()\[\]+\-*/,:~]|[><=]=?)', Operator),
250
247
(r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
251
248
r"0[xX][0-9a-fA-F]+[Ll]?", Number),
1294
1291
def __init__(self, **options):
1295
1292
super(EvoqueXmlLexer, self).__init__(XmlLexer, EvoqueLexer,
1295
class ColdfusionLexer(RegexLexer):
1297
Coldfusion statements
1299
name = 'cfstatement'
1303
flags = re.IGNORECASE | re.MULTILINE
1308
(r'\+\+|--', Operator),
1309
(r'[-+*/^&=!]', Operator),
1310
(r'<=|>=|<|>', Operator),
1311
(r'mod\b', Operator),
1312
(r'(eq|lt|gt|lte|gte|not|is|and|or)\b', Operator),
1313
(r'\|\||&&', Operator),
1314
(r'"', String.Double, 'string'),
1315
# There is a special rule for allowing html in single quoted
1316
# strings, evidently.
1317
(r"'.*?'", String.Single),
1319
(r'(if|else|len|var|case|default|break|switch)\b', Keyword),
1320
(r'([A-Za-z_$][A-Za-z0-9_.]*)\s*(\()', bygroups(Name.Function, Punctuation)),
1321
(r'[A-Za-z_$][A-Za-z0-9_.]*', Name.Variable),
1322
(r'[()\[\]{};:,.\\]', Punctuation),
1326
(r'""', String.Double),
1327
(r'#.+?#', String.Interp),
1328
(r'[^"#]+', String.Double),
1329
(r'#', String.Double),
1330
(r'"', String.Double, '#pop'),
1334
class ColdfusionMarkupLexer(RegexLexer):
1336
Coldfusion markup only
1347
(r'<[^<>]*', Other),
1350
(r'(?s)<!---.*?--->', Comment.Multiline),
1351
(r'(?s)<!--.*?-->', Comment),
1352
(r'<cfoutput.*?>', Name.Builtin, 'cfoutput'),
1353
(r'(?s)(<cfscript.*?>)(.+?)(</cfscript.*?>)',
1354
bygroups(Name.Builtin, using(ColdfusionLexer), Name.Builtin)),
1355
# negative lookbehind is for strings with embedded >
1356
(r'(?s)(</?cf(?:component|include|if|else|elseif|loop|return|'
1357
r'dbinfo|dump|abort|location|invoke|throw|file|savecontent|'
1358
r'mailpart|mail|header|content|zip|image|lock|argument|try|'
1359
r'catch|break|directory|http|set|function|param)\b)(.*?)((?<!\\)>)',
1360
bygroups(Name.Builtin, using(ColdfusionLexer), Name.Builtin)),
1364
(r'(#)(.*?)(#)', bygroups(Punctuation, using(ColdfusionLexer),
1366
#(r'<cfoutput.*?>', Name.Builtin, '#push'),
1367
(r'</cfoutput.*?>', Name.Builtin, '#pop'),
1369
(r'(?s)<[^<>]*', Other),
1375
class ColdfusionHtmlLexer(DelegatingLexer):
1377
Coldfusion markup in html
1379
name = 'Coldufsion HTML'
1381
filenames = ['*.cfm', '*.cfml', '*.cfc']
1382
mimetypes = ['application/x-coldfusion']
1384
def __init__(self, **options):
1385
super(ColdfusionHtmlLexer, self).__init__(HtmlLexer, ColdfusionMarkupLexer,