Imported Upstream version 1.6 upstream/1.6
authorJinWang An <jinwang.an@samsung.com>
Tue, 5 Jan 2021 03:15:23 +0000 (12:15 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 5 Jan 2021 03:15:23 +0000 (12:15 +0900)
37 files changed:
AUTHORS
CHANGES
PKG-INFO
Pygments.egg-info/PKG-INFO
Pygments.egg-info/SOURCES.txt
docs/build/api.html
docs/build/index.html
docs/build/integrate.html
docs/build/java.html
docs/src/java.txt
external/autopygmentize [changed mode: 0644->0755]
pygments/__init__.py
pygments/cmdline.py
pygments/formatters/html.py
pygments/lexer.py
pygments/lexers/_mapping.py
pygments/lexers/_robotframeworklexer.py
pygments/lexers/agile.py
pygments/lexers/asm.py
pygments/lexers/compiled.py
pygments/lexers/foxpro.py
pygments/lexers/functional.py
pygments/lexers/hdl.py
pygments/lexers/jvm.py
pygments/lexers/math.py
pygments/lexers/other.py
pygments/lexers/shell.py
pygments/lexers/text.py
pygments/lexers/web.py
scripts/detect_missing_analyse_text.py
setup.py
tests/examplefiles/classes.dylan
tests/examplefiles/example.shell-session [new file with mode: 0644]
tests/examplefiles/logos_example.xm [new file with mode: 0644]
tests/examplefiles/session.dylan-console [new file with mode: 0644]
tests/examplefiles/test.opa [new file with mode: 0644]
tests/test_basic_api.py

diff --git a/AUTHORS b/AUTHORS
index 66438135c3a93f7689378538c656fd1cf779e805..9447bd0fb1f473b40a872f6c9329b3964362c997 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -9,6 +9,7 @@ Other contributors, listed alphabetically, are:
 * Kumar Appaiah -- Debian control lexer
 * Ali Afshar -- image formatter
 * Andreas Amann -- AppleScript lexer
+* Timothy Armstrong -- Dart lexer fixes
 * Jeffrey Arnold -- R/S, Rd, BUGS, Jags, and Stan lexers
 * Jeremy Ashkenas -- CoffeeScript lexer
 * Stefan Matthias Aust -- Smalltalk lexer
@@ -25,6 +26,7 @@ Other contributors, listed alphabetically, are:
 * Hiram Chirino -- Scaml and Jade lexers
 * Ian Cooper -- VGL lexer
 * Leaf Corcoran -- MoonScript lexer
+* Christian Jann -- ShellSession lexer
 * Christopher Creutzig -- MuPAD lexer
 * Pete Curry -- bugfixes
 * Owen Durni -- haXe lexer
@@ -53,6 +55,7 @@ Other contributors, listed alphabetically, are:
 * Varun Hiremath -- Debian control lexer
 * Doug Hogan -- Mscgen lexer
 * Ben Hollis -- Mason lexer
+* Dustin Howett -- Logos lexer
 * Alastair Houghton -- Lexer inheritance facility
 * Tim Howard -- BlitzMax lexer
 * Ivan Inozemtsev -- Fantom lexer
diff --git a/CHANGES b/CHANGES
index 1e54020a3bdd7e8e6735929077f4722178347b12..c2a3528fe41f66782a01637d929fb1abd8da897c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,23 @@ Issue numbers refer to the tracker at
 pull request numbers to the requests at
 <http://bitbucket.org/birkenfeld/pygments-main/pull-requests/merged>.
 
+Version 1.6
+-----------
+(released Feb 3, 2013)
+
+- Lexers added:
+
+  * Dylan console (PR#149)
+  * Logos (PR#150)
+  * Shell sessions (PR#158)
+
+- Fix guessed lexers not receiving lexer options (#838).
+
+- Fix unquoted HTML attribute lexing in Opa (#841).
+
+- Fixes to the Dart lexer (PR#160).
+
+
 Version 1.6rc1
 --------------
 (released Jan 9, 2013)
index 423a4f06507b78cb8bd64bec402493d048d5c01a..6e9739d45a7765709063931e8eca58370cae2d41 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: Pygments
-Version: 1.6rc1
+Version: 1.6
 Summary: Pygments is a syntax highlighting package written in Python.
 Home-page: http://pygments.org/
 Author: Georg Brandl
index 423a4f06507b78cb8bd64bec402493d048d5c01a..6e9739d45a7765709063931e8eca58370cae2d41 100644 (file)
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: Pygments
-Version: 1.6rc1
+Version: 1.6
 Summary: Pygments is a syntax highlighting package written in Python.
 Home-page: http://pygments.org/
 Author: Georg Brandl
index 6f0e6e97dc248d8733d075c1ff5e106bab0de50d..dd49c4013f72d520200e513c271fa7c31494acb1 100644 (file)
@@ -245,6 +245,7 @@ tests/examplefiles/example.rhtml
 tests/examplefiles/example.rkt
 tests/examplefiles/example.rpf
 tests/examplefiles/example.sh-session
+tests/examplefiles/example.shell-session
 tests/examplefiles/example.sml
 tests/examplefiles/example.snobol
 tests/examplefiles/example.stan
@@ -294,6 +295,7 @@ tests/examplefiles/json.lasso9
 tests/examplefiles/lighttpd_config.conf
 tests/examplefiles/linecontinuation.py
 tests/examplefiles/livescript-demo.ls
+tests/examplefiles/logos_example.xm
 tests/examplefiles/ltmain.sh
 tests/examplefiles/main.cmake
 tests/examplefiles/markdown.lsp
@@ -339,6 +341,7 @@ tests/examplefiles/robotframework.txt
 tests/examplefiles/ruby_func_def.rb
 tests/examplefiles/rust_example.rs
 tests/examplefiles/scilab.sci
+tests/examplefiles/session.dylan-console
 tests/examplefiles/sibling.prolog
 tests/examplefiles/simple.md
 tests/examplefiles/smarty_example.html
@@ -382,6 +385,7 @@ tests/examplefiles/test.mod
 tests/examplefiles/test.moo
 tests/examplefiles/test.myt
 tests/examplefiles/test.nim
+tests/examplefiles/test.opa
 tests/examplefiles/test.pas
 tests/examplefiles/test.php
 tests/examplefiles/test.plot
index 900cfa873bec95f0c82e904f544b099beb51cf1c..1225e28ace6a9cef413e1cf5c6c32febcbff7e6f 100644 (file)
@@ -453,6 +453,6 @@ or a tuple, it is returned as a list.</dd>
 
   </div>
 </body>
-<!-- generated on: 2013-01-09 17:48:43.546455
+<!-- generated on: 2013-02-03 10:39:02.580045
      file id: api -->
 </html>
\ No newline at end of file
index 331ebe87daf4a223b0727988b86e973d805320fd..6ab5fd9ea233aded4afb57f09f3717e2cec788a3 100644 (file)
@@ -256,6 +256,6 @@ look <a class="reference external" href="http://pygments.org/contribute/">here</
 
   </div>
 </body>
-<!-- generated on: 2013-01-09 17:48:43.675300
+<!-- generated on: 2013-02-03 10:39:02.732660
      file id: index -->
 </html>
\ No newline at end of file
index 53d0ae097858dfcb8ef257addeb90d7bcac468be..3b7ddc756df26239043b7d01db16fd356e581e1f 100644 (file)
@@ -263,6 +263,6 @@ sets up completion for the <tt class="docutils literal">pygmentize</tt> command
 
   </div>
 </body>
-<!-- generated on: 2013-01-09 17:48:40.384344
+<!-- generated on: 2013-02-03 10:39:02.461007
      file id: integrate -->
 </html>
\ No newline at end of file
index c2cb51646e9a785a2d8beb97360c6cb8c84d5141..af0b6e12272250c6accc60e1a147bb26930e245f 100644 (file)
@@ -215,7 +215,7 @@ Java.</p>
 then look at the <a class="reference external" href="http://www.jython.org/docs/">Jython documentation</a> for more
 advanced use.</p>
 <p>Since version 1.5, Pygments is deployed on <a class="reference external" href="http://repo1.maven.org/maven2/org/pygments/pygments/">Maven Central</a> as a JAR so is Jython
-which make it a lot easier to create the Java project.</p>
+which makes it a lot easier to create the Java project.</p>
 <p>Here is an example of a <a class="reference external" href="http://www.maven.org">Maven</a> <tt class="docutils literal">pom.xml</tt> file for a
 project running Pygments:</p>
 <div class="syntax"><pre><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
@@ -266,6 +266,6 @@ project running Pygments:</p>
 
   </div>
 </body>
-<!-- generated on: 2013-01-09 17:48:42.547732
+<!-- generated on: 2013-02-03 10:39:02.521367
      file id: java -->
 </html>
\ No newline at end of file
index f40a52d2fbd1026ba7fec65a50770d1729a5749f..5eb6196a1cc30cc7d5a31d726d2dff1502d52aaa 100644 (file)
@@ -11,7 +11,7 @@ advanced use.
 
 Since version 1.5, Pygments is deployed on `Maven Central
 <http://repo1.maven.org/maven2/org/pygments/pygments/>`__ as a JAR so is Jython
-which make it a lot easier to create the Java project.
+which makes it a lot easier to create the Java project.
 
 Here is an example of a `Maven <http://www.maven.org>`__ ``pom.xml`` file for a
 project running Pygments:
old mode 100644 (file)
new mode 100755 (executable)
index ad9faae..85c8dfd
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Best effort auto-pygmentization with transparent decompression
-# (c) Reuben Thomas 2012
+# (c) Reuben Thomas 2012-2013
 # This program is in the public domain.
 
 # Strategy: first see if pygmentize can find a lexer; if not, ask file; if that finds nothing, fail
@@ -8,60 +8,56 @@
 
 # This program can be used as a .lessfilter for the less pager to auto-color less's output
 
-if [ `pygmentize -N $1` != "text" ]; then
-    pygmentize $PYGMENTIZE_OPTS "$1"
-    exit 0
-fi
+lexer=`pygmentize -N "$1"`
+if [ "$lexer" = "text" ]; then
+  file_common_opts="--brief --dereference --uncompress"
 
-file_common_opts="--brief --dereference --uncompress"
-
-unset lexer
-case `file --mime-type $file_common_opts "$1"` in
-    application/xml|image/svg+xml) lexer=xml;;
-    text/html) lexer=html;;
-    text/troff) lexer=nroff;;
-    text/x-asm) lexer=nasm;;
-    text/x-awk) lexer=awk;;
-    text/x-c) lexer=c;;
-    text/x-c++) lexer=cpp;;
-    text/x-diff) lexer=diff;;
-    text/x-fortran) lexer=fortran;;
-    text/x-gawk) lexer=gawk;;
-    text/x-java) lexer=java;;
-    text/x-lisp) lexer=common-lisp;;
-    text/x-lua) lexer=lua;;
-    text/x-makefile) lexer=make;;
-    text/x-msdos-batch) lexer=bat;;
-    text/x-nawk) lexer=nawk;;
-    text/x-pascal) lexer=pascal;;
-    text/x-perl) lexer=perl;;
-    text/x-php) lexer=php;;
-    text/x-po) lexer=po;;
-    text/x-python) lexer=python;;
-    text/x-ruby) lexer=ruby;;
-    text/x-shellscript) lexer=sh;;
-    text/x-tcl) lexer=tcl;;
-    text/x-tex|text/x-texinfo) lexer=latex;; # FIXME: texinfo really needs its own lexer
-    
-    # Types that file outputs which pygmentize didn't support as of file 5.11, pygments 1.5
-    # text/calendar
-    # text/PGP
-    # text/rtf
-    # text/texmacs
-    # text/x-bcpl
-    # text/x-info
-    # text/x-m4
-    # text/x-vcard
-    # text/x-xmcd
-esac
+  unset lexer
+  case `file --mime-type $file_common_opts "$1"` in
+      application/xml|image/svg+xml) lexer=xml;;
+      text/html) lexer=html;;
+      text/troff) lexer=nroff;;
+      text/x-asm) lexer=nasm;;
+      text/x-awk) lexer=awk;;
+      text/x-c) lexer=c;;
+      text/x-c++) lexer=cpp;;
+      text/x-diff) lexer=diff;;
+      text/x-fortran) lexer=fortran;;
+      text/x-gawk) lexer=gawk;;
+      text/x-java) lexer=java;;
+      text/x-lisp) lexer=common-lisp;;
+      text/x-lua) lexer=lua;;
+      text/x-makefile) lexer=make;;
+      text/x-msdos-batch) lexer=bat;;
+      text/x-nawk) lexer=nawk;;
+      text/x-pascal) lexer=pascal;;
+      text/x-perl) lexer=perl;;
+      text/x-php) lexer=php;;
+      text/x-po) lexer=po;;
+      text/x-python) lexer=python;;
+      text/x-ruby) lexer=ruby;;
+      text/x-shellscript) lexer=sh;;
+      text/x-tcl) lexer=tcl;;
+      text/x-tex|text/x-texinfo) lexer=latex;; # FIXME: texinfo really needs its own lexer
+      
+      # Types that file outputs which pygmentize didn't support as of file 5.11, pygments 1.6rc1
+      # text/calendar
+      # text/PGP
+      # text/rtf
+      # text/texmacs
+      # text/x-bcpl
+      # text/x-info
+      # text/x-m4
+      # text/x-vcard
+      # text/x-xmcd
+  esac
+fi
 
