grammar: some cleanup
This commit is contained in:
parent
1395b25364
commit
731be00903
5 changed files with 56 additions and 74 deletions
|
@ -95,10 +95,8 @@ module.exports = grammar({
|
|||
seq(
|
||||
$._connection_path,
|
||||
repeat1(seq($.arrow, $._connection_path)),
|
||||
seq(
|
||||
optional(seq($._colon, optional($.label))),
|
||||
optional(seq(alias($._connection_block, $.block)))
|
||||
)
|
||||
),
|
||||
|
||||
_connection_path: ($) =>
|
||||
|
@ -370,13 +368,13 @@ module.exports = grammar({
|
|||
attr_value_list: mkList(($) => $.attr_value),
|
||||
|
||||
attr_value: ($) =>
|
||||
seq(choice($.boolean, $.integer, $.float, $.string, $._unquoted_string)),
|
||||
choice($.boolean, $.integer, $.float, $.string, $._unquoted_string),
|
||||
|
||||
// --------------------------------------------
|
||||
|
||||
_dash: ($) => token.immediate("-"),
|
||||
|
||||
_colon: ($) => seq(":"),
|
||||
_colon: ($) => token(":"),
|
||||
|
||||
arrow: ($) => token(prec(PREC.ARROW, choice(/-+>/, /--+/, /<-+/, /<-+>/))),
|
||||
|
||||
|
|
|
@ -88,9 +88,6 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
|
@ -143,8 +140,6 @@
|
|||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"_connection_path": {
|
||||
"type": "SEQ",
|
||||
|
@ -1976,9 +1971,6 @@
|
|||
]
|
||||
},
|
||||
"attr_value": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
|
@ -2002,8 +1994,6 @@
|
|||
"name": "_unquoted_string"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"_dash": {
|
||||
"type": "IMMEDIATE_TOKEN",
|
||||
|
@ -2013,13 +2003,11 @@
|
|||
}
|
||||
},
|
||||
"_colon": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "STRING",
|
||||
"value": ":"
|
||||
}
|
||||
]
|
||||
},
|
||||
"arrow": {
|
||||
"type": "TOKEN",
|
||||
|
|
|
@ -515,10 +515,6 @@
|
|||
"type": "3d",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": ":",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": ";",
|
||||
"named": false
|
||||
|
|
BIN
src/parser.c
BIN
src/parser.c
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue