Skip to content

Commit

Permalink
Add rellitvec
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Thiele authored and sthiele committed Jun 24, 2024
1 parent 09d5da3 commit c2aeaad
Show file tree
Hide file tree
Showing 5 changed files with 11,467 additions and 11,281 deletions.
11 changes: 8 additions & 3 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ module.exports = grammar({
seq($.SUB, $._widentifier, $.argvec, $.RPAREN),
),

rellitvec: $ => choice(
seq($.cmp , $.term),
seq($.rellitvec, $.cmp, $.term)
),

literal: $ => choice(
$.TRUE,
seq($.NOT, $.TRUE),
Expand All @@ -267,9 +272,9 @@ module.exports = grammar({
$.atom,
seq($.NOT, $.atom),
seq($.NOT, $.NOT, $.atom),
seq($.term, $.cmp, $.term),
seq($.NOT, $.term, $.cmp, $.term),
seq($.NOT, $.NOT, $.term, $.cmp, $.term),
seq($.term, $.rellitvec),
seq($.NOT, $.term, $.rellitvec),
seq($.NOT, $.NOT, $.term, $.rellitvec),
$.csp_literal
),

Expand Down
53 changes: 38 additions & 15 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,41 @@
}
]
},
"rellitvec": {
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "cmp"
},
{
"type": "SYMBOL",
"name": "term"
}
]
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "rellitvec"
},
{
"type": "SYMBOL",
"name": "cmp"
},
{
"type": "SYMBOL",
"name": "term"
}
]
}
]
},
"literal": {
"type": "CHOICE",
"members": [
Expand Down Expand Up @@ -1893,11 +1928,7 @@
},
{
"type": "SYMBOL",
"name": "cmp"
},
{
"type": "SYMBOL",
"name": "term"
"name": "rellitvec"
}
]
},
Expand All @@ -1914,11 +1945,7 @@
},
{
"type": "SYMBOL",
"name": "cmp"
},
{
"type": "SYMBOL",
"name": "term"
"name": "rellitvec"
}
]
},
Expand All @@ -1939,11 +1966,7 @@
},
{
"type": "SYMBOL",
"name": "cmp"
},
{
"type": "SYMBOL",
"name": "term"
"name": "rellitvec"
}
]
},
Expand Down
27 changes: 25 additions & 2 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -1036,11 +1036,11 @@
"named": true
},
{
"type": "cmp",
"type": "csp_literal",
"named": true
},
{
"type": "csp_literal",
"type": "rellitvec",
"named": true
},
{
Expand Down Expand Up @@ -1296,6 +1296,29 @@
]
}
},
{
"type": "rellitvec",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "cmp",
"named": true
},
{
"type": "rellitvec",
"named": true
},
{
"type": "term",
"named": true
}
]
}
},
{
"type": "source_file",
"named": true,
Expand Down
Loading

0 comments on commit c2aeaad

Please sign in to comment.