Imported Upstream version 1.2 upstream/1.2
authorJinWang An <jinwang.an@samsung.com>
Tue, 5 Jan 2021 03:13:32 +0000 (12:13 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 5 Jan 2021 03:13:32 +0000 (12:13 +0900)
119 files changed:
AUTHORS
CHANGES
LICENSE
Makefile
PKG-INFO
Pygments.egg-info/PKG-INFO
Pygments.egg-info/SOURCES.txt
TODO
docs/build/api.html
docs/build/authors.html
docs/build/changelog.html
docs/build/cmdline.html
docs/build/filterdevelopment.html
docs/build/filters.html
docs/build/formatterdevelopment.html
docs/build/formatters.html
docs/build/index.html
docs/build/installation.html
docs/build/integrate.html
docs/build/lexerdevelopment.html
docs/build/lexers.html
docs/build/moinmoin.html
docs/build/plugins.html
docs/build/quickstart.html
docs/build/rstdirective.html
docs/build/styles.html
docs/build/tokens.html
docs/build/unicode.html
docs/generate.py
docs/src/cmdline.txt
docs/src/installation.txt
external/markdown-processor.py
external/moin-parser.py
external/rst-directive-old.py
external/rst-directive.py
pygments/__init__.py
pygments/cmdline.py
pygments/console.py
pygments/filter.py
pygments/filters/__init__.py
pygments/formatter.py
pygments/formatters/__init__.py
pygments/formatters/_mapping.py
pygments/formatters/bbcode.py
pygments/formatters/html.py
pygments/formatters/img.py
pygments/formatters/latex.py
pygments/formatters/other.py
pygments/formatters/rtf.py
pygments/formatters/svg.py
pygments/formatters/terminal.py
pygments/formatters/terminal256.py
pygments/lexer.py
pygments/lexers/__init__.py
pygments/lexers/_asybuiltins.py [new file with mode: 0644]
pygments/lexers/_clbuiltins.py
pygments/lexers/_luabuiltins.py
pygments/lexers/_mapping.py
pygments/lexers/_phpbuiltins.py
pygments/lexers/agile.py
pygments/lexers/asm.py
pygments/lexers/compiled.py
pygments/lexers/dotnet.py
pygments/lexers/functional.py
pygments/lexers/math.py
pygments/lexers/other.py
pygments/lexers/parsers.py
pygments/lexers/special.py
pygments/lexers/templates.py
pygments/lexers/text.py
pygments/lexers/web.py
pygments/plugin.py
pygments/scanner.py
pygments/style.py
pygments/styles/__init__.py
pygments/styles/autumn.py
pygments/styles/borland.py
pygments/styles/bw.py
pygments/styles/colorful.py
pygments/styles/default.py
pygments/styles/emacs.py
pygments/styles/friendly.py
pygments/styles/fruity.py
pygments/styles/manni.py
pygments/styles/monokai.py [new file with mode: 0644]
pygments/styles/murphy.py
pygments/styles/native.py
pygments/styles/pastie.py
pygments/styles/perldoc.py
pygments/styles/tango.py
pygments/styles/trac.py
pygments/styles/vim.py
pygments/styles/vs.py
pygments/token.py
pygments/unistring.py
pygments/util.py
scripts/check_sources.py
scripts/find_codetags.py
scripts/find_error.py
setup.py
tests/examplefiles/broken/fucked_up.rb [deleted file]
tests/examplefiles/database.pytb
tests/examplefiles/fucked_up.rb [new file with mode: 0644]
tests/examplefiles/main.cmake [new file with mode: 0644]
tests/examplefiles/test.asy [new file with mode: 0644]
tests/examplefiles/test.html
tests/examplefiles/truncated.pytb [new file with mode: 0644]
tests/old_run.py
tests/run.py
tests/test_basic_api.py
tests/test_clexer.py
tests/test_cmdline.py
tests/test_examplefiles.py
tests/test_html_formatter.py
tests/test_latex_formatter.py
tests/test_regexlexer.py
tests/test_token.py
tests/test_using_api.py
tests/test_util.py

diff --git a/AUTHORS b/AUTHORS
index fd4983bef9a69b2dccc5c0fd1426a6bd63bf653c..34cc6bed69c339d8519267a0e46f8aa2de373c33 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -23,18 +23,22 @@ Other contributors, listed alphabetically, are:
 * Laurent Gautier -- R/S lexer
 * Krzysiek Goj -- Scala lexer
 * Matt Good -- Genshi, Cheetah lexers
+* Olivier Guibe -- Asymptote lexer
 * Matthew Harrison -- SVG formatter
 * Steven Hazel -- Tcl lexer
+* Aslak Hellesøy -- Gherkin lexer
 * Varun Hiremath -- Debian control lexer
 * Dennis Kaarsemaker -- sources.list lexer
 * Marek Kubica -- Scheme lexer
 * Jochen Kupperschmidt -- Markdown processor
 * Gerd Kurzbach -- Modelica lexer
 * Mark Lee -- Vala lexer
+* Ben Mabey -- Gherkin lexer
 * Kirk McDonald -- D lexer
 * Lukas Meuser -- BBCode formatter, Lua lexer
 * Paulo Moura -- Logtalk lexer
 * Ana Nelson -- Ragel, ANTLR lexers
+* Nam T. Nguyen -- Monokai style
 * Jesper Noehr -- HTML formatter "anchorlinenos"
 * Jonas Obrist -- BBCode lexer
 * David Oliva -- Rebol lexer
@@ -42,6 +46,7 @@ Other contributors, listed alphabetically, are:
 * Benjamin Peterson -- Test suite refactoring
 * Justin Reidy -- MXML lexer
 * Andre Roberge -- Tango style
+* Konrad Rudolph -- LaTeX formatter enhancements
 * Mario Ruggier -- Evoque lexers
 * Stou Sandalski -- NumPy, FORTRAN, tcsh and XSLT lexers
 * Matteo Sasso -- Common Lisp lexer
diff --git a/CHANGES b/CHANGES
index 9985ab3bbf1aacfaf6794d558c3596c28cb3bd61..9daf05af4a8b6f2b1a2d989e53bdd6bc6f93eef6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,46 @@ Pygments changelog
 
 Issue numbers refer to the tracker at http://dev.pocoo.org/projects/pygments/.
 
+Version 1.2
+-----------
+(codename Neujahr, released Jan 01, 2010)
+
+- Dropped Python 2.3 compatibility.
+
+- Lexers added:
+
+  * Asymptote
+  * Go
+  * Gherkin (Cucumber)
+  * CMake
+  * OOC
+
+- Added options for rendering LaTeX in source code comments in the
+  LaTeX formatter (#461).
+
+- Updated the Logtalk lexer.
+
+- Added `line_number_start` option to image formatter (#456).
+
+- Added `hl_lines` and `hl_color` options to image formatter (#457).
+
+- Fixed the HtmlFormatter's handling of noclasses=True to not output any
+  classes (#427).
+
+- Added the Monokai style (#453).
+
+- Fixed LLVM lexer identifier syntax and added new keywords (#442).
+
+- Fixed the PythonTracebackLexer to handle non-traceback data in header or
+  trailer, and support more partial tracebacks that start on line 2 (#437).
+
+- Fixed the CLexer to not highlight ternary statements as labels.
+
+- Fixed lexing of some Ruby quoting peculiarities (#460).
+
+- A few ASM lexer fixes (#450).
+
+
 Version 1.1.1
 -------------
 (bugfix release, released Sep 15, 2009)
diff --git a/LICENSE b/LICENSE
index 05652fc1fe0b5ba692bd5349a3b4149a4d1e922e..0ad59ecf940fb5cd1aa3be8c2eed97c52865967f 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2006-2009 by the respective authors (see AUTHORS file).
+Copyright (c) 2006-2010 by the respective authors (see AUTHORS file).
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
index 3d27e39dbf88c315acbbf5620ba54b0edb0e12cb..6e81f2eeeebae55056f9da2afb2cb96414ce24c2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
 #
 # Combines scripts for common tasks.
 #
-# :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+# :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
 # :license: BSD, see LICENSE for details.
 #
 
@@ -19,13 +19,13 @@ all: clean-pyc check test
 
 check:
        @$(PYTHON) scripts/detect_missing_analyse_text.py || true
-       @$(PYTHON) scripts/check_sources.py -i pygments/lexers/_mapping.py \
+       @$(PYTHON) scripts/check_sources.py -i build -i dist -i pygments/lexers/_mapping.py \
                   -i docs/build -i pygments/formatters/_mapping.py -i pygments/unistring.py \
                   -i pygments/lexers/_vimbuiltins.py
 
 clean: clean-pyc
-       rm -r build
-       rm -f codetags.html
+       -rm -rf build
+       -rm -f codetags.html
 
 clean-pyc:
        find . -name '*.pyc' -exec rm -f {} +
index d786c4825d1f9ce92597c6a70ed8c4d42d1a25e5..fb8dabf29e8efe26811eaf419bc27788d01eb2c8 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: Pygments
-Version: 1.1.1
+Version: 1.2
 Summary: Pygments is a syntax highlighting package written in Python.
 Home-page: http://pygments.org/
 Author: Georg Brandl
@@ -28,7 +28,7 @@ Description:
         .. _Pygments tip:
         http://dev.pocoo.org/hg/pygments-main/archive/tip.tar.gz#egg=Pygments-dev
         
-        :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+        :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
         :license: BSD, see LICENSE for details.
         
 Keywords: syntax highlighting
index d786c4825d1f9ce92597c6a70ed8c4d42d1a25e5..fb8dabf29e8efe26811eaf419bc27788d01eb2c8 100644 (file)
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: Pygments
-Version: 1.1.1
+Version: 1.2
 Summary: Pygments is a syntax highlighting package written in Python.
 Home-page: http://pygments.org/
 Author: Georg Brandl
@@ -28,7 +28,7 @@ Description:
         .. _Pygments tip:
         http://dev.pocoo.org/hg/pygments-main/archive/tip.tar.gz#egg=Pygments-dev
         
-        :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+        :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
         :license: BSD, see LICENSE for details.
         
 Keywords: syntax highlighting
index d14d7b57ef697dbef37da430d8c25d9ce1f4aab3..c6669e561cefcef755dea148d62323bd4062f296 100644 (file)
@@ -84,6 +84,7 @@ pygments/formatters/svg.py
 pygments/formatters/terminal.py
 pygments/formatters/terminal256.py
 pygments/lexers/__init__.py
+pygments/lexers/_asybuiltins.py
 pygments/lexers/_clbuiltins.py
 pygments/lexers/_luabuiltins.py
 pygments/lexers/_mapping.py
@@ -111,6 +112,7 @@ pygments/styles/emacs.py
 pygments/styles/friendly.py
 pygments/styles/fruity.py
 pygments/styles/manni.py
+pygments/styles/monokai.py
 pygments/styles/murphy.py
 pygments/styles/native.py
 pygments/styles/pastie.py
@@ -194,6 +196,7 @@ tests/examplefiles/example.yaml
 tests/examplefiles/example2.aspx
 tests/examplefiles/firefox.mak
 tests/examplefiles/format.ml
+tests/examplefiles/fucked_up.rb
 tests/examplefiles/functional.rst
 tests/examplefiles/genclass.clj
 tests/examplefiles/genshi_example.xml+genshi
@@ -206,6 +209,7 @@ tests/examplefiles/jinjadesignerdoc.rst
 tests/examplefiles/lighttpd_config.conf
 tests/examplefiles/linecontinuation.py
 tests/examplefiles/ltmain.sh
+tests/examplefiles/main.cmake
 tests/examplefiles/matlab_noreturn
 tests/examplefiles/matlab_sample
 tests/examplefiles/matlabsession_sample.txt
@@ -243,6 +247,7 @@ tests/examplefiles/sqlite3.sqlite3-console
 tests/examplefiles/squid.conf
 tests/examplefiles/string_delimiters.d
 tests/examplefiles/test.R
+tests/examplefiles/test.asy
 tests/examplefiles/test.bas
 tests/examplefiles/test.boo
 tests/examplefiles/test.cs
@@ -263,8 +268,8 @@ tests/examplefiles/test.rb
 tests/examplefiles/test.rhtml
 tests/examplefiles/test.tcsh
 tests/examplefiles/test.xsl
+tests/examplefiles/truncated.pytb
 tests/examplefiles/type.lisp
 tests/examplefiles/unicode.applescript
 tests/examplefiles/while.pov
-tests/examplefiles/zmlrpc.f90
-tests/examplefiles/broken/fucked_up.rb
\ No newline at end of file
+tests/examplefiles/zmlrpc.f90
\ No newline at end of file
diff --git a/TODO b/TODO
index 5873d87335f234af5663f856f4fc35726825022a..64827004c95d0443a1605a8d76e845b4087b0573 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,15 +1,10 @@
 Todo
 ====
 
-suggested new lexers
---------------------
-
-* IPython sessions
-* Nemerle
-* PostgreSQL/SQLite
-
-for 1.0
--------
+- suggested new lexers
+  * IPython sessions
+  * PostgreSQL/SQLite
+  * Nemerle
 
 - lexers that need work:
   * review perl lexer (numerous bugs, but so far no one had complaints ;)
index ec31e52a46a3ea74004099e7daaab276cc2233b3..39152b5b8874fabf335d12de95abfd6d1a3cfdd7 100644 (file)
@@ -237,7 +237,7 @@ and return an iterable of tokens. Currently, this only calls
 <dt>def <cite>format(tokens, formatter, outfile=None):</cite></dt>
 <dd>Format a token stream (iterable of tokens) <cite>tokens</cite> with the
 <cite>formatter</cite> (must be a <cite>Formatter</cite> instance). The result is
-written to <cite>outfile</cite>, or if that is <tt class="docutils literal"><span class="pre">None</span></tt>, returned as a
+written to <cite>outfile</cite>, or if that is <tt class="docutils literal">None</tt>, returned as a
 string.</dd>
 <dt>def <cite>highlight(code, lexer, formatter, outfile=None):</cite></dt>
 <dd>This is the most high-level highlighting function.
@@ -339,23 +339,23 @@ available to help with that, see <a class="reference internal" href="#option-pro
 <dt>def <cite>get_tokens(self, text):</cite></dt>
 <dd><p class="first">This method is the basic interface of a lexer. It is called by
 the <cite>highlight()</cite> function. It must process the text and return an
-iterable of <tt class="docutils literal"><span class="pre">(tokentype,</span> <span class="pre">value)</span></tt> pairs from <cite>text</cite>.</p>
+iterable of <tt class="docutils literal">(tokentype, value)</tt> pairs from <cite>text</cite>.</p>
 <p class="last">Normally, you don't need to override this method. The default
 implementation processes the <cite>stripnl</cite>, <cite>stripall</cite> and <cite>tabsize</cite>
 options and then yields all tokens from <cite>get_tokens_unprocessed()</cite>,
-with the <tt class="docutils literal"><span class="pre">index</span></tt> dropped.</p>
+with the <tt class="docutils literal">index</tt> dropped.</p>
 </dd>
 <dt>def <cite>get_tokens_unprocessed(self, text):</cite></dt>
 <dd><p class="first">This method should process the text and return an iterable of
-<tt class="docutils literal"><span class="pre">(index,</span> <span class="pre">tokentype,</span> <span class="pre">value)</span></tt> tuples where <tt class="docutils literal"><span class="pre">index</span></tt> is the starting
+<tt class="docutils literal">(index, tokentype, value)</tt> tuples where <tt class="docutils literal">index</tt> is the starting
 position of the token within the input text.</p>
 <p class="last">This method must be overridden by subclasses.</p>
 </dd>
 <dt>def <cite>analyse_text(text):</cite></dt>
 <dd>A static method which is called for lexer guessing. It should analyse
-the text and return a float in the range from <tt class="docutils literal"><span class="pre">0.0</span></tt> to <tt class="docutils literal"><span class="pre">1.0</span></tt>.
-If it returns <tt class="docutils literal"><span class="pre">0.0</span></tt>, the lexer will not be selected as the most
-probable one, if it returns <tt class="docutils literal"><span class="pre">1.0</span></tt>, it will be selected immediately.</dd>
+the text and return a float in the range from <tt class="docutils literal">0.0</tt> to <tt class="docutils literal">1.0</tt>.
+If it returns <tt class="docutils literal">0.0</tt>, the lexer will not be selected as the most
+probable one, if it returns <tt class="docutils literal">1.0</tt>, it will be selected immediately.</dd>
 </dl>
 <p>For a list of known tokens have a look at the <a class="reference external" href="./tokens.html">Tokens</a> page.</p>
 <p>A lexer also can have the following attributes (in fact, they are mandatory
@@ -435,9 +435,9 @@ the type or value of the argument is not correct.</dd>
 <dd><p class="first">Interpret the key <cite>optname</cite> from the dictionary <cite>options</cite>
 as a boolean and return it. Return <cite>default</cite> if <cite>optname</cite>
 is not in <cite>options</cite>.</p>
-<p class="last">The valid string values for <tt class="docutils literal"><span class="pre">True</span></tt> are <tt class="docutils literal"><span class="pre">1</span></tt>, <tt class="docutils literal"><span class="pre">yes</span></tt>,
-<tt class="docutils literal"><span class="pre">true</span></tt> and <tt class="docutils literal"><span class="pre">on</span></tt>, the ones for <tt class="docutils literal"><span class="pre">False</span></tt> are <tt class="docutils literal"><span class="pre">0</span></tt>,
-<tt class="docutils literal"><span class="pre">no</span></tt>, <tt class="docutils literal"><span class="pre">false</span></tt> and <tt class="docutils literal"><span class="pre">off</span></tt> (matched case-insensitively).</p>
+<p class="last">The valid string values for <tt class="docutils literal">True</tt> are <tt class="docutils literal">1</tt>, <tt class="docutils literal">yes</tt>,
+<tt class="docutils literal">true</tt> and <tt class="docutils literal">on</tt>, the ones for <tt class="docutils literal">False</tt> are <tt class="docutils literal">0</tt>,
+<tt class="docutils literal">no</tt>, <tt class="docutils literal">false</tt> and <tt class="docutils literal">off</tt> (matched case-insensitively).</p>
 </dd>
 <dt>def <cite>get_int_opt(options, optname, default=None):</cite></dt>
 <dd>As <cite>get_bool_opt</cite>, but interpret the value as an integer.</dd>
@@ -453,6 +453,6 @@ or a tuple, it is returned as a list.</dd>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:50.249548
+<!-- generated on: 2010-01-01 20:18:40.254170
      file id: api -->
 </html>
\ No newline at end of file
index d6f796dce4267c90ca280b7cd9894475d6461679..161aa11f98ba5f5964f93ffa162d26f0a5a675ec 100644 (file)
@@ -232,18 +232,22 @@ div.toc h2 {
 <li>Laurent Gautier -- R/S lexer</li>
 <li>Krzysiek Goj -- Scala lexer</li>
 <li>Matt Good -- Genshi, Cheetah lexers</li>
+<li>Olivier Guibe -- Asymptote lexer</li>
 <li>Matthew Harrison -- SVG formatter</li>
 <li>Steven Hazel -- Tcl lexer</li>
+<li>Aslak Hellesøy -- Gherkin lexer</li>
 <li>Varun Hiremath -- Debian control lexer</li>
 <li>Dennis Kaarsemaker -- sources.list lexer</li>
 <li>Marek Kubica -- Scheme lexer</li>
 <li>Jochen Kupperschmidt -- Markdown processor</li>
 <li>Gerd Kurzbach -- Modelica lexer</li>
 <li>Mark Lee -- Vala lexer</li>
+<li>Ben Mabey -- Gherkin lexer</li>
 <li>Kirk McDonald -- D lexer</li>
 <li>Lukas Meuser -- BBCode formatter, Lua lexer</li>
 <li>Paulo Moura -- Logtalk lexer</li>
 <li>Ana Nelson -- Ragel, ANTLR lexers</li>
+<li>Nam T. Nguyen -- Monokai style</li>
 <li>Jesper Noehr -- HTML formatter &quot;anchorlinenos&quot;</li>
 <li>Jonas Obrist -- BBCode lexer</li>
 <li>David Oliva -- Rebol lexer</li>
@@ -251,6 +255,7 @@ div.toc h2 {
 <li>Benjamin Peterson -- Test suite refactoring</li>
 <li>Justin Reidy -- MXML lexer</li>
 <li>Andre Roberge -- Tango style</li>
+<li>Konrad Rudolph -- LaTeX formatter enhancements</li>
 <li>Mario Ruggier -- Evoque lexers</li>
 <li>Stou Sandalski -- NumPy, FORTRAN, tcsh and XSLT lexers</li>
 <li>Matteo Sasso -- Common Lisp lexer</li>
@@ -269,6 +274,6 @@ div.toc h2 {
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:50.740246
+<!-- generated on: 2010-01-01 20:18:40.605987
      file id: authors -->
 </html>
\ No newline at end of file
index aeffcb3f26ef22a5141a81e01603cad0dfca55dc..80fcd7110a9710c7d6d566e5bc3d8a5acd4cee26 100644 (file)
@@ -213,6 +213,8 @@ div.toc h2 {
         <h2>Contents</h2>
         <ul class="contents">
         
+          <li><a href="#version-1-2">Version 1.2</a></li>
+        
           <li><a href="#version-1-1-1">Version 1.1.1</a></li>
         
           <li><a href="#version-1-1">Version 1.1</a></li>
@@ -245,6 +247,35 @@ div.toc h2 {
       </div>
     
     <p>Issue numbers refer to the tracker at <a class="reference external" href="http://dev.pocoo.org/projects/pygments/">http://dev.pocoo.org/projects/pygments/</a>.</p>
+<div class="section" id="version-1-2">
+<h3>Version 1.2</h3>
+<p>(codename Neujahr, released Jan 01, 2010)</p>
+<ul class="simple">
+<li>Dropped Python 2.3 compatibility.</li>
+<li>Lexers added:<ul>
+<li>Asymptote</li>
+<li>Go</li>
+<li>Gherkin (Cucumber)</li>
+<li>CMake</li>
+<li>OOC</li>
+</ul>
+</li>
+<li>Added options for rendering LaTeX in source code comments in the
+LaTeX formatter (#461).</li>
+<li>Updated the Logtalk lexer.</li>
+<li>Added <cite>line_number_start</cite> option to image formatter (#456).</li>
+<li>Added <cite>hl_lines</cite> and <cite>hl_color</cite> options to image formatter (#457).</li>
+<li>Fixed the HtmlFormatter's handling of noclasses=True to not output any
+classes (#427).</li>
+<li>Added the Monokai style (#453).</li>
+<li>Fixed LLVM lexer identifier syntax and added new keywords (#442).</li>
+<li>Fixed the PythonTracebackLexer to handle non-traceback data in header or
+trailer, and support more partial tracebacks that start on line 2 (#437).</li>
+<li>Fixed the CLexer to not highlight ternary statements as labels.</li>
+<li>Fixed lexing of some Ruby quoting peculiarities (#460).</li>
+<li>A few ASM lexer fixes (#450).</li>
+</ul>
+</div>
 <div class="section" id="version-1-1-1">
 <h3>Version 1.1.1</h3>
 <p>(bugfix release, released Sep 15, 2009)</p>
@@ -309,16 +340,16 @@ and the AS3 lexer (#389).</li>
 <h3>Version 1.0</h3>
 <p>(codename Dreiundzwanzig, released Nov 23, 2008)</p>
 <ul>
-<li><p class="first">Don't use join(splitlines()) when converting newlines to <tt class="docutils literal"><span class="pre">\n</span></tt>,
+<li><p class="first">Don't use join(splitlines()) when converting newlines to <tt class="docutils literal">\n</tt>,
 because that doesn't keep all newlines at the end when the
-<tt class="docutils literal"><span class="pre">stripnl</span></tt> lexer option is False.</p>
+<tt class="docutils literal">stripnl</tt> lexer option is False.</p>
 </li>
 <li><p class="first">Add <tt class="docutils literal"><span class="pre">-N</span></tt> option to command-line interface to get a lexer name
 for a given filename.</p>
 </li>
 <li><p class="first">Add Tango style, written by Andre Roberge for the Crunchy project.</p>
 </li>
-<li><p class="first">Add Python3TracebackLexer and <tt class="docutils literal"><span class="pre">python3</span></tt> option to
+<li><p class="first">Add Python3TracebackLexer and <tt class="docutils literal">python3</tt> option to
 PythonConsoleLexer.</p>
 </li>
 <li><p class="first">Fix a few bugs in the Haskell lexer.</p>
@@ -391,7 +422,7 @@ whitespace.</li>
 <li>Vim lexer now highlights hex colors properly and knows a couple
 more keywords.</li>
 <li>Irc logs lexer now handles xchat's default time format (#340) and
-correctly highlights lines ending in <tt class="docutils literal"><span class="pre">&gt;</span></tt>.</li>
+correctly highlights lines ending in <tt class="docutils literal">&gt;</tt>.</li>
 <li>Support more delimiters for perl regular expressions (#258).</li>
 <li>ObjectiveC lexer now supports 2.0 features.</li>
 </ul>
@@ -400,18 +431,18 @@ correctly highlights lines ending in <tt class="docutils literal"><span class="p
 <li>Updated markdown processor to Markdown 1.7.</li>
 <li>Support roman/sans/mono style defs and use them in the LaTeX
 formatter.</li>
-<li>The RawTokenFormatter is no longer registered to <tt class="docutils literal"><span class="pre">*.raw</span></tt> and it's
+<li>The RawTokenFormatter is no longer registered to <tt class="docutils literal">*.raw</tt> and it's
 documented that tokenization with this lexer may raise exceptions.</li>
-<li>New option <tt class="docutils literal"><span class="pre">hl_lines</span></tt> to HTML formatter, to highlight certain
+<li>New option <tt class="docutils literal">hl_lines</tt> to HTML formatter, to highlight certain
 lines.</li>
-<li>New option <tt class="docutils literal"><span class="pre">prestyles</span></tt> to HTML formatter.</li>
+<li>New option <tt class="docutils literal">prestyles</tt> to HTML formatter.</li>
 <li>New option <em>-g</em> to pygmentize, to allow lexer guessing based on
 filetext (can be slowish, so file extensions are still checked
 first).</li>
-<li><tt class="docutils literal"><span class="pre">guess_lexer()</span></tt> now makes its decision much faster due to a cache
+<li><tt class="docutils literal">guess_lexer()</tt> now makes its decision much faster due to a cache
 of whether data is xml-like (a check which is used in several
-versions of <tt class="docutils literal"><span class="pre">analyse_text()</span></tt>.  Several lexers also have more
-accurate <tt class="docutils literal"><span class="pre">analyse_text()</span></tt> now.</li>
+versions of <tt class="docutils literal">analyse_text()</tt>.  Several lexers also have more
+accurate <tt class="docutils literal">analyse_text()</tt> now.</li>
 </ul>
 </div>
 <div class="section" id="version-0-10">
@@ -437,7 +468,7 @@ accurate <tt class="docutils literal"><span class="pre">analyse_text()</span></t
 <li>In the LatexFormatter, the <em>commandprefix</em> option is now by default
 'PY' instead of 'C', since the latter resulted in several collisions
 with other packages.  Also, the special meaning of the <em>arg</em>
-argument to <tt class="docutils literal"><span class="pre">get_style_defs()</span></tt> was removed.</li>
+argument to <tt class="docutils literal">get_style_defs()</tt> was removed.</li>
 <li>Added ImageFormatter, to format code as PNG, JPG, GIF or BMP.
 (Needs the Python Imaging Library.)</li>
 <li>Support doc comments in the PHP lexer.</li>
@@ -489,7 +520,7 @@ don't give an encoding option.</li>
 give options whose values contain commas or equals signs.</li>
 <li>Added 256-color terminal formatter.</li>
 <li>Added an experimental SVG formatter.</li>
-<li>Added the <tt class="docutils literal"><span class="pre">lineanchors</span></tt> option to the HTML formatter, thanks to
+<li>Added the <tt class="docutils literal">lineanchors</tt> option to the HTML formatter, thanks to
 Ian Charnas for the idea.</li>
 <li>Gave the line numbers table a CSS class in the HTML formatter.</li>
 <li>Added a Vim 7-like style.</li>
@@ -520,7 +551,7 @@ Ian Charnas for the idea.</li>
 </ul>
 </li>
 <li>The HTML formatter now has a second line-numbers mode in which it
-will just integrate the numbers in the same <tt class="docutils literal"><span class="pre">&lt;pre&gt;</span></tt> tag as the
+will just integrate the numbers in the same <tt class="docutils literal">&lt;pre&gt;</tt> tag as the
 code.</li>
 <li>The <cite>CSharpLexer</cite> now is Unicode-aware, which means that it has an
 option that can be set so that it correctly lexes Unicode
@@ -628,7 +659,7 @@ argument to generate CSS with multiple prefixes.</li>
 <li>Support for guessing input encoding added.</li>
 <li>Encoding support added: all processing is now done with Unicode
 strings, input and output are converted from and optionally to byte
-strings (see the <tt class="docutils literal"><span class="pre">encoding</span></tt> option of lexers and formatters).</li>
+strings (see the <tt class="docutils literal">encoding</tt> option of lexers and formatters).</li>
 <li>Some improvements in the C(++) lexers handling comments and line
 continuations.</li>
 </ul>
@@ -637,7 +668,7 @@ continuations.</li>
 <h3>Version 0.5.1</h3>
 <p>(released Oct 30, 2006)</p>
 <ul class="simple">
-<li>Fixed traceback in <tt class="docutils literal"><span class="pre">pygmentize</span> <span class="pre">-L</span></tt> (thanks to Piotr Ozarowski).</li>
+<li>Fixed traceback in <tt class="docutils literal">pygmentize <span class="pre">-L</span></tt> (thanks to Piotr Ozarowski).</li>
 </ul>
 </div>
 <div class="section" id="version-0-5">
@@ -650,6 +681,6 @@ continuations.</li>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:50.966655
+<!-- generated on: 2010-01-01 20:18:40.685723
      file id: changelog -->
 </html>
\ No newline at end of file
index 676749b8ddb847246e1dd20d8149855d3cf8e289..c673c3fbe46bc338f14dab50ab0b18749c6b2ab6 100644 (file)
@@ -221,8 +221,6 @@ div.toc h2 {
         
           <li><a href="#getting-help">Getting help</a></li>
         
-          <li><a href="#examples">Examples</a></li>
-        
           <li><a href="#a-note-on-encodings">A note on encodings</a></li>
         
         </ul>
@@ -255,6 +253,11 @@ If no output file name is given and <tt class="docutils literal"><span class="pr
 <pre class="literal-block">
 $ pygmentize -o test.html test.py
 </pre>
+<p>To create a full HTML document, including line numbers and stylesheet (using the
+&quot;emacs&quot; style), highlighting the Python file <tt class="docutils literal">test.py</tt> to <tt class="docutils literal">test.html</tt>:</p>
+<pre class="literal-block">
+$ pygmentize -O full,style=emacs -o test.html test.py
+</pre>
 <div class="section" id="options-and-filters">
 <h3>Options and filters</h3>
 <p>Lexer and formatter options can be given using the <tt class="docutils literal"><span class="pre">-O</span></tt> option:</p>
@@ -262,11 +265,11 @@ $ pygmentize -o test.html test.py
 $ pygmentize -f html -O style=colorful,linenos=1 -l python test.py
 </pre>
 <p>Be sure to enclose the option string in quotes if it contains any special shell
-characters, such as spaces or expansion wildcards like <tt class="docutils literal"><span class="pre">*</span></tt>. If an option
+characters, such as spaces or expansion wildcards like <tt class="docutils literal">*</tt>. If an option
 expects a list value, separate the list entries with spaces (you'll have to
 quote the option value in this case too, so that the shell doesn't split it).</p>
 <p>Since the <tt class="docutils literal"><span class="pre">-O</span></tt> option argument is split at commas and expects the split values
-to be of the form <tt class="docutils literal"><span class="pre">name=value</span></tt>, you can't give an option value that contains
+to be of the form <tt class="docutils literal">name=value</tt>, you can't give an option value that contains
 commas or equals signs.  Therefore, an option <tt class="docutils literal"><span class="pre">-P</span></tt> is provided (as of Pygments
 0.9) that works like <tt class="docutils literal"><span class="pre">-O</span></tt> but can only pass one option per <tt class="docutils literal"><span class="pre">-P</span></tt>. Its value
 can then contain all characters:</p>
@@ -284,7 +287,7 @@ around the colon.</p>
 <div class="section" id="generating-styles">
 <h3>Generating styles</h3>
 <p>Formatters normally don't output full style information.  For example, the HTML
-formatter by default only outputs <tt class="docutils literal"><span class="pre">&lt;span&gt;</span></tt> tags with <tt class="docutils literal"><span class="pre">class</span></tt> attributes.
+formatter by default only outputs <tt class="docutils literal">&lt;span&gt;</tt> tags with <tt class="docutils literal">class</tt> attributes.
 Therefore, there's a special <tt class="docutils literal"><span class="pre">-S</span></tt> option for generating style definitions.
 Usage is as follows:</p>
 <pre class="literal-block">
@@ -302,8 +305,8 @@ the <cite>arg</cite> argument for the formatter's <cite>get_style_defs()</cite>
 <pre class="literal-block">
 $ pygmentize -N setup.py
 </pre>
-<p>will print out <tt class="docutils literal"><span class="pre">python</span></tt>.  It won't highlight anything yet.  If no specific
-lexer is known for that filename, <tt class="docutils literal"><span class="pre">text</span></tt> is printed.</p>
+<p>will print out <tt class="docutils literal">python</tt>.  It won't highlight anything yet.  If no specific
+lexer is known for that filename, <tt class="docutils literal">text</tt> is printed.</p>
 </div>
 <div class="section" id="getting-help">
 <h3>Getting help</h3>
@@ -325,25 +328,17 @@ $ pygmentize -H lexer python
 </pre>
 <p>will print the help for the Python lexer, etc.</p>
 </div>
-<div class="section" id="examples">
-<h3>Examples</h3>
-<p>Create a full HTML document, including line numbers and stylesheet (using the
-&quot;emacs&quot; style), highlighting the Python file <tt class="docutils literal"><span class="pre">setup.py</span></tt> to <tt class="docutils literal"><span class="pre">setup.html</span></tt>:</p>
-<pre class="literal-block">
-$ pygmentize -O full,style=emacs -o setup.html setup.py
-</pre>
-</div>
 <div class="section" id="a-note-on-encodings">
 <h3>A note on encodings</h3>
 <p><em>New in Pygments 0.9.</em></p>
 <p>Pygments tries to be smart regarding encodings in the formatting process:</p>
 <ul class="simple">
-<li>If you give an <tt class="docutils literal"><span class="pre">encoding</span></tt> option, it will be used as the input and
+<li>If you give an <tt class="docutils literal">encoding</tt> option, it will be used as the input and
 output encoding.</li>
-<li>If you give an <tt class="docutils literal"><span class="pre">outencoding</span></tt> option, it will override <tt class="docutils literal"><span class="pre">encoding</span></tt>
+<li>If you give an <tt class="docutils literal">outencoding</tt> option, it will override <tt class="docutils literal">encoding</tt>
 as the output encoding.</li>
 <li>If you don't give an encoding and have given an output file, the default
-encoding for lexer and formatter is <tt class="docutils literal"><span class="pre">latin1</span></tt> (which will pass through
+encoding for lexer and formatter is <tt class="docutils literal">latin1</tt> (which will pass through
 all non-ASCII characters).</li>
 <li>If you don't give an encoding and haven't given an output file (that means
 output is written to the console), the default encoding for lexer and
@@ -353,6 +348,6 @@ formatter is the terminal encoding (<cite>sys.stdout.encoding</cite>).</li>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:51.960944
+<!-- generated on: 2010-01-01 20:18:41.039915
      file id: cmdline -->
 </html>
\ No newline at end of file
index edc07a01f8f0d7e5a8a0bdd45e86e3e3c8d57030..75ff0282a9daa1bc1a59ac9c75b77aa5b628923b 100644 (file)
@@ -277,6 +277,6 @@ decorated function for filtering.</p>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:52.103105
+<!-- generated on: 2010-01-01 20:18:41.126814
      file id: filterdevelopment -->
 </html>
\ No newline at end of file
index 4413aec78f4ffd0bf7abece6ee01ad9b75745ecd..8be21dce9ab0c1a0be31aef743b51662f3202f23 100644 (file)
@@ -242,6 +242,97 @@ iterable for all known filters.</p>
 <p>If you want to write your own filter, have a look at <a class="reference external" href="./filterdevelopment.html">Write your own filter</a>.</p>
 <div class="section" id="builtin-filters">
 <h3>Builtin Filters</h3>
+<p><cite>RaiseOnErrorTokenFilter</cite></p>
+<blockquote>
+<p>Raise an exception when the lexer generates an error token.</p>
+<p>Options accepted:</p>
+<dl class="docutils">
+<dt><cite>excclass</cite> <span class="classifier-delimiter">:</span> <span class="classifier">Exception class</span></dt>
+<dd>The exception class to raise.
+The default is <cite>pygments.filters.ErrorToken</cite>.</dd>
+</dl>
+<p><em>New in Pygments 0.8.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Name:</th><td class="field-body">raiseonerror</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>VisibleWhitespaceFilter</cite></p>
+<blockquote>
+<p>Convert tabs, newlines and/or spaces to visible characters.</p>
+<p>Options accepted:</p>
+<dl class="docutils">
+<dt><cite>spaces</cite> <span class="classifier-delimiter">:</span> <span class="classifier">string or bool</span></dt>
+<dd>If this is a one-character string, spaces will be replaces by this string.
+If it is another true value, spaces will be replaced by <tt class="docutils literal">·</tt> (unicode
+MIDDLE DOT).  If it is a false value, spaces will not be replaced.  The
+default is <tt class="docutils literal">False</tt>.</dd>
+<dt><cite>tabs</cite> <span class="classifier-delimiter">:</span> <span class="classifier">string or bool</span></dt>
+<dd>The same as for <cite>spaces</cite>, but the default replacement character is <tt class="docutils literal">»</tt>
+(unicode RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK).  The default value
+is <tt class="docutils literal">False</tt>.  Note: this will not work if the <cite>tabsize</cite> option for the
+lexer is nonzero, as tabs will already have been expanded then.</dd>
+<dt><cite>tabsize</cite> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
+<dd>If tabs are to be replaced by this filter (see the <cite>tabs</cite> option), this
+is the total number of characters that a tab should be expanded to.
+The default is <tt class="docutils literal">8</tt>.</dd>
+<dt><cite>newlines</cite> <span class="classifier-delimiter">:</span> <span class="classifier">string or bool</span></dt>
+<dd>The same as for <cite>spaces</cite>, but the default replacement character is <tt class="docutils literal">¶</tt>
+(unicode PILCROW SIGN).  The default value is <tt class="docutils literal">False</tt>.</dd>
+<dt><cite>wstokentype</cite> <span class="classifier-delimiter">:</span> <span class="classifier">bool</span></dt>
+<dd>If true, give whitespace the special <cite>Whitespace</cite> token type.  This allows
+styling the visible whitespace differently (e.g. greyed out), but it can
+disrupt background colors.  The default is <tt class="docutils literal">True</tt>.</dd>
+</dl>
+<p><em>New in Pygments 0.8.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Name:</th><td class="field-body">whitespace</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>TokenMergeFilter</cite></p>
+<blockquote>
+<p>Merges consecutive tokens with the same token type in the output stream of a
+lexer.</p>
+<p><em>New in Pygments 1.2.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Name:</th><td class="field-body">tokenmerge</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
+<p><cite>GobbleFilter</cite></p>
+<blockquote>
+<p>Gobbles source code lines (eats initial characters).</p>
+<p>This filter drops the first <tt class="docutils literal">n</tt> characters off every line of code.  This
+may be useful when the source code fed to the lexer is indented by a fixed
+amount of space that isn't desired in the output.</p>
+<p>Options accepted:</p>
+<dl class="docutils">
+<dt><cite>n</cite> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
+<dd>The number of characters to gobble.</dd>
+</dl>
+<p><em>New in Pygments 1.2.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Name:</th><td class="field-body">gobble</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>NameHighlightFilter</cite></p>
 <blockquote>
 <p>Highlight a normal Name token with a different token type.</p>
@@ -280,7 +371,7 @@ used for highlighting the strings in <cite>names</cite>.  The default is
 <dl class="docutils">
 <dt><cite>codetags</cite> <span class="classifier-delimiter">:</span> <span class="classifier">list of strings</span></dt>
 <dd>A list of strings that are flagged as code tags.  The default is to
-highlight <tt class="docutils literal"><span class="pre">XXX</span></tt>, <tt class="docutils literal"><span class="pre">TODO</span></tt>, <tt class="docutils literal"><span class="pre">BUG</span></tt> and <tt class="docutils literal"><span class="pre">NOTE</span></tt>.</dd>
+highlight <tt class="docutils literal">XXX</tt>, <tt class="docutils literal">TODO</tt>, <tt class="docutils literal">BUG</tt> and <tt class="docutils literal">NOTE</tt>.</dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -291,25 +382,6 @@ highlight <tt class="docutils literal"><span class="pre">XXX</span></tt>, <tt cl
 </tbody>
 </table>
 </blockquote>
-<p><cite>RaiseOnErrorTokenFilter</cite></p>
-<blockquote>
-<p>Raise an exception when the lexer generates an error token.</p>
-<p>Options accepted:</p>
-<dl class="docutils">
-<dt><cite>excclass</cite> <span class="classifier-delimiter">:</span> <span class="classifier">Exception class</span></dt>
-<dd>The exception class to raise.
-The default is <cite>pygments.filters.ErrorToken</cite>.</dd>
-</dl>
-<p><em>New in Pygments 0.8.</em></p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field"><th class="field-name">Name:</th><td class="field-body">raiseonerror</td>
-</tr>
-</tbody>
-</table>
-</blockquote>
 <p><cite>KeywordCaseFilter</cite></p>
 <blockquote>
 <p>Convert keywords to lowercase or uppercase or capitalize them, which
@@ -319,8 +391,8 @@ code to your styleguide.</p>
 <p>Options accepted:</p>
 <dl class="docutils">
 <dt><cite>case</cite> <span class="classifier-delimiter">:</span> <span class="classifier">string</span></dt>
-<dd>The casing to convert keywords to. Must be one of <tt class="docutils literal"><span class="pre">'lower'</span></tt>,
-<tt class="docutils literal"><span class="pre">'upper'</span></tt> or <tt class="docutils literal"><span class="pre">'capitalize'</span></tt>.  The default is <tt class="docutils literal"><span class="pre">'lower'</span></tt>.</dd>
+<dd>The casing to convert keywords to. Must be one of <tt class="docutils literal">'lower'</tt>,
+<tt class="docutils literal">'upper'</tt> or <tt class="docutils literal">'capitalize'</tt>.  The default is <tt class="docutils literal">'lower'</tt>.</dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -331,47 +403,10 @@ code to your styleguide.</p>
 </tbody>
 </table>
 </blockquote>
-<p><cite>VisibleWhitespaceFilter</cite></p>
-<blockquote>
-<p>Convert tabs, newlines and/or spaces to visible characters.</p>
-<p>Options accepted:</p>
-<dl class="docutils">
-<dt><cite>spaces</cite> <span class="classifier-delimiter">:</span> <span class="classifier">string or bool</span></dt>
-<dd>If this is a one-character string, spaces will be replaces by this string.
-If it is another true value, spaces will be replaced by <tt class="docutils literal"><span class="pre">·</span></tt> (unicode
-MIDDLE DOT).  If it is a false value, spaces will not be replaced.  The
-default is <tt class="docutils literal"><span class="pre">False</span></tt>.</dd>
-<dt><cite>tabs</cite> <span class="classifier-delimiter">:</span> <span class="classifier">string or bool</span></dt>
-<dd>The same as for <cite>spaces</cite>, but the default replacement character is <tt class="docutils literal"><span class="pre">»</span></tt>
-(unicode RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK).  The default value
-is <tt class="docutils literal"><span class="pre">False</span></tt>.  Note: this will not work if the <cite>tabsize</cite> option for the
-lexer is nonzero, as tabs will already have been expanded then.</dd>
-<dt><cite>tabsize</cite> <span class="classifier-delimiter">:</span> <span class="classifier">int</span></dt>
-<dd>If tabs are to be replaced by this filter (see the <cite>tabs</cite> option), this
-is the total number of characters that a tab should be expanded to.
-The default is <tt class="docutils literal"><span class="pre">8</span></tt>.</dd>
-<dt><cite>newlines</cite> <span class="classifier-delimiter">:</span> <span class="classifier">string or bool</span></dt>
-<dd>The same as for <cite>spaces</cite>, but the default replacement character is <tt class="docutils literal"><span class="pre">¶</span></tt>
-(unicode PILCROW SIGN).  The default value is <tt class="docutils literal"><span class="pre">False</span></tt>.</dd>
-<dt><cite>wstokentype</cite> <span class="classifier-delimiter">:</span> <span class="classifier">bool</span></dt>
-<dd>If true, give whitespace the special <cite>Whitespace</cite> token type.  This allows
-styling the visible whitespace differently (e.g. greyed out), but it can
-disrupt background colors.  The default is <tt class="docutils literal"><span class="pre">True</span></tt>.</dd>
-</dl>
-<p><em>New in Pygments 0.8.</em></p>
-<table class="docutils field-list" frame="void" rules="none">
-<col class="field-name" />
-<col class="field-body" />
-<tbody valign="top">
-<tr class="field"><th class="field-name">Name:</th><td class="field-body">whitespace</td>
-</tr>
-</tbody>
-</table>
-</blockquote>
 </div>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:52.182079
+<!-- generated on: 2010-01-01 20:18:41.186410
      file id: filters -->
 </html>
\ No newline at end of file
index d0a0002e44091deef69e07db4252ec6793f4ecbc..f50ae0444f1a661a381966f77f067cb80ce45b49 100644 (file)
@@ -244,7 +244,7 @@ sends the value of a token to the output stream:</p>
             <span class="n">outfile</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
 </pre></div>
 <p>As you can see, the <cite>format()</cite> method is passed two parameters: <cite>tokensource</cite>
-and <cite>outfile</cite>. The first is an iterable of <tt class="docutils literal"><span class="pre">(token_type,</span> <span class="pre">value)</span></tt> tuples,
+and <cite>outfile</cite>. The first is an iterable of <tt class="docutils literal">(token_type, value)</tt> tuples,
 the latter a file like object with a <cite>write()</cite> method.</p>
 <p>Because the formatter is that basic it doesn't overwrite the <cite>get_style_defs()</cite>
 method.</p>
@@ -253,23 +253,23 @@ method.</p>
 <h3>Styles</h3>
 <p>Styles aren't instantiated but their metaclass provides some class functions
 so that you can access the style definitions easily.</p>
-<p>Styles are iterable and yield tuples in the form <tt class="docutils literal"><span class="pre">(ttype,</span> <span class="pre">d)</span></tt> where <cite>ttype</cite>
+<p>Styles are iterable and yield tuples in the form <tt class="docutils literal">(ttype, d)</tt> where <cite>ttype</cite>
 is a token and <cite>d</cite> is a dict with the following keys:</p>
 <dl class="docutils">
-<dt><tt class="docutils literal"><span class="pre">'color'</span></tt></dt>
-<dd>Hexadecimal color value (eg: <tt class="docutils literal"><span class="pre">'ff0000'</span></tt> for red) or <cite>None</cite> if not
+<dt><tt class="docutils literal">'color'</tt></dt>
+<dd>Hexadecimal color value (eg: <tt class="docutils literal">'ff0000'</tt> for red) or <cite>None</cite> if not
 defined.</dd>
-<dt><tt class="docutils literal"><span class="pre">'bold'</span></tt></dt>
+<dt><tt class="docutils literal">'bold'</tt></dt>
 <dd><cite>True</cite> if the value should be bold</dd>
-<dt><tt class="docutils literal"><span class="pre">'italic'</span></tt></dt>
+<dt><tt class="docutils literal">'italic'</tt></dt>
 <dd><cite>True</cite> if the value should be italic</dd>
-<dt><tt class="docutils literal"><span class="pre">'underline'</span></tt></dt>
+<dt><tt class="docutils literal">'underline'</tt></dt>
 <dd><cite>True</cite> if the value should be underlined</dd>
-<dt><tt class="docutils literal"><span class="pre">'bgcolor'</span></tt></dt>
-<dd>Hexadecimal color value for the background (eg: <tt class="docutils literal"><span class="pre">'eeeeeee'</span></tt> for light
+<dt><tt class="docutils literal">'bgcolor'</tt></dt>
+<dd>Hexadecimal color value for the background (eg: <tt class="docutils literal">'eeeeeee'</tt> for light
 gray) or <cite>None</cite> if not defined.</dd>
-<dt><tt class="docutils literal"><span class="pre">'border'</span></tt></dt>
-<dd>Hexadecimal color value for the border (eg: <tt class="docutils literal"><span class="pre">'0000aa'</span></tt> for a dark
+<dt><tt class="docutils literal">'border'</tt></dt>
+<dd>Hexadecimal color value for the border (eg: <tt class="docutils literal">'0000aa'</tt> for a dark
 blue) or <cite>None</cite> for no border.</dd>
 </dl>
 <p>Additional keys might appear in the future, formatters should ignore all keys
@@ -278,7 +278,7 @@ they don't support.</p>
 <div class="section" id="html-3-2-formatter">
 <h3>HTML 3.2 Formatter</h3>
 <p>For an more complex example, let's implement a HTML 3.2 Formatter. We don't
-use CSS but inline markup (<tt class="docutils literal"><span class="pre">&lt;u&gt;</span></tt>, <tt class="docutils literal"><span class="pre">&lt;font&gt;</span></tt>, etc). Because this isn't good
+use CSS but inline markup (<tt class="docutils literal">&lt;u&gt;</tt>, <tt class="docutils literal">&lt;font&gt;</tt>, etc). Because this isn't good
 style this formatter isn't in the standard library ;-)</p>
 <div class="syntax"><pre><span class="kn">from</span> <span class="nn">pygments.formatter</span> <span class="kn">import</span> <span class="n">Formatter</span>
 
@@ -364,11 +364,11 @@ purpose the <cite>get_style_defs()</cite> method exists:</p>
 output inline markup but reference either macros or css classes. Because
 the definitions of those are not part of the output, the <cite>get_style_defs()</cite>
 method exists. It is passed one parameter (if it's used and how it's used
-is up to the formatter) and has to return a string or <tt class="docutils literal"><span class="pre">None</span></tt>.</p>
+is up to the formatter) and has to return a string or <tt class="docutils literal">None</tt>.</p>
 </div>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:52.412801
+<!-- generated on: 2010-01-01 20:18:41.334111
      file id: formatterdevelopment -->
 </html>
\ No newline at end of file
index 6a64f2df957378ec0032bb595f2b3c477d4f80d7..028685a723c364e82ac1988fcf44672aee37367b 100644 (file)
@@ -230,16 +230,16 @@ div.toc h2 {
 <dd><p class="first"><em>New in Pygments 0.6.</em></p>
 <p>If given, must be an encoding name (such as <tt class="docutils literal"><span class="pre">&quot;utf-8&quot;</span></tt>). This will
 be used to convert the token strings (which are Unicode strings)
-to byte strings in the output (default: <tt class="docutils literal"><span class="pre">None</span></tt>).
+to byte strings in the output (default: <tt class="docutils literal">None</tt>).
 It will also be written in an encoding declaration suitable for the
-document format if the <cite>full</cite> option is given (e.g. a <tt class="docutils literal"><span class="pre">meta</span>
+document format if the <cite>full</cite> option is given (e.g. a <tt class="docutils literal">meta
 <span class="pre">content-type</span></tt> directive in HTML or an invocation of the <cite>inputenc</cite>
 package in LaTeX).</p>
-<p class="last">If this is <tt class="docutils literal"><span class="pre">&quot;&quot;</span></tt> or <tt class="docutils literal"><span class="pre">None</span></tt>, Unicode strings will be written
+<p class="last">If this is <tt class="docutils literal">&quot;&quot;</tt> or <tt class="docutils literal">None</tt>, Unicode strings will be written
 to the output file, which most file-like objects do not support.
 For example, <cite>pygments.highlight()</cite> will return a Unicode string if
 called with no <cite>outfile</cite> argument and a formatter that has <cite>encoding</cite>
-set to <tt class="docutils literal"><span class="pre">None</span></tt> because it uses a <cite>StringIO.StringIO</cite> object that
+set to <tt class="docutils literal">None</tt> because it uses a <cite>StringIO.StringIO</cite> object that
 supports Unicode arguments to <cite>write()</cite>. Using a regular file object
 wouldn't work.</p>
 </dd>
@@ -247,7 +247,7 @@ wouldn't work.</p>
 <dd><p class="first"><em>New in Pygments 0.7.</em></p>
 <p class="last">When using Pygments from the command line, any <cite>encoding</cite> option given is
 passed to the lexer and the formatter. This is sometimes not desirable,
-for example if you want to set the input encoding to <tt class="docutils literal"><span class="pre">&quot;guess&quot;</span></tt>.
+for example if you want to set the input encoding to <tt class="docutils literal">&quot;guess&quot;</tt>.
 Therefore, <cite>outencoding</cite> has been introduced which overrides <cite>encoding</cite>
 for the formatter if given.</p>
 </dd>
@@ -267,19 +267,19 @@ are no common BBcode tags for that.</p>
 <p>Some board systems (e.g. phpBB) don't support colors in their [code] tag,
 so you can't use the highlighting together with that tag.
 Text in a [code] tag usually is shown with a monospace font (which this
-formatter can do with the <tt class="docutils literal"><span class="pre">monofont</span></tt> option) and no spaces (which you
+formatter can do with the <tt class="docutils literal">monofont</tt> option) and no spaces (which you
 need for indentation) are removed.</p>
 <p>Additional options accepted:</p>
 <dl class="docutils">
 <dt><cite>style</cite></dt>
 <dd>The style to use, can be a string or a Style subclass (default:
-<tt class="docutils literal"><span class="pre">'default'</span></tt>).</dd>
+<tt class="docutils literal">'default'</tt>).</dd>
 <dt><cite>codetag</cite></dt>
-<dd>If set to true, put the output into <tt class="docutils literal"><span class="pre">[code]</span></tt> tags (default:
-<tt class="docutils literal"><span class="pre">false</span></tt>)</dd>
+<dd>If set to true, put the output into <tt class="docutils literal">[code]</tt> tags (default:
+<tt class="docutils literal">false</tt>)</dd>
 <dt><cite>monofont</cite></dt>
 <dd>If set to true, add a tag to show the code with a monospace font
-(default: <tt class="docutils literal"><span class="pre">false</span></tt>).</dd>
+(default: <tt class="docutils literal">false</tt>).</dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -334,11 +334,11 @@ suitable <cite>image_format</cite> option to the <cite>ImageFormatter</cite>.)</
 <div class="section" id="htmlformatter">
 <h4><cite>HtmlFormatter</cite></h4>
 <blockquote>
-<p>Format tokens as HTML 4 <tt class="docutils literal"><span class="pre">&lt;span&gt;</span></tt> tags within a <tt class="docutils literal"><span class="pre">&lt;pre&gt;</span></tt> tag, wrapped
-in a <tt class="docutils literal"><span class="pre">&lt;div&gt;</span></tt> tag. The <tt class="docutils literal"><span class="pre">&lt;div&gt;</span></tt>'s CSS class can be set by the <cite>cssclass</cite>
+<p>Format tokens as HTML 4 <tt class="docutils literal">&lt;span&gt;</tt> tags within a <tt class="docutils literal">&lt;pre&gt;</tt> tag, wrapped
+in a <tt class="docutils literal">&lt;div&gt;</tt> tag. The <tt class="docutils literal">&lt;div&gt;</tt>'s CSS class can be set by the <cite>cssclass</cite>
 option.</p>
-<p>If the <cite>linenos</cite> option is set to <tt class="docutils literal"><span class="pre">&quot;table&quot;</span></tt>, the <tt class="docutils literal"><span class="pre">&lt;pre&gt;</span></tt> is
-additionally wrapped inside a <tt class="docutils literal"><span class="pre">&lt;table&gt;</span></tt> which has one row and two
+<p>If the <cite>linenos</cite> option is set to <tt class="docutils literal">&quot;table&quot;</tt>, the <tt class="docutils literal">&lt;pre&gt;</tt> is
+additionally wrapped inside a <tt class="docutils literal">&lt;table&gt;</tt> which has one row and two
 cells: one containing the line numbers and one containing the code.
 Example:</p>
 <div class="syntax"><pre><span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">&quot;highlight&quot;</span> <span class="nt">&gt;</span>
@@ -361,7 +361,7 @@ Example:</p>
 <p>A list of lines can be specified using the <cite>hl_lines</cite> option to make these
 lines highlighted (as of Pygments 0.11).</p>
 <p>With the <cite>full</cite> option, a complete HTML 4 document is output, including
-the style definitions inside a <tt class="docutils literal"><span class="pre">&lt;style&gt;</span></tt> tag, or in a separate file if
+the style definitions inside a <tt class="docutils literal">&lt;style&gt;</tt> tag, or in a separate file if
 the <cite>cssfile</cite> option is given.</p>
 <p>The <cite>get_style_defs(arg='')</cite> method of a <cite>HtmlFormatter</cite> returns a string
 containing CSS rules for the CSS classes used by the formatter. The
@@ -386,23 +386,23 @@ would result in the following CSS classes:</p>
 <p>Additional options accepted:</p>
 <dl class="docutils">
 <dt><cite>nowrap</cite></dt>
-<dd>If set to <tt class="docutils literal"><span class="pre">True</span></tt>, don't wrap the tokens at all, not even inside a <tt class="docutils literal"><span class="pre">&lt;pre&gt;</span></tt>
-tag. This disables most other options (default: <tt class="docutils literal"><span class="pre">False</span></tt>).</dd>
+<dd>If set to <tt class="docutils literal">True</tt>, don't wrap the tokens at all, not even inside a <tt class="docutils literal">&lt;pre&gt;</tt>
+tag. This disables most other options (default: <tt class="docutils literal">False</tt>).</dd>
 <dt><cite>full</cite></dt>
 <dd>Tells the formatter to output a &quot;full&quot; document, i.e. a complete
-self-contained document (default: <tt class="docutils literal"><span class="pre">False</span></tt>).</dd>
+self-contained document (default: <tt class="docutils literal">False</tt>).</dd>
 <dt><cite>title</cite></dt>
 <dd>If <cite>full</cite> is true, the title that should be used to caption the
-document (default: <tt class="docutils literal"><span class="pre">''</span></tt>).</dd>
+document (default: <tt class="docutils literal">''</tt>).</dd>
 <dt><cite>style</cite></dt>
 <dd>The style to use, can be a string or a Style subclass (default:
-<tt class="docutils literal"><span class="pre">'default'</span></tt>). This option has no effect if the <cite>cssfile</cite>
+<tt class="docutils literal">'default'</tt>). This option has no effect if the <cite>cssfile</cite>
 and <cite>noclobber_cssfile</cite> option are given and the file specified in
 <cite>cssfile</cite> exists.</dd>
 <dt><cite>noclasses</cite></dt>
-<dd>If set to true, token <tt class="docutils literal"><span class="pre">&lt;span&gt;</span></tt> tags will not use CSS classes, but
+<dd>If set to true, token <tt class="docutils literal">&lt;span&gt;</tt> tags will not use CSS classes, but
 inline styles. This is not recommended for larger pieces of code since
-it increases output size by quite a bit (default: <tt class="docutils literal"><span class="pre">False</span></tt>).</dd>
+it increases output size by quite a bit (default: <tt class="docutils literal">False</tt>).</dd>
 <dt><cite>classprefix</cite></dt>
 <dd>Since the token types use relatively short class names, they may clash
 with some of your own class names. In this case you can use the
@@ -410,17 +410,17 @@ with some of your own class names. In this case you can use the
 CSS class names for token types.
 Note that this option also affects the output of <cite>get_style_defs()</cite>.</dd>
 <dt><cite>cssclass</cite></dt>
-<dd><p class="first">CSS class for the wrapping <tt class="docutils literal"><span class="pre">&lt;div&gt;</span></tt> tag (default: <tt class="docutils literal"><span class="pre">'highlight'</span></tt>).
+<dd><p class="first">CSS class for the wrapping <tt class="docutils literal">&lt;div&gt;</tt> tag (default: <tt class="docutils literal">'highlight'</tt>).
 If you set this option, the default selector for <cite>get_style_defs()</cite>
 will be this class.</p>
-<p class="last"><em>New in Pygments 0.9:</em> If you select the <tt class="docutils literal"><span class="pre">'table'</span></tt> line numbers, the
-wrapping table will have a CSS class of this string plus <tt class="docutils literal"><span class="pre">'table'</span></tt>,
-the default is accordingly <tt class="docutils literal"><span class="pre">'highlighttable'</span></tt>.</p>
+<p class="last"><em>New in Pygments 0.9:</em> If you select the <tt class="docutils literal">'table'</tt> line numbers, the
+wrapping table will have a CSS class of this string plus <tt class="docutils literal">'table'</tt>,
+the default is accordingly <tt class="docutils literal">'highlighttable'</tt>.</p>
 </dd>
 <dt><cite>cssstyles</cite></dt>
-<dd>Inline CSS styles for the wrapping <tt class="docutils literal"><span class="pre">&lt;div&gt;</span></tt> tag (default: <tt class="docutils literal"><span class="pre">''</span></tt>).</dd>
+<dd>Inline CSS styles for the wrapping <tt class="docutils literal">&lt;div&gt;</tt> tag (default: <tt class="docutils literal">''</tt>).</dd>
 <dt><cite>prestyles</cite></dt>
-<dd>Inline CSS styles for the <tt class="docutils literal"><span class="pre">&lt;pre&gt;</span></tt> tag (default: <tt class="docutils literal"><span class="pre">''</span></tt>).  <em>New in
+<dd>Inline CSS styles for the <tt class="docutils literal">&lt;pre&gt;</tt> tag (default: <tt class="docutils literal">''</tt>).  <em>New in
 Pygments 0.11.</em></dd>
 <dt><cite>cssfile</cite></dt>
 <dd>If the <cite>full</cite> option is true and this option is given, it must be the
@@ -431,48 +431,48 @@ to this file instead of the HTML file. <em>New in Pygments 0.6.</em></dd>
 <dt><cite>noclobber_cssfile</cite></dt>
 <dd>If <cite>cssfile</cite> is given and the specified file exists, the css file will
 not be overwritten. This allows the use of the <cite>full</cite> option in
-combination with a user specified css file. Default is <tt class="docutils literal"><span class="pre">False</span></tt>.
+combination with a user specified css file. Default is <tt class="docutils literal">False</tt>.
 <em>New in Pygments 1.1.</em></dd>
 <dt><cite>linenos</cite></dt>
-<dd><p class="first">If set to <tt class="docutils literal"><span class="pre">'table'</span></tt>, output line numbers as a table with two cells,
+<dd><p class="first">If set to <tt class="docutils literal">'table'</tt>, output line numbers as a table with two cells,
 one containing the line numbers, the other the whole code.  This is
 copy-and-paste-friendly, but may cause alignment problems with some
-browsers or fonts.  If set to <tt class="docutils literal"><span class="pre">'inline'</span></tt>, the line numbers will be
-integrated in the <tt class="docutils literal"><span class="pre">&lt;pre&gt;</span></tt> tag that contains the code (that setting
+browsers or fonts.  If set to <tt class="docutils literal">'inline'</tt>, the line numbers will be
+integrated in the <tt class="docutils literal">&lt;pre&gt;</tt> tag that contains the code (that setting
 is <em>new in Pygments 0.8</em>).</p>
 <p>For compatibility with Pygments 0.7 and earlier, every true value
-except <tt class="docutils literal"><span class="pre">'inline'</span></tt> means the same as <tt class="docutils literal"><span class="pre">'table'</span></tt> (in particular, that
-means also <tt class="docutils literal"><span class="pre">True</span></tt>).</p>
-<p>The default value is <tt class="docutils literal"><span class="pre">False</span></tt>, which means no line numbers at all.</p>
+except <tt class="docutils literal">'inline'</tt> means the same as <tt class="docutils literal">'table'</tt> (in particular, that
+means also <tt class="docutils literal">True</tt>).</p>
+<p>The default value is <tt class="docutils literal">False</tt>, which means no line numbers at all.</p>
 <p class="last"><strong>Note:</strong> with the default (&quot;table&quot;) line number mechanism, the line
 numbers and code can have different line heights in Internet Explorer
-unless you give the enclosing <tt class="docutils literal"><span class="pre">&lt;pre&gt;</span></tt> tags an explicit <tt class="docutils literal"><span class="pre">line-height</span></tt>
+unless you give the enclosing <tt class="docutils literal">&lt;pre&gt;</tt> tags an explicit <tt class="docutils literal"><span class="pre">line-height</span></tt>
 CSS property (you get the default line spacing with <tt class="docutils literal"><span class="pre">line-height:</span>
-<span class="pre">125%</span></tt>).</p>
+125%</tt>).</p>
 </dd>
 <dt><cite>hl_lines</cite></dt>
 <dd>Specify a list of lines to be highlighted.  <em>New in Pygments 0.11.</em></dd>
 <dt><cite>linenostart</cite></dt>
-<dd>The line number for the first line (default: <tt class="docutils literal"><span class="pre">1</span></tt>).</dd>
+<dd>The line number for the first line (default: <tt class="docutils literal">1</tt>).</dd>
 <dt><cite>linenostep</cite></dt>
 <dd>If set to a number n &gt; 1, only every nth line number is printed.</dd>
 <dt><cite>linenospecial</cite></dt>
 <dd>If set to a number n &gt; 0, every nth line number is given the CSS
-class <tt class="docutils literal"><span class="pre">&quot;special&quot;</span></tt> (default: <tt class="docutils literal"><span class="pre">0</span></tt>).</dd>
+class <tt class="docutils literal">&quot;special&quot;</tt> (default: <tt class="docutils literal">0</tt>).</dd>
 <dt><cite>nobackground</cite></dt>
-<dd>If set to <tt class="docutils literal"><span class="pre">True</span></tt>, the formatter won't output the background color
-for the wrapping element (this automatically defaults to <tt class="docutils literal"><span class="pre">False</span></tt>
+<dd>If set to <tt class="docutils literal">True</tt>, the formatter won't output the background color
+for the wrapping element (this automatically defaults to <tt class="docutils literal">False</tt>
 when there is no wrapping element [eg: no argument for the
-<cite>get_syntax_defs</cite> method given]) (default: <tt class="docutils literal"><span class="pre">False</span></tt>). <em>New in
+<cite>get_syntax_defs</cite> method given]) (default: <tt class="docutils literal">False</tt>). <em>New in
 Pygments 0.6.</em></dd>
 <dt><cite>lineseparator</cite></dt>
-<dd>This string is output between lines of code. It defaults to <tt class="docutils literal"><span class="pre">&quot;\n&quot;</span></tt>,
-which is enough to break a line inside <tt class="docutils literal"><span class="pre">&lt;pre&gt;</span></tt> tags, but you can
-e.g. set it to <tt class="docutils literal"><span class="pre">&quot;&lt;br&gt;&quot;</span></tt> to get HTML line breaks. <em>New in Pygments
+<dd>This string is output between lines of code. It defaults to <tt class="docutils literal">&quot;\n&quot;</tt>,
+which is enough to break a line inside <tt class="docutils literal">&lt;pre&gt;</tt> tags, but you can
+e.g. set it to <tt class="docutils literal">&quot;&lt;br&gt;&quot;</tt> to get HTML line breaks. <em>New in Pygments
 0.7.</em></dd>
 <dt><cite>lineanchors</cite></dt>
-<dd>If set to a nonempty string, e.g. <tt class="docutils literal"><span class="pre">foo</span></tt>, the formatter will wrap each
-output line in an anchor tag with a <tt class="docutils literal"><span class="pre">name</span></tt> of <tt class="docutils literal"><span class="pre">foo-linenumber</span></tt>.
+<dd>If set to a nonempty string, e.g. <tt class="docutils literal">foo</tt>, the formatter will wrap each
+output line in an anchor tag with a <tt class="docutils literal">name</tt> of <tt class="docutils literal"><span class="pre">foo-linenumber</span></tt>.
 This allows easy linking to certain lines. <em>New in Pygments 0.9.</em></dd>
 <dt><cite>anchorlinenos</cite></dt>
 <dd>If set to <cite>True</cite>, will wrap line numbers in &lt;a&gt; tags. Used in
@@ -482,19 +482,19 @@ combination with <cite>linenos</cite> and <cite>lineanchors</cite>.</dd>
 <p><em>New in Pygments 0.7.</em></p>
 <p>The HTML formatter is now built in a way that allows easy subclassing, thus
 customizing the output HTML code. The <cite>format()</cite> method calls
-<cite>self._format_lines()</cite> which returns a generator that yields tuples of <tt class="docutils literal"><span class="pre">(1,</span>
-<span class="pre">line)</span></tt>, where the <tt class="docutils literal"><span class="pre">1</span></tt> indicates that the <tt class="docutils literal"><span class="pre">line</span></tt> is a line of the
+<cite>self._format_lines()</cite> which returns a generator that yields tuples of <tt class="docutils literal">(1,
+line)</tt>, where the <tt class="docutils literal">1</tt> indicates that the <tt class="docutils literal">line</tt> is a line of the
 formatted source code.</p>
 <p>If the <cite>nowrap</cite> option is set, the generator is the iterated over and the
 resulting HTML is output.</p>
 <p>Otherwise, <cite>format()</cite> calls <cite>self.wrap()</cite>, which wraps the generator with
 other generators. These may add some HTML code to the one generated by
 <cite>_format_lines()</cite>, either by modifying the lines generated by the latter,
-then yielding them again with <tt class="docutils literal"><span class="pre">(1,</span> <span class="pre">line)</span></tt>, and/or by yielding other HTML
-code before or after the lines, with <tt class="docutils literal"><span class="pre">(0,</span> <span class="pre">html)</span></tt>. The distinction between
+then yielding them again with <tt class="docutils literal">(1, line)</tt>, and/or by yielding other HTML
+code before or after the lines, with <tt class="docutils literal">(0, html)</tt>. The distinction between
 source lines and other code makes it possible to wrap the generator multiple
 times.</p>
-<p>The default <cite>wrap()</cite> implementation adds a <tt class="docutils literal"><span class="pre">&lt;div&gt;</span></tt> and a <tt class="docutils literal"><span class="pre">&lt;pre&gt;</span></tt> tag.</p>
+<p>The default <cite>wrap()</cite> implementation adds a <tt class="docutils literal">&lt;div&gt;</tt> and a <tt class="docutils literal">&lt;pre&gt;</tt> tag.</p>
 <p>A custom <cite>HtmlFormatter</cite> subclass could look like this:</p>
 <div class="syntax"><pre><span class="k">class</span> <span class="nc">CodeHtmlFormatter</span><span class="p">(</span><span class="n">HtmlFormatter</span><span class="p">):</span>
 
@@ -510,8 +510,8 @@ times.</p>
             <span class="k">yield</span> <span class="n">i</span><span class="p">,</span> <span class="n">t</span>
         <span class="k">yield</span> <span class="mi">0</span><span class="p">,</span> <span class="s">&#39;&lt;/code&gt;&#39;</span>
 </pre></div>
-<p>This results in wrapping the formatted lines with a <tt class="docutils literal"><span class="pre">&lt;code&gt;</span></tt> tag, where the
-source lines are broken using <tt class="docutils literal"><span class="pre">&lt;br&gt;</span></tt> tags.</p>
+<p>This results in wrapping the formatted lines with a <tt class="docutils literal">&lt;code&gt;</tt> tag, where the
+source lines are broken using <tt class="docutils literal">&lt;br&gt;</tt> tags.</p>
 <p>After calling <cite>wrap()</cite>, the <cite>format()</cite> method also adds the &quot;line numbers&quot;
 and/or &quot;full document&quot; wrappers if the respective options are set. Then, all
 HTML yielded by the wrapped generator is output.</p>
@@ -566,6 +566,10 @@ monospace font to look sane.</p>
 <dd><p class="first">Whether line numbers should be shown: True/False</p>
 <p class="last">Default: True</p>
 </dd>
+<dt><cite>line_number_start</cite></dt>
+<dd><p class="first">The line number of the first line.</p>
+<p class="last">Default: 1</p>
+</dd>
 <dt><cite>line_number_step</cite></dt>
 <dd><p class="first">The step used when printing line numbers.</p>
 <p class="last">Default: 1</p>
@@ -602,6 +606,14 @@ source code area: True/False</p>
 the source code area.</p>
 <p class="last">Default: 6</p>
 </dd>
+<dt><cite>hl_lines</cite></dt>
+<dd><p class="first">Specify a list of lines to be highlighted.  <em>New in Pygments 1.2.</em></p>
+<p class="last">Default: empty list</p>
+</dd>
+<dt><cite>hl_color</cite></dt>
+<dd><p class="first">Specify the color for highlighting lines.  <em>New in Pygments 1.2.</em></p>
+<p class="last">Default: highlight color of the selected style</p>
+</dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -639,52 +651,60 @@ suitable <cite>image_format</cite> option to the <cite>ImageFormatter</cite>.)</
 <blockquote>
 <p>Format tokens as LaTeX code. This needs the <cite>fancyvrb</cite> and <cite>color</cite>
 standard packages.</p>
-<p>Without the <cite>full</cite> option, code is formatted as one <tt class="docutils literal"><span class="pre">Verbatim</span></tt>
+<p>Without the <cite>full</cite> option, code is formatted as one <tt class="docutils literal">Verbatim</tt>
 environment, like this:</p>
 <div class="syntax"><pre><span class="k">\begin</span><span class="nb">{</span>Verbatim<span class="nb">}</span>[commandchars=@<span class="sb">\[</span><span class="s">\]</span>]
 @PY[k][def ]@PY[n+nf][foo](@PY[n][bar]):
     @PY[k][pass]
 <span class="k">\end</span><span class="nb">{</span>Verbatim<span class="nb">}</span>
 </pre></div>
-<p>The special command used here (<tt class="docutils literal"><span class="pre">&#64;PY</span></tt>) and all the other macros it needs
+<p>The special command used here (<tt class="docutils literal">&#64;PY</tt>) and all the other macros it needs
 are output by the <cite>get_style_defs</cite> method.</p>
 <p>With the <cite>full</cite> option, a complete LaTeX document is output, including
 the command definitions in the preamble.</p>
 <p>The <cite>get_style_defs()</cite> method of a <cite>LatexFormatter</cite> returns a string
-containing <tt class="docutils literal"><span class="pre">\def</span></tt> commands defining the macros needed inside the
-<tt class="docutils literal"><span class="pre">Verbatim</span></tt> environments.</p>
+containing <tt class="docutils literal">\def</tt> commands defining the macros needed inside the
+<tt class="docutils literal">Verbatim</tt> environments.</p>
 <p>Additional options accepted:</p>
 <dl class="docutils">
 <dt><cite>style</cite></dt>
 <dd>The style to use, can be a string or a Style subclass (default:
-<tt class="docutils literal"><span class="pre">'default'</span></tt>).</dd>
+<tt class="docutils literal">'default'</tt>).</dd>
 <dt><cite>full</cite></dt>
 <dd>Tells the formatter to output a &quot;full&quot; document, i.e. a complete
-self-contained document (default: <tt class="docutils literal"><span class="pre">False</span></tt>).</dd>
+self-contained document (default: <tt class="docutils literal">False</tt>).</dd>
 <dt><cite>title</cite></dt>
 <dd>If <cite>full</cite> is true, the title that should be used to caption the
-document (default: <tt class="docutils literal"><span class="pre">''</span></tt>).</dd>
+document (default: <tt class="docutils literal">''</tt>).</dd>
 <dt><cite>docclass</cite></dt>
 <dd>If the <cite>full</cite> option is enabled, this is the document class to use
-(default: <tt class="docutils literal"><span class="pre">'article'</span></tt>).</dd>
+(default: <tt class="docutils literal">'article'</tt>).</dd>
 <dt><cite>preamble</cite></dt>
 <dd>If the <cite>full</cite> option is enabled, this can be further preamble commands,
-e.g. <tt class="docutils literal"><span class="pre">\usepackage</span></tt> (default: <tt class="docutils literal"><span class="pre">''</span></tt>).</dd>
+e.g. <tt class="docutils literal">\usepackage</tt> (default: <tt class="docutils literal">''</tt>).</dd>
 <dt><cite>linenos</cite></dt>
-<dd>If set to <tt class="docutils literal"><span class="pre">True</span></tt>, output line numbers (default: <tt class="docutils literal"><span class="pre">False</span></tt>).</dd>
+<dd>If set to <tt class="docutils literal">True</tt>, output line numbers (default: <tt class="docutils literal">False</tt>).</dd>
 <dt><cite>linenostart</cite></dt>
-<dd>The line number for the first line (default: <tt class="docutils literal"><span class="pre">1</span></tt>).</dd>
+<dd>The line number for the first line (default: <tt class="docutils literal">1</tt>).</dd>
 <dt><cite>linenostep</cite></dt>
 <dd>If set to a number n &gt; 1, only every nth line number is printed.</dd>
 <dt><cite>verboptions</cite></dt>
 <dd>Additional options given to the Verbatim environment (see the <em>fancyvrb</em>
-docs for possible values) (default: <tt class="docutils literal"><span class="pre">''</span></tt>).</dd>
+docs for possible values) (default: <tt class="docutils literal">''</tt>).</dd>
 <dt><cite>commandprefix</cite></dt>
 <dd><p class="first">The LaTeX commands used to produce colored output are constructed
-using this prefix and some letters (default: <tt class="docutils literal"><span class="pre">'PY'</span></tt>).
+using this prefix and some letters (default: <tt class="docutils literal">'PY'</tt>).
 <em>New in Pygments 0.7.</em></p>
-<p class="last"><em>New in Pygments 0.10:</em> the default is now <tt class="docutils literal"><span class="pre">'PY'</span></tt> instead of <tt class="docutils literal"><span class="pre">'C'</span></tt>.</p>
+<p class="last"><em>New in Pygments 0.10:</em> the default is now <tt class="docutils literal">'PY'</tt> instead of <tt class="docutils literal">'C'</tt>.</p>
 </dd>
+<dt><cite>texcomments</cite></dt>
+<dd>If set to <tt class="docutils literal">True</tt>, enables LaTeX comment lines.  That is, LaTex markup
+in comment tokens is not escaped so that LaTeX can render it (default:
+<tt class="docutils literal">False</tt>).  <em>New in Pygments 1.2.</em></dd>
+<dt><cite>mathescape</cite></dt>
+<dd>If set to <tt class="docutils literal">True</tt>, enables LaTeX math mode escape in comments. That
+is, <tt class="docutils literal"><span class="pre">'$...$'</span></tt> inside a comment will trigger math mode (default:
+<tt class="docutils literal">False</tt>).  <em>New in Pygments 1.2.</em></dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -724,11 +744,11 @@ be converted to a token stream with the <cite>RawTokenLexer</cite>, described in
 <p>Only two options are accepted:</p>
 <dl class="docutils">
 <dt><cite>compress</cite></dt>
-<dd>If set to <tt class="docutils literal"><span class="pre">'gz'</span></tt> or <tt class="docutils literal"><span class="pre">'bz2'</span></tt>, compress the output with the given
-compression algorithm after encoding (default: <tt class="docutils literal"><span class="pre">''</span></tt>).</dd>
+<dd>If set to <tt class="docutils literal">'gz'</tt> or <tt class="docutils literal">'bz2'</tt>, compress the output with the given
+compression algorithm after encoding (default: <tt class="docutils literal">''</tt>).</dd>
 <dt><cite>error_color</cite></dt>
 <dd>If set to a color name, highlight error tokens using that color.  If
-set but with no value, defaults to <tt class="docutils literal"><span class="pre">'red'</span></tt>.
+set but with no value, defaults to <tt class="docutils literal">'red'</tt>.
 <em>New in Pygments 0.11.</em></dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
@@ -754,9 +774,9 @@ Paste into Microsoft® Word® documents.</p>
 <dl class="docutils">
 <dt><cite>style</cite></dt>
 <dd>The style to use, can be a string or a Style subclass (default:
-<tt class="docutils literal"><span class="pre">'default'</span></tt>).</dd>
+<tt class="docutils literal">'default'</tt>).</dd>
 <dt><cite>fontface</cite></dt>
-<dd>The used font famliy, for example <tt class="docutils literal"><span class="pre">Bitstream</span> <span class="pre">Vera</span> <span class="pre">Sans</span></tt>. Defaults to
+<dd>The used font famliy, for example <tt class="docutils literal">Bitstream Vera Sans</tt>. Defaults to
 some generic font which is supposed to have fixed width.</dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
@@ -775,40 +795,40 @@ some generic font which is supposed to have fixed width.</dd>
 <h4><cite>SvgFormatter</cite></h4>
 <blockquote>
 <p>Format tokens as an SVG graphics file.  This formatter is still experimental.
-Each line of code is a <tt class="docutils literal"><span class="pre">&lt;text&gt;</span></tt> element with explicit <tt class="docutils literal"><span class="pre">x</span></tt> and <tt class="docutils literal"><span class="pre">y</span></tt>
-coordinates containing <tt class="docutils literal"><span class="pre">&lt;tspan&gt;</span></tt> elements with the individual token styles.</p>
+Each line of code is a <tt class="docutils literal">&lt;text&gt;</tt> element with explicit <tt class="docutils literal">x</tt> and <tt class="docutils literal">y</tt>
+coordinates containing <tt class="docutils literal">&lt;tspan&gt;</tt> elements with the individual token styles.</p>
 <p>By default, this formatter outputs a full SVG document including doctype
-declaration and the <tt class="docutils literal"><span class="pre">&lt;svg&gt;</span></tt> root element.</p>
+declaration and the <tt class="docutils literal">&lt;svg&gt;</tt> root element.</p>
 <p><em>New in Pygments 0.9.</em></p>
 <p>Additional options accepted:</p>
 <dl class="docutils">
 <dt><cite>nowrap</cite></dt>
-<dd>Don't wrap the SVG <tt class="docutils literal"><span class="pre">&lt;text&gt;</span></tt> elements in <tt class="docutils literal"><span class="pre">&lt;svg&gt;&lt;g&gt;</span></tt> elements and
+<dd>Don't wrap the SVG <tt class="docutils literal">&lt;text&gt;</tt> elements in <tt class="docutils literal"><span class="pre">&lt;svg&gt;&lt;g&gt;</span></tt> elements and
 don't add a XML declaration and a doctype.  If true, the <cite>fontfamily</cite>
-and <cite>fontsize</cite> options are ignored.  Defaults to <tt class="docutils literal"><span class="pre">False</span></tt>.</dd>
+and <cite>fontsize</cite> options are ignored.  Defaults to <tt class="docutils literal">False</tt>.</dd>
 <dt><cite>fontfamily</cite></dt>
-<dd>The value to give the wrapping <tt class="docutils literal"><span class="pre">&lt;g&gt;</span></tt> element's <tt class="docutils literal"><span class="pre">font-family</span></tt>
-attribute, defaults to <tt class="docutils literal"><span class="pre">&quot;monospace&quot;</span></tt>.</dd>
+<dd>The value to give the wrapping <tt class="docutils literal">&lt;g&gt;</tt> element's <tt class="docutils literal"><span class="pre">font-family</span></tt>
+attribute, defaults to <tt class="docutils literal">&quot;monospace&quot;</tt>.</dd>
 <dt><cite>fontsize</cite></dt>
-<dd>The value to give the wrapping <tt class="docutils literal"><span class="pre">&lt;g&gt;</span></tt> element's <tt class="docutils literal"><span class="pre">font-size</span></tt>
-attribute, defaults to <tt class="docutils literal"><span class="pre">&quot;14px&quot;</span></tt>.</dd>
+<dd>The value to give the wrapping <tt class="docutils literal">&lt;g&gt;</tt> element's <tt class="docutils literal"><span class="pre">font-size</span></tt>
+attribute, defaults to <tt class="docutils literal">&quot;14px&quot;</tt>.</dd>
 <dt><cite>xoffset</cite></dt>
-<dd>Starting offset in X direction, defaults to <tt class="docutils literal"><span class="pre">0</span></tt>.</dd>
+<dd>Starting offset in X direction, defaults to <tt class="docutils literal">0</tt>.</dd>
 <dt><cite>yoffset</cite></dt>
 <dd>Starting offset in Y direction, defaults to the font size if it is given
-in pixels, or <tt class="docutils literal"><span class="pre">20</span></tt> else.  (This is necessary since text coordinates
+in pixels, or <tt class="docutils literal">20</tt> else.  (This is necessary since text coordinates
 refer to the text baseline, not the top edge.)</dd>
 <dt><cite>ystep</cite></dt>
 <dd>Offset to add to the Y coordinate for each subsequent line.  This should
 roughly be the text size plus 5.  It defaults to that value if the text
-size is given in pixels, or <tt class="docutils literal"><span class="pre">25</span></tt> else.</dd>
+size is given in pixels, or <tt class="docutils literal">25</tt> else.</dd>
 <dt><cite>spacehack</cite></dt>
-<dd>Convert spaces in the source to <tt class="docutils literal"><span class="pre">&amp;#160;</span></tt>, which are non-breaking
-spaces.  SVG provides the <tt class="docutils literal"><span class="pre">xml:space</span></tt> attribute to control how
-whitespace inside tags is handled, in theory, the <tt class="docutils literal"><span class="pre">preserve</span></tt> value
+<dd>Convert spaces in the source to <tt class="docutils literal">&amp;#160;</tt>, which are non-breaking
+spaces.  SVG provides the <tt class="docutils literal">xml:space</tt> attribute to control how
+whitespace inside tags is handled, in theory, the <tt class="docutils literal">preserve</tt> value
 could be used to keep all whitespace as-is.  However, many current SVG
 viewers don't obey that rule, so this option is provided as a workaround
-and defaults to <tt class="docutils literal"><span class="pre">True</span></tt>.</dd>
+and defaults to <tt class="docutils literal">True</tt>.</dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -836,7 +856,7 @@ underline attributes from the style are preserved (and displayed).</p>
 <dl class="docutils">
 <dt><cite>style</cite></dt>
 <dd>The style to use, can be a string or a Style subclass (default:
-<tt class="docutils literal"><span class="pre">'default'</span></tt>).</dd>
+<tt class="docutils literal">'default'</tt>).</dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -861,11 +881,11 @@ no support for common styles.</p>
 <p>Options accepted:</p>
 <dl class="docutils">
 <dt><cite>bg</cite></dt>
-<dd>Set to <tt class="docutils literal"><span class="pre">&quot;light&quot;</span></tt> or <tt class="docutils literal"><span class="pre">&quot;dark&quot;</span></tt> depending on the terminal's background
-(default: <tt class="docutils literal"><span class="pre">&quot;light&quot;</span></tt>).</dd>
+<dd>Set to <tt class="docutils literal">&quot;light&quot;</tt> or <tt class="docutils literal">&quot;dark&quot;</tt> depending on the terminal's background
+(default: <tt class="docutils literal">&quot;light&quot;</tt>).</dd>
 <dt><cite>colorscheme</cite></dt>
 <dd>A dictionary mapping token types to (lightbg, darkbg) color names or
-<tt class="docutils literal"><span class="pre">None</span></tt> (default: <tt class="docutils literal"><span class="pre">None</span></tt> = use builtin colorscheme).</dd>
+<tt class="docutils literal">None</tt> (default: <tt class="docutils literal">None</tt> = use builtin colorscheme).</dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -883,6 +903,6 @@ no support for common styles.</p>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:52.568889
+<!-- generated on: 2010-01-01 20:18:41.451497
      file id: formatters -->
 </html>
\ No newline at end of file
index 4e5a6475583df7cdfc29ab2b31bb45182acdaa45..c62ff359f7702213c3e9da045d821e4078361be5 100644 (file)
@@ -256,6 +256,6 @@ look <a class="reference external" href="http://pygments.org/contribute/">here</
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:53.578289
+<!-- generated on: 2010-01-01 20:18:42.001421
      file id: index -->
 </html>
\ No newline at end of file
index 2320d5c8eecbf1b5d9bccd147b20c0b0b79d57a8..c9e1b887921e93742f91acc827466703f9253b81 100644 (file)
@@ -221,8 +221,8 @@ div.toc h2 {
       </div>
     
     <!-- -*- mode: rst -*- -->
-<p>Pygments requires at least Python 2.3 to work correctly. Just to clarify:
-there <em>won't</em> ever be support for Python versions below 2.3. However, there
+<p>Pygments requires at least Python 2.4 to work correctly. Just to clarify:
+there <em>won't</em> ever be support for Python versions below 2.4. However, there
 are no other dependencies.</p>
 <div class="section" id="installing-a-released-version">
 <h3>Installing a released version</h3>
@@ -240,7 +240,7 @@ directory.</p>
 <ol class="arabic simple">
 <li>Download the most recent tarball from the <a class="reference external" href="http://pygments.org/download/">download page</a></li>
 <li>Unpack the tarball</li>
-<li><tt class="docutils literal"><span class="pre">sudo</span> <span class="pre">python</span> <span class="pre">setup.py</span> <span class="pre">install</span></tt></li>
+<li><tt class="docutils literal">sudo python setup.py install</tt></li>
 </ol>
 <p>Note that the last command will automatically download and install
 <a class="reference external" href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools</a> if you don't already have it installed. This requires a working
@@ -254,12 +254,12 @@ internet connection.</p>
 <h4>If you want to play around with the code</h4>
 <ol class="arabic simple">
 <li>Install <a class="reference external" href="http://selenic.com/mercurial/">Mercurial</a></li>
-<li><tt class="docutils literal"><span class="pre">hg</span> <span class="pre">clone</span> <span class="pre">http://dev.pocoo.org/hg/pygments-main</span> <span class="pre">pygments</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">cd</span> <span class="pre">pygments</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">ln</span> <span class="pre">-s</span> <span class="pre">pygments</span> <span class="pre">/usr/lib/python2.X/site-packages</span></tt></li>
-<li><tt class="docutils literal"><span class="pre">ln</span> <span class="pre">-s</span> <span class="pre">pygmentize</span> <span class="pre">/usr/local/bin</span></tt></li>
+<li><tt class="docutils literal">hg clone <span class="pre">http://dev.pocoo.org/hg/pygments-main</span> pygments</tt></li>
+<li><tt class="docutils literal">cd pygments</tt></li>
+<li><tt class="docutils literal">ln <span class="pre">-s</span> pygments <span class="pre">/usr/lib/python2.X/site-packages</span></tt></li>
+<li><tt class="docutils literal">ln <span class="pre">-s</span> pygmentize /usr/local/bin</tt></li>
 </ol>
-<p>As an alternative to steps 4 and 5 you can also do <tt class="docutils literal"><span class="pre">python</span> <span class="pre">setup.py</span> <span class="pre">develop</span></tt>
+<p>As an alternative to steps 4 and 5 you can also do <tt class="docutils literal">python setup.py develop</tt>
 which will install the package via setuptools in development mode.</p>
 <!-- If you just want the latest features and use them
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -276,6 +276,6 @@ is run, the sources are updated from Subversion. -->
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:53.754543
+<!-- generated on: 2010-01-01 20:18:42.090829
      file id: installation -->
 </html>
\ No newline at end of file
index 5ae2a3d834899cb725de0ce31a08cbacb72af154..254fb65537d2d6e152ef6eabfd0248001b60cc57 100644 (file)
@@ -250,6 +250,6 @@ colorize code via a simple menu option.  It can be found <a class="reference ext
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:53.869119
+<!-- generated on: 2010-01-01 20:18:42.152952
      file id: integrate -->
 </html>
\ No newline at end of file
index a802c3c8cb16d04c9ec39b28b29608dcfac4a97b..488b14a8c1591eb9a7bac5a558e3fe2e642ee7dd 100644 (file)
@@ -245,7 +245,7 @@ some keyword arguments (the lexer options) and that provides a
 <cite>get_tokens_unprocessed()</cite> method which is given a string or unicode object with
 the data to parse.</p>
 <p>The <cite>get_tokens_unprocessed()</cite> method must return an iterator or iterable
-containing tuples in the form <tt class="docutils literal"><span class="pre">(index,</span> <span class="pre">token,</span> <span class="pre">value)</span></tt>. Normally you don't need
+containing tuples in the form <tt class="docutils literal">(index, token, value)</tt>. Normally you don't need
 to do this since there are numerous base lexers you can subclass.</p>
 <div class="section" id="regexlexer">
 <h3>RegexLexer</h3>
@@ -264,9 +264,9 @@ new state is pushed onto the stack.  The most basic lexers (like the
 <cite>new_state</cite>) where the last item is optional.  In the most basic form, <cite>action</cite>
 is a token type (like <cite>Name.Builtin</cite>).  That means: When <cite>regex</cite> matches, emit a
 token with the match text and type <cite>tokentype</cite> and push <cite>new_state</cite> on the state
-stack.  If the new state is <tt class="docutils literal"><span class="pre">'#pop'</span></tt>, the topmost state is popped from the
-stack instead. (To pop more than one state, use <tt class="docutils literal"><span class="pre">'#pop:2'</span></tt> and so on.)
-<tt class="docutils literal"><span class="pre">'#push'</span></tt> is a synonym for pushing the current state on the
+stack.  If the new state is <tt class="docutils literal">'#pop'</tt>, the topmost state is popped from the
+stack instead. (To pop more than one state, use <tt class="docutils literal">'#pop:2'</tt> and so on.)
+<tt class="docutils literal">'#push'</tt> is a synonym for pushing the current state on the
 stack.</p>
 <p>The following example shows the <cite>DiffLexer</cite> from the builtin lexers. Note that
 it contains some additional attributes <cite>name</cite>, <cite>aliases</cite> and <cite>filenames</cite> which
@@ -303,7 +303,7 @@ so on.</p>
 </div>
 <div class="section" id="regex-flags">
 <h3>Regex Flags</h3>
-<p>You can either define regex flags in the regex (<tt class="docutils literal"><span class="pre">r'(?x)foo</span> <span class="pre">bar'</span></tt>) or by adding
+<p>You can either define regex flags in the regex (<tt class="docutils literal"><span class="pre">r'(?x)foo</span> bar'</tt>) or by adding
 a <cite>flags</cite> attribute to your lexer class. If no attribute is defined, it defaults
 to <cite>re.MULTILINE</cite>. For more informations about regular expression flags see the
 <a class="reference external" href="http://docs.python.org/lib/re-syntax.html">regular expressions</a> help page in the python documentation.</p>
@@ -331,7 +331,7 @@ sections, comments and key = value pairs:</p>
     <span class="p">}</span>
 </pre></div>
 <p>The lexer first looks for whitespace, comments and section names. And later it
-looks for a line that looks like a key, value pair, seperated by an <tt class="docutils literal"><span class="pre">'='</span></tt>
+looks for a line that looks like a key, value pair, seperated by an <tt class="docutils literal">'='</tt>
 sign, and optional whitespace.</p>
 <p>The <cite>bygroups</cite> helper makes sure that each group is yielded with a different
 token type. First the <cite>Name.Attribute</cite> token, then a <cite>Text</cite> token for the
@@ -375,24 +375,24 @@ pattern it's impossible to lex just using regular expressions.</p>
         <span class="p">]</span>
     <span class="p">}</span>
 </pre></div>
-<p>This lexer starts lexing in the <tt class="docutils literal"><span class="pre">'root'</span></tt> state. It tries to match as much as
-possible until it finds a slash (<tt class="docutils literal"><span class="pre">'/'</span></tt>). If the next character after the slash
-is a star (<tt class="docutils literal"><span class="pre">'*'</span></tt>) the <cite>RegexLexer</cite> sends those two characters to the output
+<p>This lexer starts lexing in the <tt class="docutils literal">'root'</tt> state. It tries to match as much as
+possible until it finds a slash (<tt class="docutils literal">'/'</tt>). If the next character after the slash
+is a star (<tt class="docutils literal">'*'</tt>) the <cite>RegexLexer</cite> sends those two characters to the output
 stream marked as <cite>Comment.Multiline</cite> and continues parsing with the rules
-defined in the <tt class="docutils literal"><span class="pre">'comment'</span></tt> state.</p>
+defined in the <tt class="docutils literal">'comment'</tt> state.</p>
 <p>If there wasn't a star after the slash, the <cite>RegexLexer</cite> checks if it's a
 singleline comment (eg: followed by a second slash). If this also wasn't the
 case it must be a single slash (the separate regex for a single slash must also
 be given, else the slash would be marked as an error token).</p>
-<p>Inside the <tt class="docutils literal"><span class="pre">'comment'</span></tt> state, we do the same thing again. Scan until the lexer
+<p>Inside the <tt class="docutils literal">'comment'</tt> state, we do the same thing again. Scan until the lexer
 finds a star or slash. If it's the opening of a multiline comment, push the
-<tt class="docutils literal"><span class="pre">'comment'</span></tt> state on the stack and continue scanning, again in the
-<tt class="docutils literal"><span class="pre">'comment'</span></tt> state.  Else, check if it's the end of the multiline comment. If
+<tt class="docutils literal">'comment'</tt> state on the stack and continue scanning, again in the
+<tt class="docutils literal">'comment'</tt> state.  Else, check if it's the end of the multiline comment. If
 yes, pop one state from the stack.</p>
 <p>Note: If you pop from an empty stack you'll get an <cite>IndexError</cite>. (There is an
-easy way to prevent this from happening: don't <tt class="docutils literal"><span class="pre">'#pop'</span></tt> in the root state).</p>
+easy way to prevent this from happening: don't <tt class="docutils literal">'#pop'</tt> in the root state).</p>
 <p>If the <cite>RegexLexer</cite> encounters a newline that is flagged as an error token, the
-stack is emptied and the lexer continues scanning in the <tt class="docutils literal"><span class="pre">'root'</span></tt> state. This
+stack is emptied and the lexer continues scanning in the <tt class="docutils literal">'root'</tt> state. This
 helps producing error-tolerant highlighting for erroneous input, e.g. when a
 single-line string is not closed.</p>
 </div>
@@ -423,13 +423,13 @@ match a comment containing a directive, something like:</p>
     <span class="p">]</span>
 <span class="p">}</span>
 </pre></div>
-<p>When this encounters the above sample, first <tt class="docutils literal"><span class="pre">'comment'</span></tt> and <tt class="docutils literal"><span class="pre">'directive'</span></tt>
+<p>When this encounters the above sample, first <tt class="docutils literal">'comment'</tt> and <tt class="docutils literal">'directive'</tt>
 are pushed onto the stack, then the lexer continues in the directive state
-until it finds the closing <tt class="docutils literal"><span class="pre">&gt;</span></tt>, then it continues in the comment state until
-the closing <tt class="docutils literal"><span class="pre">*/</span></tt>. Then, both states are popped from the stack again and
+until it finds the closing <tt class="docutils literal">&gt;</tt>, then it continues in the comment state until
+the closing <tt class="docutils literal">*/</tt>. Then, both states are popped from the stack again and
 lexing continues in the root state.</p>
-<p><em>New in Pygments 0.9:</em> The tuple can contain the special <tt class="docutils literal"><span class="pre">'#push'</span></tt> and
-<tt class="docutils literal"><span class="pre">'#pop'</span></tt> (but not <tt class="docutils literal"><span class="pre">'#pop:n'</span></tt>) directives.</p>
+<p><em>New in Pygments 0.9:</em> The tuple can contain the special <tt class="docutils literal">'#push'</tt> and
+<tt class="docutils literal">'#pop'</tt> (but not <tt class="docutils literal">'#pop:n'</tt>) directives.</p>
 </li>
 <li><p class="first">You can include the rules of a state in the definition of another.  This is
 done by using <cite>include</cite> from <cite>pygments.lexer</cite>:</p>
@@ -460,12 +460,12 @@ done by using <cite>include</cite> from <cite>pygments.lexer</cite>:</p>
 comments. Because comments can occur at toplevel and in functions, we need
 rules for comments in both states. As you can see, the <cite>include</cite> helper saves
 repeating rules that occur more than once (in this example, the state
-<tt class="docutils literal"><span class="pre">'comment'</span></tt> will never be entered by the lexer, as it's only there to be
-included in <tt class="docutils literal"><span class="pre">'root'</span></tt> and <tt class="docutils literal"><span class="pre">'function'</span></tt>).</p>
+<tt class="docutils literal">'comment'</tt> will never be entered by the lexer, as it's only there to be
+included in <tt class="docutils literal">'root'</tt> and <tt class="docutils literal">'function'</tt>).</p>
 </li>
 <li><p class="first">Sometimes, you may want to &quot;combine&quot; a state from existing ones.  This is
 possible with the <cite>combine</cite> helper from <cite>pygments.lexer</cite>.</p>
-<p>If you, instead of a new state, write <tt class="docutils literal"><span class="pre">combined('state1',</span> <span class="pre">'state2')</span></tt> as the
+<p>If you, instead of a new state, write <tt class="docutils literal"><span class="pre">combined('state1',</span> 'state2')</tt> as the
 third item of a rule tuple, a new anonymous state will be formed from state1
 and state2 and if the rule matches, the lexer will enter this state.</p>
 <p>This is not used very often, but can be helpful in some cases, such as the
@@ -486,9 +486,9 @@ the stack by overloading the <cite>get_tokens_unprocessed()</cite> method:</p>
 <p>Some lexers like the <cite>PhpLexer</cite> use this to make the leading <tt class="docutils literal"><span class="pre">&lt;?php</span></tt>
 preprocessor comments optional. Note that you can crash the lexer easily
 by putting values into the stack that don't exist in the token map. Also
-removing <tt class="docutils literal"><span class="pre">'root'</span></tt> from the stack can result in strange errors!</p>
+removing <tt class="docutils literal">'root'</tt> from the stack can result in strange errors!</p>
 </li>
-<li><p class="first">An empty regex at the end of a state list, combined with <tt class="docutils literal"><span class="pre">'#pop'</span></tt>, can
+<li><p class="first">An empty regex at the end of a state list, combined with <tt class="docutils literal">'#pop'</tt>, can
 act as a return point from a state that doesn't have a clear end marker.</p>
 </li>
 </ul>
@@ -525,22 +525,22 @@ lexed with that lexer, and the resulting tokens will be yielded.</p>
         <span class="p">]</span>
     <span class="p">}</span>
 </pre></div>
-<p>Here the content of a <tt class="docutils literal"><span class="pre">&lt;script&gt;</span></tt> tag is passed to a newly created instance of
+<p>Here the content of a <tt class="docutils literal">&lt;script&gt;</tt> tag is passed to a newly created instance of
 a <cite>JavascriptLexer</cite> and not processed by the <cite>HtmlLexer</cite>. This is done using the
 <cite>using</cite> helper that takes the other lexer class as its parameter.</p>
 <p>Note the combination of <cite>bygroups</cite> and <cite>using</cite>. This makes sure that the content
-up to the <tt class="docutils literal"><span class="pre">&lt;/script&gt;</span></tt> end tag is processed by the <cite>JavascriptLexer</cite>, while the
+up to the <tt class="docutils literal">&lt;/script&gt;</tt> end tag is processed by the <cite>JavascriptLexer</cite>, while the
 end tag is yielded as a normal token with the <cite>Name.Tag</cite> type.</p>
 <p>As an additional goodie, if the lexer class is replaced by <cite>this</cite> (imported from
 <cite>pygments.lexer</cite>), the &quot;other&quot; lexer will be the current one (because you cannot
 refer to the current class within the code that runs at class definition time).</p>
-<p>Also note the <tt class="docutils literal"><span class="pre">(r'&lt;\s*script\s*',</span> <span class="pre">Name.Tag,</span> <span class="pre">('script-content',</span> <span class="pre">'tag'))</span></tt> rule.
+<p>Also note the <tt class="docutils literal"><span class="pre">(r'&lt;\s*script\s*',</span> Name.Tag, <span class="pre">('script-content',</span> <span class="pre">'tag'))</span></tt> rule.
 Here, two states are pushed onto the state stack, <tt class="docutils literal"><span class="pre">'script-content'</span></tt> and
-<tt class="docutils literal"><span class="pre">'tag'</span></tt>.  That means that first <tt class="docutils literal"><span class="pre">'tag'</span></tt> is processed, which will parse
-attributes and the closing <tt class="docutils literal"><span class="pre">&gt;</span></tt>, then the <tt class="docutils literal"><span class="pre">'tag'</span></tt> state is popped and the
+<tt class="docutils literal">'tag'</tt>.  That means that first <tt class="docutils literal">'tag'</tt> is processed, which will parse
+attributes and the closing <tt class="docutils literal">&gt;</tt>, then the <tt class="docutils literal">'tag'</tt> state is popped and the
 next state on top of the stack will be <tt class="docutils literal"><span class="pre">'script-content'</span></tt>.</p>
 <p>The <cite>using()</cite> helper has a special keyword argument, <cite>state</cite>, which works as
-follows: if given, the lexer to use initially is not in the <tt class="docutils literal"><span class="pre">&quot;root&quot;</span></tt> state,
+follows: if given, the lexer to use initially is not in the <tt class="docutils literal">&quot;root&quot;</tt> state,
 but in the state given by this argument. This <em>only</em> works with a <cite>RegexLexer</cite>.</p>
 <p>Any other keywords arguments passed to <cite>using()</cite> are added to the keyword
 arguments used to create the lexer.</p>
@@ -551,7 +551,7 @@ arguments used to create the lexer.</p>
 example used for the template engine lexers. It takes two lexers as
 arguments on initialisation: a <cite>root_lexer</cite> and a <cite>language_lexer</cite>.</p>
 <p>The input is processed as follows: First, the whole text is lexed with the
-<cite>language_lexer</cite>. All tokens yielded with a type of <tt class="docutils literal"><span class="pre">Other</span></tt> are then
+<cite>language_lexer</cite>. All tokens yielded with a type of <tt class="docutils literal">Other</tt> are then
 concatenated and given to the <cite>root_lexer</cite>. The language tokens of the
 <cite>language_lexer</cite> are then inserted into the <cite>root_lexer</cite>'s token stream
 at the appropriate positions.</p>
@@ -564,7 +564,7 @@ at the appropriate positions.</p>
 </pre></div>
 <p>This procedure ensures that e.g. HTML with template tags in it is highlighted
 correctly even if the template tags are put into HTML tags or attributes.</p>
-<p>If you want to change the needle token <tt class="docutils literal"><span class="pre">Other</span></tt> to something else, you can
+<p>If you want to change the needle token <tt class="docutils literal">Other</tt> to something else, you can
 give the lexer another token type as the third parameter:</p>
 <div class="syntax"><pre><span class="n">DelegatingLexer</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="n">MyLexer</span><span class="p">,</span> <span class="n">OtherLexer</span><span class="p">,</span> <span class="n">Text</span><span class="p">,</span> <span class="o">**</span><span class="n">options</span><span class="p">)</span>
 </pre></div>
@@ -580,11 +580,11 @@ callbacks). The callback must be a function taking two arguments:</p>
 <li>the lexer itself</li>
 <li>the match object for the last matched rule</li>
 </ul>
-<p>The callback must then return an iterable of (or simply yield) <tt class="docutils literal"><span class="pre">(index,</span>
-<span class="pre">tokentype,</span> <span class="pre">value)</span></tt> tuples, which are then just passed through by
-<cite>get_tokens_unprocessed()</cite>. The <tt class="docutils literal"><span class="pre">index</span></tt> here is the position of the token in
-the input string, <tt class="docutils literal"><span class="pre">tokentype</span></tt> is the normal token type (like <cite>Name.Builtin</cite>),
-and <tt class="docutils literal"><span class="pre">value</span></tt> the associated part of the input string.</p>
+<p>The callback must then return an iterable of (or simply yield) <tt class="docutils literal">(index,
+tokentype, value)</tt> tuples, which are then just passed through by
+<cite>get_tokens_unprocessed()</cite>. The <tt class="docutils literal">index</tt> here is the position of the token in
+the input string, <tt class="docutils literal">tokentype</tt> is the normal token type (like <cite>Name.Builtin</cite>),
+and <tt class="docutils literal">value</tt> the associated part of the input string.</p>
 <p>You can see an example here:</p>
 <div class="syntax"><pre><span class="kn">from</span> <span class="nn">pygments.lexer</span> <span class="kn">import</span> <span class="n">RegexLexer</span>
 <span class="kn">from</span> <span class="nn">pygments.token</span> <span class="kn">import</span> <span class="n">Generic</span>
@@ -665,7 +665,7 @@ has every extension installed. In the case of PHP there are over 3000 builtin
 functions. That's an incredible huge amount of functions, much more than you
 can put into a regular expression.</p>
 <p>But because only <cite>Name</cite> tokens can be function names it's solvable by overriding
-the <tt class="docutils literal"><span class="pre">get_tokens_unprocessed()</span></tt> method. The following lexer subclasses the
+the <tt class="docutils literal">get_tokens_unprocessed()</tt> method. The following lexer subclasses the
 <cite>PythonLexer</cite> so that it highlights some additional names as pseudo keywords:</p>
 <div class="syntax"><pre><span class="kn">from</span> <span class="nn">pygments.lexers.agile</span> <span class="kn">import</span> <span class="n">PythonLexer</span>
 <span class="kn">from</span> <span class="nn">pygments.token</span> <span class="kn">import</span> <span class="n">Name</span><span class="p">,</span> <span class="n">Keyword</span>
@@ -686,6 +686,6 @@ the <tt class="docutils literal"><span class="pre">get_tokens_unprocessed()</spa
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:53.939837
+<!-- generated on: 2010-01-01 20:18:42.243381
      file id: lexerdevelopment -->
 </html>
\ No newline at end of file
index 893cfac9683a1d49cb2d1cc069a92cb367bd88bf..1ffb4eca837a79d070682833ac8734d613cc3850 100644 (file)
@@ -247,19 +247,19 @@ div.toc h2 {
 <p>Currently, <strong>all lexers</strong> support these options:</p>
 <dl class="docutils">
 <dt><cite>stripnl</cite></dt>
-<dd>Strip leading and trailing newlines from the input (default: <tt class="docutils literal"><span class="pre">True</span></tt>)</dd>
+<dd>Strip leading and trailing newlines from the input (default: <tt class="docutils literal">True</tt>)</dd>
 <dt><cite>stripall</cite></dt>
 <dd>Strip all leading and trailing whitespace from the input (default:
-<tt class="docutils literal"><span class="pre">False</span></tt>).</dd>
+<tt class="docutils literal">False</tt>).</dd>
 <dt><cite>tabsize</cite></dt>
-<dd>If given and greater than 0, expand tabs in the input (default: <tt class="docutils literal"><span class="pre">0</span></tt>).</dd>
+<dd>If given and greater than 0, expand tabs in the input (default: <tt class="docutils literal">0</tt>).</dd>
 <dt><cite>encoding</cite></dt>
 <dd><p class="first"><em>New in Pygments 0.6.</em></p>
 <p>If given, must be an encoding name (such as <tt class="docutils literal"><span class="pre">&quot;utf-8&quot;</span></tt>). This encoding
 will be used to convert the input string to Unicode (if it is not already
-a Unicode string). The default is <tt class="docutils literal"><span class="pre">&quot;latin1&quot;</span></tt>.</p>
-<p class="last">If this option is set to <tt class="docutils literal"><span class="pre">&quot;guess&quot;</span></tt>, a simple UTF-8 vs. Latin-1
-detection is used, if it is set to <tt class="docutils literal"><span class="pre">&quot;chardet&quot;</span></tt>, the
+a Unicode string). The default is <tt class="docutils literal">&quot;latin1&quot;</tt>.</p>
+<p class="last">If this option is set to <tt class="docutils literal">&quot;guess&quot;</tt>, a simple UTF-8 vs. Latin-1
+detection is used, if it is set to <tt class="docutils literal">&quot;chardet&quot;</tt>, the
 <a class="reference external" href="http://chardet.feedparser.org/">chardet library</a> is used to
 guess the encoding of the input.</p>
 </dd>
@@ -310,8 +310,8 @@ programming language) source.</p>
 <p>Additional options accepted:</p>
 <dl class="docutils">
 <dt><cite>func_name_highlighting</cite></dt>
-<dd>If given and <tt class="docutils literal"><span class="pre">True</span></tt>, highlight builtin function names
-(default: <tt class="docutils literal"><span class="pre">True</span></tt>).</dd>
+<dd>If given and <tt class="docutils literal">True</tt>, highlight builtin function names
+(default: <tt class="docutils literal">True</tt>).</dd>
 <dt><cite>disabled_modules</cite></dt>
 <dd><p class="first">If given, must be a list of module names whose function names
 should not be highlighted. By default all modules are highlighted.</p>
@@ -417,7 +417,7 @@ language) source.</p>
 <p>Additional options:</p>
 <dl class="docutils">
 <dt><cite>python3</cite></dt>
-<dd>Use Python 3 lexer for code.  Default is <tt class="docutils literal"><span class="pre">False</span></tt>.
+<dd>Use Python 3 lexer for code.  Default is <tt class="docutils literal">False</tt>.
 <em>New in Pygments 1.0.</em></dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
@@ -691,6 +691,7 @@ language) source.</p>
 <p><cite>DLexer</cite></p>
 <blockquote>
 <p>For D source.</p>
+<p><em>New in Pygments 1.2.</em></p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
 <col class="field-body" />
@@ -711,14 +712,14 @@ Turbo Pascal and Free Pascal source code.</p>
 <p>Additional options accepted:</p>
 <dl class="docutils">
 <dt><cite>turbopascal</cite></dt>
-<dd>Highlight Turbo Pascal specific keywords (default: <tt class="docutils literal"><span class="pre">True</span></tt>).</dd>
+<dd>Highlight Turbo Pascal specific keywords (default: <tt class="docutils literal">True</tt>).</dd>
 <dt><cite>delphi</cite></dt>
-<dd>Highlight Borland Delphi specific keywords (default: <tt class="docutils literal"><span class="pre">True</span></tt>).</dd>
+<dd>Highlight Borland Delphi specific keywords (default: <tt class="docutils literal">True</tt>).</dd>
 <dt><cite>freepascal</cite></dt>
-<dd>Highlight Free Pascal specific keywords (default: <tt class="docutils literal"><span class="pre">True</span></tt>).</dd>
+<dd>Highlight Free Pascal specific keywords (default: <tt class="docutils literal">True</tt>).</dd>
 <dt><cite>units</cite></dt>
 <dd>A list of units that should be considered builtin, supported are
-<tt class="docutils literal"><span class="pre">System</span></tt>, <tt class="docutils literal"><span class="pre">SysUtils</span></tt>, <tt class="docutils literal"><span class="pre">Classes</span></tt> and <tt class="docutils literal"><span class="pre">Math</span></tt>.
+<tt class="docutils literal">System</tt>, <tt class="docutils literal">SysUtils</tt>, <tt class="docutils literal">Classes</tt> and <tt class="docutils literal">Math</tt>.
 Default is to consider all of them builtin.</dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
@@ -785,6 +786,22 @@ Default is to consider all of them builtin.</dd>
 </tbody>
 </table>
 </blockquote>
+<p><cite>GoLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://golang.org">Go</a> source.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">go</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.go</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-gosrc</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>JavaLexer</cite></p>
 <blockquote>
 <p>For <a class="reference external" href="http://www.sun.com/java/">Java</a> source code.</p>
@@ -817,6 +834,23 @@ Default is to consider all of them builtin.</dd>
 </tbody>
 </table>
 </blockquote>
+<p><cite>OocLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://ooc-lang.org/">Ooc</a> source code</p>
+<p><em>New in Pygments 1.2.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">ooc</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.ooc</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-ooc</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>PrologLexer</cite></p>
 <blockquote>
 <p>Lexer for Prolog files.</p>
@@ -911,15 +945,15 @@ source code.</p>
 <dd><p class="first">Determines which Unicode characters this lexer allows for identifiers.
 The possible values are:</p>
 <ul class="simple">
-<li><tt class="docutils literal"><span class="pre">none</span></tt> -- only the ASCII letters and numbers are allowed. This
+<li><tt class="docutils literal">none</tt> -- only the ASCII letters and numbers are allowed. This
 is the fastest selection.</li>
-<li><tt class="docutils literal"><span class="pre">basic</span></tt> -- all Unicode characters from the specification except
-category <tt class="docutils literal"><span class="pre">Lo</span></tt> are allowed.</li>
-<li><tt class="docutils literal"><span class="pre">full</span></tt> -- all Unicode characters as specified in the C# specs
+<li><tt class="docutils literal">basic</tt> -- all Unicode characters from the specification except
+category <tt class="docutils literal">Lo</tt> are allowed.</li>
+<li><tt class="docutils literal">full</tt> -- all Unicode characters as specified in the C# specs
 are allowed.  Note that this means a considerable slowdown since the
-<tt class="docutils literal"><span class="pre">Lo</span></tt> category has more than 40,000 characters in it!</li>
+<tt class="docutils literal">Lo</tt> category has more than 40,000 characters in it!</li>
 </ul>
-<p>The default value is <tt class="docutils literal"><span class="pre">basic</span></tt>.</p>
+<p>The default value is <tt class="docutils literal">basic</tt>.</p>
 <p class="last"><em>New in Pygments 0.8.</em></p>
 </dd>
 </dl>
@@ -1048,7 +1082,7 @@ source code.</p>
 <p>Additional options accepted:</p>
 <dl class="docutils">
 <dt><cite>litstyle</cite></dt>
-<dd>If given, must be <tt class="docutils literal"><span class="pre">&quot;bird&quot;</span></tt> or <tt class="docutils literal"><span class="pre">&quot;latex&quot;</span></tt>.  If not given, the style
+<dd>If given, must be <tt class="docutils literal">&quot;bird&quot;</tt> or <tt class="docutils literal">&quot;latex&quot;</tt>.  If not given, the style
 is autodetected: if the first non-whitespace character in the source
 is a backslash or percent character, LaTeX is assumed, else Bird.</dd>
 </dl>
@@ -1235,6 +1269,23 @@ Contributed by Andreas Amann &lt;<a class="reference external" href="mailto:aama
 </tbody>
 </table>
 </blockquote>
+<p><cite>AsymptoteLexer</cite></p>
+<blockquote>
+<p>For <a class="reference external" href="http://asymptote.sf.net/">Asymptote</a> source code.</p>
+<p><em>New in Pygments 1.2.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">asy</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.asy</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-asymptote</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>BashLexer</cite></p>
 <blockquote>
 <p>Lexer for (ba)sh shell scripts.</p>
@@ -1321,6 +1372,23 @@ language.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>GherkinLexer</cite></p>
+<blockquote>
+<p>For <cite>Gherkin &lt;http://cukes.info/&gt;</cite> syntax.</p>
+<p><em>New in Pygments 1.2.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">Cucumber, cucumber, Gherkin, gherkin</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.feature</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-gherkin</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>GnuplotLexer</cite></p>
 <blockquote>
 <p>For <a class="reference external" href="http://gnuplot.info/">Gnuplot</a> plotting scripts.</p>
@@ -1792,7 +1860,7 @@ highlighting then call the language-specific Ragel lexer.</p>
 <p><cite>RagelLexer</cite></p>
 <blockquote>
 <p>A pure <a class="reference external" href="http://www.complang.org/ragel/">Ragel</a> lexer.  Use this for
-fragments of Ragel.  For <tt class="docutils literal"><span class="pre">.rl</span></tt> files, use RagelEmbeddedLexer instead
+fragments of Ragel.  For <tt class="docutils literal">.rl</tt> files, use RagelEmbeddedLexer instead
 (or one of the language-specific subclasses).</p>
 <p><em>New in Pygments 1.1.</em></p>
 <table class="docutils field-list" frame="void" rules="none">
@@ -1853,8 +1921,8 @@ file is malformed.</p>
 <p>Additional options accepted:</p>
 <dl class="docutils">
 <dt><cite>compress</cite></dt>
-<dd>If set to <tt class="docutils literal"><span class="pre">&quot;gz&quot;</span></tt> or <tt class="docutils literal"><span class="pre">&quot;bz2&quot;</span></tt>, decompress the token stream with
-the given compression algorithm before lexing (default: <tt class="docutils literal"><span class="pre">&quot;&quot;</span></tt>).</dd>
+<dd>If set to <tt class="docutils literal">&quot;gz&quot;</tt> or <tt class="docutils literal">&quot;bz2&quot;</tt>, decompress the token stream with
+the given compression algorithm before lexing (default: <tt class="docutils literal">&quot;&quot;</tt>).</dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -2674,11 +2742,28 @@ format.</p>
 </tbody>
 </table>
 </blockquote>
+<p><cite>CMakeLexer</cite></p>
+<blockquote>
+<p>Lexer for <a class="reference external" href="http://cmake.org/Wiki/CMake">CMake</a> files.</p>
+<p><em>New in Pygments 1.2.</em></p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field"><th class="field-name">Short names:</th><td class="field-body">cmake</td>
+</tr>
+<tr class="field"><th class="field-name">Filename patterns:</th><td class="field-body">*.cmake</td>
+</tr>
+<tr class="field"><th class="field-name">Mimetypes:</th><td class="field-body">text/x-cmake</td>
+</tr>
+</tbody>
+</table>
+</blockquote>
 <p><cite>DarcsPatchLexer</cite></p>
 <blockquote>
 <p>DarcsPatchLexer is a lexer for the various versions of the darcs patch
 format.  Examples of this format are derived by commands such as
-<tt class="docutils literal"><span class="pre">darcs</span> <span class="pre">annotate</span> <span class="pre">--patch</span></tt> and <tt class="docutils literal"><span class="pre">darcs</span> <span class="pre">send</span></tt>.</p>
+<tt class="docutils literal">darcs annotate <span class="pre">--patch</span></tt> and <tt class="docutils literal">darcs send</tt>.</p>
 <p><em>New in Pygments 0.10.</em></p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -2695,7 +2780,7 @@ format.  Examples of this format are derived by commands such as
 </blockquote>
 <p><cite>DebianControlLexer</cite></p>
 <blockquote>
-<p>Lexer for Debian <tt class="docutils literal"><span class="pre">control</span></tt> files and <tt class="docutils literal"><span class="pre">apt-cache</span> <span class="pre">show</span> <span class="pre">&lt;pkg&gt;</span></tt> outputs.</p>
+<p>Lexer for Debian <tt class="docutils literal">control</tt> files and <tt class="docutils literal"><span class="pre">apt-cache</span> show &lt;pkg&gt;</tt> outputs.</p>
 <p><em>New in Pygments 0.9.</em></p>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -2869,9 +2954,9 @@ the same file even).</p>
 <p>Additional options accepted:</p>
 <dl class="docutils">
 <dt><cite>handlecodeblocks</cite></dt>
-<dd>Highlight the contents of <tt class="docutils literal"><span class="pre">..</span> <span class="pre">sourcecode::</span> <span class="pre">langauge</span></tt> and
-<tt class="docutils literal"><span class="pre">..</span> <span class="pre">code::</span> <span class="pre">language</span></tt> directives with a lexer for the given
-language (default: <tt class="docutils literal"><span class="pre">True</span></tt>). <em>New in Pygments 0.8.</em></dd>
+<dd>Highlight the contents of <tt class="docutils literal">.. sourcecode:: langauge</tt> and
+<tt class="docutils literal">.. code:: language</tt> directives with a lexer for the given
+language (default: <tt class="docutils literal">True</tt>). <em>New in Pygments 0.8.</em></dd>
 </dl>
 <table class="docutils field-list" frame="void" rules="none">
 <col class="field-name" />
@@ -3081,16 +3166,16 @@ For PHP embedded in HTML, use the <cite>HtmlPhpLexer</cite>.</p>
 <p>Additional options accepted:</p>
 <dl class="docutils">
 <dt><cite>startinline</cite></dt>
-<dd>If given and <tt class="docutils literal"><span class="pre">True</span></tt> the lexer starts highlighting with
+<dd>If given and <tt class="docutils literal">True</tt> the lexer starts highlighting with
 php code (i.e.: no starting <tt class="docutils literal"><span class="pre">&lt;?php</span></tt> required).  The default
-is <tt class="docutils literal"><span class="pre">False</span></tt>.</dd>
+is <tt class="docutils literal">False</tt>.</dd>
 <dt><cite>funcnamehighlighting</cite></dt>
-<dd>If given and <tt class="docutils literal"><span class="pre">True</span></tt>, highlight builtin function names
-(default: <tt class="docutils literal"><span class="pre">True</span></tt>).</dd>
+<dd>If given and <tt class="docutils literal">True</tt>, highlight builtin function names
+(default: <tt class="docutils literal">True</tt>).</dd>
 <dt><cite>disabledmodules</cite></dt>
 <dd><p class="first">If given, must be a list of module names whose function names
 should not be highlighted. By default all modules are highlighted
-except the special <tt class="docutils literal"><span class="pre">'unknown'</span></tt> module that includes functions
+except the special <tt class="docutils literal">'unknown'</tt> module that includes functions
 that are known to php but are undocumented.</p>
 <p>To get a list of allowed modules have a look into the
 <cite>_phpbuiltins</cite> module:</p>
@@ -3165,11 +3250,11 @@ module:</p>
 <span class="go">(&#39;XML+Ruby&#39;, (&#39;xml+erb&#39;, &#39;xml+ruby&#39;), (), ())</span>
 </pre></div>
 <p>As you can see, the return value is an iterator which yields tuples
-in the form <tt class="docutils literal"><span class="pre">(name,</span> <span class="pre">aliases,</span> <span class="pre">filetypes,</span> <span class="pre">mimetypes)</span></tt>.</p>
+in the form <tt class="docutils literal">(name, aliases, filetypes, mimetypes)</tt>.</p>
 </div>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:54.412817
+<!-- generated on: 2010-01-01 20:18:42.538629
      file id: lexers -->
 </html>
\ No newline at end of file
index 5d4aa9bc6f5f234c7af9cc96b85fd3f4d24e2bf6..cd897019b457d8ba10ea76f1d24bbd58ac585160 100644 (file)
@@ -214,9 +214,9 @@ div.toc h2 {
 can be used to get Pygments highlighting in Moin wiki pages.</p>
 <p>To use it, copy the file <cite>external/moin-parser.py</cite> from the Pygments
 distribution to the <cite>data/plugin/parser</cite> subdirectory of your Moin instance.
-Edit the options at the top of the file (currently <tt class="docutils literal"><span class="pre">ATTACHMENTS</span></tt> and
-<tt class="docutils literal"><span class="pre">INLINESTYLES</span></tt>) and rename the file to the name that the parser directive
-should have. For example, if you name the file <tt class="docutils literal"><span class="pre">code.py</span></tt>, you can get a
+Edit the options at the top of the file (currently <tt class="docutils literal">ATTACHMENTS</tt> and
+<tt class="docutils literal">INLINESTYLES</tt>) and rename the file to the name that the parser directive
+should have. For example, if you name the file <tt class="docutils literal">code.py</tt>, you can get a
 highlighted Python code sample with this Wiki markup:</p>
 <pre class="literal-block">
 {{{
@@ -224,8 +224,8 @@ highlighted Python code sample with this Wiki markup:</p>
 [...]
 }}}
 </pre>
-<p>where <tt class="docutils literal"><span class="pre">python</span></tt> is the Pygments name of the lexer to use.</p>
-<p>Additionally, if you set the <tt class="docutils literal"><span class="pre">ATTACHMENTS</span></tt> option to True, Pygments will also
+<p>where <tt class="docutils literal">python</tt> is the Pygments name of the lexer to use.</p>
+<p>Additionally, if you set the <tt class="docutils literal">ATTACHMENTS</tt> option to True, Pygments will also
 be called for all attachments for whose filenames there is no other parser
 registered.</p>
 <p>You are responsible for including CSS rules that will map the Pygments CSS
@@ -236,10 +236,10 @@ into the <cite>htdocs</cite> directory of your Moin instance and then include it
 stylesheets = [('screen', '/htdocs/pygments.css')]
 </pre>
 <p>If you do not want to do that and are willing to accept larger HTML output, you
-can set the <tt class="docutils literal"><span class="pre">INLINESTYLES</span></tt> option to True.</p>
+can set the <tt class="docutils literal">INLINESTYLES</tt> option to True.</p>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:58.579361
+<!-- generated on: 2010-01-01 20:18:44.336595
      file id: moinmoin -->
 </html>
\ No newline at end of file
index 6ebf441b8827c230131975c0d37fffc58f3a3f63..dfe88045bdf73e43be04fac5f0a1368458372622 100644 (file)
@@ -239,7 +239,7 @@ required metadata from the class definition:</p>
 <div class="syntax"><pre><span class="k">[pygments.lexers]</span>
 <span class="na">yourlexer</span> <span class="o">=</span> <span class="s">yourmodule:YourLexer</span>
 </pre></div>
-<p>Note that you have to define <tt class="docutils literal"><span class="pre">name</span></tt>, <tt class="docutils literal"><span class="pre">aliases</span></tt> and <tt class="docutils literal"><span class="pre">filename</span></tt>
+<p>Note that you have to define <tt class="docutils literal">name</tt>, <tt class="docutils literal">aliases</tt> and <tt class="docutils literal">filename</tt>
 attributes so that you can use the highlighter from the command line:</p>
 <div class="syntax"><pre><span class="k">class</span> <span class="nc">YourLexer</span><span class="p">(</span><span class="o">...</span><span class="p">):</span>
     <span class="n">name</span> <span class="o">=</span> <span class="s">&#39;Name Of Your Lexer&#39;</span>
@@ -289,6 +289,6 @@ distribution.</p>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:58.639406
+<!-- generated on: 2010-01-01 20:18:44.382671
      file id: plugins -->
 </html>
\ No newline at end of file
index c7c018d14045878c572e2418fe9481e41316ddcc..14368a37ac58ed09936498e90458c88463ae3b6a 100644 (file)
@@ -293,8 +293,8 @@ arguments either to the class or to the lookup method:</p>
 </pre></div>
 <p>This makes the lexer strip all leading and trailing whitespace from the input
 (<cite>stripall</cite> option), lets the formatter output line numbers (<cite>linenos</cite> option),
-and sets the wrapping <tt class="docutils literal"><span class="pre">&lt;div&gt;</span></tt>'s class to <tt class="docutils literal"><span class="pre">source</span></tt> (instead of
-<tt class="docutils literal"><span class="pre">highlight</span></tt>).</p>
+and sets the wrapping <tt class="docutils literal">&lt;div&gt;</tt>'s class to <tt class="docutils literal">source</tt> (instead of
+<tt class="docutils literal">highlight</tt>).</p>
 <p>Important options include:</p>
 <dl class="docutils">
 <dt><cite>encoding</cite> <span class="classifier-delimiter">:</span> <span class="classifier">for lexers and formatters</span></dt>
@@ -332,7 +332,7 @@ for this purpose.</p>
 <div class="section" id="guessing-lexers">
 <h3>Guessing lexers</h3>
 <p>If you don't know the content of the file, or you want to highlight a file
-whose extension is ambiguous, such as <tt class="docutils literal"><span class="pre">.html</span></tt> (which could contain plain HTML
+whose extension is ambiguous, such as <tt class="docutils literal">.html</tt> (which could contain plain HTML
 or some template tags), use these functions:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pygments.lexers</span> <span class="kn">import</span> <span class="n">guess_lexer</span><span class="p">,</span> <span class="n">guess_lexer_for_filename</span>
 
@@ -379,12 +379,12 @@ it can be created with:</p>
 <pre class="literal-block">
 $ pygmentize -S default -f html &gt; style.css
 </pre>
-<p>where <tt class="docutils literal"><span class="pre">default</span></tt> is the style name.</p>
+<p>where <tt class="docutils literal">default</tt> is the style name.</p>
 <p>More options and tricks and be found in the <a class="reference external" href="./cmdline.html">command line reference</a>.</p>
 </div>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:58.748097
+<!-- generated on: 2010-01-01 20:18:44.456825
      file id: quickstart -->
 </html>
\ No newline at end of file
index 546851253c417258dfa3b79033c13b1e8dfb107c..feaef624bca067b1121e28e9cdcdc37825f60f32 100644 (file)
@@ -224,6 +224,6 @@ if the `handlecodeblocks` option is true. -->
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:58.934959
+<!-- generated on: 2010-01-01 20:18:44.580164
      file id: rstdirective -->
 </html>
\ No newline at end of file
index 913c33b73c3f09c11187caaa099c6911a17a9a22..27d2114011181e73e056ee09cac44f049a0b76a1 100644 (file)
@@ -265,7 +265,7 @@ define some styles:</p>
 </pre></div>
 <p>That's it. There are just a few rules. When you define a style for <cite>Name</cite>
 the style automatically also affects <cite>Name.Function</cite> and so on. If you
-defined <tt class="docutils literal"><span class="pre">'bold'</span></tt> and you don't want boldface for a subtoken use <tt class="docutils literal"><span class="pre">'nobold'</span></tt>.</p>
+defined <tt class="docutils literal">'bold'</tt> and you don't want boldface for a subtoken use <tt class="docutils literal">'nobold'</tt>.</p>
 <p>(Philosophy: the styles aren't written in CSS syntax since this way
 they can be used for a variety of formatters.)</p>
 <p><cite>default_style</cite> is the style inherited by all token types.</p>
@@ -275,8 +275,8 @@ they can be used for a variety of formatters.)</p>
 <li>or drop it into the <cite>styles</cite> subpackage of your Pygments distribution one style
 class per style, where the file name is the style name and the class name is
 <cite>StylenameClass</cite>. For example, if your style should be called
-<tt class="docutils literal"><span class="pre">&quot;mondrian&quot;</span></tt>, name the class <cite>MondrianStyle</cite>, put it into the file
-<tt class="docutils literal"><span class="pre">mondrian.py</span></tt> and this file into the <tt class="docutils literal"><span class="pre">pygments.styles</span></tt> subpackage
+<tt class="docutils literal">&quot;mondrian&quot;</tt>, name the class <cite>MondrianStyle</cite>, put it into the file
+<tt class="docutils literal">mondrian.py</tt> and this file into the <tt class="docutils literal">pygments.styles</tt> subpackage
 directory.</li>
 </ul>
 </div>
@@ -284,32 +284,32 @@ directory.</li>
 <h3>Style Rules</h3>
 <p>Here a small overview of all allowed styles:</p>
 <dl class="docutils">
-<dt><tt class="docutils literal"><span class="pre">bold</span></tt></dt>
+<dt><tt class="docutils literal">bold</tt></dt>
 <dd>render text as bold</dd>
-<dt><tt class="docutils literal"><span class="pre">nobold</span></tt></dt>
+<dt><tt class="docutils literal">nobold</tt></dt>
 <dd>don't render text as bold (to prevent subtokens behing highlighted bold)</dd>
-<dt><tt class="docutils literal"><span class="pre">italic</span></tt></dt>
+<dt><tt class="docutils literal">italic</tt></dt>
 <dd>render text italic</dd>
-<dt><tt class="docutils literal"><span class="pre">noitalic</span></tt></dt>
+<dt><tt class="docutils literal">noitalic</tt></dt>
 <dd>don't render text as italic</dd>
-<dt><tt class="docutils literal"><span class="pre">underline</span></tt></dt>
+<dt><tt class="docutils literal">underline</tt></dt>
 <dd>render text underlined</dd>
-<dt><tt class="docutils literal"><span class="pre">nounderline</span></tt></dt>
+<dt><tt class="docutils literal">nounderline</tt></dt>
 <dd>don't render text underlined</dd>
-<dt><tt class="docutils literal"><span class="pre">bg:</span></tt></dt>
+<dt><tt class="docutils literal">bg:</tt></dt>
 <dd>transparent background</dd>
 <dt><tt class="docutils literal"><span class="pre">bg:#000000</span></tt></dt>
 <dd>background color (black)</dd>
-<dt><tt class="docutils literal"><span class="pre">border:</span></tt></dt>
+<dt><tt class="docutils literal">border:</tt></dt>
 <dd>no border</dd>
 <dt><tt class="docutils literal"><span class="pre">border:#ffffff</span></tt></dt>
 <dd>border color (white)</dd>
-<dt><tt class="docutils literal"><span class="pre">#ff0000</span></tt></dt>
+<dt><tt class="docutils literal">#ff0000</tt></dt>
 <dd>text color (red)</dd>
-<dt><tt class="docutils literal"><span class="pre">noinherit</span></tt></dt>
+<dt><tt class="docutils literal">noinherit</tt></dt>
 <dd>don't inherit styles from supertoken</dd>
 </dl>
-<p>Note that there may not be a space between <tt class="docutils literal"><span class="pre">bg:</span></tt> and the color value
+<p>Note that there may not be a space between <tt class="docutils literal">bg:</tt> and the color value
 since the style definition string is split at whitespace.
 Also, using named colors is not allowed since the supported color names
 vary for different formatters.</p>
@@ -336,6 +336,6 @@ a way to iterate over all styles:</p>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:58.982703
+<!-- generated on: 2010-01-01 20:18:44.618066
      file id: styles -->
 </html>
\ No newline at end of file
index b80aa1b85ec3e129b41b6bdb5686ee60298ac564..68247a24900e7555c6a68e7302a5881573a3f77a 100644 (file)
@@ -240,9 +240,9 @@ that is used to create token types.</p>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">Token</span><span class="o">.</span><span class="n">String</span> <span class="ow">is</span> <span class="n">Token</span><span class="o">.</span><span class="n">String</span>
 <span class="go">True</span>
 </pre></div>
-<p>Note that tokens are singletons so you can use the <tt class="docutils literal"><span class="pre">is</span></tt> operator for comparing
+<p>Note that tokens are singletons so you can use the <tt class="docutils literal">is</tt> operator for comparing
 token types.</p>
-<p>As of Pygments 0.7 you can also use the <tt class="docutils literal"><span class="pre">in</span></tt> operator to perform set tests:</p>
+<p>As of Pygments 0.7 you can also use the <tt class="docutils literal">in</tt> operator to perform set tests:</p>
 <div class="syntax"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">pygments.token</span> <span class="kn">import</span> <span class="n">Comment</span>
 <span class="gp">&gt;&gt;&gt; </span><span class="n">Comment</span><span class="o">.</span><span class="n">Single</span> <span class="ow">in</span> <span class="n">Comment</span>
 <span class="go">True</span>
@@ -314,11 +314,11 @@ markup in PHP code)</td>
 </tr>
 <tr><td><cite>Operator</cite></td>
 <td><cite>Token.Operator</cite></td>
-<td>operators (<tt class="docutils literal"><span class="pre">+</span></tt>, <tt class="docutils literal"><span class="pre">not</span></tt>...)</td>
+<td>operators (<tt class="docutils literal">+</tt>, <tt class="docutils literal">not</tt>...)</td>
 </tr>
 <tr><td><cite>Punctuation</cite></td>
 <td><cite>Token.Punctuation</cite></td>
-<td>punctuation (<tt class="docutils literal"><span class="pre">[</span></tt>, <tt class="docutils literal"><span class="pre">(</span></tt>...)</td>
+<td>punctuation (<tt class="docutils literal">[</tt>, <tt class="docutils literal">(</tt>...)</td>
 </tr>
 <tr><td><cite>Comment</cite></td>
 <td><cite>Token.Comment</cite></td>
@@ -338,7 +338,7 @@ of those token aliases, a number of subtypes exists (excluding the special token
 <cite>Token.Text</cite>, <cite>Token.Error</cite> and <cite>Token.Other</cite>)</p>
 <p>The <cite>is_token_subtype()</cite> function in the <cite>pygments.token</cite> module can be used to
 test if a token type is a subtype of another (such as <cite>Name.Tag</cite> and <cite>Name</cite>).
-(This is the same as <tt class="docutils literal"><span class="pre">Name.Tag</span> <span class="pre">in</span> <span class="pre">Name</span></tt>. The overloaded <cite>in</cite> operator was newly
+(This is the same as <tt class="docutils literal">Name.Tag in Name</tt>. The overloaded <cite>in</cite> operator was newly
 introduced in Pygments 0.7, the function still exists for backwards
 compatiblity.)</p>
 <p>With Pygments 0.7, it's also possible to convert strings to token types (for example
@@ -358,21 +358,21 @@ if you want to supply a token from the command line):</p>
 <dd>For any kind of keyword (especially if it doesn't match any of the
 subtypes of course).</dd>
 <dt><cite>Keyword.Constant</cite></dt>
-<dd>For keywords that are constants (e.g. <tt class="docutils literal"><span class="pre">None</span></tt> in future Python versions).</dd>
+<dd>For keywords that are constants (e.g. <tt class="docutils literal">None</tt> in future Python versions).</dd>
 <dt><cite>Keyword.Declaration</cite></dt>
-<dd>For keywords used for variable declaration (e.g. <tt class="docutils literal"><span class="pre">var</span></tt> in some programming
+<dd>For keywords used for variable declaration (e.g. <tt class="docutils literal">var</tt> in some programming
 languages like JavaScript).</dd>
 <dt><cite>Keyword.Namespace</cite></dt>
-<dd>For keywords used for namespace declarations (e.g. <tt class="docutils literal"><span class="pre">import</span></tt> in Python and
-Java and <tt class="docutils literal"><span class="pre">package</span></tt> in Java).</dd>
+<dd>For keywords used for namespace declarations (e.g. <tt class="docutils literal">import</tt> in Python and
+Java and <tt class="docutils literal">package</tt> in Java).</dd>
 <dt><cite>Keyword.Pseudo</cite></dt>
-<dd>For keywords that aren't really keywords (e.g. <tt class="docutils literal"><span class="pre">None</span></tt> in old Python
+<dd>For keywords that aren't really keywords (e.g. <tt class="docutils literal">None</tt> in old Python
 versions).</dd>
 <dt><cite>Keyword.Reserved</cite></dt>
 <dd>For reserved keywords.</dd>
 <dt><cite>Keyword.Type</cite></dt>
-<dd>For builtin types that can't be used as identifiers (e.g. <tt class="docutils literal"><span class="pre">int</span></tt>,
-<tt class="docutils literal"><span class="pre">char</span></tt> etc. in C).</dd>
+<dd>For builtin types that can't be used as identifiers (e.g. <tt class="docutils literal">int</tt>,
+<tt class="docutils literal">char</tt> etc. in C).</dd>
 </dl>
 </div>
 <div class="section" id="name-tokens">
@@ -385,30 +385,30 @@ versions).</dd>
 <dt><cite>Name.Builtin</cite></dt>
 <dd>Builtin names; names that are available in the global namespace.</dd>
 <dt><cite>Name.Builtin.Pseudo</cite></dt>
-<dd>Builtin names that are implicit (e.g. <tt class="docutils literal"><span class="pre">self</span></tt> in Ruby, <tt class="docutils literal"><span class="pre">this</span></tt> in Java).</dd>
+<dd>Builtin names that are implicit (e.g. <tt class="docutils literal">self</tt> in Ruby, <tt class="docutils literal">this</tt> in Java).</dd>
 <dt><cite>Name.Class</cite></dt>
 <dd>Class names. Because no lexer can know if a name is a class or a function
 or something else this token is meant for class declarations.</dd>
 <dt><cite>Name.Constant</cite></dt>
 <dd>Token type for constants. In some languages you can recognise a token by the
-way it's defined (the value after a <tt class="docutils literal"><span class="pre">const</span></tt> keyword for example). In
+way it's defined (the value after a <tt class="docutils literal">const</tt> keyword for example). In
 other languages constants are uppercase by definition (Ruby).</dd>
 <dt><cite>Name.Decorator</cite></dt>
 <dd>Token type for decorators. Decorators are synatic elements in the Python
 language. Similar syntax elements exist in C# and Java.</dd>
 <dt><cite>Name.Entity</cite></dt>
-<dd>Token type for special entities. (e.g. <tt class="docutils literal"><span class="pre">&amp;nbsp;</span></tt> in HTML).</dd>
+<dd>Token type for special entities. (e.g. <tt class="docutils literal">&amp;nbsp;</tt> in HTML).</dd>
 <dt><cite>Name.Exception</cite></dt>
-<dd>Token type for exception names (e.g. <tt class="docutils literal"><span class="pre">RuntimeError</span></tt> in Python). Some languages
+<dd>Token type for exception names (e.g. <tt class="docutils literal">RuntimeError</tt> in Python). Some languages
 define exceptions in the function signature (Java). You can highlight
 the name of that exception using this token then.</dd>
 <dt><cite>Name.Function</cite></dt>
 <dd>Token type for function names.</dd>
 <dt><cite>Name.Label</cite></dt>
-<dd>Token type for label names (e.g. in languages that support <tt class="docutils literal"><span class="pre">goto</span></tt>).</dd>
+<dd>Token type for label names (e.g. in languages that support <tt class="docutils literal">goto</tt>).</dd>
 <dt><cite>Name.Namespace</cite></dt>
 <dd>Token type for namespaces. (e.g. import paths in Java/Python), names following
-the <tt class="docutils literal"><span class="pre">module</span></tt>/<tt class="docutils literal"><span class="pre">namespace</span></tt> keyword in other languages.</dd>
+the <tt class="docutils literal">module</tt>/<tt class="docutils literal">namespace</tt> keyword in other languages.</dd>
 <dt><cite>Name.Other</cite></dt>
 <dd>Other names. Normally unused.</dd>
 <dt><cite>Name.Tag</cite></dt>
@@ -431,7 +431,7 @@ example).</dd>
 <dt><cite>Literal</cite></dt>
 <dd>For any literal (if not further defined).</dd>
 <dt><cite>Literal.Date</cite></dt>
-<dd>for date literals (e.g. <tt class="docutils literal"><span class="pre">42d</span></tt> in Boo).</dd>
+<dd>for date literals (e.g. <tt class="docutils literal">42d</tt> in Boo).</dd>
 <dt><cite>String</cite></dt>
 <dd>For any string literal.</dd>
 <dt><cite>String.Backtick</cite></dt>
@@ -447,26 +447,26 @@ example).</dd>
 <dt><cite>String.Heredoc</cite></dt>
 <dd>Token type for &quot;heredoc&quot; strings (e.g. in Ruby or Perl).</dd>
 <dt><cite>String.Interpol</cite></dt>
-<dd>Token type for interpolated parts in strings (e.g. <tt class="docutils literal"><span class="pre">#{foo}</span></tt> in Ruby).</dd>
+<dd>Token type for interpolated parts in strings (e.g. <tt class="docutils literal">#{foo}</tt> in Ruby).</dd>
 <dt><cite>String.Other</cite></dt>
-<dd>Token type for any other strings (for example <tt class="docutils literal"><span class="pre">%q{foo}</span></tt> string constructs
+<dd>Token type for any other strings (for example <tt class="docutils literal">%q{foo}</tt> string constructs
 in Ruby).</dd>
 <dt><cite>String.Regex</cite></dt>
-<dd>Token type for regular expression literals (e.g. <tt class="docutils literal"><span class="pre">/foo/</span></tt> in JavaScript).</dd>
+<dd>Token type for regular expression literals (e.g. <tt class="docutils literal">/foo/</tt> in JavaScript).</dd>
 <dt><cite>String.Single</cite></dt>
 <dd>Token type for single quoted strings.</dd>
 <dt><cite>String.Symbol</cite></dt>
-<dd>Token type for symbols (e.g. <tt class="docutils literal"><span class="pre">:foo</span></tt> in LISP or Ruby).</dd>
+<dd>Token type for symbols (e.g. <tt class="docutils literal">:foo</tt> in LISP or Ruby).</dd>
 <dt><cite>Number</cite></dt>
 <dd>Token type for any number literal.</dd>
 <dt><cite>Number.Float</cite></dt>
-<dd>Token type for float literals (e.g. <tt class="docutils literal"><span class="pre">42.0</span></tt>).</dd>
+<dd>Token type for float literals (e.g. <tt class="docutils literal">42.0</tt>).</dd>
 <dt><cite>Number.Hex</cite></dt>
-<dd>Token type for hexadecimal number literals (e.g. <tt class="docutils literal"><span class="pre">0xdeadbeef</span></tt>).</dd>
+<dd>Token type for hexadecimal number literals (e.g. <tt class="docutils literal">0xdeadbeef</tt>).</dd>
 <dt><cite>Number.Integer</cite></dt>
-<dd>Token type for integer literals (e.g. <tt class="docutils literal"><span class="pre">42</span></tt>).</dd>
+<dd>Token type for integer literals (e.g. <tt class="docutils literal">42</tt>).</dd>
 <dt><cite>Number.Integer.Long</cite></dt>
-<dd>Token type for long integer literals (e.g. <tt class="docutils literal"><span class="pre">42L</span></tt> in Python).</dd>
+<dd>Token type for long integer literals (e.g. <tt class="docutils literal">42L</tt> in Python).</dd>
 <dt><cite>Number.Oct</cite></dt>
 <dd>Token type for octal literals.</dd>
 </dl>
@@ -475,9 +475,9 @@ in Ruby).</dd>
 <h3>Operators</h3>
 <dl class="docutils">
 <dt><cite>Operator</cite></dt>
-<dd>For any punctuation operator (e.g. <tt class="docutils literal"><span class="pre">+</span></tt>, <tt class="docutils literal"><span class="pre">-</span></tt>).</dd>
+<dd>For any punctuation operator (e.g. <tt class="docutils literal">+</tt>, <tt class="docutils literal">-</tt>).</dd>
 <dt><cite>Operator.Word</cite></dt>
-<dd>For any operator that is a word (e.g. <tt class="docutils literal"><span class="pre">not</span></tt>).</dd>
+<dd>For any operator that is a word (e.g. <tt class="docutils literal">not</tt>).</dd>
 </dl>
 </div>
 <div class="section" id="punctuation">
@@ -485,7 +485,7 @@ in Ruby).</dd>
 <p><em>New in Pygments 0.7.</em></p>
 <dl class="docutils">
 <dt><cite>Punctuation</cite></dt>
-<dd>For any punctuation which is not an operator (e.g. <tt class="docutils literal"><span class="pre">[</span></tt>, <tt class="docutils literal"><span class="pre">(</span></tt>...)</dd>
+<dd>For any punctuation which is not an operator (e.g. <tt class="docutils literal">[</tt>, <tt class="docutils literal">(</tt>...)</dd>
 </dl>
 </div>
 <div class="section" id="comments">
@@ -496,9 +496,9 @@ in Ruby).</dd>
 <dt><cite>Comment.Multiline</cite></dt>
 <dd>Token type for multiline comments.</dd>
 <dt><cite>Comment.Preproc</cite></dt>
-<dd>Token type for preprocessor comments (also <tt class="docutils literal"><span class="pre">&lt;?php</span></tt>/<tt class="docutils literal"><span class="pre">&lt;%</span></tt> constructs).</dd>
+<dd>Token type for preprocessor comments (also <tt class="docutils literal"><span class="pre">&lt;?php</span></tt>/<tt class="docutils literal">&lt;%</tt> constructs).</dd>
 <dt><cite>Comment.Single</cite></dt>
-<dd>Token type for comments that end at the end of a line (e.g. <tt class="docutils literal"><span class="pre">#</span> <span class="pre">foo</span></tt>).</dd>
+<dd>Token type for comments that end at the end of a line (e.g. <tt class="docutils literal"># foo</tt>).</dd>
 <dt><cite>Comment.Special</cite></dt>
 <dd>Special data in comments. For example code tags, author and license
 informations etc.</dd>
@@ -536,6 +536,6 @@ highlight a programming language but a patch file.</p>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:59.168145
+<!-- generated on: 2010-01-01 20:18:44.729344
      file id: tokens -->
 </html>
\ No newline at end of file
index 768495e66f61373da80d471305f19141554975dc..d6851ca213595b793db5f6426b3723498df329e9 100644 (file)
@@ -216,7 +216,7 @@ wrong encoding.</p>
 If you pass a lexer a string object (not unicode), it tries to decode the data
 using this encoding.
 You can override the encoding using the <cite>encoding</cite> lexer option. If you have the
-<a class="reference external" href="http://chardet.feedparser.org/">chardet</a> library installed and set the encoding to <tt class="docutils literal"><span class="pre">chardet</span></tt> if will ananlyse
+<a class="reference external" href="http://chardet.feedparser.org/">chardet</a> library installed and set the encoding to <tt class="docutils literal">chardet</tt> if will ananlyse
 the text and use the encoding it thinks is the right one automatically:</p>
 <div class="syntax"><pre><span class="kn">from</span> <span class="nn">pygments.lexers</span> <span class="kn">import</span> <span class="n">PythonLexer</span>
 <span class="n">lexer</span> <span class="o">=</span> <span class="n">PythonLexer</span><span class="p">(</span><span class="n">encoding</span><span class="o">=</span><span class="s">&#39;chardet&#39;</span><span class="p">)</span>
@@ -244,6 +244,6 @@ input and output encodings.</p>
 
   </div>
 </body>
-<!-- generated on: 2009-09-15 12:36:59.802096
+<!-- generated on: 2010-01-01 20:18:44.977011
      file id: unicode -->
 </html>
\ No newline at end of file
index 436b79e1104b6b18e89779bc711573edd22acf62..e5e7eaa0ca8686eaf1fcfb78e370fdf84e0507be 100644 (file)
@@ -6,7 +6,7 @@
 
     Generates a bunch of html files containing the documentation.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -119,7 +119,7 @@ def generate_authors():
     fn = os.path.abspath(os.path.join(os.path.dirname(__file__), '..',
                          'AUTHORS'))
     f = file(fn)
-    r = f.read().rstrip()
+    r = f.read().rstrip().decode('utf-8')
     f.close()
     return r
 
index ce14a3fd261d9fafd7c99272fca8cf44fb1aff39..a48a5c2788547b93570dba666d4b54e01aebb37a 100644 (file)
@@ -34,6 +34,11 @@ The above command could therefore also be given as::
 
     $ pygmentize -o test.html test.py
 
+To create a full HTML document, including line numbers and stylesheet (using the
+"emacs" style), highlighting the Python file ``test.py`` to ``test.html``::
+
+    $ pygmentize -O full,style=emacs -o test.html test.py
+
 
 Options and filters
 -------------------
@@ -117,15 +122,6 @@ will print the help for the HTML formatter, while ::
 will print the help for the Python lexer, etc.
 
 
-Examples
---------
-
-Create a full HTML document, including line numbers and stylesheet (using the
-"emacs" style), highlighting the Python file ``setup.py`` to ``setup.html``::
-
-    $ pygmentize -O full,style=emacs -o setup.html setup.py
-
-
 A note on encodings
 -------------------
 
index c611fc55f7e8b761f8939947038ae9e76c2dae8a..225391656488871bb249bae51bdbaf4fde077558 100644 (file)
@@ -4,8 +4,8 @@
 Installation
 ============
 
-Pygments requires at least Python 2.3 to work correctly. Just to clarify:
-there *won't* ever be support for Python versions below 2.3. However, there
+Pygments requires at least Python 2.4 to work correctly. Just to clarify:
+there *won't* ever be support for Python versions below 2.4. However, there
 are no other dependencies.
 
 
index 9351ce8f7417c8dde53c6a56feb5285c43b69f36..0371af2bc494f0f57354c4e98c8d04971ea5c39d 100644 (file)
@@ -27,7 +27,7 @@
 
     .. _Markdown: http://www.freewisdom.org/projects/python-markdown/
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 3117723d8745fa9d6b0c9713fc7884eb30b9e29c..6d55004ff8dac04f18886daceb957acbb6f53672 100644 (file)
@@ -31,7 +31,7 @@
     If you do not want to do that and are willing to accept larger HTML
     output, you can set the INLINESTYLES option below to True.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 4cd0d5010f2ebdc8e4586a2fb16453b3b986caa4..b7877ae715030c170004c5345986650f201080e6 100644 (file)
@@ -31,7 +31,7 @@
     .. _directive documentation:
        http://docutils.sourceforge.net/docs/howto/rst-directives.html
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 998e8d6150d66f9e14b7a9e719f1ee78f1cf4b5a..934adb54f47e65eb39a23c8e371ee2f5d95a7057 100644 (file)
@@ -31,7 +31,7 @@
     .. _directive documentation:
        http://docutils.sourceforge.net/docs/howto/rst-directives.html
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index e97dd6b5d6c77eaa55731ef7752374011c26c711..9a0a273fbb6eb2693fe5b3d72b04c897a557a58b 100644 (file)
     .. _Pygments tip:
        http://dev.pocoo.org/hg/pygments-main/archive/tip.tar.gz#egg=Pygments-dev
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
-__version__ = '1.1.1'
+__version__ = '1.2'
 __docformat__ = 'restructuredtext'
 
 __all__ = ['lex', 'format', 'highlight']
index c9a945de532e1db61c24829653a4007c72c84be4..cfce216ac1072e0745e4e1e40dac4e4691b609d3 100644 (file)
@@ -5,7 +5,7 @@
 
     Command line interface.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import sys
index 41284e5ba9fe9e2d00d6ffae3385c8fdeb9d3b62..92a8c6d81dff9cda931baf2ba79a2e30594960bf 100644 (file)
@@ -5,7 +5,7 @@
 
     Format colored console output.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index b7312e909ca2d394567605299dfa71a2e86fc654..acb0d0ada4caf0e17fc95d5c2d9d2d12315e9df0 100644 (file)
@@ -5,7 +5,7 @@
 
     Module that implements the default filter.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 08c2f3a14bcf91d30d20c4b5b009c6bc0a82ee7b..382933b0adbdc2dc0ae37573c2de07ea1632d72b 100644 (file)
@@ -6,7 +6,7 @@
     Module containing filter lookup functions and default
     filters.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 try:
@@ -283,10 +283,78 @@ class VisibleWhitespaceFilter(Filter):
                 yield ttype, value
 
 
+class GobbleFilter(Filter):
+    """
+    Gobbles source code lines (eats initial characters).
+
+    This filter drops the first ``n`` characters off every line of code.  This
+    may be useful when the source code fed to the lexer is indented by a fixed
+    amount of space that isn't desired in the output.
+
+    Options accepted:
+
+    `n` : int
+       The number of characters to gobble.
+
+    *New in Pygments 1.2.*
+    """
+    def __init__(self, **options):
+        Filter.__init__(self, **options)
+        self.n = get_int_opt(options, 'n', 0)
+
+    def gobble(self, value, left):
+        if left < len(value):
+            return value[left:], 0
+        else:
+            return '', left - len(value)
+
+    def filter(self, lexer, stream):
+        n = self.n
+        left = n # How many characters left to gobble.
+        for ttype, value in stream:
+            # Remove ``left`` tokens from first line, ``n`` from all others.
+            parts = value.split('\n')
+            (parts[0], left) = self.gobble(parts[0], left)
+            for i in range(1, len(parts)):
+                (parts[i], left) = self.gobble(parts[i], n)
+            value = '\n'.join(parts)
+
+            if value != '':
+                yield ttype, value
+
+
+class TokenMergeFilter(Filter):
+    """
+    Merges consecutive tokens with the same token type in the output stream of a
+    lexer.
+
+    *New in Pygments 1.2.*
+    """
+    def __init__(self, **options):
+        Filter.__init__(self, **options)
+
+    def filter(self, lexer, stream):
+        output = []
+        current_type = None
+        current_value = None
+        for ttype, value in stream:
+            if ttype is current_type:
+                current_value += value
+            else:
+                if current_type is not None:
+                    yield current_type, current_value
+                current_type = ttype
+                current_value = value
+        if current_type is not None:
+            yield current_type, current_value
+
+
 FILTERS = {
     'codetagify':     CodeTagFilter,
     'keywordcase':    KeywordCaseFilter,
     'highlight':      NameHighlightFilter,
     'raiseonerror':   RaiseOnErrorTokenFilter,
     'whitespace':     VisibleWhitespaceFilter,
+    'gobble':         GobbleFilter,
+    'tokenmerge':     TokenMergeFilter,
 }
index d6c75a017f7244c899f1054c74217c37ec0762d9..6eea3d75f1782e794c4b6c5b0a7ee662170d6ca7 100644 (file)
@@ -5,7 +5,7 @@
 
     Base formatter class.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 0dc3592d5b1833a269d9d6416e11ee881ca8e6a7..e5802b9925bf0ad1fb15ddc70a78f2d45f9a35a9 100644 (file)
@@ -5,7 +5,7 @@
 
     Pygments formatters.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import os.path
index 81556276a283eaf1690badf8e57d2553b9cf16b7..0c344a7a969e087e8bf3c0877452e364dbddea41 100755 (executable)
@@ -9,7 +9,7 @@
 
     Do not alter the FORMATTERS dictionary by hand.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 0bdae2dec817d1bba42e2785b16a2299101adbfb..03852b3e2a25381af034dc30843e6ee745bcc127 100644 (file)
@@ -5,7 +5,7 @@
 
     BBcode formatter.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 674856fa1e32c397cfac5eff7a2c14970acc1296..96cde3fb04111dc318296ec4ee9b692bb6028792 100644 (file)
@@ -5,7 +5,7 @@
 
     Formatter for HTML output.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import sys, os
@@ -582,15 +582,29 @@ class HtmlFormatter(Formatter):
                 yield 0, line
 
     def _wrap_div(self, inner):
+        style = []
+        if (self.noclasses and not self.nobackground and
+            self.style.background_color is not None):
+            style.append('background: %s' % (self.style.background_color,))
+        if self.cssstyles:
+            style.append(self.cssstyles)
+        style = '; '.join(style)
+
         yield 0, ('<div' + (self.cssclass and ' class="%s"' % self.cssclass)
-                  + (self.cssstyles and ' style="%s"' % self.cssstyles) + '>')
+                  + (style and (' style="%s"' % style)) + '>')
         for tup in inner:
             yield tup
         yield 0, '</div>\n'
 
     def _wrap_pre(self, inner):
-        yield 0, ('<pre'
-                  + (self.prestyles and ' style="%s"' % self.prestyles) + '>')
+        style = []
+        if self.prestyles:
+            style.append(self.prestyles)
+        if self.noclasses:
+            style.append('line-height: 125%')
+        style = '; '.join(style)
+
+        yield 0, ('<pre' + (style and ' style="%s"' % style) + '>')
         for tup in inner:
             yield tup
         yield 0, '</pre>'
@@ -661,7 +675,14 @@ class HtmlFormatter(Formatter):
             if t != 1:
                 yield t, value
             if i + 1 in hls: # i + 1 because Python indexes start at 0
-                yield 1, '<span class="hll">%s</span>' % value
+                if self.noclasses:
+                    style = ''
+                    if self.style.highlight_color is not None:
+                        style = (' style="background-color: %s"' %
+                                 (self.style.highlight_color,))
+                    yield 1, '<span%s>%s</span>' % (style, value)
+                else:
+                    yield 1, '<span class="hll">%s</span>' % value
             else:
                 yield 1, value
 
index 91bf5179628c2db56f282b456f4dcd762e779eae..69ac484b85a712be22674277aa1b411ab24feda9 100644 (file)
@@ -5,7 +5,7 @@
 
     Formatter for Pixmap output.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -13,7 +13,8 @@ import sys
 from commands import getstatusoutput
 
 from pygments.formatter import Formatter
-from pygments.util import get_bool_opt, get_int_opt, get_choice_opt
+from pygments.util import get_bool_opt, get_int_opt, \
+     get_list_opt, get_choice_opt
 
 # Import this carefully
 try:
@@ -207,6 +208,11 @@ class ImageFormatter(Formatter):
 
         Default: True
 
+    `line_number_start`
+        The line number of the first line.
+
+        Default: 1
+
     `line_number_step`
         The step used when printing line numbers.
 
@@ -250,6 +256,16 @@ class ImageFormatter(Formatter):
         the source code area.
 
         Default: 6
+
+    `hl_lines`
+        Specify a list of lines to be highlighted.  *New in Pygments 1.2.*
+
+        Default: empty list
+
+    `hl_color`
+        Specify the color for highlighting lines.  *New in Pygments 1.2.*
+
+        Default: highlight color of the selected style
     """
 
     # Required by the pygments mapper
@@ -299,11 +315,21 @@ class ImageFormatter(Formatter):
         self.line_number_separator = get_bool_opt(options,
                                         'line_number_separator', True)
         self.line_number_step = get_int_opt(options, 'line_number_step', 1)
+        self.line_number_start = get_int_opt(options, 'line_number_start', 1)
         if self.line_numbers:
             self.line_number_width = (self.fontw * self.line_number_chars +
                                    self.line_number_pad * 2)
         else:
             self.line_number_width = 0
+        self.hl_lines = []
+        hl_lines_str = get_list_opt(options, 'hl_lines', [])
+        for line in hl_lines_str:
+            try:
+                self.hl_lines.append(int(line))
+            except ValueError:
+                pass
+        self.hl_color = options.get('hl_color',
+                                    self.style.highlight_color) or '#f90'
         self.drawables = []
 
     def get_style_defs(self, arg=''):
@@ -369,13 +395,13 @@ class ImageFormatter(Formatter):
         return (self._get_char_x(maxcharno) + self.image_pad,
                 self._get_line_y(maxlineno + 0) + self.image_pad)
 
-    def _draw_linenumber(self, lineno):
+    def _draw_linenumber(self, posno, lineno):
         """
         Remember a line number drawable to paint later.
         """
         self._draw_text(
-            self._get_linenumber_pos(lineno),
-            str(lineno + 1).rjust(self.line_number_chars),
+            self._get_linenumber_pos(posno),
+            str(lineno).rjust(self.line_number_chars),
             font=self.fonts.get_font(self.line_number_bold,
                                      self.line_number_italic),
             fill=self.line_number_fg,
@@ -426,9 +452,10 @@ class ImageFormatter(Formatter):
         """
         if not self.line_numbers:
             return
-        for i in xrange(self.maxlineno):
-            if ((i + 1) % self.line_number_step) == 0:
-                self._draw_linenumber(i)
+        for p in xrange(self.maxlineno):
+            n = p + self.line_number_start
+            if (n % self.line_number_step) == 0:
+                self._draw_linenumber(p, n)
 
     def _paint_line_number_bg(self, im):
         """
@@ -464,6 +491,15 @@ class ImageFormatter(Formatter):
         )
         self._paint_line_number_bg(im)
         draw = ImageDraw.Draw(im)
+        # Highlight
+        if self.hl_lines:
+            x = self.image_pad + self.line_number_width - self.line_number_pad + 1
+            recth = self._get_line_height()
+            rectw = im.size[0] - x
+            for linenumber in self.hl_lines:
+                y = self._get_line_y(linenumber - 1)
+                draw.rectangle([(x, y), (x + rectw, y + recth)],
+                               fill=self.hl_color)
         for pos, value, font, kw in self.drawables:
             draw.text(pos, value, font=font, **kw)
         im.save(outfile, self.image_format.upper())
index a5911a3a9db83704c30b1e0d883ce65aee9b9c73..a9059b1413bf00e1b8c6bfe656518c7fcce6fbf2 100644 (file)
@@ -5,7 +5,7 @@
 
     Formatter for LaTeX fancyvrb output.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -18,12 +18,16 @@ __all__ = ['LatexFormatter']
 
 
 def escape_tex(text, commandprefix):
-    return text.replace('@', '\x00').    \
-                replace('[', '\x01').    \
-                replace(']', '\x02').    \
-                replace('\x00', '@%sZat[]' % commandprefix).\
-                replace('\x01', '@%sZlb[]' % commandprefix).\
-                replace('\x02', '@%sZrb[]' % commandprefix)
+    return text.replace('\\', '\x00'). \
+                replace('{', '\x01'). \
+                replace('}', '\x02'). \
+                replace('^', '\x03'). \
+                replace('_', '\x04'). \
+                replace('\x00', r'\%sZbs{}' % commandprefix). \
+                replace('\x01', r'\%sZob{}' % commandprefix). \
+                replace('\x02', r'\%sZcb{}' % commandprefix). \
+                replace('\x03', r'\%sZca{}' % commandprefix). \
+                replace('\x04', r'\%sZus{}' % commandprefix)
 
 
 DOC_TEMPLATE = r'''
@@ -92,9 +96,11 @@ STYLE_TEMPLATE = r'''
 
 %(styles)s
 
-\def\%(cp)sZat{@}
-\def\%(cp)sZlb{[}
-\def\%(cp)sZrb{]}
+\def\%(cp)sZbs{\char`\\}
+\def\%(cp)sZus{\char`\_}
+\def\%(cp)sZob{\char`\{}
+\def\%(cp)sZcb{\char`\}}
+\def\%(cp)sZca{\char`\^}
 \makeatother
 '''
 
@@ -177,6 +183,16 @@ class LatexFormatter(Formatter):
         *New in Pygments 0.7.*
 
         *New in Pygments 0.10:* the default is now ``'PY'`` instead of ``'C'``.
+
+    `texcomments`
+        If set to ``True``, enables LaTeX comment lines.  That is, LaTex markup
+        in comment tokens is not escaped so that LaTeX can render it (default:
+        ``False``).  *New in Pygments 1.2.*
+
+    `mathescape`
+        If set to ``True``, enables LaTeX math mode escape in comments. That
+        is, ``'$...$'`` inside a comment will trigger math mode (default:
+        ``False``).  *New in Pygments 1.2.*
     """
     name = 'LaTeX'
     aliases = ['latex', 'tex']
@@ -192,6 +208,8 @@ class LatexFormatter(Formatter):
         self.verboptions = options.get('verboptions', '')
         self.nobackground = get_bool_opt(options, 'nobackground', False)
         self.commandprefix = options.get('commandprefix', 'PY')
+        self.texcomments = get_bool_opt(options, 'texcomments', False)
+        self.mathescape = get_bool_opt(options, 'mathescape', False)
 
         self._create_stylesheet()
 
@@ -260,18 +278,46 @@ class LatexFormatter(Formatter):
             realoutfile = outfile
             outfile = StringIO()
 
-        outfile.write(r'\begin{Verbatim}[commandchars=@\[\]')
+        outfile.write(r'\begin{Verbatim}[commandchars=\\\{\}')
         if self.linenos:
             start, step = self.linenostart, self.linenostep
             outfile.write(',numbers=left' +
                           (start and ',firstnumber=%d' % start or '') +
                           (step and ',stepnumber=%d' % step or ''))
+        if self.mathescape or self.texcomments:
+            outfile.write(r',codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8}')
         if self.verboptions:
             outfile.write(',' + self.verboptions)
         outfile.write(']\n')
 
         for ttype, value in tokensource:
-            value = escape_tex(value, self.commandprefix)
+            if ttype in Token.Comment:
+                if self.texcomments:
+                    # Try to guess comment starting lexeme and escape it ...
+                    start = value[0:1]
+                    for i in xrange(1, len(value)):
+                        if start[0] != value[i]:
+                            break
+                        start += value[i]
+
+                    value = value[len(start):]
+                    start = escape_tex(start, self.commandprefix)
+
+                    # ... but do not escape inside comment.
+                    value = start + value
+                elif self.mathescape:
+                    # Only escape parts not inside a math environment.
+                    parts = value.split('$')
+                    in_math = False
+                    for i, part in enumerate(parts):
+                        if not in_math:
+                            parts[i] = escape_tex(part, self.commandprefix)
+                        in_math = not in_math
+                    value = '$'.join(parts)
+                else:
+                    value = escape_tex(value, self.commandprefix)
+            else:
+                value = escape_tex(value, self.commandprefix)
             styles = []
             while ttype is not Token:
                 try:
@@ -285,10 +331,10 @@ class LatexFormatter(Formatter):
                 spl = value.split('\n')
                 for line in spl[:-1]:
                     if line:
-                        outfile.write("@%s[%s][%s]" % (cp, styleval, line))
+                        outfile.write("\\%s{%s}{%s}" % (cp, styleval, line))
                     outfile.write('\n')
                 if spl[-1]:
-                    outfile.write("@%s[%s][%s]" % (cp, styleval, spl[-1]))
+                    outfile.write("\\%s{%s}{%s}" % (cp, styleval, spl[-1]))
             else:
                 outfile.write(value)
 
index 4b195244d2762d8bda2cfc06e4c56faddfba12e0..249291a814680ff1dd8c54705eedb8e409cc3774 100644 (file)
@@ -5,7 +5,7 @@
 
     Other formatters: NullFormatter, RawTokenFormatter.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 501ef4244707ecc24beb1147926ccc33cc46440a..83414c589d8be4ee63f8016969ea284de73b6dcd 100644 (file)
@@ -5,7 +5,7 @@
 
     A formatter that generates RTF files.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index ade86629bfeea65487720f27dd95d97fc9c29194..9928345abc48083cf3da1c758c52f06f1809cbf9 100644 (file)
@@ -5,7 +5,7 @@
 
     Formatter for SVG output.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index fdcc8dcc106366c38bcb6a976a490d6eccd4218a..fc05cad7f9ac394d8d2cd2448f6849c68a9a96c4 100644 (file)
@@ -5,7 +5,7 @@
 
     Formatter for terminal output with ANSI sequences.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index f1f7dc7e8eb1c4f759ad68d7bf040fc038c2ad53..d72a939e7d001ee34426a3ebbbb95efb05ca56a6 100644 (file)
@@ -11,7 +11,7 @@
 
     Formatter version 1.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index cf5115f172647e652d5fdcec12266d080cb079ac..f28627b3a2e159f8d56a399794a24b569d676d3d 100644 (file)
@@ -5,7 +5,7 @@
 
     Base lexer classes.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import re
index d9d475f7936d78f75143f44f9780ae6f6f7f6c0e..c1890a907fdc297a08582f3fce2f5b6b17aa7d13 100644 (file)
@@ -5,7 +5,7 @@
 
     Pygments lexers.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import sys
diff --git a/pygments/lexers/_asybuiltins.py b/pygments/lexers/_asybuiltins.py
new file mode 100644 (file)
index 0000000..fbfd937
--- /dev/null
@@ -0,0 +1,1645 @@
+# -*- coding: utf-8 -*-
+"""
+    pygments.lexers._asybuiltins
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    This file contains the asy-function names and asy-variable names of
+    Asymptote.
+
+    Do not edit the ASYFUNCNAME and ASYVARNAME sets by hand.
+    TODO: perl/python script in Asymptote SVN similar to asy-list.pl but only
+    for function and variable names.
+
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+"""
+
+ASYFUNCNAME = set([
+    'AND',
+    'Arc',
+    'ArcArrow',
+    'ArcArrows',
+    'Arrow',
+    'Arrows',
+    'Automatic',
+    'AvantGarde',
+    'BBox',
+    'BWRainbow',
+    'BWRainbow2',
+    'Bar',
+    'Bars',
+    'BeginArcArrow',
+    'BeginArrow',
+    'BeginBar',
+    'BeginDotMargin',
+    'BeginMargin',
+    'BeginPenMargin',
+    'Blank',
+    'Bookman',
+    'Bottom',
+    'BottomTop',
+    'Bounds',
+    'Break',
+    'Broken',
+    'BrokenLog',
+    'Ceil',
+    'Circle',
+    'CircleBarIntervalMarker',
+    'Cos',
+    'Courier',
+    'CrossIntervalMarker',
+    'DefaultFormat',
+    'DefaultLogFormat',
+    'Degrees',
+    'Dir',
+    'DotMargin',
+    'DotMargins',
+    'Dotted',
+    'Draw',
+    'Drawline',
+    'Embed',
+    'EndArcArrow',
+    'EndArrow',
+    'EndBar',
+    'EndDotMargin',
+    'EndMargin',
+    'EndPenMargin',
+    'Fill',
+    'FillDraw',
+    'Floor',
+    'Format',
+    'Full',
+    'Gaussian',
+    'Gaussrand',
+    'Gaussrandpair',
+    'Gradient',
+    'Grayscale',
+    'Helvetica',
+    'Hermite',
+    'HookHead',
+    'InOutTicks',
+    'InTicks',
+    'J',
+    'Label',
+    'Landscape',
+    'Left',
+    'LeftRight',
+    'LeftTicks',
+    'Legend',
+    'Linear',
+    'Link',
+    'Log',
+    'LogFormat',
+    'Margin',
+    'Margins',
+    'Mark',
+    'MidArcArrow',
+    'MidArrow',
+    'NOT',
+    'NewCenturySchoolBook',
+    'NoBox',
+    'NoMargin',
+    'NoModifier',
+    'NoTicks',
+    'NoTicks3',
+    'NoZero',
+    'NoZeroFormat',
+    'None',
+    'OR',
+    'OmitFormat',
+    'OmitTick',
+    'OutTicks',
+    'Ox',
+    'Oy',
+    'Palatino',
+    'PaletteTicks',
+    'Pen',
+    'PenMargin',
+    'PenMargins',
+    'Pentype',
+    'Portrait',
+    'RadialShade',
+    'Rainbow',
+    'Range',
+    'Relative',
+    'Right',
+    'RightTicks',
+    'Rotate',
+    'Round',
+    'SQR',
+    'Scale',
+    'ScaleX',
+    'ScaleY',
+    'ScaleZ',
+    'Seascape',
+    'Shift',
+    'Sin',
+    'Slant',
+    'Spline',
+    'StickIntervalMarker',
+    'Straight',
+    'Symbol',
+    'Tan',
+    'TeXify',
+    'Ticks',
+    'Ticks3',
+    'TildeIntervalMarker',
+    'TimesRoman',
+    'Top',
+    'TrueMargin',
+    'UnFill',
+    'UpsideDown',
+    'Wheel',
+    'X',
+    'XEquals',
+    'XOR',
+    'XY',
+    'XYEquals',
+    'XYZero',
+    'XYgrid',
+    'XZEquals',
+    'XZZero',
+    'XZero',
+    'XZgrid',
+    'Y',
+    'YEquals',
+    'YXgrid',
+    'YZ',
+    'YZEquals',
+    'YZZero',
+    'YZero',
+    'YZgrid',
+    'Z',
+    'ZX',
+    'ZXgrid',
+    'ZYgrid',
+    'ZapfChancery',
+    'ZapfDingbats',
+    '_cputime',
+    '_draw',
+    '_eval',
+    '_image',
+    '_labelpath',
+    '_projection',
+    '_strokepath',
+    '_texpath',
+    'aCos',
+    'aSin',
+    'aTan',
+    'abort',
+    'abs',
+    'accel',
+    'acos',
+    'acosh',
+    'acot',
+    'acsc',
+    'add',
+    'addArrow',
+    'addMargins',
+    'addSaveFunction',
+    'addnode',
+    'addnodes',
+    'addpenarc',
+    'addpenline',
+    'addseg',
+    'adjust',
+    'alias',
+    'align',
+    'all',
+    'altitude',
+    'angabscissa',
+    'angle',
+    'angpoint',
+    'animate',
+    'annotate',
+    'anticomplementary',
+    'antipedal',
+    'apply',
+    'approximate',
+    'arc',
+    'arcarrowsize',
+    'arccircle',
+    'arcdir',
+    'arcfromcenter',
+    'arcfromfocus',
+    'arclength',
+    'arcnodesnumber',
+    'arcpoint',
+    'arcsubtended',
+    'arcsubtendedcenter',
+    'arctime',
+    'arctopath',
+    'array',
+    'arrow',
+    'arrow2',
+    'arrowbase',
+    'arrowbasepoints',
+    'arrowsize',
+    'asec',
+    'asin',
+    'asinh',
+    'ask',
+    'assert',
+    'asy',
+    'asycode',
+    'asydir',
+    'asyfigure',
+    'asyfilecode',
+    'asyinclude',
+    'asywrite',
+    'atan',
+    'atan2',
+    'atanh',
+    'atbreakpoint',
+    'atexit',
+    'atime',
+    'attach',
+    'attract',
+    'atupdate',
+    'autoformat',
+    'autoscale',
+    'autoscale3',
+    'axes',
+    'axes3',
+    'axialshade',
+    'axis',
+    'axiscoverage',
+    'azimuth',
+    'babel',
+    'background',
+    'bangles',
+    'bar',
+    'barmarksize',
+    'barsize',
+    'basealign',
+    'baseline',
+    'bbox',
+    'beep',
+    'begin',
+    'beginclip',
+    'begingroup',
+    'beginpoint',
+    'between',
+    'bevel',
+    'bezier',
+    'bezierP',
+    'bezierPP',
+    'bezierPPP',
+    'bezulate',
+    'bibliography',
+    'bibliographystyle',
+    'binarytree',
+    'binarytreeNode',
+    'binomial',
+    'binput',
+    'bins',
+    'bisector',
+    'bisectorpoint',
+    'blend',
+    'boutput',
+    'box',
+    'bqe',
+    'breakpoint',
+    'breakpoints',
+    'brick',
+    'buildRestoreDefaults',
+    'buildRestoreThunk',
+    'buildcycle',
+    'bulletcolor',
+    'canonical',
+    'canonicalcartesiansystem',
+    'cartesiansystem',
+    'case1',
+    'case2',
+    'case3',
+    'cbrt',
+    'cd',
+    'ceil',
+    'center',
+    'centerToFocus',
+    'centroid',
+    'cevian',
+    'change2',
+    'changecoordsys',
+    'checkSegment',
+    'checkconditionlength',
+    'checker',
+    'checklengths',
+    'checkposition',
+    'checktriangle',
+    'choose',
+    'circle',
+    'circlebarframe',
+    'circlemarkradius',
+    'circlenodesnumber',
+    'circumcenter',
+    'circumcircle',
+    'clamped',
+    'clear',
+    'clip',
+    'clipdraw',
+    'close',
+    'cmyk',
+    'code',
+    'colatitude',
+    'collect',
+    'collinear',
+    'color',
+    'colorless',
+    'colors',
+    'colorspace',
+    'comma',
+    'compassmark',
+    'complement',
+    'complementary',
+    'concat',
+    'concurrent',
+    'cone',
+    'conic',
+    'conicnodesnumber',
+    'conictype',
+    'conj',
+    'connect',
+    'containmentTree',
+    'contains',
+    'contour',
+    'contour3',
+    'controlSpecifier',
+    'convert',
+    'coordinates',
+    'coordsys',
+    'copy',
+    'cos',
+    'cosh',
+    'cot',
+    'countIntersections',
+    'cputime',
+    'crop',
+    'cropcode',
+    'cross',
+    'crossframe',
+    'crosshatch',
+    'crossmarksize',
+    'csc',
+    'cubicroots',
+    'curabscissa',
+    'curlSpecifier',
+    'curpoint',
+    'currentarrow',
+    'currentexitfunction',
+    'currentmomarrow',
+    'currentpolarconicroutine',
+    'curve',
+    'cut',
+    'cutafter',
+    'cutbefore',
+    'cyclic',
+    'cylinder',
+    'debugger',
+    'deconstruct',
+    'defaultdir',
+    'defaultformat',
+    'defaultpen',
+    'defined',
+    'degenerate',
+    'degrees',
+    'delete',
+    'deletepreamble',
+    'determinant',
+    'diagonal',
+    'diamond',
+    'diffdiv',
+    'dir',
+    'dirSpecifier',
+    'dirtime',
+    'display',
+    'distance',
+    'divisors',
+    'do_overpaint',
+    'dot',
+    'dotframe',
+    'dotsize',
+    'downcase',
+    'draw',
+    'drawAll',
+    'drawDoubleLine',
+    'drawFermion',
+    'drawGhost',
+    'drawGluon',
+    'drawMomArrow',
+    'drawPhoton',
+    'drawScalar',
+    'drawVertex',
+    'drawVertexBox',
+    'drawVertexBoxO',
+    'drawVertexBoxX',
+    'drawVertexO',
+    'drawVertexOX',
+    'drawVertexTriangle',
+    'drawVertexTriangleO',
+    'drawVertexX',
+    'drawarrow',
+    'drawarrow2',
+    'drawline',
+    'drawtick',
+    'duplicate',
+    'elle',
+    'ellipse',
+    'ellipsenodesnumber',
+    'embed',
+    'embed3',
+    'empty',
+    'enclose',
+    'end',
+    'endScript',
+    'endclip',
+    'endgroup',
+    'endl',
+    'endpoint',
+    'endpoints',
+    'eof',
+    'eol',
+    'equation',
+    'equations',
+    'erase',
+    'erasestep',
+    'erf',
+    'erfc',
+    'error',
+    'errorbar',
+    'errorbars',
+    'eval',
+    'excenter',
+    'excircle',
+    'exit',
+    'exitXasyMode',
+    'exitfunction',
+    'exp',
+    'expfactors',
+    'expi',
+    'expm1',
+    'exradius',
+    'extend',
+    'extension',
+    'extouch',
+    'fabs',
+    'factorial',
+    'fermat',
+    'fft',
+    'fhorner',
+    'figure',
+    'file',
+    'filecode',
+    'fill',
+    'filldraw',
+    'filloutside',
+    'fillrule',
+    'filltype',
+    'find',
+    'finite',
+    'finiteDifferenceJacobian',
+    'firstcut',
+    'firstframe',
+    'fit',
+    'fit2',
+    'fixedscaling',
+    'floor',
+    'flush',
+    'fmdefaults',
+    'fmod',
+    'focusToCenter',
+    'font',
+    'fontcommand',
+    'fontsize',
+    'foot',
+    'format',
+    'frac',
+    'frequency',
+    'fromCenter',
+    'fromFocus',
+    'fspline',
+    'functionshade',
+    'gamma',
+    'generate_random_backtrace',
+    'generateticks',
+    'gergonne',
+    'getc',
+    'getint',
+    'getpair',
+    'getreal',
+    'getstring',
+    'gettriple',
+    'gluon',
+    'gouraudshade',
+    'graph',
+    'graphic',
+    'gray',
+    'grestore',
+    'grid',
+    'grid3',
+    'gsave',
+    'halfbox',
+    'hatch',
+    'hdiffdiv',
+    'hermite',
+    'hex',
+    'histogram',
+    'history',
+    'hline',
+    'hprojection',
+    'hsv',
+    'hyperbola',
+    'hyperbolanodesnumber',
+    'hyperlink',
+    'hypot',
+    'identity',
+    'image',
+    'incenter',
+    'incentral',
+    'incircle',
+    'increasing',
+    'incrementposition',
+    'indexedTransform',
+    'indexedfigure',
+    'initXasyMode',
+    'initdefaults',
+    'input',
+    'inradius',
+    'insert',
+    'inside',
+    'integrate',
+    'interactive',
+    'interior',
+    'interp',
+    'interpolate',
+    'intersect',
+    'intersection',
+    'intersectionpoint',
+    'intersectionpoints',
+    'intersections',
+    'intouch',
+    'inverse',
+    'inversion',
+    'invisible',
+    'is3D',
+    'isDuplicate',
+    'isogonal',
+    'isogonalconjugate',
+    'isotomic',
+    'isotomicconjugate',
+    'isparabola',
+    'italic',
+    'item',
+    'key',
+    'kurtosis',
+    'kurtosisexcess',
+    'label',
+    'labelaxis',
+    'labelmargin',
+    'labelpath',
+    'labels',
+    'labeltick',
+    'labelx',
+    'labelx3',
+    'labely',
+    'labely3',
+    'labelz',
+    'labelz3',
+    'lastcut',
+    'latex',
+    'latitude',
+    'latticeshade',
+    'layer',
+    'layout',
+    'ldexp',
+    'leastsquares',
+    'legend',
+    'legenditem',
+    'length',
+    'lift',
+    'light',
+    'limits',
+    'line',
+    'linear',
+    'linecap',
+    'lineinversion',
+    'linejoin',
+    'linemargin',
+    'lineskip',
+    'linetype',
+    'linewidth',
+    'link',
+    'list',
+    'lm_enorm',
+    'lm_evaluate_default',
+    'lm_lmdif',
+    'lm_lmpar',
+    'lm_minimize',
+    'lm_print_default',
+    'lm_print_quiet',
+    'lm_qrfac',
+    'lm_qrsolv',
+    'locale',
+    'locate',
+    'locatefile',
+    'location',
+    'log',
+    'log10',
+    'log1p',
+    'logaxiscoverage',
+    'longitude',
+    'lookup',
+    'magnetize',
+    'makeNode',
+    'makedraw',
+    'makepen',
+    'map',
+    'margin',
+    'markangle',
+    'markangleradius',
+    'markanglespace',
+    'markarc',
+    'marker',
+    'markinterval',
+    'marknodes',
+    'markrightangle',
+    'markuniform',
+    'mass',
+    'masscenter',
+    'massformat',
+    'math',
+    'max',
+    'max3',
+    'maxbezier',
+    'maxbound',
+    'maxcoords',
+    'maxlength',
+    'maxratio',
+    'maxtimes',
+    'mean',
+    'medial',
+    'median',
+    'midpoint',
+    'min',
+    'min3',
+    'minbezier',
+    'minbound',
+    'minipage',
+    'minratio',
+    'mintimes',
+    'miterlimit',
+    'momArrowPath',
+    'momarrowsize',
+    'monotonic',
+    'multifigure',
+    'nativeformat',
+    'natural',
+    'needshipout',
+    'newl',
+    'newpage',
+    'newslide',
+    'newton',
+    'newtree',
+    'nextframe',
+    'nextnormal',
+    'nextpage',
+    'nib',
+    'nodabscissa',
+    'none',
+    'norm',
+    'normalvideo',
+    'notaknot',
+    'nowarn',
+    'numberpage',
+    'nurb',
+    'object',
+    'offset',
+    'onpath',
+    'opacity',
+    'opposite',
+    'orientation',
+    'orig_circlenodesnumber',
+    'orig_circlenodesnumber1',
+    'orig_draw',
+    'orig_ellipsenodesnumber',
+    'orig_ellipsenodesnumber1',
+    'orig_hyperbolanodesnumber',
+    'orig_parabolanodesnumber',
+    'origin',
+    'orthic',
+    'orthocentercenter',
+    'outformat',
+    'outline',
+    'outprefix',
+    'output',
+    'overloadedMessage',
+    'overwrite',
+    'pack',
+    'pad',
+    'pairs',
+    'palette',
+    'parabola',
+    'parabolanodesnumber',
+    'parallel',
+    'partialsum',
+    'path',
+    'path3',
+    'pattern',
+    'pause',
+    'pdf',
+    'pedal',
+    'periodic',
+    'perp',
+    'perpendicular',
+    'perpendicularmark',
+    'phantom',
+    'phi1',
+    'phi2',
+    'phi3',
+    'photon',
+    'piecewisestraight',
+    'point',
+    'polar',
+    'polarconicroutine',
+    'polargraph',
+    'polygon',
+    'postcontrol',
+    'postscript',
+    'pow10',
+    'ppoint',
+    'prc',
+    'prc0',
+    'precision',
+    'precontrol',
+    'prepend',
+    'print_random_addresses',
+    'project',
+    'projection',
+    'purge',
+    'pwhermite',
+    'quadrant',
+    'quadraticroots',
+    'quantize',
+    'quarticroots',
+    'quotient',
+    'radialshade',
+    'radians',
+    'radicalcenter',
+    'radicalline',
+    'radius',
+    'rand',
+    'randompath',
+    'rd',
+    'readline',
+    'realmult',
+    'realquarticroots',
+    'rectangle',
+    'rectangular',
+    'rectify',
+    'reflect',
+    'relabscissa',
+    'relative',
+    'relativedistance',
+    'reldir',
+    'relpoint',
+    'reltime',
+    'remainder',
+    'remark',
+    'removeDuplicates',
+    'rename',
+    'replace',
+    'report',
+    'resetdefaultpen',
+    'restore',
+    'restoredefaults',
+    'reverse',
+    'reversevideo',
+    'rf',
+    'rfind',
+    'rgb',
+    'rgba',
+    'rgbint',
+    'rms',
+    'rotate',
+    'rotateO',
+    'rotation',
+    'round',
+    'roundbox',
+    'roundedpath',
+    'roundrectangle',
+    'samecoordsys',
+    'sameside',
+    'sample',
+    'save',
+    'savedefaults',
+    'saveline',
+    'scale',
+    'scale3',
+    'scaleO',
+    'scaleT',
+    'scaleless',
+    'scientific',
+    'search',
+    'searchtree',
+    'sec',
+    'secondaryX',
+    'secondaryY',
+    'seconds',
+    'section',
+    'sector',
+    'seek',
+    'seekeof',
+    'segment',
+    'sequence',
+    'setpens',
+    'sgn',
+    'sgnd',
+    'sharpangle',
+    'sharpdegrees',
+    'shift',
+    'shiftless',
+    'shipout',
+    'shipout3',
+    'show',
+    'side',
+    'simeq',
+    'simpson',
+    'sin',
+    'single',
+    'sinh',
+    'size',
+    'size3',
+    'skewness',
+    'skip',
+    'slant',
+    'sleep',
+    'slope',
+    'slopefield',
+    'solve',
+    'solveBVP',
+    'sort',
+    'sourceline',
+    'sphere',
+    'split',
+    'sqrt',
+    'square',
+    'srand',
+    'standardizecoordsys',
+    'startScript',
+    'startTrembling',
+    'stdev',
+    'step',
+    'stickframe',
+    'stickmarksize',
+    'stickmarkspace',
+    'stop',
+    'straight',
+    'straightness',
+    'string',
+    'stripdirectory',
+    'stripextension',
+    'stripfile',
+    'strokepath',
+    'subdivide',
+    'subitem',
+    'subpath',
+    'substr',
+    'sum',
+    'surface',
+    'symmedial',
+    'symmedian',
+    'system',
+    'tab',
+    'tableau',
+    'tan',
+    'tangent',
+    'tangential',
+    'tangents',
+    'tanh',
+    'tell',
+    'tensionSpecifier',
+    'tensorshade',
+    'tex',
+    'texcolor',
+    'texify',
+    'texpath',
+    'texpreamble',
+    'texreset',
+    'texshipout',
+    'texsize',
+    'textpath',
+    'thick',
+    'thin',
+    'tick',
+    'tickMax',
+    'tickMax3',
+    'tickMin',
+    'tickMin3',
+    'ticklabelshift',
+    'ticklocate',
+    'tildeframe',
+    'tildemarksize',
+    'tile',
+    'tiling',
+    'time',
+    'times',
+    'title',
+    'titlepage',
+    'topbox',
+    'transform',
+    'transformation',
+    'transpose',
+    'tremble',
+    'trembleFuzz',
+    'tremble_circlenodesnumber',
+    'tremble_circlenodesnumber1',
+    'tremble_draw',
+    'tremble_ellipsenodesnumber',
+    'tremble_ellipsenodesnumber1',
+    'tremble_hyperbolanodesnumber',
+    'tremble_marknodes',
+    'tremble_markuniform',
+    'tremble_parabolanodesnumber',
+    'triangle',
+    'triangleAbc',
+    'triangleabc',
+    'triangulate',
+    'tricoef',
+    'tridiagonal',
+    'trilinear',
+    'trim',
+    'trueMagnetize',
+    'truepoint',
+    'tube',
+    'uncycle',
+    'unfill',
+    'uniform',
+    'unit',
+    'unitrand',
+    'unitsize',
+    'unityroot',
+    'unstraighten',
+    'upcase',
+    'updatefunction',
+    'uperiodic',
+    'upscale',
+    'uptodate',
+    'usepackage',
+    'usersetting',
+    'usetypescript',
+    'usleep',
+    'value',
+    'variance',
+    'variancebiased',
+    'vbox',
+    'vector',
+    'vectorfield',
+    'verbatim',
+    'view',
+    'vline',
+    'vperiodic',
+    'vprojection',
+    'warn',
+    'warning',
+    'windingnumber',
+    'write',
+    'xaxis',
+    'xaxis3',
+    'xaxis3At',
+    'xaxisAt',
+    'xequals',
+    'xinput',
+    'xlimits',
+    'xoutput',
+    'xpart',
+    'xscale',
+    'xscaleO',
+    'xtick',
+    'xtick3',
+    'xtrans',
+    'yaxis',
+    'yaxis3',
+    'yaxis3At',
+    'yaxisAt',
+    'yequals',
+    'ylimits',
+    'ypart',
+    'yscale',
+    'yscaleO',
+    'ytick',
+    'ytick3',
+    'ytrans',
+    'zaxis3',
+    'zaxis3At',
+    'zero',
+    'zero3',
+    'zlimits',
+    'zpart',
+    'ztick',
+    'ztick3',
+    'ztrans'
+])
+
+ASYVARNAME = set([
+    'AliceBlue',
+    'Align',
+    'Allow',
+    'AntiqueWhite',
+    'Apricot',
+    'Aqua',
+    'Aquamarine',
+    'Aspect',
+    'Azure',
+    'BeginPoint',
+    'Beige',
+    'Bisque',
+    'Bittersweet',
+    'Black',
+    'BlanchedAlmond',
+    'Blue',
+    'BlueGreen',
+    'BlueViolet',
+    'Both',
+    'Break',
+    'BrickRed',
+    'Brown',
+    'BurlyWood',
+    'BurntOrange',
+    'CCW',
+    'CW',
+    'CadetBlue',
+    'CarnationPink',
+    'Center',
+    'Centered',
+    'Cerulean',
+    'Chartreuse',
+    'Chocolate',
+    'Coeff',
+    'Coral',
+    'CornflowerBlue',
+    'Cornsilk',
+    'Crimson',
+    'Crop',
+    'Cyan',
+    'Dandelion',
+    'DarkBlue',
+    'DarkCyan',
+    'DarkGoldenrod',
+    'DarkGray',
+    'DarkGreen',
+    'DarkKhaki',
+    'DarkMagenta',
+    'DarkOliveGreen',
+    'DarkOrange',
+    'DarkOrchid',
+    'DarkRed',
+    'DarkSalmon',
+    'DarkSeaGreen',
+    'DarkSlateBlue',
+    'DarkSlateGray',
+    'DarkTurquoise',
+    'DarkViolet',
+    'DeepPink',
+    'DeepSkyBlue',
+    'DefaultHead',
+    'DimGray',
+    'DodgerBlue',
+    'Dotted',
+    'Draw',
+    'E',
+    'ENE',
+    'EPS',
+    'ESE',
+    'E_Euler',
+    'E_PC',
+    'E_RK2',
+    'E_RK3BS',
+    'Emerald',
+    'EndPoint',
+    'Euler',
+    'Fill',
+    'FillDraw',
+    'FireBrick',
+    'FloralWhite',
+    'ForestGreen',
+    'Fuchsia',
+    'Gainsboro',
+    'GhostWhite',
+    'Gold',
+    'Goldenrod',
+    'Gray',
+    'Green',
+    'GreenYellow',
+    'Honeydew',
+    'HookHead',
+    'Horizontal',
+    'HotPink',
+    'I',
+    'IgnoreAspect',
+    'IndianRed',
+    'Indigo',
+    'Ivory',
+    'JOIN_IN',
+    'JOIN_OUT',
+    'JungleGreen',
+    'Khaki',
+    'LM_DWARF',
+    'LM_MACHEP',
+    'LM_SQRT_DWARF',
+    'LM_SQRT_GIANT',
+    'LM_USERTOL',
+    'Label',
+    'Lavender',
+    'LavenderBlush',
+    'LawnGreen',
+    'LeftJustified',
+    'LeftSide',
+    'LemonChiffon',
+    'LightBlue',
+    'LightCoral',
+    'LightCyan',
+    'LightGoldenrodYellow',
+    'LightGreen',
+    'LightGrey',
+    'LightPink',
+    'LightSalmon',
+    'LightSeaGreen',
+    'LightSkyBlue',
+    'LightSlateGray',
+    'LightSteelBlue',
+    'LightYellow',
+    'Lime',
+    'LimeGreen',
+    'Linear',
+    'Linen',
+    'Log',
+    'Logarithmic',
+    'Magenta',
+    'Mahogany',
+    'Mark',
+    'MarkFill',
+    'Maroon',
+    'Max',
+    'MediumAquamarine',
+    'MediumBlue',
+    'MediumOrchid',
+    'MediumPurple',
+    'MediumSeaGreen',
+    'MediumSlateBlue',
+    'MediumSpringGreen',
+    'MediumTurquoise',
+    'MediumVioletRed',
+    'Melon',
+    'MidPoint',
+    'MidnightBlue',
+    'Min',
+    'MintCream',
+    'MistyRose',
+    'Moccasin',
+    'Move',
+    'MoveQuiet',
+    'Mulberry',
+    'N',
+    'NE',
+    'NNE',
+    'NNW',
+    'NW',
+    'NavajoWhite',
+    'Navy',
+    'NavyBlue',
+    'NoAlign',
+    'NoCrop',
+    'NoFill',
+    'NoSide',
+    'OldLace',
+    'Olive',
+    'OliveDrab',
+    'OliveGreen',
+    'Orange',
+    'OrangeRed',
+    'Orchid',
+    'Ox',
+    'Oy',
+    'PC',
+    'PaleGoldenrod',
+    'PaleGreen',
+    'PaleTurquoise',
+    'PaleVioletRed',
+    'PapayaWhip',
+    'Peach',
+    'PeachPuff',
+    'Periwinkle',
+    'Peru',
+    'PineGreen',
+    'Pink',
+    'Plum',
+    'PowderBlue',
+    'ProcessBlue',
+    'Purple',
+    'RK2',
+    'RK3',
+    'RK3BS',
+    'RK4',
+    'RK5',
+    'RK5DP',
+    'RK5F',
+    'RawSienna',
+    'Red',
+    'RedOrange',
+    'RedViolet',
+    'Rhodamine',
+    'RightJustified',
+    'RightSide',
+    'RosyBrown',
+    'RoyalBlue',
+    'RoyalPurple',
+    'RubineRed',
+    'S',
+    'SE',
+    'SSE',
+    'SSW',
+    'SW',
+    'SaddleBrown',
+    'Salmon',
+    'SandyBrown',
+    'SeaGreen',
+    'Seashell',
+    'Sepia',
+    'Sienna',
+    'Silver',
+    'SimpleHead',
+    'SkyBlue',
+    'SlateBlue',
+    'SlateGray',
+    'Snow',
+    'SpringGreen',
+    'SteelBlue',
+    'Suppress',
+    'SuppressQuiet',
+    'Tan',
+    'TeXHead',
+    'Teal',
+    'TealBlue',
+    'Thistle',
+    'Ticksize',
+    'Tomato',
+    'Turquoise',
+    'UnFill',
+    'VERSION',
+    'Value',
+    'Vertical',
+    'Violet',
+    'VioletRed',
+    'W',
+    'WNW',
+    'WSW',
+    'Wheat',
+    'White',
+    'WhiteSmoke',
+    'WildStrawberry',
+    'XYAlign',
+    'YAlign',
+    'Yellow',
+    'YellowGreen',
+    'YellowOrange',
+    'addpenarc',
+    'addpenline',
+    'align',
+    'allowstepping',
+    'angularsystem',
+    'animationdelay',
+    'appendsuffix',
+    'arcarrowangle',
+    'arcarrowfactor',
+    'arrow2sizelimit',
+    'arrowangle',
+    'arrowbarb',
+    'arrowdir',
+    'arrowfactor',
+    'arrowhookfactor',
+    'arrowlength',
+    'arrowsizelimit',
+    'arrowtexfactor',
+    'authorpen',
+    'axis',
+    'axiscoverage',
+    'axislabelfactor',
+    'background',
+    'backgroundcolor',
+    'backgroundpen',
+    'barfactor',
+    'barmarksizefactor',
+    'basealign',
+    'baselinetemplate',
+    'beveljoin',
+    'bigvertexpen',
+    'bigvertexsize',
+    'black',
+    'blue',
+    'bm',
+    'bottom',
+    'bp',
+    'brown',
+    'bullet',
+    'byfoci',
+    'byvertices',
+    'camerafactor',
+    'chartreuse',
+    'circlemarkradiusfactor',
+    'circlenodesnumberfactor',
+    'circleprecision',
+    'circlescale',
+    'cm',
+    'codefile',
+    'codepen',
+    'codeskip',
+    'colorPen',
+    'coloredNodes',
+    'coloredSegments',
+    'conditionlength',
+    'conicnodesfactor',
+    'count',
+    'cputimeformat',
+    'crossmarksizefactor',
+    'currentcoordsys',
+    'currentlight',
+    'currentpatterns',
+    'currentpen',
+    'currentpicture',
+    'currentposition',
+    'currentprojection',
+    'curvilinearsystem',
+    'cuttings',
+    'cyan',
+    'darkblue',
+    'darkbrown',
+    'darkcyan',
+    'darkgray',
+    'darkgreen',
+    'darkgrey',
+    'darkmagenta',
+    'darkolive',
+    'darkred',
+    'dashdotted',
+    'dashed',
+    'datepen',
+    'dateskip',
+    'debuggerlines',
+    'debugging',
+    'deepblue',
+    'deepcyan',
+    'deepgray',
+    'deepgreen',
+    'deepgrey',
+    'deepmagenta',
+    'deepred',
+    'default',
+    'defaultControl',
+    'defaultS',
+    'defaultbackpen',
+    'defaultcoordsys',
+    'defaultfilename',
+    'defaultformat',
+    'defaultmassformat',
+    'defaultpen',
+    'diagnostics',
+    'differentlengths',
+    'dot',
+    'dotfactor',
+    'dotframe',
+    'dotted',
+    'doublelinepen',
+    'doublelinespacing',
+    'down',
+    'duplicateFuzz',
+    'ellipsenodesnumberfactor',
+    'eps',
+    'epsgeo',
+    'epsilon',
+    'evenodd',
+    'extendcap',
+    'fermionpen',
+    'figureborder',
+    'figuremattpen',
+    'firstnode',
+    'firststep',
+    'foregroundcolor',
+    'fuchsia',
+    'fuzz',
+    'gapfactor',
+    'ghostpen',
+    'gluonamplitude',
+    'gluonpen',
+    'gluonratio',
+    'gray',
+    'green',
+    'grey',
+    'hatchepsilon',
+    'havepagenumber',
+    'heavyblue',
+    'heavycyan',
+    'heavygray',
+    'heavygreen',
+    'heavygrey',
+    'heavymagenta',
+    'heavyred',
+    'hline',
+    'hwratio',
+    'hyperbolanodesnumberfactor',
+    'identity4',
+    'ignore',
+    'inXasyMode',
+    'inch',
+    'inches',
+    'includegraphicscommand',
+    'inf',
+    'infinity',
+    'institutionpen',
+    'intMax',
+    'intMin',
+    'invert',
+    'invisible',
+    'itempen',
+    'itemskip',
+    'itemstep',
+    'labelmargin',
+    'landscape',
+    'lastnode',
+    'left',
+    'legendhskip',
+    'legendlinelength',
+    'legendmargin',
+    'legendmarkersize',
+    'legendmaxrelativewidth',
+    'legendvskip',
+    'lightblue',
+    'lightcyan',
+    'lightgray',
+    'lightgreen',
+    'lightgrey',
+    'lightmagenta',
+    'lightolive',
+    'lightred',
+    'lightyellow',
+    'linemargin',
+    'lm_infmsg',
+    'lm_shortmsg',
+    'longdashdotted',
+    'longdashed',
+    'magenta',
+    'magneticPoints',
+    'magneticRadius',
+    'mantissaBits',
+    'markangleradius',
+    'markangleradiusfactor',
+    'markanglespace',
+    'markanglespacefactor',
+    'mediumblue',
+    'mediumcyan',
+    'mediumgray',
+    'mediumgreen',
+    'mediumgrey',
+    'mediummagenta',
+    'mediumred',
+    'mediumyellow',
+    'middle',
+    'minDistDefault',
+    'minblockheight',
+    'minblockwidth',
+    'mincirclediameter',
+    'minipagemargin',
+    'minipagewidth',
+    'minvertexangle',
+    'miterjoin',
+    'mm',
+    'momarrowfactor',
+    'momarrowlength',
+    'momarrowmargin',
+    'momarrowoffset',
+    'momarrowpen',
+    'monoPen',
+    'morepoints',
+    'nCircle',
+    'newbulletcolor',
+    'ngraph',
+    'nil',
+    'nmesh',
+    'nobasealign',
+    'nodeMarginDefault',
+    'nodesystem',
+    'nomarker',
+    'nopoint',
+    'noprimary',
+    'nullpath',
+    'nullpen',
+    'numarray',
+    'ocgindex',
+    'oldbulletcolor',
+    'olive',
+    'orange',
+    'origin',
+    'overpaint',
+    'page',
+    'pageheight',
+    'pagemargin',
+    'pagenumberalign',
+    'pagenumberpen',
+    'pagenumberposition',
+    'pagewidth',
+    'paleblue',
+    'palecyan',
+    'palegray',
+    'palegreen',
+    'palegrey',
+    'palemagenta',
+    'palered',
+    'paleyellow',
+    'parabolanodesnumberfactor',
+    'perpfactor',
+    'phi',
+    'photonamplitude',
+    'photonpen',
+    'photonratio',
+    'pi',
+    'pink',
+    'plain',
+    'plus',
+    'preamblenodes',
+    'pt',
+    'purple',
+    'r3',
+    'r4a',
+    'r4b',
+    'randMax',
+    'realDigits',
+    'realEpsilon',
+    'realMax',
+    'realMin',
+    'red',
+    'relativesystem',
+    'reverse',
+    'right',
+    'roundcap',
+    'roundjoin',
+    'royalblue',
+    'salmon',
+    'saveFunctions',
+    'scalarpen',
+    'sequencereal',
+    'settings',
+    'shipped',
+    'signedtrailingzero',
+    'solid',
+    'springgreen',
+    'sqrtEpsilon',
+    'squarecap',
+    'squarepen',
+    'startposition',
+    'stdin',
+    'stdout',
+    'stepfactor',
+    'stepfraction',
+    'steppagenumberpen',
+    'stepping',
+    'stickframe',
+    'stickmarksizefactor',
+    'stickmarkspacefactor',
+    'textpen',
+    'ticksize',
+    'tildeframe',
+    'tildemarksizefactor',
+    'tinv',
+    'titlealign',
+    'titlepagepen',
+    'titlepageposition',
+    'titlepen',
+    'titleskip',
+    'top',
+    'trailingzero',
+    'treeLevelStep',
+    'treeMinNodeWidth',
+    'treeNodeStep',
+    'trembleAngle',
+    'trembleFrequency',
+    'trembleRandom',
+    'tremblingMode',
+    'undefined',
+    'unitcircle',
+    'unitsquare',
+    'up',
+    'urlpen',
+    'urlskip',
+    'version',
+    'vertexpen',
+    'vertexsize',
+    'viewportmargin',
+    'viewportsize',
+    'vline',
+    'white',
+    'wye',
+    'xformStack',
+    'yellow',
+    'ylabelwidth',
+    'zerotickfuzz',
+    'zerowinding'
+])
index 4f4f88622540e75ccbd3d78a14848baae8963898..03e5cad4a8cff33ea729b8719f5d0647682a00ac 100644 (file)
@@ -5,7 +5,7 @@
 
     ANSI Common Lisp builtins.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 31cbb5be273086e35c959cd2b5e1027a288a6991..c475c9c13793116c70a0818f00ffb711b00dc67f 100644 (file)
@@ -9,7 +9,7 @@
 
     Do not edit the MODULES dict by hand.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 86c59a5b2a9ad57bdbba15c7786f25d012cfdc12..7e06831cf9ca8cd2b71e301227b8add747dc9f12 100644 (file)
@@ -9,7 +9,7 @@
 
     Do not alter the LEXERS dictionary by hand.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -28,6 +28,7 @@ LEXERS = {
     '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',)),
     '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')),
@@ -37,6 +38,7 @@ LEXERS = {
     'BooLexer': ('pygments.lexers.dotnet', 'Boo', ('boo',), ('*.boo',), ('text/x-boo',)),
     'BrainfuckLexer': ('pygments.lexers.other', 'Brainfuck', ('brainfuck', 'bf'), ('*.bf', '*.b'), ('application/x-brainfuck',)),
     'CLexer': ('pygments.lexers.compiled', 'C', ('c',), ('*.c', '*.h'), ('text/x-chdr', 'text/x-csrc')),
+    'CMakeLexer': ('pygments.lexers.text', 'CMake', ('cmake',), ('*.cmake',), ('text/x-cmake',)),
     'CObjdumpLexer': ('pygments.lexers.asm', 'c-objdump', ('c-objdump',), ('*.c-objdump',), ('text/x-c-objdump',)),
     'CSharpAspxLexer': ('pygments.lexers.dotnet', 'aspx-cs', ('aspx-cs',), ('*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd'), ()),
     'CSharpLexer': ('pygments.lexers.dotnet', 'C#', ('csharp', 'c#'), ('*.cs',), ('text/x-csharp',)),
@@ -75,7 +77,9 @@ LEXERS = {
     'GenshiLexer': ('pygments.lexers.templates', 'Genshi', ('genshi', 'kid', 'xml+genshi', 'xml+kid'), ('*.kid',), ('application/x-genshi', 'application/x-kid')),
     'GenshiTextLexer': ('pygments.lexers.templates', 'Genshi Text', ('genshitext',), (), ('application/x-genshi-text', 'text/x-genshi')),
     'GettextLexer': ('pygments.lexers.text', 'Gettext Catalog', ('pot', 'po'), ('*.pot', '*.po'), ('application/x-gettext', 'text/x-gettext', 'text/gettext')),
+    'GherkinLexer': ('pygments.lexers.other', 'Gherkin', ('Cucumber', 'cucumber', 'Gherkin', 'gherkin'), ('*.feature',), ('text/x-gherkin',)),
     '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')),
     'HaskellLexer': ('pygments.lexers.functional', 'Haskell', ('haskell', 'hs'), ('*.hs',), ('text/x-haskell',)),
     'HtmlDjangoLexer': ('pygments.lexers.templates', 'HTML+Django/Jinja', ('html+django', 'html+jinja'), (), ('text/html+django', 'text/html+jinja')),
@@ -127,6 +131,7 @@ LEXERS = {
     'ObjectiveCLexer': ('pygments.lexers.compiled', 'Objective-C', ('objective-c', 'objectivec', 'obj-c', 'objc'), ('*.m',), ('text/x-objective-c',)),
     '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',)),
     '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',)),
     'PovrayLexer': ('pygments.lexers.other', 'POVRay', ('pov',), ('*.pov', '*.inc'), ('text/x-povray',)),
index 4ab11eb70f2a9131bd5006ead433fba2f9fd5e28..0c0accccc3747f4810f06b883cb39ff0cde14e5a 100644 (file)
@@ -12,7 +12,7 @@
              internet connection. don't run that at home, use
              a server ;-)
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 1a57c7376724ec0041b7d00c1766c5ddfe363388..40f29c5e439e404da8740b447e16ebe07d5dddc7 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for agile languages.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -17,7 +17,7 @@ except NameError:
 
 from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, \
      LexerContext, include, combined, do_insertions, bygroups, using
-from pygments.token import Error, Text, \
+from pygments.token import Error, Text, Other, \
      Comment, Operator, Keyword, Name, String, Number, Generic, Punctuation
 from pygments.util import get_bool_opt, get_list_opt, shebang_matches
 from pygments import unistring as uni
@@ -368,7 +368,8 @@ class PythonTracebackLexer(RegexLexer):
         'root': [
             (r'^Traceback \(most recent call last\):\n', Generic.Traceback, 'intb'),
             # SyntaxError starts with this.
-            (r'^(?=  File "[^"]+", line \d+\n)', Generic.Traceback, 'intb'),
+            (r'^(?=  File "[^"]+", line \d+)', Generic.Traceback, 'intb'),
+            (r'^.*\n', Other),
         ],
         'intb': [
             (r'^(  File )("[^"]+")(, line )(\d+)(, in )(.+)(\n)',
@@ -559,22 +560,22 @@ class RubyLexer(ExtendedRegexLexer):
         # these must come after %<brace>!
         states['strings'] += [
             # %r regex
-            (r'(%r([^a-zA-Z0-9]))([^\2\\]*(?:\\.[^\2\\]*)*)(\2[mixounse]*)',
+            (r'(%r([^a-zA-Z0-9]))((?:\\\2|(?!\2).)*)(\2[mixounse]*)',
              intp_regex_callback),
             # regular fancy strings with qsw
-            (r'%[qsw]([^a-zA-Z0-9])([^\1\\]*(?:\\.[^\1\\]*)*)\1', String.Other),
-            (r'(%[QWx]([^a-zA-Z0-9]))([^\2\\]*(?:\\.[^\2\\]*)*)(\2)',
+            (r'%[qsw]([^a-zA-Z0-9])((?:\\\1|(?!\1).)*)\1', String.Other),
+            (r'(%[QWx]([^a-zA-Z0-9]))((?:\\\2|(?!\2).)*)(\2)',
              intp_string_callback),
             # special forms of fancy strings after operators or
             # in method calls with braces
-            (r'(?<=[-+/*%=<>&!^|~,(])(\s*)(%([\t ])(?:[^\3\\]*(?:\\.[^\3\\]*)*)\3)',
+            (r'(?<=[-+/*%=<>&!^|~,(])(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)',
              bygroups(Text, String.Other, None)),
             # and because of fixed width lookbehinds the whole thing a
             # second time for line startings...
-            (r'^(\s*)(%([\t ])(?:[^\3\\]*(?:\\.[^\3\\]*)*)\3)',
+            (r'^(\s*)(%([\t ])(?:(?:\\\3|(?!\3).)*)\3)',
              bygroups(Text, String.Other, None)),
             # all regular fancy strings without qsw
-            (r'(%([^a-zA-Z0-9\s]))([^\2\\]*(?:\\.[^\2\\]*)*)(\2)',
+            (r'(%([^a-zA-Z0-9\s]))((?:\\\2|(?!\2).)*)(\2)',
              intp_string_callback),
         ]
 
index 655b746176a2246147988b10c8e1de6911ba18fa..e574a59bd83ad33e12d830d45faa36a834d58062 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for assembly languages.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -199,7 +199,7 @@ class LlvmLexer(RegexLexer):
 
     #: optional Comment or Whitespace
     string = r'"[^"]*?"'
-    identifier = r'([a-zA-Z$._][a-zA-Z$._0-9]*|' + string + ')'
+    identifier = r'([-a-zA-Z$._][-a-zA-Z$._0-9]*|' + string + ')'
 
     tokens = {
         'root': [
@@ -211,14 +211,17 @@ class LlvmLexer(RegexLexer):
             include('keyword'),
 
             (r'%' + identifier, Name.Variable),#Name.Identifier.Local),
-            (r'@' + identifier, Name.Constant),#Name.Identifier.Global),
+            (r'@' + identifier, Name.Variable.Global),#Name.Identifier.Global),
             (r'%\d+', Name.Variable.Anonymous),#Name.Identifier.Anonymous),
+            (r'@\d+', Name.Variable.Global),#Name.Identifier.Anonymous),
+            (r'!' + identifier, Name.Variable),
+            (r'!\d+', Name.Variable.Anonymous),
             (r'c?' + string, String),
 
             (r'0[xX][a-fA-F0-9]+', Number),
             (r'-?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?', Number),
 
-            (r'[=<>{}\[\]()*.,]|x\b', Punctuation)
+            (r'[=<>{}\[\]()*.,!]|x\b', Punctuation)
         ],
         'whitespace': [
             (r'(\n|\s)+', Text),
@@ -226,36 +229,56 @@ class LlvmLexer(RegexLexer):
         ],
         'keyword': [
             # Regular keywords
-            (r'(void|label|float|double|opaque'
-             r'|to'
-             r'|alias|type'
-             r'|zeroext|signext|inreg|sret|noalias|noreturn|nounwind|nest'
-             r'|module|asm|target|datalayout|triple'
-             r'|true|false|null|zeroinitializer|undef'
-             r'|global|internal|external|linkonce|weak|appending|extern_weak'
-             r'|dllimport|dllexport'
-             r'|ccc|fastcc|coldcc|cc|tail'
-             r'|default|hidden|protected'
-             r'|thread_local|constant|align|section'
-             r'|define|declare'
-
-             # Statements & expressions
-             r'|trunc|zext|sext|fptrunc|fpext|fptoui|fptosi|uitofp|sitofp'
-             r'|ptrtoint|inttoptr|bitcast|getelementptr|select|icmp|fcmp'
-             r'|extractelement|insertelement|shufflevector'
-             r'|sideeffect|volatile'
-             r'|ret|br|switch|invoke|unwind|unreachable'
-             r'|add|sub|mul|udiv|sdiv|fdiv|urem|srem|frem'
-             r'|shl|lshr|ashr|and|or|xor'
-             r'|malloc|free|alloca|load|store'
-             r'|phi|call|va_arg|va_list'
-
-             # Comparison condition codes for icmp
-             r'|eq|ne|ugt|uge|ult|ule|sgt|sge|slt|sle'
-             # Ditto for fcmp: (minus keywords mentioned in other contexts)
-             r'|oeq|ogt|oge|olt|ole|one|ord|ueq|ugt|uge|une|uno'
+            (r'(begin|end'
+             r'|true|false'
+             r'|declare|define'
+             r'|global|constant'
+
+             r'|private|linker_private|internal|available_externally|linkonce'
+             r'|linkonce_odr|weak|weak_odr|appending|dllimport|dllexport'
+             r'|common|default|hidden|protected|extern_weak|external'
+             r'|thread_local|zeroinitializer|undef|null|to|tail|target|triple'
+             r'|deplibs|datalayout|volatile|nuw|nsw|exact|inbounds|align'
+             r'|addrspace|section|alias|module|asm|sideeffect|gc|dbg'
+
+             r'|ccc|fastcc|coldcc|x86_stdcallcc|x86_fastcallcc|arm_apcscc'
+             r'|arm_aapcscc|arm_aapcs_vfpcc'
+
+             r'|cc|c'
+
+             r'|signext|zeroext|inreg|sret|nounwind|noreturn|noalias|nocapture'
+             r'|byval|nest|readnone|readonly'
+
+             r'|inlinehint|noinline|alwaysinline|optsize|ssp|sspreq|noredzone'
+             r'|noimplicitfloat|naked'
+
+             r'|type|opaque'
+
+             r'|eq|ne|slt|sgt|sle'
+             r'|sge|ult|ugt|ule|uge'
+             r'|oeq|one|olt|ogt|ole'
+             r'|oge|ord|uno|ueq|une'
+             r'|x'
+
+             # instructions
+             r'|add|fadd|sub|fsub|mul|fmul|udiv|sdiv|fdiv|urem|srem|frem|shl'
+             r'|lshr|ashr|and|or|xor|icmp|fcmp'
+
+             r'|phi|call|trunc|zext|sext|fptrunc|fpext|uitofp|sitofp|fptoui'
+             r'fptosi|inttoptr|ptrtoint|bitcast|select|va_arg|ret|br|switch'
+             r'|invoke|unwind|unreachable'
+
+             r'|malloc|alloca|free|load|store|getelementptr'
+
+             r'|extractelement|insertelement|shufflevector|getresult'
+             r'|extractvalue|insertvalue'
 
              r')\b', Keyword),
+
+            # Types
+            (r'void|float|double|x86_fp80|fp128|ppc_fp128|label|metadata',
+             Keyword.Type),
+
             # Integer types
             (r'i[1-9]\d*', Keyword)
         ]
@@ -272,7 +295,7 @@ class NasmLexer(RegexLexer):
     mimetypes = ['text/x-nasm']
 
     identifier = r'[a-zA-Z$._?][a-zA-Z0-9$._?#@~]*'
-    hexn = r'(?:0[xX][0-9a-fA-F]+|$0[0-9a-fA-F]*|[0-9a-fA-F]+h)'
+    hexn = r'(?:0[xX][0-9a-fA-F]+|$0[0-9a-fA-F]*|[0-9]+[0-9a-fA-F]*h)'
     octn = r'[0-7]+q'
     binn = r'[01]+b'
     decn = r'[0-9]+'
@@ -284,7 +307,8 @@ class NasmLexer(RegexLexer):
     wordop = r'seg|wrt|strict'
     type = r'byte|[dq]?word'
     directives = (r'BITS|USE16|USE32|SECTION|SEGMENT|ABSOLUTE|EXTERN|GLOBAL|'
-                  r'COMMON|CPU|GROUP|UPPERCASE|IMPORT|EXPORT|LIBRARY|MODULE')
+                  r'ORG|ALIGN|STRUC|ENDSTRUC|COMMON|CPU|GROUP|UPPERCASE|IMPORT|'
+                  r'EXPORT|LIBRARY|MODULE')
 
     flags = re.IGNORECASE | re.MULTILINE
     tokens = {
@@ -292,10 +316,10 @@ class NasmLexer(RegexLexer):
             include('whitespace'),
             (r'^\s*%', Comment.Preproc, 'preproc'),
             (identifier + ':', Name.Label),
-            (directives, Keyword, 'instruction-args'),
-            (r'(%s)\s+(equ)' % identifier,
-                bygroups(Name.Constant, Keyword.Declaration),
+            (r'(%s)(\s+)(equ)' % identifier,
+                bygroups(Name.Constant, Keyword.Declaration, Keyword.Declaration),
                 'instruction-args'),
+            (directives, Keyword, 'instruction-args'),
             (declkw, Keyword.Declaration, 'instruction-args'),
             (identifier, Name.Function, 'instruction-args'),
             (r'[\r\n]+', Text)
index a6780fcc1c16ab2c2fe6e3a83cd5ce674c4b13ce..84ffd2b111890ecd53c0f6928944aa4a56a5e0db 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for compiled languages.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -29,7 +29,7 @@ from pygments.lexers.functional import OcamlLexer
 __all__ = ['CLexer', 'CppLexer', 'DLexer', 'DelphiLexer', 'JavaLexer',
            'ScalaLexer', 'DylanLexer', 'OcamlLexer', 'ObjectiveCLexer',
            'FortranLexer', 'GLShaderLexer', 'PrologLexer', 'CythonLexer',
-           'ValaLexer']
+           'ValaLexer', 'OocLexer', 'GoLexer']
 
 
 class CLexer(RegexLexer):
@@ -48,6 +48,7 @@ class CLexer(RegexLexer):
         'whitespace': [
             (r'^\s*#if\s+0', Comment.Preproc, 'if0'),
             (r'^\s*#', Comment.Preproc, 'macro'),
+            (r'^(\s*)([a-zA-Z_][a-zA-Z0-9_]*:(?!:))', bygroups(Text, Name.Label)),
             (r'\n', Text),
             (r'\s+', Text),
             (r'\\\n', Text), # line continuation
@@ -74,7 +75,6 @@ class CLexer(RegexLexer):
             (r'__(asm|int8|based|except|int16|stdcall|cdecl|fastcall|int32|'
              r'declspec|finally|int64|try|leave)\b', Keyword.Reserved),
             (r'(true|false|NULL)\b', Name.Builtin),
-            ('[a-zA-Z_][a-zA-Z0-9_]*:(?!:)', Name.Label),
             ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
         ],
         'root': [
@@ -241,6 +241,8 @@ class CppLexer(RegexLexer):
 class DLexer(RegexLexer):
     """
     For D source.
+
+    *New in Pygments 1.2.*
     """
     name = 'D'
     filenames = ['*.d', '*.di']
@@ -304,8 +306,8 @@ class DLexer(RegexLexer):
             # -- DoubleQuotedString
             (r'"(\\\\|\\"|[^"])*"[cwd]?', String),
             # -- EscapeSequence
-            (r"""\\(['"?\\abfnrtv]|x[0-9a-fA-F]{2}|[0-7]{1,3}"""
-             r"""|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|&\w+;)""",
+            (r"\\(['\"?\\abfnrtv]|x[0-9a-fA-F]{2}|[0-7]{1,3}"
+             r"|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|&\w+;)",
              String
             ),
             # -- HexString
@@ -1661,3 +1663,130 @@ class ValaLexer(RegexLexer):
             (r'[a-zA-Z_][a-zA-Z0-9_.]*', Name.Namespace, '#pop')
         ],
     }
+
+
+class OocLexer(RegexLexer):
+    """
+    For `Ooc <http://ooc-lang.org/>`_ source code
+
+    *New in Pygments 1.2.*
+    """
+    name = 'Ooc'
+    aliases = ['ooc']
+    filenames = ['*.ooc']
+    mimetypes = ['text/x-ooc']
+
+    tokens = {
+        'root': [
+            (r'\b(class|interface|implement|abstract|extends|from|'
+             r'this|super|new|const|final|static|import|use|extern|'
+             r'inline|proto|break|continue|fallthrough|operator|if|else|for|'
+             r'while|do|switch|case|as|in|version|return|true|false|null)\b',
+             Keyword),
+            (r'include\b', Keyword, 'include'),
+            (r'(cover)([ \t]+)(from)([ \t]+)([a-zA-Z0-9_]+[*@]?)',
+             bygroups(Keyword, Text, Keyword, Text, Name.Class)),
+            (r'(func)((?:[ \t]|\\\n)+)(~[a-z_][a-zA-Z0-9_]*)',
+             bygroups(Keyword, Text, Name.Function)),
+            (r'\bfunc\b', Keyword),
+            # Note: %= and ^= not listed on http://ooc-lang.org/syntax
+            (r'//.*', Comment),
+            (r'(?s)/\*.*?\*/', Comment.Multiline),
+            (r'(==?|\+=?|-[=>]?|\*=?|/=?|:=|!=?|%=?|\?|>{1,3}=?|<{1,3}=?|\.\.|'
+             r'&&?|\|\|?|\^=?)', Operator),
+            (r'(\.)([ \t]*)([a-z]\w*)', bygroups(Operator, Text,
+                                                 Name.Function)),
+            (r'[A-Z][A-Z0-9_]+', Name.Constant),
+            (r'[A-Z][a-zA-Z0-9_]*([@*]|\[[ \t]*\])?', Name.Class),
+
+            (r'([a-z][a-zA-Z0-9_]*(?:~[a-z][a-zA-Z0-9_]*)?)((?:[ \t]|\\\n)*)(?=\()',
+             bygroups(Name.Function, Text)),
+            (r'[a-z][a-zA-Z0-9_]*', Name.Variable),
+
+            # : introduces types
+            (r'[:(){}\[\];,]', Punctuation),
+
+            (r'0x[0-9a-fA-F]+', Number.Hex),
+            (r'0c[0-9]+', Number.Octal),
+            (r'0b[01]+', Number.Binary),
+            (r'[0-9_]\.[0-9_]*(?!\.)', Number.Float),
+            (r'[0-9_]+', Number.Decimal),
+
+            (r'"(?:\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\"])*"',
+             String.Double),
+            (r"'(?:\\.|\\[0-9]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\'\n])'",
+             String.Char),
+            (r'@', Punctuation), # pointer dereference
+            (r'\.', Punctuation), # imports or chain operator
+
+            (r'\\[ \t\n]', Text),
+            (r'[ \t]+', Text),
+        ],
+        'include': [
+            (r'[\w/]+', Name),
+            (r',', Punctuation),
+            (r'[ \t]', Text),
+            (r'[;\n]', Text, '#pop'),
+        ],
+    }
+
+
+class GoLexer(RegexLexer):
+    """
+    For `Go <http://golang.org>`_ source.
+    """
+    name = 'Go'
+    filenames = ['*.go']
+    aliases = ['go']
+    mimetypes = ['text/x-gosrc']
+
+    tokens = {
+        'root': [
+            (r'\n', Text),
+            (r'\s+', Text),
+            (r'\\\n', Text), # line continuations
+            (r'//(.*?)\n', Comment.Single),
+            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
+            (r'(break|default|func|interface|select'
+             r'|case|defer|go|map|struct'
+             r'|chan|else|goto|package|switch'
+             r'|const|fallthrough|if|range|type'
+             r'|continue|for|import|return|var)\b', Keyword
+            ),
+            # It seems the builtin types aren't actually keywords.
+            (r'(uint8|uint16|uint32|uint64'
+             r'|int8|int16|int32|int64'
+             r'|float32|float64|byte'
+             r'|uint|int|float|uintptr'
+             r'|string|close|closed|len|cap|new|make)\b', Name.Builtin
+            ),
+            # float_lit
+            (r'\d+(\.\d+[eE][+\-]?\d+|'
+             r'\.\d*|[eE][+\-]?\d+)', Number.Float),
+            (r'\.\d+([eE][+\-]?\d+)?', Number.Float),
+            # int_lit
+            # -- octal_lit
+            (r'0[0-7]+', Number.Oct),
+            # -- hex_lit
+            (r'0[xX][0-9a-fA-F]+', Number.Hex),
+            # -- decimal_lit
+            (r'(0|[1-9][0-9]*)', Number.Integer),
+            # char_lit
+            (r"""'(\\['"\\abfnrtv]|\\x[0-9a-fA-F]{2}|\\[0-7]{1,3}"""
+             r"""|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|[^\\])'""",
+             String.Char
+            ),
+            # StringLiteral
+            # -- raw_string_lit
+            (r'`[^`]*`', String),
+            # -- interpreted_string_lit
+            (r'"(\\\\|\\"|[^"])*"', String),
+            # Tokens
+            (r'(<<=|>>=|<<|>>|<=|>=|&\^=|&\^|\+=|-=|\*=|/=|%=|&=|\|=|&&|\|\|'
+             r'|<-|\+\+|--|==|!=|:=|\.\.\.)|[+\-*/%&|^<>=!()\[\]{}.,;:]',
+             Punctuation
+            ),
+            # identifier
+            (r'[a-zA-Z_]\w*', Name),
+        ]
+    }
index 4b03beae3a2e66402434fe673d3815a6ed3a3c94..0867cdb7925b83e35453153fe3ff2b3a0655ddef 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for .net languages.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import re
index 50974d17fb35f3bda058d2fd4ecd6ce3ee62f4b5..5c035bb93c9b705d03270b82d85cb2c902d69982 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for functional languages.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -443,7 +443,7 @@ class HaskellLexer(RegexLexer):
             (r'o[0-7]+', String.Escape, '#pop'),
             (r'x[\da-fA-F]+', String.Escape, '#pop'),
             (r'\d+', String.Escape, '#pop'),
-            (r'\n\s+\\', String.Escape, '#pop'),
+            (r'\s+\\', String.Escape, '#pop'),
         ],
     }
 
index 75da52f7d41372bcea87a9f2cd93549b2a30a737..79097f2849d32797a565e5e511c53bd73682abd2 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for math languages.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 735caa627260c486d0751efdcfb03d78dc726689..d3eac45ceb638411dfcd1806ecfca4064a479dd5 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for other languages.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -24,7 +24,7 @@ __all__ = ['SqlLexer', 'MySqlLexer', 'SqliteConsoleLexer', 'BrainfuckLexer',
            'MOOCodeLexer', 'SmalltalkLexer', 'TcshLexer', 'LogtalkLexer',
            'GnuplotLexer', 'PovrayLexer', 'AppleScriptLexer',
            'BashSessionLexer', 'ModelicaLexer', 'RebolLexer', 'ABAPLexer',
-           'NewspeakLexer']
+           'NewspeakLexer', 'GherkinLexer', 'AsymptoteLexer']
 
 line_re  = re.compile('.*?\n')
 
@@ -808,7 +808,8 @@ class LogtalkLexer(RegexLexer):
             # Reflection
             (r'(current_predicate|predicate_property)(?=[(])', Keyword),
             # DCGs and term expansion
-            (r'(expand_term|(goal|term)_expansion|phrase)(?=[(])', Keyword),
+            (r'(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])',
+             Keyword),
             # Entity
             (r'(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])',
              Keyword),
@@ -921,19 +922,22 @@ class LogtalkLexer(RegexLexer):
         ],
 
         'directive': [
+            # Conditional compilation directives
+            (r'(el)?if(?=[(])', Keyword, 'root'),
+            (r'(e(lse|ndif))[.]', Keyword, 'root'),
             # Entity directives
             (r'(category|object|protocol)(?=[(])', Keyword, 'entityrelations'),
             (r'(end_(category|object|protocol))[.]',Keyword, 'root'),
             # Predicate scope directives
             (r'(public|protected|private)(?=[(])', Keyword, 'root'),
             # Other directives
-            (r'e(ncoding|xport)(?=[(])', Keyword, 'root'),
+            (r'e(n(coding|sure_loaded)|xport)(?=[(])', Keyword, 'root'),
             (r'in(fo|itialization)(?=[(])', Keyword, 'root'),
             (r'(dynamic|synchronized|threaded)[.]', Keyword, 'root'),
-            (r'(alias|d(ynamic|iscontiguous)|m(eta_predicate|ode|ultifile)'
-             r'|synchronized)(?=[(])', Keyword, 'root'),
+            (r'(alias|d(ynamic|iscontiguous)|m(eta_predicate|ode|ultifile)|'
+             r's(et_(logtalk|prolog)_flag|ynchronized))(?=[(])', Keyword, 'root'),
             (r'op(?=[(])', Keyword, 'root'),
-            (r'(calls|use(s|_module))(?=[(])', Keyword, 'root'),
+            (r'(calls|reexport|use(s|_module))(?=[(])', Keyword, 'root'),
             (r'[a-z][a-zA-Z0-9_]*(?=[(])', Text, 'root'),
             (r'[a-z][a-zA-Z0-9_]*[.]', Text, 'root'),
         ],
@@ -969,6 +973,15 @@ class LogtalkLexer(RegexLexer):
         ]
     }
 
+    def analyse_text(text):
+        if ':- object(' in text:
+            return True
+        if ':- protocol(' in text:
+            return True
+        if ':- category(' in text:
+            return True
+        return False
+
 
 def _shortened(word):
     dpos = word.find('$')
@@ -2080,3 +2093,210 @@ class NewspeakLexer(RegexLexer):
        ]
     }
 
+class GherkinLexer(RegexLexer):
+    """
+    For `Gherkin <http://cukes.info/>` syntax.
+
+    *New in Pygments 1.2.*
+    """
+    name = 'Gherkin'
+    aliases = ['Cucumber', 'cucumber', 'Gherkin', 'gherkin']
+    filenames = ['*.feature']
+    mimetypes = ['text/x-gherkin']
+
+    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 )'
+
+    tokens = {
+        'comments': [
+            (r'#.*$', Comment),
+          ],
+        'multiline_descriptions' : [
+            (step_keywords_regexp, Keyword, "#pop"),
+            include('comments'),
+            (r"(\s|.)", Name.Constant),
+          ],
+        'multiline_descriptions_on_stack' : [
+            (step_keywords_regexp, Keyword, "#pop:2"),
+            include('comments'),
+            (r"(\s|.)", Name.Constant),
+          ],
+        'scenario_table_description': [
+            (r"\s+\|", Text, 'scenario_table_header'),
+            include('comments'),
+            (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),
+          ],
+        'scenario_sections_on_stack': [
+            (scenario_keywords_regexp,
+             bygroups(Text, Name.Class, Name.Class, Name.Constant),
+             "multiline_descriptions_on_stack"),
+            ],
+        'narrative': [
+            include('scenario_sections_on_stack'),
+            (r"(\s|.)", Name.Builtin),
+          ],
+        'table_vars': [
+            (r'(<[^>]*>)', bygroups(Name.Variable)),
+          ],
+        'string': [
+            include('table_vars'),
+            (r'(\s|.)', String),
+          ],
+        'py_string': [
+            (r'"""', String, "#pop"),
+            include('string'),
+          ],
+        'double_string': [
+            (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)),
+            (feature_keywords_regexp,
+             bygroups(Name.Class, Name.Class, Name.Constant), 'narrative'),
+            (scenario_keywords_regexp,
+             bygroups(Text, Name.Class, Name.Class, Name.Constant),
+             "multiline_descriptions"),
+            (examples_regexp,
+             bygroups(Text, Name.Class, Name.Class, Name.Constant),
+             "scenario_table_description"),
+            (r'(\s|.)', Text),
+        ]
+    }
+
+
+class AsymptoteLexer(RegexLexer):
+    """
+    For `Asymptote <http://asymptote.sf.net/>`_ source code.
+
+    *New in Pygments 1.2.*
+    """
+    name = 'Asymptote'
+    aliases = ['asy', 'asymptote']
+    filenames = ['*.asy']
+    mimetypes = ['text/x-asymptote']
+
+    #: optional Comment or Whitespace
+    _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+'
+
+    tokens = {
+        'whitespace': [
+            (r'\n', Text),
+            (r'\s+', Text),
+            (r'\\\n', Text), # line continuation
+            (r'//(\n|(.|\n)*?[^\\]\n)', Comment),
+            (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment),
+        ],
+        'statements': [
+            # simple string (TeX friendly)
+            (r'"(\\\\|\\"|[^"])*"', String),
+            # C style string (with character escapes)
+            (r"'", String, 'string'),
+            (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'[~!%^&*+=|?:<>/-]', Operator),
+            (r'[()\[\],.]', Punctuation),
+            (r'\b(case)(.+?)(:)', bygroups(Keyword, using(this), Text)),
+            (r'(and|controls|tension|atleast|curl|if|else|while|for|do|'
+             r'return|break|continue|struct|typedef|new|access|import|'
+             r'unravel|from|include|quote|static|public|private|restricted|'
+             r'this|explicit|true|false|null|cycle|newframe|operator)\b', Keyword),
+            # Since an asy-type-name can be also an asy-function-name,
+            # in the following we test if the string "  [a-zA-Z]" follows
+            # the Keyword.Type.
+            # Of course it is not perfect !
+            (r'(Braid|FitResult|Label|Legend|TreeNode|abscissa|arc|arrowhead|'
+             r'binarytree|binarytreeNode|block|bool|bool3|bounds|bqe|circle|'
+             r'conic|coord|coordsys|cputime|ellipse|file|filltype|frame|grid3|'
+             r'guide|horner|hsv|hyperbola|indexedTransform|int|inversion|key|'
+             r'light|line|linefit|marginT|marker|mass|object|pair|parabola|path|'
+             r'path3|pen|picture|point|position|projection|real|revolution|'
+             r'scaleT|scientific|segment|side|slice|splitface|string|surface|'
+             r'tensionSpecifier|ticklocate|ticksgridT|tickvalues|transform|'
+             r'transformation|tree|triangle|trilinear|triple|vector|'
+             r'vertex|void)(?=([ ]{1,}[a-zA-Z]))', Keyword.Type),
+            # Now the asy-type-name which are not asy-function-name
+            # except yours !
+            # Perhaps useless
+            (r'(Braid|FitResult|TreeNode|abscissa|arrowhead|block|bool|bool3|'
+             r'bounds|coord|frame|guide|horner|int|linefit|marginT|pair|pen|'
+             r'picture|position|real|revolution|slice|splitface|ticksgridT|'
+             r'tickvalues|tree|triple|vertex|void)\b', Keyword.Type),
+            ('[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'(\s*\([^;]*?\))'                      # signature
+             r'(' + _ws + r')({)',
+             bygroups(using(this), Name.Function, using(this), using(this),
+                      Punctuation),
+             'function'),
+            # function declarations
+            (r'((?:[a-zA-Z0-9_*\s])+?(?:\s|[*]))'    # return arguments
+             r'([a-zA-Z_][a-zA-Z0-9_]*)'             # method name
+             r'(\s*\([^;]*?\))'                      # signature
+             r'(' + _ws + r')(;)',
+             bygroups(using(this), Name.Function, using(this), using(this),
+                      Punctuation)),
+            ('', Text, 'statement'),
+        ],
+        'statement' : [
+            include('whitespace'),
+            include('statements'),
+            ('[{}]', Punctuation),
+            (';', Punctuation, '#pop'),
+        ],
+        'function': [
+            include('whitespace'),
+            include('statements'),
+            (';', Punctuation),
+            ('{', Punctuation, '#push'),
+            ('}', Punctuation, '#pop'),
+        ],
+        'string': [
+            (r"'", String, '#pop'),
+            (r'\\([\\abfnrtv"\'?]|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
+            (r'\n', String),
+            (r"[^\\'\n]+", String), # all other characters
+            (r'\\\n', String),
+            (r'\\n', String), # line continuation
+            (r'\\', String), # stray backslash
+            ]
+        }
+
+    def get_tokens_unprocessed(self, text):
+        from pygments.lexers._asybuiltins import ASYFUNCNAME, ASYVARNAME
+        for index, token, value in \
+               RegexLexer.get_tokens_unprocessed(self, text):
+           if token is Name and value in ASYFUNCNAME:
+               token = Name.Function
+           elif token is Name and value in ASYVARNAME:
+               token = Name.Variable
+           yield index, token, value
index 07f2eca1d1551d658a5cdae1f3653c5c96ebc408..15d58ebf659f834609adca57641901c23dc17f53 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for parser generators.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 31d01c90b1e09dcddc4d4ef9ebc80585f090c7ea..bd200a7268d5946648ff8be4387a40cf7bab941a 100644 (file)
@@ -5,7 +5,7 @@
 
     Special lexers.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 9ae0c3aa0cf26e400fa067736ca61267f2e610b0..49b843d7717b369b7520329154955c66f47826cc 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for various template engines' markup.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index efc346d531be14664a528a0914af16fce01e979e..8a35b31423c2af692397f0bed182cd3fb3eacd77 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for non-source code file types.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -28,7 +28,7 @@ __all__ = ['IniLexer', 'SourcesListLexer', 'BaseMakefileLexer',
            'GroffLexer', 'ApacheConfLexer', 'BBCodeLexer', 'MoinWikiLexer',
            'RstLexer', 'VimLexer', 'GettextLexer', 'SquidConfLexer',
            'DebianControlLexer', 'DarcsPatchLexer', 'YamlLexer',
-           'LighttpdConfLexer', 'NginxConfLexer']
+           'LighttpdConfLexer', 'NginxConfLexer', 'CMakeLexer']
 
 
 class IniLexer(RegexLexer):
@@ -1505,3 +1505,73 @@ class NginxConfLexer(RegexLexer):
             (r'\s+', Text),
         ],
     }
+
+
+class CMakeLexer(RegexLexer):
+    """
+    Lexer for `CMake <http://cmake.org/Wiki/CMake>`_ files.
+
+    *New in Pygments 1.2.*
+    """
+    name = 'CMake'
+    aliases = ['cmake']
+    filenames = ['*.cmake']
+    mimetypes = ['text/x-cmake']
+
+    tokens = {
+        'root': [
+            #(r'(ADD_CUSTOM_COMMAND|ADD_CUSTOM_TARGET|ADD_DEFINITIONS|'
+            # r'ADD_DEPENDENCIES|ADD_EXECUTABLE|ADD_LIBRARY|ADD_SUBDIRECTORY|'
+            # r'ADD_TEST|AUX_SOURCE_DIRECTORY|BUILD_COMMAND|BUILD_NAME|'
+            # r'CMAKE_MINIMUM_REQUIRED|CONFIGURE_FILE|CREATE_TEST_SOURCELIST|'
+            # r'ELSE|ELSEIF|ENABLE_LANGUAGE|ENABLE_TESTING|ENDFOREACH|'
+            # r'ENDFUNCTION|ENDIF|ENDMACRO|ENDWHILE|EXEC_PROGRAM|'
+            # r'EXECUTE_PROCESS|EXPORT_LIBRARY_DEPENDENCIES|FILE|FIND_FILE|'
+            # r'FIND_LIBRARY|FIND_PACKAGE|FIND_PATH|FIND_PROGRAM|FLTK_WRAP_UI|'
+            # r'FOREACH|FUNCTION|GET_CMAKE_PROPERTY|GET_DIRECTORY_PROPERTY|'
+            # r'GET_FILENAME_COMPONENT|GET_SOURCE_FILE_PROPERTY|'
+            # r'GET_TARGET_PROPERTY|GET_TEST_PROPERTY|IF|INCLUDE|'
+            # r'INCLUDE_DIRECTORIES|INCLUDE_EXTERNAL_MSPROJECT|'
+            # r'INCLUDE_REGULAR_EXPRESSION|INSTALL|INSTALL_FILES|'
+            # r'INSTALL_PROGRAMS|INSTALL_TARGETS|LINK_DIRECTORIES|'
+            # r'LINK_LIBRARIES|LIST|LOAD_CACHE|LOAD_COMMAND|MACRO|'
+            # r'MAKE_DIRECTORY|MARK_AS_ADVANCED|MATH|MESSAGE|OPTION|'
+            # r'OUTPUT_REQUIRED_FILES|PROJECT|QT_WRAP_CPP|QT_WRAP_UI|REMOVE|'
+            # r'REMOVE_DEFINITIONS|SEPARATE_ARGUMENTS|SET|'
+            # r'SET_DIRECTORY_PROPERTIES|SET_SOURCE_FILES_PROPERTIES|'
+            # r'SET_TARGET_PROPERTIES|SET_TESTS_PROPERTIES|SITE_NAME|'
+            # r'SOURCE_GROUP|STRING|SUBDIR_DEPENDS|SUBDIRS|'
+            # r'TARGET_LINK_LIBRARIES|TRY_COMPILE|TRY_RUN|UNSET|'
+            # r'USE_MANGLED_MESA|UTILITY_SOURCE|VARIABLE_REQUIRES|'
+            # r'VTK_MAKE_INSTANTIATOR|VTK_WRAP_JAVA|VTK_WRAP_PYTHON|'
+            # r'VTK_WRAP_TCL|WHILE|WRITE_FILE|'
+            # r'COUNTARGS)\b', Name.Builtin, 'args'),
+            (r'\b([A-Za-z_]+)([ \t]*)(\()', bygroups(Name.Builtin, Text,
+                                                     Punctuation), 'args'),
+            include('keywords'),
+            include('ws')
+        ],
+        'args': [
+            (r'\(', Punctuation, '#push'),
+            (r'\)', Punctuation, '#pop'),
+            (r'(\${)(.+?)(})', bygroups(Operator, Name.Variable, Operator)),
+            (r'(?s)".*?"', String.Double),
+            (r'\\\S+', String),
+            (r'[^\)$"# \t\n]+', String),
+            (r'\n', Text), # explicitly legal
+            include('keywords'),
+            include('ws')
+        ],
+        'string': [
+
+        ],
+        'keywords': [
+            (r'\b(WIN32|UNIX|APPLE|CYGWIN|BORLAND|MINGW|MSVC|MSVC_IDE|MSVC60|'
+             r'MSVC70|MSVC71|MSVC80|MSVC90)\b', Keyword),
+        ],
+        'ws': [
+            (r'[ \t]+', Text),
+            (r'#.+\n', Comment),
+        ]
+    }
+
index c5229617a44459186fd38122a159754b8d33fef7..598611d44cd3277804f306e15f0c867f7b33d48d 100644 (file)
@@ -5,7 +5,7 @@
 
     Lexers for web-related languages and markup.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 60edf39ecb3f1b69f0e2dafd989673419539d416..cb59c9e64442f8e5a93374e66d2a24ce56750dd1 100644 (file)
@@ -32,7 +32,7 @@
         yourfilter = yourfilter:YourFilter
 
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 try:
index 8d633f7a4b9c28edc3c5e735f201012515e58b04..a486f05b8a10594b824b8f001c98999646886199 100644 (file)
@@ -12,7 +12,7 @@
     Have a look at the `DelphiLexer` to get an idea of how to use
     this scanner.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import re
index 8a04dcb9b63500396e352fd692a7a9862eb13036..7bb1f3f3732f77dda9025ae033fc5494dbf9a938 100644 (file)
@@ -5,7 +5,7 @@
 
     Basic style object.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index f7dc699db231b88ca47ccecfb98b76cf42da98be..429028e811a04342c4f68c58afca22742c64f6bc 100644 (file)
@@ -5,7 +5,7 @@
 
     Contains built-in styles.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -22,6 +22,7 @@ STYLE_MAP = {
     'autumn':   'autumn::AutumnStyle',
     'murphy':   'murphy::MurphyStyle',
     'manni':    'manni::ManniStyle',
+    'monokai':  'monokai::MonokaiStyle',
     'perldoc':  'perldoc::PerldocStyle',
     'pastie':   'pastie::PastieStyle',
     'borland':  'borland::BorlandStyle',
index 8a32bb399e5e9c3bdbc97aae1294b5d497d2d6f1..c494ec42f3ee7537ffaed2f809e8040655ef0320 100644 (file)
@@ -5,7 +5,7 @@
 
     A colorful style, inspired by the terminal highlighting style.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 4d1e14f4fc34af96bf5356384d8bb10c13483d5e..8d4ca08205b16289e9d8c72a778bd905ddcbdeba 100644 (file)
@@ -5,7 +5,7 @@
 
     Style similar to the style used in the Borland IDEs.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index e7886a93ac19d533746b5e454338c006160800b3..805bcf8b7cc0e629b7d46b159da5b81962a9ee92 100644 (file)
@@ -5,7 +5,7 @@
 
     Simple black/white only style.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 3c50e26531c8183b84ec782df5d432f163c813fc..e9fb60b9b1210c48310b3ee890330aef58966350 100644 (file)
@@ -5,7 +5,7 @@
 
     A colorful style, inspired by CodeRay.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 21a088cdf2927062cf174433fa26f4de047bc04f..a494dba228470714ee87c54984f6ee5b0a241969 100644 (file)
@@ -5,7 +5,7 @@
 
     The default highlighting style.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 6f1e28cdbfaec0ad86cc5f2e30088d8d12e66500..6283feddbbf3f9195e507eab6182cf433b2fb868 100644 (file)
@@ -5,7 +5,7 @@
 
     A highlighting style for Pygments, inspired by Emacs.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 280751510b8e3312ed643153377cb6828bba724e..d5393d27ca097b622c2659f0b4a140a9ee0005ed 100644 (file)
@@ -5,7 +5,7 @@
 
     A modern style based on the VIM pyte theme.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 8057f99ff1a5bf8db5b9e86b04d601ad0673c81d..5eb4decec095aceddbc05ffce1e5b1d7a74bd0d3 100644 (file)
@@ -5,7 +5,7 @@
 
     pygments version of my "fruity" vim theme.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index d004a70b3cdb05cba5ee365169c674883364381e..0537c9e606d1c3be885886caaa75ecf8afc6ba77 100644 (file)
@@ -8,7 +8,7 @@
     This is a port of the style used in the `php port`_ of pygments
     by Manni. The style is called 'default' there.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
diff --git a/pygments/styles/monokai.py b/pygments/styles/monokai.py
new file mode 100644 (file)
index 0000000..90c3664
--- /dev/null
@@ -0,0 +1,106 @@
+# -*- coding: utf-8 -*-
+"""
+    pygments.styles.monokai
+    ~~~~~~~~~~~~~~~~~~~~~~~
+
+    Mimic the Monokai color scheme. Based on tango.py.
+
+    http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/
+
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+"""
+
+from pygments.style import Style
+from pygments.token import Keyword, Name, Comment, String, Error, Text, \
+     Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
+
+class MonokaiStyle(Style):
+    """
+    This style mimics the Monokai color scheme.
+    """
+
+    background_color = "#272822"
+    highlight_color = "#49483e"
+
+    styles = {
+        # No corresponding class for the following:
+        Text:                      "#f8f8f2", # class:  ''
+        Whitespace:                "",        # class: 'w'
+        Error:                     "#960050 bg:#1e0010", # class: 'err'
+        Other:                     "",        # class 'x'
+
+        Comment:                   "#75715e", # class: 'c'
+        Comment.Multiline:         "",        # class: 'cm'
+        Comment.Preproc:           "",        # class: 'cp'
+        Comment.Single:            "",        # class: 'c1'
+        Comment.Special:           "",        # class: 'cs'
+
+        Keyword:                   "#66d9ef", # class: 'k'
+        Keyword.Constant:          "",        # class: 'kc'
+        Keyword.Declaration:       "",        # class: 'kd'
+        Keyword.Namespace:         "#f92672", # class: 'kn'
+        Keyword.Pseudo:            "",        # class: 'kp'
+        Keyword.Reserved:          "",        # class: 'kr'
+        Keyword.Type:              "",        # class: 'kt'
+
+        Operator:                  "#f92672", # class: 'o'
+        Operator.Word:             "",        # class: 'ow' - like keywords
+
+        Punctuation:               "#f8f8f2", # class: 'p'
+
+        Name:                      "#f8f8f2", # class: 'n'
+        Name.Attribute:            "#a6e22e", # class: 'na' - to be revised
+        Name.Builtin:              "",        # class: 'nb'
+        Name.Builtin.Pseudo:       "",        # class: 'bp'
+        Name.Class:                "#a6e22e", # class: 'nc' - to be revised
+        Name.Constant:             "#66d9ef", # class: 'no' - to be revised
+        Name.Decorator:            "#a6e22e", # class: 'nd' - to be revised
+        Name.Entity:               "",        # class: 'ni'
+        Name.Exception:            "#a6e22e", # class: 'ne'
+        Name.Function:             "#a6e22e", # class: 'nf'
+        Name.Property:             "",        # class: 'py'
+        Name.Label:                "",        # class: 'nl'
+        Name.Namespace:            "",        # class: 'nn' - to be revised
+        Name.Other:                "#a6e22e", # class: 'nx'
+        Name.Tag:                  "#f92672", # class: 'nt' - like a keyword
+        Name.Variable:             "",        # class: 'nv' - to be revised
+        Name.Variable.Class:       "",        # class: 'vc' - to be revised
+        Name.Variable.Global:      "",        # class: 'vg' - to be revised
+        Name.Variable.Instance:    "",        # class: 'vi' - to be revised
+
+        Number:                    "#ae81ff", # class: 'm'
+        Number.Float:              "",        # class: 'mf'
+        Number.Hex:                "",        # class: 'mh'
+        Number.Integer:            "",        # class: 'mi'
+        Number.Integer.Long:       "",        # class: 'il'
+        Number.Oct:                "",        # class: 'mo'
+
+        Literal:                   "#ae81ff", # class: 'l'
+        Literal.Date:              "#e6db74", # class: 'ld'
+
+        String:                    "#e6db74", # class: 's'
+        String.Backtick:           "",        # class: 'sb'
+        String.Char:               "",        # class: 'sc'
+        String.Doc:                "",        # class: 'sd' - like a comment
+        String.Double:             "",        # class: 's2'
+        String.Escape:             "#ae81ff", # class: 'se'
+        String.Heredoc:            "",        # class: 'sh'
+        String.Interpol:           "",        # class: 'si'
+        String.Other:              "",        # class: 'sx'
+        String.Regex:              "",        # class: 'sr'
+        String.Single:             "",        # class: 's1'
+        String.Symbol:             "",        # class: 'ss'
+
+        Generic:                   "",        # class: 'g'
+        Generic.Deleted:           "",        # class: 'gd',
+        Generic.Emph:              "italic",  # class: 'ge'
+        Generic.Error:             "",        # class: 'gr'
+        Generic.Heading:           "",        # class: 'gh'
+        Generic.Inserted:          "",        # class: 'gi'
+        Generic.Output:            "",        # class: 'go'
+        Generic.Prompt:            "",        # class: 'gp'
+        Generic.Strong:            "bold",    # class: 'gs'
+        Generic.Subheading:        "",        # class: 'gu'
+        Generic.Traceback:         "",        # class: 'gt'
+    }
index 5a3b7fcdb32a739a347c6a8ebbd13f8e6e7add16..01eeff312b239204453530f8a9e067233306e42b 100644 (file)
@@ -5,7 +5,7 @@
 
     Murphy's style from CodeRay.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index c216c8348fa442e3038e7d1bf1084a7f3ee5b9b8..7c552ec1fad72647e702979245fc92b47fc6f7ee 100644 (file)
@@ -5,7 +5,7 @@
 
     pygments version of my "native" vim theme.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 13bf8b7c26155b4e6199586f1a5e88954c51ce47..2ca542336b41f84f33213461b5c9a0fcabcf6018 100644 (file)
@@ -7,7 +7,7 @@
 
     .. _pastie: http://pastie.caboo.se/
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 0a2503f75dd9417ab1d03e996c5da75024b0d602..89388adf4941efa0b4db882a46324d4a1f7c5828 100644 (file)
@@ -7,7 +7,7 @@
 
     .. _perldoc: http://perldoc.perl.org/
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index b1b8caf0e896f376d672633b8af5aa3a22cbee25..933cdadffa09f863ad7b8247fb7e1ee8881a673c 100644 (file)
@@ -33,7 +33,7 @@
     have been chosen to have the same style.  Similarly, keywords (Keyword.*),
     and Operator.Word (and, or, in) have been assigned the same style.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -55,87 +55,87 @@ class TangoStyle(Style):
 
     styles = {
         # No corresponding class for the following:
-        #Text:              "", # class:  '',
-        Whitespace:                "underline #f8f8f8", # class: 'w',
-        Error:                     "#a40000 border:#ef2929", # class: 'err',
-        Other:                     "#000000",        # class 'x',
-
-        Comment:                   "italic #8f5902", # class: 'c',
-        Comment.Multiline:         "italic #8f5902", # class: 'cm',
-        Comment.Preproc:           "italic #8f5902", # class: 'cp',
-        Comment.Single:            "italic #8f5902", # class: 'c1',
-        Comment.Special:           "italic #8f5902", # class: 'cs',
-
-        Keyword:                   "bold #204a87", # class: 'k',
-        Keyword.Constant:          "bold #204a87", # class: 'kc',
-        Keyword.Declaration:       "bold #204a87", # class: 'kd',
-        Keyword.Namespace:         "bold #204a87", # class: 'kn',
-        Keyword.Pseudo:            "bold #204a87", # class: 'kp',
-        Keyword.Reserved:          "bold #204a87", # class: 'kr',
-        Keyword.Type:              "bold #204a87", # class: 'kt',
-
-        Operator:                  "bold #ce5c00", # class: 'o'
-        Operator.Word:             "bold #204a87", # class: 'ow' - like keywords
-
-        Punctuation:               "bold #000000", # class: 'p'
+        #Text:                     "", # class:  ''
+        Whitespace:                "underline #f8f8f8",      # class: 'w'
+        Error:                     "#a40000 border:#ef2929", # class: 'err'
+        Other:                     "#000000",                # class 'x'
+
+        Comment:                   "italic #8f5902", # class: 'c'
+        Comment.Multiline:         "italic #8f5902", # class: 'cm'
+        Comment.Preproc:           "italic #8f5902", # class: 'cp'
+        Comment.Single:            "italic #8f5902", # class: 'c1'
+        Comment.Special:           "italic #8f5902", # class: 'cs'
+
+        Keyword:                   "bold #204a87",   # class: 'k'
+        Keyword.Constant:          "bold #204a87",   # class: 'kc'
+        Keyword.Declaration:       "bold #204a87",   # class: 'kd'
+        Keyword.Namespace:         "bold #204a87",   # class: 'kn'
+        Keyword.Pseudo:            "bold #204a87",   # class: 'kp'
+        Keyword.Reserved:          "bold #204a87",   # class: 'kr'
+        Keyword.Type:              "bold #204a87",   # class: 'kt'
+
+        Operator:                  "bold #ce5c00",   # class: 'o'
+        Operator.Word:             "bold #204a87",   # class: 'ow' - like keywords
+
+        Punctuation:               "bold #000000",   # class: 'p'
 
         # because special names such as Name.Class, Name.Function, etc.
         # are not recognized as such later in the parsing, we choose them
         # to look the same as ordinary variables.
-        Name:                          "#000000",      # class: 'n'
-        Name.Attribute:                "#c4a000",      # class: 'na', - to be revised
-        Name.Builtin:                  "#204a87",      # class: 'nb'
-        Name.Builtin.Pseudo:           "#3465a4",      # class: 'bp'
-        Name.Class:                    "#000000",      # class: 'nc' - to be revised
-        Name.Constant:                 "#000000",      # class: 'no', - to be revised
-        Name.Decorator:                "bold #5c35cc", # class: 'nd', - to be revised
-        Name.Entity:                   "#ce5c00",      # class: 'ni',
-        Name.Exception:                "bold #cc0000", # class: 'ne',
-        Name.Function:                 "#000000",      # class: 'nf'
-        Name.Property:                 "#000000",      # class: 'py',
-        Name.Label:                    "#f57900",      # class: 'nl',
-        Name.Namespace:                "#000000",      # class: 'nn' - to be revised
-        Name.Other:                    "#000000",      # class: 'nx',
-        Name.Tag:                      "bold #204a87", # class'nt' -- like a keyword
-        Name.Variable:                 "#000000",      # class: 'nv', - to be revised
-        Name.Variable.Class:           "#000000",      # class: 'vc', - to be revised
-        Name.Variable.Global:          "#000000",      # class: 'vg', - to be revised
-        Name.Variable.Instance:        "#000000",      # class: 'vi', - to be revised
+        Name:                      "#000000",        # class: 'n'
+        Name.Attribute:            "#c4a000",        # class: 'na' - to be revised
+        Name.Builtin:              "#204a87",        # class: 'nb'
+        Name.Builtin.Pseudo:       "#3465a4",        # class: 'bp'
+        Name.Class:                "#000000",        # class: 'nc' - to be revised
+        Name.Constant:             "#000000",        # class: 'no' - to be revised
+        Name.Decorator:            "bold #5c35cc",   # class: 'nd' - to be revised
+        Name.Entity:               "#ce5c00",        # class: 'ni'
+        Name.Exception:            "bold #cc0000",   # class: 'ne'
+        Name.Function:             "#000000",        # class: 'nf'
+        Name.Property:             "#000000",        # class: 'py'
+        Name.Label:                "#f57900",        # class: 'nl'
+        Name.Namespace:            "#000000",        # class: 'nn' - to be revised
+        Name.Other:                "#000000",        # class: 'nx'
+        Name.Tag:                  "bold #204a87",   # class: 'nt' - like a keyword
+        Name.Variable:             "#000000",        # class: 'nv' - to be revised
+        Name.Variable.Class:       "#000000",        # class: 'vc' - to be revised
+        Name.Variable.Global:      "#000000",        # class: 'vg' - to be revised
+        Name.Variable.Instance:    "#000000",        # class: 'vi' - to be revised
 
         # since the tango light blue does not show up well in text, we choose
         # a pure blue instead.
-        Number:                        "bold #0000cf", # class: 'm'
-        Number.Float:                  "bold #0000cf", # class: ''mf',
-        Number.Hex:                    "bold #0000cf", # class: ''mh',
-        Number.Integer:                "bold #0000cf", # class: ''mi',
-        Number.Integer.Long:           "bold #0000cf", # class: ''il',
-        Number.Oct:                    "bold #0000cf", # class: ''mo',
-
-        Literal:                   "#000000",      # class: 'l',
-        Literal.Date:              "#000000",      # class: 'ld',
-
-        String:                    "#4e9a06",      # class: 's',
-        String.Backtick:           "#4e9a06",      # class: 'sb',
-        String.Char:               "#4e9a06",      # class: 'sc',
-        String.Doc:                "italic #8f5902",  # class: 'sd' - like a comment
-        String.Double:             "#4e9a06",      # class: 's2',
-        String.Escape:             "#4e9a06",      # class: 'se',
-        String.Heredoc:            "#4e9a06",      # class: 'sh',
-        String.Interpol:           "#4e9a06",      # class: 'si',
-        String.Other:              "#4e9a06",      # class: 'sx',
-        String.Regex:              "#4e9a06",      # class: 'sr',
-        String.Single:             "#4e9a06",      # class: 's1',
-        String.Symbol:             "#4e9a06",      # class: 'ss',
-
-        Generic:                   "#000000",      # class: 'g',
-        Generic.Deleted:           "#a40000",      # class: 'gd',
-        Generic.Emph:              "italic #000000",      # class: 'ge',
-        Generic.Error:             "#ef2929",      # class: 'gr',
-        Generic.Heading:           "bold #000080",      # class: 'gh',
-        Generic.Inserted:          "#00A000",      # class: 'gi',
-        Generic.Output:            "italic #000000",      # class: 'go',
-        Generic.Prompt:            "#8f5902",      # class: 'gp',
-        Generic.Strong:            "bold #000000",      # class: 'gs',
-        Generic.Subheading:        "bold #800080",      # class: 'gu',
-        Generic.Traceback:         "bold #a40000",      # class: 'gt',
+        Number:                    "bold #0000cf",   # class: 'm'
+        Number.Float:              "bold #0000cf",   # class: 'mf'
+        Number.Hex:                "bold #0000cf",   # class: 'mh'
+        Number.Integer:            "bold #0000cf",   # class: 'mi'
+        Number.Integer.Long:       "bold #0000cf",   # class: 'il'
+        Number.Oct:                "bold #0000cf",   # class: 'mo'
+
+        Literal:                   "#000000",        # class: 'l'
+        Literal.Date:              "#000000",        # class: 'ld'
+
+        String:                    "#4e9a06",        # class: 's'
+        String.Backtick:           "#4e9a06",        # class: 'sb'
+        String.Char:               "#4e9a06",        # class: 'sc'
+        String.Doc:                "italic #8f5902", # class: 'sd' - like a comment
+        String.Double:             "#4e9a06",        # class: 's2'
+        String.Escape:             "#4e9a06",        # class: 'se'
+        String.Heredoc:            "#4e9a06",        # class: 'sh'
+        String.Interpol:           "#4e9a06",        # class: 'si'
+        String.Other:              "#4e9a06",        # class: 'sx'
+        String.Regex:              "#4e9a06",        # class: 'sr'
+        String.Single:             "#4e9a06",        # class: 's1'
+        String.Symbol:             "#4e9a06",        # class: 'ss'
+
+        Generic:                   "#000000",        # class: 'g'
+        Generic.Deleted:           "#a40000",        # class: 'gd'
+        Generic.Emph:              "italic #000000", # class: 'ge'
+        Generic.Error:             "#ef2929",        # class: 'gr'
+        Generic.Heading:           "bold #000080",   # class: 'gh'
+        Generic.Inserted:          "#00A000",        # class: 'gi'
+        Generic.Output:            "italic #000000", # class: 'go'
+        Generic.Prompt:            "#8f5902",        # class: 'gp'
+        Generic.Strong:            "bold #000000",   # class: 'gs'
+        Generic.Subheading:        "bold #800080",   # class: 'gu'
+        Generic.Traceback:         "bold #a40000",   # class: 'gt'
     }
index 3e40715aadacb3c96e4f0396502e1b9f113ceb9b..f82571360b191a534fd06b04ae45716ebbb8dbc0 100644 (file)
@@ -5,7 +5,7 @@
 
     Port of the default trac highlighter design.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index b7db5f8a9b83ef3e78f7e301d2251442d6637c99..04562879e050f358f9cafb8d0cb5b9f9031a3955 100644 (file)
@@ -5,7 +5,7 @@
 
     A highlighting style for Pygments, inspired by vim.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 55deac1f1bad4fa0b8b14fe62dfef7b75af5639e..7fbca3e77ba89429b8c7e3e34241f2b407a8d980 100644 (file)
@@ -5,7 +5,7 @@
 
     Simple style with MS Visual Studio colors.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index c524bb65bc7f49023dd9310fbe5c7daabce5e590..f0a6541a026762e578b5af890f475a0fa1e89068 100644 (file)
@@ -5,7 +5,7 @@
 
     Basic token types and the standard tokens.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 try:
index 41b333e17da44ef445d8f447e035591794ab1805..8144a2736ab507a32617e070e3a28b1995f5c7e5 100644 (file)
@@ -8,7 +8,7 @@
 
     Inspired by chartypes_create.py from the MoinMoin project.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 from pygments.util import u_prefix
index ac9babc13eb25005326ef68fac51004fd279d753..fc65b676618741d87001c49c77164ea4a66792ec 100644 (file)
@@ -5,7 +5,7 @@
 
     Utility functions.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 import re
index 35adc37ba58dd5ed73257c1e0cbbe4e40a7aac0d..c98a4a55c2e7cc0a102eeceee26d03423daa0f95 100755 (executable)
@@ -7,7 +7,7 @@
     Make sure each Python file has a correct file header
     including copyright and license information.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -30,7 +30,7 @@ def checker(*suffixes, **kwds):
 
 
 name_mail_re = r'[\w ]+(<.*?>)?'
-copyright_re = re.compile(r'^    :copyright: Copyright 2006-2009 by the Pygments team, '
+copyright_re = re.compile(r'^    :copyright: Copyright 2006-2010 by the Pygments team, '
                           r'see AUTHORS\.$', re.UNICODE)
 copyright_2_re = re.compile(r'^                %s(, %s)*[,.]$' %
                             (name_mail_re, name_mail_re), re.UNICODE)
index e680d1bd7ec6234ff742187a17e9feeaa5ab6945..d78e4a73556d1812adbb0c1ad3c4e197b976093f 100755 (executable)
@@ -7,7 +7,7 @@
     Find code tags in specified files and/or directories
     and create a report in HTML format.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 44dd053964975463eea150fd20a8dc9f39397852..a3cdad4fbabfd662b8f0e3ad5aa4a818324bb011 100644 (file)
@@ -8,7 +8,7 @@
     the text where Error tokens are being generated, along
     with some context.
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index b54823e55c9f4fefd5161bbb849527ff36e71783..45537a49ce1504fc97fd6fc69643cef47d47f89e 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@
     .. _Pygments tip:
        http://dev.pocoo.org/hg/pygments-main/archive/tip.tar.gz#egg=Pygments-dev
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -46,7 +46,7 @@ except ImportError:
 
 setup(
     name = 'Pygments',
-    version = '1.1.1',
+    version = '1.2',
     url = 'http://pygments.org/',
     license = 'BSD License',
     author = 'Georg Brandl',
diff --git a/tests/examplefiles/broken/fucked_up.rb b/tests/examplefiles/broken/fucked_up.rb
deleted file mode 100644 (file)
index b1d0ee3..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-# vim:ft=ruby
-
-events = Hash.new { |h, k| h[k] = [] }
-DATA.read.split(/\n\n\n\s*/).each do |event|
-       name = event[/^.*/].sub(/http:.*/, '')
-       event[/\n.*/m].scan(/^([A-Z]{2}\S*)\s*(\S*)\s*(\S*)(\s*\S*)/) do |kind, day, daytime, comment|
-               events[ [day, daytime] ] << [kind, name + comment]
-       end
-end
-
-conflicts = 0
-events.to_a.sort_by do |(day, daytime),|
-       [%w(Mo Di Mi Do Fr).index(day) || 0, daytime]
-end.each do |(day, daytime), names|
-       if names.size > 1
-               conflicts += 1
-               print '!!! '
-       end
-       print "#{day} #{daytime}: "
-       names.each { |kind, name| puts "  #{kind}  #{name}" }
-       puts
-end
-
-puts '%d conflicts' % conflicts
-puts '%d SWS' % (events.inject(0) { |sum, ((day, daytime),)| sum + (daytime[/\d+$/].to_i - daytime[/^\d+/].to_i) })
-
-string = % foo     # strange. huh?
-print "Escape here: \n"
-print 'Dont escape here: \n'
-
-__END__
-Informatik und Informationsgesellschaft I: Digitale Medien (32 214)
-Computer lassen ihre eigentliche Bestimmung durch Multimedia und Vernetzung erkennen: Es sind digitale Medien, die alle bisherigen Massen- und Kommunikationsmedien simulieren, kopieren oder ersetzen können. Die kurze Geschichte elektronischer Medien vom Telegramm bis zum Fernsehen wird so zur Vorgeschichte des Computers als Medium. Der Prozess der Mediatisierung der Rechnernetze soll in Technik, Theorie und Praxis untersucht werden. Das PR soll die Techniken der ortsverteilten und zeitversetzten Lehre an Hand praktischer Übungen vorführen und untersuchen.
-VL     Di      15-17   wöch.  RUD 25, 3.101   J. Koubek
-VL     Do      15-17   wöch.  RUD 25, 3.101
-UE/PR  Do      17-19   wöch.  RUD 25, 3.101   J.-M. Loebel
-
-
-Methoden und Modelle des Systementwurfs (32 223)
-Gute Methoden zum Entwurf und zur Verifikation von Systemen sind ein Schlüssel für gute Software. Dieses Seminar betrachtet moderne Entwurfsmethoden.
- VL    Di      09-11   wöch.  RUD 26, 0\92313  W. Reisig
- VL    Do      09-11   wöch.  RUD 26, 0\92313  
- UE    Di      11-13   wöch.  RUD 26, 0\92313  
- PR    Di      13-15   wöch.  RUD 26, 0\92313  D. Weinberg
-
-
-Komplexitätstheorie (32 229)
-In dieser Vorlesung untersuchen wir eine Reihe von wichtigen algorithmischen Problemstellungen aus verschiedenen Bereichen der Informatik. Unser besonderes Interesse gilt dabei der Abschätzung der Rechenressourcen, die zu ihrer Lösung aufzubringen sind.  Die Vorlesung bildet eine wichtige Grundlage für weiterführende Veranstaltungen in den Bereichen Algorithmen, Kryptologie, Algorithmisches Lernen und Algorithmisches Beweisen.
- VL    Di      09-11   wöch.  RUD 26, 1\92303  J. Köbler
- VL    Do      09-11   wöch.  RUD 26, 1\92305  
- UE    Do      11-13   wöch.  RUD 26, 1\92305  
-
-
-Zuverlässige Systeme (32 234)
-Mit zunehmender Verbreitung der Computertechnologie in immer mehr Bereichen des menschlichen Lebens wird die Zuverlässigkeit solcher Systeme zu einer immer zentraleren Frage.
-Der Halbkurs "Zuverlässige Systeme" konzentriert sich auf folgende Schwerpunkte: Zuverlässigkeit, Fehlertoleranz, Responsivität, Messungen, Anwendungen, Systemmodelle und Techniken, Ausfallverhalten, Fehlermodelle, Schedulingtechniken, Software/Hardware - responsives Systemdesign, Analyse und Synthese, Bewertung, Fallstudien in Forschung und Industrie.
-Der Halbkurs kann mit dem Halbkurs "Eigenschaften mobiler und eingebetteter Systeme" zu einem Projektkurs kombiniert werden. Ein gemeinsames Projekt begleitet beide Halbkurse.
-VL     Di      09-11   wöch.  RUD 26, 1\92308  M. Malek
-VL     Do      09-11   wöch.  RUD 26, 1\92308
-PR     n.V.
-
-
-Stochastik für InformatikerInnen (32 239)
-Grundlagen der Wahrscheinlichkeitsrechnung, Diskrete und stetige Wahrscheinlichkeitsmodelle in der Informatik, Grenzwertsätze, Simulationsverfahren, Zufallszahlen, Statistische Schätz- und Testverfahren, Markoffsche Ketten, Simulated Annealing, Probabilistische Analyse von Algorithmen.
-VL     Mo      09-11   wöch.  RUD 25, 3.101   W. Kössler
-VL     Mi      09-11   wöch.  RUD 25, 3.101
-UE     Mo      11-13   wöch.  RUD 25, 3.101
- UE    Mi      11-13   wöch.  RUD 25. 3.101
-
-
-Geschichte der Informatik \96 Ausgewählte Kapitel (32 243)
-VL     Mi      13-15   wöch.  RUD 25, 3.113   W. Coy
-
-
-Aktuelle Themen der Theoretischen Informatik (32 260)
-In diesem Seminar sollen wichtige aktuelle Veröffentlichungen aus der theoretischen Informatik gemeinsam erarbeitet werden. Genaueres wird erst kurz vor dem Seminar entschieden. Bei Interesse wenden Sie sich bitte möglichst frühzeitig an den Veranstalter.
- SE    Fr      09-11   wöch.  RUD 26, 1\92307  M. Grohe 
index a3f9911473ba6d30f219f67daf9e9f0933e00d5d..9138e01bc698fa9d2d43201c6415fb04517bbd71 100644 (file)
@@ -1,3 +1,5 @@
+Text before
+
 Traceback (most recent call last):
   File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 314, in dispatch_request
     dispatcher.dispatch(req)
@@ -14,3 +16,5 @@ Traceback (most recent call last):
   File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 36, in _rollback_on_error
     return function(self, *args, **kwargs)
 OperationalError: database is locked
+
+Text after
diff --git a/tests/examplefiles/fucked_up.rb b/tests/examplefiles/fucked_up.rb
new file mode 100644 (file)
index 0000000..b1d0ee3
--- /dev/null
@@ -0,0 +1,77 @@
+# vim:ft=ruby
+
+events = Hash.new { |h, k| h[k] = [] }
+DATA.read.split(/\n\n\n\s*/).each do |event|
+       name = event[/^.*/].sub(/http:.*/, '')
+       event[/\n.*/m].scan(/^([A-Z]{2}\S*)\s*(\S*)\s*(\S*)(\s*\S*)/) do |kind, day, daytime, comment|
+               events[ [day, daytime] ] << [kind, name + comment]
+       end
+end
+
+conflicts = 0
+events.to_a.sort_by do |(day, daytime),|
+       [%w(Mo Di Mi Do Fr).index(day) || 0, daytime]
+end.each do |(day, daytime), names|
+       if names.size > 1
+               conflicts += 1
+               print '!!! '
+       end
+       print "#{day} #{daytime}: "
+       names.each { |kind, name| puts "  #{kind}  #{name}" }
+       puts
+end
+
+puts '%d conflicts' % conflicts
+puts '%d SWS' % (events.inject(0) { |sum, ((day, daytime),)| sum + (daytime[/\d+$/].to_i - daytime[/^\d+/].to_i) })
+
+string = % foo     # strange. huh?
+print "Escape here: \n"
+print 'Dont escape here: \n'
+
+__END__
+Informatik und Informationsgesellschaft I: Digitale Medien (32 214)
+Computer lassen ihre eigentliche Bestimmung durch Multimedia und Vernetzung erkennen: Es sind digitale Medien, die alle bisherigen Massen- und Kommunikationsmedien simulieren, kopieren oder ersetzen können. Die kurze Geschichte elektronischer Medien vom Telegramm bis zum Fernsehen wird so zur Vorgeschichte des Computers als Medium. Der Prozess der Mediatisierung der Rechnernetze soll in Technik, Theorie und Praxis untersucht werden. Das PR soll die Techniken der ortsverteilten und zeitversetzten Lehre an Hand praktischer Übungen vorführen und untersuchen.
+VL     Di      15-17   wöch.  RUD 25, 3.101   J. Koubek
+VL     Do      15-17   wöch.  RUD 25, 3.101
+UE/PR  Do      17-19   wöch.  RUD 25, 3.101   J.-M. Loebel
+
+
+Methoden und Modelle des Systementwurfs (32 223)
+Gute Methoden zum Entwurf und zur Verifikation von Systemen sind ein Schlüssel für gute Software. Dieses Seminar betrachtet moderne Entwurfsmethoden.
+ VL    Di      09-11   wöch.  RUD 26, 0\92313  W. Reisig
+ VL    Do      09-11   wöch.  RUD 26, 0\92313  
+ UE    Di      11-13   wöch.  RUD 26, 0\92313  
+ PR    Di      13-15   wöch.  RUD 26, 0\92313  D. Weinberg
+
+
+Komplexitätstheorie (32 229)
+In dieser Vorlesung untersuchen wir eine Reihe von wichtigen algorithmischen Problemstellungen aus verschiedenen Bereichen der Informatik. Unser besonderes Interesse gilt dabei der Abschätzung der Rechenressourcen, die zu ihrer Lösung aufzubringen sind.  Die Vorlesung bildet eine wichtige Grundlage für weiterführende Veranstaltungen in den Bereichen Algorithmen, Kryptologie, Algorithmisches Lernen und Algorithmisches Beweisen.
+ VL    Di      09-11   wöch.  RUD 26, 1\92303  J. Köbler
+ VL    Do      09-11   wöch.  RUD 26, 1\92305  
+ UE    Do      11-13   wöch.  RUD 26, 1\92305  
+
+
+Zuverlässige Systeme (32 234)
+Mit zunehmender Verbreitung der Computertechnologie in immer mehr Bereichen des menschlichen Lebens wird die Zuverlässigkeit solcher Systeme zu einer immer zentraleren Frage.
+Der Halbkurs "Zuverlässige Systeme" konzentriert sich auf folgende Schwerpunkte: Zuverlässigkeit, Fehlertoleranz, Responsivität, Messungen, Anwendungen, Systemmodelle und Techniken, Ausfallverhalten, Fehlermodelle, Schedulingtechniken, Software/Hardware - responsives Systemdesign, Analyse und Synthese, Bewertung, Fallstudien in Forschung und Industrie.
+Der Halbkurs kann mit dem Halbkurs "Eigenschaften mobiler und eingebetteter Systeme" zu einem Projektkurs kombiniert werden. Ein gemeinsames Projekt begleitet beide Halbkurse.
+VL     Di      09-11   wöch.  RUD 26, 1\92308  M. Malek
+VL     Do      09-11   wöch.  RUD 26, 1\92308
+PR     n.V.
+
+
+Stochastik für InformatikerInnen (32 239)
+Grundlagen der Wahrscheinlichkeitsrechnung, Diskrete und stetige Wahrscheinlichkeitsmodelle in der Informatik, Grenzwertsätze, Simulationsverfahren, Zufallszahlen, Statistische Schätz- und Testverfahren, Markoffsche Ketten, Simulated Annealing, Probabilistische Analyse von Algorithmen.
+VL     Mo      09-11   wöch.  RUD 25, 3.101   W. Kössler
+VL     Mi      09-11   wöch.  RUD 25, 3.101
+UE     Mo      11-13   wöch.  RUD 25, 3.101
+ UE    Mi      11-13   wöch.  RUD 25. 3.101
+
+
+Geschichte der Informatik \96 Ausgewählte Kapitel (32 243)
+VL     Mi      13-15   wöch.  RUD 25, 3.113   W. Coy
+
+
+Aktuelle Themen der Theoretischen Informatik (32 260)
+In diesem Seminar sollen wichtige aktuelle Veröffentlichungen aus der theoretischen Informatik gemeinsam erarbeitet werden. Genaueres wird erst kurz vor dem Seminar entschieden. Bei Interesse wenden Sie sich bitte möglichst frühzeitig an den Veranstalter.
+ SE    Fr      09-11   wöch.  RUD 26, 1\92307  M. Grohe 
diff --git a/tests/examplefiles/main.cmake b/tests/examplefiles/main.cmake
new file mode 100644 (file)
index 0000000..dac3da4
--- /dev/null
@@ -0,0 +1,42 @@
+SET( SOURCES back.c io.c main.c )
+MESSAGE( ${SOURCES}   )      # three arguments, prints "back.cio.cmain.c"
+MESSAGE( "${SOURCES}" )      # one argument,    prints "back.c;io.c;main.c"
+MESSAGE( "" )                # one argument,    prints "" an empty line
+MESSAGE( "${EMPTY_STRING}" ) # one argument,    prints "" an empty line
+MESSAGE( ${EMPTY_STRING} )   # zero arguments,  causes CMake Error
+                             # "MESSAGE called with incorrect number of arguments"
+MESSAGE( \\\"\ \(\)\#\$\^ ) # this message contains literal characters
+
+MESSAGE( "This is practice." )  # prints "This is practice."
+MESSAGE( "This;is;practice." )  # prints "This;is;practice."
+MESSAGE( "Hi. ) MESSAGE( x )" ) # prints "Hi. ) MESSAGE( x )"
+
+MESSAGE( "Welc"ome ) # rule 1
+MESSAGE( Welc"ome" ) # rule 3
+MESSAGE( Welc"ome)" ) # rule 2
+MESSAGE( ""Thanks ) # rule 1
+MESSAGE( Thanks"" ) # rule 3
+
+SET( x y A B C )              # stores "y;A;B;C" in x (without quote)
+SET( ${x} )                   # => SET( y;A;B;C ) => SET( y A B C)
+MESSAGE( ${y} )               # prints "ABC" to stdout (without quotes)
+SET( y x )                    # stores "x" in y (without quotes)
+SET( ${y} y = x )             # => SET( x y )
+MESSAGE( "\${x} = '${x}'" )   # prints "${x} = 'y;=;x'" to stdout (without quotes)
+SET( y ${x} )                 # => SET( y y = x ) => stores "y;=;x" in y (without quotes)
+MESSAGE( ${y} )               # prints "y=x" to stdout (without quotes)
+
+SET( x a b c   ) # stores "a;b;c" in x      (without quotes)
+SET( y "a b c" ) # stores "a b c" in y      (without quotes)
+MESSAGE( a b c ) # prints "abc"   to stdout (without quotes)
+MESSAGE( ${x} )  # prints "abc"   to stdout (without quotes)
+MESSAGE("${x}")  # prints "a;b;c" to stdout (without quotes)
+MESSAGE( ${y} )  # prints "a b c" to stdout (without quotes)
+MESSAGE("${y}")  # prints "a b c" to stdout (without quotes)
+
+# This is a comment.
+COMMAND( arguments go here )
+ANOTHER_COMMAND() # this command has no arguments
+YET_ANOTHER_COMMAND( these
+  arguments are spread         # another comment
+  over several lines )
diff --git a/tests/examplefiles/test.asy b/tests/examplefiles/test.asy
new file mode 100644 (file)
index 0000000..cfcc3d0
--- /dev/null
@@ -0,0 +1,131 @@
+// example file for roundedpath() in roundedpath.asy
+// written by stefan knorr
+
+
+// import needed packages
+import roundedpath;
+
+// function definition
+picture CreateKOOS(real Scale, string legend)               // draw labeled coordinate system as picture
+{
+  picture ReturnPic;
+  real S = 1.2*Scale;
+  draw(ReturnPic, ((-S,0)--(S,0)), bar = EndArrow);         // x axis
+  draw(ReturnPic, ((0,-S)--(0,S)), bar = EndArrow);         // y axis
+  label(ReturnPic, "$\varepsilon$", (S,0), SW);             // x axis label
+  label(ReturnPic, "$\sigma$", (0,S), SW);                  // y axis label
+  label(ReturnPic, legend, (0.7S, -S), NW);                 // add label 'legend' 
+  return ReturnPic;                                         // return picture
+}
+
+
+// some global definitions
+real S = 13mm;                          // universal scale factor for the whole file
+real grad = 0.25;                       // gradient for lines
+real radius = 0.04;                     // radius for the rounded path'
+real lw = 2;                            // linewidth
+pair A = (-1, -1);                      // start point for graphs
+pair E = ( 1,  1);                      // end point for graphs
+path graph;                             // local graph
+pen ActPen;                             // actual pen for each drawing
+picture T[];                            // vector of all four diagrams
+real inc = 2.8;                         // increment-offset for combining pictures
+
+//////////////////////////////////////// 1st diagram
+T[1] = CreateKOOS(S, "$T_1$");                                        // initialise T[1] as empty diagram with label $T_1$                  
+graph = A;                                                            //  # pointwise definition of current path 'graph'                    
+graph = graph -- (A.x + grad*1.6, A.y + 1.6);                         //  #                                                                 
+graph = graph -- (E.x - grad*0.4, E.y - 0.4);                         //  #                                                                 
+graph = graph -- E;                                                   //  #
+
+graph = roundedpath(graph, radius, S);                                // round edges of 'graph' using roundedpath() in roundedpath.asy      
+ActPen =  rgb(0,0,0.6) + linewidth(lw);                               // define pen for drawing in 1st diagram                              
+draw(T[1],                   graph, ActPen);                          // draw 'graph' with 'ActPen' into 'T[1]' (1st hysteresis branch)     
+draw(T[1], rotate(180,(0,0))*graph, ActPen);                          // draw rotated 'graph' (2nd hysteresis branch)                       
+
+graph = (0,0) -- (grad*0.6, 0.6) -- ( (grad*0.6, 0.6) + (0.1, 0) );   // define branch from origin to hysteresis
+graph = roundedpath(graph, radius, S);                                // round this path                        
+draw(T[1], graph, ActPen);                                            // draw this path into 'T[1]'             
+
+
+//////////////////////////////////////// 2nd diagram
+T[2] = CreateKOOS(S, "$T_2$");                                        // initialise T[2] as empty diagram with label $T_2$              
+graph = A;                                                            //  # pointwise definition of current path 'graph'                
+graph = graph -- (A.x + grad*1.3, A.y + 1.3);                         //  #                                                             
+graph = graph -- (E.x - grad*0.7 , E.y - 0.7);                        //  #                                                             
+graph = graph -- E;                                                   //  #
+                                                                                                
+graph = roundedpath(graph, radius, S);                                // round edges of 'graph' using roundedpath() in roundedpath.asy      
+ActPen =  rgb(0.2,0,0.4) + linewidth(lw);                             // define pen for drawing in 2nd diagram                              
+draw(T[2],                   graph, ActPen);                          // draw 'graph' with 'ActPen' into 'T[2]' (1st hysteresis branch)     
+draw(T[2], rotate(180,(0,0))*graph, ActPen);                          // draw rotated 'graph' (2nd hysteresis branch)                       
+
+graph = (0,0) -- (grad*0.3, 0.3) -- ( (grad*0.3, 0.3) + (0.1, 0) );   // define branch from origin to hysteresis
+graph = roundedpath(graph, radius, S);                                // round this path                        
+draw(T[2], graph, ActPen);                                            // draw this path into 'T[2]'             
+
+
+//////////////////////////////////////// 3rd diagram
+T[3] = CreateKOOS(S, "$T_3$");                                        // initialise T[3] as empty diagram with label $T_3$              
+graph = A;                                                            //  # pointwise definition of current path 'graph'                
+graph = graph -- (A.x + grad*0.7, A.y + 0.7);                         //  #                                                             
+graph = graph -- ( - grad*0.3 , - 0.3);                               //  #                                                             
+graph = graph -- (0,0);                                               //  #                                                             
+graph = graph -- (grad*0.6, 0.6);                                     //  #                                                             
+graph = graph -- (E.x - grad*0.4, E.y - 0.4);                         //  #                                                             
+graph = graph -- E;                                                   //  #                                                             
+                                                                                                                                        
+graph = roundedpath(graph, radius, S);                                // round edges of 'graph' using roundedpath() in roundedpath.asy  
+ActPen =  rgb(0.6,0,0.2) + linewidth(lw);                             // define pen for drawing in 3rd diagram                          
+draw(T[3],                   graph, ActPen);                          // draw 'graph' with 'ActPen' into 'T[3]' (1st hysteresis branch) 
+draw(T[3], rotate(180,(0,0))*graph, ActPen);                          // draw rotated 'graph' (2nd hysteresis branch)                   
+
+
+//////////////////////////////////////// 4th diagram
+T[4] = CreateKOOS(S, "$T_4$");                                        // initialise T[4] as empty diagram with label $T_4$              
+graph = A;                                                            //  # pointwise definition of current path 'graph'                
+graph = graph -- (A.x + grad*0.4, A.y + 0.4);                         //  #                                                             
+graph = graph -- ( - grad*0.6 , - 0.6);                               //  #                                                             
+graph = graph -- (0,0);                                               //  #                                                             
+graph = graph -- (grad*0.9, 0.9);                                     //  #                                                             
+graph = graph -- (E.x - grad*0.1, E.y - 0.1);                         //  #                                                             
+graph = graph -- E;                                                   //  #                                                             
+                                                                                                                                        
+graph = roundedpath(graph, radius, S);                                // round edges of 'graph' using roundedpath() in roundedpath.asy  
+ActPen =  rgb(0.6,0,0) + linewidth(lw);                               // define pen for drawing in 4th diagram                          
+draw(T[4],                   graph, ActPen);                          // draw 'graph' with 'ActPen' into 'T[4]' (1st hysteresis branch) 
+draw(T[4], rotate(180,(0,0))*graph, ActPen);                          // draw rotated 'graph' (3nd hysteresis branch)                   
+
+
+// add some labels and black dots to the first two pictures
+pair SWW = (-0.8, -0.6);
+label(T[1], "$\sigma_f$", (0, 0.6S), NE);                             // sigma_f
+draw(T[1], (0, 0.6S), linewidth(3) + black);
+label(T[2], "$\sigma_f$", (0, 0.3S), NE);                             // sigma_f
+draw(T[2], (0, 0.3S), linewidth(3) + black);
+label(T[1], "$\varepsilon_p$", (0.7S, 0), SWW);                       // epsilon_p
+draw(T[1], (0.75S, 0), linewidth(3) + black);
+label(T[2], "$\varepsilon_p$", (0.7S, 0), SWW);                       // epsilon_p
+draw(T[2], (0.75S, 0), linewidth(3) + black);
+
+
+// add all pictures T[1...4] to the current one
+add(T[1],(0,0));
+add(T[2],(1*inc*S,0));
+add(T[3],(2*inc*S,0));
+add(T[4],(3*inc*S,0));
+
+
+// draw line of constant \sigma and all intersection points with the graphs in T[1...4]
+ActPen = linewidth(1) + dashed + gray(0.5);                           // pen definition
+draw((-S, 0.45*S)--((3*inc+1)*S, 0.45*S), ActPen);                    // draw backgoundline
+label("$\sigma_s$", (-S, 0.45S), W);                            // label 'sigma_s'
+
+path mark = scale(2)*unitcircle;                                  // define mark-symbol to be used for intersections
+ActPen = linewidth(1) + gray(0.5);                                    // define pen for intersection mark
+draw(shift(( 1 - grad*0.55 + 0*inc)*S, 0.45*S)*mark, ActPen);         //  # draw all intersections
+draw(shift((-1 + grad*1.45 + 0*inc)*S, 0.45*S)*mark, ActPen);         //  #
+draw(shift(( 1 - grad*0.55 + 1*inc)*S, 0.45*S)*mark, ActPen);         //  #
+draw(shift(( 1 - grad*0.55 + 2*inc)*S, 0.45*S)*mark, ActPen);         //  # 
+draw(shift((     grad*0.45 + 2*inc)*S, 0.45*S)*mark, ActPen);         //  # 
+draw(shift((     grad*0.45 + 3*inc)*S, 0.45*S)*mark, ActPen);         //  #
index 39365c0ea52a3a955b04d5c0d078b05d4f9246fd..b22f0c61f41b0e4945594ea517f73079fde7de3b 100644 (file)
@@ -6,16 +6,6 @@
     }
 </script>
 <style>
-/*
- * Pocoo highlight package "green" style
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- * based on the pyte vim theme
- *
- * :copyright: 2006-2007 by Georg Brandl.
- * :license: GNU GPL, see LICENSE for more details.
- */
-
 .syntax { border: 1px solid #d0d0d0; background-color: #f0f0f0;
           margin-left: 10px; margin-right: 10px; }
 
@@ -71,8 +61,6 @@ pre.syntax { padding: 5px; margin-top: 0px; }
 
     Pocoo ACL System.
 
-    :copyright: 2006-2007 by Armin Ronacher.
-    :license: GNU GPL, see LICENSE for more details.
 </span><span class="st st-db">&quot;&quot;&quot;</span>
 
 <span class="kw">from </span><span class="cls">pocoo.db</span><span class="kw"> import</span> <span class="name">meta</span>
diff --git a/tests/examplefiles/truncated.pytb b/tests/examplefiles/truncated.pytb
new file mode 100644 (file)
index 0000000..ad5b6d4
--- /dev/null
@@ -0,0 +1,15 @@
+  File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 314, in dispatch_request
+    dispatcher.dispatch(req)
+  File "/usr/lib/python2.3/site-packages/trac/web/main.py", line 186, in dispatch
+    req.session = Session(self.env, req)
+  File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 52, in __init__
+    self.promote_session(sid)
+  File "/usr/lib/python2.3/site-packages/trac/web/session.py", line 125, in promote_session
+    "AND authenticated=0", (sid,))
+  File "/usr/lib/python2.3/site-packages/trac/db/util.py", line 47, in execute
+    return self.cursor.execute(sql_escape_percent(sql), args)
+  File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 44, in execute
+    args or [])
+  File "/usr/lib/python2.3/site-packages/trac/db/sqlite_backend.py", line 36, in _rollback_on_error
+    return function(self, *args, **kwargs)
+OperationalError: database is locked
index 3c4de1dea99f228d560d629f6f2e49206ec71f9a..2d6fc36885fab9a2bd1170e22f4bc974aab6bca8 100644 (file)
@@ -8,7 +8,7 @@
         python run.py [testfile ...]
 
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 97c832d2ca73edc852c5447ad49ba4577ba3e6c2..954f6f78fb9d57bc5123f4c7e5e83d213f94b830 100644 (file)
@@ -8,7 +8,7 @@
         python run.py [testfile ...]
 
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index e106b19c378b9955718979891506d4e573cad256..44a656b44fdce44a075fac39adcce17ea6a0bb1d 100644 (file)
@@ -3,7 +3,7 @@
     Pygments basic API tests
     ~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 79b84866b44c74188fbdc10f62cde34340f1de52..c172116c5a43d97565d082b8f0836cd9f8412351 100644 (file)
@@ -3,7 +3,7 @@
     Basic CLexer Test
     ~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index b3088251c5b00b8774e7f246cd8f8aa3315c7384..151346070e17e8b36ff6b283a90737eaa3469324 100644 (file)
@@ -3,7 +3,7 @@
     Command line test
     ~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 2f6efa21cdf839d4fee028d2814034b06b5b280a..d56eb7c30117a31e5f4355b7f10d155fb58d2567 100644 (file)
@@ -3,7 +3,7 @@
     Pygments tests with example files
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 365cc8ff98a8ef9867fcec37c2aaad88f21b519a..9ff593f9c1fd6460e0751a703b3563e3d5c623ad 100644 (file)
@@ -3,7 +3,7 @@
     Pygments HTML formatter tests
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -84,14 +84,9 @@ class HtmlFormatterTest(unittest.TestCase):
         tfile.close()
         catname = os.path.join(TESTDIR, 'dtds', 'HTML4.soc')
         try:
-            try:
-                import subprocess
-                ret = subprocess.Popen(['nsgmls', '-s', '-c', catname, pathname],
-                                       stdout=subprocess.PIPE).wait()
-            except ImportError:
-                # Python 2.3 - no subprocess module
-                ret = os.popen('nsgmls -s -c "%s" "%s"' % (catname, pathname)).close()
-                if ret == 32512: raise OSError  # not found
+            import subprocess
+            ret = subprocess.Popen(['nsgmls', '-s', '-c', catname, pathname],
+                                   stdout=subprocess.PIPE).wait()
         except OSError:
             # nsgmls not available
             pass
index 54c43811d991f353c8b96da9bd7d4dfaa92468b9..dc8231bebee476ad0c0f9d9294c8a98701576f72 100644 (file)
@@ -3,7 +3,7 @@
     Pygments LaTeX formatter tests
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -33,16 +33,10 @@ class LatexFormatterTest(unittest.TestCase):
         fmt.format(tokensource, tfile)
         tfile.close()
         try:
-            try:
-                import subprocess
-                ret = subprocess.Popen(['latex', '-interaction=nonstopmode',
-                                        pathname],
-                                       stdout=subprocess.PIPE).wait()
-            except ImportError:
-                # Python 2.3 - no subprocess module
-                ret = os.popen('latex -interaction=nonstopmode "%s"'
-                               % pathname).close()
-                if ret == 32512: raise OSError  # not found
+            import subprocess
+            ret = subprocess.Popen(['latex', '-interaction=nonstopmode',
+                                    pathname],
+                                   stdout=subprocess.PIPE).wait()
         except OSError:
             # latex not available
             pass
index 59284599dd1c7e6fd40d3260fb5fda12e0579563..f9c1b7ac2e3d9dc0df1964bdaa9d9db851df86fe 100644 (file)
@@ -3,7 +3,7 @@
     Pygments regex lexer tests
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 96ac75c80b8d3d1dd99cef7c695b0b7a11cbbcb5..9a836845d7723f8eb6a4f812bf94b1c88aaf4d39 100644 (file)
@@ -3,7 +3,7 @@
     Test suite for the token module
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index ad8f641d50e98d3ea35eed8839ab65c63c06a4ec..3d824f51986fa101010e4409f7f6e04e651bdca5 100644 (file)
@@ -3,7 +3,7 @@
     Pygments tests for using()
     ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
index 4dcbcd0bdf78899c640feb8f191022ddc4e462e8..b0fc2579aa6dfbf101feb49694941fb9fa4d54d7 100644 (file)
@@ -3,7 +3,7 @@
     Test suite for the util module
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-    :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """