softdevteam / grmtools

Rust grammar tool libraries and binaries
Other
518 stars 31 forks source link

Catch incorrectly terminated productions. #460

Closed ltratt closed 5 months ago

ltratt commented 5 months 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 5 months ago

This looks OK to me.