From bcd5bcc390793791d293d386b2ebefbe683fb4e1 Mon Sep 17 00:00:00 2001 From: robot-piglet Date: Mon, 20 May 2024 07:58:40 +0300 Subject: Intermediate changes --- contrib/python/Pygments/py3/.dist-info/METADATA | 10 +- contrib/python/Pygments/py3/AUTHORS | 6 +- contrib/python/Pygments/py3/pygments/__init__.py | 4 +- contrib/python/Pygments/py3/pygments/__main__.py | 2 +- contrib/python/Pygments/py3/pygments/cmdline.py | 24 +- contrib/python/Pygments/py3/pygments/console.py | 10 +- contrib/python/Pygments/py3/pygments/filter.py | 5 +- .../Pygments/py3/pygments/filters/__init__.py | 8 +- contrib/python/Pygments/py3/pygments/formatter.py | 7 +- .../Pygments/py3/pygments/formatters/__init__.py | 13 +- .../Pygments/py3/pygments/formatters/bbcode.py | 4 +- .../Pygments/py3/pygments/formatters/groff.py | 6 +- .../Pygments/py3/pygments/formatters/html.py | 75 ++- .../python/Pygments/py3/pygments/formatters/img.py | 21 +- .../python/Pygments/py3/pygments/formatters/irc.py | 2 +- .../Pygments/py3/pygments/formatters/latex.py | 51 +- .../Pygments/py3/pygments/formatters/other.py | 7 +- .../py3/pygments/formatters/pangomarkup.py | 4 +- .../python/Pygments/py3/pygments/formatters/rtf.py | 253 +++++++- .../python/Pygments/py3/pygments/formatters/svg.py | 37 +- .../Pygments/py3/pygments/formatters/terminal.py | 2 +- .../py3/pygments/formatters/terminal256.py | 2 +- contrib/python/Pygments/py3/pygments/lexer.py | 42 +- .../Pygments/py3/pygments/lexers/__init__.py | 23 +- .../Pygments/py3/pygments/lexers/_ada_builtins.py | 2 +- .../Pygments/py3/pygments/lexers/_asy_builtins.py | 2 +- .../Pygments/py3/pygments/lexers/_cl_builtins.py | 2 +- .../py3/pygments/lexers/_cocoa_builtins.py | 4 +- .../py3/pygments/lexers/_csound_builtins.py | 2 +- .../Pygments/py3/pygments/lexers/_css_builtins.py | 2 +- .../py3/pygments/lexers/_julia_builtins.py | 2 +- .../py3/pygments/lexers/_lasso_builtins.py | 2 +- .../py3/pygments/lexers/_lilypond_builtins.py | 2 +- .../Pygments/py3/pygments/lexers/_lua_builtins.py | 10 +- .../Pygments/py3/pygments/lexers/_luau_builtins.py | 62 ++ .../Pygments/py3/pygments/lexers/_mapping.py | 21 +- .../Pygments/py3/pygments/lexers/_mql_builtins.py | 2 +- .../py3/pygments/lexers/_mysql_builtins.py | 6 +- .../py3/pygments/lexers/_openedge_builtins.py | 2 +- .../Pygments/py3/pygments/lexers/_php_builtins.py | 6 +- .../py3/pygments/lexers/_postgres_builtins.py | 10 +- .../Pygments/py3/pygments/lexers/_qlik_builtins.py | 2 +- .../py3/pygments/lexers/_scheme_builtins.py | 2 +- .../py3/pygments/lexers/_scilab_builtins.py | 8 +- .../py3/pygments/lexers/_sourcemod_builtins.py | 6 +- .../Pygments/py3/pygments/lexers/_stan_builtins.py | 2 +- .../py3/pygments/lexers/_stata_builtins.py | 2 +- .../Pygments/py3/pygments/lexers/_tsql_builtins.py | 2 +- .../Pygments/py3/pygments/lexers/_usd_builtins.py | 2 +- .../py3/pygments/lexers/_vbscript_builtins.py | 2 +- .../Pygments/py3/pygments/lexers/_vim_builtins.py | 2 +- .../Pygments/py3/pygments/lexers/actionscript.py | 14 +- contrib/python/Pygments/py3/pygments/lexers/ada.py | 6 +- .../python/Pygments/py3/pygments/lexers/agile.py | 4 +- .../python/Pygments/py3/pygments/lexers/algebra.py | 20 +- .../python/Pygments/py3/pygments/lexers/ambient.py | 5 +- .../python/Pygments/py3/pygments/lexers/amdgpu.py | 6 +- .../python/Pygments/py3/pygments/lexers/ampl.py | 5 +- .../Pygments/py3/pygments/lexers/apdlexer.py | 7 +- contrib/python/Pygments/py3/pygments/lexers/apl.py | 5 +- .../Pygments/py3/pygments/lexers/archetype.py | 20 +- .../python/Pygments/py3/pygments/lexers/arrow.py | 5 +- .../python/Pygments/py3/pygments/lexers/arturo.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/asc.py | 6 +- contrib/python/Pygments/py3/pygments/lexers/asm.py | 43 +- .../python/Pygments/py3/pygments/lexers/asn1.py | 5 +- .../Pygments/py3/pygments/lexers/automation.py | 14 +- .../python/Pygments/py3/pygments/lexers/bare.py | 5 +- .../python/Pygments/py3/pygments/lexers/basic.py | 105 ++- contrib/python/Pygments/py3/pygments/lexers/bdd.py | 7 +- .../python/Pygments/py3/pygments/lexers/berry.py | 8 +- .../python/Pygments/py3/pygments/lexers/bibtex.py | 10 +- .../Pygments/py3/pygments/lexers/blueprint.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/boa.py | 8 +- contrib/python/Pygments/py3/pygments/lexers/bqn.py | 5 +- .../Pygments/py3/pygments/lexers/business.py | 43 +- .../python/Pygments/py3/pygments/lexers/c_cpp.py | 5 +- .../python/Pygments/py3/pygments/lexers/c_like.py | 126 +++- .../Pygments/py3/pygments/lexers/capnproto.py | 5 +- .../python/Pygments/py3/pygments/lexers/carbon.py | 7 +- .../python/Pygments/py3/pygments/lexers/cddl.py | 17 +- .../python/Pygments/py3/pygments/lexers/chapel.py | 5 +- .../python/Pygments/py3/pygments/lexers/clean.py | 3 +- .../python/Pygments/py3/pygments/lexers/comal.py | 3 +- .../Pygments/py3/pygments/lexers/compiled.py | 3 +- .../python/Pygments/py3/pygments/lexers/configs.py | 93 ++- .../python/Pygments/py3/pygments/lexers/console.py | 10 +- .../python/Pygments/py3/pygments/lexers/cplint.py | 5 +- .../python/Pygments/py3/pygments/lexers/crystal.py | 7 +- .../python/Pygments/py3/pygments/lexers/csound.py | 14 +- contrib/python/Pygments/py3/pygments/lexers/css.py | 10 +- contrib/python/Pygments/py3/pygments/lexers/d.py | 7 +- .../python/Pygments/py3/pygments/lexers/dalvik.py | 5 +- .../python/Pygments/py3/pygments/lexers/data.py | 16 +- contrib/python/Pygments/py3/pygments/lexers/dax.py | 5 +- .../Pygments/py3/pygments/lexers/devicetree.py | 5 +- .../python/Pygments/py3/pygments/lexers/diff.py | 13 +- contrib/python/Pygments/py3/pygments/lexers/dns.py | 17 +- .../python/Pygments/py3/pygments/lexers/dotnet.py | 33 +- .../python/Pygments/py3/pygments/lexers/dsls.py | 54 +- .../python/Pygments/py3/pygments/lexers/dylan.py | 14 +- contrib/python/Pygments/py3/pygments/lexers/ecl.py | 5 +- .../python/Pygments/py3/pygments/lexers/eiffel.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/elm.py | 5 +- .../python/Pygments/py3/pygments/lexers/elpi.py | 41 +- .../python/Pygments/py3/pygments/lexers/email.py | 6 +- .../python/Pygments/py3/pygments/lexers/erlang.py | 46 +- .../Pygments/py3/pygments/lexers/esoteric.py | 23 +- .../python/Pygments/py3/pygments/lexers/ezhil.py | 5 +- .../python/Pygments/py3/pygments/lexers/factor.py | 5 +- .../python/Pygments/py3/pygments/lexers/fantom.py | 6 +- .../python/Pygments/py3/pygments/lexers/felix.py | 19 +- .../python/Pygments/py3/pygments/lexers/fift.py | 3 +- .../Pygments/py3/pygments/lexers/floscript.py | 5 +- .../python/Pygments/py3/pygments/lexers/forth.py | 5 +- .../python/Pygments/py3/pygments/lexers/fortran.py | 9 +- .../python/Pygments/py3/pygments/lexers/foxpro.py | 6 +- .../python/Pygments/py3/pygments/lexers/freefem.py | 5 +- .../python/Pygments/py3/pygments/lexers/func.py | 4 +- .../Pygments/py3/pygments/lexers/functional.py | 3 +- .../python/Pygments/py3/pygments/lexers/futhark.py | 13 +- .../Pygments/py3/pygments/lexers/gcodelexer.py | 6 +- .../Pygments/py3/pygments/lexers/gdscript.py | 3 +- contrib/python/Pygments/py3/pygments/lexers/go.py | 5 +- .../py3/pygments/lexers/grammar_notation.py | 15 +- .../python/Pygments/py3/pygments/lexers/graph.py | 5 +- .../Pygments/py3/pygments/lexers/graphics.py | 30 +- .../python/Pygments/py3/pygments/lexers/graphql.py | 5 +- .../Pygments/py3/pygments/lexers/graphviz.py | 5 +- .../python/Pygments/py3/pygments/lexers/gsql.py | 5 +- .../python/Pygments/py3/pygments/lexers/haskell.py | 59 +- .../python/Pygments/py3/pygments/lexers/haxe.py | 8 +- contrib/python/Pygments/py3/pygments/lexers/hdl.py | 15 +- .../python/Pygments/py3/pygments/lexers/hexdump.py | 6 +- .../python/Pygments/py3/pygments/lexers/html.py | 31 +- contrib/python/Pygments/py3/pygments/lexers/idl.py | 5 +- .../python/Pygments/py3/pygments/lexers/igor.py | 7 +- .../python/Pygments/py3/pygments/lexers/inferno.py | 5 +- .../Pygments/py3/pygments/lexers/installers.py | 16 +- .../Pygments/py3/pygments/lexers/int_fiction.py | 312 +++++---- .../python/Pygments/py3/pygments/lexers/iolang.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/j.py | 5 +- .../Pygments/py3/pygments/lexers/javascript.py | 37 +- .../Pygments/py3/pygments/lexers/jmespath.py | 3 +- .../python/Pygments/py3/pygments/lexers/jslt.py | 5 +- .../python/Pygments/py3/pygments/lexers/jsonnet.py | 7 +- contrib/python/Pygments/py3/pygments/lexers/jsx.py | 5 +- .../python/Pygments/py3/pygments/lexers/julia.py | 9 +- contrib/python/Pygments/py3/pygments/lexers/jvm.py | 214 +++---- .../python/Pygments/py3/pygments/lexers/kuin.py | 5 +- .../python/Pygments/py3/pygments/lexers/kusto.py | 5 +- .../python/Pygments/py3/pygments/lexers/ldap.py | 8 +- .../python/Pygments/py3/pygments/lexers/lean.py | 145 ++++- .../Pygments/py3/pygments/lexers/lilypond.py | 5 +- .../python/Pygments/py3/pygments/lexers/lisp.py | 428 +++++++++++-- .../Pygments/py3/pygments/lexers/macaulay2.py | 37 +- .../python/Pygments/py3/pygments/lexers/make.py | 11 +- .../python/Pygments/py3/pygments/lexers/markup.py | 232 +++++-- .../python/Pygments/py3/pygments/lexers/math.py | 3 +- .../python/Pygments/py3/pygments/lexers/matlab.py | 22 +- .../python/Pygments/py3/pygments/lexers/maxima.py | 5 +- .../python/Pygments/py3/pygments/lexers/meson.py | 5 +- .../python/Pygments/py3/pygments/lexers/mime.py | 8 +- .../Pygments/py3/pygments/lexers/minecraft.py | 43 +- .../python/Pygments/py3/pygments/lexers/mips.py | 4 +- contrib/python/Pygments/py3/pygments/lexers/ml.py | 114 ++-- .../Pygments/py3/pygments/lexers/modeling.py | 41 +- .../python/Pygments/py3/pygments/lexers/modula2.py | 5 +- .../python/Pygments/py3/pygments/lexers/mojo.py | 704 +++++++++++++++++++++ .../python/Pygments/py3/pygments/lexers/monte.py | 5 +- .../python/Pygments/py3/pygments/lexers/mosel.py | 6 +- contrib/python/Pygments/py3/pygments/lexers/ncl.py | 7 +- .../python/Pygments/py3/pygments/lexers/nimrod.py | 15 +- contrib/python/Pygments/py3/pygments/lexers/nit.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/nix.py | 13 +- .../python/Pygments/py3/pygments/lexers/oberon.py | 6 +- .../Pygments/py3/pygments/lexers/objective.py | 20 +- contrib/python/Pygments/py3/pygments/lexers/ooc.py | 5 +- .../Pygments/py3/pygments/lexers/openscad.py | 5 +- .../python/Pygments/py3/pygments/lexers/other.py | 3 +- .../Pygments/py3/pygments/lexers/parasail.py | 5 +- .../python/Pygments/py3/pygments/lexers/parsers.py | 85 ++- .../python/Pygments/py3/pygments/lexers/pascal.py | 9 +- .../python/Pygments/py3/pygments/lexers/pawn.py | 10 +- .../python/Pygments/py3/pygments/lexers/perl.py | 6 +- .../python/Pygments/py3/pygments/lexers/phix.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/php.py | 9 +- .../Pygments/py3/pygments/lexers/pointless.py | 5 +- .../python/Pygments/py3/pygments/lexers/pony.py | 6 +- .../python/Pygments/py3/pygments/lexers/praat.py | 5 +- .../Pygments/py3/pygments/lexers/procfile.py | 5 +- .../python/Pygments/py3/pygments/lexers/prolog.py | 25 +- .../python/Pygments/py3/pygments/lexers/promql.py | 3 +- .../python/Pygments/py3/pygments/lexers/prql.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/ptx.py | 5 +- .../python/Pygments/py3/pygments/lexers/python.py | 40 +- contrib/python/Pygments/py3/pygments/lexers/q.py | 11 +- .../python/Pygments/py3/pygments/lexers/qlik.py | 6 +- contrib/python/Pygments/py3/pygments/lexers/qvt.py | 8 +- contrib/python/Pygments/py3/pygments/lexers/r.py | 14 +- contrib/python/Pygments/py3/pygments/lexers/rdf.py | 28 +- .../python/Pygments/py3/pygments/lexers/rebol.py | 14 +- .../Pygments/py3/pygments/lexers/resource.py | 11 +- .../python/Pygments/py3/pygments/lexers/ride.py | 9 +- .../python/Pygments/py3/pygments/lexers/rita.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/rnc.py | 5 +- .../Pygments/py3/pygments/lexers/roboconf.py | 10 +- .../Pygments/py3/pygments/lexers/robotframework.py | 5 +- .../python/Pygments/py3/pygments/lexers/ruby.py | 10 +- .../python/Pygments/py3/pygments/lexers/rust.py | 19 +- contrib/python/Pygments/py3/pygments/lexers/sas.py | 6 +- .../python/Pygments/py3/pygments/lexers/savi.py | 261 ++++---- .../python/Pygments/py3/pygments/lexers/scdoc.py | 5 +- .../Pygments/py3/pygments/lexers/scripting.py | 396 ++++++++++-- contrib/python/Pygments/py3/pygments/lexers/sgf.py | 5 +- .../python/Pygments/py3/pygments/lexers/shell.py | 236 ++++--- .../python/Pygments/py3/pygments/lexers/sieve.py | 6 +- .../python/Pygments/py3/pygments/lexers/slash.py | 9 +- .../Pygments/py3/pygments/lexers/smalltalk.py | 8 +- .../python/Pygments/py3/pygments/lexers/smithy.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/smv.py | 6 +- .../python/Pygments/py3/pygments/lexers/snobol.py | 6 +- .../Pygments/py3/pygments/lexers/solidity.py | 6 +- .../python/Pygments/py3/pygments/lexers/soong.py | 78 +++ .../python/Pygments/py3/pygments/lexers/sophia.py | 7 +- .../python/Pygments/py3/pygments/lexers/special.py | 11 +- .../python/Pygments/py3/pygments/lexers/spice.py | 16 +- contrib/python/Pygments/py3/pygments/lexers/sql.py | 40 +- .../python/Pygments/py3/pygments/lexers/srcinfo.py | 6 +- .../python/Pygments/py3/pygments/lexers/stata.py | 5 +- .../Pygments/py3/pygments/lexers/supercollider.py | 5 +- .../python/Pygments/py3/pygments/lexers/tact.py | 303 +++++++++ contrib/python/Pygments/py3/pygments/lexers/tal.py | 8 +- contrib/python/Pygments/py3/pygments/lexers/tcl.py | 5 +- .../python/Pygments/py3/pygments/lexers/teal.py | 5 +- .../Pygments/py3/pygments/lexers/templates.py | 203 +++--- .../Pygments/py3/pygments/lexers/teraterm.py | 5 +- .../python/Pygments/py3/pygments/lexers/testing.py | 9 +- .../python/Pygments/py3/pygments/lexers/text.py | 3 +- .../Pygments/py3/pygments/lexers/textedit.py | 15 +- .../Pygments/py3/pygments/lexers/textfmts.py | 22 +- .../python/Pygments/py3/pygments/lexers/theorem.py | 57 +- .../Pygments/py3/pygments/lexers/thingsdb.py | 76 ++- contrib/python/Pygments/py3/pygments/lexers/tlb.py | 4 +- contrib/python/Pygments/py3/pygments/lexers/tls.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/tnt.py | 5 +- .../Pygments/py3/pygments/lexers/trafficscript.py | 6 +- .../Pygments/py3/pygments/lexers/typoscript.py | 13 +- .../python/Pygments/py3/pygments/lexers/typst.py | 104 +++ contrib/python/Pygments/py3/pygments/lexers/ul4.py | 52 +- .../python/Pygments/py3/pygments/lexers/unicon.py | 16 +- .../python/Pygments/py3/pygments/lexers/urbi.py | 6 +- contrib/python/Pygments/py3/pygments/lexers/usd.py | 17 +- .../python/Pygments/py3/pygments/lexers/varnish.py | 10 +- .../Pygments/py3/pygments/lexers/verification.py | 9 +- .../Pygments/py3/pygments/lexers/verifpal.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/vip.py | 8 +- .../python/Pygments/py3/pygments/lexers/vyper.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/web.py | 3 +- .../Pygments/py3/pygments/lexers/webassembly.py | 5 +- .../python/Pygments/py3/pygments/lexers/webidl.py | 5 +- .../python/Pygments/py3/pygments/lexers/webmisc.py | 26 +- .../python/Pygments/py3/pygments/lexers/wgsl.py | 13 +- .../python/Pygments/py3/pygments/lexers/whiley.py | 5 +- .../python/Pygments/py3/pygments/lexers/wowtoc.py | 6 +- .../python/Pygments/py3/pygments/lexers/wren.py | 7 +- contrib/python/Pygments/py3/pygments/lexers/x10.py | 13 +- .../python/Pygments/py3/pygments/lexers/xorg.py | 3 +- .../python/Pygments/py3/pygments/lexers/yang.py | 5 +- .../python/Pygments/py3/pygments/lexers/yara.py | 5 +- contrib/python/Pygments/py3/pygments/lexers/zig.py | 3 +- contrib/python/Pygments/py3/pygments/modeline.py | 8 +- contrib/python/Pygments/py3/pygments/plugin.py | 22 +- contrib/python/Pygments/py3/pygments/regexopt.py | 2 +- contrib/python/Pygments/py3/pygments/scanner.py | 2 +- contrib/python/Pygments/py3/pygments/sphinxext.py | 24 +- contrib/python/Pygments/py3/pygments/style.py | 4 +- .../Pygments/py3/pygments/styles/__init__.py | 6 +- .../Pygments/py3/pygments/styles/_mapping.py | 1 + .../python/Pygments/py3/pygments/styles/abap.py | 2 +- .../python/Pygments/py3/pygments/styles/algol.py | 2 +- .../Pygments/py3/pygments/styles/algol_nu.py | 2 +- .../python/Pygments/py3/pygments/styles/arduino.py | 2 +- .../python/Pygments/py3/pygments/styles/autumn.py | 2 +- .../python/Pygments/py3/pygments/styles/borland.py | 2 +- contrib/python/Pygments/py3/pygments/styles/bw.py | 2 +- .../python/Pygments/py3/pygments/styles/coffee.py | 80 +++ .../Pygments/py3/pygments/styles/colorful.py | 2 +- .../python/Pygments/py3/pygments/styles/default.py | 2 +- .../python/Pygments/py3/pygments/styles/dracula.py | 2 +- .../python/Pygments/py3/pygments/styles/emacs.py | 2 +- .../Pygments/py3/pygments/styles/friendly.py | 2 +- .../py3/pygments/styles/friendly_grayscale.py | 2 +- .../python/Pygments/py3/pygments/styles/fruity.py | 2 +- .../python/Pygments/py3/pygments/styles/gh_dark.py | 2 +- .../python/Pygments/py3/pygments/styles/gruvbox.py | 2 +- .../python/Pygments/py3/pygments/styles/igor.py | 2 +- .../python/Pygments/py3/pygments/styles/inkpot.py | 2 +- .../Pygments/py3/pygments/styles/lightbulb.py | 2 +- .../Pygments/py3/pygments/styles/lilypond.py | 2 +- .../Pygments/py3/pygments/styles/lovelace.py | 2 +- .../python/Pygments/py3/pygments/styles/manni.py | 2 +- .../Pygments/py3/pygments/styles/material.py | 2 +- .../python/Pygments/py3/pygments/styles/monokai.py | 2 +- .../python/Pygments/py3/pygments/styles/murphy.py | 2 +- .../python/Pygments/py3/pygments/styles/native.py | 8 +- .../python/Pygments/py3/pygments/styles/nord.py | 2 +- .../python/Pygments/py3/pygments/styles/onedark.py | 2 +- .../Pygments/py3/pygments/styles/paraiso_dark.py | 2 +- .../Pygments/py3/pygments/styles/paraiso_light.py | 2 +- .../python/Pygments/py3/pygments/styles/pastie.py | 2 +- .../python/Pygments/py3/pygments/styles/perldoc.py | 2 +- .../Pygments/py3/pygments/styles/rainbow_dash.py | 38 +- contrib/python/Pygments/py3/pygments/styles/rrt.py | 2 +- contrib/python/Pygments/py3/pygments/styles/sas.py | 2 +- .../Pygments/py3/pygments/styles/solarized.py | 2 +- .../Pygments/py3/pygments/styles/staroffice.py | 2 +- .../Pygments/py3/pygments/styles/stata_dark.py | 2 +- .../Pygments/py3/pygments/styles/stata_light.py | 2 +- .../python/Pygments/py3/pygments/styles/tango.py | 2 +- .../python/Pygments/py3/pygments/styles/trac.py | 2 +- contrib/python/Pygments/py3/pygments/styles/vim.py | 2 +- contrib/python/Pygments/py3/pygments/styles/vs.py | 2 +- .../python/Pygments/py3/pygments/styles/xcode.py | 2 +- .../python/Pygments/py3/pygments/styles/zenburn.py | 2 +- contrib/python/Pygments/py3/pygments/token.py | 2 +- contrib/python/Pygments/py3/pygments/unistring.py | 10 +- contrib/python/Pygments/py3/pygments/util.py | 32 +- contrib/python/Pygments/py3/ya.make | 8 +- 329 files changed, 4994 insertions(+), 2527 deletions(-) create mode 100644 contrib/python/Pygments/py3/pygments/lexers/_luau_builtins.py create mode 100644 contrib/python/Pygments/py3/pygments/lexers/mojo.py create mode 100644 contrib/python/Pygments/py3/pygments/lexers/soong.py create mode 100644 contrib/python/Pygments/py3/pygments/lexers/tact.py create mode 100644 contrib/python/Pygments/py3/pygments/lexers/typst.py create mode 100644 contrib/python/Pygments/py3/pygments/styles/coffee.py (limited to 'contrib/python/Pygments') diff --git a/contrib/python/Pygments/py3/.dist-info/METADATA b/contrib/python/Pygments/py3/.dist-info/METADATA index 4318a7b72fd..3b102e1c8fc 100644 --- a/contrib/python/Pygments/py3/.dist-info/METADATA +++ b/contrib/python/Pygments/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.3 Name: Pygments -Version: 2.17.2 +Version: 2.18.0 Summary: Pygments is a syntax highlighting package written in Python. Project-URL: Homepage, https://pygments.org Project-URL: Documentation, https://pygments.org/docs @@ -22,7 +22,6 @@ Classifier: License :: OSI Approved :: BSD License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 @@ -32,9 +31,8 @@ Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Text Processing :: Filters Classifier: Topic :: Utilities -Requires-Python: >=3.7 +Requires-Python: >=3.8 Provides-Extra: plugins -Requires-Dist: importlib-metadata; python_version < '3.8' and extra == 'plugins' Provides-Extra: windows-terminal Requires-Dist: colorama>=0.4.6; extra == 'windows-terminal' Description-Content-Type: text/x-rst @@ -55,5 +53,5 @@ are: formats that PIL supports and ANSI sequences * it is usable as a command-line tool and as a library -Copyright 2006-2023 by the Pygments team, see ``AUTHORS``. +Copyright 2006-2024 by the Pygments team, see ``AUTHORS``. Licensed under the BSD, see ``LICENSE`` for details. diff --git a/contrib/python/Pygments/py3/AUTHORS b/contrib/python/Pygments/py3/AUTHORS index 0e9f5127180..4ec64ba1ef0 100644 --- a/contrib/python/Pygments/py3/AUTHORS +++ b/contrib/python/Pygments/py3/AUTHORS @@ -46,6 +46,7 @@ Other contributors, listed alphabetically, are: * chebee7i -- Python traceback lexer improvements * Hiram Chirino -- Scaml and Jade lexers * Mauricio Caceres -- SAS and Stata lexers. +* Michael Camilleri, John Gabriele, sogaiu -- Janet lexer * Ian Cooper -- VGL lexer * David Corbett -- Inform, Jasmin, JSGF, Snowball, and TADS 3 lexers * Leaf Corcoran -- MoonScript lexer @@ -115,6 +116,8 @@ Other contributors, listed alphabetically, are: MSDOS session, BC, WDiff * Brian R. Jackson -- Tea lexer * Christian Jann -- ShellSession lexer +* Jonas Camillus Jeppesen -- Line numbers and line highlighting for + RTF-formatter * Dennis Kaarsemaker -- sources.list lexer * Dmitri Kabak -- Inferno Limbo lexer * Igor Kalnitsky -- vhdl lexer @@ -195,6 +198,7 @@ Other contributors, listed alphabetically, are: * Kashif Rasul -- CUDA lexer * Nathan Reed -- HLSL lexer * Justin Reidy -- MXML lexer +* Jonathon Reinhart, Google LLC -- Soong lexer * Norman Richards -- JSON lexer * Corey Richardson -- Rust lexer updates * Fabrizio Riguzzi -- cplint leder @@ -274,6 +278,6 @@ Other contributors, listed alphabetically, are: * vanillajonathan -- PRQL lexer * Nikolay Antipov -- OpenSCAD lexer * Markus Meyer, Nextron Systems -- YARA lexer - +* Hannes Römer -- Mojo lexer Many thanks for all contributions! diff --git a/contrib/python/Pygments/py3/pygments/__init__.py b/contrib/python/Pygments/py3/pygments/__init__.py index 6b77c465c3f..e5a669ccbf2 100644 --- a/contrib/python/Pygments/py3/pygments/__init__.py +++ b/contrib/python/Pygments/py3/pygments/__init__.py @@ -21,12 +21,12 @@ .. _Pygments master branch: https://github.com/pygments/pygments/archive/master.zip#egg=Pygments-dev - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from io import StringIO, BytesIO -__version__ = '2.17.2' +__version__ = '2.18.0' __docformat__ = 'restructuredtext' __all__ = ['lex', 'format', 'highlight'] diff --git a/contrib/python/Pygments/py3/pygments/__main__.py b/contrib/python/Pygments/py3/pygments/__main__.py index 5eb2c747aaa..a243531748d 100644 --- a/contrib/python/Pygments/py3/pygments/__main__.py +++ b/contrib/python/Pygments/py3/pygments/__main__.py @@ -4,7 +4,7 @@ Main entry point for ``python -m pygments``. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/cmdline.py b/contrib/python/Pygments/py3/pygments/cmdline.py index 435231e6519..df1c3b7a466 100644 --- a/contrib/python/Pygments/py3/pygments/cmdline.py +++ b/contrib/python/Pygments/py3/pygments/cmdline.py @@ -4,7 +4,7 @@ Command line interface. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -68,19 +68,19 @@ def _print_help(what, name): try: if what == 'lexer': cls = get_lexer_by_name(name) - print("Help on the %s lexer:" % cls.name) + print(f"Help on the {cls.name} lexer:") print(dedent(cls.__doc__)) elif what == 'formatter': cls = find_formatter_class(name) - print("Help on the %s formatter:" % cls.name) + print(f"Help on the {cls.name} formatter:") print(dedent(cls.__doc__)) elif what == 'filter': cls = find_filter_class(name) - print("Help on the %s filter:" % name) + print(f"Help on the {name} filter:") print(dedent(cls.__doc__)) return 0 except (AttributeError, ValueError): - print("%s not found!" % what, file=sys.stderr) + print(f"{what} not found!", file=sys.stderr) return 1 @@ -97,7 +97,7 @@ def _print_list(what): info.append(tup) info.sort() for i in info: - print(('* %s\n %s %s') % i) + print(('* {}\n {} {}').format(*i)) elif what == 'formatter': print() @@ -112,7 +112,7 @@ def _print_list(what): info.append(tup) info.sort() for i in info: - print(('* %s\n %s %s') % i) + print(('* {}\n {} {}').format(*i)) elif what == 'filter': print() @@ -122,7 +122,7 @@ def _print_list(what): for name in get_all_filters(): cls = find_filter_class(name) print("* " + name + ':') - print(" %s" % docstring_headline(cls)) + print(f" {docstring_headline(cls)}") elif what == 'style': print() @@ -132,7 +132,7 @@ def _print_list(what): for name in get_all_styles(): cls = get_style_by_name(name) print("* " + name + ':') - print(" %s" % docstring_headline(cls)) + print(f" {docstring_headline(cls)}") def _print_list_as_json(requested_items): @@ -185,8 +185,8 @@ def main_inner(parser, argns): return 0 if argns.V: - print('Pygments version %s, (c) 2006-2023 by Georg Brandl, Matthäus ' - 'Chajdas and contributors.' % __version__) + print(f'Pygments version {__version__}, (c) 2006-2024 by Georg Brandl, Matthäus ' + 'Chajdas and contributors.') return 0 def is_only_option(opt): @@ -659,7 +659,7 @@ def main(args=sys.argv): msg = info[-1].strip() if len(info) >= 3: # extract relevant file and position info - msg += '\n (f%s)' % info[-2].split('\n')[0].strip()[1:] + msg += '\n (f{})'.format(info[-2].split('\n')[0].strip()[1:]) print(file=sys.stderr) print('*** Error while highlighting:', file=sys.stderr) print(msg, file=sys.stderr) diff --git a/contrib/python/Pygments/py3/pygments/console.py b/contrib/python/Pygments/py3/pygments/console.py index deb4937f74f..4c1a06219ca 100644 --- a/contrib/python/Pygments/py3/pygments/console.py +++ b/contrib/python/Pygments/py3/pygments/console.py @@ -4,7 +4,7 @@ Format colored console output. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -27,12 +27,12 @@ light_colors = ["brightblack", "brightred", "brightgreen", "brightyellow", "brig "brightmagenta", "brightcyan", "white"] x = 30 -for d, l in zip(dark_colors, light_colors): - codes[d] = esc + "%im" % x - codes[l] = esc + "%im" % (60 + x) +for dark, light in zip(dark_colors, light_colors): + codes[dark] = esc + "%im" % x + codes[light] = esc + "%im" % (60 + x) x += 1 -del d, l, x +del dark, light, x codes["white"] = codes["bold"] diff --git a/contrib/python/Pygments/py3/pygments/filter.py b/contrib/python/Pygments/py3/pygments/filter.py index dafa08d1569..aa6f76041b6 100644 --- a/contrib/python/Pygments/py3/pygments/filter.py +++ b/contrib/python/Pygments/py3/pygments/filter.py @@ -4,7 +4,7 @@ Module that implements the default filter. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -62,8 +62,7 @@ class FunctionFilter(Filter): def __init__(self, **options): if not hasattr(self, 'function'): - raise TypeError('%r used without bound function' % - self.__class__.__name__) + raise TypeError(f'{self.__class__.__name__!r} used without bound function') Filter.__init__(self, **options) def filter(self, lexer, stream): diff --git a/contrib/python/Pygments/py3/pygments/filters/__init__.py b/contrib/python/Pygments/py3/pygments/filters/__init__.py index 8bd53745cdd..86e8dacf3dd 100644 --- a/contrib/python/Pygments/py3/pygments/filters/__init__.py +++ b/contrib/python/Pygments/py3/pygments/filters/__init__.py @@ -5,7 +5,7 @@ Module containing filter lookup functions and default filters. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -39,7 +39,7 @@ def get_filter_by_name(filtername, **options): if cls: return cls(**options) else: - raise ClassNotFound('filter %r not found' % filtername) + raise ClassNotFound(f'filter {filtername!r} not found') def get_all_filters(): @@ -79,9 +79,9 @@ class CodeTagFilter(Filter): Filter.__init__(self, **options) tags = get_list_opt(options, 'codetags', ['XXX', 'TODO', 'FIXME', 'BUG', 'NOTE']) - self.tag_re = re.compile(r'\b(%s)\b' % '|'.join([ + self.tag_re = re.compile(r'\b({})\b'.format('|'.join([ re.escape(tag) for tag in tags if tag - ])) + ]))) def filter(self, lexer, stream): regex = self.tag_re diff --git a/contrib/python/Pygments/py3/pygments/formatter.py b/contrib/python/Pygments/py3/pygments/formatter.py index 87183abbb23..cad3b388cac 100644 --- a/contrib/python/Pygments/py3/pygments/formatter.py +++ b/contrib/python/Pygments/py3/pygments/formatter.py @@ -4,7 +4,7 @@ Base formatter class. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -122,3 +122,8 @@ class Formatter: # wrap the outfile in a StreamWriter outfile = codecs.lookup(self.encoding)[3](outfile) return self.format_unencoded(tokensource, outfile) + + # Allow writing Formatter[str] or Formatter[bytes]. That's equivalent to + # Formatter. This helps when using third-party type stubs from typeshed. + def __class_getitem__(cls, name): + return cls diff --git a/contrib/python/Pygments/py3/pygments/formatters/__init__.py b/contrib/python/Pygments/py3/pygments/formatters/__init__.py index 6e482a1b737..014de975f5d 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/__init__.py +++ b/contrib/python/Pygments/py3/pygments/formatters/__init__.py @@ -4,7 +4,7 @@ Pygments formatters. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -77,7 +77,7 @@ def get_formatter_by_name(_alias, **options): """ cls = find_formatter_class(_alias) if cls is None: - raise ClassNotFound("no formatter found for name %r" % _alias) + raise ClassNotFound(f"no formatter found for name {_alias!r}") return cls(**options) @@ -103,17 +103,16 @@ def load_formatter_from_file(filename, formattername="CustomFormatter", **option exec(f.read(), custom_namespace) # Retrieve the class `formattername` from that namespace if formattername not in custom_namespace: - raise ClassNotFound('no valid %s class found in %s' % - (formattername, filename)) + raise ClassNotFound(f'no valid {formattername} class found in {filename}') formatter_class = custom_namespace[formattername] # And finally instantiate it with the options return formatter_class(**options) except OSError as err: - raise ClassNotFound('cannot read %s: %s' % (filename, err)) + raise ClassNotFound(f'cannot read {filename}: {err}') except ClassNotFound: raise except Exception as err: - raise ClassNotFound('error when loading custom formatter: %s' % err) + raise ClassNotFound(f'error when loading custom formatter: {err}') def get_formatter_for_filename(fn, **options): @@ -135,7 +134,7 @@ def get_formatter_for_filename(fn, **options): for filename in cls.filenames: if _fn_matches(fn, filename): return cls(**options) - raise ClassNotFound("no formatter found for file name %r" % fn) + raise ClassNotFound(f"no formatter found for file name {fn!r}") class _automodule(types.ModuleType): diff --git a/contrib/python/Pygments/py3/pygments/formatters/bbcode.py b/contrib/python/Pygments/py3/pygments/formatters/bbcode.py index 9ce4ebc5a4f..9554081062a 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/bbcode.py +++ b/contrib/python/Pygments/py3/pygments/formatters/bbcode.py @@ -4,7 +4,7 @@ BBcode formatter. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -60,7 +60,7 @@ class BBCodeFormatter(Formatter): for ttype, ndef in self.style: start = end = '' if ndef['color']: - start += '[color=#%s]' % ndef['color'] + start += '[color=#{}]'.format(ndef['color']) end = '[/color]' + end if ndef['bold']: start += '[b]' diff --git a/contrib/python/Pygments/py3/pygments/formatters/groff.py b/contrib/python/Pygments/py3/pygments/formatters/groff.py index 687fd549671..a9e071128bd 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/groff.py +++ b/contrib/python/Pygments/py3/pygments/formatters/groff.py @@ -4,7 +4,7 @@ Formatter for groff output. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -63,7 +63,7 @@ class GroffFormatter(Formatter): for ttype, ndef in self.style: start = end = '' if ndef['color']: - start += '\\m[%s]' % ndef['color'] + start += '\\m[{}]'.format(ndef['color']) end = '\\m[]' + end if ndef['bold']: start += bold @@ -72,7 +72,7 @@ class GroffFormatter(Formatter): start += italic end = regular + end if ndef['bgcolor']: - start += '\\M[%s]' % ndef['bgcolor'] + start += '\\M[{}]'.format(ndef['bgcolor']) end = '\\M[]' + end self.styles[ttype] = start, end diff --git a/contrib/python/Pygments/py3/pygments/formatters/html.py b/contrib/python/Pygments/py3/pygments/formatters/html.py index df2469e2a51..3330c1d5888 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/html.py +++ b/contrib/python/Pygments/py3/pygments/formatters/html.py @@ -4,7 +4,7 @@ Formatter for HTML output. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -62,7 +62,7 @@ def _get_ttype_class(ttype): CSSFILE_TEMPLATE = '''\ /* generated by Pygments -Copyright 2006-2023 by the Pygments team. +Copyright 2006-2024 by the Pygments team. Licensed under the BSD license, see LICENSE for details. */ %(styledefs)s @@ -73,7 +73,7 @@ DOC_HEADER = '''\ "http://www.w3.org/TR/html4/strict.dtd"> @@ -488,7 +488,7 @@ class HtmlFormatter(Formatter): name = self._get_css_class(ttype) style = '' if ndef['color']: - style += 'color: %s; ' % webify(ndef['color']) + style += 'color: {}; '.format(webify(ndef['color'])) if ndef['bold']: style += 'font-weight: bold; ' if ndef['italic']: @@ -496,9 +496,9 @@ class HtmlFormatter(Formatter): if ndef['underline']: style += 'text-decoration: underline; ' if ndef['bgcolor']: - style += 'background-color: %s; ' % webify(ndef['bgcolor']) + style += 'background-color: {}; '.format(webify(ndef['bgcolor'])) if ndef['border']: - style += 'border: 1px solid %s; ' % webify(ndef['border']) + style += 'border: 1px solid {}; '.format(webify(ndef['border'])) if style: t2c[ttype] = name # save len(ttype) to enable ordering the styles by @@ -530,7 +530,7 @@ class HtmlFormatter(Formatter): styles.sort() lines = [ - '%s { %s } /* %s */' % (prefix(cls), style, repr(ttype)[6:]) + f'{prefix(cls)} {{ {style} }} /* {repr(ttype)[6:]} */' for (level, ttype, cls, style) in styles ] @@ -548,24 +548,24 @@ class HtmlFormatter(Formatter): if Text in self.ttype2class: text_style = ' ' + self.class2style[self.ttype2class[Text]][0] lines.insert( - 0, '%s{ background: %s;%s }' % ( + 0, '{}{{ background: {};{} }}'.format( prefix(''), bg_color, text_style ) ) if hl_color is not None: lines.insert( - 0, '%s { background-color: %s }' % (prefix('hll'), hl_color) + 0, '{} {{ background-color: {} }}'.format(prefix('hll'), hl_color) ) return lines def get_linenos_style_defs(self): lines = [ - 'pre { %s }' % self._pre_style, - 'td.linenos .normal { %s }' % self._linenos_style, - 'span.linenos { %s }' % self._linenos_style, - 'td.linenos .special { %s }' % self._linenos_special_style, - 'span.linenos.special { %s }' % self._linenos_special_style, + f'pre {{ {self._pre_style} }}', + f'td.linenos .normal {{ {self._linenos_style} }}', + f'span.linenos {{ {self._linenos_style} }}', + f'td.linenos .special {{ {self._linenos_special_style} }}', + f'span.linenos.special {{ {self._linenos_special_style} }}', ] return lines @@ -594,17 +594,15 @@ class HtmlFormatter(Formatter): @property def _linenos_style(self): - return 'color: %s; background-color: %s; padding-left: 5px; padding-right: 5px;' % ( - self.style.line_number_color, - self.style.line_number_background_color - ) + color = self.style.line_number_color + background_color = self.style.line_number_background_color + return f'color: {color}; background-color: {background_color}; padding-left: 5px; padding-right: 5px;' @property def _linenos_special_style(self): - return 'color: %s; background-color: %s; padding-left: 5px; padding-right: 5px;' % ( - self.style.line_number_special_color, - self.style.line_number_special_background_color - ) + color = self.style.line_number_special_color + background_color = self.style.line_number_special_background_color + return f'color: {color}; background-color: {background_color}; padding-left: 5px; padding-right: 5px;' def _decodeifneeded(self, value): if isinstance(value, bytes): @@ -685,9 +683,9 @@ class HtmlFormatter(Formatter): if nocls: if special_line: - style = ' style="%s"' % self._linenos_special_style + style = f' style="{self._linenos_special_style}"' else: - style = ' style="%s"' % self._linenos_style + style = f' style="{self._linenos_style}"' else: if special_line: style = ' class="special"' @@ -695,7 +693,7 @@ class HtmlFormatter(Formatter): style = ' class="normal"' if style: - line = '%s' % (style, line) + line = f'{line}' lines.append(line) @@ -744,9 +742,9 @@ class HtmlFormatter(Formatter): if nocls: if special_line: - style = ' style="%s"' % self._linenos_special_style + style = f' style="{self._linenos_special_style}"' else: - style = ' style="%s"' % self._linenos_style + style = f' style="{self._linenos_style}"' else: if special_line: style = ' class="linenos special"' @@ -754,7 +752,7 @@ class HtmlFormatter(Formatter): style = ' class="linenos"' if style: - linenos = '%s' % (style, line) + linenos = f'{line}' else: linenos = line @@ -791,13 +789,13 @@ class HtmlFormatter(Formatter): style = [] if (self.noclasses and not self.nobackground and self.style.background_color is not None): - style.append('background: %s' % (self.style.background_color,)) + style.append(f'background: {self.style.background_color}') if self.cssstyles: style.append(self.cssstyles) style = '; '.join(style) - yield 0, ('') + yield 0, ('') yield from inner yield 0, '\n' @@ -814,7 +812,7 @@ class HtmlFormatter(Formatter): # the empty span here is to keep leading empty lines from being # ignored by HTML parsers - yield 0, ('') + yield 0, ('') yield from inner yield 0, '' @@ -843,18 +841,18 @@ class HtmlFormatter(Formatter): try: cspan = self.span_element_openers[ttype] except KeyError: - title = ' title="%s"' % '.'.join(ttype) if self.debug_token_types else '' + title = ' title="{}"'.format('.'.join(ttype)) if self.debug_token_types else '' if nocls: css_style = self._get_css_inline_styles(ttype) if css_style: css_style = self.class2style[css_style][0] - cspan = '' % (css_style, title) + cspan = f'' else: cspan = '' else: css_class = self._get_css_classes(ttype) if css_class: - cspan = '' % (css_class, title) + cspan = f'' else: cspan = '' self.span_element_openers[ttype] = cspan @@ -927,11 +925,10 @@ class HtmlFormatter(Formatter): if self.noclasses: style = '' if self.style.highlight_color is not None: - style = (' style="background-color: %s"' % - (self.style.highlight_color,)) - yield 1, '%s' % (style, value) + style = (f' style="background-color: {self.style.highlight_color}"') + yield 1, f'{value}' else: - yield 1, '%s' % value + yield 1, f'{value}' else: yield 1, value diff --git a/contrib/python/Pygments/py3/pygments/formatters/img.py b/contrib/python/Pygments/py3/pygments/formatters/img.py index dcf09da97fd..d5c97d47b53 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/img.py +++ b/contrib/python/Pygments/py3/pygments/formatters/img.py @@ -4,7 +4,7 @@ Formatter for Pixmap output. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os @@ -90,7 +90,7 @@ class FontManager: self._create_nix() def _get_nix_font_path(self, name, style): - proc = subprocess.Popen(['fc-list', "%s:style=%s" % (name, style), 'file'], + proc = subprocess.Popen(['fc-list', f"{name}:style={style}", 'file'], stdout=subprocess.PIPE, stderr=None) stdout, _ = proc.communicate() if proc.returncode == 0: @@ -110,8 +110,7 @@ class FontManager: self.fonts['NORMAL'] = ImageFont.truetype(path, self.font_size) break else: - raise FontNotFound('No usable fonts named: "%s"' % - self.font_name) + raise FontNotFound(f'No usable fonts named: "{self.font_name}"') for style in ('ITALIC', 'BOLD', 'BOLDITALIC'): for stylename in STYLES[style]: path = self._get_nix_font_path(self.font_name, stylename) @@ -142,8 +141,7 @@ class FontManager: self.fonts['NORMAL'] = ImageFont.truetype(path, self.font_size) break else: - raise FontNotFound('No usable fonts named: "%s"' % - self.font_name) + raise FontNotFound(f'No usable fonts named: "{self.font_name}"') for style in ('ITALIC', 'BOLD', 'BOLDITALIC'): for stylename in STYLES[style]: path = self._get_mac_font_path(font_map, self.font_name, stylename) @@ -160,15 +158,14 @@ class FontManager: for suffix in ('', ' (TrueType)'): for style in styles: try: - valname = '%s%s%s' % (basename, style and ' '+style, suffix) + valname = '{}{}{}'.format(basename, style and ' '+style, suffix) val, _ = _winreg.QueryValueEx(key, valname) return val except OSError: continue else: if fail: - raise FontNotFound('Font %s (%s) not found in registry' % - (basename, styles[0])) + raise FontNotFound(f'Font {basename} ({styles[0]}) not found in registry') return None def _create_win(self): @@ -633,7 +630,11 @@ class ImageFormatter(Formatter): fill=self.hl_color) for pos, value, font, text_fg, text_bg in self.drawables: if text_bg: - text_size = draw.textsize(text=value, font=font) + # see deprecations https://pillow.readthedocs.io/en/stable/releasenotes/9.2.0.html#font-size-and-offset-methods + if hasattr(draw, 'textsize'): + text_size = draw.textsize(text=value, font=font) + else: + text_size = font.getbbox(value)[2:] draw.rectangle([pos[0], pos[1], pos[0] + text_size[0], pos[1] + text_size[1]], fill=text_bg) draw.text(pos, value, font=font, fill=text_fg) im.save(outfile, self.image_format.upper()) diff --git a/contrib/python/Pygments/py3/pygments/formatters/irc.py b/contrib/python/Pygments/py3/pygments/formatters/irc.py index 334aeef4924..a1e3979beb3 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/irc.py +++ b/contrib/python/Pygments/py3/pygments/formatters/irc.py @@ -4,7 +4,7 @@ Formatter for IRC output - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/formatters/latex.py b/contrib/python/Pygments/py3/pygments/formatters/latex.py index b130bfaf691..2f7971e8d30 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/latex.py +++ b/contrib/python/Pygments/py3/pygments/formatters/latex.py @@ -4,7 +4,7 @@ Formatter for LaTeX fancyvrb output. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -23,21 +23,21 @@ def escape_tex(text, commandprefix): return text.replace('\\', '\x00'). \ replace('{', '\x01'). \ replace('}', '\x02'). \ - replace('\x00', r'\%sZbs{}' % commandprefix). \ - replace('\x01', r'\%sZob{}' % commandprefix). \ - replace('\x02', r'\%sZcb{}' % commandprefix). \ - replace('^', r'\%sZca{}' % commandprefix). \ - replace('_', r'\%sZus{}' % commandprefix). \ - replace('&', r'\%sZam{}' % commandprefix). \ - replace('<', r'\%sZlt{}' % commandprefix). \ - replace('>', r'\%sZgt{}' % commandprefix). \ - replace('#', r'\%sZsh{}' % commandprefix). \ - replace('%', r'\%sZpc{}' % commandprefix). \ - replace('$', r'\%sZdl{}' % commandprefix). \ - replace('-', r'\%sZhy{}' % commandprefix). \ - replace("'", r'\%sZsq{}' % commandprefix). \ - replace('"', r'\%sZdq{}' % commandprefix). \ - replace('~', r'\%sZti{}' % commandprefix) + replace('\x00', rf'\{commandprefix}Zbs{{}}'). \ + replace('\x01', rf'\{commandprefix}Zob{{}}'). \ + replace('\x02', rf'\{commandprefix}Zcb{{}}'). \ + replace('^', rf'\{commandprefix}Zca{{}}'). \ + replace('_', rf'\{commandprefix}Zus{{}}'). \ + replace('&', rf'\{commandprefix}Zam{{}}'). \ + replace('<', rf'\{commandprefix}Zlt{{}}'). \ + replace('>', rf'\{commandprefix}Zgt{{}}'). \ + replace('#', rf'\{commandprefix}Zsh{{}}'). \ + replace('%', rf'\{commandprefix}Zpc{{}}'). \ + replace('$', rf'\{commandprefix}Zdl{{}}'). \ + replace('-', rf'\{commandprefix}Zhy{{}}'). \ + replace("'", rf'\{commandprefix}Zsq{{}}'). \ + replace('"', rf'\{commandprefix}Zdq{{}}'). \ + replace('~', rf'\{commandprefix}Zti{{}}') DOC_TEMPLATE = r''' @@ -304,17 +304,14 @@ class LatexFormatter(Formatter): if ndef['mono']: cmndef += r'\let\$$@ff=\textsf' if ndef['color']: - cmndef += (r'\def\$$@tc##1{\textcolor[rgb]{%s}{##1}}' % - rgbcolor(ndef['color'])) + cmndef += (r'\def\$$@tc##1{{\textcolor[rgb]{{{}}}{{##1}}}}'.format(rgbcolor(ndef['color']))) if ndef['border']: - cmndef += (r'\def\$$@bc##1{{\setlength{\fboxsep}{\string -\fboxrule}' - r'\fcolorbox[rgb]{%s}{%s}{\strut ##1}}}' % - (rgbcolor(ndef['border']), + cmndef += (r'\def\$$@bc##1{{{{\setlength{{\fboxsep}}{{\string -\fboxrule}}' + r'\fcolorbox[rgb]{{{}}}{{{}}}{{\strut ##1}}}}}}'.format(rgbcolor(ndef['border']), rgbcolor(ndef['bgcolor']))) elif ndef['bgcolor']: - cmndef += (r'\def\$$@bc##1{{\setlength{\fboxsep}{0pt}' - r'\colorbox[rgb]{%s}{\strut ##1}}}' % - rgbcolor(ndef['bgcolor'])) + cmndef += (r'\def\$$@bc##1{{{{\setlength{{\fboxsep}}{{0pt}}' + r'\colorbox[rgb]{{{}}}{{\strut ##1}}}}}}'.format(rgbcolor(ndef['bgcolor']))) if cmndef == '': continue cmndef = cmndef.replace('$$', cp) @@ -329,7 +326,7 @@ class LatexFormatter(Formatter): cp = self.commandprefix styles = [] for name, definition in self.cmd2def.items(): - styles.append(r'\@namedef{%s@tok@%s}{%s}' % (cp, name, definition)) + styles.append(rf'\@namedef{{{cp}@tok@{name}}}{{{definition}}}') return STYLE_TEMPLATE % {'cp': self.commandprefix, 'styles': '\n'.join(styles)} @@ -410,10 +407,10 @@ class LatexFormatter(Formatter): spl = value.split('\n') for line in spl[:-1]: if line: - outfile.write("\\%s{%s}{%s}" % (cp, styleval, line)) + outfile.write(f"\\{cp}{{{styleval}}}{{{line}}}") outfile.write('\n') if spl[-1]: - outfile.write("\\%s{%s}{%s}" % (cp, styleval, spl[-1])) + outfile.write(f"\\{cp}{{{styleval}}}{{{spl[-1]}}}") else: outfile.write(value) diff --git a/contrib/python/Pygments/py3/pygments/formatters/other.py b/contrib/python/Pygments/py3/pygments/formatters/other.py index 8004764371a..56e8f033ceb 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/other.py +++ b/contrib/python/Pygments/py3/pygments/formatters/other.py @@ -4,7 +4,7 @@ Other formatters: NullFormatter, RawTokenFormatter. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -74,8 +74,7 @@ class RawTokenFormatter(Formatter): try: colorize(self.error_color, '') except KeyError: - raise ValueError("Invalid color %r specified" % - self.error_color) + raise ValueError(f"Invalid color {self.error_color!r} specified") def format(self, tokensource, outfile): try: @@ -147,7 +146,7 @@ class TestcaseFormatter(Formatter): outbuf = [] for ttype, value in tokensource: rawbuf.append(value) - outbuf.append('%s(%s, %r),\n' % (indentation, ttype, value)) + outbuf.append(f'{indentation}({ttype}, {value!r}),\n') before = TESTCASE_BEFORE % (''.join(rawbuf),) during = ''.join(outbuf) diff --git a/contrib/python/Pygments/py3/pygments/formatters/pangomarkup.py b/contrib/python/Pygments/py3/pygments/formatters/pangomarkup.py index 50872fe2475..550dabb41b0 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/pangomarkup.py +++ b/contrib/python/Pygments/py3/pygments/formatters/pangomarkup.py @@ -4,7 +4,7 @@ Formatter for Pango markup output. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -45,7 +45,7 @@ class PangoMarkupFormatter(Formatter): start = '' end = '' if style['color']: - start += '' % style['color'] + start += ''.format(style['color']) end = '' + end if style['bold']: start += '' diff --git a/contrib/python/Pygments/py3/pygments/formatters/rtf.py b/contrib/python/Pygments/py3/pygments/formatters/rtf.py index d3a83fa603b..7f8b7e4cd7d 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/rtf.py +++ b/contrib/python/Pygments/py3/pygments/formatters/rtf.py @@ -4,12 +4,14 @@ A formatter that generates RTF files. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ +from collections import OrderedDict from pygments.formatter import Formatter -from pygments.util import get_int_opt, surrogatepair +from pygments.style import _ansimap +from pygments.util import get_bool_opt, get_int_opt, get_list_opt, surrogatepair __all__ = ['RtfFormatter'] @@ -42,6 +44,59 @@ class RtfFormatter(Formatter): default is 24 half-points, giving a size 12 font. .. versionadded:: 2.0 + + `linenos` + Turn on line numbering (default: ``False``). + + .. versionadded:: 2.18 + + `lineno_fontsize` + Font size for line numbers. Size is specified in half points + (default: `fontsize`). + + .. versionadded:: 2.18 + + `lineno_padding` + Number of spaces between the (inline) line numbers and the + source code (default: ``2``). + + .. versionadded:: 2.18 + + `linenostart` + The line number for the first line (default: ``1``). + + .. versionadded:: 2.18 + + `linenostep` + If set to a number n > 1, only every nth line number is printed. + + .. versionadded:: 2.18 + + `lineno_color` + Color for line numbers specified as a hex triplet, e.g. ``'5e5e5e'``. + Defaults to the style's line number color if it is a hex triplet, + otherwise ansi bright black. + + .. versionadded:: 2.18 + + `hl_lines` + Specify a list of lines to be highlighted, as line numbers separated by + spaces, e.g. ``'3 7 8'``. The line numbers are relative to the input + (i.e. the first line is line 1) unless `hl_linenostart` is set. + + .. versionadded:: 2.18 + + `hl_color` + Color for highlighting the lines specified in `hl_lines`, specified as + a hex triplet (default: style's `highlight_color`). + + .. versionadded:: 2.18 + + `hl_linenostart` + If set to ``True`` line numbers in `hl_lines` are specified + relative to `linenostart` (default ``False``). + + .. versionadded:: 2.18 """ name = 'RTF' aliases = ['rtf'] @@ -62,6 +117,40 @@ class RtfFormatter(Formatter): Formatter.__init__(self, **options) self.fontface = options.get('fontface') or '' self.fontsize = get_int_opt(options, 'fontsize', 0) + self.linenos = get_bool_opt(options, 'linenos', False) + self.lineno_fontsize = get_int_opt(options, 'lineno_fontsize', + self.fontsize) + self.lineno_padding = get_int_opt(options, 'lineno_padding', 2) + self.linenostart = abs(get_int_opt(options, 'linenostart', 1)) + self.linenostep = abs(get_int_opt(options, 'linenostep', 1)) + self.hl_linenostart = get_bool_opt(options, 'hl_linenostart', False) + + self.hl_color = options.get('hl_color', '') + if not self.hl_color: + self.hl_color = self.style.highlight_color + + self.hl_lines = [] + for lineno in get_list_opt(options, 'hl_lines', []): + try: + lineno = int(lineno) + if self.hl_linenostart: + lineno = lineno - self.linenostart + 1 + self.hl_lines.append(lineno) + except ValueError: + pass + + self.lineno_color = options.get('lineno_color', '') + if not self.lineno_color: + if self.style.line_number_color == 'inherit': + # style color is the css value 'inherit' + # default to ansi bright-black + self.lineno_color = _ansimap['ansibrightblack'] + else: + # style color is assumed to be a hex triplet as other + # colors in pygments/style.py + self.lineno_color = self.style.line_number_color + + self.color_mapping = self._create_color_mapping() def _escape(self, text): return text.replace('\\', '\\\\') \ @@ -90,43 +179,145 @@ class RtfFormatter(Formatter): # Force surrogate pairs buf.append('{\\u%d}{\\u%d}' % surrogatepair(cn)) - return ''.join(buf).replace('\n', '\\par\n') + return ''.join(buf).replace('\n', '\\par') - def format_unencoded(self, tokensource, outfile): - # rtf 1.8 header - outfile.write('{\\rtf1\\ansi\\uc0\\deff0' - '{\\fonttbl{\\f0\\fmodern\\fprq1\\fcharset0%s;}}' - '{\\colortbl;' % (self.fontface and - ' ' + self._escape(self.fontface) or - '')) - - # convert colors and save them in a mapping to access them later. - color_mapping = {} + @staticmethod + def hex_to_rtf_color(hex_color): + if hex_color[0] == "#": + hex_color = hex_color[1:] + + return '\\red%d\\green%d\\blue%d;' % ( + int(hex_color[0:2], 16), + int(hex_color[2:4], 16), + int(hex_color[4:6], 16) + ) + + def _split_tokens_on_newlines(self, tokensource): + """ + Split tokens containing newline characters into multiple token + each representing a line of the input file. Needed for numbering + lines of e.g. multiline comments. + """ + for ttype, value in tokensource: + if value == '\n': + yield (ttype, value) + elif "\n" in value: + lines = value.split("\n") + for line in lines[:-1]: + yield (ttype, line+"\n") + if lines[-1]: + yield (ttype, lines[-1]) + else: + yield (ttype, value) + + def _create_color_mapping(self): + """ + Create a mapping of style hex colors to index/offset in + the RTF color table. + """ + color_mapping = OrderedDict() offset = 1 + + if self.linenos: + color_mapping[self.lineno_color] = offset + offset += 1 + + if self.hl_lines: + color_mapping[self.hl_color] = offset + offset += 1 + for _, style in self.style: for color in style['color'], style['bgcolor'], style['border']: if color and color not in color_mapping: color_mapping[color] = offset - outfile.write('\\red%d\\green%d\\blue%d;' % ( - int(color[0:2], 16), - int(color[2:4], 16), - int(color[4:6], 16) - )) offset += 1 - outfile.write('}\\f0 ') + + return color_mapping + + @property + def _lineno_template(self): + if self.lineno_fontsize != self.fontsize: + return '{{\\fs{} \\cf{} %s{}}}'.format(self.lineno_fontsize, + self.color_mapping[self.lineno_color], + " " * self.lineno_padding) + + return '{{\\cf{} %s{}}}'.format(self.color_mapping[self.lineno_color], + " " * self.lineno_padding) + + @property + def _hl_open_str(self): + return rf'{{\highlight{self.color_mapping[self.hl_color]} ' + + @property + def _rtf_header(self): + lines = [] + # rtf 1.8 header + lines.append('{\\rtf1\\ansi\\uc0\\deff0' + '{\\fonttbl{\\f0\\fmodern\\fprq1\\fcharset0%s;}}' + % (self.fontface and ' ' + + self._escape(self.fontface) or '')) + + # color table + lines.append('{\\colortbl;') + for color, _ in self.color_mapping.items(): + lines.append(self.hex_to_rtf_color(color)) + lines.append('}') + + # font and fontsize + lines.append('\\f0\\sa0') if self.fontsize: - outfile.write('\\fs%d' % self.fontsize) + lines.append('\\fs%d' % self.fontsize) + + # ensure Libre Office Writer imports and renders consecutive + # space characters the same width, needed for line numbering. + # https://bugs.documentfoundation.org/show_bug.cgi?id=144050 + lines.append('\\dntblnsbdb') + + return lines + + def format_unencoded(self, tokensource, outfile): + for line in self._rtf_header: + outfile.write(line + "\n") + + tokensource = self._split_tokens_on_newlines(tokensource) + + # first pass of tokens to count lines, needed for line numbering + if self.linenos: + line_count = 0 + tokens = [] # for copying the token source generator + for ttype, value in tokensource: + tokens.append((ttype, value)) + if value.endswith("\n"): + line_count += 1 + + # width of line number strings (for padding with spaces) + linenos_width = len(str(line_count+self.linenostart-1)) + + tokensource = tokens # highlight stream + lineno = 1 + start_new_line = True for ttype, value in tokensource: + if start_new_line and lineno in self.hl_lines: + outfile.write(self._hl_open_str) + + if start_new_line and self.linenos: + if (lineno-self.linenostart+1)%self.linenostep == 0: + current_lineno = lineno + self.linenostart - 1 + lineno_str = str(current_lineno).rjust(linenos_width) + else: + lineno_str = "".rjust(linenos_width) + outfile.write(self._lineno_template % lineno_str) + while not self.style.styles_token(ttype) and ttype.parent: ttype = ttype.parent style = self.style.style_for_token(ttype) buf = [] if style['bgcolor']: - buf.append('\\cb%d' % color_mapping[style['bgcolor']]) + buf.append('\\cb%d' % self.color_mapping[style['bgcolor']]) if style['color']: - buf.append('\\cf%d' % color_mapping[style['color']]) + buf.append('\\cf%d' % self.color_mapping[style['color']]) if style['bold']: buf.append('\\b') if style['italic']: @@ -135,12 +326,24 @@ class RtfFormatter(Formatter): buf.append('\\ul') if style['border']: buf.append('\\chbrdr\\chcfpat%d' % - color_mapping[style['border']]) + self.color_mapping[style['border']]) start = ''.join(buf) if start: - outfile.write('{%s ' % start) + outfile.write(f'{{{start} ') outfile.write(self._escape_text(value)) if start: outfile.write('}') + start_new_line = False + + # complete line of input + if value.endswith("\n"): + # close line highlighting + if lineno in self.hl_lines: + outfile.write('}') + # newline in RTF file after closing } + outfile.write("\n") + + start_new_line = True + lineno += 1 - outfile.write('}') + outfile.write('}\n') diff --git a/contrib/python/Pygments/py3/pygments/formatters/svg.py b/contrib/python/Pygments/py3/pygments/formatters/svg.py index e3cd26955ab..74019b69614 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/svg.py +++ b/contrib/python/Pygments/py3/pygments/formatters/svg.py @@ -4,7 +4,7 @@ Formatter for SVG output. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -60,11 +60,11 @@ class SvgFormatter(Formatter): `linenostep` If set to a number n > 1, only every nth line number is printed. - + `linenowidth` Maximum width devoted to line numbers (default: ``3*ystep``, sufficient - for up to 4-digit line numbers. Increase width for longer code blocks). - + for up to 4-digit line numbers. Increase width for longer code blocks). + `xoffset` Starting offset in X direction, defaults to ``0``. @@ -97,10 +97,11 @@ class SvgFormatter(Formatter): self.fontsize = options.get('fontsize', '14px') self.xoffset = get_int_opt(options, 'xoffset', 0) fs = self.fontsize.strip() - if fs.endswith('px'): fs = fs[:-2].strip() + if fs.endswith('px'): + fs = fs[:-2].strip() try: int_fs = int(fs) - except: + except ValueError: int_fs = 20 self.yoffset = get_int_opt(options, 'yoffset', int_fs) self.ystep = get_int_opt(options, 'ystep', int_fs + 5) @@ -122,30 +123,27 @@ class SvgFormatter(Formatter): y = self.yoffset if not self.nowrap: if self.encoding: - outfile.write('\n' % - self.encoding) + outfile.write(f'\n') else: outfile.write('\n') outfile.write('\n') outfile.write('\n') - outfile.write('\n' % - (self.fontfamily, self.fontsize)) - - counter = self.linenostart + outfile.write(f'\n') + + counter = self.linenostart counter_step = self.linenostep counter_style = self._get_style(Comment) line_x = x - + if self.linenos: if counter % counter_step == 0: - outfile.write('%s' % - (x+self.linenowidth,y,counter_style,counter)) + outfile.write(f'{counter}') line_x += self.linenowidth + self.ystep counter += 1 - outfile.write('' % (line_x, y)) + outfile.write(f'') for ttype, value in tokensource: style = self._get_style(ttype) tspan = style and '' or '' @@ -159,11 +157,10 @@ class SvgFormatter(Formatter): y += self.ystep outfile.write('\n') if self.linenos and counter % counter_step == 0: - outfile.write('%s' % - (x+self.linenowidth,y,counter_style,counter)) - + outfile.write(f'{counter}') + counter += 1 - outfile.write('' % (line_x,y)) + outfile.write(f'') outfile.write(tspan + parts[-1] + tspanend) outfile.write('') diff --git a/contrib/python/Pygments/py3/pygments/formatters/terminal.py b/contrib/python/Pygments/py3/pygments/formatters/terminal.py index 636f3503df2..5c38805171b 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/terminal.py +++ b/contrib/python/Pygments/py3/pygments/formatters/terminal.py @@ -4,7 +4,7 @@ Formatter for terminal output with ANSI sequences. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/formatters/terminal256.py b/contrib/python/Pygments/py3/pygments/formatters/terminal256.py index dba5b63e216..6402d8c4695 100644 --- a/contrib/python/Pygments/py3/pygments/formatters/terminal256.py +++ b/contrib/python/Pygments/py3/pygments/formatters/terminal256.py @@ -10,7 +10,7 @@ Formatter version 1. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexer.py b/contrib/python/Pygments/py3/pygments/lexer.py index eb5403e7988..3061964a7a9 100644 --- a/contrib/python/Pygments/py3/pygments/lexer.py +++ b/contrib/python/Pygments/py3/pygments/lexer.py @@ -4,7 +4,7 @@ Base lexer classes. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -67,10 +67,12 @@ class Lexer(metaclass=LexerMeta): :no-value: .. autoattribute:: priority - Lexers included in Pygments should have an additional attribute: + Lexers included in Pygments should have two additional attributes: .. autoattribute:: url :no-value: + .. autoattribute:: version_added + :no-value: Lexers included in Pygments may have additional attributes: @@ -130,9 +132,12 @@ class Lexer(metaclass=LexerMeta): priority = 0 #: URL of the language specification/definition. Used in the Pygments - #: documentation. + #: documentation. Set to an empty string to disable. url = None + #: Version of Pygments in which the lexer was added. + version_added = None + #: Example file name. Relative to the ``tests/examplefiles`` directory. #: This is used by the documentation generator to show an example. _example = None @@ -169,10 +174,9 @@ class Lexer(metaclass=LexerMeta): def __repr__(self): if self.options: - return '' % (self.__class__.__name__, - self.options) + return f'' else: - return '' % self.__class__.__name__ + return f'' def add_filter(self, filter_, **options): """ @@ -506,7 +510,7 @@ class RegexLexerMeta(LexerMeta): def _process_token(cls, token): """Preprocess the token component of a token definition.""" assert type(token) is _TokenType or callable(token), \ - 'token type must be simple type or callable, not %r' % (token,) + f'token type must be simple type or callable, not {token!r}' return token def _process_new_state(cls, new_state, unprocessed, processed): @@ -522,14 +526,14 @@ class RegexLexerMeta(LexerMeta): elif new_state[:5] == '#pop:': return -int(new_state[5:]) else: - assert False, 'unknown new state %r' % new_state + assert False, f'unknown new state {new_state!r}' elif isinstance(new_state, combined): # combine a new state from existing ones tmp_state = '_tmp_%d' % cls._tmpname cls._tmpname += 1 itokens = [] for istate in new_state: - assert istate != new_state, 'circular state ref %r' % istate + assert istate != new_state, f'circular state ref {istate!r}' itokens.extend(cls._process_state(unprocessed, processed, istate)) processed[tmp_state] = itokens @@ -542,12 +546,12 @@ class RegexLexerMeta(LexerMeta): 'unknown new state ' + istate return new_state else: - assert False, 'unknown new state def %r' % new_state + assert False, f'unknown new state def {new_state!r}' def _process_state(cls, unprocessed, processed, state): """Preprocess a single state definition.""" - assert type(state) is str, "wrong state name %r" % state - assert state[0] != '#', "invalid state name %r" % state + assert isinstance(state, str), f"wrong state name {state!r}" + assert state[0] != '#', f"invalid state name {state!r}" if state in processed: return processed[state] tokens = processed[state] = [] @@ -555,7 +559,7 @@ class RegexLexerMeta(LexerMeta): for tdef in unprocessed[state]: if isinstance(tdef, include): # it's a state reference - assert tdef != state, "circular state reference %r" % state + assert tdef != state, f"circular state reference {state!r}" tokens.extend(cls._process_state(unprocessed, processed, str(tdef))) continue @@ -569,13 +573,12 @@ class RegexLexerMeta(LexerMeta): tokens.append((re.compile('').match, None, new_state)) continue - assert type(tdef) is tuple, "wrong rule def %r" % tdef + assert type(tdef) is tuple, f"wrong rule def {tdef!r}" try: rex = cls._process_regex(tdef[0], rflags, state) except Exception as err: - raise ValueError("uncompilable regex %r in state %r of %r: %s" % - (tdef[0], state, cls, err)) from err + raise ValueError(f"uncompilable regex {tdef[0]!r} in state {state!r} of {cls!r}: {err}") from err token = cls._process_token(tdef[1]) @@ -736,7 +739,7 @@ class RegexLexer(Lexer, metaclass=RegexLexerMeta): elif new_state == '#push': statestack.append(statestack[-1]) else: - assert False, "wrong state def: %r" % new_state + assert False, f"wrong state def: {new_state!r}" statetokens = tokendefs[statestack[-1]] break else: @@ -768,8 +771,7 @@ class LexerContext: self.stack = stack or ['root'] def __repr__(self): - return 'LexerContext(%r, %r, %r)' % ( - self.text, self.pos, self.stack) + return f'LexerContext({self.text!r}, {self.pos!r}, {self.stack!r})' class ExtendedRegexLexer(RegexLexer): @@ -824,7 +826,7 @@ class ExtendedRegexLexer(RegexLexer): elif new_state == '#push': ctx.stack.append(ctx.stack[-1]) else: - assert False, "wrong state def: %r" % new_state + assert False, f"wrong state def: {new_state!r}" statetokens = tokendefs[ctx.stack[-1]] break else: diff --git a/contrib/python/Pygments/py3/pygments/lexers/__init__.py b/contrib/python/Pygments/py3/pygments/lexers/__init__.py index 5701be7b6c6..a2eaf71f22b 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/__init__.py +++ b/contrib/python/Pygments/py3/pygments/lexers/__init__.py @@ -4,7 +4,7 @@ Pygments lexers. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -93,7 +93,7 @@ def find_lexer_class_by_name(_alias): .. versionadded:: 2.2 """ if not _alias: - raise ClassNotFound('no lexer for alias %r found' % _alias) + raise ClassNotFound(f'no lexer for alias {_alias!r} found') # lookup builtin lexers for module_name, name, aliases, _, _ in LEXERS.values(): if _alias.lower() in aliases: @@ -104,7 +104,7 @@ def find_lexer_class_by_name(_alias): for cls in find_plugin_lexers(): if _alias.lower() in cls.aliases: return cls - raise ClassNotFound('no lexer for alias %r found' % _alias) + raise ClassNotFound(f'no lexer for alias {_alias!r} found') def get_lexer_by_name(_alias, **options): @@ -117,7 +117,7 @@ def get_lexer_by_name(_alias, **options): found. """ if not _alias: - raise ClassNotFound('no lexer for alias %r found' % _alias) + raise ClassNotFound(f'no lexer for alias {_alias!r} found') # lookup builtin lexers for module_name, name, aliases, _, _ in LEXERS.values(): @@ -129,7 +129,7 @@ def get_lexer_by_name(_alias, **options): for cls in find_plugin_lexers(): if _alias.lower() in cls.aliases: return cls(**options) - raise ClassNotFound('no lexer for alias %r found' % _alias) + raise ClassNotFound(f'no lexer for alias {_alias!r} found') def load_lexer_from_file(filename, lexername="CustomLexer", **options): @@ -154,17 +154,16 @@ def load_lexer_from_file(filename, lexername="CustomLexer", **options): exec(f.read(), custom_namespace) # Retrieve the class `lexername` from that namespace if lexername not in custom_namespace: - raise ClassNotFound('no valid %s class found in %s' % - (lexername, filename)) + raise ClassNotFound(f'no valid {lexername} class found in {filename}') lexer_class = custom_namespace[lexername] # And finally instantiate it with the options return lexer_class(**options) except OSError as err: - raise ClassNotFound('cannot read %s: %s' % (filename, err)) + raise ClassNotFound(f'cannot read {filename}: {err}') except ClassNotFound: raise except Exception as err: - raise ClassNotFound('error when loading custom lexer: %s' % err) + raise ClassNotFound(f'error when loading custom lexer: {err}') def find_lexer_class_for_filename(_fn, code=None): @@ -225,7 +224,7 @@ def get_lexer_for_filename(_fn, code=None, **options): """ res = find_lexer_class_for_filename(_fn, code) if not res: - raise ClassNotFound('no lexer for filename %r found' % _fn) + raise ClassNotFound(f'no lexer for filename {_fn!r} found') return res(**options) @@ -245,7 +244,7 @@ def get_lexer_for_mimetype(_mime, **options): for cls in find_plugin_lexers(): if _mime in cls.mimetypes: return cls(**options) - raise ClassNotFound('no lexer for mimetype %r found' % _mime) + raise ClassNotFound(f'no lexer for mimetype {_mime!r} found') def _iter_lexerclasses(plugins=True): @@ -280,7 +279,7 @@ def guess_lexer_for_filename(_fn, _text, **options): matching_lexers.add(lexer) primary[lexer] = False if not matching_lexers: - raise ClassNotFound('no lexer for filename %r found' % fn) + raise ClassNotFound(f'no lexer for filename {fn!r} found') if len(matching_lexers) == 1: return matching_lexers.pop()(**options) result = [] diff --git a/contrib/python/Pygments/py3/pygments/lexers/_ada_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_ada_builtins.py index 24f9b197b02..6b6a7c556f6 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_ada_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_ada_builtins.py @@ -4,7 +4,7 @@ Ada builtins. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_asy_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_asy_builtins.py index c4a362ca6d6..be73baf2d07 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_asy_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_asy_builtins.py @@ -9,7 +9,7 @@ TODO: perl/python script in Asymptote SVN similar to asy-list.pl but only for function and variable names. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_cl_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_cl_builtins.py index beb7b4d6f10..1e02451caac 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_cl_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_cl_builtins.py @@ -4,7 +4,7 @@ ANSI Common Lisp builtins. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_cocoa_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_cocoa_builtins.py index 4b7dc1ad409..f45b85a287a 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_cocoa_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_cocoa_builtins.py @@ -7,7 +7,7 @@ File may be also used as standalone generator for above. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -41,7 +41,7 @@ if __name__ == '__main__': # pragma: no cover with open(headerFilePath, encoding='utf-8') as f: content = f.read() except UnicodeDecodeError: - print("Decoding error for file: {0}".format(headerFilePath)) + print(f"Decoding error for file: {headerFilePath}") continue res = re.findall(r'(?<=@interface )\w+', content) diff --git a/contrib/python/Pygments/py3/pygments/lexers/_csound_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_csound_builtins.py index 5f373068432..e1ea1a015c9 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_csound_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_csound_builtins.py @@ -2,7 +2,7 @@ pygments.lexers._csound_builtins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_css_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_css_builtins.py index fff992425ce..60fa564b4a3 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_css_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_css_builtins.py @@ -4,7 +4,7 @@ This file is autogenerated by scripts/get_css_properties.py - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_julia_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_julia_builtins.py index 5d3c96fb8f7..c73a2e0ec89 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_julia_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_julia_builtins.py @@ -4,7 +4,7 @@ Julia builtins. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_lasso_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_lasso_builtins.py index 1fbe681931e..f4d417e67b0 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_lasso_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_lasso_builtins.py @@ -4,7 +4,7 @@ Built-in Lasso types, traits, methods, and members. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_lilypond_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_lilypond_builtins.py index 013c85ca322..948c7625ad0 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_lilypond_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_lilypond_builtins.py @@ -4,7 +4,7 @@ LilyPond builtins. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_lua_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_lua_builtins.py index 8170d5e8256..b46fe4f021a 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_lua_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_lua_builtins.py @@ -10,7 +10,7 @@ Run with `python -I` to regenerate. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -230,7 +230,7 @@ if __name__ == '__main__': # pragma: no cover return m.groups()[0] def get_lua_functions(version): - f = urlopen('http://www.lua.org/manual/%s/' % version) + f = urlopen(f'http://www.lua.org/manual/{version}/') r = re.compile(r'^\1') functions = [] for line in f: @@ -258,14 +258,14 @@ if __name__ == '__main__': # pragma: no cover with open(filename, 'w', encoding='utf-8') as fp: fp.write(header) - fp.write('MODULES = %s\n\n' % pprint.pformat(modules)) + fp.write(f'MODULES = {pprint.pformat(modules)}\n\n') fp.write(footer) def run(): version = get_newest_version() functions = set() for v in ('5.2', version): - print('> Downloading function index for Lua %s' % v) + print(f'> Downloading function index for Lua {v}') f = get_lua_functions(v) print('> %d functions found, %d new:' % (len(f), len(set(f) - functions))) @@ -275,7 +275,7 @@ if __name__ == '__main__': # pragma: no cover modules = {} for full_function_name in functions: - print('>> %s' % full_function_name) + print(f'>> {full_function_name}') m = get_function_module(full_function_name) modules.setdefault(m, []).append(full_function_name) modules = {k: tuple(v) for k, v in modules.items()} diff --git a/contrib/python/Pygments/py3/pygments/lexers/_luau_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_luau_builtins.py new file mode 100644 index 00000000000..3b7dd152019 --- /dev/null +++ b/contrib/python/Pygments/py3/pygments/lexers/_luau_builtins.py @@ -0,0 +1,62 @@ +""" + pygments.lexers._luau_builtins + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Includes the builtins for Luau and Roblox. + + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +LUAU_BUILTINS = { + 'bit32', + 'buffer', + 'coroutine', + 'debug', + 'math', + 'os', + 'string', + 'table', + 'utf8', +} + +ROBLOX_BUILTINS = { + 'task', + + 'Axes', + 'BrickColor', + 'CatalogSearchParams', + 'CFrame', + 'Color3', + 'ColorSequence', + 'ColorSequenceKeypoint', + 'DateTime', + 'DockWidgetPluginGuiInfo', + 'Faces', + 'FloatCurveKey', + 'Font', + 'Instance', + 'NumberRange', + 'NumberSequence', + 'NumberSequenceKeypoint', + 'OverlapParams', + 'PathWaypoint', + 'PhysicalProperties', + 'Random', + 'Ray', + 'RaycastParams', + 'RaycastResult', + 'RBXScriptConnection', + 'RBXScriptSignal', + 'Rect', + 'Region3', + 'Region3int16', + 'SharedTable', + 'TweenInfo', + 'UDim', + 'UDim2', + 'Vector2', + 'Vector2int16', + 'Vector3', + 'Vector3int16', +} \ No newline at end of file diff --git a/contrib/python/Pygments/py3/pygments/lexers/_mapping.py b/contrib/python/Pygments/py3/pygments/lexers/_mapping.py index aaec80232ae..0a62565d503 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_mapping.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_mapping.py @@ -46,7 +46,7 @@ LEXERS = { 'BSTLexer': ('pygments.lexers.bibtex', 'BST', ('bst', 'bst-pybtex'), ('*.bst',), ()), 'BareLexer': ('pygments.lexers.bare', 'BARE', ('bare',), ('*.bare',), ()), 'BaseMakefileLexer': ('pygments.lexers.make', 'Base Makefile', ('basemake',), (), ()), - 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh', 'zsh', 'shell'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '*.exheres-0', '*.exlib', '*.zsh', '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'zshrc', '.zshrc', '.kshrc', 'kshrc', 'PKGBUILD'), ('application/x-sh', 'application/x-shellscript', 'text/x-shellscript')), + 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh', 'zsh', 'shell', 'openrc'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '*.exheres-0', '*.exlib', '*.zsh', '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'zshrc', '.zshrc', '.kshrc', 'kshrc', 'PKGBUILD'), ('application/x-sh', 'application/x-shellscript', 'text/x-shellscript')), 'BashSessionLexer': ('pygments.lexers.shell', 'Bash Session', ('console', 'shell-session'), ('*.sh-session', '*.shell-session'), ('application/x-shell-session', 'application/x-sh-session')), 'BatchLexer': ('pygments.lexers.shell', 'Batchfile', ('batch', 'bat', 'dosbatch', 'winbatch'), ('*.bat', '*.cmd'), ('application/x-dos-batch',)), 'BddLexer': ('pygments.lexers.bdd', 'Bdd', ('bdd',), ('*.feature',), ('text/x-bdd',)), @@ -128,7 +128,7 @@ LEXERS = { 'DaxLexer': ('pygments.lexers.dax', 'Dax', ('dax',), ('*.dax',), ()), 'DebianControlLexer': ('pygments.lexers.installers', 'Debian Control file', ('debcontrol', 'control'), ('control',), ()), 'DelphiLexer': ('pygments.lexers.pascal', 'Delphi', ('delphi', 'pas', 'pascal', 'objectpascal'), ('*.pas', '*.dpr'), ('text/x-pascal',)), - 'DesktopLexer': ('pygments.lexers.configs', 'Desktop file', ('desktop',), ('*.desktop',), ()), + 'DesktopLexer': ('pygments.lexers.configs', 'Desktop file', ('desktop',), ('*.desktop',), ('application/x-desktop',)), 'DevicetreeLexer': ('pygments.lexers.devicetree', 'Devicetree', ('devicetree', 'dts'), ('*.dts', '*.dtsi'), ('text/x-c',)), 'DgLexer': ('pygments.lexers.python', 'dg', ('dg',), ('*.dg',), ('text/x-dg',)), 'DiffLexer': ('pygments.lexers.diff', 'Diff', ('diff', 'udiff'), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch')), @@ -216,8 +216,8 @@ LEXERS = { 'HtmlSmartyLexer': ('pygments.lexers.templates', 'HTML+Smarty', ('html+smarty',), (), ('text/html+smarty',)), 'HttpLexer': ('pygments.lexers.textfmts', 'HTTP', ('http',), (), ()), 'HxmlLexer': ('pygments.lexers.haxe', 'Hxml', ('haxeml', 'hxml'), ('*.hxml',), ()), - 'HyLexer': ('pygments.lexers.lisp', 'Hy', ('hylang',), ('*.hy',), ('text/x-hy', 'application/x-hy')), - 'HybrisLexer': ('pygments.lexers.scripting', 'Hybris', ('hybris', 'hy'), ('*.hy', '*.hyb'), ('text/x-hybris', 'application/x-hybris')), + 'HyLexer': ('pygments.lexers.lisp', 'Hy', ('hylang', 'hy'), ('*.hy',), ('text/x-hy', 'application/x-hy')), + 'HybrisLexer': ('pygments.lexers.scripting', 'Hybris', ('hybris',), ('*.hyb',), ('text/x-hybris', 'application/x-hybris')), 'IDLLexer': ('pygments.lexers.idl', 'IDL', ('idl',), ('*.pro',), ('text/idl',)), 'IconLexer': ('pygments.lexers.unicon', 'Icon', ('icon',), ('*.icon', '*.ICON'), ()), 'IdrisLexer': ('pygments.lexers.haskell', 'Idris', ('idris', 'idr'), ('*.idr',), ('text/x-idris',)), @@ -234,6 +234,7 @@ LEXERS = { 'JMESPathLexer': ('pygments.lexers.jmespath', 'JMESPath', ('jmespath', 'jp'), ('*.jp',), ()), 'JSLTLexer': ('pygments.lexers.jslt', 'JSLT', ('jslt',), ('*.jslt',), ('text/x-jslt',)), 'JagsLexer': ('pygments.lexers.modeling', 'JAGS', ('jags',), ('*.jag', '*.bug'), ()), + 'JanetLexer': ('pygments.lexers.lisp', 'Janet', ('janet',), ('*.janet', '*.jdn'), ('text/x-janet', 'application/x-janet')), 'JasminLexer': ('pygments.lexers.jvm', 'Jasmin', ('jasmin', 'jasminxt'), ('*.j',), ()), 'JavaLexer': ('pygments.lexers.jvm', 'Java', ('java',), ('*.java',), ('text/x-java',)), 'JavascriptDjangoLexer': ('pygments.lexers.templates', 'JavaScript+Django/Jinja', ('javascript+django', 'js+django', 'javascript+jinja', 'js+jinja'), ('*.js.j2', '*.js.jinja2'), ('application/x-javascript+django', 'application/x-javascript+jinja', 'text/x-javascript+django', 'text/x-javascript+jinja', 'text/javascript+django', 'text/javascript+jinja')), @@ -271,6 +272,7 @@ LEXERS = { 'LdaprcLexer': ('pygments.lexers.ldap', 'LDAP configuration file', ('ldapconf', 'ldaprc'), ('.ldaprc', 'ldaprc', 'ldap.conf'), ('text/x-ldapconf',)), 'LdifLexer': ('pygments.lexers.ldap', 'LDIF', ('ldif',), ('*.ldif',), ('text/x-ldif',)), 'Lean3Lexer': ('pygments.lexers.lean', 'Lean', ('lean', 'lean3'), ('*.lean',), ('text/x-lean', 'text/x-lean3')), + 'Lean4Lexer': ('pygments.lexers.lean', 'Lean4', ('lean4',), ('*.lean',), ('text/x-lean4',)), 'LessCssLexer': ('pygments.lexers.css', 'LessCss', ('less',), ('*.less',), ('text/x-less-css',)), 'LighttpdConfLexer': ('pygments.lexers.configs', 'Lighttpd configuration file', ('lighttpd', 'lighty'), ('lighttpd.conf',), ('text/x-lighttpd-conf',)), 'LilyPondLexer': ('pygments.lexers.lilypond', 'LilyPond', ('lilypond',), ('*.ly',), ()), @@ -287,6 +289,7 @@ LEXERS = { 'LogosLexer': ('pygments.lexers.objective', 'Logos', ('logos',), ('*.x', '*.xi', '*.xm', '*.xmi'), ('text/x-logos',)), 'LogtalkLexer': ('pygments.lexers.prolog', 'Logtalk', ('logtalk',), ('*.lgt', '*.logtalk'), ('text/x-logtalk',)), 'LuaLexer': ('pygments.lexers.scripting', 'Lua', ('lua',), ('*.lua', '*.wlua'), ('text/x-lua', 'application/x-lua')), + 'LuauLexer': ('pygments.lexers.scripting', 'Luau', ('luau',), ('*.luau',), ()), 'MCFunctionLexer': ('pygments.lexers.minecraft', 'MCFunction', ('mcfunction', 'mcf'), ('*.mcfunction',), ('text/mcfunction',)), 'MCSchemaLexer': ('pygments.lexers.minecraft', 'MCSchema', ('mcschema',), ('*.mcschema',), ('text/mcschema',)), 'MIMELexer': ('pygments.lexers.mime', 'MIME', ('mime',), (), ('multipart/mixed', 'multipart/related', 'multipart/alternative')), @@ -314,6 +317,7 @@ LEXERS = { 'ModelicaLexer': ('pygments.lexers.modeling', 'Modelica', ('modelica',), ('*.mo',), ('text/x-modelica',)), 'Modula2Lexer': ('pygments.lexers.modula2', 'Modula-2', ('modula2', 'm2'), ('*.def', '*.mod'), ('text/x-modula2',)), 'MoinWikiLexer': ('pygments.lexers.markup', 'MoinMoin/Trac Wiki markup', ('trac-wiki', 'moin'), (), ('text/x-trac-wiki',)), + 'MojoLexer': ('pygments.lexers.mojo', 'Mojo', ('mojo', '🔥'), ('*.mojo', '*.🔥'), ('text/x-mojo', 'application/x-mojo')), 'MonkeyLexer': ('pygments.lexers.basic', 'Monkey', ('monkey',), ('*.monkey',), ('text/x-monkey',)), 'MonteLexer': ('pygments.lexers.monte', 'Monte', ('monte',), ('*.mt',), ()), 'MoonScriptLexer': ('pygments.lexers.scripting', 'MoonScript', ('moonscript', 'moon'), ('*.moon',), ('text/x-moonscript', 'application/x-moonscript')), @@ -362,6 +366,7 @@ LEXERS = { 'OpaLexer': ('pygments.lexers.ml', 'Opa', ('opa',), ('*.opa',), ('text/x-opa',)), 'OpenEdgeLexer': ('pygments.lexers.business', 'OpenEdge ABL', ('openedge', 'abl', 'progress'), ('*.p', '*.cls'), ('text/x-openedge', 'application/x-openedge')), 'OpenScadLexer': ('pygments.lexers.openscad', 'OpenSCAD', ('openscad',), ('*.scad',), ('application/x-openscad',)), + 'OrgLexer': ('pygments.lexers.markup', 'Org Mode', ('org', 'orgmode', 'org-mode'), ('*.org',), ('text/org',)), 'OutputLexer': ('pygments.lexers.special', 'Text output', ('output',), (), ()), 'PacmanConfLexer': ('pygments.lexers.configs', 'PacmanConf', ('pacmanconf',), ('pacman.conf',), ()), 'PanLexer': ('pygments.lexers.dsls', 'Pan', ('pan',), ('*.pan',), ()), @@ -390,6 +395,7 @@ LEXERS = { 'ProcfileLexer': ('pygments.lexers.procfile', 'Procfile', ('procfile',), ('Procfile',), ()), 'PrologLexer': ('pygments.lexers.prolog', 'Prolog', ('prolog',), ('*.ecl', '*.prolog', '*.pro', '*.pl'), ('text/x-prolog',)), 'PromQLLexer': ('pygments.lexers.promql', 'PromQL', ('promql',), ('*.promql',), ()), + 'PromelaLexer': ('pygments.lexers.c_like', 'Promela', ('promela',), ('*.pml', '*.prom', '*.prm', '*.promela', '*.pr', '*.pm'), ('text/x-promela',)), 'PropertiesLexer': ('pygments.lexers.configs', 'Properties', ('properties', 'jproperties'), ('*.properties',), ('text/x-java-properties',)), 'ProtoBufLexer': ('pygments.lexers.dsls', 'Protocol Buffer', ('protobuf', 'proto'), ('*.proto',), ()), 'PrqlLexer': ('pygments.lexers.prql', 'PRQL', ('prql',), ('*.prql',), ('application/prql', 'application/x-prql')), @@ -400,7 +406,7 @@ LEXERS = { 'PyPyLogLexer': ('pygments.lexers.console', 'PyPy Log', ('pypylog', 'pypy'), ('*.pypylog',), ('application/x-pypylog',)), 'Python2Lexer': ('pygments.lexers.python', 'Python 2.x', ('python2', 'py2'), (), ('text/x-python2', 'application/x-python2')), 'Python2TracebackLexer': ('pygments.lexers.python', 'Python 2.x Traceback', ('py2tb',), ('*.py2tb',), ('text/x-python2-traceback',)), - 'PythonConsoleLexer': ('pygments.lexers.python', 'Python console session', ('pycon',), (), ('text/x-python-doctest',)), + 'PythonConsoleLexer': ('pygments.lexers.python', 'Python console session', ('pycon', 'python-console'), (), ('text/x-python-doctest',)), 'PythonLexer': ('pygments.lexers.python', 'Python', ('python', 'py', 'sage', 'python3', 'py3', 'bazel', 'starlark'), ('*.py', '*.pyw', '*.pyi', '*.jy', '*.sage', '*.sc', 'SConstruct', 'SConscript', '*.bzl', 'BUCK', 'BUILD', 'BUILD.bazel', 'WORKSPACE', '*.tac'), ('text/x-python', 'application/x-python', 'text/x-python3', 'application/x-python3')), 'PythonTracebackLexer': ('pygments.lexers.python', 'Python Traceback', ('pytb', 'py3tb'), ('*.pytb', '*.py3tb'), ('text/x-python-traceback', 'text/x-python3-traceback')), 'PythonUL4Lexer': ('pygments.lexers.ul4', 'Python+UL4', ('py+ul4',), ('*.pyul4',), ()), @@ -473,6 +479,7 @@ LEXERS = { 'SnobolLexer': ('pygments.lexers.snobol', 'Snobol', ('snobol',), ('*.snobol',), ('text/x-snobol',)), 'SnowballLexer': ('pygments.lexers.dsls', 'Snowball', ('snowball',), ('*.sbl',), ()), 'SolidityLexer': ('pygments.lexers.solidity', 'Solidity', ('solidity',), ('*.sol',), ()), + 'SoongLexer': ('pygments.lexers.soong', 'Soong', ('androidbp', 'bp', 'soong'), ('Android.bp',), ()), 'SophiaLexer': ('pygments.lexers.sophia', 'Sophia', ('sophia',), ('*.aes',), ()), 'SourcePawnLexer': ('pygments.lexers.pawn', 'SourcePawn', ('sp',), ('*.sp',), ('text/x-sourcepawn',)), 'SourcesListLexer': ('pygments.lexers.installers', 'Debian Sourcelist', ('debsources', 'sourceslist', 'sources.list'), ('sources.list',), ()), @@ -494,6 +501,7 @@ LEXERS = { 'TAPLexer': ('pygments.lexers.testing', 'TAP', ('tap',), ('*.tap',), ()), 'TNTLexer': ('pygments.lexers.tnt', 'Typographic Number Theory', ('tnt',), ('*.tnt',), ()), 'TOMLLexer': ('pygments.lexers.configs', 'TOML', ('toml',), ('*.toml', 'Pipfile', 'poetry.lock'), ('application/toml',)), + 'TactLexer': ('pygments.lexers.tact', 'Tact', ('tact',), ('*.tact',), ()), 'Tads3Lexer': ('pygments.lexers.int_fiction', 'TADS 3', ('tads3',), ('*.t',), ()), 'TalLexer': ('pygments.lexers.tal', 'Tal', ('tal', 'uxntal'), ('*.tal',), ('text/x-uxntal',)), 'TasmLexer': ('pygments.lexers.asm', 'TASM', ('tasm',), ('*.asm', '*.ASM', '*.tasm'), ('text/x-tasm',)), @@ -523,6 +531,7 @@ LEXERS = { 'TypoScriptCssDataLexer': ('pygments.lexers.typoscript', 'TypoScriptCssData', ('typoscriptcssdata',), (), ()), 'TypoScriptHtmlDataLexer': ('pygments.lexers.typoscript', 'TypoScriptHtmlData', ('typoscripthtmldata',), (), ()), 'TypoScriptLexer': ('pygments.lexers.typoscript', 'TypoScript', ('typoscript',), ('*.typoscript',), ('text/x-typoscript',)), + 'TypstLexer': ('pygments.lexers.typst', 'Typst', ('typst',), ('*.typ',), ('text/x-typst',)), 'UL4Lexer': ('pygments.lexers.ul4', 'UL4', ('ul4',), ('*.ul4',), ()), 'UcodeLexer': ('pygments.lexers.unicon', 'ucode', ('ucode',), ('*.u', '*.u1', '*.u2'), ()), 'UniconLexer': ('pygments.lexers.unicon', 'Unicon', ('unicon',), ('*.icn',), ('text/unicon',)), @@ -537,7 +546,7 @@ LEXERS = { 'VGLLexer': ('pygments.lexers.dsls', 'VGL', ('vgl',), ('*.rpf',), ()), 'ValaLexer': ('pygments.lexers.c_like', 'Vala', ('vala', 'vapi'), ('*.vala', '*.vapi'), ('text/x-vala',)), 'VbNetAspxLexer': ('pygments.lexers.dotnet', 'aspx-vb', ('aspx-vb',), ('*.aspx', '*.asax', '*.ascx', '*.ashx', '*.asmx', '*.axd'), ()), - 'VbNetLexer': ('pygments.lexers.dotnet', 'VB.net', ('vb.net', 'vbnet', 'lobas', 'oobas', 'sobas'), ('*.vb', '*.bas'), ('text/x-vbnet', 'text/x-vba')), + 'VbNetLexer': ('pygments.lexers.dotnet', 'VB.net', ('vb.net', 'vbnet', 'lobas', 'oobas', 'sobas', 'visual-basic', 'visualbasic'), ('*.vb', '*.bas'), ('text/x-vbnet', 'text/x-vba')), 'VelocityHtmlLexer': ('pygments.lexers.templates', 'HTML+Velocity', ('html+velocity',), (), ('text/html+velocity',)), 'VelocityLexer': ('pygments.lexers.templates', 'Velocity', ('velocity',), ('*.vm', '*.fhtml'), ()), 'VelocityXmlLexer': ('pygments.lexers.templates', 'XML+Velocity', ('xml+velocity',), (), ('application/xml+velocity',)), diff --git a/contrib/python/Pygments/py3/pygments/lexers/_mql_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_mql_builtins.py index 3b89f1db7d5..ca5bfe45a0a 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_mql_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_mql_builtins.py @@ -4,7 +4,7 @@ Builtins for the MqlLexer. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ types = ( diff --git a/contrib/python/Pygments/py3/pygments/lexers/_mysql_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_mysql_builtins.py index d25ed9c7c0b..95bbe173925 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_mysql_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_mysql_builtins.py @@ -6,7 +6,7 @@ Run with `python -I` to update. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -1321,10 +1321,10 @@ if __name__ == '__main__': # pragma: no cover data = f.read() # Line to start/end inserting - re_match = re.compile(r'^%s\s*=\s*\($.*?^\s*\)$' % field_name, re.M | re.S) + re_match = re.compile(rf'^{field_name}\s*=\s*\($.*?^\s*\)$', re.M | re.S) m = re_match.search(data) if not m: - raise ValueError('Could not find an existing definition for %s' % field_name) + raise ValueError(f'Could not find an existing definition for {field_name}') new_block = format_lines(field_name, content) data = data[:m.start()] + new_block + data[m.end():] diff --git a/contrib/python/Pygments/py3/pygments/lexers/_openedge_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_openedge_builtins.py index 7fdfb410491..c5e9c347413 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_openedge_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_openedge_builtins.py @@ -4,7 +4,7 @@ Builtin list for the OpenEdgeLexer. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_php_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_php_builtins.py index 5366e75116f..a1f0232a1a8 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_php_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_php_builtins.py @@ -7,7 +7,7 @@ Run with `python -I` to regenerate. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -3299,7 +3299,7 @@ if __name__ == '__main__': # pragma: no cover download = urlretrieve(PHP_MANUAL_URL) with tarfile.open(download[0]) as tar: tar.extractall() - yield from glob.glob("%s%s" % (PHP_MANUAL_DIR, PHP_REFERENCE_GLOB)) + yield from glob.glob(f"{PHP_MANUAL_DIR}{PHP_REFERENCE_GLOB}") os.remove(download[0]) def regenerate(filename, modules): @@ -3311,7 +3311,7 @@ if __name__ == '__main__': # pragma: no cover with open(filename, 'w', encoding='utf-8') as fp: fp.write(header) - fp.write('MODULES = %s\n\n' % pprint.pformat(modules)) + fp.write(f'MODULES = {pprint.pformat(modules)}\n\n') fp.write(footer) def run(): diff --git a/contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py index ecc2a7eef13..f29235598a9 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_postgres_builtins.py @@ -6,7 +6,7 @@ Run with `python -I` to update itself. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -683,7 +683,8 @@ if __name__ == '__main__': # pragma: no cover for t in tmp.split(']') if "(" not in t]: for t in tmp.split(','): t = t.strip() - if not t: continue + if not t: + continue dt.add(" ".join(t.split())) dt = list(dt) @@ -724,11 +725,10 @@ if __name__ == '__main__': # pragma: no cover data = f.read() # Line to start/end inserting - re_match = re.compile(r'^%s\s*=\s*\($.*?^\s*\)$' % constname, re.M | re.S) + re_match = re.compile(rf'^{constname}\s*=\s*\($.*?^\s*\)$', re.M | re.S) m = re_match.search(data) if not m: - raise ValueError('Could not find existing definition for %s' % - (constname,)) + raise ValueError(f'Could not find existing definition for {constname}') new_block = format_lines(constname, content) data = data[:m.start()] + new_block + data[m.end():] diff --git a/contrib/python/Pygments/py3/pygments/lexers/_qlik_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_qlik_builtins.py index 697c12462bb..f3af5230f23 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_qlik_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_qlik_builtins.py @@ -4,7 +4,7 @@ Qlik builtins. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_scheme_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_scheme_builtins.py index 8f2de9dbab8..d93b9fd3bb2 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_scheme_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_scheme_builtins.py @@ -4,7 +4,7 @@ Scheme builtins. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_scilab_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_scilab_builtins.py index f2adba858f5..c4992938dbd 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_scilab_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_scilab_builtins.py @@ -4,7 +4,7 @@ Builtin list for the ScilabLexer. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -3060,10 +3060,10 @@ if __name__ == '__main__': # pragma: no cover def extract_completion(var_type): s = subprocess.Popen(['scilab', '-nwni'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - output = s.communicate('''\ + output = s.communicate(f'''\ fd = mopen("/dev/stderr", "wt"); -mputl(strcat(completion("", "%s"), "||"), fd); -mclose(fd)\n''' % var_type) +mputl(strcat(completion("", "{var_type}"), "||"), fd); +mclose(fd)\n''') if '||' not in output[1]: raise Exception(output[0]) # Invalid DISPLAY causes this to be output: diff --git a/contrib/python/Pygments/py3/pygments/lexers/_sourcemod_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_sourcemod_builtins.py index 02d3e779dd9..613ce708447 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_sourcemod_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_sourcemod_builtins.py @@ -8,7 +8,7 @@ Run with `python -I` to regenerate. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -1136,13 +1136,13 @@ if __name__ == '__main__': # pragma: no cover def run(): version = get_version() - print('> Downloading function index for SourceMod %s' % version) + print(f'> Downloading function index for SourceMod {version}') functions = get_sm_functions() print('> %d functions found:' % len(functions)) functionlist = [] for full_function_name in functions: - print('>> %s' % full_function_name) + print(f'>> {full_function_name}') functionlist.append(full_function_name) regenerate(__file__, functionlist) diff --git a/contrib/python/Pygments/py3/pygments/lexers/_stan_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_stan_builtins.py index 23f7fa60325..afe31437062 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_stan_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_stan_builtins.py @@ -5,7 +5,7 @@ This file contains the names of functions for Stan used by ``pygments.lexers.math.StanLexer. This is for Stan language version 2.29.0. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_stata_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_stata_builtins.py index 16251cff242..c806f50be1f 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_stata_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_stata_builtins.py @@ -4,7 +4,7 @@ Builtins for Stata - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_tsql_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_tsql_builtins.py index 96b16bf4a4e..1fc792bb8fb 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_tsql_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_tsql_builtins.py @@ -4,7 +4,7 @@ These are manually translated lists from https://msdn.microsoft.com. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_usd_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_usd_builtins.py index d891ad03d8f..ff83574afcf 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_usd_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_usd_builtins.py @@ -4,7 +4,7 @@ A collection of known USD-related keywords, attributes, and types. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_vbscript_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_vbscript_builtins.py index e7e96e69088..fba2218e28a 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_vbscript_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_vbscript_builtins.py @@ -5,7 +5,7 @@ These are manually translated lists from http://www.indusoft.com/pdf/VBScript%20Reference.pdf. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/_vim_builtins.py b/contrib/python/Pygments/py3/pygments/lexers/_vim_builtins.py index ccc8740f47a..e1171ebbcff 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/_vim_builtins.py +++ b/contrib/python/Pygments/py3/pygments/lexers/_vim_builtins.py @@ -4,7 +4,7 @@ This file is autogenerated by scripts/get_vimkw.py - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/contrib/python/Pygments/py3/pygments/lexers/actionscript.py b/contrib/python/Pygments/py3/pygments/lexers/actionscript.py index e0e94a52e42..a23a2087e16 100644 --- a/contrib/python/Pygments/py3/pygments/lexers/actionscript.py +++ b/contrib/python/Pygments/py3/pygments/lexers/actionscript.py @@ -4,7 +4,7 @@ Lexers for ActionScript and MXML. - :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -20,8 +20,6 @@ __all__ = ['ActionScriptLexer', 'ActionScript3Lexer', 'MxmlLexer'] class ActionScriptLexer(RegexLexer): """ For ActionScript source code. - - .. versionadded:: 0.9 """ name = 'ActionScript' @@ -29,6 +27,8 @@ class ActionScriptLexer(RegexLexer): filenames = ['*.as'] mimetypes = ['application/x-actionscript', 'text/x-actionscript', 'text/actionscript'] + url = 'https://en.wikipedia.org/wiki/ActionScript' + version_added = '0.9' flags = re.DOTALL tokens = { @@ -118,8 +118,6 @@ class ActionScriptLexer(RegexLexer): class ActionScript3Lexer(RegexLexer): """ For ActionScript 3 source code. - - .. versionadded:: 0.11 """ name = 'ActionScript 3' @@ -128,6 +126,7 @@ class ActionScript3Lexer(RegexLexer): filenames = ['*.as'] mimetypes = ['application/x-actionscript3', 'text/x-actionscript3', 'text/actionscript3'] + version_added = '0.11' identifier = r'[$a-zA-Z_]\w*' typeidentifier = identifier + r'(?:\.<\w+>)?' @@ -205,14 +204,13 @@ class MxmlLexer(RegexLexer): """ For MXML markup. Nested AS3 in