Skip to content

Commit

Permalink
Add rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreLachanceGit committed Aug 25, 2023
1 parent deff217 commit 767edce
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions p4_lsf/language_def/rules.ron
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,30 @@ LanguageDefinition (
),
Rule(
node_name: "Transition",
children: [
Maybe(query: Kind("select_expression"), rule: Rule("Select")),
]
),
Rule(
node_name: "Select",
children: [
One(query: Path([Kind("select_expression_params"), Kind("expression_list")]), rule: Rule("ValueList")),
One(query: Path([Kind("select_expression_body"), Kind("select_case_list")]), rule: Rule("SelectCaseList")),
]
),
Rule(
node_name: "SelectCaseList",
children: [
Many(query: Kind("select_case"), rule: Rule("SelectCase")),
]
),
Rule(
node_name: "SelectCase",
children: [
Many(query: Path([Kind("simple_keyset_expression"), Kind("expression")]), rule: Rule("Value")),
// TODO: tuple_keyset_expression
One(query: Field("name"), rule: Rule("NameUsage")),
]
),
Rule(
node_name: "VariableDeclaration",
Expand Down Expand Up @@ -509,6 +533,12 @@ LanguageDefinition (
Rule(
node_name: "Member",
),
Rule(
node_name: "ValueList",
children: [
Many(query: Kind("expression"), rule: Rule("Value")),
]
),
Rule(
node_name: "Value",
children: [
Expand Down

0 comments on commit 767edce

Please sign in to comment.