simplify the connection rule
This commit is contained in:
parent
c3be4d43cc
commit
fcc6316ba1
3 changed files with 25 additions and 42 deletions
|
@ -12,10 +12,8 @@ module.exports = grammar({
|
|||
connection: ($) =>
|
||||
seq(
|
||||
$.identifier,
|
||||
choice(
|
||||
seq(seq($.arrow, $.identifier, $._colon, $.label)),
|
||||
seq(repeat1(seq($.arrow, $.identifier)))
|
||||
),
|
||||
repeat1(seq($.arrow, $.identifier)),
|
||||
optional(seq($._colon, $.label)),
|
||||
$._end
|
||||
),
|
||||
|
||||
|
|
|
@ -33,38 +33,6 @@
|
|||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "arrow"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_colon"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "label"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "REPEAT1",
|
||||
"content": {
|
||||
|
@ -80,8 +48,25 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_colon"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "label"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
BIN
src/parser.c
BIN
src/parser.c
Binary file not shown.
Loading…
Reference in a new issue