summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Update javascript lexer (#1814)Mestery2021-07-185-10/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * make ts extends js lexer * add regex's d flag for js lexers cf. https://v8.dev/features/regexp-match-indices * update js builtins, operators, exceptions * fixup! update js builtins, operators, exceptions * add typescript override keywork * Update _mapping.py
* | | Update Fennel lexer to include forms from latest version. (#1862)Phil Hagelberg2021-07-181-31/+33
| | | | | | | | | | | | | | | Treat true/false/nil as constants. Also separate out declarations from other special forms and macros.
* | | Fix FutureWarning for words() with "[" (#1854)Jean-Abou-Samra2021-07-061-0/+366
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | regex_opt() groups characters in sets when possible. The warning was caused when the "[" character ended up at the beginning of a set: r"[[...]". This emits a FutureWarning since Python 3.7 due to possible changes in semantics in the future (https://bugs.python.org/issue30349). Just add "[" to the list of characters that should be escaped in sets. Add unit tests for words(). [Closes #1853.]
* | | Support error locations in Python tracebacks (#1852)Jean-Abou-Samra2021-07-0613-7/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support both single carets for syntax errors (Python 2 and 3) and fine-grained error locations with several carets (Python 3.11+). Previously, the carets were highlighted as operators. This uses a new token, Token.Punctuation.Marker. For now, no style supports it specifically. In the future, styles might start differentiating it from Token.Punctuation. [Closes #1850.]
* | | Improved Rust attributes (#1813)kaivol2021-06-251-0/+12
| | |
* | | Use Whitespace for whitespace in Tcl.Matthäus G. Chajdas2021-06-201-38/+38
| | |
* | | tcl lexer: no error for @ or , (#1834)Akuli2021-06-201-0/+131
| | | | | | | | | | | | | | | | | | | | | * tcl lexer: no error for @ or , * examplefiles --> snippets * rename test file to convention
* | | Remove unicorn token types (fixes #1816.)Matthäus G. Chajdas2021-06-204-100/+100
| | | | | | | | | | | | | | | | | | The PR #1819 provides a tool to identify unique token types. This PR aims to remove the most obvious cases of unicorn styles which are used in a single lexer only.
* | | Add procfile lexer (#1808)sblondon2021-06-203-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add Procfile Lexer * add unit tests for ProcfileLexer * add Procfile lexer author * Document Procfile as supported language * add Procfile.output file * merge Profile files; update output file * Add versionadded info * Fix typo (processus -> processes) * detect Integer only * split Text from Whitespace
* | | Use the correct whitespace token for the C family.Matthäus G. Chajdas2021-06-2048-31708/+31708
| | | | | | | | | | | | The CFamilyLexer was matching whitespace as Text instead of Whitespace.
* | | Fix CFamilyLexer preprocessor tokenization errors (#1830)Henrik Lievonen2021-06-2018-225/+912
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CFamilyLexer failed to tokenize preprocessor macros when they were preceded by line break surrounded by spaces. This was the case because prerpocessor regex rule expected to start at the beginning of the line, but the space regex rule matched also the whitespace after the line break. Now the space rule has been refined not to match the line break. Because of this, the preprocessor regex rule correctly matches prerpocessor tokens even when they are preceded by white spaces, at the cost of adding some more tokens in the token stream in some cases. This change preserves the behavior of invalid preprocessor usage failing to tokenize.
* | | Add Meson build language support (#1823)ldrumm2021-06-202-0/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add a Meson language lexer * update the mappings * Add meson to the list of supported languages * Add a meson.build example file
* | | Rust: fix lexing of "break" and "continue"Georg Brandl2021-06-201-0/+39
| | | | | | | | | | | | fixes #1843
* | | Correctly highlight multiline console input, even without PS2 prompt (#1833)Jesse Tan2021-06-044-0/+32
|/ /
* | groovy lexer: detect quoted function names (#1765)Alison Winters2021-05-024-4/+34
| | | | | | | | | | | | | | * groovy lexer: parse keywords before function names like java * groovy lexer: detect quoted function names * changes: update groovy lexer
* | Support Terraform 0.14 syntax (#1756)Leonardo Giordani2021-05-0211-1227/+673
| | | | | | | | | | * Support Terraform 0.14 syntax * Use \S instead of [^\s]
* | Support for OMG IDL (#1595)Fred Hornsey2021-05-026-0/+880
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Support for OMG IDL Lexer for [Object Management Group Interface Definition Language](https://www.omg.org/spec/IDL/About-IDL/). * Allow Whitespace Before include in C Preprocessor It wasn't highlighting the included filename the same as if there was no space before the include, but now it is. * Update omg-idl Tests to Latest Requirements * Update omg-idl versionadded to 2.9 Since I just realized this missed the 2.8 release. * Add Missing Operators to omg-idl
* | Improve PromQL lexer with new test cases (#1783)Pablo Seminario2021-04-242-0/+51
| | | | | | | | | | | | | | | | | | * Fix PromQL lexer to support values enclosed within single quotes Values for labels could now be enclosed within single or double quotes. * Fix a typo into the lables regex for PromQL lexer The correct label matching operator is `!~` instead of `~!`.
* | Detect multiline patterns in velocity lexer text analysis (#1776)Andy2021-04-171-1/+41
| |
* | AMDGPU: Updated modifier tokenization. (#1775)Thomas Symalla2021-04-152-1/+21
| | | | | | | | | | | | | | * Added new modifier tokenizer. * Add expected output for the AMDGPU test. * Used "words" function.
* | Rust: fix raw string tokenGeorg Brandl2021-04-121-0/+117
| | | | | | | | Fixes #1771
* | Fix python lexer parsing floats incorrectly (#1768)Liam Stevens2021-04-101-0/+75
| | | | | | | | | | | | | | | | | | * lexers: python: add test cases for floats * lexers: python: fix float lexing * lexer:python:fixed test syntax Co-authored-by: Aidan Do <giahuydo99@gmail.com>
* | lexers: devicetree: allow node label without root node (#1755)Gerard Marull-Paretas2021-04-051-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lexers: devicetree: allow node label without root node It is sometimes useful to render DeviceTree snippets such as: foo: bar@1234 { foo = "bar"; }; However the snipper shown above does not render properly unless it is enclosed on a root node, i.e. /{ foo: bar@1234 { foo = "bar"; }; }; Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no> * tests: add devicetree lexer test for fragments out of root node Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
* | Fix #1416: add WebAssembly lexer (#1564)Jendrik2021-04-0411-0/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add WebAssembly lexer * avoid test failure by using the default function instead of an empty regex * address small issues * fix WebAssembly string escapes * change WebAssembly multiline comment parsing * update copyright year * set versionadded to 2.9 * change WebAssembly tests to use the new test system * change WebAssembly unit test to use snippets
* | PowerShell: lex ':' (#1758)amitkummer2021-03-283-3/+38
| |
* | Filename to <th> if linenos=table (fixes #1757) (#1759)Andy Pearce2021-03-28129-1/+996
| | | | | | | | | | | | | | | | | | * Filename to <th> if linenos=table (fixes #1757) * Emit `<th>` for `filename` if `linenos=table`. * Added test cases for filename inclusion. * Updated CHANGES
* | Add NestedText lexer (#1578)Kale Kundert2021-03-212-0/+174
| | | | | | | | | | | | | | | | | | * Add NestedText lexer * Add NestedText to list of supported languages * Add some more test cases * Update tests.
* | Leading underscore in APL variable names (GNU, Dyalog) (#1747)Stefan Kruger2021-03-151-0/+26
| | | | | | | | | | | | | | | | | | | | | | * Two small tweaks to the APL lexer: 1. Add all APL file suffixes 2. Allow leading _ in variable names (GNU APL, Dyalog) * Build mappings to pick up new file extensions * Add tests for APL: 1. Leading underscores for variables OK (Dyalog, GNU)
* | Add a teal lexer (#1671)iscke2021-03-145-0/+190
| | | | | | | | | | | | | | | | | | * Add a teal lexer * fix an indent * convert tests, fix version, alias * fix examplefile
* | Added ThingsDB Language support (#1295)Georg Brandl2021-03-143-0/+536
| | | | | | | | | | | | | | | | | | | | | | | | * Added ThingsDB Language support * Update ThingsDB language * add comments to syntax * Update to new test system. Co-authored-by: Jeroen van der Heijden <joente@gmail.com> Co-authored-by: Matthäus G. Chajdas <dev@anteru.net>
* | Add KuinLexer (#1300)Georg Brandl2021-03-142-0/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add KuinLexer * Add golden test output. * Update mapfiles. * Update URL. * Fix regex lint failures. Co-authored-by: tatt61880 <tatt61880@gmail.com> Co-authored-by: Matthäus G. Chajdas <dev@anteru.net>
* | Add apdl and gcode lexers (#1714)Averter2021-03-148-0/+1943
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add apdl and gcode lexers * Added requested changes except words function * Added requested changes except words function * Added words function to handle lists of keywords * Add two testing example files * Delete two_dimensional_truss.ans * Delete coupled_example.ans * Create example1apdl.ans * Create example2apdl.ans * General cleanup of apdlexer and creation of mapfiles * Escaped backslashes in string literals on apdlexer * Removed backslashes. None was necessary in the first place * Added apdl aliase and a * based command in the test file * Forgot to create the map files * Tested version. Also removed an unused function from apdlexer * Added examples for gcode and golden output * Trimming of gcode files to a few dozens of lines * Removed duplicates from elafunb
* | Update the Chapel lexer (#1743)Engin Kayraklioglu2021-03-141-31/+31
| | | | | | | | | | | | | | | | | | * Update the Chapel lexer Signed-off-by: Engin Kayraklioglu <e-kayrakli@users.noreply.github.com> * Update the test Signed-off-by: Engin Kayraklioglu <e-kayrakli@users.noreply.github.com>
* | Refactor CFamilyLexer (#1746)amitkummer2021-03-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove duplicate lines in state * Refactor ident regex for readability Refactor ident regex changed in c1a0d82 to improve readability. Refactor namespaced_ident regex added in c1a0d82 to improve readability. * Fix inline keword lexing * Fix indentation * Refactor CLexer keywords to 'keywords' state
* | use `id` not `name` for line anchors; (#1725)Cyker Way2021-03-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | * use `id` not `name` for line anchors; `name` attribute on `a` element is obsolete in html5; * keep `name` to remain compatible with existing code; * update docstring; * update test files;
* | Add formatter for Pango Markup (#1727)Philipp Imhof2021-03-051-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | * Add formatter for Pango Markup * Code style improvement * Code improvement + test case * Changed test * retrigger checks * Make test independent of color style
* | Update lists of operators/keywords in Julia and expand/refine highlighting ↵jmert2021-03-0511-10816/+3431
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#1715) * [julia] Update operators, keywords, and literal lists * [julia] Support symbol macros * [julia] Parse '..' operator juxtaposed with integers * [julia] Identify Symbol literals * [julia] Consume strings/commands faster & add triple-quoted command * [julia] Support identifying operators with custom suffixes * [julia] Add parsing for raw strings * [julia] Share definition of interpolation * [julia] Identify escaped ` and $ in commands * [julia] Support non-standard string and commmand literals with flags * [julia] Support variable names with interior exclamations * [julia] Fix matching floats starting with decimal * [julia] Compress nearly duplicate number matches with optional group * [julia] Match double-underscored float literal * [julia] Match hex float literals * [julia] Test more non-numerical literal expressions * [julia] Tag types in type contexts * [julia] Identify console via `julia-repl` as well * [julia] Be more conservative in identifying symbols * [julia] Update example file to v1.6 `base/strings/string.jl` * Address one CI failure * Switch to non-emoji Unicode category So example Hopefully fixes pypy3 CI failure * fixup: remove duplicate operators already in DOTTED_OPERATORS_LIST * [julia] Fix backslash operator * [julia] List `true`, `false` with builtin names, not keywords
* | octave: also allow percent block commentsGeorg Brandl2021-03-011-0/+9
| |
* | octave: add multiline commentsGeorg Brandl2021-03-011-0/+18
| | | | | | | | fixes #1726
* | Rewrite Scala lexer for Scala 3 (#1694)Maxime Kjaer2021-03-0173-359/+5837
| |
* | Fixes for C and C++ functions and namespaces (#1722)amitkummer2021-02-2714-156/+1944
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix lexing of function names This fixes #1561. Add a keywords state that matches inside and outside functions for keywords. Before this, when a keyword would appear the lexer would go to the statements state, in which functions were not matched. * Add tests for lexing of function names * Unbreak previous tests * Allow namespaced names in function statements Add a second identifiers regex that matces all the previous identifiers and also '::'. I took the decision to create a second identifiers regex with '::' inside, simply because using the old identifiers regex would hurt performance massively on every solution I tried to craft. * Add tests for namespaced names in functions * Unbreak previous tests * Add support for namespaces in namespace declarations Add a namespace state that is entered each time the namespace keyword is matched and lexes all name matches as namespaces. Cases this approach doesn't cover: * Namespaces in using declarations. * Namespaces that prefix names in random code. Unfortunately, in both of these cases the names before and after '::' are not always namespaces. * Add tests for namespace declartions * Unbreak previous tests * Tidy functions regex Remove group nesting that became unneeded after fc56ab8 (the last big refactor). * Remove f string usage I introduced by mistake
* | Fix various issues found by make check.Matthäus G. Chajdas2021-02-141-4/+8
| |
* | Add futhark lexer (#1691)Philip Munksgaard2021-02-142-0/+255
| |
* | Merge branch 'master' of https://github.com/pygments/pygmentsMatthäus G. Chajdas2021-02-1459-134/+3260
|\ \
| * | RawToken{Formatter,Lexer}: support Python 3 and handle exceptions (#1602)Anders Kaseorg2021-02-141-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Provide (all?) Matlab built-ins (#1705)Alex Povel2021-02-146-9/+9
| | | | | | | | | | | | | | | | | | | | | * 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/+3042
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-1249-125/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-14/+16
| | |
| * | fix ecl analyze text logic (#1610)Carlos Henrique Guardão Gandarez2021-02-121-0/+14
| | |