Open asottile opened 4 years ago
I have tried also in TextMate and they appear to handle this in the way you expect:
Here is the grammar converted to TextMate's format:
{ patterns = (
{
match = "((a)) ((b) c) (d (e)) ((f) )";
name = "matched";
captures = {
1 = { name = "g1"; };
2 = { name = "g2"; };
3 = { name = "g3"; };
4 = { name = "g4"; };
5 = { name = "g5"; };
6 = { name = "g6"; };
7 = {
patterns = (
{ match = "f"; name = "g7f"; },
{ match = " "; name = "g7space"; },
);
};
8 = { name = "g8"; };
};
},
);
}
@RedCMD usually dupe goes the other way since this one is older and has more context
a bit of an edge case, I'm not sure how this is supposed to be handled -- I don't have a concrete use case, just trying to implement my own parser in python using this as a reference
sample grammar
sample file
tokenization using vs code
I expect the
f
to have the scopetest, matched, g7f, g8
: