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) 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"), _style_attr_key: ($) => choice($._common_style_attr_key, "3d"),
_common_style_attr_key: ($) => _common_style_attr_key: ($) =>

View File

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

View File

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

Binary file not shown.

View File

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

View File

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