-encoding=`file --mime-encoding $file_common_opts "$1"`
+encoding=`file --brief --mime-encoding $file_common_opts "$1"`
 
 if [ -n "$lexer" ]; then
     # FIXME: Specify input encoding rather than output encoding https://bitbucket.org/birkenfeld/pygments-main/issue/800
-    # FIXME: Encoding argument ignored on stdin https://bitbucket.org/birkenfeld/pygments-main/issue/799
-    #zcat "$1" | pygmentize -O encoding=$encoding,outencoding=UTF-8 $PYGMENTIZE_OPTS -l $lexer
-    pygmentize -O encoding=$encoding,outencoding=UTF-8 $PYGMENTIZE_OPTS -l $lexer $1
+    zcat "$1" | pygmentize -O encoding=$encoding,outencoding=UTF-8 $PYGMENTIZE_OPTS -l $lexer
     exit 0
 fi
 
index ff8c3121c2c4ad7a97bf6785f62fe63724853823..2bfd8ba5c3c07ca83527b1b8ab499916a25a5c79 100644 (file)
@@ -26,7 +26,7 @@
     :license: BSD, see LICENSE for details.
 """
 
-__version__ = '1.6rc1'
+__version__ = '1.6'
 __docformat__ = 'restructuredtext'
 
 __all__ = ['lex', 'format', 'highlight']
index 3bf081d4c8d88a312428bc0247999a17f7cc1daa..c25204bf71ee4c7c9cc9846c0f08c0723a9c862f 100644 (file)
@@ -378,9 +378,9 @@ def main(args=sys.argv):
             except ClassNotFound, err:
                 if '-g' in opts:
                     try:
-                        lexer = guess_lexer(code)
+                        lexer = guess_lexer(code, **parsed_opts)
                     except ClassNotFound:
-                        lexer = TextLexer()
+                        lexer = TextLexer(**parsed_opts)
                 else:
                     print >>sys.stderr, 'Error:', err
                     return 1
@@ -392,9 +392,9 @@ def main(args=sys.argv):
         if '-g' in opts:
             code = sys.stdin.read()
             try:
-                lexer = guess_lexer(code)
+                lexer = guess_lexer(code, **parsed_opts)
             except ClassNotFound:
-                lexer = TextLexer()
+                lexer = TextLexer(**parsed_opts)
         elif not lexer:
             print >>sys.stderr, 'Error: no lexer name given and reading ' + \
                                 'from stdin (try using -g or -l <lexer>)'
index 02ea6e964c37e233b40fcfce845fd98cfc785d48..06096930541cb3049aa2ee7529770c020f0ddad1 100644 (file)
@@ -310,7 +310,7 @@ class HtmlFormatter(Formatter):
 
     `tagurlformat`
         A string formatting pattern used to generate links to ctags definitions.
-        Avaliabe variable are `%(path)s`, `%(fname)s` and `%(fext)s`.
+        Available variables are `%(path)s`, `%(fname)s` and `%(fext)s`.
         Defaults to an empty string, resulting in just `#prefix-number` links.
         *New in Pygments 1.6.*
 
@@ -712,6 +712,8 @@ class HtmlFormatter(Formatter):
                 filename, linenumber = self._lookup_ctag(value)
                 if linenumber:
                     base, filename = os.path.split(filename)
+                    if base:
+                        base += '/'
                     filename, extension = os.path.splitext(filename)
                     url = self.tagurlformat % {'path': base, 'fname': filename,
                                                'fext': extension}
index b2af789b37064f50eb5af6b5a9beded37244f853..8f88dfda35aab15482dc51c7edc2f3dcdb4bfcc5 100644 (file)
@@ -691,10 +691,10 @@ class ExtendedRegexLexer(RegexLexer):
                         break
                     if text[ctx.pos] == '\n':
                         # at EOL, reset state to "root"
-                        ctx.pos += 1
                         ctx.stack = ['root']
                         statetokens = tokendefs['root']
                         yield ctx.pos, Text, u'\n'
+                        ctx.pos += 1
                         continue
                     yield ctx.pos, Error, text[ctx.pos]
                     ctx.pos += 1
index ec8ee818ccf1e6db1b13cfbfb94067bed6e8e178..53e09176f6c82b3cde8c86e30778b96a6fed4990 100644 (file)
@@ -88,6 +88,7 @@ LEXERS = {
     'DjangoLexer': ('pygments.lexers.templates', 'Django/Jinja', ('django', 'jinja'), (), ('application/x-django-templating', 'application/x-jinja')),
     'DtdLexer': ('pygments.lexers.web', 'DTD', ('dtd',), ('*.dtd',), ('application/xml-dtd',)),
     'DuelLexer': ('pygments.lexers.web', 'Duel', ('duel', 'Duel Engine', 'Duel View', 'JBST', 'jbst', 'JsonML+BST'), ('*.duel', '*.jbst'), ('text/x-duel', 'text/x-jbst')),
+    'DylanConsoleLexer': ('pygments.lexers.compiled', 'Dylan session', ('dylan-console', 'dylan-repl'), ('*.dylan-console',), ('text/x-dylan-console',)),
     'DylanLexer': ('pygments.lexers.compiled', 'Dylan', ('dylan',), ('*.dylan', '*.dyl', '*.intr'), ('text/x-dylan',)),
     'DylanLidLexer': ('pygments.lexers.compiled', 'DylanLID', ('dylan-lid', 'lid'), ('*.lid', '*.hdp'), ('text/x-dylan-lid',)),
     'ECLLexer': ('pygments.lexers.other', 'ECL', ('ecl',), ('*.ecl',), ('application/x-ecl',)),
@@ -161,6 +162,7 @@ LEXERS = {
     'LiterateHaskellLexer': ('pygments.lexers.functional', 'Literate Haskell', ('lhs', 'literate-haskell'), ('*.lhs',), ('text/x-literate-haskell',)),
     'LiveScriptLexer': ('pygments.lexers.web', 'LiveScript', ('live-script', 'livescript'), ('*.ls',), ('text/livescript',)),
     'LlvmLexer': ('pygments.lexers.asm', 'LLVM', ('llvm',), ('*.ll',), ('text/x-llvm',)),
+    'LogosLexer': ('pygments.lexers.compiled', 'Logos', ('logos',), ('*.x', '*.xi', '*.xm', '*.xmi'), ('text/x-logos',)),
     'LogtalkLexer': ('pygments.lexers.other', 'Logtalk', ('logtalk',), ('*.lgt',), ('text/x-logtalk',)),
     'LuaLexer': ('pygments.lexers.agile', 'Lua', ('lua',), ('*.lua', '*.wlua'), ('text/x-lua', 'application/x-lua')),
     'MOOCodeLexer': ('pygments.lexers.other', 'MOOCode', ('moocode',), ('*.moo',), ('text/x-moocode',)),
@@ -207,7 +209,7 @@ LEXERS = {
     'OpaLexer': ('pygments.lexers.functional', 'Opa', ('opa',), ('*.opa',), ('text/x-opa',)),
     'OpenEdgeLexer': ('pygments.lexers.other', 'OpenEdge ABL', ('openedge', 'abl', 'progress'), ('*.p', '*.cls'), ('text/x-openedge', 'application/x-openedge')),
     'PerlLexer': ('pygments.lexers.agile', 'Perl', ('perl', 'pl'), ('*.pl', '*.pm'), ('text/x-perl', 'application/x-perl')),
-    'PhpLexer': ('pygments.lexers.web', 'PHP', ('php', 'php3', 'php4', 'php5'), ('*.php', '*.php[345]'), ('text/x-php',)),
+    'PhpLexer': ('pygments.lexers.web', 'PHP', ('php', 'php3', 'php4', 'php5'), ('*.php', '*.php[345]', '*.inc'), ('text/x-php',)),
     'PlPgsqlLexer': ('pygments.lexers.sql', 'PL/pgSQL', ('plpgsql',), (), ('text/x-plpgsql',)),
     'PostScriptLexer': ('pygments.lexers.other', 'PostScript', ('postscript',), ('*.ps', '*.eps'), ('application/postscript',)),
     'PostgresConsoleLexer': ('pygments.lexers.sql', 'PostgreSQL console (psql)', ('psql', 'postgresql-console', 'postgres-console'), (), ('text/x-postgresql-psql',)),
@@ -240,9 +242,9 @@ LEXERS = {
     'RdLexer': ('pygments.lexers.math', 'Rd', ('rd',), ('*.Rd',), ('text/x-r-doc',)),
     'RebolLexer': ('pygments.lexers.other', 'REBOL', ('rebol',), ('*.r', '*.r3'), ('text/x-rebol',)),
     'RedcodeLexer': ('pygments.lexers.other', 'Redcode', ('redcode',), ('*.cw',), ()),
-    'RegeditLexer': ('pygments.lexers.text', 'reg', (), ('*.reg',), ('text/x-windows-registry',)),
+    'RegeditLexer': ('pygments.lexers.text', 'reg', ('registry',), ('*.reg',), ('text/x-windows-registry',)),
     'RhtmlLexer': ('pygments.lexers.templates', 'RHTML', ('rhtml', 'html+erb', 'html+ruby'), ('*.rhtml',), ('text/html+ruby',)),
-    'RobotFrameworkLexer': ('pygments.lexers.other', 'RobotFramework', ('RobotFramework', 'robotframework'), ('*.txt',), ('text/x-robotframework',)),
+    'RobotFrameworkLexer': ('pygments.lexers.other', 'RobotFramework', ('RobotFramework', 'robotframework'), ('*.txt', '*.robot'), ('text/x-robotframework',)),
     'RstLexer': ('pygments.lexers.text', 'reStructuredText', ('rst', 'rest', 'restructuredtext'), ('*.rst', '*.rest'), ('text/x-rst', 'text/prs.fallenstein.rst')),
     'RubyConsoleLexer': ('pygments.lexers.agile', 'Ruby irb session', ('rbcon', 'irb'), (), ('text/x-ruby-shellsession',)),
     'RubyLexer': ('pygments.lexers.agile', 'Ruby', ('rb', 'ruby', 'duby'), ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx', '*.duby'), ('text/x-ruby', 'application/x-ruby')),
@@ -255,6 +257,7 @@ LEXERS = {
     'SchemeLexer': ('pygments.lexers.functional', 'Scheme', ('scheme', 'scm'), ('*.scm', '*.ss'), ('text/x-scheme', 'application/x-scheme')),
     'ScilabLexer': ('pygments.lexers.math', 'Scilab', ('scilab',), ('*.sci', '*.sce', '*.tst'), ('text/scilab',)),
     'ScssLexer': ('pygments.lexers.web', 'SCSS', ('scss',), ('*.scss',), ('text/x-scss',)),
+    'ShellSessionLexer': ('pygments.lexers.shell', 'Shell Session', ('shell-session',), ('*.shell-session',), ('application/x-sh-session',)),
     'SmaliLexer': ('pygments.lexers.dalvik', 'Smali', ('smali',), ('*.smali',), ('text/smali',)),
     'SmalltalkLexer': ('pygments.lexers.other', 'Smalltalk', ('smalltalk', 'squeak'), ('*.st',), ('text/x-smalltalk',)),
     'SmartyLexer': ('pygments.lexers.templates', 'Smarty', ('smarty',), ('*.tpl',), ('application/x-smarty',)),
@@ -266,7 +269,7 @@ LEXERS = {
     'SquidConfLexer': ('pygments.lexers.text', 'SquidConf', ('squidconf', 'squid.conf', 'squid'), ('squid.conf',), ('text/x-squidconf',)),
     'SspLexer': ('pygments.lexers.templates', 'Scalate Server Page', ('ssp',), ('*.ssp',), ('application/x-ssp',)),
     'StanLexer': ('pygments.lexers.math', 'Stan', ('stan',), ('*.stan',), ()),
-    'SystemVerilogLexer': ('pygments.lexers.hdl', 'systemverilog', ('sv',), ('*.sv', '*.svh'), ('text/x-systemverilog',)),
+    'SystemVerilogLexer': ('pygments.lexers.hdl', 'systemverilog', ('systemverilog', 'sv'), ('*.sv', '*.svh'), ('text/x-systemverilog',)),
     'TclLexer': ('pygments.lexers.agile', 'Tcl', ('tcl',), ('*.tcl',), ('text/x-tcl', 'text/x-script.tcl', 'application/x-tcl')),
     'TcshLexer': ('pygments.lexers.shell', 'Tcsh', ('tcsh', 'csh'), ('*.tcsh', '*.csh'), ('application/x-csh',)),
     'TeaTemplateLexer': ('pygments.lexers.templates', 'Tea', ('tea',), ('*.tea',), ('text/x-tea',)),
@@ -282,7 +285,7 @@ LEXERS = {
     'VelocityHtmlLexer': ('pygments.lexers.templates', 'HTML+Velocity', ('html+velocity',), (), ('text/html+velocity',)),
     'VelocityLexer': ('pygments.lexers.templates', 'Velocity', ('velocity',), ('*.vm', '*.fhtml'), ()),
     'VelocityXmlLexer': ('pygments.lexers.templates', 'XML+Velocity', ('xml+velocity',), (), ('application/xml+velocity',)),
-    'VerilogLexer': ('pygments.lexers.hdl', 'verilog', ('v',), ('*.v',), ('text/x-verilog',)),
+    'VerilogLexer': ('pygments.lexers.hdl', 'verilog', ('verilog', 'v'), ('*.v',), ('text/x-verilog',)),
     'VhdlLexer': ('pygments.lexers.hdl', 'vhdl', ('vhdl',), ('*.vhdl', '*.vhd'), ('text/x-vhdl',)),
     'VimLexer': ('pygments.lexers.text', 'VimL', ('vim',), ('*.vim', '.vimrc', '.exrc', '.gvimrc', '_vimrc', '_exrc', '_gvimrc', 'vimrc', 'gvimrc'), ('text/x-vim',)),
     'XQueryLexer': ('pygments.lexers.web', 'XQuery', ('xquery', 'xqy', 'xq', 'xql', 'xqm'), ('*.xqy', '*.xquery', '*.xq', '*.xql', '*.xqm'), ('text/xquery', 'application/xquery')),
index b32dbde2a78cb6c696b6a3139c563632749a228b..0192d289d369d95628a888376cb496c0e77d69c7 100644 (file)
@@ -61,7 +61,7 @@ class RobotFrameworkLexer(Lexer):
     """
     name = 'RobotFramework'
     aliases = ['RobotFramework', 'robotframework']
