summaryrefslogtreecommitdiff
path: root/tests/examplefiles/python
Commit message (Collapse)AuthorAgeFilesLines
* Improve whitespace handling in Python.Matthäus G. Chajdas2022-12-114-69/+69
| | | | | | | | | 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.
* Python: lex soft keywordsamitkummer2021-12-202-0/+219
| | | | | | | | | | | | | | | | | | | | | | | | Some notes: - This approach is not perfect, but it's rather simple and I can't think of an edge case. - I did not use the `words` function to create the regex matching the keywords list, because it returns a capturing group (`()`) and it needs to be non-capturing here (because of `bygroups` usage). - I chose to go to the 'soft-keywords-inner' state after both `match` and `case`, even though it's unnecessary for `match` (the inner state catches the `_` wildcard keyword which appears only after a `case`). This is mostly harmless and saves us from writing the 'soft-keywords' regex twice each for `match` and `case` with the extra inner state just for `case`. The only piece of code this will lex incorrectly is `match _:` (`_` will be lexed as keyword). I doubt though that pattern mathcing will be used like this.
* Also add auto-updatable output-based tests to examplefiles (#1689)Oleh Prypin2021-01-206-0/+316
Co-authored-by: Georg Brandl <georg@python.org>