annotate MoinMoin/support/pygments/lexers/php.py @ 6097:815981fad7fd

upgrade pygments from 1.6 to 2.1.3
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 05 Sep 2016 23:55:33 +0200
parents
children
rev   line source
6097
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 """
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3 pygments.lexers.php
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4 ~~~~~~~~~~~~~~~~~~~
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
5
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
6 Lexers for PHP and related languages.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
7
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
8 :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
9 :license: BSD, see LICENSE for details.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10 """
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
11
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
12 import re
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
13
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
14 from pygments.lexer import RegexLexer, include, bygroups, default, using, this
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
15 from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
16 Number, Punctuation, Other
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
17 from pygments.util import get_bool_opt, get_list_opt, iteritems
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
18
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
19 __all__ = ['ZephirLexer', 'PhpLexer']
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
20
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
21
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
22 class ZephirLexer(RegexLexer):
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
23 """
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
24 For `Zephir language <http://zephir-lang.com/>`_ source code.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
25
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
26 Zephir is a compiled high level language aimed
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
27 to the creation of C-extensions for PHP.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
28
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
29 .. versionadded:: 2.0
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
30 """
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
31
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
32 name = 'Zephir'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
33 aliases = ['zephir']
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
34 filenames = ['*.zep']
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
35
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
36 zephir_keywords = ['fetch', 'echo', 'isset', 'empty']
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
37 zephir_type = ['bit', 'bits', 'string']
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
38
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
39 flags = re.DOTALL | re.MULTILINE
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
40
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
41 tokens = {
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
42 'commentsandwhitespace': [
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
43 (r'\s+', Text),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
44 (r'//.*?\n', Comment.Single),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
45 (r'/\*.*?\*/', Comment.Multiline)
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
46 ],
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
47 'slashstartsregex': [
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
48 include('commentsandwhitespace'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
49 (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
50 r'([gim]+\b|\B)', String.Regex, '#pop'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
51 default('#pop')
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
52 ],
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
53 'badregex': [
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
54 (r'\n', Text, '#pop')
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
55 ],
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
56 'root': [
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
57 (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
58 include('commentsandwhitespace'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
59 (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
60 r'(<<|>>>?|==?|!=?|->|[-<>+*%&|^/])=?', Operator, 'slashstartsregex'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
61 (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
62 (r'[})\].]', Punctuation),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
63 (r'(for|in|while|do|break|return|continue|switch|case|default|if|else|loop|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
64 r'require|inline|throw|try|catch|finally|new|delete|typeof|instanceof|void|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
65 r'namespace|use|extends|this|fetch|isset|unset|echo|fetch|likely|unlikely|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
66 r'empty)\b', Keyword, 'slashstartsregex'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
67 (r'(var|let|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
68 (r'(abstract|boolean|bool|char|class|const|double|enum|export|extends|final|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
69 r'native|goto|implements|import|int|string|interface|long|ulong|char|uchar|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
70 r'float|unsigned|private|protected|public|short|static|self|throws|reverse|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
71 r'transient|volatile)\b', Keyword.Reserved),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
72 (r'(true|false|null|undefined)\b', Keyword.Constant),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
73 (r'(Array|Boolean|Date|_REQUEST|_COOKIE|_SESSION|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
74 r'_GET|_POST|_SERVER|this|stdClass|range|count|iterator|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
75 r'window)\b', Name.Builtin),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
76 (r'[$a-zA-Z_][\w\\]*', Name.Other),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
77 (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
78 (r'0x[0-9a-fA-F]+', Number.Hex),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
79 (r'[0-9]+', Number.Integer),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
80 (r'"(\\\\|\\"|[^"])*"', String.Double),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
81 (r"'(\\\\|\\'|[^'])*'", String.Single),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
82 ]
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
83 }
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
84
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
85
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
86 class PhpLexer(RegexLexer):
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
87 """
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
88 For `PHP <http://www.php.net/>`_ source code.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
89 For PHP embedded in HTML, use the `HtmlPhpLexer`.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
90
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
91 Additional options accepted:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
92
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
93 `startinline`
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
94 If given and ``True`` the lexer starts highlighting with
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
95 php code (i.e.: no starting ``<?php`` required). The default
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
96 is ``False``.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
97 `funcnamehighlighting`
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
98 If given and ``True``, highlight builtin function names
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
99 (default: ``True``).
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
100 `disabledmodules`
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
101 If given, must be a list of module names whose function names
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
102 should not be highlighted. By default all modules are highlighted
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
103 except the special ``'unknown'`` module that includes functions
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
104 that are known to php but are undocumented.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
105
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
106 To get a list of allowed modules have a look into the
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
107 `_php_builtins` module:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
108
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
109 .. sourcecode:: pycon
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
110
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
111 >>> from pygments.lexers._php_builtins import MODULES
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
112 >>> MODULES.keys()
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
113 ['PHP Options/Info', 'Zip', 'dba', ...]
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
114
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
115 In fact the names of those modules match the module names from
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
116 the php documentation.
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
117 """
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
118
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
119 name = 'PHP'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
120 aliases = ['php', 'php3', 'php4', 'php5']
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
121 filenames = ['*.php', '*.php[345]', '*.inc']
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
122 mimetypes = ['text/x-php']
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
123
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
124 # Note that a backslash is included in the following two patterns
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
125 # PHP uses a backslash as a namespace separator
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
126 _ident_char = r'[\\\w]|[^\x00-\x7f]'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
127 _ident_begin = r'(?:[\\_a-z]|[^\x00-\x7f])'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
128 _ident_end = r'(?:' + _ident_char + ')*'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
129 _ident_inner = _ident_begin + _ident_end
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
130
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
131 flags = re.IGNORECASE | re.DOTALL | re.MULTILINE
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
132 tokens = {
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
133 'root': [
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
134 (r'<\?(php)?', Comment.Preproc, 'php'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
135 (r'[^<]+', Other),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
136 (r'<', Other)
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
137 ],
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
138 'php': [
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
139 (r'\?>', Comment.Preproc, '#pop'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
140 (r'<<<([\'"]?)(' + _ident_inner + r')\1\n.*?\n\s*\2;?\n', String),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
141 (r'\s+', Text),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
142 (r'#.*?\n', Comment.Single),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
143 (r'//.*?\n', Comment.Single),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
144 # put the empty comment here, it is otherwise seen as
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
145 # the start of a docstring
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
146 (r'/\*\*/', Comment.Multiline),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
147 (r'/\*\*.*?\*/', String.Doc),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
148 (r'/\*.*?\*/', Comment.Multiline),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
149 (r'(->|::)(\s*)(' + _ident_inner + ')',
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
150 bygroups(Operator, Text, Name.Attribute)),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
151 (r'[~!%^&*+=|:.<>/@-]+', Operator),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
152 (r'\?', Operator), # don't add to the charclass above!
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
153 (r'[\[\]{}();,]+', Punctuation),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
154 (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
155 (r'(function)(\s*)(?=\()', bygroups(Keyword, Text)),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
156 (r'(function)(\s+)(&?)(\s*)',
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
157 bygroups(Keyword, Text, Operator, Text), 'functionname'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
158 (r'(const)(\s+)(' + _ident_inner + ')',
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
159 bygroups(Keyword, Text, Name.Constant)),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
160 (r'(and|E_PARSE|old_function|E_ERROR|or|as|E_WARNING|parent|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
161 r'eval|PHP_OS|break|exit|case|extends|PHP_VERSION|cfunction|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
162 r'FALSE|print|for|require|continue|foreach|require_once|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
163 r'declare|return|default|static|do|switch|die|stdClass|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
164 r'echo|else|TRUE|elseif|var|empty|if|xor|enddeclare|include|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
165 r'virtual|endfor|include_once|while|endforeach|global|__FILE__|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
166 r'endif|list|__LINE__|endswitch|new|__sleep|endwhile|not|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
167 r'array|__wakeup|E_ALL|NULL|final|php_user_filter|interface|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
168 r'implements|public|private|protected|abstract|clone|try|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
169 r'catch|throw|this|use|namespace|trait|yield|'
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
170 r'finally)\b', Keyword),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
171 (r'(true|false|null)\b', Keyword.Constant),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
172 (r'\$\{\$+' + _ident_inner + '\}', Name.Variable),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
173 (r'\$+' + _ident_inner, Name.Variable),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
174 (_ident_inner, Name.Other),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
175 (r'(\d+\.\d*|\d*\.\d+)(e[+-]?[0-9]+)?', Number.Float),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
176 (r'\d+e[+-]?[0-9]+', Number.Float),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
177 (r'0[0-7]+', Number.Oct),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
178 (r'0x[a-f0-9]+', Number.Hex),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
179 (r'\d+', Number.Integer),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
180 (r'0b[01]+', Number.Bin),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
181 (r"'([^'\\]*(?:\\.[^'\\]*)*)'", String.Single),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
182 (r'`([^`\\]*(?:\\.[^`\\]*)*)`', String.Backtick),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
183 (r'"', String.Double, 'string'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
184 ],
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
185 'classname': [
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
186 (_ident_inner, Name.Class, '#pop')
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
187 ],
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
188 'functionname': [
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
189 (_ident_inner, Name.Function, '#pop')
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
190 ],
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
191 'string': [
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
192 (r'"', String.Double, '#pop'),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
193 (r'[^{$"\\]+', String.Double),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
194 (r'\\([nrt"$\\]|[0-7]{1,3}|x[0-9a-f]{1,2})', String.Escape),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
195 (r'\$' + _ident_inner + '(\[\S+?\]|->' + _ident_inner + ')?',
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
196 String.Interpol),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
197 (r'(\{\$\{)(.*?)(\}\})',
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
198 bygroups(String.Interpol, using(this, _startinline=True),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
199 String.Interpol)),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
200 (r'(\{)(\$.*?)(\})',
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
201 bygroups(String.Interpol, using(this, _startinline=True),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
202 String.Interpol)),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
203 (r'(\$\{)(\S+)(\})',
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
204 bygroups(String.Interpol, Name.Variable, String.Interpol)),
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
205 (r'[${\\]+', String.Double)
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
206 ],
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
207 }
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
208
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
209 def __init__(self, **options):
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
210 self.funcnamehighlighting = get_bool_opt(
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
211 options, 'funcnamehighlighting', True)
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
212 self.disabledmodules = get_list_opt(
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
213 options, 'disabledmodules', ['unknown'])
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
214 self.startinline = get_bool_opt(options, 'startinline', False)
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
215
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
216 # private option argument for the lexer itself
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
217 if '_startinline' in options:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
218 self.startinline = options.pop('_startinline')
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
219
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
220 # collect activated functions in a set
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
221 self._functions = set()
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
222 if self.funcnamehighlighting:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
223 from pygments.lexers._php_builtins import MODULES
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
224 for key, value in iteritems(MODULES):
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
225 if key not in self.disabledmodules:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
226 self._functions.update(value)
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
227 RegexLexer.__init__(self, **options)
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
228
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
229 def get_tokens_unprocessed(self, text):
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
230 stack = ['root']
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
231 if self.startinline:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
232 stack.append('php')
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
233 for index, token, value in \
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
234 RegexLexer.get_tokens_unprocessed(self, text, stack):
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
235 if token is Name.Other:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
236 if value in self._functions:
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
237 yield index, Name.Builtin, value
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
238 continue
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
239 yield index, token, value
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
240
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
241 def analyse_text(text):
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
242 rv = 0.0
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
243 if re.search(r'<\?(?!xml)', text):
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
244 rv += 0.3
815981fad7fd upgrade pygments from 1.6 to 2.1.3
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
245 return rv