-    filenames = ['*.txt']
+    filenames = ['*.txt', '*.robot']
     mimetypes = ['text/x-robotframework']
 
     def __init__(self, **options):
index 90f9ecd3744ca3039a22d8a61eb267c2eb3724e1..8bcb1d46049e731a2dc947a08ae23ed246659407 100644 (file)
@@ -607,7 +607,8 @@ class RubyLexer(ExtendedRegexLexer):
              r'rescue|raise|retry|return|super|then|undef|unless|until|when|'
              r'while|yield)\b', Keyword),
             # start of function, class and module names
-            (r'(module)(\s+)([a-zA-Z_][a-zA-Z0-9_]*(::[a-zA-Z_][a-zA-Z0-9_]*)*)',
+            (r'(module)(\s+)([a-zA-Z_][a-zA-Z0-9_]*'
+             r'(?:::[a-zA-Z_][a-zA-Z0-9_]*)*)',
              bygroups(Keyword, Text, Name.Namespace)),
             (r'(def)(\s+)', bygroups(Keyword, Text), 'funcname'),
             (r'def(?=[*%&^`~+-/\[<>=])', Keyword, 'funcname'),
index 5f1d808a3abe4eff82e9ccc0166c192ccc27d3db..7ff64bcced8172dd2fd12ecda98e7cc9f24f82e9 100644 (file)
@@ -376,7 +376,7 @@ class Ca65Lexer(RegexLexer):
         'root': [
             (r';.*', Comment.Single),
             (r'\s+', Text),
-            (r'[\w.@$][\w.@$\d]*:', Name.Label),
+            (r'[a-z_.@$][\w.@$]*:', Name.Label),
             (r'((ld|st)[axy]|(in|de)[cxy]|asl|lsr|ro[lr]|adc|sbc|cmp|cp[xy]'
              r'|cl[cvdi]|se[cdi]|jmp|jsr|bne|beq|bpl|bmi|bvc|bvs|bcc|bcs'
              r'|p[lh][ap]|rt[is]|brk|nop|ta[xy]|t[xy]a|txs|tsx|and|ora|eor'
@@ -388,7 +388,7 @@ class Ca65Lexer(RegexLexer):
             (r'\$[0-9a-f]+|[0-9a-f]+h\b', Number.Hex),
             (r'\d+|%[01]+', Number.Integer),
             (r'[#,.:()=]', Punctuation),
-            (r'[\w.@$][\w.@$\d]*', Name),
+            (r'[a-z_.@$][\w.@$]*', Name),
         ]
     }
 
index ef6a8551814172750baff1bc27b9df32a19e052c..7513a4e198ee316ca4169a2795b2e154ccd5fe68 100644 (file)
@@ -13,10 +13,10 @@ import re
 from string import Template
 
 from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
-     this, combined, inherit
+     this, combined, inherit, do_insertions
 from pygments.util import get_bool_opt, get_list_opt
 from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
-     Number, Punctuation, Error, Literal
+     Number, Punctuation, Error, Literal, Generic
 from pygments.scanner import Scanner
 
 # backwards compatibility
@@ -28,7 +28,8 @@ __all__ = ['CLexer', 'CppLexer', 'DLexer', 'DelphiLexer', 'ECLexer', 'DylanLexer
            'PrologLexer', 'CythonLexer', 'ValaLexer', 'OocLexer', 'GoLexer',
            'FelixLexer', 'AdaLexer', 'Modula2Lexer', 'BlitzMaxLexer',
            'NimrodLexer', 'FantomLexer', 'RustLexer', 'CudaLexer', 'MonkeyLexer',
-           'DylanLidLexer', 'CobolLexer', 'CobolFreeformatLexer']
+           'DylanLidLexer', 'DylanConsoleLexer', 'CobolLexer',
+           'CobolFreeformatLexer', 'LogosLexer']
 
 
 class CFamilyLexer(RegexLexer):
@@ -974,16 +975,17 @@ class DylanLexer(RegexLexer):
     def get_tokens_unprocessed(self, text):
         for index, token, value in RegexLexer.get_tokens_unprocessed(self, text):
             if token is Name:
-                if value in self.builtins:
+                lowercase_value = value.lower()
+                if lowercase_value in self.builtins:
                     yield index, Name.Builtin, value
                     continue
