Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

Commit

Permalink
Latest pygments
Browse files Browse the repository at this point in the history
  • Loading branch information
tnm committed Sep 17, 2013
1 parent e87424c commit 5eee4fe
Show file tree
Hide file tree
Showing 51 changed files with 9,610 additions and 3,752 deletions.
14 changes: 12 additions & 2 deletions vendor/pygments-main/AUTHORS
Expand Up @@ -6,15 +6,17 @@ Major developers are Tim Hatch <tim@timhatch.com> and Armin Ronacher
Other contributors, listed alphabetically, are:

* Sam Aaron -- Ioke lexer
* Kumar Appaiah -- Debian control lexer
* Ali Afshar -- image formatter
* Thomas Aglassinger -- Rexx lexer
* Kumar Appaiah -- Debian control lexer
* Andreas Amann -- AppleScript lexer
* Timothy Armstrong -- Dart lexer fixes
* Jeffrey Arnold -- R/S, Rd, BUGS, Jags, and Stan lexers
* Jeremy Ashkenas -- CoffeeScript lexer
* Stefan Matthias Aust -- Smalltalk lexer
* Ben Bangert -- Mako lexers
* Max Battcher -- Darcs patch lexer
* Tim Baumann -- (Literate) Agda lexer
* Paul Baumgart, 280 North, Inc. -- Objective-J lexer
* Michael Bayer -- Myghty lexers
* John Benediktsson -- Factor lexer
Expand All @@ -29,20 +31,25 @@ Other contributors, listed alphabetically, are:
* Christian Jann -- ShellSession lexer
* Christopher Creutzig -- MuPAD lexer
* Pete Curry -- bugfixes
* Owen Durni -- haXe lexer
* Bryan Davis -- EBNF lexer
* Owen Durni -- Haxe lexer
* Nick Efford -- Python 3 lexer
* Sven Efftinge -- Xtend lexer
* Artem Egorkine -- terminal256 formatter
* James H. Fisher -- PostScript lexer
* William S. Fulton -- SWIG lexer
* Carlos Galdino -- Elixir and Elixir Console lexers
* Michael Galloy -- IDL lexer
* Naveen Garg -- Autohotkey lexer
* Laurent Gautier -- R/S lexer
* Alex Gaynor -- PyPy log lexer
* Richard Gerkin -- Igor Pro lexer
* Alain Gilbert -- TypeScript lexer
* Alex Gilding -- BlitzBasic lexer
* Bertrand Goetzmann -- Groovy lexer
* Krzysiek Goj -- Scala lexer
* Matt Good -- Genshi, Cheetah lexers
* Michał Górny -- vim modeline support
* Patrick Gotthardt -- PHP namespaces support
* Olivier Guibe -- Asymptote lexer
* Jordi Gutiérrez Hermoso -- Octave lexer
Expand All @@ -53,6 +60,7 @@ Other contributors, listed alphabetically, are:
* Greg Hendershott -- Racket lexer
* David Hess, Fish Software, Inc. -- Objective-J lexer
* Varun Hiremath -- Debian control lexer
* Rob Hoelz -- Perl 6 lexer
* Doug Hogan -- Mscgen lexer
* Ben Hollis -- Mason lexer
* Dustin Howett -- Logos lexer
Expand All @@ -64,6 +72,7 @@ Other contributors, listed alphabetically, are:
* Igor Kalnitsky -- vhdl lexer
* Pekka Klärck -- Robot Framework lexer
* Eric Knibbe -- Lasso lexer
* Stepan Koltsov -- Clay lexer
* Adam Koprowski -- Opa lexer
* Benjamin Kowarsch -- Modula-2 lexer
* Alexander Kriegisch -- Kconfig and AspectJ lexers
Expand Down Expand Up @@ -97,6 +106,7 @@ Other contributors, listed alphabetically, are:
* Mike Nolta -- Julia lexer
* Jonas Obrist -- BBCode lexer
* David Oliva -- Rebol lexer
* Pat Pannuto -- nesC lexer
* Jon Parise -- Protocol buffers lexer
* Ronny Pfannschmidt -- BBCode lexer
* Benjamin Peterson -- Test suite refactoring
Expand Down
54 changes: 52 additions & 2 deletions vendor/pygments-main/CHANGES
Expand Up @@ -6,6 +6,56 @@ Issue numbers refer to the tracker at
pull request numbers to the requests at
<http://bitbucket.org/birkenfeld/pygments-main/pull-requests/merged>.

Version 1.7
-----------
(under development)

- Lexers added:

