Sorry, I ran into another question about using PetitParser. I've figured out my recursive issues, but now I have a problem with parentheses. If I need to be able to parse the following two expressions:
- '(use = "official").empty()'
- '(( 5 + 5 ) * 5) + 5'
I've tried doing something like the following:
final expression = (char('(') & any().starGreedy(char(')')).flatten() & char(')')).map((value) => ParenthesesParser(value));
But that doesnt' work on the first expression. If I try this:
final expression = (char('(') & any().starLazy(char(')')).flatten() & char(')')).map((value) => ParenthesesParser(value));
It doesn't work on the second expression. Any suggestions on how to parse both?