Silence missing-initializer warnings for gcc
This commit is contained in:
parent
02f3fe2b04
commit
5145bba53d
6 changed files with 33 additions and 15 deletions
|
|
@ -530,6 +530,9 @@ LEX_STATES = {
|
|||
[133] = 26,
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
|
||||
PARSE_TABLE = {
|
||||
[0] = {
|
||||
[ts_sym__operand1] = SHIFT(1),
|
||||
|
|
@ -549,7 +552,7 @@ PARSE_TABLE = {
|
|||
[1] = {
|
||||
[ts_aux_sym_token3] = SHIFT(2),
|
||||
[ts_aux_sym_token4] = SHIFT(100),
|
||||
[ts_builtin_sym_end] = REDUCE(ts_sym_difference, 1),
|
||||
[ts_builtin_sym_end] = REDUCE(ts_sym_sum, 1),
|
||||
},
|
||||
[2] = {
|
||||
[ts_sym__operand1] = SHIFT(3),
|
||||
|
|
@ -569,7 +572,7 @@ PARSE_TABLE = {
|
|||
[4] = {
|
||||
[ts_aux_sym_token5] = SHIFT(5),
|
||||
[ts_aux_sym_token6] = SHIFT(85),
|
||||
[ts_builtin_sym_end] = REDUCE(ts_sym_product, 1),
|
||||
[ts_builtin_sym_end] = REDUCE(ts_sym_quotient, 1),
|
||||
},
|
||||
[5] = {
|
||||
[ts_sym__operand2] = SHIFT(6),
|
||||
|
|
@ -617,7 +620,7 @@ PARSE_TABLE = {
|
|||
[ts_builtin_sym_error] = SHIFT(78),
|
||||
},
|
||||
[12] = {
|
||||
[ts_aux_sym_token2] = REDUCE(ts_sym_difference, 1),
|
||||
[ts_aux_sym_token2] = REDUCE(ts_sym_sum, 1),
|
||||
[ts_aux_sym_token3] = SHIFT(13),
|
||||
[ts_aux_sym_token4] = SHIFT(76),
|
||||
},
|
||||
|
|
@ -687,9 +690,9 @@ PARSE_TABLE = {
|
|||
[ts_builtin_sym_error] = SHIFT(54),
|
||||
},
|
||||
[23] = {
|
||||
[ts_aux_sym_token2] = REDUCE(ts_sym_quotient, 1),
|
||||
[ts_aux_sym_token2] = REDUCE(ts_sym_product, 1),
|
||||
[ts_aux_sym_token3] = REDUCE(ts_sym_quotient, 1),
|
||||
[ts_aux_sym_token4] = REDUCE(ts_sym_product, 1),
|
||||
[ts_aux_sym_token4] = REDUCE(ts_sym_quotient, 1),
|
||||
[ts_aux_sym_token5] = SHIFT(24),
|
||||
[ts_aux_sym_token6] = SHIFT(52),
|
||||
},
|
||||
|
|
@ -1208,11 +1211,11 @@ PARSE_TABLE = {
|
|||
[ts_builtin_sym_end] = REDUCE(ts_sym_difference, 3),
|
||||
},
|
||||
[102] = {
|
||||
[ts_aux_sym_token3] = REDUCE(ts_sym_quotient, 1),
|
||||
[ts_aux_sym_token3] = REDUCE(ts_sym_product, 1),
|
||||
[ts_aux_sym_token4] = REDUCE(ts_sym_quotient, 1),
|
||||
[ts_aux_sym_token5] = SHIFT(103),
|
||||
[ts_aux_sym_token6] = SHIFT(117),
|
||||
[ts_builtin_sym_end] = REDUCE(ts_sym_quotient, 1),
|
||||
[ts_builtin_sym_end] = REDUCE(ts_sym_product, 1),
|
||||
},
|
||||
[103] = {
|
||||
[ts_sym__operand2] = SHIFT(104),
|
||||
|
|
@ -1435,4 +1438,6 @@ PARSE_TABLE = {
|
|||
},
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
EXPORT_PARSER(ts_parser_arithmetic);
|
||||
|
|
|
|||
|
|
@ -1304,6 +1304,9 @@ LEX_STATES = {
|
|||
[195] = 75,
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
|
||||
PARSE_TABLE = {
|
||||
[0] = {
|
||||
[ts_sym__package] = SHIFT(1),
|
||||
|
|
@ -2429,4 +2432,6 @@ PARSE_TABLE = {
|
|||
},
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
EXPORT_PARSER(ts_parser_golang);
|
||||
|
|
|
|||
|
|
@ -2686,6 +2686,9 @@ LEX_STATES = {
|
|||
[603] = 140,
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
|
||||
PARSE_TABLE = {
|
||||
[0] = {
|
||||
[ts_sym__break] = SHIFT(1),
|
||||
|
|
@ -8843,4 +8846,6 @@ PARSE_TABLE = {
|
|||
},
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
EXPORT_PARSER(ts_parser_javascript);
|
||||
|
|
|
|||
|
|
@ -424,6 +424,9 @@ LEX_STATES = {
|
|||
[59] = 0,
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
|
||||
PARSE_TABLE = {
|
||||
[0] = {
|
||||
[ts_sym_array] = SHIFT(1),
|
||||
|
|
@ -738,4 +741,6 @@ PARSE_TABLE = {
|
|||
},
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
EXPORT_PARSER(ts_parser_json);
|
||||
|
|
|
|||
|
|
@ -9,13 +9,6 @@ extern "C" {
|
|||
#include <stdio.h>
|
||||
#include "tree_sitter/runtime.h"
|
||||
|
||||
/*
|
||||
* Parsing DSL Macros
|
||||
*
|
||||
* Generated parser use these macros. They prevent the code generator
|
||||
* from having too much knowledge of the runtime types and functions.
|
||||
*/
|
||||
|
||||
//#define TS_DEBUG_PARSE
|
||||
//#define TS_DEBUG_LEX
|
||||
|
||||
|
|
|
|||
|
|
@ -239,6 +239,9 @@ namespace tree_sitter {
|
|||
string parse_table_array() {
|
||||
size_t state_id = 0;
|
||||
return join({
|
||||
"#pragma GCC diagnostic push",
|
||||
"#pragma GCC diagnostic ignored \"-Wmissing-field-initializers\"",
|
||||
"",
|
||||
"PARSE_TABLE = {",
|
||||
indent(join(map_to_string<ParseState>(parse_table.states, [&](ParseState state) {
|
||||
string result = "[" + to_string(state_id++) + "] = {\n";
|
||||
|
|
@ -246,7 +249,9 @@ namespace tree_sitter {
|
|||
result += indent("[" + symbol_id(pair.first) + "] = " + code_for_parse_action(pair.second) + ",") + "\n";
|
||||
return result + "},";
|
||||
}), "\n")),
|
||||
"};"
|
||||
"};",
|
||||
"",
|
||||
"#pragma GCC diagnostic pop"
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue