Closed charlie572 closed 1 year ago
The implementation looks OK. Could you explain a bit more:
grammar = Grammar("""
function = "def" ~"\s+" func_name "(" parameter "," ~"\s*")* "):"
func_name = ~"[a-zA-z_]+"
parameter = ~"[a-zA-Z_]+"
""")
You're right, this isn't any better than your solution. I'll close this pull request. Also, I realised that this won't work on lazy references. If anyone wants to reopen this pull request, they'll have to figure that out.
These have the same syntax as named groups in re.
For example:
Outputs: