~ubuntu-branches/ubuntu/raring/wxwidgets2.8/raring

« back to all changes in this revision

Viewing changes to wxPython/wx/tools/Editra/src/extern/pygments/lexers/templates.py

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber
  • Date: 2012-01-07 13:59:25 UTC
  • mfrom: (1.1.9) (5.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120107135925-2601miy9ullcon9j
Tags: 2.8.12.1-6ubuntu1
* Resync from Debian, changes that were kept:
  - debian/rules: re-enable mediactrl. This allows libwx_gtk2u_media-2.8 to be
    built, as this is required by some applications (LP: #632984)
  - debian/control: Build-dep on libxt-dev for mediactrl.
  - Patches
    + fix-bashism-in-example
* Add conflict on python-wxgtk2.8 (<< 2.8.12.1-6ubuntu1~) to python-wxversion
  to guarantee upgrade ordering when moving from pycentral to dh_python2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
    Lexers for various template engines' markup.
7
7
 
8
 
    :copyright: 2006-2008 by Armin Ronacher, Georg Brandl, Matt Good,
9
 
                Ben Bangert.
10
 
    :license: BSD, see LICENSE for more details.
 
8
    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
 
9
    :license: BSD, see LICENSE for details.
11
10
"""
12
11
 
13
12
import re
14
 
try:
15
 
    set
16
 
except NameError:
17
 
    from sets import Set as set
18
13
 
19
14
from pygments.lexers.web import \
20
15
     PhpLexer, HtmlLexer, XmlLexer, JavascriptLexer, CssLexer
21
 
from pygments.lexers.agile import PythonLexer
 
16
from pygments.lexers.agile import PythonLexer, PerlLexer
22
17
from pygments.lexers.compiled import JavaLexer
23
18
from pygments.lexer import Lexer, DelegatingLexer, RegexLexer, bygroups, \
24
19
     include, using, this
35
30
           'JavascriptDjangoLexer', 'GenshiLexer', 'HtmlGenshiLexer',
36
31
           'GenshiTextLexer', 'CssGenshiLexer', 'JavascriptGenshiLexer',
37
32
           'MyghtyLexer', 'MyghtyHtmlLexer', 'MyghtyXmlLexer',
38
 
           'MyghtyCssLexer', 'MyghtyJavascriptLexer', 'MakoLexer',
 
33
           'MyghtyCssLexer', 'MyghtyJavascriptLexer', 'MasonLexer', 'MakoLexer',
39
34
           'MakoHtmlLexer', 'MakoXmlLexer', 'MakoJavascriptLexer',
40
35
           'MakoCssLexer', 'JspLexer', 'CheetahLexer', 'CheetahHtmlLexer',
41
 
           'CheetahXmlLexer', 'CheetahJavascriptLexer']
 
36
           'CheetahXmlLexer', 'CheetahJavascriptLexer',
 
37
           'EvoqueLexer', 'EvoqueHtmlLexer', 'EvoqueXmlLexer',
 
38
           'ColdfusionLexer', 'ColdfusionHtmlLexer',
 
39
           'VelocityLexer', 'VelocityHtmlLexer', 'VelocityXmlLexer',
 
40
           'SspLexer']
42
41
 
43
42
 
44
43
class ErbLexer(Lexer):
191
190
        return rv
192
191
 
193
192
 
 
193
class VelocityLexer(RegexLexer):
 
194
    """
 
195
    Generic `Velocity <http://velocity.apache.org/>`_ template lexer.
 
196
 
 
197
    Just highlights velocity directives and variable references, other
 
198
    data is left untouched by the lexer.
 
199
    """
 
200
 
 
201
    name = 'Velocity'
 
202
    aliases = ['velocity']
 
203
    filenames = ['*.vm','*.fhtml']
 
204
 
 
205
    flags = re.MULTILINE | re.DOTALL
 
206
 
 
207
    identifier = r'[a-zA-Z_][a-zA-Z0-9_]*'
 
208
 
 
209
    tokens = {
 
210
        'root': [
 
211
            (r'[^{#$]+', Other),
 
212
            (r'(#)(\*.*?\*)(#)',
 
213
             bygroups(Comment.Preproc, Comment, Comment.Preproc)),
 
214
            (r'(##)(.*?$)',
 
215
             bygroups(Comment.Preproc, Comment)),
 
216
            (r'(#\{?)(' + identifier + r')(\}?)(\s?\()',
 
217
             bygroups(Comment.Preproc, Name.Function, Comment.Preproc, Punctuation),
 
218
             'directiveparams'),
 
219
            (r'(#\{?)(' + identifier + r')(\}|\b)',
 
220
             bygroups(Comment.Preproc, Name.Function, Comment.Preproc)),
 
221
            (r'\$\{?', Punctuation, 'variable')
 
222
        ],
 
223
        'variable': [
 
224
            (identifier, Name.Variable),
 
225
            (r'\(', Punctuation, 'funcparams'),
 
226
            (r'(\.)(' + identifier + r')', bygroups(Punctuation, Name.Variable), '#push'),
 
227
            (r'\}', Punctuation, '#pop'),
 
228
            (r'', Other, '#pop')
 
229
        ],
 
230
        'directiveparams': [
 
231
            (r'(&&|\|\||==?|!=?|[-<>+*%&\|\^/])|\b(eq|ne|gt|lt|ge|le|not|in)\b', Operator),
 
232
            (r'\[', Operator, 'rangeoperator'),
 
233
            (r'\b' + identifier + r'\b', Name.Function),
 
234
            include('funcparams')
 
235
        ],
 
236
        'rangeoperator': [
 
237
            (r'\.\.', Operator),
 
238
            include('funcparams'),
 
239
            (r'\]', Operator, '#pop')
 
240
        ],
 
241
        'funcparams': [
 
242
            (r'\$\{?', Punctuation, 'variable'),
 
243
            (r'\s+', Text),
 
244
            (r',', Punctuation),
 
245
            (r'"(\\\\|\\"|[^"])*"', String.Double),
 
246
            (r"'(\\\\|\\'|[^'])*'", String.Single),
 
247
            (r"0[xX][0-9a-fA-F]+[Ll]?", Number),
 
248
            (r"\b[0-9]+\b", Number),
 
249
            (r'(true|false|null)\b', Keyword.Constant),
 
250
            (r'\(', Punctuation, '#push'),
 
251
            (r'\)', Punctuation, '#pop')
 
252
        ]
 
253
    }
 
254
 
 
255
    def analyse_text(text):
 
256
        rv = 0.0
 
257
        if re.search(r'#\{?macro\}?\(.*?\).*?#\{?end\}?', text):
 
258
            rv += 0.25
 
259
        if re.search(r'#\{?if\}?\(.+?\).*?#\{?end\}?', text):
 
260
            rv += 0.15
 
261
        if re.search(r'#\{?foreach\}?\(.+?\).*?#\{?end\}?', text):
 
262
            rv += 0.15
 
263
        if re.search(r'\$\{?[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?(\.[a-zA-Z0-9_]+(\([^)]*\))?)*\}?', text):
 
264
            rv += 0.01
 
265
        return rv
 
266
 
 
267
 
 
268
class VelocityHtmlLexer(DelegatingLexer):
 
269
    """
 
270
    Subclass of the `VelocityLexer` that highlights unlexer data
 
271
    with the `HtmlLexer`.
 
272
 
 
273
    """
 
274
 
 
275
    name = 'HTML+Velocity'
 
276
    aliases = ['html+velocity']
 
277
    alias_filenames = ['*.html','*.fhtml']
 
278
    mimetypes = ['text/html+velocity']
 
279
 
 
280
    def __init__(self, **options):
 
281
        super(VelocityHtmlLexer, self).__init__(HtmlLexer, VelocityLexer,
 
282
                                              **options)
 
283
 
 
284
 
 
285
class VelocityXmlLexer(DelegatingLexer):
 
286
    """
 
287
    Subclass of the `VelocityLexer` that highlights unlexer data
 
288
    with the `XmlLexer`.
 
289
 
 
290
    """
 
291
 
 
292
    name = 'XML+Velocity'
 
293
    aliases = ['xml+velocity']
 
294
    alias_filenames = ['*.xml','*.vm']
 
295
    mimetypes = ['application/xml+velocity']
 
296
 
 
297
    def __init__(self, **options):
 
298
        super(VelocityXmlLexer, self).__init__(XmlLexer, VelocityLexer,
 
299
                                               **options)
 
300
 
 
301
    def analyse_text(text):
 
302
        rv = VelocityLexer.analyse_text(text) - 0.01
 
303
        if looks_like_xml(text):
 
304
            rv += 0.5
 
305
        return rv
 
306
 
 
307
 
194
308
class DjangoLexer(RegexLexer):
195
309
    """
196
310
    Generic `django <http://www.djangoproject.com/documentation/templates/>`_
239
353
             bygroups(Keyword, Text, Keyword, Text, Name.Function)),
240
354
            (r'(_|true|false|none|True|False|None)\b', Keyword.Pseudo),
241
355
            (r'(in|as|reversed|recursive|not|and|or|is|if|else|import|'
242
 
             r'with(?:(?:out)?\s*context)?)\b', Keyword),
 
356
             r'with(?:(?:out)?\s*context)?|scoped|ignore\s+missing)\b',
 
357
             Keyword),
