Remove 'selection_type' alias

This commit is contained in:
Bruno BELANYI 2024-04-23 14:56:10 +00:00
parent 2649422636
commit f6bc0f887a
6 changed files with 15 additions and 42 deletions

View file

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

View file

@ -51,7 +51,8 @@
(unset) (unset)
(default) (default)
] @variable.builtin ] @variable.builtin
(selection_type) @function.builtin (select_value
name: (identifier) @function.builtin)
; }}} ; }}}
; Expressions {{{ ; Expressions {{{

5
src/grammar.json generated
View file

@ -492,14 +492,9 @@
{ {
"type": "FIELD", "type": "FIELD",
"name": "name", "name": "name",
"content": {
"type": "ALIAS",
"content": { "content": {
"type": "SYMBOL", "type": "SYMBOL",
"name": "identifier" "name": "identifier"
},
"named": true,
"value": "selection_type"
} }
}, },
{ {

6
src/node-types.json generated
View file

@ -476,7 +476,7 @@
"required": true, "required": true,
"types": [ "types": [
{ {
"type": "selection_type", "type": "identifier",
"named": true "named": true
} }
] ]
@ -578,10 +578,6 @@
"type": "select", "type": "select",
"named": false "named": false
}, },
{
"type": "selection_type",
"named": true
},
{ {
"type": "true", "type": "true",
"named": false "named": false

21
src/parser.c generated
View file

@ -8,7 +8,7 @@
#define STATE_COUNT 117 #define STATE_COUNT 117
#define LARGE_STATE_COUNT 2 #define LARGE_STATE_COUNT 2
#define SYMBOL_COUNT 59 #define SYMBOL_COUNT 59
#define ALIAS_COUNT 1 #define ALIAS_COUNT 0
#define TOKEN_COUNT 30 #define TOKEN_COUNT 30
#define EXTERNAL_TOKEN_COUNT 0 #define EXTERNAL_TOKEN_COUNT 0
#define FIELD_COUNT 11 #define FIELD_COUNT 11
@ -74,7 +74,6 @@ enum ts_symbol_identifiers {
aux_sym_select_value_repeat1 = 56, aux_sym_select_value_repeat1 = 56,
aux_sym_select_cases_repeat1 = 57, aux_sym_select_cases_repeat1 = 57,
aux_sym_list_expression_repeat1 = 58, aux_sym_list_expression_repeat1 = 58,
alias_sym_selection_type = 59,
}; };
static const char * const ts_symbol_names[] = { static const char * const ts_symbol_names[] = {
@ -137,7 +136,6 @@ static const char * const ts_symbol_names[] = {
[aux_sym_select_value_repeat1] = "select_value_repeat1", [aux_sym_select_value_repeat1] = "select_value_repeat1",
[aux_sym_select_cases_repeat1] = "select_cases_repeat1", [aux_sym_select_cases_repeat1] = "select_cases_repeat1",
[aux_sym_list_expression_repeat1] = "list_expression_repeat1", [aux_sym_list_expression_repeat1] = "list_expression_repeat1",
[alias_sym_selection_type] = "selection_type",
}; };
static const TSSymbol ts_symbol_map[] = { static const TSSymbol ts_symbol_map[] = {
@ -200,7 +198,6 @@ static const TSSymbol ts_symbol_map[] = {
[aux_sym_select_value_repeat1] = aux_sym_select_value_repeat1, [aux_sym_select_value_repeat1] = aux_sym_select_value_repeat1,
[aux_sym_select_cases_repeat1] = aux_sym_select_cases_repeat1, [aux_sym_select_cases_repeat1] = aux_sym_select_cases_repeat1,
[aux_sym_list_expression_repeat1] = aux_sym_list_expression_repeat1, [aux_sym_list_expression_repeat1] = aux_sym_list_expression_repeat1,
[alias_sym_selection_type] = alias_sym_selection_type,
}; };
static const TSSymbolMetadata ts_symbol_metadata[] = { static const TSSymbolMetadata ts_symbol_metadata[] = {
@ -440,10 +437,6 @@ static const TSSymbolMetadata ts_symbol_metadata[] = {
.visible = false, .visible = false,
.named = false, .named = false,
}, },
[alias_sym_selection_type] = {
.visible = true,
.named = true,
},
}; };
enum ts_field_identifiers { enum ts_field_identifiers {
@ -564,18 +557,6 @@ static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE
[2] = { [2] = {
[1] = anon_sym_PLUS_EQ, [1] = anon_sym_PLUS_EQ,
}, },
[14] = {
[0] = alias_sym_selection_type,
},
[15] = {
[0] = alias_sym_selection_type,
},
[16] = {
[0] = alias_sym_selection_type,
},
[17] = {
[0] = alias_sym_selection_type,
},
}; };
static const uint16_t ts_non_terminal_alias_map[] = { static const uint16_t ts_non_terminal_alias_map[] = {

View file

@ -15,7 +15,7 @@ foo = select(release_variable("RELEASE_TEST"), {
(operator) (operator)
(select_expression (select_expression
(select_value (select_value
(selection_type) (identifier)
(interpreted_string_literal)) (interpreted_string_literal))
(select_cases (select_cases
(select_case (select_case
@ -42,7 +42,7 @@ foo = select(soong_config_variable("my_namespace", "my_var"), {
(operator) (operator)
(select_expression (select_expression
(select_value (select_value
(selection_type) (identifier)
(interpreted_string_literal) (interpreted_string_literal)
(interpreted_string_literal)) (interpreted_string_literal))
(select_cases (select_cases
@ -72,7 +72,7 @@ foo = select(variant("arch"), {
(operator) (operator)
(select_expression (select_expression
(select_value (select_value
(selection_type) (identifier)
(interpreted_string_literal)) (interpreted_string_literal))
(select_cases (select_cases
(select_case (select_case
@ -102,7 +102,7 @@ foo = select(variant("VARIANT"), {})
(operator) (operator)
(select_expression (select_expression
(select_value (select_value
(selection_type) (identifier)
(interpreted_string_literal)) (interpreted_string_literal))
(select_cases)))) (select_cases))))
@ -126,7 +126,7 @@ foo = select(variant("VARIANT"), {
(operator) (operator)
(select_expression (select_expression
(select_value (select_value
(selection_type) (identifier)
(interpreted_string_literal)) (interpreted_string_literal))
(select_cases (select_cases
(select_case (select_case
@ -162,7 +162,7 @@ foo = select(variant(), {
(operator) (operator)
(select_expression (select_expression
(select_value (select_value
(selection_type)) (identifier))
(select_cases (select_cases
(select_case (select_case
(interpreted_string_literal) (interpreted_string_literal)
@ -188,7 +188,7 @@ foo = select(some_unknown_type("CONDITION"), {
(operator) (operator)
(select_expression (select_expression
(select_value (select_value
(selection_type) (identifier)
(interpreted_string_literal)) (interpreted_string_literal))
(select_cases (select_cases
(select_case (select_case
@ -215,7 +215,7 @@ foo = select(release_variable("ONE", "TWO"), {
(operator) (operator)
(select_expression (select_expression
(select_value (select_value
(selection_type) (identifier)
(interpreted_string_literal) (interpreted_string_literal)
(interpreted_string_literal)) (interpreted_string_literal))
(select_cases (select_cases