Open kaby76 opened 5 years ago
This is very important. I want to special case special cases for parameters of functions. I can do special case a parameter--but only by special casing the match for the entire function declaration. What I want is to add in a pattern specific for the parameter without adding in a whole new pattern for functions.
Antlr has both a visitor and listener pattern implementation. See https://saumitra.me/blog/antlr4-visitor-vs-listener-pattern/ . Piggy needs a similar pattern with syntax. At the moment, Piggy patterns are visitor patterns, in which once matched in a pass, the node and entire sub-tree eliminated from further pattern matching.