summaryrefslogtreecommitdiff
path: root/tests/snippets
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | Update golen test files.Matthäus G. Chajdas2022-02-203-56/+56
| |
* | Merge branch 'master' of github.com:pygments/pygments; branch 'lexers_ijkl' ↵Matthäus G. Chajdas2022-02-2045-493/+577
|\ \ | | | | | | | | | of https://github.com/blu-base/pygments into blu-base-lexers_ijkl
| * | Whitespace token for kotlin lexerSebastian Engel2022-01-068-36/+36
| | |
| * | Whitespace token for scala lexerSebastian Engel2022-01-0617-54/+54
| | |
| * | Whitespace token for jvm lexerSebastian Engel2022-01-064-47/+47
| | |
| * | Whitespace token for julia lexerSebastian Engel2022-01-0610-347/+359
| | |
| * | Whitespace token j lexerSebastian Engel2022-01-062-2/+2
| | |
| * | Ws token coffee lexerSebastian Engel2022-01-062-2/+2
| | |
| * | Modernize Whitespace token in lexer javascriptSebastian Engel2022-01-062-5/+77
| |/
* | Add support for non-idiomatic single line comments in terraform (#2066)Charles Bouchard-Légaré2022-02-091-0/+3
| |
* | Scheme: recognize #: keywords (used for named function arguments)Jean Abou Samra2022-02-081-0/+43
| | | | | | | | | | Highlighting as Keyword.Declaration is consistent with the RacketLexer.
* | Scheme: autogenerate lists of builtinsJean Abou Samra2022-02-081-4/+4
| | | | | | | | | | | | | | This enriches the space of recognized builtins. Note that this also fixes the space after a builtin being included in the token.
* | Scheme: support fancy kinds of numbersJean Abou Samra2022-02-081-0/+169
| | | | | | | | | | Many number literals were not recognized previously, such as fractions, infinities, hex and complex literals.
* | Scheme: highlight string escapesJean Abou Samra2022-02-081-0/+85
| | | | | | | | | | Move string parsing to a dedicated state so it can recognize string escapes. Add support for various kinds of escapes.
* | tests: fix pytest 8 deprecationGeorg Brandl2022-02-081-1/+2
| |
* | Elpi: fix catastrophic backtracking (#2061)Jean Abou-Samra2022-02-031-0/+6
| |
* | Happy new year.Georg Brandl2022-01-251-1/+1
|/
* Java: fix lexing of 'record' soft keyword (#2018)amitkummer2022-01-031-1/+53
| | | | | | | | | | | | | | | | * Java: fix lexing of 'record' soft keyword Refactor the Java lexer to treat `record` as a soft keyword. Previously, the lexer assumed record is a reserved word, even though it is a soft keyword which can be used as a variable name. This refactor lexes record as a keyword only if it appears at the beggining of the line, with some potential other keywords like public and private preceding it. * Remove repetition in capture group * Update test output
* Merge branch 'master' of github.com:pygments/pygments; branch 'lexers_gh' of ↵Matthäus G. Chajdas2021-12-2915-270/+230
|\ | | | | | | https://github.com/blu-base/pygments into blu-base-lexers_gh
| * Modernize Whitespace token in lexer: hdlSebastian Engel2021-12-034-216/+176
| |
| * Modernize Whitespace token in lexer: haskellSebastian Engel2021-12-033-20/+20
| |
| * Modernize Whitespace token in lexer: gdscriptSebastian Engel2021-11-218-34/+34
| |
* | Lexer for new language Elpi (#1894)Enrico Tassi2021-12-125-0/+309
| | | | | | | | | | | | | | | | | | * lexers: add Elpi * test: elpi * Fix copyright * address code review
* | Merge branch 'lexers_ef' of https://github.com/blu-base/pygments into ↵Matthäus G. Chajdas2021-12-062-32/+33
|\ \ | |/ |/| | | blu-base-lexers_ef
| * Modernize Whitespace token in lexer: ezhilSebastian Engel2021-11-142-32/+33
| |
* | Merge branch 'lexers_de' of https://github.com/blu-base/pygments into ↵Matthäus G. Chajdas2021-11-213-17/+17
|\ \ | | | | | | | | | blu-base-lexers_de
| * | Modernize Whitespace token: data lexer(json,yaml)Sebastian Engel2021-10-233-17/+17
| | |
* | | Regenerate golden test files.Matthäus G. Chajdas2021-11-211-1/+1
| | |
* | | Asm lex bugfix #1895: register re check for boundary (#1961)Sebastian Engel2021-11-171-0/+32
| |/ |/|
* | Squashed commit of the following:Matthäus G. Chajdas2021-11-062-0/+56
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit c339afa51bac82515e90da90df3d2a428c612e20 Author: Matthäus G. Chajdas <dev@anteru.net> Date: Sat Nov 6 22:10:22 2021 +0100 Update tests. commit b60cf209ad93bc9176581f4a77ece58da4e1212a Merge: 7f000b4e cf7a978a Author: Matthäus G. Chajdas <Anteru@users.noreply.github.com> Date: Sat Nov 6 17:35:34 2021 +0100 Merge branch 'master' into feature-terraform-heredoc commit 7f000b4ef8930817f4c1249c242d95a9c191f4eb Author: Chris Rose <offline@offby1.net> Date: Mon Oct 11 07:47:36 2021 -0700 Eliminate pathological regex case I updated the terraform lexer to use the ExtendedRegexLexer and to handle heredocs with a callback, instead of with a regexp for the whole shebang. commit 0a1fa1b139b9249f210cd9450dafa8a1ee1715f8 Author: Chris Rose <offline@offby1.net> Date: Sat Oct 9 20:16:51 2021 -0700 Add support for the `set` type in HCL commit 18ad21300bb890fc9014a66c7ba2c195429b4d16 Author: Chris Rose <offline@offby1.net> Date: Sat Oct 9 19:14:27 2021 -0700 Support HCL's heredoc syntax Fixes #1909
* Whitespace token modernization - a* lexers - regarding #1905 (#1914)Sebastian Engel2021-10-233-14/+14
| | | | | | | | | | | | | | | * Whitespace token modernization - ambient lexer * Whitespace token modernization - ampl lexer * Whitespace token modernization - apdlexer lexer * Whitespace token modernization - apl lexer * Whitespace token modernization - adl lexer * Whitespace token modernization - arrow lexer * Whitespace token modernization - asm lexer
* Whitespace token modernization - [bc] lexers - regarding #1905 (#1923)Sebastian Engel2021-10-2373-675/+667
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Modernize Whitespace token: basic lexer * Modernize Whitespace token: bibtex lexer * Modernize Whitespace token: boa lexer * Modernize Whitespace token: capnproto lexer + new example * Modernize Whitespace token: cddl lexer * Modernize Whitespace token: chapel lexer * Modernize Whitespace token: c_like lexer * Modernize Whitespace token: configs lexer * Modernize Whitespace token: console lexer * Modernize Whitespace token: crystal lexer * Modernize Whitespace token: csound lexer * Modernize Whitespace token: css lexer * Revert a change in basic lexer