summaryrefslogtreecommitdiff
path: root/pygments
Commit message (Collapse)AuthorAgeFilesLines
* Fix various issues found by make check.Matthäus G. Chajdas2021-02-148-14/+21
|
* Add futhark lexer (#1691)Philip Munksgaard2021-02-142-0/+111
|
* Merge branch 'master' of https://github.com/pygments/pygmentsMatthäus G. Chajdas2021-02-1414-102/+2846
|\
| * RawToken{Formatter,Lexer}: support Python 3 and handle exceptions (#1602)Anders Kaseorg2021-02-142-24/+24
| | | | | | | | | | | | | | | | | | In Python 3, RawTokenFormatter would output non-ASCII for non-ASCII input, and RawTokenLexer would throw Unicode-related exceptions for ASCII or non-ASCII input; fix them. Also, handle all exceptions, so that callers who find RawTokenLexer via get_lexer_by_name on user input don’t unexpectedly get a lexer that throws exceptions. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
| * image formatter supports background color (#1374)Hector Medina2021-02-141-6/+21
| | | | | | | | | | | | | | | | | | Extend Image formatters in img.py to support background colors. * New function to get the background color for a given token type, optionally None * The self.drawables list used the fill keyword, stuffed into a **kwrgs, for the color of the token; since tokens can have foreground and background colors, that list now uses two explicit names, passing one to the PIL/Pillow text draw call, the other to the rectangle draw call. * When iterating over the `drawables` list, the presence of a background color triggers the drawing of a rectangle beneath the text. * Dimensions of background rectangle calculated by PIL based on the rendered text and font. * If input string is multiline, PIL will use multiline for draw and size internally.
| * Provide (all?) Matlab built-ins (#1705)Alex Povel2021-02-141-42/+2569
| | | | | | | | | | | | | | * Add (all?) Matlab built-ins See also https://de.mathworks.com/help/matlab/referencelist.html * Adjust pytest goldens
| * Add CDDL lexer (Fix #1239) (#1379)Thomas Duboucher2021-02-142-0/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add CDDL lexer (thanks to Fabian Neumann) * Add CDDL to mappings * Fix inline flag in CDDL regex * Update AUTHORS * Fix explosive backtracking * Comment invalid CDDL syntax for automated tests * Update following Georg Brandl's review * Update tests for CDDL to new framework * Pylint pass * Update links to CDDL RFC * Update copyright header * Solve regexlint issues in CDDL parser * Add link to CDDL in documentation
| * Fix/1698 lineos wrapping (#1701)Matthäus G. Chajdas2021-02-122-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix #1698. * Change default line number styling. Instead of hardcoding black/light gray, use transparent/inherit which makes it "neutral" out of the box. linenospecial is still hard-coded and may look wrong, but that needs fixing in the style. * Prettify the test files. * Fix incorrect wrapping of TD linenos. The padding would get applied twice to "special" lines, once via <pre>, once via the <span>, which was not consistent with inline line numbers where the .special style would override the default style. To fix this, we now emit "normal" and "special" lines for td.linenos line numbers, and the normal style is applied to "normal". This brings td.linenos closer to inline line numbers, and also makes the styling between noclasses=True and noclasses=False consistent. * Document the line number styling changes.
| * Fix CBM BASIC V2 analyze text logic (#1607)Carlos Henrique Guardão Gandarez2021-02-122-3/+3
| |
| * fix ecl analyze text logic (#1610)Carlos Henrique Guardão Gandarez2021-02-121-2/+2
| |
| * LaTeX: avoid uneven baselines in case highlighting uses \fcolorbox (#1708)Jean-François B2021-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this, the \strut causes the background color to apply to a full baseline height, then the framing done by \fcolorbox augments beyond that the box height and as a result the line where this happens will have extra distance from previous and next lines. Correct that by reducing the apparent box size by exactly the width of the frame (\fboxrule). Also, make the change to \fboxsep local. Reason: if texcomments is True, some arbitrary LaTeX mark-up can be executed in a later part and the setting of \fboxsep could modify output; macro \<cmdprefix>@bc is executed at top level, cf. \<cmdprefix>@do.
| * Fix eiffel regex performance (#1658)Dave Brondsema2021-02-121-1/+1
| |
| * LaTeX: keep scope of \fboxsep local (#1709)Jean-François B2021-02-121-2/+2
| | | | | | | | | | | | | | In case of texcomments=True or usage of escapeinside, arbitrary LaTeX can be executed. The \PY@bc is executed at top level hence should not set \fboxsep at this level but keep the change to a local scope. There is another instance but it is part of PR #1708
| * LaTeX: use \@namedef (refactoring) (#1710)Jean-François B2021-02-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | $ latexdef @namedef \@namedef: macro:#1->\expandafter \def \csname #1\endcsname And the @ character is usable here in macro names (the variable with name definition is authorized to contain for example \PY@it) This makes the output shorter. It makes for a neater sphinxhighlight.sty...
| * LaTeX: \catcode assignment should be terminated (#1711)Jean-François B2021-02-121-1/+2
| | | | | | | | | | | | | | | | This is almost irrelevant. But \catcode`\_=8 without termination might let LaTeX expand prematurely its token stream. Of course here in the context of fancyvrb.sty chances are 99.99% that what comes next does not expand or expands safely. I did not look in code. Only a matter of style, to be on the safe side.
| * Updated _cocoa_builtins.py with types from iOS 14.4 SDK (#1703)Filip Němeček2021-02-121-10/+15
| | | | | | | | | | * Updated _cocoa_builtins with types from iOS 14.4 SDK * Added continue to the except block
* | Merge branch 'issue-253-ruby-unicode' of ↵Matthäus G. Chajdas2021-02-141-3/+7
|\ \ | |/ |/| | | https://github.com/kurtmckee/pygments into kurtmckee-issue-253-ruby-unicode
| * Rely on the regex engine's `\u1234` escape supportKurt McKee2020-09-051-7/+7
| |
| * Standardize the entire multi-line string to use no `r` string prefixesKurt McKee2020-09-041-2/+2
| |
| * Support Ruby method names and operator overrides, including UnicodeKurt McKee2020-09-041-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #253 This patch contains these changes: * Add 50+ new Ruby tests for method name/operator override matching. * Unicode method names are now supported (#253). * `=` method name postfixes are now supported. * These operator overrides are now supported: `<`, `<=`, `!` `!@`, `~@`, `!`, `!=`, `!~`, `=~` * The `<>` "operator" override is removed. It appears that this was a typo in the regular expression (`<=?>` should have been `<=>?`). Syntax verified with https://docs.ruby-lang.org/en/2.7.0/syntax/methods_rdoc.html
* | Fotran lexer: detect keywords formed by two keywords without inter-word ↵ecasglez2021-02-121-0/+3
| | | | | | | | | | | | | | spaces. (#1677) * Fix for issue #1188. * I took the list of keywords affected by this issue from the VIM fortran lexer. * All the affeced keywords are ending keywords, that is, "end" followed by another keyword without space.
* | Supports single quote strings in AutoItLexer (#1667)trdean12021-02-081-0/+6
| | | | | | | | | | * Supports single quote strings in AutoItLexer * Adds test case for autoIt single strings
* | Add Zenburn theme (#1659)Mantas Zimnickas2021-02-072-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add Zenburn theme Zenburn theme home page: https://kippura.org/zenburnpage/ And Vim Zenburn theme repository, from which I took color codes: https://github.com/jnurmine/Zenburn * Add line number and other styles for zenburn As requested in code review. * Fix failing tests Probably during rebase I accidentally added dracula, which is now removed. * Remove encoding file markers It looks, that pygments no longer use these markers. * Add special colors for line numbers Something does not work with HTML generator, because colors does not show up, unless I added `noclasses=True`.
* | Add Material theme style (#1662)Paulo S. Costa2021-02-072-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | * Add Material theme style * List Material style in CHANGES * Change highlight color to be darker * Adjust line number special color * Set line number special background color Co-authored-by: Matthäus G. Chajdas <Anteru@users.noreply.github.com>
* | Updated Stata buildin function list modified: ↵Hua Peng2021-02-071-53/+90
| | | | | | | | | | | | | | pygments/lexers/_stata_builtins.py (#1470) * modified: pygments/lexers/_stata_builtins.py * modified: pygments/lexers/_stata_builtins.py
* | Add missing prompt color for Solarized style. (#1529)Kevin Deldycke2021-02-071-0/+3
| | | | | | | | | | | | | | * Add missing prompt color for Solarized style. * Add missing output color style. * Add missing generic color.
* | Add lexer for graphviz (#1657)Niklas Mollenhauer2021-02-072-0/+57
| | | | | | | | | | | | | | Imported from: https://github.com/nikeee/pygments-lexer-graphviz See: https://github.com/pygments/pygments/issues/731
* | Remove the alias for the RawTokenLexer. (#1643)Georg Brandl2021-02-062-2/+2
| | | | | | | | | | | | | | | | | | RawTokenLexer was broken until 2.7.4, so it seems pretty much unused, and it led to tracebacks when the "raw" alias was used from some markup that allows specifying a language alias. We'll still keep the class for special usage as intended. Co-authored-by: Matthäus G. Chajdas <Anteru@users.noreply.github.com>
* | Improve Kotlin lexer (#1699)Ilya Zorin2021-02-061-42/+105
| |
* | Fix for lexing J operator ? (#1700)amitkummer2021-02-061-1/+1
| | | | | | | | | | * Add J lexer tests for operator ? * Make J lexer match ? as an operator
* | Support anchored line numbers in inline mode (#1591)Kevin Deldycke2021-02-061-2/+10
| | | | | | | | | | * Add support for anchored line numbers in inline rendering mode * Fix tests rendering anchored line number in inline mode
* | MATLAB parser cleanup & fix for parsing `1./x` (#1673)Antony Lee2021-02-061-5/+9
| | | | | | | | | | | | | | | | | | * Clarify recognition of "command form" by MATLAB parser. Expand a bit the explanation; remove an unnecessary non-capturing group, replace \s+ by \s at the end (we just need to check for the presence of a space). * MATLAB: Correctly parse 1./x as (1)(./)(x).
* | Fix #1046.Matthäus G. Chajdas2021-02-061-0/+1
| | | | | | | | LESS lexer didn't handle single-line comments.
* | linenos support for terminal256 (#1674)Jiamin Shen2021-02-061-1/+23
| |
* | Merge branch 'master' of https://github.com/mathiasertl/pygments into ↵Matthäus G. Chajdas2021-01-301-6/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | mathiasertl-master Resolve conflicts, move tests to snippets, regenerate example files. # Conflicts: # tests/test_shell.py
| * | only print PS2 prompt if backslash continuation is enabledMathias Ertl2021-01-101-5/+1
| | |
| * | make PS2 contain a spaceMathias Ertl2021-01-101-1/+1
| | |
* | | AMDGPU ISA Lexer (#1626)Thomas Symalla2021-01-302-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * This commit implements a basic lexer for the AMDGPU ISA definition. * Updated comment. * Updated comment. * Tried to fix case-sensitive issue. * Updated AUTHORS file. * Added shader unit test for the AMD ISA Parser. * Renamed AMDGCN lexer to AMDGPU. * Renamed example file. * Renames. Co-authored-by: Thomas Symalla <root@SEUCHOMAT.localdomain>
* | | cmdline: port to argparse (#1693)Georg Brandl2021-01-301-163/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cmdline: port to argparse * cmdline: adapt the argparse help formatter to actually take terminal width into account * Update based on review feedback. * Extract "is_only_option" method * Check -L argument to be a "known good" argument Co-authored-by: Matthäus G. Chajdas <dev@anteru.net>
* | | Updated OpenEdge keywords (#1696)movedoa2021-01-291-384/+438
| | | | | | | | | Co-authored-by: Alexander Dobetsberger <alexander.dobetsberger@moveit.at>
* | | Fix mishandling '*/' in C/C++ and related (fixes #1695)Georg Brandl2021-01-294-11/+4
| | |
* | | tests: code style fixupsGeorg Brandl2021-01-201-2/+2
| | |
* | | Matlab class properties (#1466)Dan2021-01-181-34/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * WIP: Add failing test for a matlab class with properties. * Add some missing keywords * Add leading \s* matchers to things above the command form regex, as it tends to swallow keywords otherwise. * Add support for the special 'properties' block syntax. * Fix apparent infinite loop when given garbage input. * Use includes to clean up some of my copypasta. * Fix negative lookahead when there's more than one space between operators. * Use Whitespace not Text for spaces; combine adjacent whitespace. * Add support for declarative property constraints.
* | | update the mapMestery2021-01-181-1/+1
| | |
* | | add markdown to aliasesMestery2021-01-181-1/+1
| | |
* | | Run pyupgrade across codebase to modernize syntax and patterns (#1622)Jon Dufresne2021-01-17236-245/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pyupgrade is a tool to automatically upgrade syntax for newer versions of the Python language. The project has been Python 3 only since 35544e2fc6eed0ce4a27ec7285aac71ff0ddc473, allowing for several cleanups: - Remove unnecessary "-*- coding: utf-8 -*-" cookie. Python 3 reads all source files as utf-8 by default. - Replace IOError/EnvironmentError with OSError. Python 3 unified these exceptions. The old names are aliases only. - Use the Python 3 shorter super() syntax. - Remove "utf8" argument form encode/decode. In Python 3, this value is the default. - Remove "r" from open() calls. In Python 3, this value is the default. - Remove u prefix from Unicode strings. In Python 3, all strings are Unicode. - Replace io.open() with builtin open(). In Python 3, these functions are functionally equivalent. Co-authored-by: Matthäus G. Chajdas <Anteru@users.noreply.github.com>
* | | Fix for lexing Python raw f-strings with backslashes (#1683)Jeppe Dakin2021-01-171-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | * introduce and apply rfstringescape * add unit test for raw f-strings * add further tests * fix comment
* | | fix escape in TypeScript templates literalsMestery2021-01-171-2/+1
| | |
* | | Added `pygmentize -C` option to guess a lexer from contentGeorg Brandl2021-01-171-2/+18
| | |
* | | Do not guess MIME or SQL without reasonGeorg Brandl2021-01-172-4/+1
| | | | | | | | | | | | constant returns from analyse_text are not useful.