changeset 5614:f76914e77229

upgrade pygments to 1.3.1
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 07 Mar 2010 21:36:31 +0100
parents ee3540cf6d49
children ae929978d755
files MoinMoin/support/pygments/__init__.py MoinMoin/support/pygments/filters/__init__.py MoinMoin/support/pygments/formatters/__init__.py MoinMoin/support/pygments/formatters/html.py MoinMoin/support/pygments/lexer.py MoinMoin/support/pygments/lexers/__init__.py MoinMoin/support/pygments/lexers/_mapping.py MoinMoin/support/pygments/lexers/agile.py MoinMoin/support/pygments/lexers/asm.py MoinMoin/support/pygments/lexers/compiled.py MoinMoin/support/pygments/lexers/functional.py MoinMoin/support/pygments/lexers/math.py MoinMoin/support/pygments/lexers/other.py MoinMoin/support/pygments/lexers/parsers.py MoinMoin/support/pygments/lexers/templates.py MoinMoin/support/pygments/lexers/text.py MoinMoin/support/pygments/lexers/web.py MoinMoin/support/pygments/token.py MoinMoin/support/pygments/util.py docs/REQUIREMENTS
diffstat 20 files changed, 1737 insertions(+), 134 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/support/pygments/__init__.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/__init__.py	Sun Mar 07 21:36:31 2010 +0100
@@ -26,13 +26,13 @@
     :license: BSD, see LICENSE for details.
 """
 
-__version__ = '1.2.2'
+__version__ = '1.3.1'
 __docformat__ = 'restructuredtext'
 
 __all__ = ['lex', 'format', 'highlight']
 
 
-import sys, os
+import sys
 
 from pygments.util import StringIO, BytesIO
 
--- a/MoinMoin/support/pygments/filters/__init__.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/filters/__init__.py	Sun Mar 07 21:36:31 2010 +0100
@@ -9,17 +9,14 @@
     :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 import re
+
 from pygments.token import String, Comment, Keyword, Name, Error, Whitespace, \
     string_to_tokentype
 from pygments.filter import Filter
-from pygments.util import get_list_opt, get_int_opt, get_bool_opt, get_choice_opt, \
-     ClassNotFound, OptionError
+from pygments.util import get_list_opt, get_int_opt, get_bool_opt, \
+     get_choice_opt, ClassNotFound, OptionError
 from pygments.plugin import find_plugin_filters
 
 
--- a/MoinMoin/support/pygments/formatters/__init__.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/formatters/__init__.py	Sun Mar 07 21:36:31 2010 +0100
@@ -13,7 +13,7 @@
 
 from pygments.formatters._mapping import FORMATTERS
 from pygments.plugin import find_plugin_formatters
-from pygments.util import docstring_headline, ClassNotFound
+from pygments.util import ClassNotFound
 
 ns = globals()
 for fcls in FORMATTERS:
--- a/MoinMoin/support/pygments/formatters/html.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/formatters/html.py	Sun Mar 07 21:36:31 2010 +0100
@@ -8,13 +8,10 @@
     :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
-import sys, os
-import StringIO
 
-try:
-    set
-except NameError:
-    from sets import Set as set
+import os
+import sys
+import StringIO
 
 from pygments.formatter import Formatter
 from pygments.token import Token, Text, STANDARD_TYPES
--- a/MoinMoin/support/pygments/lexer.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexer.py	Sun Mar 07 21:36:31 2010 +0100
@@ -10,11 +10,6 @@
 """
 import re
 
-try:
-    set
-except NameError:
-    from sets import Set as set
-
 from pygments.filter import apply_filters, Filter
 from pygments.filters import get_filter_by_name
 from pygments.token import Error, Text, Other, _TokenType
@@ -23,7 +18,7 @@
 
 
 __all__ = ['Lexer', 'RegexLexer', 'ExtendedRegexLexer', 'DelegatingLexer',
-           'LexerContext', 'include', 'flags', 'bygroups', 'using', 'this']
+           'LexerContext', 'include', 'bygroups', 'using', 'this']
 
 
 _default_analyse = staticmethod(lambda x: 0.0)
@@ -51,6 +46,10 @@
     ``stripall``
         Strip all leading and trailing whitespace from the input
         (default: False).
+    ``ensurenl``
+        Make sure that the input ends with a newline (default: True).  This
+        is required for some lexers that consume input linewise.
+        *New in Pygments 1.3.*
     ``tabsize``
         If given and greater than 0, expand tabs in the input (default: 0).
     ``encoding``
@@ -82,6 +81,7 @@
         self.options = options
         self.stripnl = get_bool_opt(options, 'stripnl', True)
         self.stripall = get_bool_opt(options, 'stripall', False)
+        self.ensurenl = get_bool_opt(options, 'ensurenl', True)
         self.tabsize = get_int_opt(options, 'tabsize', 0)
         self.encoding = options.get('encoding', 'latin1')
         # self.encoding = options.get('inencoding', None) or self.encoding
@@ -155,7 +155,7 @@
             text = text.strip('\n')
         if self.tabsize > 0:
             text = text.expandtabs(self.tabsize)
-        if not text.endswith('\n'):
+        if self.ensurenl and not text.endswith('\n'):
             text += '\n'
 
         def streamer():
@@ -646,9 +646,15 @@
         realpos += len(v) - oldi
 
     # leftover tokens
-    if insleft:
+    while insleft:
         # no normal tokens, set realpos to zero
         realpos = realpos or 0
         for p, t, v in itokens:
             yield realpos, t, v
             realpos += len(v)
+        try:
+            index, itokens = insertions.next()
+        except StopIteration:
+            insleft = False
+            break  # not strictly necessary
+
--- a/MoinMoin/support/pygments/lexers/__init__.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/__init__.py	Sun Mar 07 21:36:31 2010 +0100
@@ -8,16 +8,12 @@
     :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
+
 import sys
+import types
 import fnmatch
-import types
 from os.path import basename
 
-try:
-    set
-except NameError:
-    from sets import Set as set
-
 from pygments.lexers._mapping import LEXERS
 from pygments.plugin import find_plugin_lexers
 from pygments.util import ClassNotFound, bytes
@@ -223,7 +219,6 @@
         raise AttributeError(name)
 
 
-import sys
 oldmod = sys.modules['pygments.lexers']
 newmod = _automodule('pygments.lexers')
 newmod.__dict__.update(oldmod.__dict__)
--- a/MoinMoin/support/pygments/lexers/_mapping.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/_mapping.py	Sun Mar 07 21:36:31 2010 +0100
@@ -17,6 +17,7 @@
     'ABAPLexer': ('pygments.lexers.other', 'ABAP', ('abap',), ('*.abap',), ('text/x-abap',)),
     'ActionScript3Lexer': ('pygments.lexers.web', 'ActionScript 3', ('as3', 'actionscript3'), ('*.as',), ('application/x-actionscript', 'text/x-actionscript', 'text/actionscript')),
     'ActionScriptLexer': ('pygments.lexers.web', 'ActionScript', ('as', 'actionscript'), ('*.as',), ('application/x-actionscript', 'text/x-actionscript', 'text/actionscript')),
+    'AdaLexer': ('pygments.lexers.compiled', 'Ada', ('ada', 'ada95ada2005'), ('*.adb', '*.ads', '*.ada'), ('text/x-ada',)),
     'AntlrActionScriptLexer': ('pygments.lexers.parsers', 'ANTLR With ActionScript Target', ('antlr-as', 'antlr-actionscript'), ('*.G', '*.g'), ()),
     'AntlrCSharpLexer': ('pygments.lexers.parsers', 'ANTLR With C# Target', ('antlr-csharp', 'antlr-c#'), ('*.G', '*.g'), ()),
     'AntlrCppLexer': ('pygments.lexers.parsers', 'ANTLR With CPP Target', ('antlr-cpp',), ('*.G', '*.g'), ()),
@@ -28,10 +29,10 @@
     'AntlrRubyLexer': ('pygments.lexers.parsers', 'ANTLR With Ruby Target', ('antlr-ruby', 'antlr-rb'), ('*.G', '*.g'), ()),
     'ApacheConfLexer': ('pygments.lexers.text', 'ApacheConf', ('apacheconf', 'aconf', 'apache'), ('.htaccess', 'apache.conf', 'apache2.conf'), ('text/x-apacheconf',)),
     'AppleScriptLexer': ('pygments.lexers.other', 'AppleScript', ('applescript',), ('*.applescript',), ()),
-    'AsymptoteLexer': ('pygments.lexers.other', 'Asymptote', ('asy',), ('*.asy',), ('text/x-asymptote',)),
+    'AsymptoteLexer': ('pygments.lexers.other', 'Asymptote', ('asy', 'asymptote'), ('*.asy',), ('text/x-asymptote',)),
     'BBCodeLexer': ('pygments.lexers.text', 'BBCode', ('bbcode',), (), ('text/x-bbcode',)),
     'BaseMakefileLexer': ('pygments.lexers.text', 'Makefile', ('basemake',), (), ()),
