Permalink
Browse files

Merge pull request #52 from tmm1/pygments-head

Latest pygments-main
  • Loading branch information...
2 parents caf5a56 + 330e820 commit 6de76bc8fd88529f199da73c207011317626413f @tnm tnm committed Dec 7, 2012
Showing with 15,866 additions and 866 deletions.
  1. +15 −0 vendor/pygments-main/AUTHORS
  2. +28 −1 vendor/pygments-main/CHANGES
  3. +1 −1 vendor/pygments-main/LICENSE
  4. +0 −1 vendor/pygments-main/REVISION
  5. +121 −0 vendor/pygments-main/external/lasso-builtins-generator-9.lasso
  6. +1 −1 vendor/pygments-main/pygments/cmdline.py
  7. +0 −1 vendor/pygments-main/pygments/filters/__init__.py
  8. +2 −2 vendor/pygments-main/pygments/formatters/_mapping.py
  9. +1 −1 vendor/pygments-main/pygments/formatters/img.py
  10. +8 −8 vendor/pygments-main/pygments/formatters/latex.py
  11. +0 −2 vendor/pygments-main/pygments/formatters/other.py
  12. +5,413 −0 vendor/pygments-main/pygments/lexers/_lassobuiltins.py
  13. +36 −11 vendor/pygments-main/pygments/lexers/_mapping.py
  14. +551 −0 vendor/pygments-main/pygments/lexers/_openedgebuiltins.py
  15. +0 −1 vendor/pygments-main/pygments/lexers/_postgres_builtins.py
  16. +546 −0 vendor/pygments-main/pygments/lexers/_robotframeworklexer.py
  17. +1,072 −0 vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py
  18. +174 −0 vendor/pygments-main/pygments/lexers/_stan_builtins.py
  19. +13 −3 vendor/pygments-main/pygments/lexers/_vimbuiltins.py
  20. +145 −33 vendor/pygments-main/pygments/lexers/agile.py
  21. +2 −2 vendor/pygments-main/pygments/lexers/asm.py
  22. +328 −36 vendor/pygments-main/pygments/lexers/compiled.py
  23. +104 −0 vendor/pygments-main/pygments/lexers/dalvik.py
  24. +8 −14 vendor/pygments-main/pygments/lexers/dotnet.py
  25. +773 −8 vendor/pygments-main/pygments/lexers/functional.py
  26. +184 −36 vendor/pygments-main/pygments/lexers/jvm.py
  27. +349 −23 vendor/pygments-main/pygments/lexers/math.py
  28. +315 −492 vendor/pygments-main/pygments/lexers/other.py
  29. +83 −1 vendor/pygments-main/pygments/lexers/parsers.py
  30. +4 −1 vendor/pygments-main/pygments/lexers/shell.py
  31. +112 −2 vendor/pygments-main/pygments/lexers/templates.py
  32. +52 −3 vendor/pygments-main/pygments/lexers/text.py
  33. +382 −36 vendor/pygments-main/pygments/lexers/web.py
  34. +35 −25 vendor/pygments-main/pygments/unistring.py
  35. +45 −0 vendor/pygments-main/pygments/util.py
  36. +1,973 −0 vendor/pygments-main/tests/examplefiles/Config.in.cache
  37. +78 −0 vendor/pygments-main/tests/examplefiles/example.Rd
  38. +54 −0 vendor/pygments-main/tests/examplefiles/example.bug
  39. +33 −0 vendor/pygments-main/tests/examplefiles/example.ceylon
  40. +48 −0 vendor/pygments-main/tests/examplefiles/example.jag
  41. +152 −0 vendor/pygments-main/tests/examplefiles/example.monkey
  42. +43 −0 vendor/pygments-main/tests/examplefiles/example.msc
  43. +19 −0 vendor/pygments-main/tests/examplefiles/example.reg
  44. +95 −0 vendor/pygments-main/tests/examplefiles/example.rkt
  45. +4 −0 vendor/pygments-main/tests/examplefiles/example.rpf
  46. +97 −0 vendor/pygments-main/tests/examplefiles/example.stan
  47. +34 −0 vendor/pygments-main/tests/examplefiles/example.xtend
  48. +79 −0 vendor/pygments-main/tests/examplefiles/example2.msc
  49. +123 −0 vendor/pygments-main/tests/examplefiles/garcia-wachs.kk
  50. +40 −0 vendor/pygments-main/tests/examplefiles/hello.smali
  51. +9 −0 vendor/pygments-main/tests/examplefiles/hello.sp
  52. +2 −1 vendor/pygments-main/tests/examplefiles/http_request_example
  53. +4 −2 vendor/pygments-main/tests/examplefiles/http_response_example
  54. +71 −0 vendor/pygments-main/tests/examplefiles/inet_pton6.dg
  55. +301 −0 vendor/pygments-main/tests/examplefiles/json.lasso
  56. +213 −0 vendor/pygments-main/tests/examplefiles/json.lasso9
  57. +41 −0 vendor/pygments-main/tests/examplefiles/livescript-demo.ls
  58. +5 −2 vendor/pygments-main/tests/examplefiles/matlab_sample
  59. +455 −0 vendor/pygments-main/tests/examplefiles/metagrammar.treetop
  60. +4 −0 vendor/pygments-main/tests/examplefiles/pytb_test3.pytb
  61. +39 −0 vendor/pygments-main/tests/examplefiles/robotframework.txt
  62. +743 −0 vendor/pygments-main/tests/examplefiles/rust_example.rs
  63. +149 −115 vendor/pygments-main/tests/examplefiles/test.R
  64. +36 −0 vendor/pygments-main/tests/examplefiles/test.cu
  65. +1 −1 vendor/pygments-main/tests/test_basic_api.py
  66. +18 −0 vendor/pygments-main/tests/test_util.py
