Ok, found THAT problem. The "eod" rule at the end of "expression", was being called upon whenever expression was used, meaning that the ')' had to somehow come after the end of the data. With that fixed, I need to do a few more tests, but this is how it looks NOW:
my $grammar = q~ logic: expression eod expression: <leftop: term termop term> termop: /and/i | /xor/i | /or/i term: '(' <commit> expression ')' | condition condition: element comparison element element: '<' <commit> /-?\w+/ '>' | /\d+/ comparison: /=[><]=/ <commit> <error: Unable to match comparison> | /=?[><]=?/ | '=' | '!=' eod: /^\Z/ ~;
My code doesn't have bugs, it just develops random features.
Flame ~ Lead Programmer: GMS (DOWN) | GMS (DOWN)
In reply to Re: Re: •Re: Parse::RecDescent and mini-language parsing
by Flame
in thread Parse::RecDescent and mini-language parsing
by Flame
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |