peggy
peggy copied to clipboard
Importing grammar rules from a file
I often re-use the same grammar rules in multiple grammar files, so I want to save these rules in one file and import them into other grammar files.
If I defined a rule in a file named rules.peggy
:
function_call = a1:var_name "(" _ a2:exprs _ ")" {return a1+"("+a2+")";}
I would want to import it into another grammar file:
import rules.peggy
Does Peggy have a feature that allows grammar rules to be imported like this?
Also #417
I think #456 is the full fix for this.
Fixed by #456