-
Notifications
You must be signed in to change notification settings - Fork 126
Open
Description
There is persistent problem with injected languages where unclosed parentheses or quotes eat whole document.
I'm proposing to add option e.g. applyEndPatternFirst. This would check such end pattern at every line before anything else. I've looked at code a bit and it seems possible, but I'm not familiar enough with engine to correctly implement this (at least without trashing performance).
Details:
- On
endmatch - everything beforeendwould be extracted and checked again with sub-patterns and merged withend's tokens, while rest of line would be checked normally. Without match - business as usual. - When multiple
endpatterns with this option will be present, they should be stored and checked from first to last, at every line until any of them matches. There shouldn't be too many of them, since this should be used mainly with injected languages. - Successful match will terminate all descendant rules, after matching "before end" part of line.
endwith option should also match in line wherebeforewas found.
Why not use while? While while (sic) is great addition, it can only exclude whole line. Proposed option would allow stopping in mid-line.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels