grammar: add vertical-gap, horizontal-gap

Closes #14
This commit is contained in:
Dmitriy Pleshevskiy 2023-06-14 18:11:42 +03:00
parent c6b812fd8d
commit d1ace018ae
Signed by: pleshevskiy
GPG Key ID: 79C4487B44403985
6 changed files with 39 additions and 2 deletions

View File

@ -237,7 +237,14 @@ module.exports = grammar({
seq(alias($._style_attr_key, $.attr_key), $._colon, $.attr_value)
),
_grid_attr_key: ($) => choice("grid-gap", "grid-columns", "grid-rows"),
_grid_attr_key: ($) =>
choice(
"vertical-gap",
"horizontal-gap",
"grid-gap",
"grid-columns",
"grid-rows"
),
_style_attr_key: ($) => choice($._common_style_attr_key, "3d"),
_common_style_attr_key: ($) =>

View File

@ -981,6 +981,14 @@
"_grid_attr_key": {
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": "vertical-gap"
},
{
"type": "STRING",
"value": "horizontal-gap"
},
{
"type": "STRING",
"value": "grid-gap"

View File

@ -444,6 +444,10 @@
"type": "height",
"named": false
},
{
"type": "horizontal-gap",
"named": false
},
{
"type": "icon",
"named": false
@ -528,6 +532,10 @@
"type": "underline",
"named": false
},
{
"type": "vertical-gap",
"named": false
},
{
"type": "width",
"named": false

Binary file not shown.

View File

@ -450,7 +450,8 @@ grid-columns: 1
header
body: "" {
grid-gap: 0
vertical-gap: 0
horizontal-gap: 0
grid-columns: 2
content
@ -469,6 +470,7 @@ footer
(container_key)
(label (string))
(block
(attribute (attr_key) (attr_value (integer)))
(attribute (attr_key) (attr_value (integer)))
(attribute (attr_key) (attr_value (integer)))
(shape (shape_key))

View File

@ -8,6 +8,18 @@ grid-columns: 1
# <- property
# ^ punctuation.delimiter
# ^ number
vertical-gap: 0
# <- property
# ^ property
# ^ property
# ^ punctuation.delimiter
# ^ number
horizontal-gap: 0
# <- property
# ^ property
# ^ property
# ^ punctuation.delimiter
# ^ number
header
# <- variable