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

View file

@ -366,6 +366,13 @@
} }
] ]
}, },
"_dash": {
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "-"
}
},
"label": { "label": {
"type": "CHOICE", "type": "CHOICE",
"members": [ "members": [
@ -1024,13 +1031,6 @@
} }
] ]
}, },
"_dash": {
"type": "IMMEDIATE_TOKEN",
"content": {
"type": "STRING",
"value": "-"
}
},
"dot": { "dot": {
"type": "IMMEDIATE_TOKEN", "type": "IMMEDIATE_TOKEN",
"content": { "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.