-    'BashLexer': ('pygments.lexers.other', 'Bash', ('bash', 'sh'), ('*.sh', '*.ebuild', '*.eclass'), ('application/x-sh', 'application/x-shellscript')),
+    'BashLexer': ('pygments.lexers.other', 'Bash', ('bash', 'sh', 'ksh'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass'), ('application/x-sh', 'application/x-shellscript')),
     'BashSessionLexer': ('pygments.lexers.other', 'Bash Session', ('console',), ('*.sh-session',), ('application/x-shell-session',)),
     'BatchLexer': ('pygments.lexers.other', 'Batchfile', ('bat',), ('*.bat', '*.cmd'), ('application/x-dos-batch',)),
     'BefungeLexer': ('pygments.lexers.other', 'Befunge', ('befunge',), ('*.befunge',), ('application/x-befunge',)),
@@ -47,6 +48,9 @@
     'CheetahLexer': ('pygments.lexers.templates', 'Cheetah', ('cheetah', 'spitfire'), ('*.tmpl', '*.spt'), ('application/x-cheetah', 'application/x-spitfire')),
     'CheetahXmlLexer': ('pygments.lexers.templates', 'XML+Cheetah', ('xml+cheetah', 'xml+spitfire'), (), ('application/xml+cheetah', 'application/xml+spitfire')),
     'ClojureLexer': ('pygments.lexers.agile', 'Clojure', ('clojure', 'clj'), ('*.clj',), ('text/x-clojure', 'application/x-clojure')),
+    'CoffeeScriptLexer': ('pygments.lexers.web', 'CoffeeScript', ('coffee-script', 'coffeescript'), ('*.coffee',), ('text/coffeescript',)),
+    'ColdfusionHtmlLexer': ('pygments.lexers.templates', 'Coldufsion HTML', ('cfm',), ('*.cfm', '*.cfml', '*.cfc'), ('application/x-coldfusion',)),
+    'ColdfusionLexer': ('pygments.lexers.templates', 'cfstatement', ('cfs',), (), ()),
     'CommonLispLexer': ('pygments.lexers.functional', 'Common Lisp', ('common-lisp', 'cl'), ('*.cl', '*.lisp', '*.el'), ('text/x-common-lisp',)),
     'CppLexer': ('pygments.lexers.compiled', 'C++', ('cpp', 'c++'), ('*.cpp', '*.hpp', '*.c++', '*.h++', '*.cc', '*.hh', '*.cxx', '*.hxx'), ('text/x-c++hdr', 'text/x-c++src')),
     'CppObjdumpLexer': ('pygments.lexers.asm', 'cpp-objdump', ('cpp-objdump', 'c++-objdumb', 'cxx-objdump'), ('*.cpp-objdump', '*.c++-objdump', '*.cxx-objdump'), ('text/x-cpp-objdump',)),
@@ -71,6 +75,7 @@
     'EvoqueHtmlLexer': ('pygments.lexers.templates', 'HTML+Evoque', ('html+evoque',), ('*.html',), ('text/html+evoque',)),
     'EvoqueLexer': ('pygments.lexers.templates', 'Evoque', ('evoque',), ('*.evoque',), ('application/x-evoque',)),
     'EvoqueXmlLexer': ('pygments.lexers.templates', 'XML+Evoque', ('xml+evoque',), ('*.xml',), ('application/xml+evoque',)),
+    'FelixLexer': ('pygments.lexers.compiled', 'Felix', ('felix', 'flx'), ('*.flx', '*.flxh'), ('text/x-felix',)),
     'FortranLexer': ('pygments.lexers.compiled', 'Fortran', ('fortran',), ('*.f', '*.f90'), ('text/x-fortran',)),
     'GLShaderLexer': ('pygments.lexers.compiled', 'GLSL', ('glsl',), ('*.vert', '*.frag', '*.geo'), ('text/x-glslsrc',)),
     'GasLexer': ('pygments.lexers.asm', 'GAS', ('gas',), ('*.s', '*.S'), ('text/x-gas',)),
@@ -81,7 +86,9 @@
     'GnuplotLexer': ('pygments.lexers.other', 'Gnuplot', ('gnuplot',), ('*.plot', '*.plt'), ('text/x-gnuplot',)),
     'GoLexer': ('pygments.lexers.compiled', 'Go', ('go',), ('*.go',), ('text/x-gosrc',)),
     'GroffLexer': ('pygments.lexers.text', 'Groff', ('groff', 'nroff', 'man'), ('*.[1234567]', '*.man'), ('application/x-troff', 'text/troff')),
+    'HamlLexer': ('pygments.lexers.web', 'Haml', ('haml', 'HAML'), ('*.haml',), ('text/x-haml',)),
     'HaskellLexer': ('pygments.lexers.functional', 'Haskell', ('haskell', 'hs'), ('*.hs',), ('text/x-haskell',)),
+    'HaxeLexer': ('pygments.lexers.web', 'haXe', ('hx', 'haXe'), ('*.hx',), ('text/haxe',)),
     'HtmlDjangoLexer': ('pygments.lexers.templates', 'HTML+Django/Jinja', ('html+django', 'html+jinja'), (), ('text/html+django', 'text/html+jinja')),
     'HtmlGenshiLexer': ('pygments.lexers.templates', 'HTML+Genshi', ('html+genshi', 'html+kid'), (), ('text/html+genshi',)),
     'HtmlLexer': ('pygments.lexers.web', 'HTML', ('html',), ('*.html', '*.htm', '*.xhtml', '*.xslt'), ('text/html', 'application/xhtml+xml')),
@@ -114,6 +121,7 @@
     'MatlabSessionLexer': ('pygments.lexers.math', 'Matlab session', ('matlabsession',), (), ()),
     'MiniDLexer': ('pygments.lexers.agile', 'MiniD', ('minid',), ('*.md',), ('text/x-minidsrc',)),
     'ModelicaLexer': ('pygments.lexers.other', 'Modelica', ('modelica',), ('*.mo',), ('text/x-modelica',)),
+    'Modula2Lexer': ('pygments.lexers.compiled', 'Modula-2', ('modula2', 'm2'), ('*.def', '*.mod'), ('text/x-modula2',)),
     'MoinWikiLexer': ('pygments.lexers.text', 'MoinMoin/Trac Wiki markup', ('trac-wiki', 'moin'), (), ('text/x-trac-wiki',)),
     'MuPADLexer': ('pygments.lexers.math', 'MuPAD', ('mupad',), ('*.mu',), ()),
     'MxmlLexer': ('pygments.lexers.web', 'MXML', ('mxml',), ('*.mxml',), ()),
@@ -129,6 +137,7 @@
     'NumPyLexer': ('pygments.lexers.math', 'NumPy', ('numpy',), (), ()),
     'ObjdumpLexer': ('pygments.lexers.asm', 'objdump', ('objdump',), ('*.objdump',), ('text/x-objdump',)),
     'ObjectiveCLexer': ('pygments.lexers.compiled', 'Objective-C', ('objective-c', 'objectivec', 'obj-c', 'objc'), ('*.m',), ('text/x-objective-c',)),
+    'ObjectiveJLexer': ('pygments.lexers.web', 'Objective-J', ('objective-j', 'objectivej', 'obj-j', 'objj'), ('*.j',), ('text/x-objective-j',)),
     'OcamlLexer': ('pygments.lexers.compiled', 'OCaml', ('ocaml',), ('*.ml', '*.mli', '*.mll', '*.mly'), ('text/x-ocaml',)),
     'OcamlLexer': ('pygments.lexers.functional', 'OCaml', ('ocaml',), ('*.ml', '*.mli', '*.mll', '*.mly'), ('text/x-ocaml',)),
     'OocLexer': ('pygments.lexers.compiled', 'Ooc', ('ooc',), ('*.ooc',), ('text/x-ooc',)),
@@ -139,8 +148,9 @@
     'Python3Lexer': ('pygments.lexers.agile', 'Python 3', ('python3', 'py3'), (), ('text/x-python3', 'application/x-python3')),
     'Python3TracebackLexer': ('pygments.lexers.agile', 'Python 3.0 Traceback', ('py3tb',), ('*.py3tb',), ('text/x-python3-traceback',)),
     'PythonConsoleLexer': ('pygments.lexers.agile', 'Python console session', ('pycon',), (), ('text/x-python-doctest',)),
-    'PythonLexer': ('pygments.lexers.agile', 'Python', ('python', 'py'), ('*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript'), ('text/x-python', 'application/x-python')),
+    'PythonLexer': ('pygments.lexers.agile', 'Python', ('python', 'py'), ('*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript', '*.tac'), ('text/x-python', 'application/x-python')),
     'PythonTracebackLexer': ('pygments.lexers.agile', 'Python Traceback', ('pytb',), ('*.pytb',), ('text/x-python-traceback',)),
+    'RConsoleLexer': ('pygments.lexers.math', 'RConsole', ('rconsole', 'rout'), ('*.Rout',), ()),
     'RagelCLexer': ('pygments.lexers.parsers', 'Ragel in C Host', ('ragel-c',), ('*.rl',), ()),
     'RagelCppLexer': ('pygments.lexers.parsers', 'Ragel in CPP Host', ('ragel-cpp',), ('*.rl',), ()),
     'RagelDLexer': ('pygments.lexers.parsers', 'Ragel in D Host', ('ragel-d',), ('*.rl',), ()),
@@ -157,6 +167,7 @@
     'RubyConsoleLexer': ('pygments.lexers.agile', 'Ruby irb session', ('rbcon', 'irb'), (), ('text/x-ruby-shellsession',)),
     'RubyLexer': ('pygments.lexers.agile', 'Ruby', ('rb', 'ruby'), ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx'), ('text/x-ruby', 'application/x-ruby')),
     'SLexer': ('pygments.lexers.math', 'S', ('splus', 's', 'r'), ('*.S', '*.R'), ('text/S-plus', 'text/S', 'text/R')),
+    'SassLexer': ('pygments.lexers.web', 'Sass', ('sass', 'SASS'), ('*.sass',), ('text/x-sass',)),
     'ScalaLexer': ('pygments.lexers.compiled', 'Scala', ('scala',), ('*.scala',), ('text/x-scala',)),
     'SchemeLexer': ('pygments.lexers.functional', 'Scheme', ('scheme', 'scm'), ('*.scm',), ('text/x-scheme', 'application/x-scheme')),
     'SmalltalkLexer': ('pygments.lexers.other', 'Smalltalk', ('smalltalk', 'squeak'), ('*.st',), ('text/x-smalltalk',)),
--- a/MoinMoin/support/pygments/lexers/agile.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/agile.py	Sun Mar 07 21:36:31 2010 +0100
@@ -10,10 +10,6 @@
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \
      LexerContext, include, combined, do_insertions, bygroups, using
@@ -41,7 +37,7 @@
 
     name = 'Python'
     aliases = ['python', 'py']
-    filenames = ['*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript']
+    filenames = ['*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript', '*.tac']
     mimetypes = ['text/x-python', 'application/x-python']
 
     tokens = {
@@ -659,7 +655,7 @@
                  r'(?<=^match\s)|'
                  r'(?<=^if\s)|'
                  r'(?<=^elsif\s)'
-             r')(\s*)(/)(?!=)', bygroups(Text, String.Regex), 'multiline-regex'),
+             r')(\s*)(/)', bygroups(Text, String.Regex), 'multiline-regex'),
             # multiline regex (in method calls)
             (r'(?<=\(|,)/', String.Regex, 'multiline-regex'),
             # multiline regex (this time the funny no whitespace rule)
@@ -835,7 +831,6 @@
             (r'@(\\\\|\\\@|[^\@])*@[egimosx]*', String.Regex, '#pop'),
             (r'%(\\\\|\\\%|[^\%])*%[egimosx]*', String.Regex, '#pop'),
             (r'\$(\\\\|\\\$|[^\$])*\$[egimosx]*', String.Regex, '#pop'),
-            (r'!(\\\\|\\!|[^!])*![egimosx]*', String.Regex, '#pop'),
         ],
         'root': [
             (r'\#.*?$', Comment.Single),
@@ -859,6 +854,7 @@
             (r's\((\\\\|\\\)|[^\)])*\)\s*', String.Regex, 'balanced-regex'),
 
             (r'm?/(\\\\|\\/|[^/\n])*/[gcimosx]*', String.Regex),
+            (r'm(?=[/!\\{<\[\(@%\$])', String.Regex, 'balanced-regex'),
             (r'((?<==~)|(?<=\())\s*/(\\\\|\\/|[^/])*/[gcimosx]*', String.Regex),
             (r'\s+', Text),
             (r'(abs|accept|alarm|atan2|bind|binmode|bless|caller|chdir|'
@@ -906,7 +902,7 @@
             (r'(q|qq|qw|qr|qx)\(', String.Other, 'rb-string'),
             (r'(q|qq|qw|qr|qx)\[', String.Other, 'sb-string'),
             (r'(q|qq|qw|qr|qx)\<', String.Other, 'lt-string'),
-            (r'(q|qq|qw|qr|qx)(.)[.\n]*?\1', String.Other),
+            (r'(q|qq|qw|qr|qx)([^a-zA-Z0-9])(.|\n)*?\2', String.Other),
             (r'package\s+', Keyword, 'modulename'),
             (r'sub\s+', Keyword, 'funcname'),
             (r'(\[\]|\*\*|::|<<|>>|>=|<=|<=>|={3}|!=|=~|'
@@ -970,7 +966,7 @@
             (r'\\', String.Other),
             (r'\<', String.Other, 'lt-string'),
             (r'\>', String.Other, '#pop'),
-            (r'[^\<\>]]+', String.Other)
+            (r'[^\<\>]+', String.Other)
         ],
         'end-part': [
             (r'.+', Comment.Preproc, '#pop')
@@ -1015,6 +1011,11 @@
 
     tokens = {
         'root': [
+            # lua allows a file to start with a shebang
+            (r'#!(.*?)$', Comment.Preproc),
+            (r'', Text, 'base'),
+        ],
+        'base': [
             (r'(?s)--\[(=*)\[.*?\]\1\]', Comment.Multiline),
             ('--.*$', Comment.Single),
 
@@ -1263,6 +1264,7 @@
             include('command'),
             include('basic'),
             include('data'),
+            (r'}', Keyword),  # HACK: somehow we miscounted our braces
         ],
         'command': _gen_command_rules(keyword_cmds_re, builtin_cmds_re),
         'command-in-brace': _gen_command_rules(keyword_cmds_re,
@@ -1441,7 +1443,7 @@
             # strings, symbols and characters
             (r'"(\\\\|\\"|[^"])*"', String),
             (r"'" + valid_name, String.Symbol),
-            (r"\\([()/'\".'_!§$%& ?;=+-]{1}|[a-zA-Z0-9]+)", String.Char),
+            (r"\\([()/'\".'_!§$%& ?;=#+-]{1}|[a-zA-Z0-9]+)", String.Char),
 
             # constants
             (r'(#t|#f)', Name.Constant),
--- a/MoinMoin/support/pygments/lexers/asm.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/asm.py	Sun Mar 07 21:36:31 2010 +0100
@@ -10,10 +10,6 @@
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.lexer import RegexLexer, include, bygroups, using, DelegatingLexer
 from pygments.lexers.compiled import DLexer, CppLexer, CLexer
--- a/MoinMoin/support/pygments/lexers/compiled.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/compiled.py	Sun Mar 07 21:36:31 2010 +0100
@@ -10,10 +10,6 @@
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.scanner import Scanner
 from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
@@ -29,7 +25,8 @@
 __all__ = ['CLexer', 'CppLexer', 'DLexer', 'DelphiLexer', 'JavaLexer',
            'ScalaLexer', 'DylanLexer', 'OcamlLexer', 'ObjectiveCLexer',
            'FortranLexer', 'GLShaderLexer', 'PrologLexer', 'CythonLexer',
-           'ValaLexer', 'OocLexer', 'GoLexer']
+           'ValaLexer', 'OocLexer', 'GoLexer', 'FelixLexer', 'AdaLexer',
+           'Modula2Lexer']
 
 
 class CLexer(RegexLexer):
@@ -63,6 +60,7 @@
             (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),
             (r'0[0-7]+[Ll]?', Number.Oct),
             (r'\d+[Ll]?', Number.Integer),
+            (r'\*/', Error),
             (r'[~!%^&*+=|?:<>/-]', Operator),
             (r'[()\[\],.]', Punctuation),
             (r'\b(case)(.+?)(:)', bygroups(Keyword, using(this), Text)),
@@ -187,6 +185,7 @@
             (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),
             (r'0[0-7]+[Ll]?', Number.Oct),
             (r'\d+[Ll]?', Number.Integer),
+            (r'\*/', Error),
             (r'[~!%^&*+=|?:<>/-]', Operator),
             (r'[()\[\],.;]', Punctuation),
             (r'(asm|auto|break|case|catch|const|const_cast|continue|'
@@ -929,6 +928,7 @@
         ],
     }
 
+
 class ScalaLexer(RegexLexer):
     """
     For `Scala <http://www.scala-lang.org>`_ source code.
@@ -1122,14 +1122,14 @@
             (r'__(asm|int8|based|except|int16|stdcall|cdecl|fastcall|int32|'
              r'declspec|finally|int64|try|leave)\b', Keyword.Reserved),
             (r'(TRUE|FALSE|nil|NULL)\b', Name.Builtin),
-            ('[a-zA-Z_][a-zA-Z0-9_]*:(?!:)', Name.Label),
-            ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
+            ('[a-zA-Z$_][a-zA-Z0-9$_]*:(?!:)', Name.Label),
+            ('[a-zA-Z$_][a-zA-Z0-9$_]*', Name),
         ],
         'root': [
             include('whitespace'),
             # functions
             (r'((?:[a-zA-Z0-9_*\s])+?(?:\s|[*]))'    # return arguments
-             r'([a-zA-Z_][a-zA-Z0-9_]*)'             # method name
+             r'([a-zA-Z$_][a-zA-Z0-9$_]*)'           # method name
              r'(\s*\([^;]*?\))'                      # signature
              r'(' + _ws + r')({)',
              bygroups(using(this), Name.Function,
@@ -1137,7 +1137,7 @@
              'function'),
             # function declarations
             (r'((?:[a-zA-Z0-9_*\s])+?(?:\s|[*]))'    # return arguments
-             r'([a-zA-Z_][a-zA-Z0-9_]*)'             # method name
+             r'([a-zA-Z$_][a-zA-Z0-9$_]*)'           # method name
              r'(\s*\([^;]*?\))'                      # signature
              r'(' + _ws + r')(;)',
              bygroups(using(this), Name.Function,
@@ -1151,18 +1151,18 @@
         ],
         'classname' : [
             # interface definition that inherits
-            ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*:\s*)([a-zA-Z_][a-zA-Z0-9_]*)?',
+            ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*:\s*)([a-zA-Z$_][a-zA-Z0-9$_]*)?',
              bygroups(Name.Class, Text, Name.Class), '#pop'),
             # interface definition for a category
-            ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*)(\([a-zA-Z_][a-zA-Z0-9_]*\))',
+            ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*)(\([a-zA-Z$_][a-zA-Z0-9$_]*\))',
              bygroups(Name.Class, Text, Name.Label), '#pop'),
             # simple interface / implementation
-            ('([a-zA-Z_][a-zA-Z0-9_]*)', Name.Class, '#pop')
+            ('([a-zA-Z$_][a-zA-Z0-9$_]*)', Name.Class, '#pop')
         ],
         'forward_classname' : [
-          ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*,\s*)',
+          ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*,\s*)',
            bygroups(Name.Class, Text), 'forward_classname'),
-          ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*;?)',
+          ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*;?)',
            bygroups(Name.Class, Text), '#pop')
         ],
         'statement' : [
@@ -1790,3 +1790,576 @@
             (r'[a-zA-Z_]\w*', Name),
         ]
     }
+
+
+class FelixLexer(RegexLexer):
+    """
+    For `Felix <http://www.felix-lang.org>`_ source code.
+
+    *New in Pygments 1.2.*
+    """
+
+    name = 'Felix'
+    aliases = ['felix', 'flx']
+    filenames = ['*.flx', '*.flxh']
+    mimetypes = ['text/x-felix']
+
+    preproc = [
+        'elif', 'else', 'endif', 'if', 'ifdef', 'ifndef',
+    ]
+
+    keywords = [
+        '_', '_deref', 'all', 'as',
+        'assert', 'attempt', 'call', 'callback', 'case', 'caseno', 'cclass',
+        'code', 'compound', 'ctypes', 'do', 'done', 'downto', 'elif', 'else',
+        'endattempt', 'endcase', 'endif', 'endmatch', 'enum', 'except',
+        'exceptions', 'expect', 'finally', 'for', 'forall', 'forget', 'fork',
+        'functor', 'goto', 'ident', 'if', 'incomplete', 'inherit', 'instance',
+        'interface', 'jump', 'lambda', 'loop', 'match', 'module', 'namespace',
+        'new', 'noexpand', 'nonterm', 'obj', 'of', 'open', 'parse', 'raise',
+        'regexp', 'reglex', 'regmatch', 'rename', 'return', 'the', 'then',
+        'to', 'type', 'typecase', 'typedef', 'typematch', 'typeof', 'upto',
+        'when', 'whilst', 'with', 'yield',
+    ]
+
+    keyword_directives = [
+        '_gc_pointer', '_gc_type', 'body', 'comment', 'const', 'export',
+        'header', 'inline', 'lval', 'macro', 'noinline', 'noreturn',
+        'package', 'private', 'pod', 'property', 'public', 'publish',
+        'requires', 'todo', 'virtual', 'use',
+    ]
+
+    keyword_declarations = [
+        'def', 'let', 'ref', 'val', 'var',
+    ]
+
+    keyword_types = [
+        'unit', 'void', 'any', 'bool',
+        'byte',  'offset',
+        'address', 'caddress', 'cvaddress', 'vaddress',
+        'tiny', 'short', 'int', 'long', 'vlong',
+        'utiny', 'ushort', 'vshort', 'uint', 'ulong', 'uvlong',
+        'int8', 'int16', 'int32', 'int64',
+        'uint8', 'uint16', 'uint32', 'uint64',
+        'float', 'double', 'ldouble',
+        'complex', 'dcomplex', 'lcomplex',
+        'imaginary', 'dimaginary', 'limaginary',
+        'char', 'wchar', 'uchar',
+        'charp', 'charcp', 'ucharp', 'ucharcp',
+        'string', 'wstring', 'ustring',
+        'cont',
+        'array', 'varray', 'list',
+        'lvalue', 'opt', 'slice',
+    ]
+
+    keyword_constants = [
+        'false', 'true',
+    ]
+
+    operator_words = [
+        'and', 'not', 'in', 'is', 'isin', 'or', 'xor',
+    ]
+
+    name_builtins = [
+        '_svc', 'while',
+    ]
+
+    name_pseudo = [
+        'root', 'self', 'this',
+    ]
+
+    decimal_suffixes = '([tTsSiIlLvV]|ll|LL|([iIuU])(8|16|32|64))?'
+
+    tokens = {
+        'root': [
+            include('whitespace'),
+
+            # Keywords
+            (r'(axiom|ctor|fun|gen|proc|reduce|union)\b', Keyword,
+             'funcname'),
+            (r'(class|cclass|cstruct|obj|struct)\b', Keyword, 'classname'),
+            (r'(instance|module|typeclass)\b', Keyword, 'modulename'),
+
+            (r'(%s)\b' % '|'.join(keywords), Keyword),
+            (r'(%s)\b' % '|'.join(keyword_directives), Name.Decorator),
+            (r'(%s)\b' % '|'.join(keyword_declarations), Keyword.Declaration),
+            (r'(%s)\b' % '|'.join(keyword_types), Keyword.Type),
+            (r'(%s)\b' % '|'.join(keyword_constants), Keyword.Constant),
+
+            # Operators
+            include('operators'),
+
+            # Float Literal
+            # -- Hex Float
+            (r'0[xX]([0-9a-fA-F_]*\.[0-9a-fA-F_]+|[0-9a-fA-F_]+)'
+             r'[pP][+\-]?[0-9_]+[lLfFdD]?', Number.Float),
+            # -- DecimalFloat
+            (r'[0-9_]+(\.[0-9_]+[eE][+\-]?[0-9_]+|'
+             r'\.[0-9_]*|[eE][+\-]?[0-9_]+)[lLfFdD]?', Number.Float),
+            (r'\.(0|[1-9][0-9_]*)([eE][+\-]?[0-9_]+)?[lLfFdD]?',
+             Number.Float),
+
+            # IntegerLiteral
+            # -- Binary
+            (r'0[Bb][01_]+%s' % decimal_suffixes, Number),
+            # -- Octal
+            (r'0[0-7_]+%s' % decimal_suffixes, Number.Oct),
+            # -- Hexadecimal
+            (r'0[xX][0-9a-fA-F_]+%s' % decimal_suffixes, Number.Hex),
+            # -- Decimal
+            (r'(0|[1-9][0-9_]*)%s' % decimal_suffixes, Number.Integer),
+
+            # Strings
+            ('([rR][cC]?|[cC][rR])"""', String, 'tdqs'),
+            ("([rR][cC]?|[cC][rR])'''", String, 'tsqs'),
+            ('([rR][cC]?|[cC][rR])"', String, 'dqs'),
+            ("([rR][cC]?|[cC][rR])'", String, 'sqs'),
+            ('[cCfFqQwWuU]?"""', String, combined('stringescape', 'tdqs')),
+            ("[cCfFqQwWuU]?'''", String, combined('stringescape', 'tsqs')),
+            ('[cCfFqQwWuU]?"', String, combined('stringescape', 'dqs')),
+            ("[cCfFqQwWuU]?'", String, combined('stringescape', 'sqs')),
+
+            # Punctuation
+            (r'[\[\]{}:(),;?]', Punctuation),
+
+            # Labels
+            (r'[a-zA-Z_]\w*:>', Name.Label),
+
+            # Identifiers
+            (r'(%s)\b' % '|'.join(name_builtins), Name.Builtin),
+            (r'(%s)\b' % '|'.join(name_pseudo), Name.Builtin.Pseudo),
+            (r'[a-zA-Z_]\w*', Name),
+        ],
+        'whitespace': [
+            (r'\n', Text),
+            (r'\s+', Text),
+
+            include('comment'),
+
+            # Preprocessor
+            (r'#\s*if\s+0', Comment.Preproc, 'if0'),
+            (r'#', Comment.Preproc, 'macro'),
+        ],
+        'operators': [
+            (r'(%s)\b' % '|'.join(operator_words), Operator.Word),
+            (r'!=|==|<<|>>|\|\||&&|[-~+/*%=<>&^|.$]', Operator),
+        ],
+        'comment': [
+            (r'//(.*?)\n', Comment.Single),
+            (r'/[*]', Comment.Multiline, 'comment2'),
+        ],
+        'comment2': [
+            (r'[^\/*]', Comment.Multiline),
+            (r'/[*]', Comment.Multiline, '#push'),
+            (r'[*]/', Comment.Multiline, '#pop'),
+            (r'[\/*]', Comment.Multiline),
+        ],
+        'if0': [
+            (r'^\s*#if.*?(?<!\\)\n', Comment, '#push'),
+            (r'^\s*#endif.*?(?<!\\)\n', Comment, '#pop'),
+            (r'.*?\n', Comment),
+        ],
+        'macro': [
+            include('comment'),
+            (r'(import|include)(\s+)(<[^>]*?>)',
+             bygroups(Comment.Preproc, Text, String), '#pop'),
+            (r'(import|include)(\s+)("[^"]*?")',
+             bygroups(Comment.Preproc, Text, String), '#pop'),
+            (r"(import|include)(\s+)('[^']*?')",
+             bygroups(Comment.Preproc, Text, String), '#pop'),
+            (r'[^/\n]+', Comment.Preproc),
+            ##(r'/[*](.|\n)*?[*]/', Comment),
+            ##(r'//.*?\n', Comment, '#pop'),
+            (r'/', Comment.Preproc),
+            (r'(?<=\\)\n', Comment.Preproc),
+            (r'\n', Comment.Preproc, '#pop'),
+        ],
+        'funcname': [
+            include('whitespace'),
+            (r'[a-zA-Z_]\w*', Name.Function, '#pop'),
+            # anonymous functions
+            (r'(?=\()', Text, '#pop'),
+        ],
+        'classname': [
+            include('whitespace'),
+            (r'[a-zA-Z_]\w*', Name.Class, '#pop'),
+            # anonymous classes
+            (r'(?=\{)', Text, '#pop'),
+        ],
+        'modulename': [
+            include('whitespace'),
+            (r'\[', Punctuation, ('modulename2', 'tvarlist')),
+            (r'', Error, 'modulename2'),
+        ],
+        'modulename2': [
+            include('whitespace'),
+            (r'([a-zA-Z_]\w*)', Name.Namespace, '#pop:2'),
+        ],
+        'tvarlist': [
+            include('whitespace'),
+            include('operators'),
+            (r'\[', Punctuation, '#push'),
+            (r'\]', Punctuation, '#pop'),
+            (r',', Punctuation),
+            (r'(with|where)\b', Keyword),
+            (r'[a-zA-Z_]\w*', Name),
+        ],
+        'stringescape': [
+            (r'\\([\\abfnrtv"\']|\n|N{.*?}|u[a-fA-F0-9]{4}|'
+             r'U[a-fA-F0-9]{8}|x[a-fA-F0-9]{2}|[0-7]{1,3})', String.Escape)
+        ],
+        'strings': [
+            (r'%(\([a-zA-Z0-9]+\))?[-#0 +]*([0-9]+|[*])?(\.([0-9]+|[*]))?'
+             '[hlL]?[diouxXeEfFgGcrs%]', String.Interpol),
+            (r'[^\\\'"%\n]+', String),
+            # quotes, percents and backslashes must be parsed one at a time
+            (r'[\'"\\]', String),
+            # unhandled string formatting sign
+            (r'%', String)
+            # newlines are an error (use "nl" state)
+        ],
+        'nl': [
+            (r'\n', String)
+        ],
+        'dqs': [
+            (r'"', String, '#pop'),
+            # included here again for raw strings
+            (r'\\\\|\\"|\\\n', String.Escape),
+            include('strings')
+        ],
+        'sqs': [
+            (r"'", String, '#pop'),
+            # included here again for raw strings
+            (r"\\\\|\\'|\\\n", String.Escape),
+            include('strings')
+        ],
+        'tdqs': [
+            (r'"""', String, '#pop'),
+            include('strings'),
+            include('nl')
+        ],
+        'tsqs': [
+            (r"'''", String, '#pop'),
+            include('strings'),
+            include('nl')
+        ],
+     }
+
+
+class AdaLexer(RegexLexer):
+    """
+    For Ada source code.
+
+    *New in Pygments 1.3.*
+    """
+
+    name = 'Ada'
+    aliases = ['ada', 'ada95' 'ada2005']
+    filenames = ['*.adb', '*.ads', '*.ada']
+    mimetypes = ['text/x-ada']
+
+    flags = re.MULTILINE | re.I  # Ignore case
+
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
+
+    tokens = {
+        'root': [
+            (r'[^\S\n]+', Text),
+            (r'--.*?\n', Comment.Single),
+            (r'[^\S\n]+', Text),
+            (r'function|procedure|entry', Keyword.Declaration, 'subprogram'),
+            (r'(subtype|type)(\s+)([a-z0-9_]+)',
+             bygroups(Keyword.Declaration, Text, Keyword.Type), 'type_def'),
+            (r'task|protected', Keyword.Declaration),
+            (r'(subtype)(\s+)', bygroups(Keyword.Declaration, Text)),
+            (r'(end)(\s+)', bygroups(Keyword.Reserved, Text), 'end'),
+            (r'(pragma)(\s+)([a-zA-Z0-9_]+)', bygroups(Keyword.Reserved, Text,
+                                                       Comment.Preproc)),
+            (r'(true|false|null)\b', Keyword.Constant),
+            (r'(Byte|Character|Float|Integer|Long_Float|Long_Integer|'
+             r'Long_Long_Float|Long_Long_Integer|Natural|Positive|Short_Float|'
+             r'Short_Integer|Short_Short_Float|Short_Short_Integer|String|'
+             r'Wide_String|Duration)\b', Keyword.Type),
+            (r'(and(\s+then)?|in|mod|not|or(\s+else)|rem)\b', Operator.Word),
+            (r'generic|private', Keyword.Declaration),
+            (r'package', Keyword.Declaration, 'package'),
+            (r'array\b', Keyword.Reserved, 'array_def'),
+            (r'(with|use)(\s+)', bygroups(Keyword.Namespace, Text), 'import'),
+            (r'([a-z0-9_]+)(\s*)(:)(\s*)(constant)',
+             bygroups(Name.Constant, Text, Punctuation, Text,
+                      Keyword.Reserved)),
+            (r'<<[a-z0-9_]+>>', Name.Label),
+            (r'([a-z0-9_]+)(\s*)(:)(\s*)(declare|begin|loop|for|while)',
+             bygroups(Name.Label, Text, Punctuation, Text, Keyword.Reserved)),
+            (r'\b(abort|abs|abstract|accept|access|aliased|all|array|at|begin|'
+             r'body|case|constant|declare|delay|delta|digits|do|else|elsif|end|'
+             r'entry|exception|exit|interface|for|goto|if|is|limited|loop|new|'
+             r'null|of|or|others|out|overriding|pragma|protected|raise|range|'
+             r'record|renames|requeue|return|reverse|select|separate|subtype|'
+             r'synchronized|task|tagged|terminate|then|type|until|when|while|'
+             r'xor)\b',
+             Keyword.Reserved),
+            (r'"[^"]*"', String),
+            include('attribute'),
+            include('numbers'),
+            (r"'[^']'", String.Character),
+            (r'([a-z0-9_]+)(\s*|[(,])', bygroups(Name, using(this))),
+            (r"(<>|=>|:=|[\(\)\|:;,.'])", Punctuation),
+            (r'[*<>+=/&-]', Operator),
+            (r'\n+', Text),
+        ],
+        'numbers' : [
+            (r'[0-9_]+#[0-9a-f]+#', Number.Hex),
+            (r'[0-9_]+\.[0-9_]*', Number.Float),
+            (r'[0-9_]+', Number.Integer),
+        ],
+        'attribute' : [
+            (r"(')([a-zA-Z0-9_]+)", bygroups(Punctuation, Name.Attribute)),
+        ],
+        'subprogram' : [
+            (r'\(', Punctuation, ('#pop', 'formal_part')),
+            (r';', Punctuation, '#pop'),
+            (r'is\b', Keyword.Reserved, '#pop'),
+            (r'"[^"]+"|[a-z0-9_]+', Name.Function),
+            include('root'),
+        ],
+        'end' : [
+            ('(if|case|record|loop|select)', Keyword.Reserved),
+            ('"[^"]+"|[a-zA-Z0-9_]+', Name.Function),
+            ('[\n\s]+', Text),
+            (';', Punctuation, '#pop'),
+        ],
+        'type_def': [
+            (r';', Punctuation, '#pop'),
+            (r'\(', Punctuation, 'formal_part'),
+            (r'with|and|use', Keyword.Reserved),
+            (r'array\b', Keyword.Reserved, ('#pop', 'array_def')),
+            (r'record\b', Keyword.Reserved, ('formal_part')),
+            include('root'),
+        ],
+        'array_def' : [
+            (r';', Punctuation, '#pop'),
+            (r'([a-z0-9_]+)(\s+)(range)', bygroups(Keyword.Type, Text,
+                                                   Keyword.Reserved)),
+            include('root'),
+        ],
+        'import': [
+            (r'[a-z0-9_.]+', Name.Namespace, '#pop'),
+        ],
+        'formal_part' : [
+            (r'\)', Punctuation, '#pop'),
+            (r'([a-z0-9_]+)(\s*)(,|:[^=])', bygroups(Name.Variable,
+                                                     Text, Punctuation)),
+            (r'(in|not|null|out|access)\b', Keyword.Reserved),
+            include('root'),
+        ],
+        'package': [
+            ('body', Keyword.Declaration),
+            ('is\s+new|renames', Keyword.Reserved),
+            ('is', Keyword.Reserved, '#pop'),
+            (';', Punctuation, '#pop'),
+            ('\(', Punctuation, 'package_instantiation'),
+            ('([a-zA-Z0-9_.]+)', Name.Class),
+            include('root'),
+        ],
+        'package_instantiation': [
+            (r'("[^"]+"|[a-z0-9_]+)(\s+)(=>)', bygroups(Name.Variable,
+                                                        Text, Punctuation)),
+            (r'[a-z0-9._\'"]', Text),
+            (r'\)', Punctuation, '#pop'),
+            include('root'),
+        ],
+    }
+
+
+class Modula2Lexer(RegexLexer):
+    """
+    For `Modula-2 <http://www.modula2.org/>`_ source code.
+
+    Additional options that determine which keywords are highlighted:
+
+    `pim`
+        Select PIM Modula-2 dialect (default: True).
+    `iso`
+        Select ISO Modula-2 dialect (default: False).
+    `objm2`
+        Select Objective Modula-2 dialect (default: False).
+    `gm2ext`
+        Also highlight GNU extensions (default: False).
+
+    *New in Pygments 1.3.*
+    """
+    name = 'Modula-2'
+    aliases = ['modula2', 'm2']
+    filenames = ['*.def', '*.mod']
+    mimetypes = ['text/x-modula2']
+
+    flags = re.MULTILINE | re.DOTALL
+
+    tokens = {
+        'whitespace': [
+            (r'\n+', Text), # blank lines
+            (r'\s+', Text), # whitespace
+        ],
+        'identifiers': [
+            (r'([a-zA-Z_\$][a-zA-Z0-9_\$]*)', Name),
+        ],
+        'numliterals': [
+            (r'[01]+B', Number.Binary),        # binary number (ObjM2)
+            (r'[0-7]+B', Number.Oct),          # octal number (PIM + ISO)
+            (r'[0-7]+C', Number.Oct),          # char code (PIM + ISO)
+            (r'[0-9A-F]+C', Number.Hex),       # char code (ObjM2)
+            (r'[0-9A-F]+H', Number.Hex),       # hexadecimal number
+            (r'[0-9]+\.[0-9]+E[+-][0-9]+', Number.Float), # real number
+            (r'[0-9]+\.[0-9]+', Number.Float), # real number
+            (r'[0-9]+', Number.Integer),       # decimal whole number
+        ],
+        'strings': [
+            (r"'(\\\\|\\'|[^'])*'", String), # single quoted string
+            (r'"(\\\\|\\"|[^"])*"', String), # double quoted string
+        ],
+        'operators': [
+            (r'[*/+=#~&<>\^-]', Operator),
+            (r':=', Operator),   # assignment
+            (r'@', Operator),    # pointer deref (ISO)
+            (r'\.\.', Operator), # ellipsis or range
+            (r'`', Operator),    # Smalltalk message (ObjM2)
+            (r'::', Operator),   # type conversion (ObjM2)
+        ],
+        'punctuation': [
+            (r'[\(\)\[\]{},.:;|]', Punctuation),
+        ],
+        'comments': [
+            (r'//.*?\n', Comment.Single),       # ObjM2
+            (r'/\*(.*?)\*/', Comment.Multiline), # ObjM2
+            (r'\(\*([^\$].*?)\*\)', Comment.Multiline),
+            # TO DO: nesting of (* ... *) comments
+        ],
+        'pragmas': [
+            (r'\(\*\$(.*?)\*\)', Comment.Preproc), # PIM
+            (r'<\*(.*?)\*>', Comment.Preproc),     # ISO + ObjM2
+        ],
+        'root': [
+            include('whitespace'),
+            include('comments'),
+            include('pragmas'),
+            include('identifiers'),
+            include('numliterals'),
+            include('strings'),
+            include('operators'),
+            include('punctuation'),
+        ]
+    }
+
+    pim_reserved_words = [
+        # 40 reserved words
+        'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION',
+        'DIV', 'DO', 'ELSE', 'ELSIF', 'END', 'EXIT', 'EXPORT', 'FOR',
+        'FROM', 'IF', 'IMPLEMENTATION', 'IMPORT', 'IN', 'LOOP', 'MOD',
+        'MODULE', 'NOT', 'OF', 'OR', 'POINTER', 'PROCEDURE', 'QUALIFIED',
+        'RECORD', 'REPEAT', 'RETURN', 'SET', 'THEN', 'TO', 'TYPE',
+        'UNTIL', 'VAR', 'WHILE', 'WITH',
+    ]
+
+    pim_pervasives = [
+        # 31 pervasives
+        'ABS', 'BITSET', 'BOOLEAN', 'CAP', 'CARDINAL', 'CHAR', 'CHR', 'DEC',
+        'DISPOSE', 'EXCL', 'FALSE', 'FLOAT', 'HALT', 'HIGH', 'INC', 'INCL',
+        'INTEGER', 'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NEW', 'NIL', 'ODD',
+        'ORD', 'PROC', 'REAL', 'SIZE', 'TRUE', 'TRUNC', 'VAL',
+    ]
+
+    iso_reserved_words = [
+        # 46 reserved words
+        'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION', 'DIV',
+        'DO', 'ELSE', 'ELSIF', 'END', 'EXCEPT', 'EXIT', 'EXPORT', 'FINALLY',
+        'FOR', 'FORWARD', 'FROM', 'IF', 'IMPLEMENTATION', 'IMPORT', 'IN',
+        'LOOP', 'MOD', 'MODULE', 'NOT', 'OF', 'OR', 'PACKEDSET', 'POINTER',
+        'PROCEDURE', 'QUALIFIED', 'RECORD', 'REPEAT', 'REM', 'RETRY',
+        'RETURN', 'SET', 'THEN', 'TO', 'TYPE', 'UNTIL', 'VAR', 'WHILE',
+        'WITH',
+    ]
+
+    iso_pervasives = [
+        # 42 pervasives
+        'ABS', 'BITSET', 'BOOLEAN', 'CAP', 'CARDINAL', 'CHAR', 'CHR', 'CMPLX',
+        'COMPLEX', 'DEC', 'DISPOSE', 'EXCL', 'FALSE', 'FLOAT', 'HALT', 'HIGH',
+        'IM', 'INC', 'INCL', 'INT', 'INTEGER', 'INTERRUPTIBLE', 'LENGTH',
+        'LFLOAT', 'LONGCOMPLEX', 'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NEW',
+        'NIL', 'ODD', 'ORD', 'PROC', 'PROTECTION', 'RE', 'REAL', 'SIZE',
+        'TRUE', 'TRUNC', 'UNINTERRUBTIBLE', 'VAL',
+    ]
+
+    objm2_reserved_words = [
+        # base language, 42 reserved words
+        'AND', 'ARRAY', 'BEGIN', 'BY', 'CASE', 'CONST', 'DEFINITION', 'DIV',
+        'DO', 'ELSE', 'ELSIF', 'END', 'ENUM', 'EXIT', 'FOR', 'FROM', 'IF',
+        'IMMUTABLE', 'IMPLEMENTATION', 'IMPORT', 'IN', 'IS', 'LOOP', 'MOD',
+        'MODULE', 'NOT', 'OF', 'OPAQUE', 'OR', 'POINTER', 'PROCEDURE',
+        'RECORD', 'REPEAT', 'RETURN', 'SET', 'THEN', 'TO', 'TYPE',
+        'UNTIL', 'VAR', 'VARIADIC', 'WHILE',
+        # OO extensions, 16 reserved words
+        'BYCOPY', 'BYREF', 'CLASS', 'CONTINUE', 'CRITICAL', 'INOUT', 'METHOD',
+        'ON', 'OPTIONAL', 'OUT', 'PRIVATE', 'PROTECTED', 'PROTOCOL', 'PUBLIC',
+        'SUPER', 'TRY',
+    ]
+
+    objm2_pervasives = [
+        # base language, 38 pervasives
+        'ABS', 'BITSET', 'BOOLEAN', 'CARDINAL', 'CHAR', 'CHR', 'DISPOSE',
+        'FALSE', 'HALT', 'HIGH', 'INTEGER', 'INRANGE', 'LENGTH', 'LONGCARD',
+        'LONGINT', 'LONGREAL', 'MAX', 'MIN', 'NEG', 'NEW', 'NEXTV', 'NIL',
+        'OCTET', 'ODD', 'ORD', 'PRED', 'PROC', 'READ', 'REAL', 'SUCC', 'TMAX',
+        'TMIN', 'TRUE', 'TSIZE', 'UNICHAR', 'VAL', 'WRITE', 'WRITEF',
+        # OO extensions, 3 pervasives
+        'OBJECT', 'NO', 'YES',
+    ]
+
+    gnu_reserved_words = [
+        # 10 additional reserved words
+        'ASM', '__ATTRIBUTE__', '__BUILTIN__', '__COLUMN__', '__DATE__',
+        '__FILE__', '__FUNCTION__', '__LINE__', '__MODULE__', 'VOLATILE',
+    ]
+
+    gnu_pervasives = [
+        # 21 identifiers, actually from pseudo-module SYSTEM
+        # but we will highlight them as if they were pervasives
+        'BITSET8', 'BITSET16', 'BITSET32', 'CARDINAL8', 'CARDINAL16',
+        'CARDINAL32', 'CARDINAL64', 'COMPLEX32', 'COMPLEX64', 'COMPLEX96',
+        'COMPLEX128', 'INTEGER8', 'INTEGER16', 'INTEGER32', 'INTEGER64',
+        'REAL8', 'REAL16', 'REAL32', 'REAL96', 'REAL128', 'THROW',
+    ]
+
+    def __init__(self, **options):
+        self.reserved_words = set()
+        self.pervasives = set()
+        # ISO Modula-2
+        if get_bool_opt(options, 'iso', False):
+            self.reserved_words.update(self.iso_reserved_words)
+            self.pervasives.update(self.iso_pervasives)
+        # Objective Modula-2
+        elif get_bool_opt(options, 'objm2', False):
+            self.reserved_words.update(self.objm2_reserved_words)
+            self.pervasives.update(self.objm2_pervasives)
+        # PIM Modula-2 (DEFAULT)
+        else:
+            self.reserved_words.update(self.pim_reserved_words)
+            self.pervasives.update(self.pim_pervasives)
+        # GNU extensions
+        if get_bool_opt(options, 'gm2ext', False):
+            self.reserved_words.update(self.gnu_reserved_words)
+            self.pervasives.update(self.gnu_pervasives)
+        # initialise
+        RegexLexer.__init__(self, **options)
+
+    def get_tokens_unprocessed(self, text):
+        for index, token, value in \
+            RegexLexer.get_tokens_unprocessed(self, text):
+            # check for reserved words and pervasives
+            if token is Name:
+                if value in self.reserved_words:
+                    token = Keyword.Reserved
+                elif value in self.pervasives:
+                    token = Keyword.Pervasive
+            # return result
+            yield index, token, value
--- a/MoinMoin/support/pygments/lexers/functional.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/functional.py	Sun Mar 07 21:36:31 2010 +0100
@@ -10,10 +10,6 @@
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.lexer import Lexer, RegexLexer, bygroups, include, do_insertions
 from pygments.token import Text, Comment, Operator, Keyword, Name, \
@@ -474,7 +470,7 @@
 
         style = self.options.get('litstyle')
         if style is None:
-            style = (text.lstrip()[0] in '%\\') and 'latex' or 'bird'
+            style = (text.lstrip()[0:1] in '%\\') and 'latex' or 'bird'
 
         code = ''
         insertions = []
--- a/MoinMoin/support/pygments/lexers/math.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/math.py	Sun Mar 07 21:36:31 2010 +0100
@@ -10,10 +10,6 @@
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.lexer import Lexer, RegexLexer, bygroups, include, do_insertions
 from pygments.token import Comment, String, Punctuation, Keyword, Name, \
@@ -22,7 +18,7 @@
 from pygments.lexers.agile import PythonLexer
 
 __all__ = ['MuPADLexer', 'MatlabLexer', 'MatlabSessionLexer', 'NumPyLexer',
-           'SLexer']
+           'RConsoleLexer', 'SLexer']
 
 
 class MuPADLexer(RegexLexer):
@@ -340,6 +336,52 @@
                 yield index, token, value
 
 
+class RConsoleLexer(Lexer):
+    """
+    For R console transcripts or R CMD BATCH output files.
+    """
+
+    name = 'RConsole'
+    aliases = ['rconsole', 'rout']
+    filenames = ['*.Rout']
+
+    def get_tokens_unprocessed(self, text):
+        slexer = SLexer(**self.options)
+
+        current_code_block = ''
+        insertions = []
+
+        for match in line_re.finditer(text):
+            line = match.group()
+            if line.startswith('>') or line.startswith('+'):
+                # Colorize the prompt as such,
+                # then put rest of line into current_code_block
+                insertions.append((len(current_code_block),
+                                   [(0, Generic.Prompt, line[:2])]))
+                current_code_block += line[2:]
+            else:
+                # We have reached a non-prompt line!
+                # If we have stored prompt lines, need to process them first.
+                if current_code_block:
+                    # Weave together the prompts and highlight code.
+                    for item in do_insertions(insertions,
+                          slexer.get_tokens_unprocessed(current_code_block)):
+                        yield item
+                    # Reset vars for next code block.
+                    current_code_block = ''
+                    insertions = []
+                # Now process the actual line itself, this is output from R.
+                yield match.start(), Generic.Output, line
+
+        # If we happen to end on a code block with nothing after it, need to
+        # process the last code block. This is neither elegant nor DRY so
+        # should be changed.
+        if current_code_block:
+            for item in do_insertions(insertions,
+                    slexer.get_tokens_unprocessed(current_code_block)):
+                yield item
+
+
 class SLexer(RegexLexer):
     """
     For S, S-plus, and R source code.
--- a/MoinMoin/support/pygments/lexers/other.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/other.py	Sun Mar 07 21:36:31 2010 +0100
@@ -321,14 +321,14 @@
 
 class BashLexer(RegexLexer):
     """
-    Lexer for (ba)sh shell scripts.
+    Lexer for (ba|k|)sh shell scripts.
 
     *New in Pygments 0.6.*
     """
 
     name = 'Bash'
-    aliases = ['bash', 'sh']
-    filenames = ['*.sh', '*.ebuild', '*.eclass']
+    aliases = ['bash', 'sh', 'ksh']
+    filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass']
     mimetypes = ['application/x-sh', 'application/x-shellscript']
 
     tokens = {
@@ -633,11 +633,11 @@
         ],
         '_parenth_helper' : [
             include('whitespaces'),
+            (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number),
             (r'[-+*/\\~<>=|&#!?,@%\w+:]+', String.Symbol),
             # literals
             (r'\'[^\']*\'', String),
             (r'\$.', String.Char),
-            (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number),
             (r'#*\(', String.Symbol, 'inner_parenth'),
         ],
         'parenth' : [
@@ -2107,45 +2107,45 @@
     feature_keywords_regexp  = ur'^(기능|機能|功能|フィーチャ|خاصية|תכונה|Функционалност|Функционал|Особина|Могућност|Özellik|Właściwość|Tính năng|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd)(:)(.*)$'
     scenario_keywords_regexp = ur'^(\s*)(시나리오 개요|시나리오|배경|背景|場景大綱|場景|场景大纲|场景|劇本大綱|劇本|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|シナリオ|سيناريو مخطط|سيناريو|الخلفية|תרחיש|תבנית תרחיש|רקע|Тарих|Сценарио|Сценарий структураси|Сценарий|Структура сценарија|Структура сценария|Скица|Рамка на сценарий|Пример|Предыстория|Предистория|Позадина|Основа|Концепт|Контекст|Założenia|Tình huống|Tausta|Taust|Tapausaihio|Tapaus|Szenariogrundriss|Szenario|Szablon scenariusza|Stsenaarium|Struktura scenarija|Skica|Skenario konsep|Skenario|Situācija|Senaryo taslağı|Senaryo|Scénář|Scénario|Schema dello scenario|Scenārijs pēc parauga|Scenārijs|Scenár|Scenariusz|Scenariul de şablon|Scenariul de sablon|Scenariu|Scenario Outline|Scenario Amlinellol|Scenario|Scenarijus|Scenarijaus šablonas|Scenarij|Scenarie|Rerefons|Raamstsenaarium|Primer|Pozadí|Pozadina|Pozadie|Plan du scénario|Plan du Scénario|Osnova scénáře|Osnova|Náčrt Scénáře|Náčrt Scenáru|Mate|MISHUN SRSLY|MISHUN|Kịch bản|Kontext|Konteksts|Kontekstas|Kontekst|Koncept|Khung tình huống|Khung kịch bản|Háttér|Grundlage|Geçmiş|Forgatókönyv vázlat|Forgatókönyv|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l\'escenari|Escenario|Escenari|Dasar|Contexto|Contexte|Contesto|Condiţii|Conditii|Cenário|Cenario|Cefndir|Bối cảnh|Blokes|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|All y\'all|Achtergrond|Abstrakt Scenario|Abstract Scenario)(:)(.*)$'
     examples_regexp          = ur'^(\s*)(예|例子|例|サンプル|امثلة|דוגמאות|Сценарији|Примери|Мисоллар|Значения|Örnekler|Voorbeelden|Variantai|Tapaukset|Scenarios|Scenariji|Scenarijai|Příklady|Példák|Príklady|Przykłady|Primjeri|Primeri|Piemēri|Pavyzdžiai|Paraugs|Juhtumid|Exemplos|Exemples|Exemplele|Exempel|Examples|Esempi|Enghreifftiau|Eksempler|Ejemplos|EXAMPLZ|Dữ liệu|Contoh|Cobber|Beispiele)(:)(.*)$'
-    step_keywords_regexp     = ur'^(\s*)(하지만|조건|만일|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Унда |То |Онда |Но |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Агар |А |Și |És |anrhegedig a |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Yna |Ya know how |Ya gotta |Y |Wtedy |When y\'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y\'all |Then |Tapi |Tak |Tada |Tad |Så |Soit |Siis |Si |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givet |Given y\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Donat |Donada |Diyelim ki |Dengan |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |But y\'all |But |Biết |Bet |BUT |Atunci |And y\'all |And |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A )'
+    step_keywords_regexp     = ur'^(\s*)(하지만|조건|만일|그리고|그러면|那麼|那么|而且|當|当|前提|假設|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|و |متى |لكن |عندما |ثم |بفرض |اذاً |כאשר |וגם |בהינתן |אזי |אז |אבל |Унда |То |Онда |Но |Лекин |Когато |Када |Кад |К тому же |И |Задато |Задати |Задате |Если |Допустим |Дадено |Ва |Бирок |Аммо |Али |Агар |А |Și |És |anrhegedig a |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Yna |Ya know how |Ya gotta |Y |Wtedy |When y\'all |When |Wenn |WEN |Và |Ve |Und |Un |Thì |Then y\'all |Then |Tapi |Tak |Tada |Tad |Så |Stel |Soit |Siis |Si |Quando |Quand |Quan |Pryd |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Når |När |Niin |Nhưng |N |Mutta |Men |Mas |Maka |Majd |Mais |Maar |Ma |Lorsque |Lorsqu\'|Kun |Kuid |Kui |Khi |Keď |Ketika |Když |Kai |Kada |Kad |Jeżeli |Ja |Ir |I CAN HAZ |I |Ha |Givet |Given y\'all |Given |Gitt |Gegeven |Gegeben sei |Fakat |Eğer ki |Etant donné |Et |Então |Entonces |Entao |En |Eeldades |E |Duota |Donat |Donada |Diyelim ki |Dengan |De |Dato |Dar |Dann |Dan |Dado |Dacă |Daca |DEN |Când |Cuando |Cho |Cept |Cand |But y\'all |But |Biết |Bet |BUT |Atunci |And y\'all |And |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Aber |AN |A také |A |\* )'
 
     tokens = {
         'comments': [
-            (r'#.*$', Comment),
+            (r'#.*$', Comment)
           ],
         'multiline_descriptions' : [
             (step_keywords_regexp, Keyword, "#pop"),
             include('comments'),
-            (r"(\s|.)", Name.Constant),
+            (r"(\s|.)", Name.Constant)
           ],
         'multiline_descriptions_on_stack' : [
             (step_keywords_regexp, Keyword, "#pop:2"),
             include('comments'),
-            (r"(\s|.)", Name.Constant),
+            (r"(\s|.)", Name.Constant)
           ],
         'scenario_table_description': [
             (r"\s+\|", Text, 'scenario_table_header'),
             include('comments'),
-            (r"(\s|.)", Name.Constant),
+            (r"(\s|.)", Name.Constant)
           ],
         'scenario_table_header': [
             (r"\s+\|\s*$", Text, "#pop:2"),
             (r"(\s+\|\s*)(#.*)$", bygroups(Text, Comment), "#pop:2"),
             include('comments'),
             (r"\s+\|", Text),
-            (r"[^\|]", Name.Variable),
+            (r"[^\|]", Name.Variable)
           ],
         'scenario_sections_on_stack': [
             (scenario_keywords_regexp,
              bygroups(Text, Name.Class, Name.Class, Name.Constant),
-             "multiline_descriptions_on_stack"),
+             "multiline_descriptions_on_stack")
             ],
         'narrative': [
             include('scenario_sections_on_stack'),
-            (r"(\s|.)", Name.Builtin),
+            (r"(\s|.)", Name.Builtin)
           ],
         'table_vars': [
-            (r'(<[^>]*>)', bygroups(Name.Variable)),
+            (r'(<[^>]*>)', bygroups(Name.Variable))
           ],
         'string': [
             include('table_vars'),
@@ -2159,16 +2159,11 @@
             (r'"', String, "#pop"),
             include('string'),
           ],
-        'single_string': [
-            (r"'", String, "#pop"),
-            include('string'),
-          ],
         'root': [
             (r'\n', Text),
             include('comments'),
             (r'"""', String, "py_string"),
             (r'"', String, "double_string"),
-            (r"'", String, "single_string"),
             include('table_vars'),
             (r'@[^@\s]+', Name.Namespace),
             (step_keywords_regexp, bygroups(Text, Keyword)),
@@ -2180,7 +2175,7 @@
             (examples_regexp,
              bygroups(Text, Name.Class, Name.Class, Name.Constant),
              "scenario_table_description"),
-            (r'(\s|.)', Text),
+            (r'(\s|.)', Text)
         ]
     }
 
--- a/MoinMoin/support/pygments/lexers/parsers.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/parsers.py	Sun Mar 07 21:36:31 2010 +0100
@@ -12,17 +12,15 @@
 import re
 
 from pygments.lexer import RegexLexer, DelegatingLexer, \
-    include, bygroups, using, this
-from pygments.token import Error, Punctuation, Generic, Other, \
-    Text, Comment, Operator, Keyword, Name, String, Number, Whitespace
+    include, bygroups, using
+from pygments.token import Punctuation, Other, Text, Comment, Operator, \
+     Keyword, Name, String, Number, Whitespace
 from pygments.lexers.compiled import JavaLexer, CLexer, CppLexer, \
     ObjectiveCLexer, DLexer
 from pygments.lexers.dotnet import CSharpLexer
 from pygments.lexers.agile import RubyLexer, PythonLexer, PerlLexer
 from pygments.lexers.web import ActionScriptLexer
-# Use TextLexer during development to just focus on one part of a delegating
-# lexer.
-from pygments.lexers.special import TextLexer
+
 
 __all__ = ['RagelLexer', 'RagelEmbeddedLexer', 'RagelCLexer', 'RagelDLexer',
            'RagelCppLexer', 'RagelObjectiveCLexer', 'RagelRubyLexer',
--- a/MoinMoin/support/pygments/lexers/templates.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/templates.py	Sun Mar 07 21:36:31 2010 +0100
@@ -10,10 +10,6 @@
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
 from pygments.lexers.web import \
      PhpLexer, HtmlLexer, XmlLexer, JavascriptLexer, CssLexer
@@ -38,7 +34,8 @@
            'MakoHtmlLexer', 'MakoXmlLexer', 'MakoJavascriptLexer',
            'MakoCssLexer', 'JspLexer', 'CheetahLexer', 'CheetahHtmlLexer',
            'CheetahXmlLexer', 'CheetahJavascriptLexer',
-           'EvoqueLexer', 'EvoqueHtmlLexer', 'EvoqueXmlLexer']
+           'EvoqueLexer', 'EvoqueHtmlLexer', 'EvoqueXmlLexer',
+           'ColdfusionLexer', 'ColdfusionHtmlLexer']
 
 
 class ErbLexer(Lexer):
