| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Co-authored-by: Jean Abou Samra <jean@abou-samra.fr>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
| |
Use special lexer rules for escapes; fixes catastrophic backtracking,
and highlights them too.
Fixes #2356
|
|
|
|
|
| |
This is simpler and more reliable than hand-coding the state machine.
Fixes #2411
|
|
|
|
| |
valid (#2410)
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
These are easier to update in tests/snippets/ (just run with
--update-goldens).
|
|
|
|
| |
Fixes #2382
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Fixes #2329
Fixes #2226
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Co-authored-by: Jean Abou Samra <jean@abou-samra.fr>
|
|
|
|
|
| |
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)
|
|
|
|
| |
Fixes #2262
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
\\\\|\\. is like \\. but causes catastrophic backtracking inside (...)* .
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
the output
Fixes #2166
|
|
|
|
| |
Fixes #2162
|
|
|
|
| |
Fixes #2145
|
|
|
| |
Co-authored-by: Jean Abou Samra <jean@abou-samra.fr>
|
|
|
| |
Co-authored-by: Chung Tai <chungtai456@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
/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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
| |
These lexers have re.DOTALL in their flags, so r"(.|\n)" is equivalent
to r".", except with catastrophic backtracking properties.
Closes #2068
|
|\ |
|
| |
| |
| |
| | |
fix pi8027/algebra-tactics-paper#3
|