243
358
            (r'(loop|block|super|forloop)\b', Name.Builtin),
244
 
            (r'[a-zA-Z][a-zA-Z0-9_]*', Name.Variable),
 
359
            (r'[a-zA-Z][a-zA-Z0-9_-]*', Name.Variable),
245
360
            (r'\.[a-zA-Z0-9_]+', Name.Variable),
246
361
            (r':?"(\\\\|\\"|[^"])*"', String.Double),
247
362
            (r":?'(\\\\|\\'|[^'])*'", String.Single),
248
 
            (r'([{}()\[\]+\-*/,:]|[><=]=?)', Operator),
 
363
            (r'([{}()\[\]+\-*/,:~]|[><=]=?)', Operator),
249
364
            (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
250
365
             r"0[xX][0-9a-fA-F]+[Ll]?", Number),
251
366
        ],
391
506
                                             **options)
392
507
 
393
508
 
 
509
class MasonLexer(RegexLexer):
 
510
    """
 
511
    Generic `mason templates`_ lexer. Stolen from Myghty lexer. Code that isn't
 
512
    Mason markup is HTML.
 
513
 
 
514
    .. _mason templates: http://www.masonhq.com/
 
515
 
 
516
    *New in Pygments 1.4.*
 
517
    """
 
518
    name = 'Mason'
 
519
    aliases = ['mason']
 
520
    filenames = ['*.m', '*.mhtml', '*.mc', '*.mi', 'autohandler', 'dhandler']
 
521
    mimetypes = ['application/x-mason']
 
522
 
 
523
    tokens = {
 
524
        'root': [
 
525
            (r'\s+', Text),
 
526
            (r'(<%doc>)(.*?)(</%doc>)(?s)',
 
527
             bygroups(Name.Tag, Comment.Multiline, Name.Tag)),
 
528
            (r'(<%(def|method))(\s*)(.*?)(>)(.*?)(</%\2\s*>)(?s)',
 
529
             bygroups(Name.Tag, None, Text, Name.Function, Name.Tag,
 
530
                      using(this), Name.Tag)),
 
531
            (r'(<%(\w+))(.*?)(>)(.*?)(</%\2\s*>)(?s)',
 
532
             bygroups(Name.Tag, None, Name.Function, Name.Tag,
 
533
                      using(PerlLexer), Name.Tag)),
 
534
            (r'(<&[^|])(.*?)(,.*?)?(&>)(?s)',
 
535
             bygroups(Name.Tag, Name.Function, using(PerlLexer), Name.Tag)),
 
536
            (r'(<&\|)(.*?)(,.*?)?(&>)(?s)',
 
537
             bygroups(Name.Tag, Name.Function, using(PerlLexer), Name.Tag)),
 
538
            (r'</&>', Name.Tag),
 
539
            (r'(<%!?)(.*?)(%>)(?s)',
 
540
             bygroups(Name.Tag, using(PerlLexer), Name.Tag)),
 
541
            (r'(?<=^)#[^\n]*(\n|\Z)', Comment),
 
542
            (r'(?<=^)(%)([^\n]*)(\n|\Z)',
 
543
             bygroups(Name.Tag, using(PerlLexer), Other)),
 
544
            (r"""(?sx)
 
545
                 (.+?)               # anything, followed by:
 
546
                 (?:
 
547
                  (?<=\n)(?=[%#]) |  # an eval or comment line
 
548
                  (?=</?[%&]) |      # a substitution or block or
 
549
                                     # call start or end
 
550
                                     # - don't consume
 
551
                  (\\\n) |           # an escaped newline
 
552
                  \Z                 # end of string
 
553
                 )""", bygroups(using(HtmlLexer), Operator)),
 
554
        ]
 
555
    }
 
556
 
 
557
    def analyse_text(text):
 
558
        rv = 0.0
 
559
        if re.search('<&', text) is not None:
 