@@ -246,7 +243,7 @@
             (r'\.[a-zA-Z0-9_]+', Name.Variable),
             (r':?"(\\\\|\\"|[^"])*"', String.Double),
             (r":?'(\\\\|\\'|[^'])*'", String.Single),
-            (r'([{}()\[\]+\-*/,:]|[><=]=?)', Operator),
+            (r'([{}()\[\]+\-*/,:~]|[><=]=?)', Operator),
             (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
              r"0[xX][0-9a-fA-F]+[Ll]?", Number),
         ],
@@ -1294,3 +1291,97 @@
     def __init__(self, **options):
         super(EvoqueXmlLexer, self).__init__(XmlLexer, EvoqueLexer,
                                              **options)
+
+class ColdfusionLexer(RegexLexer):
+    """
+    Coldfusion statements
+    """
+    name = 'cfstatement'
+    aliases = ['cfs']
+    filenames = []
+    mimetypes = []
+    flags = re.IGNORECASE | re.MULTILINE
+
+    tokens = {
+        'root': [
+            (r'//.*', Comment),
+            (r'\+\+|--', Operator),
+            (r'[-+*/^&=!]', Operator),
+            (r'<=|>=|<|>', Operator),
+            (r'mod\b', Operator),
+            (r'(eq|lt|gt|lte|gte|not|is|and|or)\b', Operator),
+            (r'\|\||&&', Operator),
+            (r'"', String.Double, 'string'),
+            # There is a special rule for allowing html in single quoted
+            # strings, evidently.
+            (r"'.*?'", String.Single),
+            (r'\d+', Number),
+            (r'(if|else|len|var|case|default|break|switch)\b', Keyword),
+            (r'([A-Za-z_$][A-Za-z0-9_.]*)\s*(\()', bygroups(Name.Function, Punctuation)),
+            (r'[A-Za-z_$][A-Za-z0-9_.]*', Name.Variable),
+            (r'[()\[\]{};:,.\\]', Punctuation),
+            (r'\s+', Text),
+        ],
+        'string': [
+            (r'""', String.Double),
+            (r'#.+?#', String.Interp),
+            (r'[^"#]+', String.Double),
+            (r'#', String.Double),
+            (r'"', String.Double, '#pop'),
+        ],
+    }
+
+class ColdfusionMarkupLexer(RegexLexer):
+    """
+    Coldfusion markup only
+    """
+    name = 'Coldfusion'
+    aliases = ['cf']
+    filenames = []
+    mimetypes = []
+
+    tokens = {
+        'root': [
+            (r'[^<]+', Other),
+            include('tags'),
+            (r'<[^<>]*', Other),
+        ],
+        'tags': [
+            (r'(?s)<!---.*?--->', Comment.Multiline),
+            (r'(?s)<!--.*?-->', Comment),
+            (r'<cfoutput.*?>', Name.Builtin, 'cfoutput'),
+            (r'(?s)(<cfscript.*?>)(.+?)(</cfscript.*?>)',
+             bygroups(Name.Builtin, using(ColdfusionLexer), Name.Builtin)),
+            # negative lookbehind is for strings with embedded >
+            (r'(?s)(</?cf(?:component|include|if|else|elseif|loop|return|'
+             r'dbinfo|dump|abort|location|invoke|throw|file|savecontent|'
+             r'mailpart|mail|header|content|zip|image|lock|argument|try|'
+             r'catch|break|directory|http|set|function|param)\b)(.*?)((?<!\\)>)',
+             bygroups(Name.Builtin, using(ColdfusionLexer), Name.Builtin)),
+        ],
+        'cfoutput': [
+            (r'[^#<]+', Other),
+            (r'(#)(.*?)(#)', bygroups(Punctuation, using(ColdfusionLexer),
+                                      Punctuation)),
+            #(r'<cfoutput.*?>', Name.Builtin, '#push'),
+            (r'</cfoutput.*?>', Name.Builtin, '#pop'),
+            include('tags'),
+            (r'(?s)<[^<>]*', Other),
+            (r'#', Other),
+        ],
+    }
+
+
+class ColdfusionHtmlLexer(DelegatingLexer):
+    """
+    Coldfusion markup in html
+    """
+    name = 'Coldufsion HTML'
+    aliases = ['cfm']
+    filenames = ['*.cfm', '*.cfml', '*.cfc']
+    mimetypes = ['application/x-coldfusion']
+
+    def __init__(self, **options):
+        super(ColdfusionHtmlLexer, self).__init__(HtmlLexer, ColdfusionMarkupLexer,
+                                                  **options)
+
--- a/MoinMoin/support/pygments/lexers/text.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/text.py	Sun Mar 07 21:36:31 2010 +0100
@@ -10,10 +10,6 @@
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 from bisect import bisect
 
 from pygments.lexer import Lexer, LexerContext, RegexLexer, ExtendedRegexLexer, \
