softdevteam / grmtools

Rust grammar tool libraries and binaries
Other
494 stars 32 forks source link

Catch incorrectly terminated productions. #460

Closed ltratt closed 1 month ago

ltratt commented 1 month ago

Previously, if action code was followed by symbols, those would be added to the rule, which clearly isn't what should happen. So:

R: A {B} C;

would be a rule "R" with symbols [A, C] and action code C. Whatever the user intended to write, this probably wasn't the outcome they expected!

This commit catches this syntax error, removing a footgun.

vext01 commented 1 month ago

This looks OK to me.