-                if value in self.keywords:
+                if lowercase_value in self.keywords:
                     yield index, Keyword, value
                     continue
-                if value in self.functions:
+                if lowercase_value in self.functions:
                     yield index, Name.Builtin, value
                     continue
-                if value in self.operators:
+                if lowercase_value in self.operators:
                     yield index, Operator, value
                     continue
             yield index, token, value
@@ -1118,6 +1120,57 @@ class DylanLidLexer(RegexLexer):
         ]
     }
 
+
+class DylanConsoleLexer(Lexer):
+    """
+    For Dylan interactive console output like:
+
+    .. sourcecode:: dylan-console
+
+        ? let a = 1;
+        => 1
+        ? a
+        => 1
+
+    This is based on a copy of the RubyConsoleLexer.
+
+    *New in Pygments 1.6.*
+    """
+    name = 'Dylan session'
+    aliases = ['dylan-console', 'dylan-repl']
+    filenames = ['*.dylan-console']
+    mimetypes = ['text/x-dylan-console']
+
+    _line_re  = re.compile('.*?\n')
+    _prompt_re = re.compile('\?| ')
+
+    def get_tokens_unprocessed(self, text):
+        dylexer = DylanLexer(**self.options)
+
+        curcode = ''
+        insertions = []
+        for match in self._line_re.finditer(text):
+            line = match.group()
+            m = self._prompt_re.match(line)
+            if m is not None:
+                end = m.end()
+                insertions.append((len(curcode),
+                                   [(0, Generic.Prompt, line[:end])]))
+                curcode += line[end:]
+            else:
+                if curcode:
+                    for item in do_insertions(insertions,
+                                    dylexer.get_tokens_unprocessed(curcode)):
+                        yield item
+                    curcode = ''
+                    insertions = []
+                yield match.start(), Generic.Output, line
+        if curcode:
+            for item in do_insertions(insertions,
+                                      dylexer.get_tokens_unprocessed(curcode)):
+                yield item
+
+
 def objective(baselexer):
     """
     Generate a subclass of baselexer that accepts the Objective-C syntax
@@ -2137,10 +2190,12 @@ class AdaLexer(RegexLexer):
             (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'(Address|Byte|Boolean|Character|Controlled|Count|Cursor|'
+             r'Duration|File_Mode|File_Type|Float|Generator|Integer|Long_Float|'
+             r'Long_Integer|Long_Long_Float|Long_Long_Integer|Natural|Positive|'
+             r'Reference_Type|Short_Float|Short_Integer|Short_Short_Float|'
+             r'Short_Short_Integer|String|Wide_Character|Wide_String)\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'),
@@ -2195,7 +2250,8 @@ class AdaLexer(RegexLexer):
             (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')),
+            (r'record\b', Keyword.Reserved, ('record_def')),
+            (r'(null record)(;)', bygroups(Keyword.Reserved, Punctuation), '#pop'),
             include('root'),
         ],
         'array_def' : [
@@ -2204,6 +2260,10 @@ class AdaLexer(RegexLexer):
                                                    Keyword.Reserved)),
             include('root'),
         ],
+        'record_def' : [
+            (r'end record', Keyword.Reserved, '#pop'),
+            include('root'),
+        ],
         'import': [
             (r'[a-z0-9_.]+', Name.Namespace, '#pop'),
             (r'', Text, '#pop'),
@@ -3303,7 +3363,7 @@ class CobolLexer(RegexLexer):
             # Data Types
             (r'(^|(?<=[^0-9a-z_\-]))'
              r'(PIC\s+.+?(?=(\s|\.\s))|PICTURE\s+.+?(?=(\s|\.\s))|'
-             r'(COMPUTATIONAL)([-][1-5X])?|(COMP)([-][1-5X])?|'
+             r'(COMPUTATIONAL)(-[1-5X])?|(COMP)(-[1-5X])?|'
              r'BINARY-C-LONG|'
              r'BINARY-CHAR|BINARY-DOUBLE|BINARY-LONG|BINARY-SHORT|'
              r'BINARY)\s*($|(?=[^0-9a-z_\-]))', Keyword.Type),
@@ -3370,3 +3430,67 @@ class CobolFreeformatLexer(CobolLexer):
             (r'(\*>.*\n|^\w*\*.*$)', Comment),
         ],
     }
+
+
+class LogosLexer(ObjectiveCppLexer):
+    """
+    For Logos + Objective-C source code with preprocessor directives.
+
+    *New in Pygments 1.6.*
+    """
+
+    name = 'Logos'
+    aliases = ['logos']
+    filenames = ['*.x', '*.xi', '*.xm', '*.xmi']
+    mimetypes = ['text/x-logos']
+    priority = 0.25
+
+    tokens = {
+        'statements': [
+            (r'(%orig|%log)\b', Keyword),
+            (r'(%c)\b(\()(\s*)([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*)(\))',
+             bygroups(Keyword, Punctuation, Text, Name.Class, Text, Punctuation)),
+            (r'(%init)\b(\()',
+             bygroups(Keyword, Punctuation), 'logos_init_directive'),
+            (r'(%init)(?=\s*;)', bygroups(Keyword)),
+            (r'(%hook|%group)(\s+)([a-zA-Z$_][a-zA-Z0-9$_]+)',
+             bygroups(Keyword, Text, Name.Class), '#pop'),
+            (r'(%subclass)(\s+)', bygroups(Keyword, Text),
+            ('#pop', 'logos_classname')),
+            inherit,
+        ],
+        'logos_init_directive' : [
+            ('\s+', Text),
+            (',', Punctuation, ('logos_init_directive', '#pop')),
+            ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*)(=)(\s*)([^);]*)',
+             bygroups(Name.Class, Text, Punctuation, Text, Text)),
+            ('([a-zA-Z$_][a-zA-Z0-9$_]*)', Name.Class),
+            ('\)', Punctuation, '#pop'),
+        ],
+        'logos_classname' : [
+            ('([a-zA-Z$_][a-zA-Z0-9$_]*)(\s*:\s*)([a-zA-Z$_][a-zA-Z0-9$_]*)?',
+             bygroups(Name.Class, Text, Name.Class), '#pop'),
+            ('([a-zA-Z$_][a-zA-Z0-9$_]*)', Name.Class, '#pop')
+        ],
+        'root': [
+            (r'(%subclass)(\s+)', bygroups(Keyword, Text),
+             'logos_classname'),
+            (r'(%hook|%group)(\s+)([a-zA-Z$_][a-zA-Z0-9$_]+)',
+             bygroups(Keyword, Text, Name.Class)),
+            (r'(%config)(\s*\(\s*)(\w+)(\s*=\s*)(.*?)(\s*\)\s*)',
+             bygroups(Keyword, Text, Name.Variable, Text, String, Text)),
+            (r'(%ctor)(\s*)({)', bygroups(Keyword, Text, Punctuation),
+             'function'),
+            (r'(%new)(\s*)(\()(\s*.*?\s*)(\))',
+             bygroups(Keyword, Text, Keyword, String, Keyword)),
+            (r'(\s*)(%end)(\s*)', bygroups(Text, Keyword, Text)),
+            inherit,
+        ],
+    }
+
+    _logos_keywords = re.compile(r'%(?:hook|ctor|init|c\()')
+
+    def analyse_text(text):
+        if LogosLexer._logos_keywords.search(text):
+            return 1.0
+        return 0
index 8973adba686703188c2f738fdd913bf2de16cd2f..51cd499b28417fcd4f0c82b0f94d0d5124551c27 100644 (file)
@@ -127,15 +127,15 @@ class FoxProLexer(RegexLexer):
              r'_THROTTLE|_TOOLBOX|_TOOLTIPTIMEOUT|_TRANSPORT|_TRIGGERLEVEL|'
              r'_UNIX|_VFP|_WINDOWS|_WIZARD|_WRAP', Keyword.Pseudo),
 
-            (r'THIS|THISFORM|THISFORMSET', Name.Builtin),
+            (r'THISFORMSET|THISFORM|THIS', Name.Builtin),
 
             (r'Application|CheckBox|Collection|Column|ComboBox|'
-             r'CommandButton|CommandGroup|Container|Control|Cursor|'
-             r'CursorAdapter|Custom|DataEnvironment|DataObject|EditBox|'
-             r'Empty|Exception|Fields|File|Files|Form|FormSet|FoxCode|'
+             r'CommandButton|CommandGroup|Container|Control|CursorAdapter|'
+             r'Cursor|Custom|DataEnvironment|DataObject|EditBox|'
+             r'Empty|Exception|Fields|Files|File|FormSet|Form|FoxCode|'
              r'Grid|Header|Hyperlink|Image|Label|Line|ListBox|Objects|'
-             r'OptionButton|OptionGroup|Page|PageFrame|Project|ProjectHook|'
-             r'Projects|Relation|ReportListener|Separator|Server|Servers|'
+             r'OptionButton|OptionGroup|PageFrame|Page|ProjectHook|Projects|'
+             r'Project|Relation|ReportListener|Separator|Servers|Server|'
              r'Session|Shape|Spinner|Tables|TextBox|Timer|ToolBar|'
              r'XMLAdapter|XMLField|XMLTable', Name.Class),
 
@@ -144,7 +144,7 @@ class FoxProLexer(RegexLexer):
 
             (r'\.(ActiveColumn|ActiveControl|ActiveForm|ActivePage|'
              r'ActiveProject|ActiveRow|AddLineFeeds|ADOCodePage|Alias|'
-             r'Align|Alignment|AllowAddNew|AllowAutoColumnFit|'
+             r'Alignment|Align|AllowAddNew|AllowAutoColumnFit|'
              r'AllowCellSelection|AllowDelete|AllowHeaderSizing|'
              r'AllowInsert|AllowModalMessages|AllowOutput|AllowRowSizing|'
              r'AllowSimultaneousFetch|AllowTabs|AllowUpdate|'
@@ -154,11 +154,11 @@ class FoxProLexer(RegexLexer):
              r'AutoIncrement|AutoOpenTables|AutoRelease|AutoSize|'
              r'AutoVerbMenu|AutoYield|BackColor|ForeColor|BackStyle|'
              r'BaseClass|BatchUpdateCount|BindControls|BorderColor|'
-             r'BorderStyle|BorderWidth|Bound|BoundColumn|BoundTo|'
-             r'BreakOnError|BufferMode|BufferModeOverride|'
+             r'BorderStyle|BorderWidth|BoundColumn|BoundTo|Bound|'
+             r'BreakOnError|BufferModeOverride|BufferMode|'
              r'BuildDateTime|ButtonCount|Buttons|Cancel|Caption|'
              r'Centered|Century|ChildAlias|ChildOrder|ChildTable|'
-             r'Class|ClassLibrary|ClipControls|Closable|CLSID|CodePage|'
+             r'ClassLibrary|Class|ClipControls|Closable|CLSID|CodePage|'
              r'ColorScheme|ColorSource|ColumnCount|ColumnLines|'
              r'ColumnOrder|Columns|ColumnWidths|CommandClauses|'
              r'Comment|CompareMemo|ConflictCheckCmd|ConflictCheckType|'
@@ -166,11 +166,11 @@ class FoxProLexer(RegexLexer):
              r'ControlSource|ConversionFunc|Count|CurrentControl|'
              r'CurrentDataSession|CurrentPass|CurrentX|CurrentY|'
              r'CursorSchema|CursorSource|CursorStatus|Curvature|'
-             r'Database|DataSession|DataSessionID|DataSource|'
-             r'DataSourceType|DataType|DateFormat|DateMark|Debug|'
-             r'DeclareXMLPrefix|DEClass|DEClassLibrary|Default|'
-             r'DefaultFilePath|DefOLELCID|DeleteCmd|DeleteCmdDataSource|'
-             r'DeleteCmdDataSourceType|DeleteMark|Description|Desktop|'
+             r'Database|DataSessionID|DataSession|DataSourceType|'
+             r'DataSource|DataType|DateFormat|DateMark|Debug|'
+             r'DeclareXMLPrefix|DEClassLibrary|DEClass|DefaultFilePath|'
+             r'Default|DefOLELCID|DeleteCmdDataSourceType|DeleteCmdDataSource|'
+             r'DeleteCmd|DeleteMark|Description|Desktop|'
              r'Details|DisabledBackColor|DisabledForeColor|'
              r'DisabledItemBackColor|DisabledItemForeColor|'
              r'DisabledPicture|DisableEncode|DisplayCount|'
@@ -183,112 +183,112 @@ class FoxProLexer(RegexLexer):
              r'DynamicFontShadow|DynamicFontSize|DynamicInputMask|'
              r'DynamicLineHeight|EditorOptions|Enabled|'
              r'EnableHyperlinks|Encrypted|ErrorNo|Exclude|Exclusive|'
-             r'FetchAsNeeded|FetchMemo|FetchMemoCmdList|'
-             r'FetchMemoDataSource|FetchMemoDataSourceType|FetchSize|'
-             r'FileClass|FileClassLibrary|FillColor|FillStyle|Filter|'
+             r'FetchAsNeeded|FetchMemoCmdList|FetchMemoDataSourceType|'
+             r'FetchMemoDataSource|FetchMemo|FetchSize|'
+             r'FileClassLibrary|FileClass|FillColor|FillStyle|Filter|'
              r'FirstElement|FirstNestedTable|Flags|FontBold|FontItalic|'
              r'FontStrikethru|FontUnderline|FontCharSet|FontCondense|'
              r'FontExtend|FontName|FontOutline|FontShadow|FontSize|'
              r'ForceCloseTag|Format|FormCount|FormattedOutput|Forms|'
              r'FractionDigits|FRXDataSession|FullName|GDIPlusGraphics|'
              r'GridLineColor|GridLines|GridLineWidth|HalfHeightCaption|'
-             r'HeaderClass|HeaderClassLibrary|HeaderHeight|Height|'
-             r'HelpContextID|HideSelection|Highlight|HighlightBackColor|'
-             r'HighlightForeColor|HighlightStyle|HighlightRow|'
-             r'HighlightRowLineWidth|HomeDir|Hours|HostName|'
-             r'HScrollSmallChange|hWnd|Icon|Increment|IncrementalSearch|'
-             r'InitialSelectedAlias|InputMask|InsertCmd|'
-             r'InsertCmdDataSource|InsertCmdDataSourceType|'
-             r'InsertCmdRefreshCmd|InsertCmdRefreshFieldList|'
-             r'InsertCmdRefreshKeyFieldList|Instancing|IntegralHeight|'
+             r'HeaderClassLibrary|HeaderClass|HeaderHeight|Height|'
+             r'HelpContextID|HideSelection|HighlightBackColor|'
+             r'HighlightForeColor|HighlightStyle|HighlightRowLineWidth|'
+             r'HighlightRow|Highlight|HomeDir|Hours|HostName|'
+             r'HScrollSmallChange|hWnd|Icon|IncrementalSearch|Increment|'
+             r'InitialSelectedAlias|InputMask|InsertCmdDataSourceType|'
+             r'InsertCmdDataSource|InsertCmdRefreshCmd|'
+             r'InsertCmdRefreshFieldList|InsertCmdRefreshKeyFieldList|'
+             r'InsertCmd|Instancing|IntegralHeight|'
              r'Interval|IMEMode|IsAttribute|IsBase64|IsBinary|IsNull|'
              r'IsDiffGram|IsLoaded|ItemBackColor,|ItemData|ItemIDData|'
              r'ItemTips|IXMLDOMElement|KeyboardHighValue|KeyboardLowValue|'
              r'Keyfield|KeyFieldList|KeyPreview|KeySort|LanguageOptions|'
-             r'Left|LeftColumn|LineContents|LineNo|LineSlant|LinkMaster|'
-             r'List|ListCount|ListenerType|ListIndex|ListItem|ListItemID|'
-             r'LockColumns|LockColumnsLeft|LockScreen|MacDesktop|'
+             r'LeftColumn|Left|LineContents|LineNo|LineSlant|LinkMaster|'
+             r'ListCount|ListenerType|ListIndex|ListItemID|ListItem|'
+             r'List|LockColumnsLeft|LockColumns|LockScreen|MacDesktop|'
              r'MainFile|MapN19_4ToCurrency|MapBinary|MapVarchar|Margin|'
              r'MaxButton|MaxHeight|MaxLeft|MaxLength|MaxRecords|MaxTop|'
-             r'MaxWidth|MDIForm|MemberClass|MemberClassLibrary|'
+             r'MaxWidth|MDIForm|MemberClassLibrary|MemberClass|'
              r'MemoWindow|Message|MinButton|MinHeight|MinWidth|'
              r'MouseIcon|MousePointer|Movable|MoverBars|MultiSelect|'
              r'Name|NestedInto|NewIndex|NewItemID|NextSiblingTable|'
-             r'NoCpTrans|NoData|NoDataOnLoad|NullDisplay|'
+             r'NoCpTrans|NoDataOnLoad|NoData|NullDisplay|'
              r'NumberOfElements|Object|OLEClass|OLEDragMode|'
              r'OLEDragPicture|OLEDropEffects|OLEDropHasData|'
              r'OLEDropMode|OLEDropTextInsertion|OLELCID|'
              r'OLERequestPendingTimeout|OLEServerBusyRaiseError|'
              r'OLEServerBusyTimeout|OLETypeAllowed|OneToMany|'
-             r'OpenViews|OpenWindow|Optimize|Order|OrderDirection|'
+             r'OpenViews|OpenWindow|Optimize|OrderDirection|Order|'
              r'OutputPageCount|OutputType|PageCount|PageHeight|'
              r'PageNo|PageOrder|Pages|PageTotal|PageWidth|'
-             r'Panel|PanelLink|Parent|ParentAlias|ParentClass|'
-             r'ParentTable|Partition|PasswordChar|Picture|'
-             r'PictureMargin|PicturePosition|PictureSpacing|'
-             r'PictureSelectionDisplay|PictureVal|Prepared|'
+             r'PanelLink|Panel|ParentAlias|ParentClass|ParentTable|'
+             r'Parent|Partition|PasswordChar|PictureMargin|'
+             r'PicturePosition|PictureSpacing|PictureSelectionDisplay|'
+             r'PictureVal|Picture|Prepared|'
              r'PolyPoints|PreserveWhiteSpace|PreviewContainer|'
-             r'PrintJobName|Procedure|PROCESSID|ProgID|ProjectHook|'
-             r'ProjectHookClass|ProjectHookLibrary|QuietMode|'
+             r'PrintJobName|Procedure|PROCESSID|ProgID|ProjectHookClass|'
+             r'ProjectHookLibrary|ProjectHook|QuietMode|'
              r'ReadCycle|ReadLock|ReadMouse|ReadObject|ReadOnly|'
-             r'ReadSave|ReadTimeout|RecordMark|RecordSource|'
-             r'RecordSourceType|RefreshAlias|RefreshCmd|'
-             r'RefreshCmdDataSource|RefreshCmdDataSourceType|'
+             r'ReadSave|ReadTimeout|RecordMark|RecordSourceType|'
+             r'RecordSource|RefreshAlias|'
+             r'RefreshCmdDataSourceType|RefreshCmdDataSource|RefreshCmd|'
              r'RefreshIgnoreFieldList|RefreshTimeStamp|RelationalExpr|'
              r'RelativeColumn|RelativeRow|ReleaseType|Resizable|'
              r'RespectCursorCP|RespectNesting|RightToLeft|RotateFlip|'
-             r'Rotation|RowColChange|RowHeight|RowSource|'
-             r'RowSourceType|ScaleMode|SCCProvider|SCCStatus|ScrollBars|'
-             r'Seconds|SelectCmd|Selected|SelectedID|'
-             r'SelectedItemBackColor|SelectedItemForeColor|'
+             r'Rotation|RowColChange|RowHeight|RowSourceType|'
+             r'RowSource|ScaleMode|SCCProvider|SCCStatus|ScrollBars|'
+             r'Seconds|SelectCmd|SelectedID|'
+             r'SelectedItemBackColor|SelectedItemForeColor|Selected|'
              r'SelectionNamespaces|SelectOnEntry|SelLength|SelStart|'
-             r'SelText|SendGDIPlusImage|SendUpdates|ServerClass|'
-             r'ServerClassLibrary|ServerHelpFile|ServerName|'
+             r'SelText|SendGDIPlusImage|SendUpdates|ServerClassLibrary|'
+             r'ServerClass|ServerHelpFile|ServerName|'
              r'ServerProject|ShowTips|ShowInTaskbar|ShowWindow|'
              r'Sizable|SizeBox|SOM|Sorted|Sparse|SpecialEffect|'
              r'SpinnerHighValue|SpinnerLowValue|SplitBar|StackLevel|'
-             r'StartMode|StatusBar|StatusBarText|Stretch|StrictDateEntry|'
+             r'StartMode|StatusBarText|StatusBar|Stretch|StrictDateEntry|'
              r'Style|TabIndex|Tables|TabOrientation|Tabs|TabStop|'
              r'TabStretch|TabStyle|Tag|TerminateRead|Text|Themes|'
-             r'ThreadID|TimestampFieldList|TitleBar|ToolTipText|Top|'
-             r'TopIndex|TopItemID|TwoPassProcess|Type|TypeLibCLSID|'
-             r'TypeLibDesc|TypeLibName|Unicode|UpdatableFieldList|'
-             r'UpdateCmd|UpdateCmdDataSource|UpdateCmdDataSourceType|'
+             r'ThreadID|TimestampFieldList|TitleBar|ToolTipText|'
+             r'TopIndex|TopItemID|Top|TwoPassProcess|TypeLibCLSID|'
+             r'TypeLibDesc|TypeLibName|Type|Unicode|UpdatableFieldList|'
+             r'UpdateCmdDataSourceType|UpdateCmdDataSource|'
              r'UpdateCmdRefreshCmd|UpdateCmdRefreshFieldList|'
-             r'UpdateCmdRefreshKeyFieldList|UpdateGram|'
-             r'UpdateGramSchemaLocation|UpdateNameList|UpdateType|'
+             r'UpdateCmdRefreshKeyFieldList|UpdateCmd|'
+             r'UpdateGramSchemaLocation|UpdateGram|UpdateNameList|UpdateType|'
              r'UseCodePage|UseCursorSchema|UseDeDataSource|UseMemoSize|'
-             r'UserValue|UseTransactions|UTF8Encoded|Value|Version|'
-             r'VersionComments|VersionCompany|VersionCopyright|'
-             r'VersionDescription|VersionNumber|VersionProduct|'
-             r'VersionTrademarks|VFPXMLProgID|ViewPortHeight|ViewPortLeft|'
+             r'UserValue|UseTransactions|UTF8Encoded|Value|VersionComments|'
+             r'VersionCompany|VersionCopyright|VersionDescription|'
+             r'VersionNumber|VersionProduct|VersionTrademarks|Version|'
+             r'VFPXMLProgID|ViewPortHeight|ViewPortLeft|'
              r'ViewPortTop|ViewPortWidth|VScrollSmallChange|View|Visible|'
-             r'VisualEffect|WhatsThisButton|WhatsThisHelp|WhatsThisHelpID|'
+             r'VisualEffect|WhatsThisButton|WhatsThisHelpID|WhatsThisHelp|'
              r'WhereType|Width|WindowList|WindowState|WindowType|WordWrap|'
              r'WrapCharInCDATA|WrapInCDATA|WrapMemoInCDATA|XMLAdapter|'
-             r'XMLConstraints|XMLName|XMLNameIsXPath|XMLNamespace|'
+             r'XMLConstraints|XMLNameIsXPath|XMLNamespace|XMLName|'
              r'XMLPrefix|XMLSchemaLocation|XMLTable|XMLType|'
              r'XSDfractionDigits|XSDmaxLength|XSDtotalDigits|'
              r'XSDtype|ZoomBox)', Name.Attribute),
 
-            (r'\.(ActivateCell|Add|Add|AddColumn|AddItem|AddListItem|'
-             r'AddObject|AddProperty|AddTableSchema|AddToSCC|'
+            (r'\.(ActivateCell|AddColumn|AddItem|AddListItem|AddObject|'
+             r'AddProperty|AddTableSchema|AddToSCC|Add|'
              r'ApplyDiffgram|Attach|AutoFit|AutoOpen|Box|Build|'
              r'CancelReport|ChangesToCursor|CheckIn|CheckOut|Circle|'
-             r'CleanUp|Clear|ClearData|ClearStatus|CloneObject|Close|'
-             r'CloseTables|Cls|CursorAttach|CursorDetach|CursorFill|'
+             r'CleanUp|ClearData|ClearStatus|Clear|CloneObject|CloseTables|'
+             r'Close|Cls|CursorAttach|CursorDetach|CursorFill|'
              r'CursorRefresh|DataToClip|DelayedMemoFetch|DeleteColumn|'
              r'Dock|DoMessage|DoScroll|DoStatus|DoVerb|Drag|Draw|Eval|'
              r'GetData|GetDockState|GetFormat|GetKey|GetLatestVersion|'
              r'GetPageHeight|GetPageWidth|Help|Hide|IncludePageInOutput|'
-             r'IndexToItemID|Item|ItemIDToIndex|LoadXML|Line|Modify|'
-             r'Move|MoveItem|Nest|OLEDrag|OnPreviewClose|OutputPage|'
+             r'IndexToItemID|ItemIDToIndex|Item|LoadXML|Line|Modify|'
+             r'MoveItem|Move|Nest|OLEDrag|OnPreviewClose|OutputPage|'
              r'Point|Print|PSet|Quit|ReadExpression|ReadMethod|'
-             r'RecordRefresh|Refresh|Release|ReleaseXML|Remove|'
-             r'RemoveFromSCC|RemoveItem|RemoveListItem|RemoveObject|'
-             r'Render|Requery|RequestData|Reset|ResetToDefault|Run|'
-             r'SaveAs|SaveAsClass|SetAll|SetData|SetFocus|SetFormat|'
-             r'SetMain|SetVar|SetViewPort|Show|ShowWhatsThis|'
+             r'RecordRefresh|Refresh|ReleaseXML|Release|RemoveFromSCC|'
+             r'RemoveItem|RemoveListItem|RemoveObject|Remove|'
+             r'Render|Requery|RequestData|ResetToDefault|Reset|Run|'
+             r'SaveAsClass|SaveAs|SetAll|SetData|SetFocus|SetFormat|'
+             r'SetMain|SetVar|SetViewPort|ShowWhatsThis|Show|'
              r'SupportsListenerType|TextHeight|TextWidth|ToCursor|'
              r'ToXML|UndoCheckOut|Unnest|UpdateStatus|WhatsThisMode|'
              r'WriteExpression|WriteMethod|ZOrder)', Name.Function),
@@ -327,9 +327,9 @@ class FoxProLexer(RegexLexer):
              r'dbc_BeforeRenameView|dbc_BeforeValidateData|'
              r'dbc_CloseData|dbc_Deactivate|dbc_ModifyData|dbc_OpenData|'
              r'dbc_PackData|DblClick|Deactivate|Deleted|Destroy|DoCmd|'
-             r'DownClick|DragDrop|DragOver|DropDown|Error|ErrorMessage|'
+             r'DownClick|DragDrop|DragOver|DropDown|ErrorMessage|Error|'
              r'EvaluateContents|GotFocus|Init|InteractiveChange|KeyPress|'
-             r'Load|LoadReport|LostFocus|Message|MiddleClick|MouseDown|'
+             r'LoadReport|Load|LostFocus|Message|MiddleClick|MouseDown|'
              r'MouseEnter|MouseLeave|MouseMove|MouseUp|MouseWheel|Moved|'
              r'OLECompleteDrag|OLEDragOver|OLEGiveFeedback|OLESetData|'
              r'OLEStartDrag|OnMoveItem|Paint|ProgrammaticChange|'
@@ -337,7 +337,7 @@ class FoxProLexer(RegexLexer):
              r'QueryRunFile|QueryUnload|RangeHigh|RangeLow|ReadActivate|'
              r'ReadDeactivate|ReadShow|ReadValid|ReadWhen|Resize|'
              r'RightClick|SCCInit|SCCDestroy|Scrolled|Timer|UIEnable|'
-             r'UnDock|Unload|UnloadReport|UpClick|Valid|When)', Name.Function),
+             r'UnDock|UnloadReport|Unload|UpClick|Valid|When)', Name.Function),
 
             (r'\s+', Text),
             # everything else is not colored
index 4947bf7d9a6dc63780cd4faeb9d030580f00d780..a082811b1aead7ab1121938e4345ca590458638f 100644 (file)
@@ -1665,7 +1665,7 @@ class OpaLexer(RegexLexer):
     keywords = [
         'and', 'as', 'begin', 'css', 'database', 'db', 'do', 'else', 'end',
         'external', 'forall', 'if', 'import', 'match', 'package', 'parser',
-        'rec', 'server', 'then', 'type', 'val', 'with', 'xml_parser'
+        'rec', 'server', 'then', 'type', 'val', 'with', 'xml_parser',
     ]
 
     # matches both stuff and `stuff`
@@ -1902,7 +1902,7 @@ class OpaLexer(RegexLexer):
             (r'[/*]', Comment),
         ],
 
-        # the coy pasting between string and single-string
+        # the copy pasting between string and single-string
         # is kinda sad. Is there a way to avoid that??
         'string': [
             (r'[^\\"{]+', String.Double),
@@ -1949,6 +1949,7 @@ class OpaLexer(RegexLexer):
             (r'"', String.Single, ('#pop', 'string')),
             (r'#'+ident_re, String.Single, '#pop'),
             (r'#(?={)', String.Single, ('#pop', 'root')),
+            (r'[^"\'{`=<>]+', String.Single, '#pop'),
             (r'{', Operator, ('#pop', 'root')), # this is a tail call!
         ],
 
@@ -1958,7 +1959,7 @@ class OpaLexer(RegexLexer):
             (r'</', String.Single, ('#pop', 'html-end-tag')),
             (r'<', String.Single, 'html-open-tag'),
             (r'{', Operator, 'root'),
-            (r'.|\s+', String.Single),
+            (r'[^<{]+', String.Single),
         ],
 
         'html-comment': [
index 647f839681c4cbd2e5e00812abd6659997fe72f0..57ffc349a7208a5eca703b37a8f023db9614c492 100644 (file)
@@ -25,7 +25,7 @@ class VerilogLexer(RegexLexer):
     *New in Pygments 1.4.*
     """
     name = 'verilog'