@@ -638,7 +634,8 @@
     tokens = {
         'root': [
             # Heading with overline
-            (r'^(=+|-+|`+|:+|\.+|\'+|"+|~+|\^+|_+|\*+|\++|#+)([ \t]*\n)(.+)(\n)(\1)(\n)',
+            (r'^(=+|-+|`+|:+|\.+|\'+|"+|~+|\^+|_+|\*+|\++|#+)([ \t]*\n)'
+             r'(.+)(\n)(\1)(\n)',
              bygroups(Generic.Heading, Text, Generic.Heading,
                       Text, Generic.Heading, Text)),
             # Plain heading
@@ -658,24 +655,33 @@
              bygroups(Text, Number, using(this, state='inline'))),
             (r'^(\s*)(\(?[A-Za-z]+\))( .+\n(?:\1  .+\n)+)',
              bygroups(Text, Number, using(this, state='inline'))),
+            # Line blocks
+            (r'^(\s*)(\|)( .+\n(?:\|  .+\n)*)',
+             bygroups(Text, Operator, using(this, state='inline'))),
             # Sourcecode directives
             (r'^( *\.\.)(\s*)((?:source)?code)(::)([ \t]*)([^\n]+)'
              r'(\n[ \t]*\n)([ \t]+)(.*)(\n)((?:(?:\8.*|)\n)+)',
              _handle_sourcecode),
             # A directive
-            (r'^( *\.\.)(\s*)([\w-]+)(::)(?:([ \t]*)(.+))?',
-             bygroups(Punctuation, Text, Operator.Word, Punctuation, Text, Keyword)),
+            (r'^( *\.\.)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))',
+             bygroups(Punctuation, Text, Operator.Word, Punctuation, Text,
+                      using(this, state='inline'))),
             # A reference target
             (r'^( *\.\.)(\s*)([\w\t ]+:)(.*?)$',
              bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))),
             # A footnote target
             (r'^( *\.\.)(\s*)(\[.+\])(.*?)$',
              bygroups(Punctuation, Text, Name.Tag, using(this, state='inline'))),
+            # A substitution def
+            (r'^( *\.\.)(\s*)(\|.+\|)(\s*)([\w:-]+?)(::)(?:([ \t]*)(.*))',
+             bygroups(Punctuation, Text, Name.Tag, Text, Operator.Word,
+                      Punctuation, Text, using(this, state='inline'))),
             # Comments
             (r'^ *\.\..*(\n( +.*\n|\n)+)?', Comment.Preproc),
             # Field list
-            (r'^( *)(:.*?:)([ \t]+)(.*?)$', bygroups(Text, Name.Class, Text,
-                                                     Name.Function)),
+            (r'^( *)(:[a-zA-Z-]+:)(\s*)$', bygroups(Text, Name.Class, Text)),
+            (r'^( *)(:.*?:)([ \t]+)(.*?)$',
+             bygroups(Text, Name.Class, Text, Name.Function)),
             # Definition list
             (r'^([^ ].*(?<!::)\n)((?:(?: +.*)\n)+)',
              bygroups(using(this, state='inline'), using(this, state='inline'))),