@@ -9,6 +9,7 @@ Other contributors, listed alphabetically, are:
* Kumar Appaiah -- Debian control lexer
* Ali Afshar -- image formatter
* Andreas Amann -- AppleScript lexer
+* Jeffrey Arnold -- R/S, Rd, BUGS, Jags, and Stan lexers
* Jeremy Ashkenas -- CoffeeScript lexer
* Stefan Matthias Aust -- Smalltalk lexer
* Ben Bangert -- Mako lexers
@@ -22,11 +23,13 @@ Other contributors, listed alphabetically, are:
* Frits van Bommel -- assembler lexers
* Pierre Bourdon -- bugfixes
* Hiram Chirino -- Scaml and Jade lexers
+* Ian Cooper -- VGL lexer
* Leaf Corcoran -- MoonScript lexer
* Christopher Creutzig -- MuPAD lexer
* Pete Curry -- bugfixes
* Owen Durni -- haXe lexer
* Nick Efford -- Python 3 lexer
+* Sven Efftinge -- Xtend lexer
* Artem Egorkine -- terminal256 formatter
* James H. Fisher -- PostScript lexer
* Carlos Galdino -- Elixir and Elixir Console lexers
@@ -42,20 +45,26 @@ Other contributors, listed alphabetically, are:
* Matthew Harrison -- SVG formatter
* Steven Hazel -- Tcl lexer
* Aslak Hellesøy -- Gherkin lexer
+* Greg Hendershott -- Racket lexer
* Jordi Gutiérrez Hermoso -- Octave lexer
* David Hess, Fish Software, Inc. -- Objective-J lexer
* Varun Hiremath -- Debian control lexer
+* Doug Hogan -- Mscgen lexer
* Ben Hollis -- Mason lexer
* Tim Howard -- BlitzMax lexer
* Ivan Inozemtsev -- Fantom lexer
* Brian R. Jackson -- Tea lexer
* Dennis Kaarsemaker -- sources.list lexer
* Igor Kalnitsky -- vhdl lexer
+* Pekka Klärck -- Robot Framework lexer
+* Eric Knibbe -- Lasso lexer
* Adam Koprowski -- Opa lexer
* Benjamin Kowarsch -- Modula-2 lexer
+* Alexander Kriegisch -- Kconfig and AspectJ lexers
* Marek Kubica -- Scheme lexer
* Jochen Kupperschmidt -- Markdown processor
* Gerd Kurzbach -- Modelica lexer
+* Jon Larimer, Google Inc. -- Smali lexer
* Olov Lassus -- Dart lexer
* Sylvestre Ledru -- Scilab lexer
* Mark Lee -- Vala lexer
@@ -66,8 +75,11 @@ Other contributors, listed alphabetically, are:
* Stephen McKamey -- Duel/JBST lexer
* Brian McKenna -- F# lexer
* Lukas Meuser -- BBCode formatter, Lua lexer
+* Paul Miller -- LiveScript lexer
* Hong Minhee -- HTTP lexer
* Michael Mior -- Awk lexer
+* Reuben Morais -- SourcePawn lexer
+* Jon Morton -- Rust lexer
* Paulo Moura -- Logtalk lexer
* Mher Movsisyan -- DTD lexer
* Ana Nelson -- Ragel, ANTLR, R console lexers
@@ -81,6 +93,7 @@ Other contributors, listed alphabetically, are:
* Benjamin Peterson -- Test suite refactoring
* Dominik Picheta -- Nimrod lexer
* Clément Prévost -- UrbiScript lexer
+* Kashif Rasul -- CUDA lexer
* Justin Reidy -- MXML lexer
* Norman Richards -- JSON lexer
* Lubomir Rintel -- GoodData MAQL and CL lexers
@@ -98,6 +111,7 @@ Other contributors, listed alphabetically, are:
* Steve Spigarelli -- XQuery lexer
* Jerome St-Louis -- eC lexer
* James Strachan -- Kotlin lexer
+* Tom Stuart -- Treetop lexer
* Tiberius Teng -- default style overhaul
* Jeremy Thurgood -- Erlang, Squid config lexers
* Erick Tryzelaar -- Felix lexer
@@ -110,6 +124,7 @@ Other contributors, listed alphabetically, are:
* Nils Winter -- Smalltalk lexer
* Davy Wybiral -- Clojure lexer
* Diego Zamboni -- CFengine3 lexer
+* Enrique Zamudio -- Ceylon lexer
* Alex Zimin -- Nemerle lexer
Many thanks for all contributions!
@@ -6,14 +6,41 @@ http://bitbucket.org/birkenfeld/pygments-main/issues.
Version 1.6
-----------
-(in development)
+(in development, to be released xx November 2012)
- Lexers added:
+ * AspectJ (PR#90)
+ * BUGS-like languages (PR#89)
+ * Ceylon (PR#86)
+ * Croc (new name for MiniD)
+ * CUDA (PR#75)
+ * Dg (PR#116)
+ * Jags (PR#89)
* Julia (PR#61)
+ * Kconfig (#711)
+ * Lasso (PR#95)
+ * LiveScript (PR#84)
+ * Monkey (PR#117)
+ * Mscgen (PR#80)
+ * Racket (PR#94)
+ * Rdoc (PR#99)
+ * Robot Framework (PR#137)
+ * Rust (PR#67)
+ * Smali (Dalvik assembly)
+ * SourcePawn (PR#39)
+ * Stan (PR#89)
+ * Treetop (PR#125)
+ * VGL (PR#12)
+ * Windows Registry (#819)
+ * Xtend (PR#68)
- Fix Template Haskell highlighting (PR#63)
+- Fix some S/R lexer errors (PR#91)
+
+- Fix a bug in the Prolog lexer with names that start with 'is' (#810)
+
Version 1.5
-----------
@@ -1,4 +1,4 @@
-Copyright (c) 2006-2011 by the respective authors (see AUTHORS file).
+Copyright (c) 2006-2012 by the respective authors (see AUTHORS file).
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -1 +0,0 @@
-5cc94956e233
@@ -0,0 +1,121 @@
+#!/usr/bin/lasso9
+
+/*
+ Builtins Generator for Lasso 9
+
+ 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.
+
+ A partial list of keywords in Lasso 8 can be generated with this code:
+
+ <?LassoScript
+ local('l8tags' = list);
+ iterate(tags_list, local('i'));
+ #l8tags->insert(string_removeleading(#i, -pattern='_global_'));
+ /iterate;
+ #l8tags->sort;
+ iterate(#l8tags, local('i'));
+ string_lowercase(#i)+"<br>";
+ /iterate;
+
+*/
+
+output("This output statement is required for a complete list of methods.")
+local(f) = file("lassobuiltins-9.py")
+#f->doWithClose => {
+
+#f->openWrite
+#f->writeString('# -*- coding: utf-8 -*-
+"""
+ pygments.lexers._lassobuiltins
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Built-in Lasso types, traits, and methods.
+"""
+
+')
+
+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
+ )
+)
+
+with topLevelDir in #srcs
+where !#topLevelDir->lastComponent->beginsWith('.')
+do protect => {
+ handle_error => {
+ stdoutnl('Unable to load: ' + #topLevelDir + ' ' + error_msg)
+ }
+ library_thread_loader->loadLibrary(#topLevelDir)
+ stdoutnl('Loaded: ' + #topLevelDir)
+}
+
+local(
+ typesList = list(),
+ traitsList = list(),
+ methodsList = 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)
+
+// traits
+with trait in sys_listTraits
+where !#trait->asString->beginsWith('$')
+where #traitsList !>> #trait->asString
+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)
+}
+
+// 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)
+}
+
+#f->writeString("BUILTINS = {
+ 'Types': [
+")
+with t in #typesList
+do #f->writeString(" '"+string_lowercase(#t)+"',\n")
+
+#f->writeString(" ],
+ 'Traits': [
+")
+with t in #traitsList
+do #f->writeString(" '"+string_lowercase(#t)+"',\n")
+
+#f->writeString(" ],
+ 'Methods': [
+")
+with t in #methodsList
+do #f->writeString(" '"+string_lowercase(#t)+"',\n")
+
+#f->writeString(" ],
+}
+")
+
+}
@@ -219,7 +219,7 @@ def main(args=sys.argv):
return 0
if opts.pop('-V', None) is not None:
- print 'Pygments version %s, (c) 2006-2011 by Georg Brandl.' % __version__
+ print 'Pygments version %s, (c) 2006-2012 by Georg Brandl.' % __version__
return 0
# handle ``pygmentize -L``
@@ -331,7 +331,6 @@ 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:
@@ -13,8 +13,6 @@
:license: BSD, see LICENSE for details.
"""
-from pygments.util import docstring_headline
-
# start
from pygments.formatters.bbcode import BBCodeFormatter
from pygments.formatters.html import HtmlFormatter
@@ -54,6 +52,8 @@
found_formatters = []
imports = []
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
+ from pygments.util import docstring_headline
+
for filename in os.listdir('.'):
if filename.endswith('.py') and not filename.startswith('_'):
module_name = 'pygments.formatters.%s' % filename[:-3]
@@ -10,7 +10,6 @@
"""
import sys
-from commands import getstatusoutput
from pygments.formatter import Formatter
from pygments.util import get_bool_opt, get_int_opt, \
@@ -73,6 +72,7 @@ def __init__(self, font_name, font_size=14):
self._create_nix()
def _get_nix_font_path(self, name, style):
+ from commands import getstatusoutput
exit, out = getstatusoutput('fc-list "%s:style=%s" file' %
(name, style))
if not exit:
@@ -306,17 +306,17 @@ def format_unencoded(self, tokensource, outfile):
realoutfile = outfile
outfile = StringIO()
- outfile.write(r'\begin{Verbatim}[commandchars=\\\{\}')
+ outfile.write(ur'\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 ''))
+ outfile.write(u',numbers=left' +
+ (start and u',firstnumber=%d' % start or u'') +
+ (step and u',stepnumber=%d' % step or u''))
if self.mathescape or self.texcomments:
- outfile.write(r',codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8}')
+ outfile.write(ur',codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8}')
if self.verboptions:
- outfile.write(',' + self.verboptions)
- outfile.write(']\n')
+ outfile.write(u',' + self.verboptions)
+ outfile.write(u']\n')
for ttype, value in tokensource:
if ttype in Token.Comment:
@@ -366,7 +366,7 @@ def format_unencoded(self, tokensource, outfile):
else:
outfile.write(value)
- outfile.write('\\end{Verbatim}\n')
+ outfile.write(u'\\end{Verbatim}\n')
if self.full:
realoutfile.write(DOC_TEMPLATE %
@@ -102,8 +102,6 @@ def write(text):
outfile.write(text.encode())
flush = outfile.flush
- lasttype = None
- lastval = u''
if self.error_color:
for ttype, value in tokensource:
line = "%s\t%r\n" % (ttype, value)
Oops, something went wrong.

0 comments on commit 6de76bc

Please sign in to comment.