This issue is to discuss the syntax of the rule, match and reserve directives
Pattern syntax is discussed in #1
Current syntax
rule
Defines a new rule
Where id is a the identifier of the pattern - this identifier is used for referring to the rule in other matches and for setting precedence.
When 2 rules have the same id, they are matched in the order in which they are defined.
match is pattern matching syntax (see #1) which may include references to other rules which would be evaluated as a part of this rule.
The contents of the curly braces is the instructions for evaluating the rule. (That is worded badly...)
The scoping of rules needs to be discussed.
pattern
Defines a new pattern called name. Patterns can be referenced within other patterns/matches as described in #1. <pat> is the pattern which name is defined to be - note that rules may not be referenced here.
reserve
Reserve reserves id for a rule which yields n results. This allows matches to refer to this rule after the reserve, but before the rule definition.
precedence
Precedence will set the precedence of 1 rule relative to another. Syntax TBD.
This issue is to discuss the syntax of the rule, match and reserve directives
Pattern syntax is discussed in #1
Current syntax
rule
Defines a new rule
Where
idis a the identifier of the pattern - this identifier is used for referring to the rule in other matches and for setting precedence.When 2 rules have the same id, they are matched in the order in which they are defined.
matchis pattern matching syntax (see #1) which may include references to other rules which would be evaluated as a part of this rule.The contents of the curly braces is the instructions for evaluating the rule. (That is worded badly...)
The scoping of rules needs to be discussed.
pattern
Defines a new pattern called
name. Patterns can be referenced within other patterns/matches as described in #1.<pat>is the pattern whichnameis defined to be - note that rules may not be referenced here.reserve
Reserve reserves
idfor a rule which yieldsnresults. This allows matches to refer to this rule after thereserve, but before theruledefinition.precedence
Precedence will set the precedence of 1 rule relative to another. Syntax TBD.