Skip to content

Commit

Permalink
[Python] Split line continuation bailout patterns
Browse files Browse the repository at this point in the history
This commit ...

1. re-uses existing `else-pop` context
2. implements "string after newline" detection" in a separate pattern.

Goals are better readability and avoiding nested lookaheads.
  • Loading branch information
deathaxe committed May 21, 2023
1 parent b1d8713 commit 67de3e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Python/Python.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -3745,5 +3745,6 @@ contexts:
- meta_include_prototype: false
# This prevents strings after a continuation from being a docstring
- include: strings
- match: (?=\S|^(?!\s*[[:alpha:]]*['"]))
- include: else-pop
- match: ^(?!\s*[[:alpha:]]*['"])
pop: 1

0 comments on commit 67de3e2

Please sign in to comment.