-    aliases = ['v']
+    aliases = ['verilog', 'v']
     filenames = ['*.v']
     mimetypes = ['text/x-verilog']
 
@@ -137,7 +137,7 @@ class SystemVerilogLexer(RegexLexer):
     *New in Pygments 1.5.*
     """
     name = 'systemverilog'
-    aliases = ['sv']
+    aliases = ['systemverilog', 'sv']
     filenames = ['*.sv', '*.svh']
     mimetypes = ['text/x-systemverilog']
 
index 6857cd7b8354fd0fa251515494cafe2180757c76..717621e91d0bb8b8a3e982e20492ba28ebccccc4 100644 (file)
@@ -355,7 +355,7 @@ class GosuLexer(RegexLexer):
             (r'(var|delegate|construct|function|private|internal|protected|'
              r'public|abstract|override|final|static|extends|transient|'
              r'implements|represents|readonly)\b', Keyword.Declaration),
-            (r'(property\s+)(get|set|)', Keyword.Declaration),
+            (r'(property\s+)(get|set)?', Keyword.Declaration),
             (r'(boolean|byte|char|double|float|int|long|short|void|block)\b',
              Keyword.Type),
             (r'(package)(\s+)', bygroups(Keyword.Namespace, Text)),
index 81d65d99a81971123900eb02559cacf6d83f9fb5..537c6d0ec6d89602678dd2bab5ca106b349ff6b1 100644 (file)
@@ -58,9 +58,9 @@ class JuliaLexer(RegexLexer):
             # keywords
             (r'(begin|while|for|in|return|break|continue|'
              r'macro|quote|let|if|elseif|else|try|catch|end|'
-             r'bitstype|ccall|do)\b', Keyword),
+             r'bitstype|ccall|do|using|module|import|export|'
+             r'importall|baremodule)\b', Keyword),
             (r'(local|global|const)\b', Keyword.Declaration),
-            (r'(module|import|export)\b', Keyword.Reserved),
             (r'(Bool|Int|Int8|Int16|Int32|Int64|Uint|Uint8|Uint16|Uint32|Uint64'
              r'|Float32|Float64|Complex64|Complex128|Any|Nothing|None)\b',
                 Keyword.Type),
@@ -819,8 +819,7 @@ class OctaveLexer(RegexLexer):
 
     def analyse_text(text):
         if re.match('^\s*[%#]', text, re.M): #Comment
-            return 0.9
-        return 0.1
+            return 0.1
 
 
 class ScilabLexer(RegexLexer):
index bd56e112691960a4daa97791345b042f2273daac..c85579220c8fc130519ccfd73c6acd3db32433fc 100644 (file)
@@ -1487,9 +1487,9 @@ class RebolLexer(RegexLexer):
             (r'}', Comment, '#pop'),
         ],
         'commentBlock': [
-            (r'\[',Comment, '#push'),
-            (r'\]',Comment, '#pop'),
-            (r'[^(\[\])]*', Comment),
+            (r'\[', Comment, '#push'),
+            (r'\]', Comment, '#pop'),
+            (r'[^(\[\])]+', Comment),
         ],
     }
 
@@ -2845,7 +2845,7 @@ class BroLexer(RegexLexer):
              r'|pattern|port|record|set|string|subnet|table|time|timer'
              r'|vector)\b', Keyword.Type),
             (r'(T|F)\b', Keyword.Constant),
-            (r'(&)((?:add|delete|expire)_func|attr|(create|read|write)_expire'
+            (r'(&)((?:add|delete|expire)_func|attr|(?:create|read|write)_expire'
              r'|default|disable_print_hook|raw_output|encrypt|group|log'
              r'|mergeable|optional|persistent|priority|redef'
              r'|rotate_(?:interval|size)|synchronized)\b', bygroups(Punctuation,
@@ -3312,19 +3312,19 @@ class NSISLexer(RegexLexer):
             include('macro'),
             include('interpol'),
             include('basic'),
-            (r'\$\{[a-zA-Z_\|][a-zA-Z0-9_\|]*\}', Keyword.Pseudo),
-            (r'\/[a-zA-Z_][a-zA-Z0-9_]*', Name.Attribute),
+            (r'\$\{[a-z_|][\w|]*\}', Keyword.Pseudo),
+            (r'/[a-z_]\w*', Name.Attribute),
             ('.', Text),
         ],
         'basic': [
-            (r'(\n)(Function)(\s+)([\.\_a-zA-Z][\.\_a-zA-Z0-9]*)\b',
+            (r'(\n)(Function)(\s+)([._a-z][.\w]*)\b',
              bygroups(Text, Keyword, Text, Name.Function)),
-            (r'\b([_a-zA-Z][_a-zA-Z0-9]*)(::)([a-zA-Z][a-zA-Z0-9]*)\b',
+            (r'\b([_a-z]\w*)(::)([a-z][a-z0-9]*)\b',
              bygroups(Keyword.Namespace, Punctuation, Name.Function)),
-            (r'\b([_a-zA-Z][_a-zA-Z0-9]*)(:)', bygroups(Name.Label, Punctuation)),
+            (r'\b([_a-z]\w*)(:)', bygroups(Name.Label, Punctuation)),
             (r'(\b[ULS]|\B)([\!\<\>=]?=|\<\>?|\>)\B', Operator),
-            (r'[\+\-\|]', Operator),
-            (r'[\\]', Punctuation),
+            (r'[|+-]', Operator),
+            (r'\\', Punctuation),
             (r'\b(Abort|Add(?:BrandingImage|Size)|'
              r'Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|'
              r'BG(?:Font|Gradient)|BrandingText|BringToFront|Call(?:InstDLL)?|'
@@ -3397,7 +3397,7 @@ class NSISLexer(RegexLexer):
             r'STARTMENU|SYSDIR|TEMP(?:LATES)?|VIDEOS|WINDIR|\{NSISDIR\})',
              Name.Builtin),
             (r'\$(CMDLINE|INSTDIR|OUTDIR|LANGUAGE)', Name.Variable.Global),
-            (r'\$[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable),
+            (r'\$[a-z_]\w*', Name.Variable),
         ],
         'str_double': [
             (r'"', String, '#pop'),
@@ -3457,8 +3457,8 @@ class RPMSpecLexer(RegexLexer):
             include('macro'),
             (r'(?i)^(Name|Version|Release|Epoch|Summary|Group|License|Packager|'
              r'Vendor|Icon|URL|Distribution|Prefix|Patch[0-9]*|Source[0-9]*|'
-             r'Requires\(?[a-z]*\)?|[A-Za-z]+Req|Obsoletes|Provides|Conflicts|'
-             r'Build[A-Za-z]+|[A-Za-z]+Arch|Auto[A-Za-z]+)(:)(.*)$',
+             r'Requires\(?[a-z]*\)?|[a-z]+Req|Obsoletes|Provides|Conflicts|'
+             r'Build[a-z]+|[a-z]+Arch|Auto[a-z]+)(:)(.*)$',
              bygroups(Generic.Heading, Punctuation, using(this))),
             (r'^%description', Name.Decorator, 'description'),
             (r'^%changelog', Name.Decorator, 'changelog'),
@@ -3641,7 +3641,7 @@ class AutoItLexer(RegexLexer):
         ],
         'labels': [
             # sendkeys
-            (r'(^\s*)({[^\s]+?})', bygroups(Text, Name.Label)),
+            (r'(^\s*)({\S+?})', bygroups(Text, Name.Label)),
         ],
         'numbers': [
             (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
index 803005f3c4a626280bfaab2fd3becab8c064079d..b95faf93e52c1786a2192fb1c5b91a3d0c13dffc 100644 (file)
@@ -18,7 +18,7 @@ from pygments.util import shebang_matches
 
 
 __all__ = ['BashLexer', 'BashSessionLexer', 'TcshLexer', 'BatchLexer',
-           'PowerShellLexer']
+           'PowerShellLexer', 'ShellSessionLexer']
 
 line_re  = re.compile('.*?\n')
 
@@ -153,6 +153,52 @@ class BashSessionLexer(Lexer):
                 yield pos+i, t, v
 
 
+class ShellSessionLexer(Lexer):
+    """
+    Lexer for shell sessions that works with different command prompts
+
+    *New in Pygments 1.6.*
+    """
+
+    name = 'Shell Session'
+    aliases = ['shell-session']
+    filenames = ['*.shell-session']
+    mimetypes = ['application/x-sh-session']
+
+    def get_tokens_unprocessed(self, text):
+        bashlexer = BashLexer(**self.options)
+
+        pos = 0
+        curcode = ''
+        insertions = []
+
+        for match in line_re.finditer(text):
+            line = match.group()
+            m = re.match(r'^((?:\[?\S+@[^$#%]+)[$#%])(.*\n?)', line)
+            if m:
+                # To support output lexers (say diff output), the output
+                # needs to be broken by prompts whenever the output lexer
+                # changes.
+                if not insertions:
+                    pos = match.start()
+
+                insertions.append((len(curcode),
+                                   [(0, Generic.Prompt, m.group(1))]))
+                curcode += m.group(2)
+            else:
+                if insertions:
+                    toks = bashlexer.get_tokens_unprocessed(curcode)
+                    for i, t, v in do_insertions(insertions, toks):
+                        yield pos+i, t, v
+                yield match.start(), Generic.Output, line
+                insertions = []
+                curcode = ''
+        if insertions:
+            for i, t, v in do_insertions(insertions,
+                                         bashlexer.get_tokens_unprocessed(curcode)):
+                yield pos+i, t, v
+
+
 class BatchLexer(RegexLexer):
     """
     Lexer for the DOS/Windows Batch file format.
