summaryrefslogtreecommitdiff
path: root/tests/snippets
Commit message (Collapse)AuthorAgeFilesLines
* [elpi] handle quotations (#2419)Enrico Tassi2023-04-301-0/+33
| | | Co-authored-by: Jean Abou Samra <jean@abou-samra.fr>
* Updates C and C++ lexers (#2422)Christopher Di Bella2023-04-262-0/+30
| | | | | | | | | | | * replaces `restrict` with `__restrict` in C++ `restrict` isn't a C++ keyword, but `__restrict` is recognised by Clang, GCC, and MSVC as a language extension. * adds `_BitInt` and `__int128` as C and C++ types * `_BitInt` is a new C type and an extended integral type for C++. * `__int128` is an extended integral type on both Clang and GCC.
* adds C++ alternative tokens as keywords (#2421)Christopher Di Bella2023-04-261-0/+46
|
* Improve Java properties lexer (#2404)Jean Abou-Samra2023-04-172-2/+6
| | | | | | Use special lexer rules for escapes; fixes catastrophic backtracking, and highlights them too. Fixes #2356
* Refactor PythonConsoleLexer as a DelegatingLexer (#2412)Jean Abou-Samra2023-04-173-3/+21
| | | | | This is simpler and more reliable than hand-coding the state machine. Fixes #2411
* Python console: do not require output that looks like a traceback to be ↵Georg Brandl2023-04-121-0/+108
| | | | valid (#2410)
* Add lexer for MediaWiki Wikitext (#2373)diskdance2023-04-0518-0/+11103
|
* Lexer for the WebGPU Shading Language (#2386)David Neto2023-03-3015-0/+2376
| | | | | | | | | | See https://w3.org/TR/WGSL Further work is needed to refine it: - treat context-dependent names specially - treat template start and template end tokens specially, perhaps Fixes: #2388
* Update copyright year to 2023.Matthäus G. Chajdas2023-03-291-1/+1
|
* Move more tests to tests/snippets instead of .py files (#2344)Jean Abou-Samra2023-03-2919-0/+999
| | | | These are easier to update in tests/snippets/ (just run with --update-goldens).
* css: fix lexing numbers inside function calls2382-fixGeorg Brandl2023-03-191-0/+51
| | | | Fixes #2382
* Improve lexing PHP attributes (#2360)Richard van Velzen2023-03-011-0/+38
|
* Fix lexing PHP anonymous classes with no parameters (#2359)Richard van Velzen2023-03-011-0/+28
|
* Improve lexing PHP's variable variable syntax (#2358)Richard van Velzen2023-03-011-0/+45
|
* Improve bash math expansion lexing (#2353)Richard van Velzen2023-02-241-0/+672
|
* More tests moved to snippets/ (#2351)Jean Abou-Samra2023-02-2325-0/+1429
|
* Python console: make traceback handling more robustGeorg Brandl2023-02-031-0/+97
| | | | | Fixes #2329 Fixes #2226
* Add support for normal diff syntax (#2321)CosmicHorror2023-01-292-0/+82
|
* Improve whitespace handling in MesonLexer/PerlLexer.Matthäus G. Chajdas2022-12-111-19/+19
|
* Improve whitespace handling in SLexer.Matthäus G. Chajdas2022-12-118-13/+13
|
* Improve whitespace handling in Python.Matthäus G. Chajdas2022-12-1181-129/+129
| | | | | | | | | This triggers a new case in the HtmlFormatter, which emits an empty span at the end of the line for a new line, as those are removed by the split-by-parts code. This requires separate post-processing. Doesn't fix all whitespace issues with Python either, but we're done to 360 failing examples with that, from previously >400.
* Improve whitespace handling in PraatLexer.Matthäus G. Chajdas2022-12-112-2/+2
|
* Improve whitespace handling in PraatLexer.Matthäus G. Chajdas2022-12-0414-34/+34
|
* Improve whitespace handling in TealLexer.Matthäus G. Chajdas2022-12-043-7/+7
|
* Improve whitespace handling in XmlLexer.Matthäus G. Chajdas2022-12-043-3/+25
|
* Improve whitespace handling in CMake/RegexLexer.Matthäus G. Chajdas2022-12-0432-84/+84
|
* Improve whitespace handling in the BashLexer.Matthäus G. Chajdas2022-12-0414-30/+30
|
* Improve whitespace handling in Markdown.Matthäus G. Chajdas2022-12-047-16/+16
|
* Fix whitespace handling in Ruby.Matthäus G. Chajdas2022-12-046-20/+20
|
* Add support for Wren language (#2271)PureFox482022-11-291-0/+10
| | | Co-authored-by: Jean Abou Samra <jean@abou-samra.fr>
* Accept colon(s) in YAML key namesGreg Dubicki2022-11-143-0/+33
| | | | | as it's ok according to the YAML specs and is widely used in the real world, f.e. in Puppet's Hiera (https://puppet.com/docs/puppet/7/hiera_quick.html#values_common_data)
* shell session: allow continuation without marker for PowerShellGeorg Brandl2022-10-281-0/+124
| | | | Fixes #2262
* Fix: Issues with .properties format using whitespace delimited key (#2241)jmzambon2022-09-253-4/+5
| | | | | | | | | Added: - support for space delimitor in every case, included multiline value - check for odd number of backslash escapes - "!" as comment start - support for escape of spaces and separators Dropped: - undocumented ";" and "//" comment start
* Adding MIPS Lexer (#2228)davisrichard4372022-09-213-0/+390
|
* CFamilyLexer: refuse quotes between parentheses for function definitions and ↵Jean Abou-Samra2022-08-151-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | declarations (#2208) Something like id id2("){ ... }"); is no longer wrongly recognized as a "function" id id2(") { ... } "); As the difference in the tests shows, this has the unfortunate side effect that we no longer highlight something like int f(param="default"); as a function declaration, but it is hard to imagine another way to fix this (cf. “most vexing parse” problem). Fixes #2207
* Fortran: fix catastrophic backtrackingJean Abou Samra2022-08-151-0/+112
| | | | \\\\|\\. is like \\. but causes catastrophic backtracking inside (...)* .
* Disable highlighting of some escape codes for python bytes literals (#2204)LaurenceWarne2022-08-152-0/+44
| | | | | | | | Disable highlighting of unicode escape codes in python bytes literals, as described in https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals. So escape codes of the form "\N{name}", "\uxxxx" and "\Uxxxxxxxx" will no longer be highlighted within bytes literals. Add tests for escape code highlighting in string and bytes literals.
* PHP: fix `\"$var\"` inside strings (fixes #2105)Georg Brandl2022-06-301-0/+28
|
* Matlab session: fix traceback when a line continuation ellipsis appears in ↵Georg Brandl2022-06-231-0/+18
| | | | | | the output Fixes #2166
* terraform: accept leading whitespace for << heredoc delimGeorg Brandl2022-06-171-0/+33
| | | | Fixes #2162
* tcl: accept variables in ${name} syntaxGeorg Brandl2022-06-041-0/+17
| | | | Fixes #2145
* Fix comments within function declarations in C (#1891) (#2140)lambda-karlculus2022-05-301-0/+409
| | | Co-authored-by: Jean Abou Samra <jean@abou-samra.fr>
* java multiline highlighting based on issue 1858 (#2132)VishalN72022-05-102-0/+231
| | | Co-authored-by: Chung Tai <chungtai456@gmail.com>
* Initial commit for MCFunction Lexer + tests (#2107)Rit2022-04-2412-0/+1018
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial commit for MCFunction Lexer + tests * Apply suggestions from code review Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr> * added docstring info + fix for run ... command * remove string ending Error tokens * not working - refactor in-progress * fixed: generic property * Update pygments/lexers/mcfunction.py Co-authored-by: Georg Brandl <georg@python.org> * apply some fixes from comments * Update pygments/lexers/mcfunction.py Co-authored-by: Georg Brandl <georg@python.org> * spacing * updated tests and applied more suggestions * fixed comment regex, passes tests Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr> Co-authored-by: Georg Brandl <georg@python.org>
* Add lexer for colon-separated value config files like /etc/passwd, ↵Leistungsabfall2022-04-163-0/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | /etc/shadow and /etc/group (#2112) * add PasswdLexer and ShadowLexer for lexing /etc/passwd and /etc/shadow * fix regex * Update pygments/lexers/configs.py Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr> * address review comments * update _mapping.py * Create united lexer UnixConfigLexer for config files using colon-separated values, typically used in Unix/Linux system config files. * format docstring * UnixConfigLexer: add whitespace detection * add test snippets for UnixConfigLexer * address review comment Co-authored-by: Jean Abou-Samra <jean@abou-samra.fr> Co-authored-by: Leistungsabfall <–Leistungsabfall@users.noreply.github.com>
* Terraform: Fix class name lexing (#2097)amitkummer2022-03-279-18/+38
| | | | | | | | | | | | | | * Merge unneeded state with it's parent rule The `blockname` state did not have a `#pop` after it's only rule, which caused outputting errors in #2094. Instead of adding a `#pop`, I merged the `blockname` state with the rule that uses it, to achieve the exact same lexing logic, but without another state in the lexer. * Add test for #2094 * Regenerate tokens for previous tests
* CFamily: Lex identifiers after `case` as constants (#2084)amitkummer2022-03-122-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Lex identifiers after `case` as constants Add a state for marking identifiers preceded by a `case` keyword as constants. Additionally, refactor the `label` rule to no longer permit a `case` keyword before a label. Consequentially, identifiers after a `case` keyword (like `foo` in `case foo:`) are no longer wrongly lexed as `Name.Label`, but as `Name.Constant`. In addition, this fixes #2076, as multiple `case` keywords in one line are lexed the same. * Add test for multiple `case` keywords in one line * Fix existing tests * Lex `::` as Operator and not Name.Constant After a `case`, when lexing a namespaced name, like `foo::bar`, lex the namespace operator `::` as Operator, and not Name.Constant. * Regenerate tokens
* Fix catastrophic backtracking in HTML and XML (#2069)Jean Abou-Samra2022-02-242-0/+68
| | | | | | These lexers have re.DOTALL in their flags, so r"(.|\n)" is equivalent to r".", except with catastrophic backtracking properties. Closes #2068
* Merge branch 'fix-elpi' of https://github.com/gares/pygments into gares-fix-elpiMatthäus G. Chajdas2022-02-202-2/+21
|\
| * elpi: fix lexing of -> in ctypeEnrico Tassi2022-01-092-2/+21
| | | | | | | | fix pi8027/algebra-tactics-paper#3