* Clay (PR#184)
* Perl 6 (PR#181)
* Swig (PR#168)
* nesC (PR#166)
* BlitzBasic (PR#197)
* EBNF (PR#193)
* Igor Pro (PR#172)
* Rexx (PR#199)
* Agda and Literate Agda (PR#203)

- Pygments will now recognize "vim" modelines when guessing the lexer for
a file based on content (PR#118).

- The NameHighlightFilter now works with any Name.* token type (#790).

- Python 3 lexer: add new exceptions from PEP 3151.

- Opa lexer: add new keywords (PR#170).

- Julia lexer: add keywords and underscore-separated number
literals (PR#176).

- Lasso lexer: fix method highlighting, update builtins. Fix
guessing so that plain XML isn't always taken as Lasso (PR#163).

- Objective C/C++ lexers: allow "@" prefixing any expression (#871).

- Ruby lexer: fix lexing of Name::Space tokens (#860).

- Stan lexer: update for version 1.3.0 of the language (PR#162).

- JavaScript lexer: add the "yield" keyword (PR#196).

- HTTP lexer: support for PATCH method (PR#190).

- Koka lexer: update to newest language spec (PR#201).

- Haxe lexer: rewrite and support for Haxe 3 (PR#174).

- Prolog lexer: add different kinds of numeric literals (#864).

- F# lexer: rewrite with newest spec for F# 3.0 (#842).


Version 1.6
-----------
(released Feb 3, 2013)
Expand Down Expand Up @@ -259,7 +309,7 @@ Version 1.3
* Ada
* Coldfusion
* Modula-2
* haXe
* Haxe
* R console
* Objective-J
* Haml and Sass
Expand Down Expand Up @@ -318,7 +368,7 @@ Version 1.2
* CMake
* Ooc
* Coldfusion
* haXe
* Haxe
* R console

- Added options for rendering LaTeX in source code comments in the
Expand Down
2 changes: 1 addition & 1 deletion vendor/pygments-main/REVISION
@@ -1 +1 @@
157c9feaccb8
7304e4759ae6
52 changes: 52 additions & 0 deletions vendor/pygments-main/docs/src/lexerdevelopment.txt
Expand Up @@ -83,6 +83,58 @@ If no rule matches at the current position, the current char is emitted as an
1.


Adding and testing a new lexer
==============================

To make pygments aware of your new lexer, you have to perform the following
steps:

First, change to the current directory containing the pygments source code:

.. sourcecode:: console

$ cd .../pygments-main

Next, make sure the lexer is known from outside of the module. All modules in
the ``pygments.lexers`` specify ``__all__``. For example, ``other.py`` sets:

.. sourcecode:: python

__all__ = ['BrainfuckLexer', 'BefungeLexer', ...]

Simply add the name of your lexer class to this list.

Finally the lexer can be made publically known by rebuilding the lexer
mapping:

.. sourcecode:: console

$ make mapfiles

To test the new lexer, store an example file with the proper extension in
``tests/examplefiles``. For example, to test your ``DiffLexer``, add a
``tests/examplefiles/example.diff`` containing a sample diff output.

Now you can use pygmentize to render your example to HTML:

.. sourcecode:: console

$ ./pygmentize -O full -f html -o /tmp/example.html tests/examplefiles/example.diff

Note that this explicitely calls the ``pygmentize`` in the current directory
by preceding it with ``./``. This ensures your modifications are used.
Otherwise a possibly already installed, unmodified version without your new
lexer would have been called from the system search path (``$PATH``).

To view the result, open ``/tmp/example.html`` in your browser.

Once the example renders as expected, you should run the complete test suite:

.. sourcecode:: console

$ make test


Regex Flags
===========

Expand Down
111 changes: 67 additions & 44 deletions vendor/pygments-main/external/lasso-builtins-generator-9.lasso
Expand Up @@ -5,13 +5,19 @@
This is the shell script that was used to extract Lasso 9's built-in keywords
and generate most of the _lassobuiltins.py file. When run, it creates a file
named "lassobuiltins-9.py" containing the types, traits, and methods of the
currently-installed version of Lasso 9.
named "lassobuiltins-9.py" containing the types, traits, methods, and members
of the currently-installed version of Lasso 9.
A partial list of keywords in Lasso 8 can be generated with this code:
A list of tags in Lasso 8 can be generated with this code:
<?LassoScript
local('l8tags' = list);
local('l8tags' = list,
'l8libs' = array('Cache','ChartFX','Client','Database','File','HTTP',
'iCal','Lasso','Link','List','PDF','Response','Stock','String',
'Thread','Valid','WAP','XML'));
iterate(#l8libs, local('library'));
local('result' = namespace_load(#library));
/iterate;
iterate(tags_list, local('i'));
#l8tags->insert(string_removeleading(#i, -pattern='_global_'));
/iterate;
Expand All @@ -30,9 +36,12 @@ local(f) = file("lassobuiltins-9.py")
#f->writeString('# -*- coding: utf-8 -*-
"""
pygments.lexers._lassobuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Built-in Lasso types, traits, methods, and members.
Built-in Lasso types, traits, and methods.
:copyright: Copyright 2006-'+date->year+' by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
')
Expand All @@ -42,16 +51,16 @@ lcapi_loadModules
// Load all of the libraries from builtins and lassoserver
// This forces all possible available types and methods to be registered
local(srcs =
tie(
dir(sys_masterHomePath + 'LassoLibraries/builtins/')->eachFilePath,
dir(sys_masterHomePath + 'LassoLibraries/lassoserver/')->eachFilePath
)
tie(
dir(sys_masterHomePath + 'LassoLibraries/builtins/')->eachFilePath,
dir(sys_masterHomePath + 'LassoLibraries/lassoserver/')->eachFilePath
)
)
with topLevelDir in #srcs
where !#topLevelDir->lastComponent->beginsWith('.')
where not #topLevelDir->lastComponent->beginsWith('.')
do protect => {
handle_error => {
handle_error => {
stdoutnl('Unable to load: ' + #topLevelDir + ' ' + error_msg)
}
library_thread_loader->loadLibrary(#topLevelDir)
Expand All @@ -61,60 +70,74 @@ do protect => {
local(
typesList = list(),
traitsList = list(),
methodsList = list()
unboundMethodsList = list(),
memberMethodsList = list()
)
// unbound methods
with method in sys_listUnboundMethods
where !#method->methodName->asString->endsWith('=')
where #method->methodName->asString->isalpha(1)
where #methodsList !>> #method->methodName->asString
do #methodsList->insert(#method->methodName->asString)
// types
with type in sys_listTypes
where #typesList !>> #type
do {
#typesList->insert(#type)
with method in #type->getType->listMethods
let name = #method->methodName
where not #name->asString->endsWith('=') // skip setter methods
where #name->asString->isAlpha(1) // skip unpublished methods
where #memberMethodsList !>> #name
do #memberMethodsList->insert(#name)
}
// traits
with trait in sys_listTraits
where !#trait->asString->beginsWith('$')
where #traitsList !>> #trait->asString
where not #trait->asString->beginsWith('$') // skip combined traits
where #traitsList !>> #trait
do {
#traitsList->insert(#trait->asString)
with tmethod in tie(#trait->getType->provides, #trait->getType->requires)
where !#tmethod->methodName->asString->endsWith('=')
where #tmethod->methodName->asString->isalpha(1)
where #methodsList !>> #tmethod->methodName->asString
do #methodsList->insert(#tmethod->methodName->asString)
#traitsList->insert(#trait)
with method in tie(#trait->getType->provides, #trait->getType->requires)
let name = #method->methodName
where not #name->asString->endsWith('=') // skip setter methods
where #name->asString->isAlpha(1) // skip unpublished methods
where #memberMethodsList !>> #name
do #memberMethodsList->insert(#name)
}
// types
with type in sys_listTypes
where #typesList !>> #type->asString
do {
#typesList->insert(#type->asString)
with tmethod in #type->getType->listMethods
where !#tmethod->methodName->asString->endsWith('=')
where #tmethod->methodName->asString->isalpha(1)
where #methodsList !>> #tmethod->methodName->asString
do #methodsList->insert(#tmethod->methodName->asString)
}
// unbound methods
with method in sys_listUnboundMethods
let name = #method->methodName
where not #name->asString->endsWith('=') // skip setter methods
where #name->asString->isAlpha(1) // skip unpublished methods
where #typesList !>> #name
where #traitsList !>> #name
where #unboundMethodsList !>> #name
do #unboundMethodsList->insert(#name)
#f->writeString("BUILTINS = {
'Types': [
")
with t in #typesList
do #f->writeString(" '"+string_lowercase(#t)+"',\n")
do !#t->asString->endsWith('$') ? #f->writeString(" '"+string_lowercase(#t->asString)+"',\n")
#f->writeString(" ],
'Traits': [
")
with t in #traitsList
do #f->writeString(" '"+string_lowercase(#t)+"',\n")
do #f->writeString(" '"+string_lowercase(#t->asString)+"',\n")
#f->writeString(" ],
'Methods': [
'Unbound Methods': [
")
with t in #methodsList
do #f->writeString(" '"+string_lowercase(#t)+"',\n")
with t in #unboundMethodsList
do #f->writeString(" '"+string_lowercase(#t->asString)+"',\n")
#f->writeString(" ],
#f->writeString(" ]
}
MEMBERS = {
'Member Methods': [
")
with t in #memberMethodsList
do #f->writeString(" '"+string_lowercase(#t->asString)+"',\n")
#f->writeString(" ]
}
")
Expand Down
2 changes: 1 addition & 1 deletion vendor/pygments-main/pygmentize
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python2

import sys, pygments.cmdline
try:
Expand Down
4 changes: 2 additions & 2 deletions vendor/pygments-main/pygments/filters/__init__.py
Expand Up @@ -129,7 +129,7 @@ def filter(self, lexer, stream):

class NameHighlightFilter(Filter):
"""
Highlight a normal Name token with a different token type.
Highlight a normal Name (and Name.*) token with a different token type.
Example::
Expand Down Expand Up @@ -163,7 +163,7 @@ def __init__(self, **options):

def filter(self, lexer, stream):
for ttype, value in stream:
if ttype is Name and value in self.names:
if ttype in Name and value in self.names:
yield self.tokentype, value
else:
yield ttype, value
Expand Down

0 comments on commit 5eee4fe

Please sign in to comment.