feat(core): capture range for SequenceExpr#2994
feat(core): capture range for SequenceExpr#299486xsk wants to merge 3 commits intoAutomattic:masterfrom
SequenceExpr#2994Conversation
Allows the storing of a generic range in structs and similar.
Add tests for capture-range feature.
|
Interesting approach! I consider myself fairly decent at regexes but I've never known about When I played with adding capturing I was going to "enable" capturing for any selected Or try to "walk the tree" of Since then I've also considered having a new kind of |
Description
Adds the
start_captureandend_capturefunctions toSequenceExpr. These functions allow limiting the range of tokens captured by aSequenceExpr. They're inspired by and intended to function similarly to vim regex's\zsand\zeatoms.One implementation detail I'm not too sure about is the
RangeEnumtype. It's functionality feels fairly distant from a grammar checker, and it feels like something that might better be delegated to a dependency. I'm not sure if there is a dependency we can/should use for this, or if there's a simpler way to implement it entirely.All the added types/functions are currently
pub(crate), with the intention of allowing otherwise breaking changes until this can become more refined through use/experience.How Has This Been Tested?
cargo testChecklist