* 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
* 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
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)
-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
#
# 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.
#
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 {} +
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
.. _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
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
.. _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
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
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
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
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
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
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
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 ;)
<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.
<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
<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>
</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
<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 "anchorlinenos"</li>
<li>Jonas Obrist -- BBCode lexer</li>
<li>David Oliva -- Rebol lexer</li>
<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>
</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
<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>
</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>
<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>
<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">></span></tt>.</li>
+correctly highlights lines ending in <tt class="docutils literal">></tt>.</li>
<li>Support more delimiters for perl regular expressions (#258).</li>
<li>ObjectiveC lexer now supports 2.0 features.</li>
</ul>
<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">
<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>
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>
</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"><pre></span></tt> tag as the
+will just integrate the numbers in the same <tt class="docutils literal"><pre></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
<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>
<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">
</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
<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>
<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
+"emacs" 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>
$ 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>
<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"><span></span></tt> tags with <tt class="docutils literal"><span class="pre">class</span></tt> attributes.
+formatter by default only outputs <tt class="docutils literal"><span></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">
<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>
</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
-"emacs" 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
</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
</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
<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>
<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" />
</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
<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" />
</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
<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>
<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
<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"><u></span></tt>, <tt class="docutils literal"><span class="pre"><font></span></tt>, etc). Because this isn't good
+use CSS but inline markup (<tt class="docutils literal"><u></tt>, <tt class="docutils literal"><font></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>
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
<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">"utf-8"</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">""</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">""</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>
<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">"guess"</span></tt>.
+for example if you want to set the input encoding to <tt class="docutils literal">"guess"</tt>.
Therefore, <cite>outencoding</cite> has been introduced which overrides <cite>encoding</cite>
for the formatter if given.</p>
</dd>
<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" />
<div class="section" id="htmlformatter">
<h4><cite>HtmlFormatter</cite></h4>
<blockquote>
-<p>Format tokens as HTML 4 <tt class="docutils literal"><span class="pre"><span></span></tt> tags within a <tt class="docutils literal"><span class="pre"><pre></span></tt> tag, wrapped
-in a <tt class="docutils literal"><span class="pre"><div></span></tt> tag. The <tt class="docutils literal"><span class="pre"><div></span></tt>'s CSS class can be set by the <cite>cssclass</cite>
+<p>Format tokens as HTML 4 <tt class="docutils literal"><span></tt> tags within a <tt class="docutils literal"><pre></tt> tag, wrapped
+in a <tt class="docutils literal"><div></tt> tag. The <tt class="docutils literal"><div></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">"table"</span></tt>, the <tt class="docutils literal"><span class="pre"><pre></span></tt> is
-additionally wrapped inside a <tt class="docutils literal"><span class="pre"><table></span></tt> which has one row and two
+<p>If the <cite>linenos</cite> option is set to <tt class="docutils literal">"table"</tt>, the <tt class="docutils literal"><pre></tt> is
+additionally wrapped inside a <tt class="docutils literal"><table></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"><div</span> <span class="na">class=</span><span class="s">"highlight"</span> <span class="nt">></span>
<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"><style></span></tt> tag, or in a separate file if
+the style definitions inside a <tt class="docutils literal"><style></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
<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"><pre></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"><pre></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 "full" 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"><span></span></tt> tags will not use CSS classes, but
+<dd>If set to true, token <tt class="docutils literal"><span></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
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"><div></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"><div></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"><div></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"><div></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"><pre></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"><pre></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
<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"><pre></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"><pre></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 ("table") 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"><pre></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"><pre></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 > 1, only every nth line number is printed.</dd>
<dt><cite>linenospecial</cite></dt>
<dd>If set to a number n > 0, every nth line number is given the CSS
-class <tt class="docutils literal"><span class="pre">"special"</span></tt> (default: <tt class="docutils literal"><span class="pre">0</span></tt>).</dd>
+class <tt class="docutils literal">"special"</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">"\n"</span></tt>,
-which is enough to break a line inside <tt class="docutils literal"><span class="pre"><pre></span></tt> tags, but you can
-e.g. set it to <tt class="docutils literal"><span class="pre">"<br>"</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">"\n"</tt>,
+which is enough to break a line inside <tt class="docutils literal"><pre></tt> tags, but you can
+e.g. set it to <tt class="docutils literal">"<br>"</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 <a> tags. Used in
<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"><div></span></tt> and a <tt class="docutils literal"><span class="pre"><pre></span></tt> tag.</p>
+<p>The default <cite>wrap()</cite> implementation adds a <tt class="docutils literal"><div></tt> and a <tt class="docutils literal"><pre></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>
<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">'</code>'</span>
</pre></div>
-<p>This results in wrapping the formatted lines with a <tt class="docutils literal"><span class="pre"><code></span></tt> tag, where the
-source lines are broken using <tt class="docutils literal"><span class="pre"><br></span></tt> tags.</p>
+<p>This results in wrapping the formatted lines with a <tt class="docutils literal"><code></tt> tag, where the
+source lines are broken using <tt class="docutils literal"><br></tt> tags.</p>
<p>After calling <cite>wrap()</cite>, the <cite>format()</cite> method also adds the "line numbers"
and/or "full document" wrappers if the respective options are set. Then, all
HTML yielded by the wrapped generator is output.</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>
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" />
<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">@PY</span></tt>) and all the other macros it needs
+<p>The special command used here (<tt class="docutils literal">@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 "full" 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 > 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" />
<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">
<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">
<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"><text></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"><tspan></span></tt> elements with the individual token styles.</p>
+Each line of code is a <tt class="docutils literal"><text></tt> element with explicit <tt class="docutils literal">x</tt> and <tt class="docutils literal">y</tt>
+coordinates containing <tt class="docutils literal"><tspan></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"><svg></span></tt> root element.</p>
+declaration and the <tt class="docutils literal"><svg></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"><text></span></tt> elements in <tt class="docutils literal"><span class="pre"><svg><g></span></tt> elements and
+<dd>Don't wrap the SVG <tt class="docutils literal"><text></tt> elements in <tt class="docutils literal"><span class="pre"><svg><g></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"><g></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">"monospace"</span></tt>.</dd>
+<dd>The value to give the wrapping <tt class="docutils literal"><g></tt> element's <tt class="docutils literal"><span class="pre">font-family</span></tt>
+attribute, defaults to <tt class="docutils literal">"monospace"</tt>.</dd>
<dt><cite>fontsize</cite></dt>
-<dd>The value to give the wrapping <tt class="docutils literal"><span class="pre"><g></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">"14px"</span></tt>.</dd>
+<dd>The value to give the wrapping <tt class="docutils literal"><g></tt> element's <tt class="docutils literal"><span class="pre">font-size</span></tt>
+attribute, defaults to <tt class="docutils literal">"14px"</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">&#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">&#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" />
<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" />
<p>Options accepted:</p>
<dl class="docutils">
<dt><cite>bg</cite></dt>
-<dd>Set to <tt class="docutils literal"><span class="pre">"light"</span></tt> or <tt class="docutils literal"><span class="pre">"dark"</span></tt> depending on the terminal's background
-(default: <tt class="docutils literal"><span class="pre">"light"</span></tt>).</dd>
+<dd>Set to <tt class="docutils literal">"light"</tt> or <tt class="docutils literal">"dark"</tt> depending on the terminal's background
+(default: <tt class="docutils literal">"light"</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" />
</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
</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
</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>
<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
<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
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
</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
</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
<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>
<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
</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>
<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
<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>
<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">></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">></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>
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 "combine" 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
<p>Some lexers like the <cite>PhpLexer</cite> use this to make the leading <tt class="docutils literal"><span class="pre"><?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>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
-<p>Here the content of a <tt class="docutils literal"><span class="pre"><script></span></tt> tag is passed to a newly created instance of
+<p>Here the content of a <tt class="docutils literal"><script></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"></script></span></tt> end tag is processed by the <cite>JavascriptLexer</cite>, while the
+up to the <tt class="docutils literal"></script></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 "other" 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'<\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'<\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">></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">></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">"root"</span></tt> state,
+follows: if given, the lexer to use initially is not in the <tt class="docutils literal">"root"</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>
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>
</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>
<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>
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>
</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
<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">"utf-8"</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">"latin1"</span></tt>.</p>
-<p class="last">If this option is set to <tt class="docutils literal"><span class="pre">"guess"</span></tt>, a simple UTF-8 vs. Latin-1
-detection is used, if it is set to <tt class="docutils literal"><span class="pre">"chardet"</span></tt>, the
+a Unicode string). The default is <tt class="docutils literal">"latin1"</tt>.</p>
+<p class="last">If this option is set to <tt class="docutils literal">"guess"</tt>, a simple UTF-8 vs. Latin-1
+detection is used, if it is set to <tt class="docutils literal">"chardet"</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>
<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>
<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">
<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" />
<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">
</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>
</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>
<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>
<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">"bird"</span></tt> or <tt class="docutils literal"><span class="pre">"latex"</span></tt>. If not given, the style
+<dd>If given, must be <tt class="docutils literal">"bird"</tt> or <tt class="docutils literal">"latex"</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>
</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>
</tbody>
</table>
</blockquote>
+<p><cite>GherkinLexer</cite></p>
+<blockquote>
+<p>For <cite>Gherkin <http://cukes.info/></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>
<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">
<p>Additional options 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>, decompress the token stream with
-the given compression algorithm before lexing (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>, decompress the token stream with
+the given compression algorithm before lexing (default: <tt class="docutils literal">""</tt>).</dd>
</dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
</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" />
</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"><pkg></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 <pkg></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" />
<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" />
<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"><?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>
<span class="go">('XML+Ruby', ('xml+erb', 'xml+ruby'), (), ())</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
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">
{{{
[...]
}}}
</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
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
<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">'Name Of Your Lexer'</span>
</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
</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"><div></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"><div></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>
<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">>>> </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>
<pre class="literal-block">
$ pygmentize -S default -f html > 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
</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
</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>
<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">"mondrian"</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">"mondrian"</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>
<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>
</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
<span class="gp">>>> </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">>>> </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">>>> </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>
</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>
<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
<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">
<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">&nbsp;</span></tt> in HTML).</dd>
+<dd>Token type for special entities. (e.g. <tt class="docutils literal">&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>
<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>
<dt><cite>String.Heredoc</cite></dt>
<dd>Token type for "heredoc" 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>
<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">
<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">
<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"><?php</span></tt>/<tt class="docutils literal"><span class="pre"><%</span></tt> constructs).</dd>
+<dd>Token type for preprocessor comments (also <tt class="docutils literal"><span class="pre"><?php</span></tt>/<tt class="docutils literal"><%</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>
</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
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">'chardet'</span><span class="p">)</span>
</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
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.
"""
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
$ 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
-------------------
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
-------------------
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.
.. _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.
"""
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.
"""
.. _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.
"""
.. _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.
"""
.. _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']
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
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.
"""
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.
"""
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:
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,
}
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.
"""
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
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.
"""
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.
"""
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
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>'
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
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.
"""
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:
Default: True
+ `line_number_start`
+ The line number of the first line.
+
+ Default: 1
+
`line_number_step`
The step used when printing line numbers.
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
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=''):
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,
"""
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):
"""
)
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())
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.
"""
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'''
%(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
'''
*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']
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()
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:
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)
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.
"""
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.
"""
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.
"""
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.
"""
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.
"""
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
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
--- /dev/null
+# -*- 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'
+])
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.
"""
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.
"""
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.
"""
'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')),
'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',)),
'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')),
'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',)),
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.
"""
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.
"""
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
'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)',
# 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),
]
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.
"""
#: 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': [
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),
],
'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)
]
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]+'
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 = {
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)
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.
"""
__all__ = ['CLexer', 'CppLexer', 'DLexer', 'DelphiLexer', 'JavaLexer',
'ScalaLexer', 'DylanLexer', 'OcamlLexer', 'ObjectiveCLexer',
'FortranLexer', 'GLShaderLexer', 'PrologLexer', 'CythonLexer',
- 'ValaLexer']
+ 'ValaLexer', 'OocLexer', 'GoLexer']
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
(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': [
class DLexer(RegexLexer):
"""
For D source.
+
+ *New in Pygments 1.2.*
"""
name = 'D'
filenames = ['*.d', '*.di']
# -- 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
(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),
+ ]
+ }
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
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.
"""
(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'),
],
}
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.
"""
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.
"""
'MOOCodeLexer', 'SmalltalkLexer', 'TcshLexer', 'LogtalkLexer',
'GnuplotLexer', 'PovrayLexer', 'AppleScriptLexer',
'BashSessionLexer', 'ModelicaLexer', 'RebolLexer', 'ABAPLexer',
- 'NewspeakLexer']
+ 'NewspeakLexer', 'GherkinLexer', 'AsymptoteLexer']
line_re = re.compile('.*?\n')
# 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),
],
'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'),
],
]
}
+ 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('$')
]
}
+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
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.
"""
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.
"""
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.
"""
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.
"""
'GroffLexer', 'ApacheConfLexer', 'BBCodeLexer', 'MoinWikiLexer',
'RstLexer', 'VimLexer', 'GettextLexer', 'SquidConfLexer',
'DebianControlLexer', 'DarcsPatchLexer', 'YamlLexer',
- 'LighttpdConfLexer', 'NginxConfLexer']
+ 'LighttpdConfLexer', 'NginxConfLexer', 'CMakeLexer']
class IniLexer(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),
+ ]
+ }
+
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.
"""
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:
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
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.
"""
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.
"""
'autumn': 'autumn::AutumnStyle',
'murphy': 'murphy::MurphyStyle',
'manni': 'manni::ManniStyle',
+ 'monokai': 'monokai::MonokaiStyle',
'perldoc': 'perldoc::PerldocStyle',
'pastie': 'pastie::PastieStyle',
'borland': 'borland::BorlandStyle',
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.
"""
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.
"""
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.
"""
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.
"""
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.
"""
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.
"""
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.
"""
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.
"""
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.
"""
--- /dev/null
+# -*- 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'
+ }
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.
"""
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.
"""
.. _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.
"""
.. _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.
"""
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.
"""
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'
}
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.
"""
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.
"""
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.
"""
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:
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
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
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.
"""
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)
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.
"""
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.
"""
.. _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.
"""
setup(
name = 'Pygments',
- version = '1.1.1',
+ version = '1.2',
url = 'http://pygments.org/',
license = 'BSD License',
author = 'Georg Brandl',
+++ /dev/null
-# 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
+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)
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
--- /dev/null
+# 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
--- /dev/null
+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 )
--- /dev/null
+// 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); // #
}
</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; }
Pocoo ACL System.
- :copyright: 2006-2007 by Armin Ronacher.
- :license: GNU GPL, see LICENSE for more details.
</span><span class="st st-db">"""</span>
<span class="kw">from </span><span class="cls">pocoo.db</span><span class="kw"> import</span> <span class="name">meta</span>
--- /dev/null
+ 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
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.
"""
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.
"""
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.
"""
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.
"""
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.
"""
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.
"""
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.
"""
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
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.
"""
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
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.
"""
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.
"""
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.
"""
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.
"""