diff options
author | Georg Brandl <georg@python.org> | 2013-01-09 13:15:36 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2013-01-09 13:15:36 +0100 |
commit | 1b551e169d6c29d49c90baa62ea8886a7e8be46f (patch) | |
tree | 4c57f637cf7d23a1a52f058b1dba36d32d1ed73d /pygments/lexers/text.py | |
parent | 01ff62d16bcb567d2c7becd241e2b5bfb1bd3a93 (diff) | |
parent | 73a4b067b9ec07088e7c2e77e3f3c040aedcd50c (diff) | |
download | pygments-1b551e169d6c29d49c90baa62ea8886a7e8be46f.tar.gz |
Merged in alastairh/pygments (pull request #141: Improve and unify C family language lexers)
Diffstat (limited to 'pygments/lexers/text.py')
-rw-r--r-- | pygments/lexers/text.py | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/pygments/lexers/text.py b/pygments/lexers/text.py index 4f70c418..79797874 100644 --- a/pygments/lexers/text.py +++ b/pygments/lexers/text.py @@ -5,7 +5,7 @@ Lexers for non-source code file types. - :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -25,7 +25,7 @@ __all__ = ['IniLexer', 'PropertiesLexer', 'SourcesListLexer', 'BaseMakefileLexer 'RstLexer', 'VimLexer', 'GettextLexer', 'SquidConfLexer', 'DebianControlLexer', 'DarcsPatchLexer', 'YamlLexer', 'LighttpdConfLexer', 'NginxConfLexer', 'CMakeLexer', 'HttpLexer', - 'PyPyLogLexer', 'RegeditLexer'] + 'PyPyLogLexer', 'RegeditLexer', 'HxmlLexer'] class IniLexer(RegexLexer): @@ -1800,3 +1800,44 @@ class PyPyLogLexer(RegexLexer): (r"#.*?$", Comment), ], } + + +class HxmlLexer(RegexLexer): + """ + Lexer for `haXe build <http://haxe.org/doc/compiler>`_ files. + + *New in Pygments 1.6.* + """ + name = 'Hxml' + aliases = ['haxeml', 'hxml'] + filenames = ['*.hxml'] + + tokens = { + 'root': [ + # Seperator + (r'(--)(next)', bygroups(Punctuation, Generic.Heading)), + # Compiler switches with one dash + (r'(-)(prompt|debug|v)', bygroups(Punctuation, Keyword.Keyword)), + # Compilerswitches with two dashes + (r'(--)(neko-source|flash-strict|flash-use-stage|no-opt|no-traces|' + r'no-inline|times|no-output)', bygroups(Punctuation, Keyword)), + # Targets and other options that take an argument + (r'(-)(cpp|js|neko|x|as3|swf9?|swf-lib|php|xml|main|lib|D|resource|' + r'cp|cmd)( +)(.+)', + bygroups(Punctuation, Keyword, Whitespace, String)), + # Options that take only numerical arguments + (r'(-)(swf-version)( +)(\d+)', + bygroups(Punctuation, Keyword, Number.Integer)), + # An Option that defines the size, the fps and the background + # color of an flash movie + (r'(-)(swf-header)( +)(\d+)(:)(\d+)(:)(\d+)(:)([A-Fa-f0-9]{6})', + bygroups(Punctuation, Keyword, Whitespace, Number.Integer, + Punctuation, Number.Integer, Punctuation, Number.Integer, + Punctuation, Number.Hex)), + # options with two dashes that takes arguments + (r'(--)(js-namespace|php-front|php-lib|remap|gen-hx-classes)( +)' + r'(.+)', bygroups(Punctuation, Keyword, Whitespace, String)), + # Single line comment, multiline ones are not allowed. + (r'#.*', Comment.Single) + ] + } |