pygments.rb 0.3.7 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +9 -0
- data/CHANGELOG.md +6 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/lexers +0 -0
- data/lib/pygments/version.rb +1 -1
- data/test/test_pygments.rb +0 -1
- data/vendor/pygments-main/AUTHORS +14 -1
- data/vendor/pygments-main/CHANGES +56 -6
- data/vendor/pygments-main/LICENSE +1 -1
- data/vendor/pygments-main/Makefile +1 -1
- data/vendor/pygments-main/REVISION +1 -0
- data/vendor/pygments-main/docs/generate.py +1 -1
- data/vendor/pygments-main/docs/src/api.txt +1 -1
- data/vendor/pygments-main/docs/src/index.txt +1 -1
- data/vendor/pygments-main/docs/src/integrate.txt +5 -0
- data/vendor/pygments-main/docs/src/java.txt +70 -0
- data/vendor/pygments-main/external/autopygmentize +64 -0
- data/vendor/pygments-main/external/markdown-processor.py +2 -2
- data/vendor/pygments-main/external/moin-parser.py +1 -1
- data/vendor/pygments-main/external/rst-directive-old.py +1 -1
- data/vendor/pygments-main/external/rst-directive.py +1 -1
- data/vendor/pygments-main/pygments/__init__.py +2 -2
- data/vendor/pygments-main/pygments/cmdline.py +14 -6
- data/vendor/pygments-main/pygments/console.py +1 -1
- data/vendor/pygments-main/pygments/filter.py +1 -1
- data/vendor/pygments-main/pygments/filters/__init__.py +1 -1
- data/vendor/pygments-main/pygments/formatter.py +1 -1
- data/vendor/pygments-main/pygments/formatters/__init__.py +1 -1
- data/vendor/pygments-main/pygments/formatters/_mapping.py +1 -1
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
- data/vendor/pygments-main/pygments/formatters/html.py +73 -2
- data/vendor/pygments-main/pygments/formatters/img.py +1 -1
- data/vendor/pygments-main/pygments/formatters/latex.py +1 -1
- data/vendor/pygments-main/pygments/formatters/other.py +1 -1
- data/vendor/pygments-main/pygments/formatters/rtf.py +1 -1
- data/vendor/pygments-main/pygments/formatters/svg.py +1 -1
- data/vendor/pygments-main/pygments/formatters/terminal.py +1 -1
- data/vendor/pygments-main/pygments/formatters/terminal256.py +1 -1
- data/vendor/pygments-main/pygments/lexer.py +76 -12
- data/vendor/pygments-main/pygments/lexers/__init__.py +2 -2
- data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +4 -1
- data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_mapping.py +26 -10
- data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +11 -0
- data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +2 -2
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +4 -2
- data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +14 -3
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +11 -0
- data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +2 -2
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +6 -6
- data/vendor/pygments-main/pygments/lexers/agile.py +6 -4
- data/vendor/pygments-main/pygments/lexers/asm.py +40 -2
- data/vendor/pygments-main/pygments/lexers/compiled.py +751 -438
- data/vendor/pygments-main/pygments/lexers/dalvik.py +2 -2
- data/vendor/pygments-main/pygments/lexers/dotnet.py +1 -1
- data/vendor/pygments-main/pygments/lexers/foxpro.py +428 -0
- data/vendor/pygments-main/pygments/lexers/functional.py +6 -5
- data/vendor/pygments-main/pygments/lexers/hdl.py +3 -3
- data/vendor/pygments-main/pygments/lexers/jvm.py +130 -16
- data/vendor/pygments-main/pygments/lexers/math.py +250 -9
- data/vendor/pygments-main/pygments/lexers/other.py +518 -13
- data/vendor/pygments-main/pygments/lexers/parsers.py +3 -2
- data/vendor/pygments-main/pygments/lexers/shell.py +48 -2
- data/vendor/pygments-main/pygments/lexers/special.py +1 -1
- data/vendor/pygments-main/pygments/lexers/sql.py +1 -1
- data/vendor/pygments-main/pygments/lexers/templates.py +7 -6
- data/vendor/pygments-main/pygments/lexers/text.py +9 -9
- data/vendor/pygments-main/pygments/lexers/web.py +264 -51
- data/vendor/pygments-main/pygments/plugin.py +1 -1
- data/vendor/pygments-main/pygments/scanner.py +1 -1
- data/vendor/pygments-main/pygments/style.py +1 -1
- data/vendor/pygments-main/pygments/styles/__init__.py +1 -1
- data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
- data/vendor/pygments-main/pygments/styles/borland.py +1 -1
- data/vendor/pygments-main/pygments/styles/bw.py +1 -1
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
- data/vendor/pygments-main/pygments/styles/default.py +1 -1
- data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
- data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
- data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
- data/vendor/pygments-main/pygments/styles/manni.py +1 -1
- data/vendor/pygments-main/pygments/styles/monokai.py +1 -1
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
- data/vendor/pygments-main/pygments/styles/native.py +1 -1
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
- data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
- data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
- data/vendor/pygments-main/pygments/styles/tango.py +1 -1
- data/vendor/pygments-main/pygments/styles/trac.py +1 -1
- data/vendor/pygments-main/pygments/styles/vim.py +1 -1
- data/vendor/pygments-main/pygments/styles/vs.py +1 -1
- data/vendor/pygments-main/pygments/token.py +1 -1
- data/vendor/pygments-main/pygments/unistring.py +1 -1
- data/vendor/pygments-main/pygments/util.py +1 -1
- data/vendor/pygments-main/scripts/check_sources.py +2 -2
- data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +2 -0
- data/vendor/pygments-main/scripts/find_codetags.py +1 -1
- data/vendor/pygments-main/scripts/find_error.py +5 -6
- data/vendor/pygments-main/setup.cfg +1 -0
- data/vendor/pygments-main/setup.py +6 -4
- data/vendor/pygments-main/tests/examplefiles/BOM.js +1 -0
- data/vendor/pygments-main/tests/examplefiles/autoit_submit.au3 +25 -0
- data/vendor/pygments-main/tests/examplefiles/bigtest.nsi +308 -0
- data/vendor/pygments-main/tests/examplefiles/ca65_example +284 -0
- data/vendor/pygments-main/tests/examplefiles/cbmbas_example +9 -0
- data/vendor/pygments-main/tests/examplefiles/classes.dylan +89 -4
- data/vendor/pygments-main/tests/examplefiles/example.cob +3556 -0
- data/vendor/pygments-main/tests/examplefiles/example.prg +161 -0
- data/vendor/pygments-main/tests/examplefiles/example.shell-session +45 -0
- data/vendor/pygments-main/tests/examplefiles/example.ts +28 -0
- data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +2 -2
- data/vendor/pygments-main/tests/examplefiles/logos_example.xm +28 -0
- data/vendor/pygments-main/tests/examplefiles/mg_sample.pro +73 -0
- data/vendor/pygments-main/tests/examplefiles/minehunt.qml +112 -0
- data/vendor/pygments-main/tests/examplefiles/nanomsg.intr +95 -0
- data/vendor/pygments-main/tests/examplefiles/phpMyAdmin.spec +163 -0
- data/vendor/pygments-main/tests/examplefiles/rust_example.rs +191 -701
- data/vendor/pygments-main/tests/examplefiles/session.dylan-console +9 -0
- data/vendor/pygments-main/tests/examplefiles/test.opa +10 -0
- data/vendor/pygments-main/tests/examplefiles/test2.pypylog +120 -0
- data/vendor/pygments-main/tests/examplefiles/unix-io.lid +37 -0
- data/vendor/pygments-main/tests/old_run.py +1 -1
- data/vendor/pygments-main/tests/run.py +3 -2
- data/vendor/pygments-main/tests/support/tags +36 -0
- data/vendor/pygments-main/tests/test_basic_api.py +3 -2
- data/vendor/pygments-main/tests/test_clexer.py +1 -1
- data/vendor/pygments-main/tests/test_cmdline.py +1 -1
- data/vendor/pygments-main/tests/test_examplefiles.py +1 -1
- data/vendor/pygments-main/tests/test_html_formatter.py +17 -1
- data/vendor/pygments-main/tests/test_latex_formatter.py +1 -1
- data/vendor/pygments-main/tests/test_perllexer.py +1 -1
- data/vendor/pygments-main/tests/test_regexlexer.py +1 -1
- data/vendor/pygments-main/tests/test_token.py +1 -1
- data/vendor/pygments-main/tests/test_using_api.py +1 -1
- data/vendor/pygments-main/tests/test_util.py +5 -4
- metadata +26 -2
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Lexers for other languages.
|
|
7
7
|
|
|
8
|
-
:copyright: Copyright 2006-
|
|
8
|
+
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
|
|
9
9
|
:license: BSD, see LICENSE for details.
|
|
10
10
|
"""
|
|
11
11
|
|
|
@@ -34,7 +34,8 @@ __all__ = ['BrainfuckLexer', 'BefungeLexer', 'RedcodeLexer', 'MOOCodeLexer',
|
|
|
34
34
|
'HybrisLexer', 'AwkLexer', 'Cfengine3Lexer', 'SnobolLexer',
|
|
35
35
|
'ECLLexer', 'UrbiscriptLexer', 'OpenEdgeLexer', 'BroLexer',
|
|
36
36
|
'MscgenLexer', 'KconfigLexer', 'VGLLexer', 'SourcePawnLexer',
|
|
37
|
-
'RobotFrameworkLexer'
|
|
37
|
+
'RobotFrameworkLexer', 'PuppetLexer', 'NSISLexer', 'RPMSpecLexer',
|
|
38
|
+
'CbmBasicV2Lexer', 'AutoItLexer']
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
class ECLLexer(RegexLexer):
|
|
@@ -1257,7 +1258,8 @@ class ModelicaLexer(RegexLexer):
|
|
|
1257
1258
|
],
|
|
1258
1259
|
'classes': [
|
|
1259
1260
|
(r'(block|class|connector|function|model|package|'
|
|
1260
|
-
r'record|type)\
|
|
1261
|
+
r'record|type)(\s+)([A-Za-z_]+)',
|
|
1262
|
+
bygroups(Keyword, Text, Name.Class))
|
|
1261
1263
|
],
|
|
1262
1264
|
'string': [
|
|
1263
1265
|
(r'"', String, '#pop'),
|
|
@@ -1485,9 +1487,9 @@ class RebolLexer(RegexLexer):
|
|
|
1485
1487
|
(r'}', Comment, '#pop'),
|
|
1486
1488
|
],
|
|
1487
1489
|
'commentBlock': [
|
|
1488
|
-
(r'\[',Comment, '#push'),
|
|
1489
|
-
(r'\]',Comment, '#pop'),
|
|
1490
|
-
(r'[^(\[\])]
|
|
1490
|
+
(r'\[', Comment, '#push'),
|
|
1491
|
+
(r'\]', Comment, '#pop'),
|
|
1492
|
+
(r'[^(\[\])]+', Comment),
|
|
1491
1493
|
],
|
|
1492
1494
|
}
|
|
1493
1495
|
|
|
@@ -1738,6 +1740,7 @@ class NewspeakLexer(RegexLexer):
|
|
|
1738
1740
|
]
|
|
1739
1741
|
}
|
|
1740
1742
|
|
|
1743
|
+
|
|
1741
1744
|
class GherkinLexer(RegexLexer):
|
|
1742
1745
|
"""
|
|
1743
1746
|
For `Gherkin <http://github.com/aslakhellesoy/gherkin/>` syntax.
|
|
@@ -1834,10 +1837,16 @@ class GherkinLexer(RegexLexer):
|
|
|
1834
1837
|
include('table_vars'),
|
|
1835
1838
|
include('numbers'),
|
|
1836
1839
|
(r'(\s*)(@[^@\r\n\t ]+)', bygroups(Name.Function, Name.Tag)),
|
|
1837
|
-
(step_keywords, bygroups(Name.Function, Keyword),
|
|
1838
|
-
|
|
1839
|
-
(
|
|
1840
|
-
|
|
1840
|
+
(step_keywords, bygroups(Name.Function, Keyword),
|
|
1841
|
+
'step_content_root'),
|
|
1842
|
+
(feature_keywords, bygroups(Keyword, Keyword, Name.Function),
|
|
1843
|
+
'narrative'),
|
|
1844
|
+
(feature_element_keywords,
|
|
1845
|
+
bygroups(Name.Function, Keyword, Keyword, Name.Function),
|
|
1846
|
+
'feature_elements'),
|
|
1847
|
+
(examples_keywords,
|
|
1848
|
+
bygroups(Name.Function, Keyword, Keyword, Name.Function),
|
|
1849
|
+
'examples_table'),
|
|
1841
1850
|
(r'(\s|.)', Name.Function),
|
|
1842
1851
|
]
|
|
1843
1852
|
}
|
|
@@ -2773,7 +2782,7 @@ class OpenEdgeLexer(RegexLexer):
|
|
|
2773
2782
|
|
|
2774
2783
|
keywords = (r'(?i)(^|(?<=[^0-9a-z_\-]))(' +
|
|
2775
2784
|
r'|'.join(OPENEDGEKEYWORDS) +
|
|
2776
|
-
r')\s*($|(?=[^0-9a-z_\-]))')
|
|
2785
|
+
r')\s*($|(?=[^0-9a-z_\-]))')
|
|
2777
2786
|
tokens = {
|
|
2778
2787
|
'root': [
|
|
2779
2788
|
(r'/\*', Comment.Multiline, 'comment'),
|
|
@@ -2836,7 +2845,7 @@ class BroLexer(RegexLexer):
|
|
|
2836
2845
|
r'|pattern|port|record|set|string|subnet|table|time|timer'
|
|
2837
2846
|
r'|vector)\b', Keyword.Type),
|
|
2838
2847
|
(r'(T|F)\b', Keyword.Constant),
|
|
2839
|
-
(r'(&)((?:add|delete|expire)_func|attr|(create|read|write)_expire'
|
|
2848
|
+
(r'(&)((?:add|delete|expire)_func|attr|(?:create|read|write)_expire'
|
|
2840
2849
|
r'|default|disable_print_hook|raw_output|encrypt|group|log'
|
|
2841
2850
|
r'|mergeable|optional|persistent|priority|redef'
|
|
2842
2851
|
r'|rotate_(?:interval|size)|synchronized)\b', bygroups(Punctuation,
|
|
@@ -2884,6 +2893,44 @@ class BroLexer(RegexLexer):
|
|
|
2884
2893
|
}
|
|
2885
2894
|
|
|
2886
2895
|
|
|
2896
|
+
class CbmBasicV2Lexer(RegexLexer):
|
|
2897
|
+
"""
|
|
2898
|
+
For CBM BASIC V2 sources.
|
|
2899
|
+
|
|
2900
|
+
*New in Pygments 1.6.*
|
|
2901
|
+
"""
|
|
2902
|
+
name = 'CBM BASIC V2'
|
|
2903
|
+
aliases = ['cbmbas']
|
|
2904
|
+
filenames = ['*.bas']
|
|
2905
|
+
|
|
2906
|
+
flags = re.IGNORECASE
|
|
2907
|
+
|
|
2908
|
+
tokens = {
|
|
2909
|
+
'root': [
|
|
2910
|
+
(r'rem.*\n', Comment.Single),
|
|
2911
|
+
(r'\s+', Text),
|
|
2912
|
+
(r'new|run|end|for|to|next|step|go(to|sub)?|on|return|stop|cont'
|
|
2913
|
+
r'|if|then|input#?|read|wait|load|save|verify|poke|sys|print#?'
|
|
2914
|
+
r'|list|clr|cmd|open|close|get#?', Keyword.Reserved),
|
|
2915
|
+
(r'data|restore|dim|let|def|fn', Keyword.Declaration),
|
|
2916
|
+
(r'tab|spc|sgn|int|abs|usr|fre|pos|sqr|rnd|log|exp|cos|sin|tan|atn'
|
|
2917
|
+
r'|peek|len|val|asc|(str|chr|left|right|mid)\$', Name.Builtin),
|
|
2918
|
+
(r'[-+*/^<>=]', Operator),
|
|
2919
|
+
(r'not|and|or', Operator.Word),
|
|
2920
|
+
(r'"[^"\n]*.', String),
|
|
2921
|
+
(r'\d+|[-+]?\d*\.\d*(e[-+]?\d+)?', Number.Float),
|
|
2922
|
+
(r'[\(\),:;]', Punctuation),
|
|
2923
|
+
(r'\w+[$%]?', Name),
|
|
2924
|
+
]
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
def analyse_text(self, text):
|
|
2928
|
+
# if it starts with a line number, it shouldn't be a "modern" Basic
|
|
2929
|
+
# like VB.net
|
|
2930
|
+
if re.match(r'\d+', text):
|
|
2931
|
+
return True
|
|
2932
|
+
|
|
2933
|
+
|
|
2887
2934
|
class MscgenLexer(RegexLexer):
|
|
2888
2935
|
"""
|
|
2889
2936
|
For `Mscgen <http://www.mcternan.me.uk/mscgen/>`_ files.
|
|
@@ -3158,5 +3205,463 @@ class SourcePawnLexer(RegexLexer):
|
|
|
3158
3205
|
if value in self.SM_TYPES:
|
|
3159
3206
|
token = Keyword.Type
|
|
3160
3207
|
elif value in self._functions:
|
|
3161
|
-
|
|
3208
|
+
token = Name.Builtin
|
|
3162
3209
|
yield index, token, value
|
|
3210
|
+
|
|
3211
|
+
|
|
3212
|
+
class PuppetLexer(RegexLexer):
|
|
3213
|
+
"""
|
|
3214
|
+
For `Puppet <http://puppetlabs.com/>`__ configuration DSL.
|
|
3215
|
+
|
|
3216
|
+
*New in Pygments 1.6.*
|
|
3217
|
+
"""
|
|
3218
|
+
name = 'Puppet'
|
|
3219
|
+
aliases = ['puppet']
|
|
3220
|
+
filenames = ['*.pp']
|
|
3221
|
+
|
|
3222
|
+
tokens = {
|
|
3223
|
+
'root': [
|
|
3224
|
+
include('comments'),
|
|
3225
|
+
include('keywords'),
|
|
3226
|
+
include('names'),
|
|
3227
|
+
include('numbers'),
|
|
3228
|
+
include('operators'),
|
|
3229
|
+
include('strings'),
|
|
3230
|
+
|
|
3231
|
+
(r'[]{}:(),;[]', Punctuation),
|
|
3232
|
+
(r'[^\S\n]+', Text),
|
|
3233
|
+
],
|
|
3234
|
+
|
|
3235
|
+
'comments': [
|
|
3236
|
+
(r'\s*#.*$', Comment),
|
|
3237
|
+
(r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
|
|
3238
|
+
],
|
|
3239
|
+
|
|
3240
|
+
'operators': [
|
|
3241
|
+
(r'(=>|\?|<|>|=|\+|-|/|\*|~|!|\|)', Operator),
|
|
3242
|
+
(r'(in|and|or|not)\b', Operator.Word),
|
|
3243
|
+
],
|
|
3244
|
+
|
|
3245
|
+
'names': [
|
|
3246
|
+
('[a-zA-Z_][a-zA-Z0-9_]*', Name.Attribute),
|
|
3247
|
+
(r'(\$\S+)(\[)(\S+)(\])', bygroups(Name.Variable, Punctuation,
|
|
3248
|
+
String, Punctuation)),
|
|
3249
|
+
(r'\$\S+', Name.Variable),
|
|
3250
|
+
],
|
|
3251
|
+
|
|
3252
|
+
'numbers': [
|
|
3253
|
+
# Copypasta from the Python lexer
|
|
3254
|
+
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?j?', Number.Float),
|
|
3255
|
+
(r'\d+[eE][+-]?[0-9]+j?', Number.Float),
|
|
3256
|
+
(r'0[0-7]+j?', Number.Oct),
|
|
3257
|
+
(r'0[xX][a-fA-F0-9]+', Number.Hex),
|
|
3258
|
+
(r'\d+L', Number.Integer.Long),
|
|
3259
|
+
(r'\d+j?', Number.Integer)
|
|
3260
|
+
],
|
|
3261
|
+
|
|
3262
|
+
'keywords': [
|
|
3263
|
+
# Left out 'group' and 'require'
|
|
3264
|
+
# Since they're often used as attributes
|
|
3265
|
+
(r'(?i)(absent|alert|alias|audit|augeas|before|case|check|class|'
|
|
3266
|
+
r'computer|configured|contained|create_resources|crit|cron|debug|'
|
|
3267
|
+
r'default|define|defined|directory|else|elsif|emerg|err|exec|'
|
|
3268
|
+
r'extlookup|fail|false|file|filebucket|fqdn_rand|generate|host|if|'
|
|
3269
|
+
r'import|include|info|inherits|inline_template|installed|'
|
|
3270
|
+
r'interface|k5login|latest|link|loglevel|macauthorization|'
|
|
3271
|
+
r'mailalias|maillist|mcx|md5|mount|mounted|nagios_command|'
|
|
3272
|
+
r'nagios_contact|nagios_contactgroup|nagios_host|'
|
|
3273
|
+
r'nagios_hostdependency|nagios_hostescalation|nagios_hostextinfo|'
|
|
3274
|
+
r'nagios_hostgroup|nagios_service|nagios_servicedependency|'
|
|
3275
|
+
r'nagios_serviceescalation|nagios_serviceextinfo|'
|
|
3276
|
+
r'nagios_servicegroup|nagios_timeperiod|node|noop|notice|notify|'
|
|
3277
|
+
r'package|present|purged|realize|regsubst|resources|role|router|'
|
|
3278
|
+
r'running|schedule|scheduled_task|search|selboolean|selmodule|'
|
|
3279
|
+
r'service|sha1|shellquote|split|sprintf|ssh_authorized_key|sshkey|'
|
|
3280
|
+
r'stage|stopped|subscribe|tag|tagged|template|tidy|true|undef|'
|
|
3281
|
+
r'unmounted|user|versioncmp|vlan|warning|yumrepo|zfs|zone|'
|
|
3282
|
+
r'zpool)\b', Keyword),
|
|
3283
|
+
],
|
|
3284
|
+
|
|
3285
|
+
'strings': [
|
|
3286
|
+
(r'"([^"])*"', String),
|
|
3287
|
+
(r'\'([^\'])*\'', String),
|
|
3288
|
+
],
|
|
3289
|
+
|
|
3290
|
+
}
|
|
3291
|
+
|
|
3292
|
+
|
|
3293
|
+
class NSISLexer(RegexLexer):
|
|
3294
|
+
"""
|
|
3295
|
+
For `NSIS <http://nsis.sourceforge.net/>`_ scripts.
|
|
3296
|
+
|
|
3297
|
+
*New in Pygments 1.6.*
|
|
3298
|
+
"""
|
|
3299
|
+
name = 'NSIS'
|
|
3300
|
+
aliases = ['nsis', 'nsi', 'nsh']
|
|
3301
|
+
filenames = ['*.nsi', '*.nsh']
|
|
3302
|
+
mimetypes = ['text/x-nsis']
|
|
3303
|
+
|
|
3304
|
+
flags = re.IGNORECASE
|
|
3305
|
+
|
|
3306
|
+
tokens = {
|
|
3307
|
+
'root': [
|
|
3308
|
+
(r'[;\#].*\n', Comment),
|
|
3309
|
+
(r"'.*'", String.Single),
|
|
3310
|
+
(r'"', String.Double, 'str_double'),
|
|
3311
|
+
(r'`', String.Backtick, 'str_backtick'),
|
|
3312
|
+
include('macro'),
|
|
3313
|
+
include('interpol'),
|
|
3314
|
+
include('basic'),
|
|
3315
|
+
(r'\$\{[a-z_|][\w|]*\}', Keyword.Pseudo),
|
|
3316
|
+
(r'/[a-z_]\w*', Name.Attribute),
|
|
3317
|
+
('.', Text),
|
|
3318
|
+
],
|
|
3319
|
+
'basic': [
|
|
3320
|
+
(r'(\n)(Function)(\s+)([._a-z][.\w]*)\b',
|
|
3321
|
+
bygroups(Text, Keyword, Text, Name.Function)),
|
|
3322
|
+
(r'\b([_a-z]\w*)(::)([a-z][a-z0-9]*)\b',
|
|
3323
|
+
bygroups(Keyword.Namespace, Punctuation, Name.Function)),
|
|
3324
|
+
(r'\b([_a-z]\w*)(:)', bygroups(Name.Label, Punctuation)),
|
|
3325
|
+
(r'(\b[ULS]|\B)([\!\<\>=]?=|\<\>?|\>)\B', Operator),
|
|
3326
|
+
(r'[|+-]', Operator),
|
|
3327
|
+
(r'\\', Punctuation),
|
|
3328
|
+
(r'\b(Abort|Add(?:BrandingImage|Size)|'
|
|
3329
|
+
r'Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|'
|
|
3330
|
+
r'BG(?:Font|Gradient)|BrandingText|BringToFront|Call(?:InstDLL)?|'
|
|
3331
|
+
r'(?:Sub)?Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|'
|
|
3332
|
+
r'ComponentText|CopyFiles|CRCCheck|'
|
|
3333
|
+
r'Create(?:Directory|Font|Shortcut)|Delete(?:INI(?:Sec|Str)|'
|
|
3334
|
+
r'Reg(?:Key|Value))?|DetailPrint|DetailsButtonText|'
|
|
3335
|
+
r'Dir(?:Show|Text|Var|Verify)|(?:Disabled|Enabled)Bitmap|'
|
|
3336
|
+
r'EnableWindow|EnumReg(?:Key|Value)|Exch|Exec(?:Shell|Wait)?|'
|
|
3337
|
+
r'ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|'
|
|
3338
|
+
r'Read(?:Byte)?|Seek|Write(?:Byte)?)?|'
|
|
3339
|
+
r'Find(?:Close|First|Next|Window)|FlushINI|Function(?:End)?|'
|
|
3340
|
+
r'Get(?:CurInstType|CurrentAddress|DlgItem|DLLVersion(?:Local)?|'
|
|
3341
|
+
r'ErrorLevel|FileTime(?:Local)?|FullPathName|FunctionAddress|'
|
|
3342
|
+
r'InstDirError|LabelAddress|TempFileName)|'
|
|
3343
|
+
r'Goto|HideWindow|Icon|'
|
|
3344
|
+
r'If(?:Abort|Errors|FileExists|RebootFlag|Silent)|'
|
|
3345
|
+
r'InitPluginsDir|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|'
|
|
3346
|
+
r'Inst(?:ProgressFlags|Type(?:[GS]etText)?)|Int(?:CmpU?|Fmt|Op)|'
|
|
3347
|
+
r'IsWindow|LangString(?:UP)?|'
|
|
3348
|
+
r'License(?:BkColor|Data|ForceSelection|LangString|Text)|'
|
|
3349
|
+
r'LoadLanguageFile|LockWindow|Log(?:Set|Text)|MessageBox|'
|
|
3350
|
+
r'MiscButtonText|Name|Nop|OutFile|(?:Uninst)?Page(?:Ex(?:End)?)?|'
|
|
3351
|
+
r'PluginDir|Pop|Push|Quit|Read(?:(?:Env|INI|Reg)Str|RegDWORD)|'
|
|
3352
|
+
r'Reboot|(?:Un)?RegDLL|Rename|RequestExecutionLevel|ReserveFile|'
|
|
3353
|
+
r'Return|RMDir|SearchPath|Section(?:Divider|End|'
|
|
3354
|
+
r'(?:(?:Get|Set)(?:Flags|InstTypes|Size|Text))|Group(?:End)?|In)?|'
|
|
3355
|
+
r'SendMessage|Set(?:AutoClose|BrandingImage|Compress(?:ionLevel|'
|
|
3356
|
+
r'or(?:DictSize)?)?|CtlColors|CurInstType|DatablockOptimize|'
|
|
3357
|
+
r'DateSave|Details(?:Print|View)|Error(?:s|Level)|FileAttributes|'
|
|
3358
|
+
r'Font|OutPath|Overwrite|PluginUnload|RebootFlag|ShellVarContext|'
|
|
3359
|
+
r'Silent|StaticBkColor)|'
|
|
3360
|
+
r'Show(?:(?:I|Uni)nstDetails|Window)|Silent(?:Un)?Install|Sleep|'
|
|
3361
|
+
r'SpaceTexts|Str(?:CmpS?|Cpy|Len)|SubSection(?:End)?|'
|
|
3362
|
+
r'Uninstall(?:ButtonText|(?:Sub)?Caption|EXEName|Icon|Text)|'
|
|
3363
|
+
r'UninstPage|Var|VI(?:AddVersionKey|ProductVersion)|WindowIcon|'
|
|
3364
|
+
r'Write(?:INIStr|Reg(:?Bin|DWORD|(?:Expand)?Str)|Uninstaller)|'
|
|
3365
|
+
r'XPStyle)\b', Keyword),
|
|
3366
|
+
(r'\b(CUR|END|(?:FILE_ATTRIBUTE_)?'
|
|
3367
|
+
r'(?:ARCHIVE|HIDDEN|NORMAL|OFFLINE|READONLY|SYSTEM|TEMPORARY)|'
|
|
3368
|
+
r'HK(CC|CR|CU|DD|LM|PD|U)|'
|
|
3369
|
+
r'HKEY_(?:CLASSES_ROOT|CURRENT_(?:CONFIG|USER)|DYN_DATA|'
|
|
3370
|
+
r'LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|'
|
|
3371
|
+
r'ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|'
|
|
3372
|
+
r'MB_(?:ABORTRETRYIGNORE|DEFBUTTON[1-4]|'
|
|
3373
|
+
r'ICON(?:EXCLAMATION|INFORMATION|QUESTION|STOP)|'
|
|
3374
|
+
r'OK(?:CANCEL)?|RETRYCANCEL|RIGHT|SETFOREGROUND|TOPMOST|USERICON|'
|
|
3375
|
+
r'YESNO(?:CANCEL)?)|SET|SHCTX|'
|
|
3376
|
+
r'SW_(?:HIDE|SHOW(?:MAXIMIZED|MINIMIZED|NORMAL))|'
|
|
3377
|
+
r'admin|all|auto|both|bottom|bzip2|checkbox|colored|current|false|'
|
|
3378
|
+
r'force|hide|highest|if(?:diff|newer)|lastused|leave|left|'
|
|
3379
|
+
r'listonly|lzma|nevershow|none|normal|off|on|pop|push|'
|
|
3380
|
+
r'radiobuttons|right|show|silent|silentlog|smooth|textonly|top|'
|
|
3381
|
+
r'true|try|user|zlib)\b', Name.Constant),
|
|
3382
|
+
],
|
|
3383
|
+
'macro': [
|
|
3384
|
+
(r'\!(addincludedir(?:dir)?|addplugindir|appendfile|cd|define|'
|
|
3385
|
+
r'delfilefile|echo(?:message)?|else|endif|error|execute|'
|
|
3386
|
+
r'if(?:macro)?n?(?:def)?|include|insertmacro|macro(?:end)?|packhdr|'
|
|
3387
|
+
r'search(?:parse|replace)|system|tempfilesymbol|undef|verbose|'
|
|
3388
|
+
r'warning)\b', Comment.Preproc),
|
|
3389
|
+
],
|
|
3390
|
+
'interpol': [
|
|
3391
|
+
(r'\$(R?[0-9])', Name.Builtin.Pseudo), # registers
|
|
3392
|
+
(r'\$(ADMINTOOLS|APPDATA|CDBURN_AREA|COOKIES|COMMONFILES(?:32|64)|'
|
|
3393
|
+
r'DESKTOP|DOCUMENTS|EXE(?:DIR|FILE|PATH)|FAVORITES|FONTS|HISTORY|'
|
|
3394
|
+
r'HWNDPARENT|INTERNET_CACHE|LOCALAPPDATA|MUSIC|NETHOOD|PICTURES|'
|
|
3395
|
+
r'PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES(?:32|64)|QUICKLAUNCH|'
|
|
3396
|
+
r'RECENT|RESOURCES(?:_LOCALIZED)?|SENDTO|SM(?:PROGRAMS|STARTUP)|'
|
|
3397
|
+
r'STARTMENU|SYSDIR|TEMP(?:LATES)?|VIDEOS|WINDIR|\{NSISDIR\})',
|
|
3398
|
+
Name.Builtin),
|
|
3399
|
+
(r'\$(CMDLINE|INSTDIR|OUTDIR|LANGUAGE)', Name.Variable.Global),
|
|
3400
|
+
(r'\$[a-z_]\w*', Name.Variable),
|
|
3401
|
+
],
|
|
3402
|
+
'str_double': [
|
|
3403
|
+
(r'"', String, '#pop'),
|
|
3404
|
+
(r'\$(\\[nrt"]|\$)', String.Escape),
|
|
3405
|
+
include('interpol'),
|
|
3406
|
+
(r'.', String.Double),
|
|
3407
|
+
],
|
|
3408
|
+
'str_backtick': [
|
|
3409
|
+
(r'`', String, '#pop'),
|
|
3410
|
+
(r'\$(\\[nrt"]|\$)', String.Escape),
|
|
3411
|
+
include('interpol'),
|
|
3412
|
+
(r'.', String.Double),
|
|
3413
|
+
],
|
|
3414
|
+
}
|
|
3415
|
+
|
|
3416
|
+
|
|
3417
|
+
class RPMSpecLexer(RegexLexer):
|
|
3418
|
+
"""
|
|
3419
|
+
For RPM *.spec files
|
|
3420
|
+
|
|
3421
|
+
*New in Pygments 1.6.*
|
|
3422
|
+
"""
|
|
3423
|
+
|
|
3424
|
+
name = 'RPMSpec'
|
|
3425
|
+
aliases = ['spec']
|
|
3426
|
+
filenames = ['*.spec']
|
|
3427
|
+
mimetypes = ['text/x-rpm-spec']
|
|
3428
|
+
|
|
3429
|
+
_directives = ('(?:package|prep|build|install|clean|check|pre[a-z]*|'
|
|
3430
|
+
'post[a-z]*|trigger[a-z]*|files)')
|
|
3431
|
+
|
|
3432
|
+
tokens = {
|
|
3433
|
+
'root': [
|
|
3434
|
+
(r'#.*\n', Comment),
|
|
3435
|
+
include('basic'),
|
|
3436
|
+
],
|
|
3437
|
+
'description': [
|
|
3438
|
+
(r'^(%' + _directives + ')(.*)$',
|
|
3439
|
+
bygroups(Name.Decorator, Text), '#pop'),
|
|
3440
|
+
(r'\n', Text),
|
|
3441
|
+
(r'.', Text),
|
|
3442
|
+
],
|
|
3443
|
+
'changelog': [
|
|
3444
|
+
(r'\*.*\n', Generic.Subheading),
|
|
3445
|
+
(r'^(%' + _directives + ')(.*)$',
|
|
3446
|
+
bygroups(Name.Decorator, Text), '#pop'),
|
|
3447
|
+
(r'\n', Text),
|
|
3448
|
+
(r'.', Text),
|
|
3449
|
+
],
|
|
3450
|
+
'string': [
|
|
3451
|
+
(r'"', String.Double, '#pop'),
|
|
3452
|
+
(r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
|
|
3453
|
+
include('interpol'),
|
|
3454
|
+
(r'.', String.Double),
|
|
3455
|
+
],
|
|
3456
|
+
'basic': [
|
|
3457
|
+
include('macro'),
|
|
3458
|
+
(r'(?i)^(Name|Version|Release|Epoch|Summary|Group|License|Packager|'
|
|
3459
|
+
r'Vendor|Icon|URL|Distribution|Prefix|Patch[0-9]*|Source[0-9]*|'
|
|
3460
|
+
r'Requires\(?[a-z]*\)?|[a-z]+Req|Obsoletes|Provides|Conflicts|'
|
|
3461
|
+
r'Build[a-z]+|[a-z]+Arch|Auto[a-z]+)(:)(.*)$',
|
|
3462
|
+
bygroups(Generic.Heading, Punctuation, using(this))),
|
|
3463
|
+
(r'^%description', Name.Decorator, 'description'),
|
|
3464
|
+
(r'^%changelog', Name.Decorator, 'changelog'),
|
|
3465
|
+
(r'^(%' + _directives + ')(.*)$', bygroups(Name.Decorator, Text)),
|
|
3466
|
+
(r'%(attr|defattr|dir|doc(?:dir)?|setup|config(?:ure)?|'
|
|
3467
|
+
r'make(?:install)|ghost|patch[0-9]+|find_lang|exclude|verify)',
|
|
3468
|
+
Keyword),
|
|
3469
|
+
include('interpol'),
|
|
3470
|
+
(r"'.*'", String.Single),
|
|
3471
|
+
(r'"', String.Double, 'string'),
|
|
3472
|
+
(r'.', Text),
|
|
3473
|
+
],
|
|
3474
|
+
'macro': [
|
|
3475
|
+
(r'%define.*\n', Comment.Preproc),
|
|
3476
|
+
(r'%\{\!\?.*%define.*\}', Comment.Preproc),
|
|
3477
|
+
(r'(%(?:if(?:n?arch)?|else(?:if)?|endif))(.*)$',
|
|
3478
|
+
bygroups(Comment.Preproc, Text)),
|
|
3479
|
+
],
|
|
3480
|
+
'interpol': [
|
|
3481
|
+
(r'%\{?__[a-z_]+\}?', Name.Function),
|
|
3482
|
+
(r'%\{?_([a-z_]+dir|[a-z_]+path|prefix)\}?', Keyword.Pseudo),
|
|
3483
|
+
(r'%\{\?[A-Za-z0-9_]+\}', Name.Variable),
|
|
3484
|
+
(r'\$\{?RPM_[A-Z0-9_]+\}?', Name.Variable.Global),
|
|
3485
|
+
(r'%\{[a-zA-Z][a-zA-Z0-9_]+\}', Keyword.Constant),
|
|
3486
|
+
]
|
|
3487
|
+
}
|
|
3488
|
+
|
|
3489
|
+
|
|
3490
|
+
class AutoItLexer(RegexLexer):
|
|
3491
|
+
"""
|
|
3492
|
+
For `AutoIt <http://www.autoitscript.com/site/autoit/>`_ files.
|
|
3493
|
+
|
|
3494
|
+
AutoIt is a freeware BASIC-like scripting language
|
|
3495
|
+
designed for automating the Windows GUI and general scripting
|
|
3496
|
+
|
|
3497
|
+
*New in Pygments 1.6.*
|
|
3498
|
+
"""
|
|
3499
|
+
name = 'AutoIt'
|
|
3500
|
+
aliases = ['autoit', 'Autoit']
|
|
3501
|
+
filenames = ['*.au3']
|
|
3502
|
+
mimetypes = ['text/x-autoit']
|
|
3503
|
+
|
|
3504
|
+
# Keywords, functions, macros from au3.keywords.properties
|
|
3505
|
+
# which can be found in AutoIt installed directory, e.g.
|
|
3506
|
+
# c:\Program Files (x86)\AutoIt3\SciTE\au3.keywords.properties
|
|
3507
|
+
|
|
3508
|
+
keywords = """\
|
|
3509
|
+
#include-once #include #endregion #forcedef #forceref #region
|
|
3510
|
+
and byref case continueloop dim do else elseif endfunc endif
|
|
3511
|
+
endselect exit exitloop for func global
|
|
3512
|
+
if local next not or return select step
|
|
3513
|
+
then to until wend while exit""".split()
|
|
3514
|
+
|
|
3515
|
+
functions = """\
|
|
3516
|
+
abs acos adlibregister adlibunregister asc ascw asin assign atan
|
|
3517
|
+
autoitsetoption autoitwingettitle autoitwinsettitle beep binary binarylen
|
|
3518
|
+
binarymid binarytostring bitand bitnot bitor bitrotate bitshift bitxor
|
|
3519
|
+
blockinput break call cdtray ceiling chr chrw clipget clipput consoleread
|
|
3520
|
+
consolewrite consolewriteerror controlclick controlcommand controldisable
|
|
3521
|
+
controlenable controlfocus controlgetfocus controlgethandle controlgetpos
|
|
3522
|
+
controlgettext controlhide controllistview controlmove controlsend
|
|
3523
|
+
controlsettext controlshow controltreeview cos dec dircopy dircreate
|
|
3524
|
+
dirgetsize dirmove dirremove dllcall dllcalladdress dllcallbackfree
|
|
3525
|
+
dllcallbackgetptr dllcallbackregister dllclose dllopen dllstructcreate
|
|
3526
|
+
dllstructgetdata dllstructgetptr dllstructgetsize dllstructsetdata
|
|
3527
|
+
drivegetdrive drivegetfilesystem drivegetlabel drivegetserial drivegettype
|
|
3528
|
+
drivemapadd drivemapdel drivemapget drivesetlabel drivespacefree
|
|
3529
|
+
drivespacetotal drivestatus envget envset envupdate eval execute exp
|
|
3530
|
+
filechangedir fileclose filecopy filecreatentfslink filecreateshortcut
|
|
3531
|
+
filedelete fileexists filefindfirstfile filefindnextfile fileflush
|
|
3532
|
+
filegetattrib filegetencoding filegetlongname filegetpos filegetshortcut
|
|
3533
|
+
filegetshortname filegetsize filegettime filegetversion fileinstall filemove
|
|
3534
|
+
fileopen fileopendialog fileread filereadline filerecycle filerecycleempty
|
|
3535
|
+
filesavedialog fileselectfolder filesetattrib filesetpos filesettime
|
|
3536
|
+
filewrite filewriteline floor ftpsetproxy guicreate guictrlcreateavi
|
|
3537
|
+
guictrlcreatebutton guictrlcreatecheckbox guictrlcreatecombo
|
|
3538
|
+
guictrlcreatecontextmenu guictrlcreatedate guictrlcreatedummy
|
|
3539
|
+
guictrlcreateedit guictrlcreategraphic guictrlcreategroup guictrlcreateicon
|
|
3540
|
+
guictrlcreateinput guictrlcreatelabel guictrlcreatelist
|
|
3541
|
+
guictrlcreatelistview guictrlcreatelistviewitem guictrlcreatemenu
|
|
3542
|
+
guictrlcreatemenuitem guictrlcreatemonthcal guictrlcreateobj
|
|
3543
|
+
guictrlcreatepic guictrlcreateprogress guictrlcreateradio
|
|
3544
|
+
guictrlcreateslider guictrlcreatetab guictrlcreatetabitem
|
|
3545
|
+
guictrlcreatetreeview guictrlcreatetreeviewitem guictrlcreateupdown
|
|
3546
|
+
guictrldelete guictrlgethandle guictrlgetstate guictrlread guictrlrecvmsg
|
|
3547
|
+
guictrlregisterlistviewsort guictrlsendmsg guictrlsendtodummy
|
|
3548
|
+
guictrlsetbkcolor guictrlsetcolor guictrlsetcursor guictrlsetdata
|
|
3549
|
+
guictrlsetdefbkcolor guictrlsetdefcolor guictrlsetfont guictrlsetgraphic
|
|
3550
|
+
guictrlsetimage guictrlsetlimit guictrlsetonevent guictrlsetpos
|
|
3551
|
+
guictrlsetresizing guictrlsetstate guictrlsetstyle guictrlsettip guidelete
|
|
3552
|
+
guigetcursorinfo guigetmsg guigetstyle guiregistermsg guisetaccelerators
|
|
3553
|
+
guisetbkcolor guisetcoord guisetcursor guisetfont guisethelp guiseticon
|
|
3554
|
+
guisetonevent guisetstate guisetstyle guistartgroup guiswitch hex hotkeyset
|
|
3555
|
+
httpsetproxy httpsetuseragent hwnd inetclose inetget inetgetinfo inetgetsize
|
|
3556
|
+
inetread inidelete iniread inireadsection inireadsectionnames
|
|
3557
|
+
inirenamesection iniwrite iniwritesection inputbox int isadmin isarray
|
|
3558
|
+
isbinary isbool isdeclared isdllstruct isfloat ishwnd isint iskeyword
|
|
3559
|
+
isnumber isobj isptr isstring log memgetstats mod mouseclick mouseclickdrag
|
|
3560
|
+
mousedown mousegetcursor mousegetpos mousemove mouseup mousewheel msgbox
|
|
3561
|
+
number objcreate objcreateinterface objevent objevent objget objname
|
|
3562
|
+
onautoitexitregister onautoitexitunregister opt ping pixelchecksum
|
|
3563
|
+
pixelgetcolor pixelsearch pluginclose pluginopen processclose processexists
|
|
3564
|
+
processgetstats processlist processsetpriority processwait processwaitclose
|
|
3565
|
+
progressoff progresson progressset ptr random regdelete regenumkey
|
|
3566
|
+
regenumval regread regwrite round run runas runaswait runwait send
|
|
3567
|
+
sendkeepactive seterror setextended shellexecute shellexecutewait shutdown
|
|
3568
|
+
sin sleep soundplay soundsetwavevolume splashimageon splashoff splashtexton
|
|
3569
|
+
sqrt srandom statusbargettext stderrread stdinwrite stdioclose stdoutread
|
|
3570
|
+
string stringaddcr stringcompare stringformat stringfromasciiarray
|
|
3571
|
+
stringinstr stringisalnum stringisalpha stringisascii stringisdigit
|
|
3572
|
+
stringisfloat stringisint stringislower stringisspace stringisupper
|
|
3573
|
+
stringisxdigit stringleft stringlen stringlower stringmid stringregexp
|
|
3574
|
+
stringregexpreplace stringreplace stringright stringsplit stringstripcr
|
|
3575
|
+
stringstripws stringtoasciiarray stringtobinary stringtrimleft
|
|
3576
|
+
stringtrimright stringupper tan tcpaccept tcpclosesocket tcpconnect
|
|
3577
|
+
tcplisten tcpnametoip tcprecv tcpsend tcpshutdown tcpstartup timerdiff
|
|
3578
|
+
timerinit tooltip traycreateitem traycreatemenu traygetmsg trayitemdelete
|
|
3579
|
+
trayitemgethandle trayitemgetstate trayitemgettext trayitemsetonevent
|
|
3580
|
+
trayitemsetstate trayitemsettext traysetclick trayseticon traysetonevent
|
|
3581
|
+
traysetpauseicon traysetstate traysettooltip traytip ubound udpbind
|
|
3582
|
+
udpclosesocket udpopen udprecv udpsend udpshutdown udpstartup vargettype
|
|
3583
|
+
winactivate winactive winclose winexists winflash wingetcaretpos
|
|
3584
|
+
wingetclasslist wingetclientsize wingethandle wingetpos wingetprocess
|
|
3585
|
+
wingetstate wingettext wingettitle winkill winlist winmenuselectitem
|
|
3586
|
+
winminimizeall winminimizeallundo winmove winsetontop winsetstate
|
|
3587
|
+
winsettitle winsettrans winwait winwaitactive winwaitclose
|
|
3588
|
+
winwaitnotactive""".split()
|
|
3589
|
+
|
|
3590
|
+
macros = """\
|
|
3591
|
+
@appdatacommondir @appdatadir @autoitexe @autoitpid @autoitversion
|
|
3592
|
+
@autoitx64 @com_eventobj @commonfilesdir @compiled @computername @comspec
|
|
3593
|
+
@cpuarch @cr @crlf @desktopcommondir @desktopdepth @desktopdir
|
|
3594
|
+
@desktopheight @desktoprefresh @desktopwidth @documentscommondir @error
|
|
3595
|
+
@exitcode @exitmethod @extended @favoritescommondir @favoritesdir
|
|
3596
|
+
@gui_ctrlhandle @gui_ctrlid @gui_dragfile @gui_dragid @gui_dropid
|
|
3597
|
+
@gui_winhandle @homedrive @homepath @homeshare @hotkeypressed @hour
|
|
3598
|
+
@ipaddress1 @ipaddress2 @ipaddress3 @ipaddress4 @kblayout @lf
|
|
3599
|
+
@logondnsdomain @logondomain @logonserver @mday @min @mon @msec @muilang
|
|
3600
|
+
@mydocumentsdir @numparams @osarch @osbuild @oslang @osservicepack @ostype
|
|
3601
|
+
@osversion @programfilesdir @programscommondir @programsdir @scriptdir
|
|
3602
|
+
@scriptfullpath @scriptlinenumber @scriptname @sec @startmenucommondir
|
|
3603
|
+
@startmenudir @startupcommondir @startupdir @sw_disable @sw_enable @sw_hide
|
|
3604
|
+
@sw_lock @sw_maximize @sw_minimize @sw_restore @sw_show @sw_showdefault
|
|
3605
|
+
@sw_showmaximized @sw_showminimized @sw_showminnoactive @sw_showna
|
|
3606
|
+
@sw_shownoactivate @sw_shownormal @sw_unlock @systemdir @tab @tempdir
|
|
3607
|
+
@tray_id @trayiconflashing @trayiconvisible @username @userprofiledir @wday
|
|
3608
|
+
@windowsdir @workingdir @yday @year""".split()
|
|
3609
|
+
|
|
3610
|
+
tokens = {
|
|
3611
|
+
'root': [
|
|
3612
|
+
(r';.*\n', Comment.Single),
|
|
3613
|
+
(r'(#comments-start|#cs).*?(#comments-end|#ce)', Comment.Multiline),
|
|
3614
|
+
(r'[\[\]{}(),;]', Punctuation),
|
|
3615
|
+
(r'(and|or|not)\b', Operator.Word),
|
|
3616
|
+
(r'[\$|@][a-zA-Z_][a-zA-Z0-9_]*', Name.Variable),
|
|
3617
|
+
(r'!=|==|:=|\.=|<<|>>|[-~+/*%=<>&^|?:!.]', Operator),
|
|
3618
|
+
include('commands'),
|
|
3619
|
+
include('labels'),
|
|
3620
|
+
include('builtInFunctions'),
|
|
3621
|
+
include('builtInMarcros'),
|
|
3622
|
+
(r'"', String, combined('stringescape', 'dqs')),
|
|
3623
|
+
include('numbers'),
|
|
3624
|
+
(r'[a-zA-Z_#@$][a-zA-Z0-9_#@$]*', Name),
|
|
3625
|
+
(r'\\|\'', Text),
|
|
3626
|
+
(r'\`([\,\%\`abfnrtv\-\+;])', String.Escape),
|
|
3627
|
+
(r'_\n', Text), # Line continuation
|
|
3628
|
+
include('garbage'),
|
|
3629
|
+
],
|
|
3630
|
+
'commands': [
|
|
3631
|
+
(r'(?i)(\s*)(%s)\b' % '|'.join(keywords),
|
|
3632
|
+
bygroups(Text, Name.Builtin)),
|
|
3633
|
+
],
|
|
3634
|
+
'builtInFunctions': [
|
|
3635
|
+
(r'(?i)(%s)\b' % '|'.join(functions),
|
|
3636
|
+
Name.Function),
|
|
3637
|
+
],
|
|
3638
|
+
'builtInMarcros': [
|
|
3639
|
+
(r'(?i)(%s)\b' % '|'.join(macros),
|
|
3640
|
+
Name.Variable.Global),
|
|
3641
|
+
],
|
|
3642
|
+
'labels': [
|
|
3643
|
+
# sendkeys
|
|
3644
|
+
(r'(^\s*)({\S+?})', bygroups(Text, Name.Label)),
|
|
3645
|
+
],
|
|
3646
|
+
'numbers': [
|
|
3647
|
+
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
|
|
3648
|
+
(r'\d+[eE][+-]?[0-9]+', Number.Float),
|
|
3649
|
+
(r'0\d+', Number.Oct),
|
|
3650
|
+
(r'0[xX][a-fA-F0-9]+', Number.Hex),
|
|
3651
|
+
(r'\d+L', Number.Integer.Long),
|
|
3652
|
+
(r'\d+', Number.Integer)
|
|
3653
|
+
],
|
|
3654
|
+
'stringescape': [
|
|
3655
|
+
(r'\"\"|\`([\,\%\`abfnrtv])', String.Escape),
|
|
3656
|
+
],
|
|
3657
|
+
'strings': [
|
|
3658
|
+
(r'[^"\n]+', String),
|
|
3659
|
+
],
|
|
3660
|
+
'dqs': [
|
|
3661
|
+
(r'"', String, '#pop'),
|
|
3662
|
+
include('strings')
|
|
3663
|
+
],
|
|
3664
|
+
'garbage': [
|
|
3665
|
+
(r'[^\S\n]', Text),
|
|
3666
|
+
],
|
|
3667
|
+
}
|