wip
This commit is contained in:
@@ -27,13 +27,13 @@ module.exports = grammar({
|
||||
)),
|
||||
|
||||
attribute: $ => seq(
|
||||
$.identifier,
|
||||
field('name', $.identifier),
|
||||
'=',
|
||||
$.expression
|
||||
),
|
||||
|
||||
block: $ => seq(
|
||||
field('type', $.identifier),
|
||||
field('name', $.identifier),
|
||||
repeat(choice($.string_lit, $.identifier)),
|
||||
'{',
|
||||
optional($.body),
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
; highlights.scm
|
||||
|
||||
(block type: (identifier) @keyword)
|
||||
(block name: (identifier) @hcl_block_name)
|
||||
(attribute name: (identifier) @hcl_attribute_name)
|
||||
(identifier) @string.special
|
||||
(string_lit) @string
|
||||
(numeric_lit) @number
|
||||
|
||||
@@ -30,8 +30,12 @@
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
"type": "FIELD",
|
||||
"name": "name",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
@@ -48,7 +52,7 @@
|
||||
"members": [
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "type",
|
||||
"name": "name",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
|
||||
@@ -2,18 +2,25 @@
|
||||
{
|
||||
"type": "attribute",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"fields": {
|
||||
"name": {
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "identifier",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "expression",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "identifier",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -22,7 +29,7 @@
|
||||
"type": "block",
|
||||
"named": true,
|
||||
"fields": {
|
||||
"type": {
|
||||
"name": {
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
|
||||
@@ -294,12 +294,12 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
|
||||
};
|
||||
|
||||
enum {
|
||||
field_type = 1,
|
||||
field_name = 1,
|
||||
};
|
||||
|
||||
static const char * const ts_field_names[] = {
|
||||
[0] = NULL,
|
||||
[field_type] = "type",
|
||||
[field_name] = "name",
|
||||
};
|
||||
|
||||
static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = {
|
||||
@@ -308,7 +308,7 @@ static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = {
|
||||
|
||||
static const TSFieldMapEntry ts_field_map_entries[] = {
|
||||
[0] =
|
||||
{field_type, 0},
|
||||
{field_name, 0},
|
||||
};
|
||||
|
||||
static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = {
|
||||
@@ -2942,7 +2942,7 @@ static const TSParseActionEntry ts_parse_actions[] = {
|
||||
[109] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5),
|
||||
[111] = {.entry = {.count = 1, .reusable = true}}, SHIFT(15),
|
||||
[113] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 4, .production_id = 1),
|
||||
[115] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 3),
|
||||
[115] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 3, .production_id = 1),
|
||||
[117] = {.entry = {.count = 1, .reusable = true}}, SHIFT(14),
|
||||
[119] = {.entry = {.count = 1, .reusable = true}}, SHIFT(13),
|
||||
[121] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_block, 5, .production_id = 1),
|
||||
|
||||
Reference in New Issue
Block a user