@@ -687,12 +693,13 @@
         'inline': [
             (r'\\.', Text), # escape
             (r'``', String, 'literal'), # code
-            (r'(`)(.+?)(`__?)',
-             bygroups(Punctuation, using(this), Punctuation)), # reference
-            (r'(`.+?`)(:[a-zA-Z0-9-]+?:)?',
+            (r'(`.+?)(<.+?>)(`__?)',  # reference with inline target
+             bygroups(String, String.Interpol, String)),
+            (r'`.+?`__?', String), # reference
+            (r'(`.+?`)(:[a-zA-Z0-9:-]+?:)?',
              bygroups(Name.Variable, Name.Attribute)), # role
-            (r'(:[a-zA-Z0-9-]+?:)(`.+?`)',
-             bygroups(Name.Attribute, Name.Variable)), # user-defined role
+            (r'(:[a-zA-Z0-9:-]+?:)(`.+?`)',
+             bygroups(Name.Attribute, Name.Variable)), # role (content first)
             (r'\*\*.+?\*\*', Generic.Strong), # Strong emphasis
             (r'\*.+?\*', Generic.Emph), # Emphasis
             (r'\[.*?\]_', String), # Footnote or citation
@@ -1013,6 +1020,7 @@
             (r'[}]', Text),
             (r'[^,]$', Name.Function, '#pop'),
             (r'([\+\.a-zA-Z0-9-][\s\n]*)', Name.Function),
+            (r'\[.*?\]', Name.Entity),
         ],
         'depend_vers': [
             (r'\),', Text, '#pop'),
@@ -1503,6 +1511,7 @@
             (r'[^\s;#{}$]+', String), # catch all
             (r'/[^\s;#]*', Name), # pathname
             (r'\s+', Text),
+            (r'[$;]', Text),  # leftover characters
         ],
     }
 
--- a/MoinMoin/support/pygments/lexers/web.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/lexers/web.py	Sun Mar 07 21:36:31 2010 +0100
@@ -10,21 +10,20 @@
 """
 
 import re
-try:
-    set
-except NameError:
-    from sets import Set as set
 
-from pygments.lexer import RegexLexer, bygroups, using, include, this
+from pygments.lexer import RegexLexer, ExtendedRegexLexer, bygroups, using, \
+     include, this
 from pygments.token import \
      Text, Comment, Operator, Keyword, Name, String, Number, Other, Punctuation
 from pygments.util import get_bool_opt, get_list_opt, looks_like_xml, \
                           html_doctype_matches
+from pygments.lexers.agile import RubyLexer
 
 
 __all__ = ['HtmlLexer', 'XmlLexer', 'JavascriptLexer', 'CssLexer',
            'PhpLexer', 'ActionScriptLexer', 'XsltLexer', 'ActionScript3Lexer',
-           'MxmlLexer']
+           'MxmlLexer', 'HaxeLexer', 'HamlLexer', 'SassLexer',
+           'ObjectiveJLexer', 'CoffeeScriptLexer']
 
 
 class JavascriptLexer(RegexLexer):
@@ -312,7 +311,7 @@
              r'list-style|margin-bottom|margin-left|margin-right|'
              r'margin-top|margin|marker-offset|marks|max-height|max-width|'
              r'min-height|min-width|opacity|orphans|outline|outline-color|'
-             r'outline-style|outline-width|overflow|padding-bottom|'
+             r'outline-style|outline-width|overflow(?:-x|-y|)|padding-bottom|'
              r'padding-left|padding-right|padding-top|padding|page|'
              r'page-break-after|page-break-before|page-break-inside|'
              r'pause-after|pause-before|pause|pitch|pitch-range|'
@@ -390,6 +389,229 @@
     }
 
 
+class ObjectiveJLexer(RegexLexer):
+    """
+    For Objective-J source code with preprocessor directives.
+
+    *New in Pygments 1.3.*
+    """
+
+    name = 'Objective-J'
+    aliases = ['objective-j', 'objectivej', 'obj-j', 'objj']
+    filenames = ['*.j']
+    mimetypes = ['text/x-objective-j']
+
+    #: optional Comment or Whitespace
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)*'
+
+    flags = re.DOTALL | re.MULTILINE
+
+    tokens = {
+        'root': [
+            include('whitespace'),
+
+            # function definition
+            (r'^(' + _ws + r'[\+-]' + _ws + r')([\(a-zA-Z_].*?[^\(])(' + _ws + '{)',
+             bygroups(using(this), using(this, state='function_signature'),
+                      using(this))),
+
+            # class definition
+            (r'(@interface|@implementation)(\s+)', bygroups(Keyword, Text),
+             'classname'),
+            (r'(@class|@protocol)(\s*)', bygroups(Keyword, Text),
+             'forward_classname'),
+            (r'(\s*)(@end)(\s*)', bygroups(Text, Keyword, Text)),
+
+            include('statements'),
+            ('[{\(\)}]', Punctuation),
+            (';', Punctuation),
+        ],
+        'whitespace': [
+            (r'(@import)(\s+)("(\\\\|\\"|[^"])*")',
+             bygroups(Comment.Preproc, Text, String.Double)),
+            (r'(@import)(\s+)(<(\\\\|\\>|[^>])*>)',
+             bygroups(Comment.Preproc, Text, String.Double)),
+            (r'(#(?:include|import))(\s+)("(\\\\|\\"|[^"])*")',
+             bygroups(Comment.Preproc, Text, String.Double)),
+            (r'(#(?:include|import))(\s+)(<(\\\\|\\>|[^>])*>)',
+             bygroups(Comment.Preproc, Text, String.Double)),
+
+            (r'#if\s+0', Comment.Preproc, 'if0'),
+            (r'#', Comment.Preproc, 'macro'),
+
+            (r'\n', Text),
+            (r'\s+', Text),
+            (r'\\\n', Text), # line continuation
+            (r'//(\n|(.|\n)*?[^\\]\n)', Comment.Single),
+            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
+            (r'<!--', Comment),
+        ],
+        'slashstartsregex': [
+            include('whitespace'),
+            (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
+             r'([gim]+\b|\B)', String.Regex, '#pop'),
+            (r'(?=/)', Text, ('#pop', 'badregex')),
+            (r'', Text, '#pop'),
+        ],
+        'badregex': [
+            ('\n', Text, '#pop'),
+        ],
+        'statements': [
+            (r'(L|@)?"', String, 'string'),
+            (r"(L|@)?'(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'",
+             String.Char),
+            (r'"(\\\\|\\"|[^"])*"', String.Double),
+            (r"'(\\\\|\\'|[^'])*'", String.Single),
+            (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[lL]?', Number.Float),
+            (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
+            (r'0x[0-9a-fA-F]+[Ll]?', Number.Hex),
+            (r'0[0-7]+[Ll]?', Number.Oct),
+            (r'\d+[Ll]?', Number.Integer),
+
+            (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
+
+            (r'\+\+|--|~|&&|\?|:|\|\||\\(?=\n)|'
+             r'(<<|>>>?|==?|!=?|[-<>+*%&\|\^/])=?',
+             Operator, 'slashstartsregex'),
+            (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
+            (r'[})\].]', Punctuation),
+
+            (r'(for|in|while|do|break|return|continue|switch|case|default|if|'
+             r'else|throw|try|catch|finally|new|delete|typeof|instanceof|void|'
+             r'prototype|__proto__)\b', Keyword, 'slashstartsregex'),
+
+            (r'(var|with|function)\b', Keyword.Declaration, 'slashstartsregex'),
+
+            (r'(@selector|@private|@protected|@public|@encode|'
+             r'@synchronized|@try|@throw|@catch|@finally|@end|@property|'
+             r'@synthesize|@dynamic|@for|@accessors|new)\b', Keyword),
+
+            (r'(int|long|float|short|double|char|unsigned|signed|void|'
+             r'id|BOOL|bool|boolean|IBOutlet|IBAction|SEL|@outlet|@action)\b',
+             Keyword.Type),
+
+            (r'(self|super)\b', Name.Builtin),
+
+            (r'(TRUE|YES|FALSE|NO|Nil|nil|NULL)\b', Keyword.Constant),
+            (r'(true|false|null|NaN|Infinity|undefined)\b', Keyword.Constant),
+            (r'(ABS|ASIN|ACOS|ATAN|ATAN2|SIN|COS|TAN|EXP|POW|CEIL|FLOOR|ROUND|'
+             r'MIN|MAX|RAND|SQRT|E|LN2|LN10|LOG2E|LOG10E|PI|PI2|PI_2|SQRT1_2|'
+             r'SQRT2)\b', Keyword.Constant),
+
+            (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
+             r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
+             r'decodeURIComponent|encodeURI|encodeURIComponent|'
+             r'Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|'
+             r'window)\b', Name.Builtin),
+
+            (r'([$a-zA-Z_][a-zA-Z0-9_]*)(' + _ws + r')(?=\()',
+             bygroups(Name.Function, using(this))),
+
+            (r'[$a-zA-Z_][a-zA-Z0-9_]*', Name),
+        ],
+        'classname' : [
+            # interface definition that inherits
+            (r'([a-zA-Z_][a-zA-Z0-9_]*)(' + _ws + r':' + _ws +
+             r')([a-zA-Z_][a-zA-Z0-9_]*)?',
+             bygroups(Name.Class, using(this), Name.Class), '#pop'),
+            # interface definition for a category
+            (r'([a-zA-Z_][a-zA-Z0-9_]*)(' + _ws + r'\()([a-zA-Z_][a-zA-Z0-9_]*)(\))',
+             bygroups(Name.Class, using(this), Name.Label, Text), '#pop'),
+            # simple interface / implementation
+            (r'([a-zA-Z_][a-zA-Z0-9_]*)', Name.Class, '#pop'),
+        ],
+        'forward_classname' : [
+            (r'([a-zA-Z_][a-zA-Z0-9_]*)(\s*,\s*)',
+             bygroups(Name.Class, Text), '#push'),
+            (r'([a-zA-Z_][a-zA-Z0-9_]*)(\s*;?)',
+             bygroups(Name.Class, Text), '#pop'),
+        ],
+        'function_signature': [
+            include('whitespace'),
+
+            # start of a selector w/ parameters
+            (r'(\(' + _ws + r')'                # open paren
+             r'([a-zA-Z_][a-zA-Z0-9_]+)'        # return type
+             r'(' + _ws + r'\)' + _ws + r')'    # close paren
+             r'([$a-zA-Z_][a-zA-Z0-9_]+' + _ws + r':)', # function name
+             bygroups(using(this), Keyword.Type, using(this),
+                 Name.Function), 'function_parameters'),
+
+            # no-param function
+            (r'(\(' + _ws + r')'                # open paren
+             r'([a-zA-Z_][a-zA-Z0-9_]+)'        # return type
+             r'(' + _ws + r'\)' + _ws + r')'    # close paren
+             r'([$a-zA-Z_][a-zA-Z0-9_]+)',      # function name
+             bygroups(using(this), Keyword.Type, using(this),
+                 Name.Function), "#pop"),
+
+            # no return type given, start of a selector w/ parameters
+            (r'([$a-zA-Z_][a-zA-Z0-9_]+' + _ws + r':)', # function name
+             bygroups (Name.Function), 'function_parameters'),
+
+            # no return type given, no-param function
+            (r'([$a-zA-Z_][a-zA-Z0-9_]+)',      # function name
+             bygroups(Name.Function), "#pop"),
+
+            ('', Text, '#pop'),
+        ],
+        'function_parameters': [
+            include('whitespace'),
+
+            # parameters
+            (r'(\(' + _ws + ')'                 # open paren
+             r'([^\)]+)'                        # type
+             r'(' + _ws + r'\)' + _ws + r')+'   # close paren
+             r'([$a-zA-Z_][a-zA-Z0-9_]+)',      # param name
+             bygroups(using(this), Keyword.Type, using(this), Text)),
+
+            # one piece of a selector name
+            (r'([$a-zA-Z_][a-zA-Z0-9_]+' + _ws + r':)',     # function name
+             Name.Function),
+
+            # smallest possible selector piece
+            (r'(:)', Name.Function),
+
+            # var args
+            (r'(,' + _ws + r'...)', using(this)),
+
+            # param name
+            (r'([$a-zA-Z_][a-zA-Z0-9_]+)', Text),
+        ],
+        'expression' : [
+            (r'([$a-zA-Z_][a-zA-Z0-9_]*)(\()', bygroups(Name.Function,
+                                                        Punctuation)),
+            (r'(\))', Punctuation, "#pop"),
+        ],
+        'string': [
+            (r'"', String, '#pop'),
+            (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
+            (r'[^\\"\n]+', String), # all other characters
+            (r'\\\n', String), # line continuation
+            (r'\\', String), # stray backslash
+        ],
+        'macro': [
+            (r'[^/\n]+', Comment.Preproc),
+            (r'/[*](.|\n)*?[*]/', Comment.Multiline),
+            (r'//.*?\n', Comment.Single, '#pop'),
+            (r'/', Comment.Preproc),
+            (r'(?<=\\)\n', Comment.Preproc),
+            (r'\n', Comment.Preproc, '#pop'),
+        ],
+        'if0': [
+            (r'^\s*#if.*?(?<!\\)\n', Comment.Preproc, '#push'),
+            (r'^\s*#endif.*?(?<!\\)\n', Comment.Preproc, '#pop'),
+            (r'.*?\n', Comment),
+        ]
+    }
+
+    def analyse_text(text):
+        if re.search('^\s*@import\s+[<"]', text, re.MULTILINE):
+            # special directive found in most Objective-J files
+            return True
+        return False
+
+
 class HtmlLexer(RegexLexer):
     """
     For HTML 4 and XHTML 1 markup. Nested JavaScript and CSS is highlighted
