| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
Co-authored-by: Georg Brandl <georg@python.org>
|