From facc16addb9d15926342113a9cf23c27a114e3c3 Mon Sep 17 00:00:00 2001
From: JinWang An
Date: Tue, 5 Jan 2021 12:13:32 +0900
Subject: [PATCH] Imported Upstream version 1.2
---
AUTHORS | 5 +
CHANGES | 40 +
LICENSE | 2 +-
Makefile | 8 +-
PKG-INFO | 4 +-
Pygments.egg-info/PKG-INFO | 4 +-
Pygments.egg-info/SOURCES.txt | 9 +-
TODO | 13 +-
docs/build/api.html | 22 +-
docs/build/authors.html | 7 +-
docs/build/changelog.html | 63 +-
docs/build/cmdline.html | 33 +-
docs/build/filterdevelopment.html | 2 +-
docs/build/filters.html | 155 +-
docs/build/formatterdevelopment.html | 28 +-
docs/build/formatters.html | 208 ++-
docs/build/index.html | 2 +-
docs/build/installation.html | 18 +-
docs/build/integrate.html | 2 +-
docs/build/lexerdevelopment.html | 80 +-
docs/build/lexers.html | 155 +-
docs/build/moinmoin.html | 14 +-
docs/build/plugins.html | 4 +-
docs/build/quickstart.html | 10 +-
docs/build/rstdirective.html | 2 +-
docs/build/styles.html | 30 +-
docs/build/tokens.html | 66 +-
docs/build/unicode.html | 4 +-
docs/generate.py | 4 +-
docs/src/cmdline.txt | 14 +-
docs/src/installation.txt | 4 +-
external/markdown-processor.py | 2 +-
external/moin-parser.py | 2 +-
external/rst-directive-old.py | 2 +-
external/rst-directive.py | 2 +-
pygments/__init__.py | 4 +-
pygments/cmdline.py | 2 +-
pygments/console.py | 2 +-
pygments/filter.py | 2 +-
pygments/filters/__init__.py | 70 +-
pygments/formatter.py | 2 +-
pygments/formatters/__init__.py | 2 +-
pygments/formatters/_mapping.py | 2 +-
pygments/formatters/bbcode.py | 2 +-
pygments/formatters/html.py | 31 +-
pygments/formatters/img.py | 52 +-
pygments/formatters/latex.py | 74 +-
pygments/formatters/other.py | 2 +-
pygments/formatters/rtf.py | 2 +-
pygments/formatters/svg.py | 2 +-
pygments/formatters/terminal.py | 2 +-
pygments/formatters/terminal256.py | 2 +-
pygments/lexer.py | 2 +-
pygments/lexers/__init__.py | 2 +-
pygments/lexers/_asybuiltins.py | 1645 ++++++++++++++++++
pygments/lexers/_clbuiltins.py | 2 +-
pygments/lexers/_luabuiltins.py | 2 +-
pygments/lexers/_mapping.py | 7 +-
pygments/lexers/_phpbuiltins.py | 2 +-
pygments/lexers/agile.py | 19 +-
pygments/lexers/asm.py | 98 +-
pygments/lexers/compiled.py | 139 +-
pygments/lexers/dotnet.py | 2 +-
pygments/lexers/functional.py | 4 +-
pygments/lexers/math.py | 2 +-
pygments/lexers/other.py | 234 ++-
pygments/lexers/parsers.py | 2 +-
pygments/lexers/special.py | 2 +-
pygments/lexers/templates.py | 2 +-
pygments/lexers/text.py | 74 +-
pygments/lexers/web.py | 2 +-
pygments/plugin.py | 2 +-
pygments/scanner.py | 2 +-
pygments/style.py | 2 +-
pygments/styles/__init__.py | 3 +-
pygments/styles/autumn.py | 2 +-
pygments/styles/borland.py | 2 +-
pygments/styles/bw.py | 2 +-
pygments/styles/colorful.py | 2 +-
pygments/styles/default.py | 2 +-
pygments/styles/emacs.py | 2 +-
pygments/styles/friendly.py | 2 +-
pygments/styles/fruity.py | 2 +-
pygments/styles/manni.py | 2 +-
pygments/styles/monokai.py | 106 ++
pygments/styles/murphy.py | 2 +-
pygments/styles/native.py | 2 +-
pygments/styles/pastie.py | 2 +-
pygments/styles/perldoc.py | 2 +-
pygments/styles/tango.py | 154 +-
pygments/styles/trac.py | 2 +-
pygments/styles/vim.py | 2 +-
pygments/styles/vs.py | 2 +-
pygments/token.py | 2 +-
pygments/unistring.py | 2 +-
pygments/util.py | 2 +-
scripts/check_sources.py | 4 +-
scripts/find_codetags.py | 2 +-
scripts/find_error.py | 2 +-
setup.py | 4 +-
tests/examplefiles/database.pytb | 4 +
tests/examplefiles/{broken => }/fucked_up.rb | 0
tests/examplefiles/main.cmake | 42 +
tests/examplefiles/test.asy | 131 ++
tests/examplefiles/test.html | 12 -
tests/examplefiles/truncated.pytb | 15 +
tests/old_run.py | 2 +-
tests/run.py | 2 +-
tests/test_basic_api.py | 2 +-
tests/test_clexer.py | 2 +-
tests/test_cmdline.py | 2 +-
tests/test_examplefiles.py | 2 +-
tests/test_html_formatter.py | 13 +-
tests/test_latex_formatter.py | 16 +-
tests/test_regexlexer.py | 2 +-
tests/test_token.py | 2 +-
tests/test_using_api.py | 2 +-
tests/test_util.py | 2 +-
118 files changed, 3421 insertions(+), 668 deletions(-)
create mode 100644 pygments/lexers/_asybuiltins.py
create mode 100644 pygments/styles/monokai.py
rename tests/examplefiles/{broken => }/fucked_up.rb (100%)
create mode 100644 tests/examplefiles/main.cmake
create mode 100644 tests/examplefiles/test.asy
create mode 100644 tests/examplefiles/truncated.pytb
diff --git a/AUTHORS b/AUTHORS
index fd4983b..34cc6be 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -23,18 +23,22 @@ Other contributors, listed alphabetically, are:
* Laurent Gautier -- R/S lexer
* Krzysiek Goj -- Scala lexer
* Matt Good -- Genshi, Cheetah lexers
+* Olivier Guibe -- Asymptote lexer
* Matthew Harrison -- SVG formatter
* Steven Hazel -- Tcl lexer
+* Aslak Hellesøy -- Gherkin lexer
* Varun Hiremath -- Debian control lexer
* Dennis Kaarsemaker -- sources.list lexer
* Marek Kubica -- Scheme lexer
* Jochen Kupperschmidt -- Markdown processor
* Gerd Kurzbach -- Modelica lexer
* Mark Lee -- Vala lexer
+* Ben Mabey -- Gherkin lexer
* Kirk McDonald -- D lexer
* Lukas Meuser -- BBCode formatter, Lua lexer
* Paulo Moura -- Logtalk lexer
* Ana Nelson -- Ragel, ANTLR lexers
+* Nam T. Nguyen -- Monokai style
* Jesper Noehr -- HTML formatter "anchorlinenos"
* Jonas Obrist -- BBCode lexer
* David Oliva -- Rebol lexer
@@ -42,6 +46,7 @@ Other contributors, listed alphabetically, are:
* Benjamin Peterson -- Test suite refactoring
* Justin Reidy -- MXML lexer
* Andre Roberge -- Tango style
+* Konrad Rudolph -- LaTeX formatter enhancements
* Mario Ruggier -- Evoque lexers
* Stou Sandalski -- NumPy, FORTRAN, tcsh and XSLT lexers
* Matteo Sasso -- Common Lisp lexer
diff --git a/CHANGES b/CHANGES
index 9985ab3..9daf05a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,46 @@ Pygments changelog
Issue numbers refer to the tracker at http://dev.pocoo.org/projects/pygments/.
+Version 1.2
+-----------
+(codename Neujahr, released Jan 01, 2010)
+
+- Dropped Python 2.3 compatibility.
+
+- Lexers added:
+
+ * Asymptote
+ * Go
+ * Gherkin (Cucumber)
+ * CMake
+ * OOC
+
+- Added options for rendering LaTeX in source code comments in the
+ LaTeX formatter (#461).
+
+- Updated the Logtalk lexer.
+
+- Added `line_number_start` option to image formatter (#456).
+
+- Added `hl_lines` and `hl_color` options to image formatter (#457).
+
+- Fixed the HtmlFormatter's handling of noclasses=True to not output any
+ classes (#427).
+
+- Added the Monokai style (#453).
+
+- Fixed LLVM lexer identifier syntax and added new keywords (#442).
+
+- Fixed the PythonTracebackLexer to handle non-traceback data in header or
+ trailer, and support more partial tracebacks that start on line 2 (#437).
+
+- Fixed the CLexer to not highlight ternary statements as labels.
+
+- Fixed lexing of some Ruby quoting peculiarities (#460).
+
+- A few ASM lexer fixes (#450).
+
+
Version 1.1.1
-------------
(bugfix release, released Sep 15, 2009)
diff --git a/LICENSE b/LICENSE
index 05652fc..0ad59ec 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2006-2009 by the respective authors (see AUTHORS file).
+Copyright (c) 2006-2010 by the respective authors (see AUTHORS file).
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/Makefile b/Makefile
index 3d27e39..6e81f2e 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
#
# Combines scripts for common tasks.
#
-# :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+# :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
# :license: BSD, see LICENSE for details.
#
@@ -19,13 +19,13 @@ all: clean-pyc check test
check:
@$(PYTHON) scripts/detect_missing_analyse_text.py || true
- @$(PYTHON) scripts/check_sources.py -i pygments/lexers/_mapping.py \
+ @$(PYTHON) scripts/check_sources.py -i build -i dist -i pygments/lexers/_mapping.py \
-i docs/build -i pygments/formatters/_mapping.py -i pygments/unistring.py \
-i pygments/lexers/_vimbuiltins.py
clean: clean-pyc
- rm -r build
- rm -f codetags.html
+ -rm -rf build
+ -rm -f codetags.html
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
diff --git a/PKG-INFO b/PKG-INFO
index d786c48..fb8dabf 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: Pygments
-Version: 1.1.1
+Version: 1.2
Summary: Pygments is a syntax highlighting package written in Python.
Home-page: http://pygments.org/
Author: Georg Brandl
@@ -28,7 +28,7 @@ Description:
.. _Pygments tip:
http://dev.pocoo.org/hg/pygments-main/archive/tip.tar.gz#egg=Pygments-dev
- :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
Keywords: syntax highlighting
diff --git a/Pygments.egg-info/PKG-INFO b/Pygments.egg-info/PKG-INFO
index d786c48..fb8dabf 100644
--- a/Pygments.egg-info/PKG-INFO
+++ b/Pygments.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: Pygments
-Version: 1.1.1
+Version: 1.2
Summary: Pygments is a syntax highlighting package written in Python.
Home-page: http://pygments.org/
Author: Georg Brandl
@@ -28,7 +28,7 @@ Description:
.. _Pygments tip:
http://dev.pocoo.org/hg/pygments-main/archive/tip.tar.gz#egg=Pygments-dev
- :copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
Keywords: syntax highlighting
diff --git a/Pygments.egg-info/SOURCES.txt b/Pygments.egg-info/SOURCES.txt
index d14d7b5..c6669e5 100644
--- a/Pygments.egg-info/SOURCES.txt
+++ b/Pygments.egg-info/SOURCES.txt
@@ -84,6 +84,7 @@ pygments/formatters/svg.py
pygments/formatters/terminal.py
pygments/formatters/terminal256.py
pygments/lexers/__init__.py
+pygments/lexers/_asybuiltins.py
pygments/lexers/_clbuiltins.py
pygments/lexers/_luabuiltins.py
pygments/lexers/_mapping.py
@@ -111,6 +112,7 @@ pygments/styles/emacs.py
pygments/styles/friendly.py
pygments/styles/fruity.py
pygments/styles/manni.py
+pygments/styles/monokai.py
pygments/styles/murphy.py
pygments/styles/native.py
pygments/styles/pastie.py
@@ -194,6 +196,7 @@ tests/examplefiles/example.yaml
tests/examplefiles/example2.aspx
tests/examplefiles/firefox.mak
tests/examplefiles/format.ml
+tests/examplefiles/fucked_up.rb
tests/examplefiles/functional.rst
tests/examplefiles/genclass.clj
tests/examplefiles/genshi_example.xml+genshi
@@ -206,6 +209,7 @@ tests/examplefiles/jinjadesignerdoc.rst
tests/examplefiles/lighttpd_config.conf
tests/examplefiles/linecontinuation.py
tests/examplefiles/ltmain.sh
+tests/examplefiles/main.cmake
tests/examplefiles/matlab_noreturn
tests/examplefiles/matlab_sample
tests/examplefiles/matlabsession_sample.txt
@@ -243,6 +247,7 @@ tests/examplefiles/sqlite3.sqlite3-console
tests/examplefiles/squid.conf
tests/examplefiles/string_delimiters.d
tests/examplefiles/test.R
+tests/examplefiles/test.asy
tests/examplefiles/test.bas
tests/examplefiles/test.boo
tests/examplefiles/test.cs
@@ -263,8 +268,8 @@ tests/examplefiles/test.rb
tests/examplefiles/test.rhtml
tests/examplefiles/test.tcsh
tests/examplefiles/test.xsl
+tests/examplefiles/truncated.pytb
tests/examplefiles/type.lisp
tests/examplefiles/unicode.applescript
tests/examplefiles/while.pov
-tests/examplefiles/zmlrpc.f90
-tests/examplefiles/broken/fucked_up.rb
\ No newline at end of file
+tests/examplefiles/zmlrpc.f90
\ No newline at end of file
diff --git a/TODO b/TODO
index 5873d87..6482700 100644
--- a/TODO
+++ b/TODO
@@ -1,15 +1,10 @@
Todo
====
-suggested new lexers
---------------------
-
-* IPython sessions
-* Nemerle
-* PostgreSQL/SQLite
-
-for 1.0
--------
+- suggested new lexers
+ * IPython sessions
+ * PostgreSQL/SQLite
+ * Nemerle
- lexers that need work:
* review perl lexer (numerous bugs, but so far no one had complaints ;)
diff --git a/docs/build/api.html b/docs/build/api.html
index ec31e52..39152b5 100644
--- a/docs/build/api.html
+++ b/docs/build/api.html
@@ -237,7 +237,7 @@ and return an iterable of tokens. Currently, this only calls
def format(tokens, formatter, outfile=None):
Format a token stream (iterable of tokens) tokens with the
formatter (must be a Formatter instance). The result is
-written to outfile, or if that is None, returned as a
+written to outfile, or if that is None, returned as a
string.
def highlight(code, lexer, formatter, outfile=None):
This is the most high-level highlighting function.
@@ -339,23 +339,23 @@ available to help with that, see This method is the basic interface of a lexer. It is called by
the highlight() function. It must process the text and return an
-iterable of (tokentype, value) pairs from text.
+iterable of (tokentype, value) pairs from text.
Normally, you don't need to override this method. The default
implementation processes the stripnl, stripall and tabsize
options and then yields all tokens from get_tokens_unprocessed(),
-with the index dropped.
+with the index dropped.
def get_tokens_unprocessed(self, text):
This method should process the text and return an iterable of
-(index, tokentype, value) tuples where index is the starting
+(index, tokentype, value) tuples where index is the starting
position of the token within the input text.
This method must be overridden by subclasses.
def analyse_text(text):
A static method which is called for lexer guessing. It should analyse
-the text and return a float in the range from 0.0 to 1.0.
-If it returns 0.0, the lexer will not be selected as the most
-probable one, if it returns 1.0, it will be selected immediately.
+the text and return a float in the range from 0.0 to 1.0.
+If it returns 0.0, the lexer will not be selected as the most
+probable one, if it returns 1.0, it will be selected immediately.
For a list of known tokens have a look at the Tokens page.
A lexer also can have the following attributes (in fact, they are mandatory
@@ -435,9 +435,9 @@ the type or value of the argument is not correct.
Interpret the key optname from the dictionary options
as a boolean and return it. Return default if optname
is not in options.
-The valid string values for True are 1, yes,
-true and on, the ones for False are 0,
-no, false and off (matched case-insensitively).
+The valid string values for True are 1, yes,
+true and on, the ones for False are 0,
+no, false and off (matched case-insensitively).
def get_int_opt(options, optname, default=None):
As get_bool_opt, but interpret the value as an integer.
@@ -453,6 +453,6 @@ or a tuple, it is returned as a list.