index 8709e43a2aef10cff7fa61ad14eb426de064d96b..5e3408939c93664c601368434f5187be6f3634bf 100644 (file)
@@ -65,7 +65,7 @@ class RegeditLexer(RegexLexer):
     """
 
     name = 'reg'
-    aliases = []
+    aliases = ['registry']
     filenames = ['*.reg']
     mimetypes = ['text/x-windows-registry']
 
@@ -616,7 +616,7 @@ class MoinWikiLexer(RegexLexer):
             (r'(\'\'\'?|\|\||`|__|~~|\^|,,|::)', Comment), # Formatting
             # Lists
             (r'^( +)([.*-])( )', bygroups(Text, Name.Builtin, Text)),
-            (r'^( +)([a-zivx]{1,5}\.)( )', bygroups(Text, Name.Builtin, Text)),
+            (r'^( +)([a-z]{1,5}\.)( )', bygroups(Text, Name.Builtin, Text)),
             # Other Formatting
             (r'\[\[\w+.*?\]\]', Keyword), # Macro
             (r'(\[[^\s\]]+)(\s+[^\]]+?)?(\])',
index 1f88e0fcaafe8aae5c889fc92a88e15162464b04..24942007a4488a2bfe896455e45f0a4a7a2e28bf 100644 (file)
@@ -2937,27 +2937,25 @@ class DartLexer(RegexLexer):
 
     tokens = {
         'root': [
+            include('string_literal'),
             (r'#!(.*?)$', Comment.Preproc),
-            (r'(#)(import|library|source)', bygroups(Text, Keyword)),
+            (r'\b(import|export)\b', Keyword, 'import_decl'),
+            (r'\b(library|source|part of|part)\b', Keyword),
             (r'[^\S\n]+', Text),
             (r'//.*?\n', Comment.Single),
             (r'/\*.*?\*/', Comment.Multiline),
-            (r'(class|interface)(\s+)',
+            (r'\b(class)\b(\s+)',
              bygroups(Keyword.Declaration, Text), 'class'),
-            (r'(assert|break|case|catch|continue|default|do|else|finally|for|'
+            (r'\b(assert|break|case|catch|continue|default|do|else|finally|for|'
              r'if|in|is|new|return|super|switch|this|throw|try|while)\b',
              Keyword),
-            (r'(abstract|const|extends|factory|final|get|implements|'
+            (r'\b(abstract|const|extends|factory|final|get|implements|'
              r'native|operator|set|static|typedef|var)\b', Keyword.Declaration),
-            (r'(bool|double|Dynamic|int|num|Object|String|void)', Keyword.Type),
-            (r'(false|null|true)', Keyword.Constant),
-            (r'@"(\\\\|\\"|[^"])*"', String.Double), # raw string
-            (r"@'(\\\\|\\'|[^'])*'", String.Single), # raw string
-            (r'"', String.Double, 'string_double'),
-            (r"'", String.Single, 'string_single'),
+            (r'\b(bool|double|Dynamic|int|num|Object|String|void)\b', Keyword.Type),
+            (r'\b(false|null|true)\b', Keyword.Constant),
+            (r'[~!%^&*+=|?:<>/-]|as', Operator),
             (r'[a-zA-Z_$][a-zA-Z0-9_]*:', Name.Label),
             (r'[a-zA-Z_$][a-zA-Z0-9_]*', Name),
-            (r'[~!%^&*+=|?:<>/-]', Operator),
             (r'[(){}\[\],.;]', Punctuation),
             (r'0[xX][0-9a-fA-F]+', Number.Hex),
             # DIGIT+ (‘.’ DIGIT*)? EXPONENT?
@@ -2969,21 +2967,56 @@ class DartLexer(RegexLexer):
         'class': [
             (r'[a-zA-Z_$][a-zA-Z0-9_]*', Name.Class, '#pop')
         ],
-        'string_double': [
-            (r'"', String.Double, '#pop'),
-            (r'[^"$]+', String.Double),
+        'import_decl': [
+            include('string_literal'),
+            (r'\s+', Text),
+            (r'\b(as|show|hide)\b', Keyword),
+            (r'[a-zA-Z_$][a-zA-Z0-9_]*', Name),
+            (r'\,', Punctuation),
+            (r'\;', Punctuation, '#pop')
+        ],
+        'string_literal': [
+            # Raw strings.
+            (r'r"""([\s|\S]*?)"""', String.Double),
+            (r"r'''([\s|\S]*?)'''", String.Single),
+            (r'r"(.*?)"', String.Double),
+            (r"r'(.*?)'", String.Single),
+            # Normal Strings.
+            (r'"""', String.Double, 'string_double_multiline'),
+            (r"'''", String.Single, 'string_single_multiline'),
+            (r'"', String.Double, 'string_double'),
+            (r"'", String.Single, 'string_single')
+        ],
+        'string_common': [
+            (r"\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]*\}|[a-z\'\"$\\])",
+             String.Escape),
             (r'(\$)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(String.Interpol, Name)),
             (r'(\$\{)(.*?)(\})',
-             bygroups(String.Interpol, using(this), String.Interpol)),
+             bygroups(String.Interpol, using(this), String.Interpol))
+        ],
+        'string_double': [
+            (r'"', String.Double, '#pop'),
+            (r'[^\"$\\\n]+', String.Double),
+            include('string_common'),
             (r'\$+', String.Double)
         ],
