Skip to content

rule, match, precedence and reserve syntax #3

Description

@JOT85

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

rule id: match {
   ...
}

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

pattern name: <pat>

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 id(n)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions