ThirdParty/Pygments/pygments/lexers/other.py

Sat, 14 Dec 2013 23:44:25 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Sat, 14 Dec 2013 23:44:25 +0100
branch
Py2 comp.
changeset 3145
a9de05d4a22f
parent 2525
8b507a9a2d40
child 4172
4f20dba37ab6
permissions
-rw-r--r--

# __IGNORE_WARNING__ added/ removed.

808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1 # -*- coding: utf-8 -*-
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
2 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
3 pygments.lexers.other
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
4 ~~~~~~~~~~~~~~~~~~~~~
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
5
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
6 Lexers for other languages.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
7
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
8 :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
9 :license: BSD, see LICENSE for details.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
10 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
11
3145
a9de05d4a22f # __IGNORE_WARNING__ added/ removed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2525
diff changeset
12 from __future__ import unicode_literals
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2426
diff changeset
13
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
14 import re
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
15
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
16 from pygments.lexer import RegexLexer, include, bygroups, using, \
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
17 this, combined, ExtendedRegexLexer
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
18 from pygments.token import Error, Punctuation, Literal, Token, \
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
19 Text, Comment, Operator, Keyword, Name, String, Number, Generic
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
20 from pygments.util import get_bool_opt
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
21 from pygments.lexers.web import HtmlLexer
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
22
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
23 from pygments.lexers._openedgebuiltins import OPENEDGEKEYWORDS
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
24 from pygments.lexers._robotframeworklexer import RobotFrameworkLexer
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
25
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
26 # backwards compatibility
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
27 from pygments.lexers.sql import SqlLexer, MySqlLexer, SqliteConsoleLexer
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
28 from pygments.lexers.shell import BashLexer, BashSessionLexer, BatchLexer, \
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
29 TcshLexer
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
30
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
31 __all__ = ['BrainfuckLexer', 'BefungeLexer', 'RedcodeLexer', 'MOOCodeLexer',
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
32 'SmalltalkLexer', 'LogtalkLexer', 'GnuplotLexer', 'PovrayLexer',
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
33 'AppleScriptLexer', 'ModelicaLexer', 'RebolLexer', 'ABAPLexer',
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
34 'NewspeakLexer', 'GherkinLexer', 'AsymptoteLexer', 'PostScriptLexer',
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
35 'AutohotkeyLexer', 'GoodDataCLLexer', 'MaqlLexer', 'ProtoBufLexer',
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
36 'HybrisLexer', 'AwkLexer', 'Cfengine3Lexer', 'SnobolLexer',
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
37 'ECLLexer', 'UrbiscriptLexer', 'OpenEdgeLexer', 'BroLexer',
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
38 'MscgenLexer', 'KconfigLexer', 'VGLLexer', 'SourcePawnLexer',
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
39 'RobotFrameworkLexer', 'PuppetLexer', 'NSISLexer', 'RPMSpecLexer',
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
40 'CbmBasicV2Lexer', 'AutoItLexer']
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
41
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
42
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
43 class ECLLexer(RegexLexer):
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
44 """
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
45 Lexer for the declarative big-data `ECL
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
46 <http://hpccsystems.com/community/docs/ecl-language-reference/html>`_
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
47 language.
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
48
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
49 *New in Pygments 1.5.*
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
50 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
51
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
52 name = 'ECL'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
53 aliases = ['ecl']
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
54 filenames = ['*.ecl']
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
55 mimetypes = ['application/x-ecl']
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
56
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
57 flags = re.IGNORECASE | re.MULTILINE
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
58
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
59 tokens = {
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
60 'root': [
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
61 include('whitespace'),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
62 include('statements'),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
63 ],
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
64 'whitespace': [
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
65 (r'\s+', Text),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
66 (r'\/\/.*', Comment.Single),
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
67 (r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment.Multiline),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
68 ],
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
69 'statements': [
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
70 include('types'),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
71 include('keywords'),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
72 include('functions'),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
73 include('hash'),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
74 (r'"', String, 'string'),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
75 (r'\'', String, 'string'),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
76 (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
77 (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
78 (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
79 (r'0[0-7]+[LlUu]*', Number.Oct),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
80 (r'\d+[LlUu]*', Number.Integer),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
81 (r'\*/', Error),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
82 (r'[~!%^&*+=|?:<>/-]+', Operator),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
83 (r'[{}()\[\],.;]', Punctuation),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
84 (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
85 ],
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
86 'hash': [
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
87 (r'^#.*$', Comment.Preproc),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
88 ],
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
89 'types': [
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
90 (r'(RECORD|END)\D', Keyword.Declaration),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
91 (r'((?:ASCII|BIG_ENDIAN|BOOLEAN|DATA|DECIMAL|EBCDIC|INTEGER|PATTERN|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
92 r'QSTRING|REAL|RECORD|RULE|SET OF|STRING|TOKEN|UDECIMAL|UNICODE|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
93 r'UNSIGNED|VARSTRING|VARUNICODE)\d*)(\s+)',
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
94 bygroups(Keyword.Type, Text)),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
95 ],
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
96 'keywords': [
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
97 (r'(APPLY|ASSERT|BUILD|BUILDINDEX|EVALUATE|FAIL|KEYDIFF|KEYPATCH|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
98 r'LOADXML|NOTHOR|NOTIFY|OUTPUT|PARALLEL|SEQUENTIAL|SOAPCALL|WAIT'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
99 r'CHECKPOINT|DEPRECATED|FAILCODE|FAILMESSAGE|FAILURE|GLOBAL|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
100 r'INDEPENDENT|ONWARNING|PERSIST|PRIORITY|RECOVERY|STORED|SUCCESS|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
101 r'WAIT|WHEN)\b', Keyword.Reserved),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
102 # These are classed differently, check later
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
103 (r'(ALL|AND|ANY|AS|ATMOST|BEFORE|BEGINC\+\+|BEST|BETWEEN|CASE|CONST|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
104 r'COUNTER|CSV|DESCEND|ENCRYPT|ENDC\+\+|ENDMACRO|EXCEPT|EXCLUSIVE|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
105 r'EXPIRE|EXPORT|EXTEND|FALSE|FEW|FIRST|FLAT|FULL|FUNCTION|GROUP|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
106 r'HEADER|HEADING|HOLE|IFBLOCK|IMPORT|IN|JOINED|KEEP|KEYED|LAST|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
107 r'LEFT|LIMIT|LOAD|LOCAL|LOCALE|LOOKUP|MACRO|MANY|MAXCOUNT|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
108 r'MAXLENGTH|MIN SKEW|MODULE|INTERFACE|NAMED|NOCASE|NOROOT|NOSCAN|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
109 r'NOSORT|NOT|OF|ONLY|OPT|OR|OUTER|OVERWRITE|PACKED|PARTITION|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
110 r'PENALTY|PHYSICALLENGTH|PIPE|QUOTE|RELATIONSHIP|REPEAT|RETURN|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
111 r'RIGHT|SCAN|SELF|SEPARATOR|SERVICE|SHARED|SKEW|SKIP|SQL|STORE|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
112 r'TERMINATOR|THOR|THRESHOLD|TOKEN|TRANSFORM|TRIM|TRUE|TYPE|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
113 r'UNICODEORDER|UNSORTED|VALIDATE|VIRTUAL|WHOLE|WILD|WITHIN|XML|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
114 r'XPATH|__COMPRESSED__)\b', Keyword.Reserved),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
115 ],
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
116 'functions': [
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
117 (r'(ABS|ACOS|ALLNODES|ASCII|ASIN|ASSTRING|ATAN|ATAN2|AVE|CASE|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
118 r'CHOOSE|CHOOSEN|CHOOSESETS|CLUSTERSIZE|COMBINE|CORRELATION|COS|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
119 r'COSH|COUNT|COVARIANCE|CRON|DATASET|DEDUP|DEFINE|DENORMALIZE|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
120 r'DISTRIBUTE|DISTRIBUTED|DISTRIBUTION|EBCDIC|ENTH|ERROR|EVALUATE|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
121 r'EVENT|EVENTEXTRA|EVENTNAME|EXISTS|EXP|FAILCODE|FAILMESSAGE|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
122 r'FETCH|FROMUNICODE|GETISVALID|GLOBAL|GRAPH|GROUP|HASH|HASH32|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
123 r'HASH64|HASHCRC|HASHMD5|HAVING|IF|INDEX|INTFORMAT|ISVALID|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
124 r'ITERATE|JOIN|KEYUNICODE|LENGTH|LIBRARY|LIMIT|LN|LOCAL|LOG|LOOP|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
125 r'MAP|MATCHED|MATCHLENGTH|MATCHPOSITION|MATCHTEXT|MATCHUNICODE|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
126 r'MAX|MERGE|MERGEJOIN|MIN|NOLOCAL|NONEMPTY|NORMALIZE|PARSE|PIPE|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
127 r'POWER|PRELOAD|PROCESS|PROJECT|PULL|RANDOM|RANGE|RANK|RANKED|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
128 r'REALFORMAT|RECORDOF|REGEXFIND|REGEXREPLACE|REGROUP|REJECTED|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
129 r'ROLLUP|ROUND|ROUNDUP|ROW|ROWDIFF|SAMPLE|SET|SIN|SINH|SIZEOF|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
130 r'SOAPCALL|SORT|SORTED|SQRT|STEPPED|STORED|SUM|TABLE|TAN|TANH|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
131 r'THISNODE|TOPN|TOUNICODE|TRANSFER|TRIM|TRUNCATE|TYPEOF|UNGROUP|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
132 r'UNICODEORDER|VARIANCE|WHICH|WORKUNIT|XMLDECODE|XMLENCODE|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
133 r'XMLTEXT|XMLUNICODE)\b', Name.Function),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
134 ],
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
135 'string': [
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
136 (r'"', String, '#pop'),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
137 (r'\'', String, '#pop'),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
138 (r'[^"\']+', String),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
139 ],
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
140 }
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
141
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
142
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
143 class BrainfuckLexer(RegexLexer):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
144 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
145 Lexer for the esoteric `BrainFuck <http://www.muppetlabs.com/~breadbox/bf/>`_
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
146 language.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
147 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
148
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
149 name = 'Brainfuck'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
150 aliases = ['brainfuck', 'bf']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
151 filenames = ['*.bf', '*.b']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
152 mimetypes = ['application/x-brainfuck']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
153
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
154 tokens = {
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
155 'common': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
156 # use different colors for different instruction types
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
157 (r'[.,]+', Name.Tag),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
158 (r'[+-]+', Name.Builtin),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
159 (r'[<>]+', Name.Variable),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
160 (r'[^.,+\-<>\[\]]+', Comment),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
161 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
162 'root': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
163 (r'\[', Keyword, 'loop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
164 (r'\]', Error),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
165 include('common'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
166 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
167 'loop': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
168 (r'\[', Keyword, '#push'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
169 (r'\]', Keyword, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
170 include('common'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
171 ]
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
172 }
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
173
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
174
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
175 class BefungeLexer(RegexLexer):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
176 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
177 Lexer for the esoteric `Befunge <http://en.wikipedia.org/wiki/Befunge>`_
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
178 language.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
179
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
180 *New in Pygments 0.7.*
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
181 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
182 name = 'Befunge'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
183 aliases = ['befunge']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
184 filenames = ['*.befunge']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
185 mimetypes = ['application/x-befunge']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
186
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
187 tokens = {
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
188 'root': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
189 (r'[0-9a-f]', Number),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
190 (r'[\+\*/%!`-]', Operator), # Traditional math
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
191 (r'[<>^v?\[\]rxjk]', Name.Variable), # Move, imperatives
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
192 (r'[:\\$.,n]', Name.Builtin), # Stack ops, imperatives
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
193 (r'[|_mw]', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
194 (r'[{}]', Name.Tag), # Befunge-98 stack ops
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
195 (r'".*?"', String.Double), # Strings don't appear to allow escapes
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
196 (r'\'.', String.Single), # Single character
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
197 (r'[#;]', Comment), # Trampoline... depends on direction hit
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
198 (r'[pg&~=@iotsy]', Keyword), # Misc
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
199 (r'[()A-Z]', Comment), # Fingerprints
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
200 (r'\s+', Text), # Whitespace doesn't matter
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
201 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
202 }
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
203
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
204
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
205 class RedcodeLexer(RegexLexer):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
206 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
207 A simple Redcode lexer based on ICWS'94.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
208 Contributed by Adam Blinkinsop <blinks@acm.org>.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
209
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
210 *New in Pygments 0.8.*
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
211 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
212 name = 'Redcode'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
213 aliases = ['redcode']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
214 filenames = ['*.cw']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
215
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
216 opcodes = ['DAT','MOV','ADD','SUB','MUL','DIV','MOD',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
217 'JMP','JMZ','JMN','DJN','CMP','SLT','SPL',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
218 'ORG','EQU','END']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
219 modifiers = ['A','B','AB','BA','F','X','I']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
220
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
221 tokens = {
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
222 'root': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
223 # Whitespace:
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
224 (r'\s+', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
225 (r';.*$', Comment.Single),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
226 # Lexemes:
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
227 # Identifiers
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
228 (r'\b(%s)\b' % '|'.join(opcodes), Name.Function),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
229 (r'\b(%s)\b' % '|'.join(modifiers), Name.Decorator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
230 (r'[A-Za-z_][A-Za-z_0-9]+', Name),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
231 # Operators
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
232 (r'[-+*/%]', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
233 (r'[#$@<>]', Operator), # mode
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
234 (r'[.,]', Punctuation), # mode
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
235 # Numbers
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
236 (r'[-+]?\d+', Number.Integer),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
237 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
238 }
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
239
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
240
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
241 class MOOCodeLexer(RegexLexer):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
242 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
243 For `MOOCode <http://www.moo.mud.org/>`_ (the MOO scripting
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
244 language).
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
245
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
246 *New in Pygments 0.9.*
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
247 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
248 name = 'MOOCode'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
249 filenames = ['*.moo']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
250 aliases = ['moocode']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
251 mimetypes = ['text/x-moocode']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
252
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
253 tokens = {
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
254 'root' : [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
255 # Numbers
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
256 (r'(0|[1-9][0-9_]*)', Number.Integer),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
257 # Strings
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
258 (r'"(\\\\|\\"|[^"])*"', String),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
259 # exceptions
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
260 (r'(E_PERM|E_DIV)', Name.Exception),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
261 # db-refs
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
262 (r'((#[-0-9]+)|(\$[a-z_A-Z0-9]+))', Name.Entity),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
263 # Keywords
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
264 (r'\b(if|else|elseif|endif|for|endfor|fork|endfork|while'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
265 r'|endwhile|break|continue|return|try'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
266 r'|except|endtry|finally|in)\b', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
267 # builtins
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
268 (r'(random|length)', Name.Builtin),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
269 # special variables
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
270 (r'(player|caller|this|args)', Name.Variable.Instance),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
271 # skip whitespace
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
272 (r'\s+', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
273 (r'\n', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
274 # other operators
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
275 (r'([!;=,{}&\|:\.\[\]@\(\)\<\>\?]+)', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
276 # function call
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
277 (r'([a-z_A-Z0-9]+)(\()', bygroups(Name.Function, Operator)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
278 # variables
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
279 (r'([a-zA-Z_0-9]+)', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
280 ]
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
281 }
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
282
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
283
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
284 class SmalltalkLexer(RegexLexer):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
285 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
286 For `Smalltalk <http://www.smalltalk.org/>`_ syntax.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
287 Contributed by Stefan Matthias Aust.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
288 Rewritten by Nils Winter.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
289
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
290 *New in Pygments 0.10.*
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
291 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
292 name = 'Smalltalk'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
293 filenames = ['*.st']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
294 aliases = ['smalltalk', 'squeak']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
295 mimetypes = ['text/x-smalltalk']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
296
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
297 tokens = {
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
298 'root' : [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
299 (r'(<)(\w+:)(.*?)(>)', bygroups(Text, Keyword, Text, Text)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
300 include('squeak fileout'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
301 include('whitespaces'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
302 include('method definition'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
303 (r'(\|)([\w\s]*)(\|)', bygroups(Operator, Name.Variable, Operator)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
304 include('objects'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
305 (r'\^|\:=|\_', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
306 # temporaries
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
307 (r'[\]({}.;!]', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
308 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
309 'method definition' : [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
310 # Not perfect can't allow whitespaces at the beginning and the
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
311 # without breaking everything
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
312 (r'([a-zA-Z]+\w*:)(\s*)(\w+)',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
313 bygroups(Name.Function, Text, Name.Variable)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
314 (r'^(\b[a-zA-Z]+\w*\b)(\s*)$', bygroups(Name.Function, Text)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
315 (r'^([-+*/\\~<>=|&!?,@%]+)(\s*)(\w+)(\s*)$',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
316 bygroups(Name.Function, Text, Name.Variable, Text)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
317 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
318 'blockvariables' : [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
319 include('whitespaces'),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
320 (r'(:)(\s*)(\w+)',
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
321 bygroups(Operator, Text, Name.Variable)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
322 (r'\|', Operator, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
323 (r'', Text, '#pop'), # else pop
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
324 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
325 'literals' : [
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
326 (r"'(''|[^'])*'", String, 'afterobject'),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
327 (r'\$.', String.Char, 'afterobject'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
328 (r'#\(', String.Symbol, 'parenth'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
329 (r'\)', Text, 'afterobject'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
330 (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number, 'afterobject'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
331 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
332 '_parenth_helper' : [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
333 include('whitespaces'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
334 (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
335 (r'[-+*/\\~<>=|&#!?,@%\w:]+', String.Symbol),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
336 # literals
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
337 (r"'(''|[^'])*'", String),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
338 (r'\$.', String.Char),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
339 (r'#*\(', String.Symbol, 'inner_parenth'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
340 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
341 'parenth' : [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
342 # This state is a bit tricky since
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
343 # we can't just pop this state
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
344 (r'\)', String.Symbol, ('root', 'afterobject')),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
345 include('_parenth_helper'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
346 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
347 'inner_parenth': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
348 (r'\)', String.Symbol, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
349 include('_parenth_helper'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
350 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
351 'whitespaces' : [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
352 # skip whitespace and comments
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
353 (r'\s+', Text),
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
354 (r'"(""|[^"])*"', Comment),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
355 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
356 'objects' : [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
357 (r'\[', Text, 'blockvariables'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
358 (r'\]', Text, 'afterobject'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
359 (r'\b(self|super|true|false|nil|thisContext)\b',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
360 Name.Builtin.Pseudo, 'afterobject'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
361 (r'\b[A-Z]\w*(?!:)\b', Name.Class, 'afterobject'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
362 (r'\b[a-z]\w*(?!:)\b', Name.Variable, 'afterobject'),
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
363 (r'#("(""|[^"])*"|[-+*/\\~<>=|&!?,@%]+|[\w:]+)',
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
364 String.Symbol, 'afterobject'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
365 include('literals'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
366 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
367 'afterobject' : [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
368 (r'! !$', Keyword , '#pop'), # squeak chunk delimeter
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
369 include('whitespaces'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
370 (r'\b(ifTrue:|ifFalse:|whileTrue:|whileFalse:|timesRepeat:)',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
371 Name.Builtin, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
372 (r'\b(new\b(?!:))', Name.Builtin),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
373 (r'\:=|\_', Operator, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
374 (r'\b[a-zA-Z]+\w*:', Name.Function, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
375 (r'\b[a-zA-Z]+\w*', Name.Function),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
376 (r'\w+:?|[-+*/\\~<>=|&!?,@%]+', Name.Function, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
377 (r'\.', Punctuation, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
378 (r';', Punctuation),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
379 (r'[\])}]', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
380 (r'[\[({]', Text, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
381 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
382 'squeak fileout' : [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
383 # Squeak fileout format (optional)
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
384 (r'^"(""|[^"])*"!', Keyword),
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
385 (r"^'(''|[^'])*'!", Keyword),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
386 (r'^(!)(\w+)( commentStamp: )(.*?)( prior: .*?!\n)(.*?)(!)',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
387 bygroups(Keyword, Name.Class, Keyword, String, Keyword, Text, Keyword)),
2426
da76c71624de Updated to Pygments 1.6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1705
diff changeset
388 (r"^(!)(\w+(?: class)?)( methodsFor: )('(?:''|[^'])*')(.*?!)",
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
389 bygroups(Keyword, Name.Class, Keyword, String, Keyword)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
390 (r'^(\w+)( subclass: )(#\w+)'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
391 r'(\s+instanceVariableNames: )(.*?)'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
392 r'(\s+classVariableNames: )(.*?)'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
393 r'(\s+poolDictionaries: )(.*?)'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
394 r'(\s+category: )(.*?)(!)',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
395 bygroups(Name.Class, Keyword, String.Symbol, Keyword, String, Keyword,
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
396 String, Keyword, String, Keyword, String, Keyword)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
397 (r'^(\w+(?: class)?)(\s+instanceVariableNames: )(.*?)(!)',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
398 bygroups(Name.Class, Keyword, String, Keyword)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
399 (r'(!\n)(\].*)(! !)$', bygroups(Keyword, Text, Keyword)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
400 (r'! !$', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
401 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
402 }
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
403
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
404
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
405 class LogtalkLexer(RegexLexer):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
406 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
407 For `Logtalk <http://logtalk.org/>`_ source code.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
408
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
409 *New in Pygments 0.10.*
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
410 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
411
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
412 name = 'Logtalk'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
413 aliases = ['logtalk']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
414 filenames = ['*.lgt']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
415 mimetypes = ['text/x-logtalk']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
416
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
417 tokens = {
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
418 'root': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
419 # Directives
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
420 (r'^\s*:-\s',Punctuation,'directive'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
421 # Comments
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
422 (r'%.*?\n', Comment),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
423 (r'/\*(.|\n)*?\*/',Comment),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
424 # Whitespace
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
425 (r'\n', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
426 (r'\s+', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
427 # Numbers
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
428 (r"0'.", Number),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
429 (r'0b[01]+', Number),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
430 (r'0o[0-7]+', Number),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
431 (r'0x[0-9a-fA-F]+', Number),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
432 (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
433 # Variables
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
434 (r'([A-Z_][a-zA-Z0-9_]*)', Name.Variable),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
435 # Event handlers
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
436 (r'(after|before)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
437 # Execution-context methods
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
438 (r'(parameter|this|se(lf|nder))(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
439 # Reflection
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
440 (r'(current_predicate|predicate_property)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
441 # DCGs and term expansion
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
442 (r'(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
443 Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
444 # Entity
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
445 (r'(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
446 Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
447 (r'(object|protocol|category)_property(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
448 # Entity relations
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
449 (r'co(mplements_object|nforms_to_protocol)(?=[(])', Keyword),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
450 (r'extends_(object|protocol|category)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
451 (r'imp(lements_protocol|orts_category)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
452 (r'(instantiat|specializ)es_class(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
453 # Events
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
454 (r'(current_event|(abolish|define)_events)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
455 # Flags
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
456 (r'(current|set)_logtalk_flag(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
457 # Compiling, loading, and library paths
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
458 (r'logtalk_(compile|l(ibrary_path|oad_context|oad))(?=[(])',
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
459 Keyword),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
460 # Database
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
461 (r'(clause|retract(all)?)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
462 (r'a(bolish|ssert(a|z))(?=[(])', Keyword),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
463 # Control constructs
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
464 (r'(ca(ll|tch)|throw)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
465 (r'(fail|true)\b', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
466 # All solutions
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
467 (r'((bag|set)of|f(ind|or)all)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
468 # Multi-threading meta-predicates
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
469 (r'threaded(_(call|once|ignore|exit|peek|wait|notify))?(?=[(])',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
470 Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
471 # Term unification
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
472 (r'unify_with_occurs_check(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
473 # Term creation and decomposition
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
474 (r'(functor|arg|copy_term|numbervars)(?=[(])', Keyword),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
475 # Evaluable functors
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
476 (r'(rem|mod|abs|sign)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
477 (r'float(_(integer|fractional)_part)?(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
478 (r'(floor|truncate|round|ceiling)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
479 # Other arithmetic functors
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
480 (r'(cos|atan|exp|log|s(in|qrt))(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
481 # Term testing
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
482 (r'(var|atom(ic)?|integer|float|c(allable|ompound)|n(onvar|umber)|'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
483 r'ground)(?=[(])', Keyword),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
484 # Term comparison
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
485 (r'compare(?=[(])', Keyword),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
486 # Stream selection and control
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
487 (r'(curren|se)t_(in|out)put(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
488 (r'(open|close)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
489 (r'flush_output(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
490 (r'(at_end_of_stream|flush_output)\b', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
491 (r'(stream_property|at_end_of_stream|set_stream_position)(?=[(])',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
492 Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
493 # Character and byte input/output
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
494 (r'(nl|(get|peek|put)_(byte|c(har|ode)))(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
495 (r'\bnl\b', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
496 # Term input/output
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
497 (r'read(_term)?(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
498 (r'write(q|_(canonical|term))?(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
499 (r'(current_)?op(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
500 (r'(current_)?char_conversion(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
501 # Atomic term processing
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
502 (r'atom_(length|c(hars|o(ncat|des)))(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
503 (r'(char_code|sub_atom)(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
504 (r'number_c(har|ode)s(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
505 # Implementation defined hooks functions
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
506 (r'(se|curren)t_prolog_flag(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
507 (r'\bhalt\b', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
508 (r'halt(?=[(])', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
509 # Message sending operators
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
510 (r'(::|:|\^\^)', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
511 # External call
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
512 (r'[{}]', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
513 # Logic and control
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
514 (r'\b(ignore|once)(?=[(])', Keyword),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
515 (r'\brepeat\b', Keyword),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
516 # Sorting
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
517 (r'(key)?sort(?=[(])', Keyword),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
518 # Bitwise functors
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
519 (r'(>>|<<|/\\|\\\\|\\)', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
520 # Arithemtic evaluation
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
521 (r'\bis\b', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
522 # Arithemtic comparison
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
523 (r'(=:=|=\\=|<|=<|>=|>)', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
524 # Term creation and decomposition
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
525 (r'=\.\.', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
526 # Term unification
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
527 (r'(=|\\=)', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
528 # Term comparison
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
529 (r'(==|\\==|@=<|@<|@>=|@>)', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
530 # Evaluable functors
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
531 (r'(//|[-+*/])', Operator),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
532 (r'\b(e|pi|mod|rem)\b', Operator),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
533 # Other arithemtic functors
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
534 (r'\b\*\*\b', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
535 # DCG rules
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
536 (r'-->', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
537 # Control constructs
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
538 (r'([!;]|->)', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
539 # Logic and control
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
540 (r'\\+', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
541 # Mode operators
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
542 (r'[?@]', Operator),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
543 # Existential quantifier
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
544 (r'\^', Operator),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
545 # Strings
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
546 (r'"(\\\\|\\"|[^"])*"', String),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
547 # Ponctuation
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
548 (r'[()\[\],.|]', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
549 # Atoms
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
550 (r"[a-z][a-zA-Z0-9_]*", Text),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
551 (r"'", String, 'quoted_atom'),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
552 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
553
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
554 'quoted_atom': [
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
555 (r"''", String),
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
556 (r"'", String, '#pop'),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
557 (r'\\([\\abfnrtv"\']|(x[a-fA-F0-9]+|[0-7]+)\\)', String.Escape),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
558 (r"[^\\'\n]+", String),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
559 (r'\\', String),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
560 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
561
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
562 'directive': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
563 # Conditional compilation directives
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
564 (r'(el)?if(?=[(])', Keyword, 'root'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
565 (r'(e(lse|ndif))[.]', Keyword, 'root'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
566 # Entity directives
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
567 (r'(category|object|protocol)(?=[(])', Keyword, 'entityrelations'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
568 (r'(end_(category|object|protocol))[.]',Keyword, 'root'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
569 # Predicate scope directives
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
570 (r'(public|protected|private)(?=[(])', Keyword, 'root'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
571 # Other directives
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
572 (r'e(n(coding|sure_loaded)|xport)(?=[(])', Keyword, 'root'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
573 (r'in(fo|itialization)(?=[(])', Keyword, 'root'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
574 (r'(dynamic|synchronized|threaded)[.]', Keyword, 'root'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
575 (r'(alias|d(ynamic|iscontiguous)|m(eta_predicate|ode|ultifile)|'
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
576 r's(et_(logtalk|prolog)_flag|ynchronized))(?=[(])',
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
577 Keyword, 'root'),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
578 (r'op(?=[(])', Keyword, 'root'),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
579 (r'(c(alls|oinductive)|reexport|use(s|_module))(?=[(])',
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
580 Keyword, 'root'),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
581 (r'[a-z][a-zA-Z0-9_]*(?=[(])', Text, 'root'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
582 (r'[a-z][a-zA-Z0-9_]*[.]', Text, 'root'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
583 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
584
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
585 'entityrelations': [
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
586 (r'(complements|extends|i(nstantiates|mp(lements|orts))|specializes)'
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
587 r'(?=[(])', Keyword),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
588 # Numbers
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
589 (r"0'.", Number),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
590 (r'0b[01]+', Number),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
591 (r'0o[0-7]+', Number),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
592 (r'0x[0-9a-fA-F]+', Number),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
593 (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
594 # Variables
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
595 (r'([A-Z_][a-zA-Z0-9_]*)', Name.Variable),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
596 # Atoms
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
597 (r"[a-z][a-zA-Z0-9_]*", Text),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
598 (r"'", String, 'quoted_atom'),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
599 # Strings
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
600 (r'"(\\\\|\\"|[^"])*"', String),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
601 # End of entity-opening directive
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
602 (r'([)]\.)', Text, 'root'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
603 # Scope operator
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
604 (r'(::)', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
605 # Ponctuation
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
606 (r'[()\[\],.|]', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
607 # Comments
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
608 (r'%.*?\n', Comment),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
609 (r'/\*(.|\n)*?\*/',Comment),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
610 # Whitespace
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
611 (r'\n', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
612 (r'\s+', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
613 ]
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
614 }
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
615
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
616 def analyse_text(text):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
617 if ':- object(' in text:
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
618 return True
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
619 if ':- protocol(' in text:
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
620 return True
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
621 if ':- category(' in text:
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
622 return True
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
623 return False
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
624
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
625
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
626 def _shortened(word):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
627 dpos = word.find('$')
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
628 return '|'.join([word[:dpos] + word[dpos+1:i] + r'\b'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
629 for i in range(len(word), dpos, -1)])
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
630 def _shortened_many(*words):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
631 return '|'.join(map(_shortened, words))
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
632
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
633 class GnuplotLexer(RegexLexer):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
634 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
635 For `Gnuplot <http://gnuplot.info/>`_ plotting scripts.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
636
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
637 *New in Pygments 0.11.*
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
638 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
639
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
640 name = 'Gnuplot'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
641 aliases = ['gnuplot']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
642 filenames = ['*.plot', '*.plt']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
643 mimetypes = ['text/x-gnuplot']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
644
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
645 tokens = {
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
646 'root': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
647 include('whitespace'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
648 (_shortened('bi$nd'), Keyword, 'bind'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
649 (_shortened_many('ex$it', 'q$uit'), Keyword, 'quit'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
650 (_shortened('f$it'), Keyword, 'fit'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
651 (r'(if)(\s*)(\()', bygroups(Keyword, Text, Punctuation), 'if'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
652 (r'else\b', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
653 (_shortened('pa$use'), Keyword, 'pause'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
654 (_shortened_many('p$lot', 'rep$lot', 'sp$lot'), Keyword, 'plot'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
655 (_shortened('sa$ve'), Keyword, 'save'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
656 (_shortened('se$t'), Keyword, ('genericargs', 'optionarg')),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
657 (_shortened_many('sh$ow', 'uns$et'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
658 Keyword, ('noargs', 'optionarg')),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
659 (_shortened_many('low$er', 'ra$ise', 'ca$ll', 'cd$', 'cl$ear',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
660 'h$elp', '\\?$', 'hi$story', 'l$oad', 'pr$int',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
661 'pwd$', 're$read', 'res$et', 'scr$eendump',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
662 'she$ll', 'sy$stem', 'up$date'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
663 Keyword, 'genericargs'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
664 (_shortened_many('pwd$', 're$read', 'res$et', 'scr$eendump',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
665 'she$ll', 'test$'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
666 Keyword, 'noargs'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
667 ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*)(=)',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
668 bygroups(Name.Variable, Text, Operator), 'genericargs'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
669 ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*\(.*?\)\s*)(=)',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
670 bygroups(Name.Function, Text, Operator), 'genericargs'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
671 (r'@[a-zA-Z_][a-zA-Z0-9_]*', Name.Constant), # macros
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
672 (r';', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
673 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
674 'comment': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
675 (r'[^\\\n]', Comment),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
676 (r'\\\n', Comment),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
677 (r'\\', Comment),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
678 # don't add the newline to the Comment token
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
679 ('', Comment, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
680 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
681 'whitespace': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
682 ('#', Comment, 'comment'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
683 (r'[ \t\v\f]+', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
684 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
685 'noargs': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
686 include('whitespace'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
687 # semicolon and newline end the argument list
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
688 (r';', Punctuation, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
689 (r'\n', Text, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
690 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
691 'dqstring': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
692 (r'"', String, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
693 (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
694 (r'[^\\"\n]+', String), # all other characters
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
695 (r'\\\n', String), # line continuation
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
696 (r'\\', String), # stray backslash
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
697 (r'\n', String, '#pop'), # newline ends the string too
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
698 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
699 'sqstring': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
700 (r"''", String), # escaped single quote
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
701 (r"'", String, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
702 (r"[^\\'\n]+", String), # all other characters
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
703 (r'\\\n', String), # line continuation
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
704 (r'\\', String), # normal backslash
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
705 (r'\n', String, '#pop'), # newline ends the string too
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
706 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
707 'genericargs': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
708 include('noargs'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
709 (r'"', String, 'dqstring'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
710 (r"'", String, 'sqstring'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
711 (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
712 (r'(\d+\.\d*|\.\d+)', Number.Float),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
713 (r'-?\d+', Number.Integer),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
714 ('[,.~!%^&*+=|?:<>/-]', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
715 ('[{}()\[\]]', Punctuation),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
716 (r'(eq|ne)\b', Operator.Word),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
717 (r'([a-zA-Z_][a-zA-Z0-9_]*)(\s*)(\()',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
718 bygroups(Name.Function, Text, Punctuation)),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
719 (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
720 (r'@[a-zA-Z_][a-zA-Z0-9_]*', Name.Constant), # macros
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
721 (r'\\\n', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
722 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
723 'optionarg': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
724 include('whitespace'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
725 (_shortened_many(
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
726 "a$ll","an$gles","ar$row","au$toscale","b$ars","bor$der",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
727 "box$width","cl$abel","c$lip","cn$trparam","co$ntour","da$ta",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
728 "data$file","dg$rid3d","du$mmy","enc$oding","dec$imalsign",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
729 "fit$","font$path","fo$rmat","fu$nction","fu$nctions","g$rid",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
730 "hid$den3d","his$torysize","is$osamples","k$ey","keyt$itle",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
731 "la$bel","li$nestyle","ls$","loa$dpath","loc$ale","log$scale",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
732 "mac$ros","map$ping","map$ping3d","mar$gin","lmar$gin",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
733 "rmar$gin","tmar$gin","bmar$gin","mo$use","multi$plot",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
734 "mxt$ics","nomxt$ics","mx2t$ics","nomx2t$ics","myt$ics",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
735 "nomyt$ics","my2t$ics","nomy2t$ics","mzt$ics","nomzt$ics",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
736 "mcbt$ics","nomcbt$ics","of$fsets","or$igin","o$utput",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
737 "pa$rametric","pm$3d","pal$ette","colorb$ox","p$lot",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
738 "poi$ntsize","pol$ar","pr$int","obj$ect","sa$mples","si$ze",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
739 "st$yle","su$rface","table$","t$erminal","termo$ptions","ti$cs",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
740 "ticsc$ale","ticsl$evel","timef$mt","tim$estamp","tit$le",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
741 "v$ariables","ve$rsion","vi$ew","xyp$lane","xda$ta","x2da$ta",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
742 "yda$ta","y2da$ta","zda$ta","cbda$ta","xl$abel","x2l$abel",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
743 "yl$abel","y2l$abel","zl$abel","cbl$abel","xti$cs","noxti$cs",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
744 "x2ti$cs","nox2ti$cs","yti$cs","noyti$cs","y2ti$cs","noy2ti$cs",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
745 "zti$cs","nozti$cs","cbti$cs","nocbti$cs","xdti$cs","noxdti$cs",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
746 "x2dti$cs","nox2dti$cs","ydti$cs","noydti$cs","y2dti$cs",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
747 "noy2dti$cs","zdti$cs","nozdti$cs","cbdti$cs","nocbdti$cs",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
748 "xmti$cs","noxmti$cs","x2mti$cs","nox2mti$cs","ymti$cs",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
749 "noymti$cs","y2mti$cs","noy2mti$cs","zmti$cs","nozmti$cs",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
750 "cbmti$cs","nocbmti$cs","xr$ange","x2r$ange","yr$ange",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
751 "y2r$ange","zr$ange","cbr$ange","rr$ange","tr$ange","ur$ange",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
752 "vr$ange","xzeroa$xis","x2zeroa$xis","yzeroa$xis","y2zeroa$xis",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
753 "zzeroa$xis","zeroa$xis","z$ero"), Name.Builtin, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
754 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
755 'bind': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
756 ('!', Keyword, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
757 (_shortened('all$windows'), Name.Builtin),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
758 include('genericargs'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
759 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
760 'quit': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
761 (r'gnuplot\b', Keyword),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
762 include('noargs'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
763 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
764 'fit': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
765 (r'via\b', Name.Builtin),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
766 include('plot'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
767 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
768 'if': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
769 (r'\)', Punctuation, '#pop'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
770 include('genericargs'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
771 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
772 'pause': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
773 (r'(mouse|any|button1|button2|button3)\b', Name.Builtin),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
774 (_shortened('key$press'), Name.Builtin),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
775 include('genericargs'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
776 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
777 'plot': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
778 (_shortened_many('ax$es', 'axi$s', 'bin$ary', 'ev$ery', 'i$ndex',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
779 'mat$rix', 's$mooth', 'thru$', 't$itle',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
780 'not$itle', 'u$sing', 'w$ith'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
781 Name.Builtin),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
782 include('genericargs'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
783 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
784 'save': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
785 (_shortened_many('f$unctions', 's$et', 't$erminal', 'v$ariables'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
786 Name.Builtin),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
787 include('genericargs'),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
788 ],
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
789 }
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
790
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
791
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
792 class PovrayLexer(RegexLexer):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
793 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
794 For `Persistence of Vision Raytracer <http://www.povray.org/>`_ files.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
795
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
796 *New in Pygments 0.11.*
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
797 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
798 name = 'POVRay'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
799 aliases = ['pov']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
800 filenames = ['*.pov', '*.inc']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
801 mimetypes = ['text/x-povray']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
802
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
803 tokens = {
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
804 'root': [
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
805 (r'/\*[\w\W]*?\*/', Comment.Multiline),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
806 (r'//.*\n', Comment.Single),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
807 (r'(?s)"(?:\\.|[^"\\])+"', String.Double),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
808 (r'#(debug|default|else|end|error|fclose|fopen|ifdef|ifndef|'
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
809 r'include|range|read|render|statistics|switch|undef|version|'
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
810 r'warning|while|write|define|macro|local|declare)\b',
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
811 Comment.Preproc),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
812 (r'\b(aa_level|aa_threshold|abs|acos|acosh|adaptive|adc_bailout|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
813 r'agate|agate_turb|all|alpha|ambient|ambient_light|angle|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
814 r'aperture|arc_angle|area_light|asc|asin|asinh|assumed_gamma|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
815 r'atan|atan2|atanh|atmosphere|atmospheric_attenuation|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
816 r'attenuating|average|background|black_hole|blue|blur_samples|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
817 r'bounded_by|box_mapping|bozo|break|brick|brick_size|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
818 r'brightness|brilliance|bumps|bumpy1|bumpy2|bumpy3|bump_map|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
819 r'bump_size|case|caustics|ceil|checker|chr|clipped_by|clock|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
820 r'color|color_map|colour|colour_map|component|composite|concat|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
821 r'confidence|conic_sweep|constant|control0|control1|cos|cosh|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
822 r'count|crackle|crand|cube|cubic_spline|cylindrical_mapping|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
823 r'debug|declare|default|degrees|dents|diffuse|direction|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
824 r'distance|distance_maximum|div|dust|dust_type|eccentricity|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
825 r'else|emitting|end|error|error_bound|exp|exponent|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
826 r'fade_distance|fade_power|falloff|falloff_angle|false|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
827 r'file_exists|filter|finish|fisheye|flatness|flip|floor|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
828 r'focal_point|fog|fog_alt|fog_offset|fog_type|frequency|gif|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
829 r'global_settings|glowing|gradient|granite|gray_threshold|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
830 r'green|halo|hexagon|hf_gray_16|hierarchy|hollow|hypercomplex|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
831 r'if|ifdef|iff|image_map|incidence|include|int|interpolate|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
832 r'inverse|ior|irid|irid_wavelength|jitter|lambda|leopard|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
833 r'linear|linear_spline|linear_sweep|location|log|looks_like|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
834 r'look_at|low_error_factor|mandel|map_type|marble|material_map|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
835 r'matrix|max|max_intersections|max_iteration|max_trace_level|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
836 r'max_value|metallic|min|minimum_reuse|mod|mortar|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
837 r'nearest_count|no|normal|normal_map|no_shadow|number_of_waves|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
838 r'octaves|off|offset|omega|omnimax|on|once|onion|open|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
839 r'orthographic|panoramic|pattern1|pattern2|pattern3|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
840 r'perspective|pgm|phase|phong|phong_size|pi|pigment|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
841 r'pigment_map|planar_mapping|png|point_at|pot|pow|ppm|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
842 r'precision|pwr|quadratic_spline|quaternion|quick_color|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
843 r'quick_colour|quilted|radial|radians|radiosity|radius|rainbow|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
844 r'ramp_wave|rand|range|reciprocal|recursion_limit|red|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
845 r'reflection|refraction|render|repeat|rgb|rgbf|rgbft|rgbt|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
846 r'right|ripples|rotate|roughness|samples|scale|scallop_wave|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
847 r'scattering|seed|shadowless|sin|sine_wave|sinh|sky|sky_sphere|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
848 r'slice|slope_map|smooth|specular|spherical_mapping|spiral|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
849 r'spiral1|spiral2|spotlight|spotted|sqr|sqrt|statistics|str|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
850 r'strcmp|strength|strlen|strlwr|strupr|sturm|substr|switch|sys|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
851 r't|tan|tanh|test_camera_1|test_camera_2|test_camera_3|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
852 r'test_camera_4|texture|texture_map|tga|thickness|threshold|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
853 r'tightness|tile2|tiles|track|transform|translate|transmit|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
854 r'triangle_wave|true|ttf|turbulence|turb_depth|type|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
855 r'ultra_wide_angle|up|use_color|use_colour|use_index|u_steps|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
856 r'val|variance|vaxis_rotate|vcross|vdot|version|vlength|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
857 r'vnormalize|volume_object|volume_rendered|vol_with_light|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
858 r'vrotate|v_steps|warning|warp|water_level|waves|while|width|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
859 r'wood|wrinkles|yes)\b', Keyword),
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
860 (r'(bicubic_patch|blob|box|camera|cone|cubic|cylinder|difference|'
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
861 r'disc|height_field|intersection|julia_fractal|lathe|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
862 r'light_source|merge|mesh|object|plane|poly|polygon|prism|'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
863 r'quadric|quartic|smooth_triangle|sor|sphere|superellipsoid|'
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
864 r'text|torus|triangle|union)\b', Name.Builtin),
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
865 # TODO: <=, etc
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
866 (r'[\[\](){}<>;,]', Punctuation),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
867 (r'[-+*/=]', Operator),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
868 (r'\b(x|y|z|u|v)\b', Name.Builtin.Pseudo),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
869 (r'[a-zA-Z_][a-zA-Z_0-9]*', Name),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
870 (r'[0-9]+\.[0-9]*', Number.Float),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
871 (r'\.[0-9]+', Number.Float),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
872 (r'[0-9]+', Number.Integer),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
873 (r'\s+', Text),
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
874 ]
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
875 }
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
876
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
877
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
878 class AppleScriptLexer(RegexLexer):
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
879 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
880 For `AppleScript source code
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
881 <http://developer.apple.com/documentation/AppleScript/
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
882 Conceptual/AppleScriptLangGuide>`_,
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
883 including `AppleScript Studio
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
884 <http://developer.apple.com/documentation/AppleScript/
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
885 Reference/StudioReference>`_.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
886 Contributed by Andreas Amann <aamann@mac.com>.
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
887 """
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
888
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
889 name = 'AppleScript'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
890 aliases = ['applescript']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
891 filenames = ['*.applescript']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
892
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
893 flags = re.MULTILINE | re.DOTALL
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
894
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
895 Identifiers = r'[a-zA-Z]\w*'
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
896 Literals = ['AppleScript', 'current application', 'false', 'linefeed',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
897 'missing value', 'pi','quote', 'result', 'return', 'space',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
898 'tab', 'text item delimiters', 'true', 'version']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
899 Classes = ['alias ', 'application ', 'boolean ', 'class ', 'constant ',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
900 'date ', 'file ', 'integer ', 'list ', 'number ', 'POSIX file ',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
901 'real ', 'record ', 'reference ', 'RGB color ', 'script ',
1705
b0fbc9300f2b Update to Pygments 1.5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 808
diff changeset
902 'text ', 'unit types', '(?:Unicode )?text', 'string']
808
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
903 BuiltIn = ['attachment', 'attribute run', 'character', 'day', 'month',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
904 'paragraph', 'word', 'year']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
905 HandlerParams = ['about', 'above', 'against', 'apart from', 'around',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
906 'aside from', 'at', 'below', 'beneath', 'beside',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
907 'between', 'for', 'given', 'instead of', 'on', 'onto',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
908 'out of', 'over', 'since']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
909 Commands = ['ASCII (character|number)', 'activate', 'beep', 'choose URL',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
910 'choose application', 'choose color', 'choose file( name)?',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
911 'choose folder', 'choose from list',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
912 'choose remote application', 'clipboard info',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
913 'close( access)?', 'copy', 'count', 'current date', 'delay',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
914 'delete', 'display (alert|dialog)', 'do shell script',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
915 'duplicate', 'exists', 'get eof', 'get volume settings',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
916 'info for', 'launch', 'list (disks|folder)', 'load script',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
917 'log', 'make', 'mount volume', 'new', 'offset',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
918 'open( (for access|location))?', 'path to', 'print', 'quit',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
919 'random number', 'read', 'round', 'run( script)?',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
920 'say', 'scripting components',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
921 'set (eof|the clipboard to|volume)', 'store script',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
922 'summarize', 'system attribute', 'system info',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
923 'the clipboard', 'time to GMT', 'write', 'quoted form']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
924 References = ['(in )?back of', '(in )?front of', '[0-9]+(st|nd|rd|th)',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
925 'first', 'second', 'third', 'fourth', 'fifth', 'sixth',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
926 'seventh', 'eighth', 'ninth', 'tenth', 'after', 'back',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
927 'before', 'behind', 'every', 'front', 'index', 'last',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
928 'middle', 'some', 'that', 'through', 'thru', 'where', 'whose']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
929 Operators = ["and", "or", "is equal", "equals", "(is )?equal to", "is not",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
930 "isn't", "isn't equal( to)?", "is not equal( to)?",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
931 "doesn't equal", "does not equal", "(is )?greater than",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
932 "comes after", "is not less than or equal( to)?",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
933 "isn't less than or equal( to)?", "(is )?less than",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
934 "comes before", "is not greater than or equal( to)?",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
935 "isn't greater than or equal( to)?",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
936 "(is )?greater than or equal( to)?", "is not less than",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
937 "isn't less than", "does not come before",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
938 "doesn't come before", "(is )?less than or equal( to)?",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
939 "is not greater than", "isn't greater than",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
940 "does not come after", "doesn't come after", "starts? with",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
941 "begins? with", "ends? with", "contains?", "does not contain",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
942 "doesn't contain", "is in", "is contained by", "is not in",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
943 "is not contained by", "isn't contained by", "div", "mod",
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
944 "not", "(a )?(ref( to)?|reference to)", "is", "does"]
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
945 Control = ['considering', 'else', 'error', 'exit', 'from', 'if',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
946 'ignoring', 'in', 'repeat', 'tell', 'then', 'times', 'to',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
947 'try', 'until', 'using terms from', 'while', 'whith',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
948 'with timeout( of)?', 'with transaction', 'by', 'continue',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
949 'end', 'its?', 'me', 'my', 'return', 'of' , 'as']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
950 Declarations = ['global', 'local', 'prop(erty)?', 'set', 'get']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
951 Reserved = ['but', 'put', 'returning', 'the']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
952 StudioClasses = ['action cell', 'alert reply', 'application', 'box',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
953 'browser( cell)?', 'bundle', 'button( cell)?', 'cell',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
954 'clip view', 'color well', 'color-panel',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
955 'combo box( item)?', 'control',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
956 'data( (cell|column|item|row|source))?', 'default entry',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
957 'dialog reply', 'document', 'drag info', 'drawer',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
958 'event', 'font(-panel)?', 'formatter',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
959 'image( (cell|view))?', 'matrix', 'menu( item)?', 'item',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
960 'movie( view)?', 'open-panel', 'outline view', 'panel',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
961 'pasteboard', 'plugin', 'popup button',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
962 'progress indicator', 'responder', 'save-panel',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
963 'scroll view', 'secure text field( cell)?', 'slider',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
964 'sound', 'split view', 'stepper', 'tab view( item)?',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
965 'table( (column|header cell|header view|view))',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
966 'text( (field( cell)?|view))?', 'toolbar( item)?',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
967 'user-defaults', 'view', 'window']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
968 StudioEvents = ['accept outline drop', 'accept table drop', 'action',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
969 'activated', 'alert ended', 'awake from nib', 'became key',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
970 'became main', 'begin editing', 'bounds changed',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
971 'cell value', 'cell value changed', 'change cell value',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
972 'change item value', 'changed', 'child of item',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
973 'choose menu item', 'clicked', 'clicked toolbar item',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
974 'closed', 'column clicked', 'column moved',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
975 'column resized', 'conclude drop', 'data representation',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
976 'deminiaturized', 'dialog ended', 'document nib name',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
977 'double clicked', 'drag( (entered|exited|updated))?',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
978 'drop', 'end editing', 'exposed', 'idle', 'item expandable',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
979 'item value', 'item value changed', 'items changed',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
980 'keyboard down', 'keyboard up', 'launched',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
981 'load data representation', 'miniaturized', 'mouse down',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
982 'mouse dragged', 'mouse entered', 'mouse exited',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
983 'mouse moved', 'mouse up', 'moved',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
984 'number of browser rows', 'number of items',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
985 'number of rows', 'open untitled', 'opened', 'panel ended',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
986 'parameters updated', 'plugin loaded', 'prepare drop',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
987 'prepare outline drag', 'prepare outline drop',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
988 'prepare table drag', 'prepare table drop',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
989 'read from file', 'resigned active', 'resigned key',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
990 'resigned main', 'resized( sub views)?',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
991 'right mouse down', 'right mouse dragged',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
992 'right mouse up', 'rows changed', 'scroll wheel',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
993 'selected tab view item', 'selection changed',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
994 'selection changing', 'should begin editing',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
995 'should close', 'should collapse item',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
996 'should end editing', 'should expand item',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
997 'should open( untitled)?',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
998 'should quit( after last window closed)?',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
999 'should select column', 'should select item',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1000 'should select row', 'should select tab view item',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1001 'should selection change', 'should zoom', 'shown',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1002 'update menu item', 'update parameters',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1003 'update toolbar item', 'was hidden', 'was miniaturized',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1004 'will become active', 'will close', 'will dismiss',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1005 'will display browser cell', 'will display cell',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1006 'will display item cell', 'will display outline cell',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1007 'will finish launching', 'will hide', 'will miniaturize',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1008 'will move', 'will open', 'will pop up', 'will quit',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1009 'will resign active', 'will resize( sub views)?',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1010 'will select tab view item', 'will show', 'will zoom',
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684
diff changeset
1011 'write to file', 'zoomed']
8f85926125ef Updated Pygments to version 1.4.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 684