add highlight tests for connections

This commit is contained in:
Dmitriy Pleshevskiy 2022-12-08 01:37:35 +03:00
parent 8921cc8bbc
commit 7d4799f08a
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
5 changed files with 42 additions and 9 deletions

View File

@ -73,6 +73,8 @@ module.exports = grammar({
)
),
_dash: ($) => token.immediate("-"),
label: ($) => choice($.string, $._unquoted_string),
attr_value: ($) => seq(spaces, choice($.string, $._unquoted_string)),
@ -175,8 +177,6 @@ module.exports = grammar({
arrow: ($) => choice(/-+>/, /--+/, /<-+/, /<-+>/),
_dash: ($) => token.immediate("-"),
dot: ($) => token.immediate("."),
_unquoted_string: ($) => token.immediate(/[^'"`\n;{}]+/),

View File

@ -366,6 +366,13 @@
}
]
},
"_dash": {
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "-"
}
},
"label": {
"type": "CHOICE",
"members": [
@ -1024,13 +1031,6 @@
}
]
},
"_dash": {
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "-"
}
},
"dot": {
"type": "IMMEDIATE_TOKEN",
"content": {

Binary file not shown.

View File

@ -0,0 +1,33 @@
a <- b <-> c -- d -> e
# <- variable
# ^ operator
# ^ variable
# ^ operator
# ^ variable
# ^ operator
# ^ variable
# ^ operator
# ^ variable
a ----- b
# ^ operator
a ----> b
# ^ operator
a <---- b
# ^ operator
a <---> b
# ^ operator
a.b.c --> d.e
# <- constant
# ^ constant
# ^ variable
# ^ operator
# ^ constant
# ^ variable

Binary file not shown.