@@ -493,7 +715,7 @@
         ],
         'php': [
             (r'\?>', Comment.Preproc, '#pop'),
-            (r'<<<([a-zA-Z_][a-zA-Z0-9_]*)\n.*?\n\1\;?\n', String),
+            (r'<<<(\'?)([a-zA-Z_][a-zA-Z0-9_]*)\1\n.*?\n\2\;?\n', String),
             (r'\s+', Text),
             (r'#.*?\n', Comment.Single),
             (r'//.*?\n', Comment.Single),
@@ -507,6 +729,7 @@
             (r'[~!%^&*+=|:.<>/?@-]+', Operator),
             (r'[\[\]{}();,]+', Punctuation),
             (r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
+            (r'(function)(\s*)(?=\()', bygroups(Keyword, Text)),
             (r'(function)(\s+)(&?)(\s*)',
               bygroups(Keyword, Text, Operator, Text), 'functionname'),
             (r'(const)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)',
@@ -520,11 +743,11 @@
              r'endif|list|__LINE__|endswitch|new|__sleep|endwhile|not|'
              r'array|__wakeup|E_ALL|NULL|final|php_user_filter|interface|'
              r'implements|public|private|protected|abstract|clone|try|'
-             r'catch|throw|this)\b', Keyword),
+             r'catch|throw|this|use|namespace)\b', Keyword),
             ('(true|false|null)\b', Keyword.Constant),
             (r'\$\{\$+[a-zA-Z_][a-zA-Z0-9_]*\}', Name.Variable),
             (r'\$+[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable),
-            ('[a-zA-Z_][a-zA-Z0-9_]*', Name.Other),
+            (r'[\\a-zA-Z_][\\a-zA-Z0-9_]*', Name.Other),
             (r"[0-9](\.[0-9]*)?(eE[+-][0-9])?[flFLdD]?|"
              r"0[xX][0-9a-fA-F]+[Ll]?", Number),
             (r"'([^'\\]*(?:\\.[^'\\]*)*)'", String.Single),
@@ -532,7 +755,7 @@
             (r'"', String.Double, 'string'),
         ],
         'classname': [
-            (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Class, '#pop')
+            (r'[a-zA-Z_][\\a-zA-Z0-9_]*', Name.Class, '#pop')
         ],
         'functionname': [
             (r'[a-zA-Z_][a-zA-Z0-9_]*', Name.Function, '#pop')
@@ -680,7 +903,6 @@
             return 0.8
 
 
-
 class MxmlLexer(RegexLexer):
     """
     For MXML markup.
@@ -721,3 +943,677 @@
                 (r'[^\s>]+', String, '#pop'),
             ],
         }
+
+
+class HaxeLexer(RegexLexer):
+    """
+    For haXe source code (http://haxe.org/).
+    """
+
+    name = 'haXe'
+    aliases = ['hx', 'haXe']
+    filenames = ['*.hx']
+    mimetypes = ['text/haxe']
+
+    ident = r'(?:[a-zA-Z_][a-zA-Z0-9_]*)'
+    typeid = r'(?:(?:[a-z0-9_\.])*[A-Z_][A-Za-z0-9_]*)'
+    key_prop = r'(?:default|null|never)'
+    key_decl_mod = r'(?:public|private|override|static|inline|extern|dynamic)'
+
+    flags = re.DOTALL | re.MULTILINE
+
+    tokens = {
+        'root': [
+            include('whitespace'),
+            include('comments'),
+            (key_decl_mod, Keyword.Declaration),
+            include('enumdef'),
+            include('typedef'),
+            include('classdef'),
+            include('imports'),
+        ],
+
+        # General constructs
+        'comments': [
+            (r'//.*?\n', Comment.Single),
+            (r'/\*.*?\*/', Comment.Multiline),
+            (r'#[^\n]*', Comment.Preproc),
+        ],
+        'whitespace': [
+            include('comments'),
+            (r'\s+', Text),
+        ],
+        'codekeywords': [
+            (r'\b(if|else|while|do|for|in|break|continue|'
+             r'return|switch|case|try|catch|throw|null|trace|'
+             r'new|this|super|untyped|cast|callback|here)\b',
+             Keyword.Reserved),
+        ],
+        'literals': [
+            (r'0[xX][0-9a-fA-F]+', Number.Hex),
+            (r'[0-9]+', Number.Integer),
+            (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
+            (r"'(\\\\|\\'|[^'])*'", String.Single),
+            (r'"(\\\\|\\"|[^"])*"', String.Double),
+            (r'~/([^\n])*?/[gisx]*', String.Regex),
+            (r'\b(true|false|null)\b', Keyword.Constant),
+        ],
+        'codeblock': [
+          include('whitespace'),
+          include('new'),
+          include('case'),
+          include('anonfundef'),
+          include('literals'),
+          include('vardef'),
+          include('codekeywords'),
+          (r'[();,\[\]]', Punctuation),
+          (r'(?:=|\+=|-=|\*=|/=|%=|&=|\|=|\^=|<<=|>>=|>>>=|\|\||&&|'
+           r'\.\.\.|==|!=|>|<|>=|<=|\||&|\^|<<|>>|>>>|\+|\-|\*|/|%|'
+           r'!|\+\+|\-\-|~|\.|\?|\:)',
+           Operator),
+          (ident, Name),
+
+          (r'}', Punctuation,'#pop'),
+          (r'{', Punctuation,'#push'),
+        ],
+
+        # Instance/Block level constructs
+        'propertydef': [
+            (r'(\()(' + key_prop + ')(,)(' + key_prop + ')(\))',
+             bygroups(Punctuation, Keyword.Reserved, Punctuation,
+                      Keyword.Reserved, Punctuation)),
+        ],
+        'new': [
+            (r'\bnew\b', Keyword, 'typedecl'),
+        ],
+        'case': [
+            (r'\b(case)(\s+)(' + ident + ')(\s*)(\()',
+             bygroups(Keyword.Reserved, Text, Name, Text, Punctuation),
+             'funargdecl'),
+        ],
+        'vardef': [
+            (r'\b(var)(\s+)(' + ident + ')',
+             bygroups(Keyword.Declaration, Text, Name.Variable), 'vardecl'),
+        ],
+        'vardecl': [
+            include('whitespace'),
+            include('typelabel'),
+            (r'=', Operator,'#pop'),
+            (r';', Punctuation,'#pop'),
+        ],
+        'instancevardef': [
+            (key_decl_mod,Keyword.Declaration),
+            (r'\b(var)(\s+)(' + ident + ')',
+             bygroups(Keyword.Declaration, Text, Name.Variable.Instance),
+             'instancevardecl'),
+        ],
+        'instancevardecl': [
+            include('vardecl'),
+            include('propertydef'),
+        ],
+
+        'anonfundef': [
+            (r'\bfunction\b', Keyword.Declaration, 'fundecl'),
+        ],
+        'instancefundef': [
+            (key_decl_mod, Keyword.Declaration),
+            (r'\b(function)(\s+)(' + ident + ')',
+             bygroups(Keyword.Declaration, Text, Name.Function), 'fundecl'),
+        ],
+        'fundecl': [
+            include('whitespace'),
+            include('typelabel'),
+            include('generictypedecl'),
+            (r'\(',Punctuation,'funargdecl'),
+            (r'(?=[a-zA-Z0-9_])',Text,'#pop'),
+            (r'{',Punctuation,('#pop','codeblock')),
+            (r';',Punctuation,'#pop'),
+        ],
+        'funargdecl': [
+            include('whitespace'),
+            (ident, Name.Variable),
+            include('typelabel'),
+            include('literals'),
+            (r'=', Operator),
+            (r',', Punctuation),
+            (r'\?', Punctuation),
+            (r'\)', Punctuation, '#pop'),
+        ],
+
+        'typelabel': [
+            (r':', Punctuation, 'type'),
+        ],
+        'typedecl': [
+            include('whitespace'),
+            (typeid, Name.Class),
+            (r'<', Punctuation, 'generictypedecl'),
+            (r'(?=[{}()=,a-z])', Text,'#pop'),
+        ],
+        'type': [
+            include('whitespace'),
+            (typeid, Name.Class),
+            (r'<', Punctuation, 'generictypedecl'),
+            (r'->', Keyword.Type),
+            (r'(?=[{}(),;=])', Text, '#pop'),
+        ],
+        'generictypedecl': [
+            include('whitespace'),
+            (typeid, Name.Class),
+            (r'<', Punctuation, '#push'),
+            (r'>', Punctuation, '#pop'),
+            (r',', Punctuation),
+        ],
+
+        # Top level constructs
+        'imports': [
+            (r'(package|import|using)(\s+)([^;]+)(;)',
+             bygroups(Keyword.Namespace, Text, Name.Namespace,Punctuation)),
+        ],
+        'typedef': [
+            (r'typedef', Keyword.Declaration, ('typedefprebody', 'typedecl')),
+        ],
+        'typedefprebody': [
+            include('whitespace'),
+            (r'(=)(\s*)({)', bygroups(Punctuation, Text, Punctuation),
+             ('#pop', 'typedefbody')),
+        ],
+        'enumdef': [
+            (r'enum', Keyword.Declaration, ('enumdefprebody', 'typedecl')),
+        ],
+        'enumdefprebody': [
+            include('whitespace'),
+            (r'{', Punctuation, ('#pop','enumdefbody')),
+        ],
+        'classdef': [
+            (r'class', Keyword.Declaration, ('classdefprebody', 'typedecl')),
+        ],
+        'classdefprebody': [
+            include('whitespace'),
+            (r'(extends|implements)', Keyword.Declaration,'typedecl'),
+            (r'{', Punctuation, ('#pop', 'classdefbody')),
+        ],
+        'interfacedef': [
+            (r'interface', Keyword.Declaration,
+             ('interfacedefprebody', 'typedecl')),
+        ],
+        'interfacedefprebody': [
+            include('whitespace'),
+            (r'(extends)', Keyword.Declaration, 'typedecl'),
+            (r'{', Punctuation, ('#pop', 'classdefbody')),
+        ],
+
+        'typedefbody': [
+          include('whitespace'),
+          include('instancevardef'),
+          include('instancefundef'),
+          (r'>', Punctuation, 'typedecl'),
+          (r',', Punctuation),
+          (r'}', Punctuation, '#pop'),
+        ],
+        'enumdefbody': [
+          include('whitespace'),
+          (ident, Name.Variable.Instance),
+          (r'\(', Punctuation, 'funargdecl'),
+          (r';', Punctuation),
+          (r'}', Punctuation, '#pop'),
+        ],
+        'classdefbody': [
+          include('whitespace'),
+          include('instancevardef'),
+          include('instancefundef'),
+          (r'}', Punctuation, '#pop'),
+          include('codeblock'),
+        ],
+    }
+
+    def analyse_text(text):
+        if re.match(r'\w+\s*:\s*\w', text): return 0.3
+
+
+def _indentation(lexer, match, ctx):
+    indentation = match.group(0)
+    yield match.start(), Text, indentation
+    ctx.last_indentation = indentation
+    ctx.pos = match.end()
+
+    if hasattr(ctx, 'block_state') and ctx.block_state and \
+            indentation.startswith(ctx.block_indentation) and \
+            indentation != ctx.block_indentation:
+        ctx.stack.append(ctx.block_state)
+    else:
+        ctx.block_state = None
+        ctx.block_indentation = None
+        ctx.stack.append('content')
+
+def _starts_block(token, state):
+    def callback(lexer, match, ctx):
+        yield match.start(), token, match.group(0)
+
+        if hasattr(ctx, 'last_indentation'):
+            ctx.block_indentation = ctx.last_indentation
+        else:
+            ctx.block_indentation = ''
+
+        ctx.block_state = state
+        ctx.pos = match.end()
+
+    return callback
+
+
+class HamlLexer(ExtendedRegexLexer):
+    """
+    For Haml markup.
+
+    *New in Pygments 1.3.*
+    """
+
+    name = 'Haml'
+    aliases = ['haml', 'HAML']
+    filenames = ['*.haml']
+    mimetypes = ['text/x-haml']
+
+    flags = re.IGNORECASE
+    # Haml can include " |\n" anywhere,
+    # which is ignored and used to wrap long lines.
+    # To accomodate this, use this custom faux dot instead.
+    _dot = r'(?: \|\n(?=.* \|)|.)'
+    tokens = {
+        'root': [
+            (r'[ \t]*\n', Text),
+            (r'[ \t]*', _indentation),
+        ],
+
+        'css': [
+            (r'\.[a-z0-9_:-]+', Name.Class, 'tag'),
+            (r'\#[a-z0-9_:-]+', Name.Function, 'tag'),
+        ],
+
+        'eval-or-plain': [
+            (r'[&!]?==', Punctuation, 'plain'),
+            (r'([&!]?[=~])(' + _dot + '*\n)',
+             bygroups(Punctuation, using(RubyLexer)),
+             'root'),
+            (r'', Text, 'plain'),
+        ],
+
+        'content': [
+            include('css'),
+            (r'%[a-z0-9_:-]+', Name.Tag, 'tag'),
+            (r'!!!' + _dot + '*\n', Name.Namespace, '#pop'),
+            (r'(/)(\[' + _dot + '*?\])(' + _dot + '*\n)',
+             bygroups(Comment, Comment.Special, Comment),
+             '#pop'),
+            (r'/' + _dot + '*\n', _starts_block(Comment, 'html-comment-block'),
+             '#pop'),
+            (r'-#' + _dot + '*\n', _starts_block(Comment.Preproc,
+                                                 'haml-comment-block'), '#pop'),
+            (r'(-)(' + _dot + '*\n)',
+             bygroups(Punctuation, using(RubyLexer)),
+             '#pop'),
+            (r':' + _dot + '*\n', _starts_block(Name.Decorator, 'filter-block'),
+             '#pop'),
+            include('eval-or-plain'),
+        ],
+
+        'tag': [
+            include('css'),
+            (r'\{(,\n|' + _dot + ')*?\}', using(RubyLexer)),
+            (r'\[' + _dot + '*?\]', using(RubyLexer)),
+            (r'\(', Text, 'html-attributes'),
+            (r'/[ \t]*\n', Punctuation, '#pop:2'),
+            (r'[<>]{1,2}(?=[ \t=])', Punctuation),
+            include('eval-or-plain'),
+        ],
+
+        'plain': [
+            (r'([^#\n]|#[^{\n]|(\\\\)*\\#\{)+', Text),
+            (r'(#\{)(' + _dot + '*?)(\})',
+             bygroups(String.Interpol, using(RubyLexer), String.Interpol)),
+            (r'\n', Text, 'root'),
+        ],
+
+        'html-attributes': [
+            (r'\s+', Text),
+            (r'[a-z0-9_:-]+[ \t]*=', Name.Attribute, 'html-attribute-value'),
+            (r'[a-z0-9_:-]+', Name.Attribute),
+            (r'\)', Text, '#pop'),
+        ],
+
+        'html-attribute-value': [
+            (r'[ \t]+', Text),
+            (r'[a-z0-9_]+', Name.Variable, '#pop'),
+            (r'@[a-z0-9_]+', Name.Variable.Instance, '#pop'),
+            (r'\$[a-z0-9_]+', Name.Variable.Global, '#pop'),
+            (r"'(\\\\|\\'|[^'\n])*'", String, '#pop'),
+            (r'"(\\\\|\\"|[^"\n])*"', String, '#pop'),
+        ],
+
+        'html-comment-block': [
+            (_dot + '+', Comment),
+            (r'\n', Text, 'root'),
+        ],
+
+        'haml-comment-block': [
+            (_dot + '+', Comment.Preproc),
+            (r'\n', Text, 'root'),
+        ],
+
+        'filter-block': [
+            (r'([^#\n]|#[^{\n]|(\\\\)*\\#\{)+', Name.Decorator),
+            (r'(#\{)(' + _dot + '*?)(\})',
+             bygroups(String.Interpol, using(RubyLexer), String.Interpol)),
+            (r'\n', Text, 'root'),
+        ],
+    }
+
+
+class SassLexer(ExtendedRegexLexer):
+    """
+    For Sass stylesheets.
+
+    *New in Pygments 1.3.*
+    """
+
+    name = 'Sass'
+    aliases = ['sass', 'SASS']
+    filenames = ['*.sass']
+    mimetypes = ['text/x-sass']
+
+    flags = re.IGNORECASE
+    tokens = {
+        'root': [
+            (r'[ \t]*\n', Text),
+            (r'[ \t]*', _indentation),
+        ],
+
+        'content': [
+            (r'//[^\n]*', _starts_block(Comment.Single, 'single-comment'),
+             'root'),
+            (r'/\*[^\n]*', _starts_block(Comment.Multiline, 'multi-comment'),
+             'root'),
+            (r'@import', Keyword, 'import'),
+            (r'@for', Keyword, 'for'),
+            (r'@(debug|if|while)', Keyword, 'script'),
+            (r'@[a-z0-9_-]+', Keyword, 'selector'),
+            (r'=[\w-]+', Name.Function, 'script'),
+            (r'\+[\w-]+', Name.Decorator, 'script'),
+            (r'(![a-z_]\w*)([ \t]*(?:\|\|)?=)',
+             bygroups(Name.Variable, Operator), 'script'),
+            (r':', Name.Attribute, 'old-style-attr'),
+            (r'(?=[^\s:"\[]+\s*[=:]([ \t]|$))', Name.Attribute, 'new-style-attr'),
+            (r'', Text, 'selector'),
+        ],
+
+        'single-comment': [
+            (r'.+', Comment.Single),
+            (r'\n', Text, 'root'),
+        ],
+
+        'multi-comment': [
+            (r'.+', Comment.Multiline),
+            (r'\n', Text, 'root'),
+        ],
+
+        'import': [
+            (r'[ \t]+', Text),
+            (r'[^\s]+', String),
+            (r'\n', Text, 'root'),
+        ],
+
+        'for': [
+            (r'(from|to|through)', Operator.Word),
+            include('script'),
+        ],
+
+        'old-style-attr': [
+            (r'[^\s:="\[]+', Name.Attribute),
+            (r'#{', String.Interpol, 'interpolation'),
+            (r'[ \t]*=', Operator, 'script'),
+            (r'', Text, 'value'),
+        ],
+
+        'new-style-attr': [
+            (r'[^\s:="\[]+', Name.Attribute),
+            (r'#{', String.Interpol, 'interpolation'),
+            (r'[ \t]*=', Operator, 'script'),
+            (r':', Name.Attribute, 'value'),
+        ],
+
+        'value': [
+            (r'[ \t]+', Text),
+            (r'url\(', String.Other, 'string-url'),
+            (r'(azimuth|background-attachment|background-color|'
+             r'background-image|background-position|background-repeat|'
+             r'background|border-bottom-color|border-bottom-style|'
+             r'border-bottom-width|border-left-color|border-left-style|'
+             r'border-left-width|border-right|border-right-color|'
+             r'border-right-style|border-right-width|border-top-color|'
+             r'border-top-style|border-top-width|border-bottom|'
+             r'border-collapse|border-left|border-width|border-color|'
+             r'border-spacing|border-style|border-top|border|caption-side|'
+             r'clear|clip|color|content|counter-increment|counter-reset|'
+             r'cue-after|cue-before|cue|cursor|direction|display|'
+             r'elevation|empty-cells|float|font-family|font-size|'
+             r'font-size-adjust|font-stretch|font-style|font-variant|'
+             r'font-weight|font|height|letter-spacing|line-height|'
+             r'list-style-type|list-style-image|list-style-position|'
+             r'list-style|margin-bottom|margin-left|margin-right|'
+             r'margin-top|margin|marker-offset|marks|max-height|max-width|'
+             r'min-height|min-width|opacity|orphans|outline|outline-color|'
+             r'outline-style|outline-width|overflow|padding-bottom|'
+             r'padding-left|padding-right|padding-top|padding|page|'
+             r'page-break-after|page-break-before|page-break-inside|'
+             r'pause-after|pause-before|pause|pitch|pitch-range|'
+             r'play-during|position|quotes|richness|right|size|'
+             r'speak-header|speak-numeral|speak-punctuation|speak|'
+             r'speech-rate|stress|table-layout|text-align|text-decoration|'
+             r'text-indent|text-shadow|text-transform|top|unicode-bidi|'
+             r'vertical-align|visibility|voice-family|volume|white-space|'
+             r'widows|width|word-spacing|z-index|bottom|left|'
+             r'above|absolute|always|armenian|aural|auto|avoid|baseline|'
+             r'behind|below|bidi-override|blink|block|bold|bolder|both|'
+             r'capitalize|center-left|center-right|center|circle|'
+             r'cjk-ideographic|close-quote|collapse|condensed|continuous|'
+             r'crop|crosshair|cross|cursive|dashed|decimal-leading-zero|'
+             r'decimal|default|digits|disc|dotted|double|e-resize|embed|'
+             r'extra-condensed|extra-expanded|expanded|fantasy|far-left|'
+             r'far-right|faster|fast|fixed|georgian|groove|hebrew|help|'
+             r'hidden|hide|higher|high|hiragana-iroha|hiragana|icon|'
+             r'inherit|inline-table|inline|inset|inside|invert|italic|'
+             r'justify|katakana-iroha|katakana|landscape|larger|large|'
+             r'left-side|leftwards|level|lighter|line-through|list-item|'
+             r'loud|lower-alpha|lower-greek|lower-roman|lowercase|ltr|'
+             r'lower|low|medium|message-box|middle|mix|monospace|'
+             r'n-resize|narrower|ne-resize|no-close-quote|no-open-quote|'
+             r'no-repeat|none|normal|nowrap|nw-resize|oblique|once|'
+             r'open-quote|outset|outside|overline|pointer|portrait|px|'
+             r'relative|repeat-x|repeat-y|repeat|rgb|ridge|right-side|'
+             r'rightwards|s-resize|sans-serif|scroll|se-resize|'
+             r'semi-condensed|semi-expanded|separate|serif|show|silent|'
+             r'slow|slower|small-caps|small-caption|smaller|soft|solid|'
+             r'spell-out|square|static|status-bar|super|sw-resize|'
+             r'table-caption|table-cell|table-column|table-column-group|'
+             r'table-footer-group|table-header-group|table-row|'
+             r'table-row-group|text|text-bottom|text-top|thick|thin|'
+             r'transparent|ultra-condensed|ultra-expanded|underline|'
+             r'upper-alpha|upper-latin|upper-roman|uppercase|url|'
+             r'visible|w-resize|wait|wider|x-fast|x-high|x-large|x-loud|'
+             r'x-low|x-small|x-soft|xx-large|xx-small|yes)\b', Name.Constant),
+            (r'(indigo|gold|firebrick|indianred|yellow|darkolivegreen|'
+             r'darkseagreen|mediumvioletred|mediumorchid|chartreuse|'
+             r'mediumslateblue|black|springgreen|crimson|lightsalmon|brown|'
+             r'turquoise|olivedrab|cyan|silver|skyblue|gray|darkturquoise|'
+             r'goldenrod|darkgreen|darkviolet|darkgray|lightpink|teal|'
+             r'darkmagenta|lightgoldenrodyellow|lavender|yellowgreen|thistle|'
+             r'violet|navy|orchid|blue|ghostwhite|honeydew|cornflowerblue|'
+             r'darkblue|darkkhaki|mediumpurple|cornsilk|red|bisque|slategray|'
+             r'darkcyan|khaki|wheat|deepskyblue|darkred|steelblue|aliceblue|'
+             r'gainsboro|mediumturquoise|floralwhite|coral|purple|lightgrey|'
+             r'lightcyan|darksalmon|beige|azure|lightsteelblue|oldlace|'
+             r'greenyellow|royalblue|lightseagreen|mistyrose|sienna|'
+             r'lightcoral|orangered|navajowhite|lime|palegreen|burlywood|'
+             r'seashell|mediumspringgreen|fuchsia|papayawhip|blanchedalmond|'
+             r'peru|aquamarine|white|darkslategray|ivory|dodgerblue|'
+             r'lemonchiffon|chocolate|orange|forestgreen|slateblue|olive|'
+             r'mintcream|antiquewhite|darkorange|cadetblue|moccasin|'
+             r'limegreen|saddlebrown|darkslateblue|lightskyblue|deeppink|'
+             r'plum|aqua|darkgoldenrod|maroon|sandybrown|magenta|tan|'
+             r'rosybrown|pink|lightblue|palevioletred|mediumseagreen|'
+             r'dimgray|powderblue|seagreen|snow|mediumblue|midnightblue|'
+             r'paleturquoise|palegoldenrod|whitesmoke|darkorchid|salmon|'
+             r'lightslategray|lawngreen|lightgreen|tomato|hotpink|'
+             r'lightyellow|lavenderblush|linen|mediumaquamarine|green|'
+             r'blueviolet|peachpuff)\b', Name.Entity),
+            (r'\!important', Name.Exception),
+            (r'/\*', Comment, 'inline-comment'),
+            (r'\#[a-z0-9]{1,6}', Number.Hex),
+            (r'(-?\d+)(\%|[a-z]+)?', bygroups(Number.Integer, Keyword.Type)),
+            (r'(-?\d*\.\d+)(\%|[a-z]+)?', bygroups(Number.Float, Keyword.Type)),
+            (r'#{', String.Interpol, 'interpolation'),
+            (r'[~\^\*!&%<>\|+=@:,./?-]+', Operator),
+            (r'[\[\]();]+', Punctuation),
+            (r'"', String.Double, 'string-double'),
+            (r"'", String.Single, 'string-single'),
+            (r'[a-z][\w-]*', Name),
+            (r'\n', Text, 'root'),
+        ],
+
+        'script': [
+            (r'[ \t]+', Text),
+            (r'![\w_]+', Name.Variable),
+            (r'[+\-*/%=(),!><]', Operator),
+            (r'"', String.Double, 'string-double'),
+            (r"'", String.Single, 'string-single'),
+            (r'\#[a-z0-9]{1,6}', Number.Hex),
+            (r'(-?\d+)(\%|[a-z]+)?', bygroups(Number.Integer, Keyword.Type)),
+            (r'(-?\d*\.\d+)(\%|[a-z]+)?', bygroups(Number.Float, Keyword.Type)),
+            (r'(black|silver|gray|white|maroon|red|purple|fuchsia|green|'
+             r'lime|olive|yellow|navy|blue|teal|aqua)\b', Name.Builtin),
+            (r'(true|false)', Name.Pseudo),
+            (r'(and|or|not)', Operator.Word),
+            (r'(\\.|[^\s\\+*\/%(),=!])+(?=[ \t]*\()', Name.Function),
+            (r'(\\.|[^\s\\+*\/%(),=!])+', Name),
+            (r'\n', Text, 'root'),
+        ],
+
+        'interpolation': [
+            (r'\}', String.Interpol, '#pop'),
+            include('script'),
+        ],
+
+        'selector': [
+            (r'[ \t]+', Text),
+            (r'\:', Name.Decorator, 'pseudo-class'),
+            (r'\.', Name.Class, 'class'),
+            (r'\#', Name.Namespace, 'id'),
+            (r'[a-zA-Z0-9_-]+', Name.Tag),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'&', Keyword),
+            (r'[~\^\*!&\[\]\(\)<>\|+=@:;,./?-]', Operator),
+            (r'"', String.Double, 'string-double'),
+            (r"'", String.Single, 'string-single'),
+            (r'\n', Text, 'root'),
+        ],
+
+        'string-double': [
+            (r'(\\.|#(?=[^\n{])|[^\n"#])+', String.Double),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'"', String.Double, '#pop'),
+        ],
+
+        'string-single': [
+            (r"(\\.|#(?=[^\n{])|[^\n'#])+", String.Double),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r"'", String.Double, '#pop'),
+        ],
+
+        'string-url': [
+            (r'(\\#|#(?=[^\n{])|[^\n#)])+', String.Other),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'\)', String.Other, '#pop'),
+        ],
+
+        'inline-comment': [
+            (r"(\\#|#(?=[^\n{])|\*(?=[^\n/])|[^\n#*])+", Comment),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r"\*/", Comment, '#pop'),
+        ],
+
+        'pseudo-class': [
+            (r'[\w-]+', Name.Decorator),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'', Text, '#pop'),
+        ],
+
+        'class': [
+            (r'[\w-]+', Name.Class),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'', Text, '#pop'),
+        ],
+
+        'id': [
+            (r'[\w-]+', Name.Namespace),
+            (r'#\{', String.Interpol, 'interpolation'),
+            (r'', Text, '#pop'),
+        ],
+    }
+
+
+class CoffeeScriptLexer(RegexLexer):
+    """
+    For `CoffeeScript`_ source code.
+
+    .. _CoffeeScript: http://jashkenas.github.com/coffee-script/
+
+    *New in Pygments 1.3.*
+    """
+
+    name = 'CoffeeScript'
+    aliases = ['coffee-script', 'coffeescript']
+    filenames = ['*.coffee']
+    mimetypes = ['text/coffeescript']
+
+    flags = re.DOTALL
+    tokens = {
+        'commentsandwhitespace': [
+            (r'\s+', Text),
+            (r'#.*?\n', Comment.Single),
+        ],
+        'slashstartsregex': [
+            include('commentsandwhitespace'),
+            (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/'
+             r'([gim]+\b|\B)', String.Regex, '#pop'),
+            (r'(?=/)', Text, ('#pop', 'badregex')),
+            (r'', Text, '#pop'),
+        ],
+        'badregex': [
+            ('\n', Text, '#pop'),
+        ],
+        'root': [
+            (r'^(?=\s|/|<!--)', Text, 'slashstartsregex'),
+            include('commentsandwhitespace'),
+            (r'\+\+|--|~|&&|\band\b|\bor\b|\bis\b|\bisnt\b|\bnot\b|\?|:|'
+             r'\|\||\\(?=\n)|(<<|>>>?|==?|!=?|[-<>+*`%&\|\^/])=?',
+             Operator, 'slashstartsregex'),
+            (r'[{(\[;,]', Punctuation, 'slashstartsregex'),
+            (r'[})\].]', Punctuation),
+            (r'(for|in|of|while|break|return|continue|switch|when|then|if|else|'
+             r'throw|try|catch|finally|new|delete|typeof|instanceof|super|'
+             r'extends|this)\b', Keyword, 'slashstartsregex'),
+            (r'(true|false|yes|no|on|off|null|NaN|Infinity|undefined)\b',
+             Keyword.Constant),
+            (r'(Array|Boolean|Date|Error|Function|Math|netscape|'
+             r'Number|Object|Packages|RegExp|String|sun|decodeURI|'
+             r'decodeURIComponent|encodeURI|encodeURIComponent|'
+             r'Error|eval|isFinite|isNaN|parseFloat|parseInt|document|this|'
+             r'window)\b', Name.Builtin),
+            (r'[$a-zA-Z_][a-zA-Z0-9_\.:]*:\s', Name.Variable,
+             'slashstartsregex'),
+            (r'[$a-zA-Z_][a-zA-Z0-9_]*', Name.Other),
+            (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float),
+            (r'0x[0-9a-fA-F]+', Number.Hex),
+            (r'[0-9]+', Number.Integer),
+            (r'"(\\\\|\\"|[^"])*"', String.Double),
+            (r"'(\\\\|\\'|[^'])*'", String.Single),
+        ]
+    }
--- a/MoinMoin/support/pygments/token.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/token.py	Sun Mar 07 21:36:31 2010 +0100
@@ -8,11 +8,6 @@
     :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
-try:
-    set
-except NameError:
-    from sets import Set as set
-
 
 class _TokenType(tuple):
     parent = None
--- a/MoinMoin/support/pygments/util.py	Sun Mar 07 20:59:26 2010 +0100
+++ b/MoinMoin/support/pygments/util.py	Sun Mar 07 21:36:31 2010 +0100
@@ -8,8 +8,10 @@
     :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
+
 import re
 import sys
+import codecs
 
 
 split_path_re = re.compile(r'[/\\ ]')
@@ -206,6 +208,7 @@
     import StringIO, cStringIO
     BytesIO = cStringIO.StringIO
     StringIO = StringIO.StringIO
+    uni_open = codecs.open
 else:
     import builtins
     bytes = builtins.bytes
@@ -220,3 +223,4 @@
     import io
     BytesIO = io.BytesIO
     StringIO = io.StringIO
+    uni_open = builtins.open
--- a/docs/REQUIREMENTS	Sun Mar 07 20:59:26 2010 +0100
+++ b/docs/REQUIREMENTS	Sun Mar 07 21:36:31 2010 +0100
@@ -92,7 +92,7 @@
 
 pygments (highlighting for all sorts of source code and other text files)
 =========================================================================
-shipped: 1.2.2
+shipped: 1.3.1
 minimum: 1.1.1 will work, maybe even older versions