summaryrefslogtreecommitdiff
path: root/pygments
Commit message (Collapse)AuthorAgeFilesLines
* Move test_examplefiles to new tests/lexers scheme.examplefilesGeorg Brandl2021-01-181-1/+1
|
* 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.
* Make guessing prefer Python 3 lexerGeorg Brandl2021-01-171-5/+6
|
* Fix escapes in JavaScript backtick stringsGeorg Brandl2021-01-171-2/+1
| | | | fixes #1679
* Bump version to 2.7.4.2.7.4Matthäus G. Chajdas2021-01-121-1/+1
|
* Revert "Added dracula theme style (#1636)"Matthäus G. Chajdas2021-01-122-111/+0
| | | | | | | This reverts commit bd378d0ef57a6bc53e9079c9363a6eab0d54f0dc. The license terms in dracula.py don't match. We'll add it back once the author places it under the correct license.
* Fix several exponential/cubic complexity regexes found by Ben Caller/DoyensecGeorg Brandl2021-01-117-11/+10
|
* xquery: fix pop from empty stackGeorg Brandl2021-01-111-1/+2
|
* Added 'ERROR STOP' to fortran.py keywords. (#1665)ecasglez2021-01-101-2/+2
| | | Maybe close #931
* support added for css variables (#1633)zjeffer2021-01-101-0/+3
| | | | | * support added for css variables * [-]+ instead of [-]*
* (sql.py): fix errors in keywords (#1668)0xflotus2021-01-101-6/+6
|
* Add __END_LINE__ to Crystal syntax highlighting (#1670)Linda_pp2021-01-091-0/+1
| | | I found `__END_LINE__` magic constant is missing in syntax highlighting for Crystal language.
* Detect malformed closing tags as errors. (#1656)Catatonic2021-01-061-1/+3
|
* Markdown lexer improvements (#1623)Leistungsabfall2021-01-061-11/+9
| | | | | | | | | * improve fenced code recognition for markdown lexer * improve inline code detection * improve detection of some Markdown keywords * remove Markdown recognition of code indented by 4 spaces as reliable detection is not possible with regex
* support indented entries in IniLexer (#1624)Leistungsabfall2021-01-041-1/+1
|
* Update Crystal lexer (#1650)Oleh Prypin2021-01-041-74/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * crystal: drop all classes from builtins; these aren't normally highlighted ("normally" meaning all other highlighter tools) * crystal: fix percent-strings, drop Ruby-specific arbitrary delimiters It seems that Ruby supports strings such as `%*text*` where `*` can be anything. But Crystal never had anything like that. It does, however, keep `%|text|`, so add a case for that. * crystal: update keywords and builtins * crystal: fix string literals and escape sequences Update list of escapes. Support Unicode escape sequences. Also remove the Ruby-specific `:@foo` symbol syntax, Crystal doesn't have it. * crystal: uppercase identifiers aren't always constants Make `FOO::Bar` be highlighted like `Foo::Bar` would be, rather than like `FOO` * crystal: annotations can be namespaced Highlight the entire inside part of `@[Foo::Bar]`, not just the `Foo` part (these used to be named 'attributes' but the official name is 'annotations' now, so I also change that) * fixup! crystal: fix percent-strings, drop Ruby-specific arbitrary delimiters
* Fix Coq-related bug #678 (#1648)Maximilian Wuttke2021-01-041-3/+6
| | | | | | | | | | | * Unicode support for Coq Catch-all lexing for `Name.Builtin.Pseudo`, as in the lean lexer. This fixes #678. * Coq lexer: improve `analyse_text` * Add a test for Coq
* Merge branch 'master' of https://github.com/felixhao28/pygments into ↵Matthäus G. Chajdas2021-01-041-1/+1
|\ | | | | | | felixhao28-master
| * fix punctuation not labeled in function definition in TypeScriptYiyang Hao2020-08-161-1/+1
| |
* | Bump copyright year.Matthäus G. Chajdas2021-01-03234-237/+237
| |
* | Update keywords for JS and its variants (#1651)Mestery2021-01-021-37/+35
| | | | | | | | | | | | | | Some of the keywords are missing for JavaScript and TypeScript. And some of reserved keywords have been moved to `keywords` and `declarations keywords`. There are also non-existent builtins that I removed. Added missing builtins.
* | Revert a private API in the HTML formatter (#1655)Kurt McKee2020-12-301-6/+9
| | | | | | | | | | | | This should revert the behavior of the function without losing the overall caching behavior that was intended. Closes #1644
* | Fix #1652.Matthäus G. Chajdas2020-12-291-1/+1
| | | | | | | | in is a keyword in Bash, ZSH, and KSH.
* | feat: added 'ONLY' to fortran.py Keywords0xflotus2020-12-281-3/+3
| | | | | | maybe close #1543
* | add support for LiveScript and CoffeeScriptMestery2020-12-281-4/+4
| |
* | Fix regexs to support somes flagsMestery2020-12-281-4/+4
| | | | | | Resolves #1646
* | Merge github.com:mathiasertl/pygmentsGeorg Brandl2020-12-281-1/+1
|\ \ | | | | | | | | | fixes #1645
| * | consider trailing whitespace a part of the prompt, making copy/paste more ↵Mathias Ertl2020-12-251-1/+1
| | | | | | | | | | | | straight forward
* | | do_insertions: do not emit empty tokensGeorg Brandl2020-12-281-4/+6
|/ /
* | all: weed out more backtracking string regexesGeorg Brandl2020-12-2525-107/+107
| |
* | fix a lot more backtracking string regexesGeorg Brandl2020-12-2510-70/+40
| |
* | sarl: fix indentationGeorg Brandl2020-12-251-51/+56
| |
* | Added dracula theme style (#1636)Daniel Vilar2020-12-242-0/+111
| | | | | | | | | | | | | | | | | | * added dracula theme style * added dracula style to init * corrected misspell * Update __init__.py
* | Fix backtracking Modula2 string regexes.Georg Brandl2020-12-241-2/+12
| |
* | Fix raw token lexer w.r.t. Unicode.Georg Brandl2020-12-241-18/+18
| | | | | | | | fixes #1616
* | fix oversightGeorg Brandl2020-12-191-1/+1
| |
* | fix inefficient regexes for guessing lexersGeorg Brandl2020-12-192-3/+1
| |
* | Limit recursion with nesting Ruby heredocsGeorg Brandl2020-12-172-4/+10
| | | | | | | | fixes #1638
* | Fix backtracking string regexes in JavascriptLexer und TypescriptLexer.Georg Brandl2020-12-171-5/+24
| | | | | | | | fixes #1637
* | fixes #1625: infinite loop in SML lexerGeorg Brandl2020-12-101-6/+6
| | | | | | | | | | Reason was a lookahead-only pattern which was included in the state where the lookahead was transitioning to.
* | Prepare 2.7.3 release.2.7.3Matthäus G. Chajdas2020-12-061-1/+1
| |
* | Unclosed script/style tag handling Fixes #1614 (#1615)Nick Gerner2020-12-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explicitly handle unclosed <script> and <style> tags which previously would result in O(n^2) work to lex as Error tokens per character up to the end of the line or end of file (whichever comes first). Now we try lexing the rest of the line as Javascript/CSS if there's no closing script/style tag. We recover on the next line in the root state if there is a newline, otherwise just keep parsing as Javascript/CSS. This is similar to how the error handling in lexer.py works except we get Javascript or CSS tokens instead of Error tokens. And we get to the end of the line much faster since we don't apply an O(n) regex for every character in the line. I added a new test suite for html lexer (there wasn't one except for coverage in test_examplefiles.py) including a trivial happy-path case and several cases around <script> and <style> fragments, including regression coverage that fails on the old logic.
* | testing turtle prefix names where reference starts with number (#1590)elf Pavlik2020-12-051-11/+51
| | | | | | | | | | | | | | | | | | * testing turtle prefix names where reference starts with number * remove case insensitive flag from Turtle lexer * use same end-of-string regex as in SPARQL and ShExC * make example.ttl valid turtle