Skip to content
Permalink
Browse files

Upgrade internal pygments to 2.1.3

  • Loading branch information
nyalldawson committed Sep 4, 2016
1 parent 95c4fa1 commit 82da555c79f32ad54c69dd7276e25f2496c55026
Showing with 64,592 additions and 20,991 deletions.
  1. +11 −10 python/ext-libs/pygments/__init__.py
  2. +246 −158 python/ext-libs/pygments/cmdline.py
  3. +1 −1 python/ext-libs/pygments/console.py
  4. +3 −3 python/ext-libs/pygments/filter.py
  5. +35 −41 python/ext-libs/pygments/filters/__init__.py
  6. +7 −4 python/ext-libs/pygments/formatter.py
  7. +92 −42 python/ext-libs/pygments/formatters/__init__.py
  8. +54 −61 python/ext-libs/pygments/formatters/_mapping.py
  9. +1 −1 python/ext-libs/pygments/formatters/bbcode.py
  10. +105 −75 python/ext-libs/pygments/formatters/html.py
  11. +41 −31 python/ext-libs/pygments/formatters/img.py
  12. +182 −0 python/ext-libs/pygments/formatters/irc.py
  13. +124 −20 python/ext-libs/pygments/formatters/latex.py
  14. +54 −9 python/ext-libs/pygments/formatters/other.py
  15. +51 −40 python/ext-libs/pygments/formatters/rtf.py
  16. +2 −3 python/ext-libs/pygments/formatters/svg.py
  17. +41 −17 python/ext-libs/pygments/formatters/terminal.py
  18. +87 −28 python/ext-libs/pygments/formatters/terminal256.py
  19. +175 −69 python/ext-libs/pygments/lexer.py
  20. +95 −51 python/ext-libs/pygments/lexers/__init__.py
  21. +1,645 −0 python/ext-libs/pygments/lexers/_asy_builtins.py
  22. +232 −0 python/ext-libs/pygments/lexers/_cl_builtins.py
  23. +72 −0 python/ext-libs/pygments/lexers/_cocoa_builtins.py
  24. +1,346 −0 python/ext-libs/pygments/lexers/_csound_builtins.py
  25. +5,320 −0 python/ext-libs/pygments/lexers/_lasso_builtins.py
  26. +251 −0 python/ext-libs/pygments/lexers/_lua_builtins.py
  27. +332 −207 python/ext-libs/pygments/lexers/_mapping.py
  28. +1,172 −0 python/ext-libs/pygments/lexers/_mql_builtins.py
  29. +2,547 −0 python/ext-libs/pygments/lexers/_openedge_builtins.py
  30. +4,756 −0 python/ext-libs/pygments/lexers/_php_builtins.py
  31. +600 −212 python/ext-libs/pygments/lexers/_postgres_builtins.py
  32. +3,084 −30 python/ext-libs/pygments/lexers/_scilab_builtins.py
  33. +1,163 −0 python/ext-libs/pygments/lexers/_sourcemod_builtins.py
  34. +377 −19 python/ext-libs/pygments/lexers/_stan_builtins.py
  35. +1,939 −0 python/ext-libs/pygments/lexers/_vim_builtins.py
  36. +240 −0 python/ext-libs/pygments/lexers/actionscript.py
  37. +14 −1,907 python/ext-libs/pygments/lexers/agile.py
  38. +221 −0 python/ext-libs/pygments/lexers/algebra.py
  39. +76 −0 python/ext-libs/pygments/lexers/ambient.py
  40. +101 −0 python/ext-libs/pygments/lexers/apl.py
  41. +318 −0 python/ext-libs/pygments/lexers/archetype.py
  42. +82 −44 python/ext-libs/pygments/lexers/asm.py
  43. +374 −0 python/ext-libs/pygments/lexers/automation.py
  44. +500 −0 python/ext-libs/pygments/lexers/basic.py
  45. +592 −0 python/ext-libs/pygments/lexers/business.py
  46. +248 −0 python/ext-libs/pygments/lexers/c_cpp.py
  47. +541 −0 python/ext-libs/pygments/lexers/c_like.py
  48. +101 −0 python/ext-libs/pygments/lexers/chapel.py
  49. +23 −3,486 python/ext-libs/pygments/lexers/compiled.py
  50. +827 −0 python/ext-libs/pygments/lexers/configs.py
  51. +114 −0 python/ext-libs/pygments/lexers/console.py
  52. +366 −0 python/ext-libs/pygments/lexers/csound.py
  53. +524 −0 python/ext-libs/pygments/lexers/css.py
  54. +251 −0 python/ext-libs/pygments/lexers/d.py
  55. +32 −11 python/ext-libs/pygments/lexers/dalvik.py
  56. +530 −0 python/ext-libs/pygments/lexers/data.py
  57. +106 −0 python/ext-libs/pygments/lexers/diff.py
  58. +174 −114 python/ext-libs/pygments/lexers/dotnet.py
  59. +694 −0 python/ext-libs/pygments/lexers/dsls.py
  60. +289 −0 python/ext-libs/pygments/lexers/dylan.py
  61. +125 −0 python/ext-libs/pygments/lexers/ecl.py
  62. +65 −0 python/ext-libs/pygments/lexers/eiffel.py
  63. +121 −0 python/ext-libs/pygments/lexers/elm.py
  64. +511 −0 python/ext-libs/pygments/lexers/erlang.py
  65. +219 −0 python/ext-libs/pygments/lexers/esoteric.py
  66. +68 −0 python/ext-libs/pygments/lexers/ezhil.py
  67. +344 −0 python/ext-libs/pygments/lexers/factor.py
  68. +250 −0 python/ext-libs/pygments/lexers/fantom.py
  69. +273 −0 python/ext-libs/pygments/lexers/felix.py
  70. +206 −0 python/ext-libs/pygments/lexers/fortran.py
  71. +4 −4 python/ext-libs/pygments/lexers/foxpro.py
  72. +11 −2,588 python/ext-libs/pygments/lexers/functional.py
  73. +101 −0 python/ext-libs/pygments/lexers/go.py
  74. +131 −0 python/ext-libs/pygments/lexers/grammar_notation.py
  75. +80 −0 python/ext-libs/pygments/lexers/graph.py
  76. +553 −0 python/ext-libs/pygments/lexers/graphics.py
  77. +840 −0 python/ext-libs/pygments/lexers/haskell.py
  78. +936 −0 python/ext-libs/pygments/lexers/haxe.py
  79. +190 −164 python/ext-libs/pygments/lexers/hdl.py
  80. +97 −0 python/ext-libs/pygments/lexers/hexdump.py
  81. +601 −0 python/ext-libs/pygments/lexers/html.py
  82. +269 −0 python/ext-libs/pygments/lexers/idl.py
  83. +280 −0 python/ext-libs/pygments/lexers/igor.py
  84. +96 −0 python/ext-libs/pygments/lexers/inferno.py
  85. +322 −0 python/ext-libs/pygments/lexers/installers.py
  86. +1,343 −0 python/ext-libs/pygments/lexers/int_fiction.py
  87. +63 −0 python/ext-libs/pygments/lexers/iolang.py
  88. +146 −0 python/ext-libs/pygments/lexers/j.py
  89. +1,440 −0 python/ext-libs/pygments/lexers/javascript.py
  90. +206 −0 python/ext-libs/pygments/lexers/julia.py
  91. +776 −314 python/ext-libs/pygments/lexers/jvm.py
  92. +2,365 −0 python/ext-libs/pygments/lexers/lisp.py
  93. +202 −0 python/ext-libs/pygments/lexers/make.py
  94. +502 −0 python/ext-libs/pygments/lexers/markup.py
  95. +11 −1,642 python/ext-libs/pygments/lexers/math.py
  96. +663 −0 python/ext-libs/pygments/lexers/matlab.py
  97. +769 −0 python/ext-libs/pygments/lexers/ml.py
  98. +358 −0 python/ext-libs/pygments/lexers/modeling.py
  99. +1,561 −0 python/ext-libs/pygments/lexers/modula2.py
  100. +159 −0 python/ext-libs/pygments/lexers/nimrod.py
  101. +64 −0 python/ext-libs/pygments/lexers/nit.py
  102. +136 −0 python/ext-libs/pygments/lexers/nix.py
  103. +105 −0 python/ext-libs/pygments/lexers/oberon.py
  104. +501 −0 python/ext-libs/pygments/lexers/objective.py
  105. +85 −0 python/ext-libs/pygments/lexers/ooc.py
  106. +29 −3,656 python/ext-libs/pygments/lexers/other.py
  107. +79 −0 python/ext-libs/pygments/lexers/parasail.py
  108. +192 −135 python/ext-libs/pygments/lexers/parsers.py
  109. +644 −0 python/ext-libs/pygments/lexers/pascal.py
  110. +199 −0 python/ext-libs/pygments/lexers/pawn.py
  111. +615 −0 python/ext-libs/pygments/lexers/perl.py
  112. +245 −0 python/ext-libs/pygments/lexers/php.py
  113. +295 −0 python/ext-libs/pygments/lexers/praat.py
  114. +306 −0 python/ext-libs/pygments/lexers/prolog.py
  115. +859 −0 python/ext-libs/pygments/lexers/python.py
  116. +150 −0 python/ext-libs/pygments/lexers/qvt.py
  117. +453 −0 python/ext-libs/pygments/lexers/r.py
  118. +272 −0 python/ext-libs/pygments/lexers/rdf.py
  119. +431 −0 python/ext-libs/pygments/lexers/rebol.py
  120. +84 −0 python/ext-libs/pygments/lexers/resource.py
  121. +82 −0 python/ext-libs/pygments/lexers/roboconf.py
  122. +560 −0 python/ext-libs/pygments/lexers/robotframework.py
  123. +519 −0 python/ext-libs/pygments/lexers/ruby.py
  124. +190 −0 python/ext-libs/pygments/lexers/rust.py
  125. +1,203 −0 python/ext-libs/pygments/lexers/scripting.py
  126. +514 −140 python/ext-libs/pygments/lexers/shell.py
  127. +195 −0 python/ext-libs/pygments/lexers/smalltalk.py
  128. +83 −0 python/ext-libs/pygments/lexers/snobol.py
  129. +9 −9 python/ext-libs/pygments/lexers/special.py
  130. +177 −128 python/ext-libs/pygments/lexers/sql.py
  131. +90 −0 python/ext-libs/pygments/lexers/supercollider.py
  132. +145 −0 python/ext-libs/pygments/lexers/tcl.py
  133. +559 −125 python/ext-libs/pygments/lexers/templates.py
  134. +207 −0 python/ext-libs/pygments/lexers/testing.py
  135. +15 −1,833 python/ext-libs/pygments/lexers/text.py
  136. +169 −0 python/ext-libs/pygments/lexers/textedit.py
  137. +297 −0 python/ext-libs/pygments/lexers/textfmts.py
  138. +454 −0 python/ext-libs/pygments/lexers/theorem.py
  139. +54 −0 python/ext-libs/pygments/lexers/trafficscript.py
  140. +133 −0 python/ext-libs/pygments/lexers/urbi.py
  141. +13 −3,412 python/ext-libs/pygments/lexers/web.py
  142. +979 −0 python/ext-libs/pygments/lexers/webmisc.py
  143. +69 −0 python/ext-libs/pygments/lexers/x10.py
  144. +43 −0 python/ext-libs/pygments/modeline.py
  145. +1 −1 python/ext-libs/pygments/plugin.py
  146. +92 −0 python/ext-libs/pygments/regexopt.py
  147. +1 −1 python/ext-libs/pygments/scanner.py
  148. +157 −0 python/ext-libs/pygments/sphinxext.py
  149. +4 −3 python/ext-libs/pygments/style.py
  150. +8 −1 python/ext-libs/pygments/styles/__init__.py
  151. +63 −0 python/ext-libs/pygments/styles/algol.py
  152. +63 −0 python/ext-libs/pygments/styles/algol_nu.py
  153. +98 −0 python/ext-libs/pygments/styles/arduino.py
  154. +1 −1 python/ext-libs/pygments/styles/autumn.py
  155. +1 −1 python/ext-libs/pygments/styles/borland.py
  156. +1 −1 python/ext-libs/pygments/styles/bw.py
  157. +1 −1 python/ext-libs/pygments/styles/colorful.py
  158. +1 −1 python/ext-libs/pygments/styles/default.py
  159. +1 −1 python/ext-libs/pygments/styles/emacs.py
  160. +1 −1 python/ext-libs/pygments/styles/friendly.py
  161. +1 −1 python/ext-libs/pygments/styles/fruity.py
  162. +29 −0 python/ext-libs/pygments/styles/igor.py
  163. +93 −0 python/ext-libs/pygments/styles/lovelace.py
  164. +1 −1 python/ext-libs/pygments/styles/manni.py
  165. +4 −4 python/ext-libs/pygments/styles/monokai.py
  166. +1 −1 python/ext-libs/pygments/styles/murphy.py
  167. +1 −1 python/ext-libs/pygments/styles/native.py
  168. +125 −0 python/ext-libs/pygments/styles/paraiso_dark.py
  169. +125 −0 python/ext-libs/pygments/styles/paraiso_light.py
  170. +1 −1 python/ext-libs/pygments/styles/pastie.py
  171. +1 −1 python/ext-libs/pygments/styles/perldoc.py
  172. +1 −1 python/ext-libs/pygments/styles/rrt.py
  173. +1 −1 python/ext-libs/pygments/styles/tango.py
  174. +1 −1 python/ext-libs/pygments/styles/trac.py
  175. +1 −1 python/ext-libs/pygments/styles/vim.py
  176. +1 −1 python/ext-libs/pygments/styles/vs.py
  177. +51 −0 python/ext-libs/pygments/styles/xcode.py
  178. +14 −1 python/ext-libs/pygments/token.py
  179. +143 −66 python/ext-libs/pygments/unistring.py
  180. +162 −52 python/ext-libs/pygments/util.py