+        'string_double_multiline': [
+            (r'"""', String.Double, '#pop'),
+            (r'[^\"$\\]+', String.Double),
+            include('string_common'),
+            (r'(\$|\")+', String.Double)
+        ],
         'string_single': [
             (r"'", String.Single, '#pop'),
-            (r"[^'$]+", String.Single),
-            (r'(\$)([a-zA-Z_][a-zA-Z0-9_]*)', bygroups(String.Interpol, Name)),
-            (r'(\$\{)(.*?)(\})',
-             bygroups(String.Interpol, using(this), String.Interpol)),
+            (r"[^\'$\\\n]+", String.Single),
+            include('string_common'),
             (r'\$+', String.Single)
+        ],
+        'string_single_multiline': [
+            (r"'''", String.Single, '#pop'),
+            (r'[^\'$\\]+', String.Single),
+            include('string_common'),
+            (r'(\$|\')+', String.Single)
         ]
     }
 
@@ -3047,7 +3080,7 @@ class TypeScriptLexer(RegexLexer):
             # Match stuff like: constructor
             (r'\b(constructor|declare|interface|as|AS)\b', Keyword.Reserved),
             # Match stuff like: super(argument, list)
-            (r'(super)(\s*)\(([a-zA-Z0-9,_?.$\s]+\s*)\)',
+            (r'(super)(\s*)(\([a-zA-Z0-9,_?.$\s]+\s*\))',
              bygroups(Keyword.Reserved, Text), 'slashstartsregex'),
             # Match stuff like: function() {...}
             (r'([a-zA-Z_?.$][\w?.$]*)\(\) \{', Name.Other, 'slashstartsregex'),
index fc3fef71b4c4bb5f4a7ca1f8a9580b7d04186f1b..1312648fe4304365509fbbd31730a7865153a3b9 100644 (file)
@@ -8,6 +8,8 @@ def main():
 
     for name, aliases, filenames, mimetypes in get_all_lexers():
         cls = find_lexer_class(name)
+        if not cls.aliases:
+            print cls, "has no aliases"
         for f in filenames:
             if f not in uses:
                 uses[f] = []
index 91646d6906d10c59374de94bb03d7447fcc45ef2..17bbf814c8a078fdb1a80c9736aec3098312bfbe 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -60,7 +60,7 @@ else:
 
 setup(
     name = 'Pygments',
-    version = '1.6rc1',
+    version = '1.6',
     url = 'http://pygments.org/',
     license = 'BSD License',
     author = 'Georg Brandl',
index 7bb88faa31846dd67275e6f5ee8f6cb551e06c96..83faf69c172a72e10b090e2ebb10cae62bead0f4 100644 (file)
@@ -121,3 +121,5 @@ define macro with-decoded-seconds
        }
 end macro;
 
+let x = "This size call should be seen as a builtin despite the odd case.".siZe;
+
diff --git a/tests/examplefiles/example.shell-session b/tests/examplefiles/example.shell-session
new file mode 100644 (file)
index 0000000..66984aa
--- /dev/null
@@ -0,0 +1,45 @@
+[user@linuxbox imx-bootlets-src-10.05.02]$ make CROSS_COMPILE=arm-none-eabi-  clean
+rm -rf *.sb
+rm -f sd_mmc_bootstream.raw
+rm -f linux_prep/board/*.o
+...
+Files:
+rm -f power_prep.o eabi.o
+Build output:
+make[1]: Leaving directory `/home/...'
+[user@linuxbox imx-bootlets-src-10.05.02]$ make CROSS_COMPILE=arm-none-eabi-
+make[1]: Entering directory `/home/...'
+...
+#@echo "generating U-Boot boot stream image"
+#elftosb2 -z -c ./uboot_prebuilt.db -o imx23_uboot.sb
+echo "generating kernel bootstream file sd_mmc_bootstream.raw"
+generating kernel bootstream file sd_mmc_bootstream.raw
+#Please use cfimager to burn xxx_linux.sb. The below way will no
+#work at imx28 platform.
+> test
+$ test
+rm -f sd_mmc_bootstream.raw
+[user@linuxbox imx-bootlets-src-10.05.02]$
+pi@raspberrypi ~ $ sudo sh -c "echo 17 > /sys/class/gpio/export"
+pi@raspberrypi ~ $ sudo sh -c "echo out > /sys/class/gpio/gpio17/direction"
+pi@raspberrypi ~ $ sudo sh -c "echo 1 > /sys/class/gpio/gpio17/value"
+pi@raspberrypi ~ $ sudo sh -c "echo 0 > /sys/class/gpio/gpio17/value"
+pi@raspberrypi ~ $
+[user@linuxbox ~]$ # copy other stuff to the SD card
+root@imx233-olinuxino-micro:~# lsmod
+  Not tainted
+[user@linuxbox ~]$ tail -n 2 /mnt/rpi/etc/inittab
+#Spawn a getty on Raspberry Pi serial line
+T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
+pi@raspberrypi:~/Adafruit-WebIDE$ mkdir tmp
+pi@raspberrypi:~/Adafruit-WebIDE$ npm config set tmp tmp
+pi@raspberrypi:~/Adafruit-WebIDE$ npm install
+pi@raspberrypi ~/Adafruit-WebIDE $ ifconfig eth0
+eth0      Link encap:Ethernet  HWaddr b5:33:ff:33:ee:aq
+          inet addr:10.42.0.60  Bcast:10.42.0.255  Mask:255.255.255.0
+          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
+          RX packets:21867 errors:0 dropped:0 overruns:0 frame:0
+          TX packets:8684 errors:0 dropped:0 overruns:0 carrier:0
+          collisions:0 txqueuelen:1000
+          RX bytes:27338495 (26.0 MiB)  TX bytes:1268356 (1.2 MiB)
+
diff --git a/tests/examplefiles/logos_example.xm b/tests/examplefiles/logos_example.xm
new file mode 100644 (file)
index 0000000..39753e2
--- /dev/null
@@ -0,0 +1,28 @@
+%hook ABC
+- (id)a:(B)b {
+       %log;
+       return %orig(nil);
+}
+%end
+
+%subclass DEF: NSObject
+- (id)init {
+       [%c(RuntimeAccessibleClass) alloc];
+       return nil;
+}
+%end
+
+%group OptionalHooks
+%hook ABC
+- (void)release {
+       [self retain];
+       %orig;
+}
+%end
+%end
+
+%ctor {
+       %init;
+       if(OptionalCondition)
+               %init(OptionalHooks);
+}
diff --git a/tests/examplefiles/session.dylan-console b/tests/examplefiles/session.dylan-console
new file mode 100644 (file)
index 0000000..6f289c8
--- /dev/null
@@ -0,0 +1,9 @@
+? 7 * 52;
+=> 364
+? define variable *your-variable* = $foo;
+? begin
+   let yours = "apple";
+   let mine = yours;
+   mine == yours;
+ end;
+=> #t
diff --git a/tests/examplefiles/test.opa b/tests/examplefiles/test.opa
new file mode 100644 (file)
index 0000000..ec287ac
--- /dev/null
@@ -0,0 +1,10 @@
+function sample_page() {
+  <header>
+    <h3>HTML in Opa</h3>
+  </header>
+  <article>
+    <div class=container>
+      <p>Learning by examples.</p>
+    </div>
+  </article>
+}
index f66433087c33c9d7f7effee3e988d06d8856cd92..00dc26f0b42407322d044224759e200b76606fa0 100644 (file)
@@ -93,7 +93,8 @@ def test_lexer_options():
             'PythonConsoleLexer', 'RConsoleLexer', 'RubyConsoleLexer',
             'SqliteConsoleLexer', 'MatlabSessionLexer', 'ErlangShellLexer',
             'BashSessionLexer', 'LiterateHaskellLexer', 'PostgresConsoleLexer',
-            'ElixirConsoleLexer', 'JuliaConsoleLexer', 'RobotFrameworkLexer'):
+            'ElixirConsoleLexer', 'JuliaConsoleLexer', 'RobotFrameworkLexer',
+            'DylanConsoleLexer', 'ShellSessionLexer'):
             inst = cls(ensurenl=False)
             ensure(inst.get_tokens('a\nb'), 'a\nb')
             inst = cls(ensurenl=False, stripall=True)