560
            rv = 1.0
 
561
        return rv
 
562
 
 
563
 
394
564
class MakoLexer(RegexLexer):
395
565
    """
396
566
    Generic `mako templates`_ lexer. Code that isn't Mako
412
582
             bygroups(Text, Comment.Preproc, Keyword, Other)),
413
583
            (r'(\s*)(%)([^\n]*)(\n|\Z)',
414
584
             bygroups(Text, Comment.Preproc, using(PythonLexer), Other)),
415
 
             (r'(\s*)(#[^\n]*)(\n|\Z)',
416
 
              bygroups(Text, Comment.Preproc, Other)),
417
 
            (r'(<%)(def|call|namespace|text)',
 
585
            (r'(\s*)(##[^\n]*)(\n|\Z)',
 
586
             bygroups(Text, Comment.Preproc, Other)),
 
587
            (r'(?s)<%doc>.*?</%doc>', Comment.Preproc),
 
588
            (r'(<%)([\w\.\:]+)',
418
589
             bygroups(Comment.Preproc, Name.Builtin), 'tag'),
419
 
            (r'(</%)(def|call|namespace|text)(>)',
 
590
            (r'(</%)([\w\.\:]+)(>)',
420
591
             bygroups(Comment.Preproc, Name.Builtin, Comment.Preproc)),
421
 
            (r'<%(?=(include|inherit|namespace|page))', Comment.Preproc, 'ondeftags'),
 
592
            (r'<%(?=([\w\.\:]+))', Comment.Preproc, 'ondeftags'),
422
593
            (r'(<%(?:!?))(.*?)(%>)(?s)',
423
594
             bygroups(Comment.Preproc, using(PythonLexer), Comment.Preproc)),
424
 
            (r'(\$\{!?)(.*?)(\})(?s)',
 
595
            (r'(\$\{)(.*?)(\})',
425
596
             bygroups(Comment.Preproc, using(PythonLexer), Comment.Preproc)),
426
597
            (r'''(?sx)
427
 
                (.+?)               # anything, followed by:
 
598
                (.+?)                # anything, followed by:
428
599
                (?:
429
 
                 (?<=\n)(?=[%#]) |  # an eval or comment line
430
 
                 (?=</?%) |         # a python block
431
 
                                    # call start or end
432
 
                 (?=\$\{) |         # a substitution
 
600
                 (?<=\n)(?=%|\#\#) | # an eval or comment line
 
601
                 (?=\#\*) |          # multiline comment
 
602
                 (?=</?%) |          # a python block
 
603
                                     # call start or end
 
604
                 (?=\$\{) |          # a substitution
433
605
                 (?<=\n)(?=\s*%) |
434
 
                                    # - don't consume
435
 
                 (\\\n) |           # an escaped newline
436
 
                 \Z                 # end of string
 
606
                                     # - don't consume
 
607
                 (\\\n) |            # an escaped newline
 
608
                 \Z                  # end of string
437
609
                )
438
610
            ''', bygroups(Other, Operator)),
439
611
            (r'\s+', Text),
1206
1378
        if '<%' in text and '%>' in text:
1207
1379
            rv += 0.1
1208
1380
        return rv
 
1381
 
 
1382
 
 
1383
class EvoqueLexer(RegexLexer):
 
1384
    """
 
1385
    For files using the Evoque templating system.
 
1386
 
 
1387
    *New in Pygments 1.1.*
 
