Rename fields in 'select_value'

This aligns with upstream, and makes more sense given their usage.
This commit is contained in:
Bruno BELANYI 2024-04-23 14:52:36 +00:00
parent c56e2eca70
commit 734f4452dd
4 changed files with 36 additions and 32 deletions

View file

@ -128,9 +128,9 @@ module.exports = grammar({
), ),
select_value: ($) => seq( select_value: ($) => seq(
field("type", alias($.identifier, $.selection_type)), field("name", alias($.identifier, $.selection_type)),
"(", "(",
field("condition", optional(commaSeparated($._string_literal))), field("arguments", optional(commaSeparated($._string_literal))),
")", ")",
), ),

4
src/grammar.json generated
View file

@ -491,7 +491,7 @@
"members": [ "members": [
{ {
"type": "FIELD", "type": "FIELD",
"name": "type", "name": "name",
"content": { "content": {
"type": "ALIAS", "type": "ALIAS",
"content": { "content": {
@ -508,7 +508,7 @@
}, },
{ {
"type": "FIELD", "type": "FIELD",
"name": "condition", "name": "arguments",
"content": { "content": {
"type": "CHOICE", "type": "CHOICE",
"members": [ "members": [

4
src/node-types.json generated
View file

@ -453,7 +453,7 @@
"type": "select_value", "type": "select_value",
"named": true, "named": true,
"fields": { "fields": {
"condition": { "arguments": {
"multiple": true, "multiple": true,
"required": false, "required": false,
"types": [ "types": [
@ -471,7 +471,7 @@
} }
] ]
}, },
"type": { "name": {
"multiple": false, "multiple": false,
"required": true, "required": true,
"types": [ "types": [

56
src/parser.c generated
View file

@ -11,7 +11,7 @@
#define ALIAS_COUNT 1 #define ALIAS_COUNT 1
#define TOKEN_COUNT 30 #define TOKEN_COUNT 30
#define EXTERNAL_TOKEN_COUNT 0 #define EXTERNAL_TOKEN_COUNT 0
#define FIELD_COUNT 10 #define FIELD_COUNT 11
#define MAX_ALIAS_SEQUENCE_LENGTH 6 #define MAX_ALIAS_SEQUENCE_LENGTH 6
#define PRODUCTION_ID_COUNT 19 #define PRODUCTION_ID_COUNT 19
@ -447,24 +447,26 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
}; };
enum ts_field_identifiers { enum ts_field_identifiers {
field_condition = 1, field_arguments = 1,
field_element = 2, field_element = 2,
field_field = 3, field_field = 3,
field_left = 4, field_left = 4,
field_operator = 5, field_name = 5,
field_pattern = 6, field_operator = 6,
field_property = 7, field_pattern = 7,
field_right = 8, field_property = 8,
field_type = 9, field_right = 9,
field_value = 10, field_type = 10,
field_value = 11,
}; };
static const char * const ts_field_names[] = { static const char * const ts_field_names[] = {
[0] = NULL, [0] = NULL,
[field_condition] = "condition", [field_arguments] = "arguments",
[field_element] = "element", [field_element] = "element",
[field_field] = "field", [field_field] = "field",
[field_left] = "left", [field_left] = "left",
[field_name] = "name",
[field_operator] = "operator", [field_operator] = "operator",
[field_pattern] = "pattern", [field_pattern] = "pattern",
[field_property] = "property", [field_property] = "property",
@ -487,11 +489,11 @@ static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = {
[11] = {.index = 23, .length = 4}, [11] = {.index = 23, .length = 4},
[12] = {.index = 27, .length = 2}, [12] = {.index = 27, .length = 2},
[13] = {.index = 29, .length = 2}, [13] = {.index = 29, .length = 2},
[14] = {.index = 5, .length = 1}, [14] = {.index = 31, .length = 1},
[15] = {.index = 31, .length = 2}, [15] = {.index = 32, .length = 2},
[16] = {.index = 33, .length = 3}, [16] = {.index = 34, .length = 3},
[17] = {.index = 36, .length = 4}, [17] = {.index = 37, .length = 4},
[18] = {.index = 40, .length = 2}, [18] = {.index = 41, .length = 2},
}; };
static const TSFieldMapEntry ts_field_map_entries[] = { static const TSFieldMapEntry ts_field_map_entries[] = {
@ -539,18 +541,20 @@ static const TSFieldMapEntry ts_field_map_entries[] = {
{field_element, 0, .inherited = true}, {field_element, 0, .inherited = true},
{field_element, 1, .inherited = true}, {field_element, 1, .inherited = true},
[31] = [31] =
{field_condition, 2}, {field_name, 0},
{field_type, 0}, [32] =
[33] = {field_arguments, 2},
{field_condition, 2}, {field_name, 0},
{field_condition, 3}, [34] =
{field_type, 0}, {field_arguments, 2},
[36] = {field_arguments, 3},
{field_condition, 2}, {field_name, 0},
{field_condition, 3}, [37] =
{field_condition, 4}, {field_arguments, 2},
{field_type, 0}, {field_arguments, 3},
[40] = {field_arguments, 4},
{field_name, 0},
[41] =
{field_pattern, 0}, {field_pattern, 0},
{field_value, 2}, {field_value, 2},
}; };