simplify the connection rule

This commit is contained in:
Dmitriy Pleshevskiy 2022-12-05 10:33:49 +03:00
parent c3be4d43cc
commit fcc6316ba1
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
3 changed files with 25 additions and 42 deletions

View file

@ -12,10 +12,8 @@ module.exports = grammar({
connection: ($) => connection: ($) =>
seq( seq(
$.identifier, $.identifier,
choice( repeat1(seq($.arrow, $.identifier)),
seq(seq($.arrow, $.identifier, $._colon, $.label)), optional(seq($._colon, $.label)),
seq(repeat1(seq($.arrow, $.identifier)))
),
$._end $._end
), ),

View file

@ -33,38 +33,6 @@
"type": "SYMBOL", "type": "SYMBOL",
"name": "identifier" "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", "type": "REPEAT1",
"content": { "content": {
@ -80,8 +48,25 @@
} }
] ]
} }
},
{
"type": "CHOICE",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_colon"
},
{
"type": "SYMBOL",
"name": "label"
} }
] ]
},
{
"type": "BLANK"
} }
] ]
}, },

Binary file not shown.