@@ -22,11 +22,11 @@
.. _Pygments tip:
http://bitbucket.org/birkenfeld/pygments-main/get/tip.zip#egg=Pygments-dev
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

__version__ = '1.6'
__version__ = '2.1.3'
__docformat__ = 'restructuredtext'

__all__ = ['lex', 'format', 'highlight']
@@ -43,15 +43,16 @@ def lex(code, lexer):
"""
try:
return lexer.get_tokens(code)
except TypeError, err:
except TypeError as err:
if isinstance(err.args[0], str) and \
'unbound method get_tokens' in err.args[0]:
('unbound method get_tokens' in err.args[0] or
'missing 1 required positional argument' in err.args[0]):
raise TypeError('lex() argument must be a lexer instance, '
'not a class')
raise


def format(tokens, formatter, outfile=None):
def format(tokens, formatter, outfile=None): # pylint: disable=redefined-builtin
"""
Format a tokenlist ``tokens`` with the formatter ``formatter``.
@@ -61,15 +62,15 @@ def format(tokens, formatter, outfile=None):
"""
try:
if not outfile:
#print formatter, 'using', formatter.encoding
realoutfile = formatter.encoding and BytesIO() or StringIO()
realoutfile = getattr(formatter, 'encoding', None) and BytesIO() or StringIO()
formatter.format(tokens, realoutfile)
return realoutfile.getvalue()
else:
formatter.format(tokens, outfile)
except TypeError, err:
except TypeError as err:
if isinstance(err.args[0], str) and \
'unbound method format' in err.args[0]:
('unbound method format' in err.args[0] or
'missing 1 required positional argument' in err.args[0]):
raise TypeError('format() argument must be a formatter instance, '
'not a class')
raise
@@ -86,6 +87,6 @@ def highlight(code, lexer, formatter, outfile=None):
return format(lex(code, lexer), formatter, outfile)


if __name__ == '__main__':
if __name__ == '__main__': # pragma: no cover
from pygments.cmdline import main
sys.exit(main(sys.argv))

0 comments on commit 82da555

Please sign in to comment.
You can’t perform that action at this time.