The
<commit> does not prevent the parser to backtrack through it - it's
different from the Perl6
<commit> or Perl5
(*COMMIT). With Parse::RecDescent, a
<commit> only means not to try any other alternative for the current rule. Which means for your
job_statement production to
not thrown an error if, after matching
job_name, it's force to backtrack.
You could make <commit> behave the way it does in Perl6 by adding, for each rule that has a <commit> in one of its alternatives, a final <uncommit><reject> alternative.