1388
    """
 
1389
    name = 'Evoque'
 
1390
    aliases = ['evoque']
 
1391
    filenames = ['*.evoque']
 
1392
    mimetypes = ['application/x-evoque']
 
1393
 
 
1394
    flags = re.DOTALL
 
1395
 
 
1396
    tokens = {
 
1397
        'root': [
 
1398
            (r'[^#$]+', Other),
 
1399
            (r'#\[', Comment.Multiline, 'comment'),
 
1400
            (r'\$\$', Other),
 
1401
            # svn keywords
 
1402
            (r'\$\w+:[^$\n]*\$', Comment.Multiline),
 
1403
            # directives: begin, end
 
1404
            (r'(\$)(begin|end)(\{(%)?)(.*?)((?(4)%)\})',
 
1405
             bygroups(Punctuation, Name.Builtin, Punctuation, None,
 
1406
                      String, Punctuation, None)),
 
1407
            # directives: evoque, overlay
 
1408
            # see doc for handling first name arg: /directives/evoque/
 
1409
            #+ minor inconsistency: the "name" in e.g. $overlay{name=site_base}
 
1410
            # should be using(PythonLexer), not passed out as String
 
1411
            (r'(\$)(evoque|overlay)(\{(%)?)(\s*[#\w\-"\'.]+[^=,%}]+?)?'
 
1412
             r'(.*?)((?(4)%)\})',
 
1413
             bygroups(Punctuation, Name.Builtin, Punctuation, None,
 
1414
                      String, using(PythonLexer), Punctuation, None)),
 
1415
            # directives: if, for, prefer, test
 
1416
            (r'(\$)(\w+)(\{(%)?)(.*?)((?(4)%)\})',
 
1417
             bygroups(Punctuation, Name.Builtin, Punctuation, None,
 
1418
                      using(PythonLexer), Punctuation, None)),
 
1419
            # directive clauses (no {} expression)
 
1420
            (r'(\$)(else|rof|fi)', bygroups(Punctuation, Name.Builtin)),
 
1421
            # expressions
 
1422
            (r'(\$\{(%)?)(.*?)((!)(.*?))?((?(2)%)\})',
 
1423
             bygroups(Punctuation, None, using(PythonLexer),
 
1424
                      Name.Builtin, None, None, Punctuation, None)),
 
1425
            (r'#', Other),
 
1426
        ],
 
1427
        'comment': [
 
1428
            (r'[^\]#]', Comment.Multiline),
 
1429
            (r'#\[', Comment.Multiline, '#push'),
 
1430
            (r'\]#', Comment.Multiline, '#pop'),
 
1431
            (r'[\]#]', Comment.Multiline)
 
1432
        ],
 
1433
    }
 
1434
 
 
1435
class EvoqueHtmlLexer(DelegatingLexer):
 
1436
    """
 
1437
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
 
1438
    `HtmlLexer`.
 
1439
 
 
1440
    *New in Pygments 1.1.*
 
1441
    """
 
1442
    name = 'HTML+Evoque'
 
1443
    aliases = ['html+evoque']
 
1444
    filenames = ['*.html']
 
1445
    mimetypes = ['text/html+evoque']
 
1446
 
 
1447
    def __init__(self, **options):
 
1448
        super(EvoqueHtmlLexer, self).__init__(HtmlLexer, EvoqueLexer,
 
1449
                                              **options)
 
1450
 
 
1451
class EvoqueXmlLexer(DelegatingLexer):
 
1452
    """
 
1453
    Subclass of the `EvoqueLexer` that highlights unlexed data with the
 
1454
    `XmlLexer`.
 
1455
 
 
1456
    *New in Pygments 1.1.*
 
1457
    """
 
1458
    name = 'XML+Evoque'
 
1459
    aliases = ['xml+evoque']
 
1460
    filenames = ['*.xml']
 
1461
    mimetypes = ['application/xml+evoque']
 
1462
 
 
1463
    def __init__(self, **options):
 
1464
        super(EvoqueXmlLexer, self).__init__(XmlLexer, EvoqueLexer,
 
1465
                                             **options)
 
1466
 
 
1467
class ColdfusionLexer(RegexLexer):
 
1468
    """
 
1469
    Coldfusion statements
 
1470
    """
 
1471
    name = 'cfstatement'
 
1472
    aliases = ['cfs']
 
1473
    filenames = []
 
1474
    mimetypes = []
 
1475
    flags = re.IGNORECASE | re.MULTILINE
 
1476
 
 
1477
    tokens = {
 
1478
        'root': [
 
1479
            (r'//.*', Comment),
 
1480
            (r'\+\+|--', Operator),
 
1481
            (r'[-+*/^&=!]', Operator),
 
1482
            (r'<=|>=|<|>', Operator),
 
1483
            (r'mod\b', Operator),
 
1484
            (r'(eq|lt|gt|lte|gte|not|is|and|or)\b', Operator),
 
1485
            (r'\|\||&&', Operator),
 
1486
            (r'"', String.Double, 'string'),
 
1487
            # There is a special rule for allowing html in single quoted
 
1488
            # strings, evidently.
 
1489
            (r"'.*?'", String.Single),
 
1490
            (r'\d+', Number),
 
1491
            (r'(if|else|len|var|case|default|break|switch)\b', Keyword),
 
1492
            (r'([A-Za-z_$][A-Za-z0-9_.]*)\s*(\()', bygroups(Name.Function, Punctuation)),
 
1493
            (r'[A-Za-z_$][A-Za-z0-9_.]*', Name.Variable),
 
1494
            (r'[()\[\]{};:,.\\]', Punctuation),
 
1495
            (r'\s+', Text),
 
1496
        ],
 
1497
        'string': [
 
1498
            (r'""', String.Double),
 
1499
            (r'#.+?#', String.Interp),
 
1500
            (r'[^"#]+', String.Double),
 
1501
            (r'#', String.Double),
 
1502
            (r'"', String.Double, '#pop'),
 
1503
        ],
 
1504
    }
 
1505
 
 
1506
class ColdfusionMarkupLexer(RegexLexer):
 
1507
    """
 
1508
    Coldfusion markup only
 
1509
    """
 
1510
    name = 'Coldfusion'
 
1511
    aliases = ['cf']
 
1512
    filenames = []
 
1513
    mimetypes = []
 
1514
 
 
1515
    tokens = {
 
1516
        'root': [
 
1517
            (r'[^<]+', Other),
 
1518
            include('tags'),
 
1519
            (r'<[^<>]*', Other),
 
1520
        ],
 
1521
        'tags': [
 
1522
            (r'(?s)<!---.*?--->', Comment.Multiline),
 
1523
            (r'(?s)<!--.*?-->', Comment),
 
1524
            (r'<cfoutput.*?>', Name.Builtin, 'cfoutput'),
 
1525
            (r'(?s)(<cfscript.*?>)(.+?)(</cfscript.*?>)',
 
1526
             bygroups(Name.Builtin, using(ColdfusionLexer), Name.Builtin)),
 
1527
            # negative lookbehind is for strings with embedded >
 
1528
            (r'(?s)(</?cf(?:component|include|if|else|elseif|loop|return|'
 
1529
             r'dbinfo|dump|abort|location|invoke|throw|file|savecontent|'
 
1530
             r'mailpart|mail|header|content|zip|image|lock|argument|try|'
 
1531
             r'catch|break|directory|http|set|function|param)\b)(.*?)((?<!\\)>)',
 
1532
             bygroups(Name.Builtin, using(ColdfusionLexer), Name.Builtin)),
 
1533
        ],
 
1534
        'cfoutput': [
 
1535
            (r'[^#<]+', Other),
 
1536
            (r'(#)(.*?)(#)', bygroups(Punctuation, using(ColdfusionLexer),
 
1537
                                      Punctuation)),
 
1538
            #(r'<cfoutput.*?>', Name.Builtin, '#push'),
 
1539
            (r'</cfoutput.*?>', Name.Builtin, '#pop'),
 
1540
            include('tags'),
 
1541
            (r'(?s)<[^<>]*', Other),
 
1542
            (r'#', Other),
 
1543
        ],
 
1544
    }
 
1545
 
 
1546
 
 
1547
class ColdfusionHtmlLexer(DelegatingLexer):
 
1548
    """
 
1549
    Coldfusion markup in html
 
1550
    """
 
1551
    name = 'Coldfusion HTML'
 
1552
    aliases = ['cfm']
 
1553
    filenames = ['*.cfm', '*.cfml', '*.cfc']
 
1554
    mimetypes = ['application/x-coldfusion']
 
1555
 
 
1556
    def __init__(self, **options):
 
1557
        super(ColdfusionHtmlLexer, self).__init__(HtmlLexer, ColdfusionMarkupLexer,
 
1558
                                                  **options)
 
1559
 
 
1560
 
 
1561
class SspLexer(DelegatingLexer):
 
1562
    """
 
1563
    Lexer for Scalate Server Pages.
 
1564
 
 
1565
    *New in Pygments 1.4.*
 
1566
    """
 
1567
    name = 'Scalate Server Page'
 
1568
    aliases = ['ssp']
 
1569
    filenames = ['*.ssp']
 
1570
    mimetypes = ['application/x-ssp']
 
1571
 
 
1572
    def __init__(self, **options):
 
1573
        super(SspLexer, self).__init__(XmlLexer, JspRootLexer, **options)
 
1574
 
 
1575
    def analyse_text(text):
 
1576
        rv = 0.0
 
1577
        if re.search('val \w+\s*:', text):
 
1578
            rv += 0.6
 
1579
        if looks_like_xml(text):
 
1580
            rv += 0.2
 
1581
        if '<%' in text and '%>' in text:
 
1582
            rv += 0.1
 
1583
        return rv