update: changed the way heredocs are parsed
This commit is contained in:
parent
8272d72997
commit
43b969183d
365 changed files with 20907 additions and 51362 deletions
|
|
@ -14,14 +14,14 @@
|
|||
# define CONSTANTS_H
|
||||
|
||||
# define LANGUAGE_VERSION 14
|
||||
# define STATE_COUNT 1757
|
||||
# define LARGE_STATE_COUNT 1757
|
||||
# define SYMBOL_COUNT 157
|
||||
# define STATE_COUNT 841
|
||||
# define LARGE_STATE_COUNT 841
|
||||
# define SYMBOL_COUNT 116
|
||||
# define ALIAS_COUNT 0
|
||||
# define TOKEN_COUNT 88
|
||||
# define EXTERNAL_TOKEN_COUNT 20
|
||||
# define FIELD_COUNT 20
|
||||
# define MAX_ALIAS_SEQUENCE_LENGTH 8
|
||||
# define PRODUCTION_ID_COUNT 77
|
||||
# define TOKEN_COUNT 69
|
||||
# define EXTERNAL_TOKEN_COUNT 12
|
||||
# define FIELD_COUNT 18
|
||||
# define MAX_ALIAS_SEQUENCE_LENGTH 5
|
||||
# define PRODUCTION_ID_COUNT 42
|
||||
|
||||
#endif // CONSTANTS_H
|
||||
|
|
|
|||
|
|
@ -14,26 +14,18 @@
|
|||
# define EXTERNAL_SCANNER_SYMBOL_IDENTIFIERS_H
|
||||
|
||||
enum e_external_scanner_symbol_identifiers {
|
||||
ts_external_token_heredoc_start = 0,
|
||||
ts_external_token_simple_heredoc_body = 1,
|
||||
ts_external_token__heredoc_body_beginning = 2,
|
||||
ts_external_token_heredoc_content = 3,
|
||||
ts_external_token_heredoc_end = 4,
|
||||
ts_external_token_file_descriptor = 5,
|
||||
ts_external_token__empty_value = 6,
|
||||
ts_external_token__concat = 7,
|
||||
ts_external_token_variable_name = 8,
|
||||
ts_external_token_regex = 9,
|
||||
ts_external_token__expansion_word = 10,
|
||||
ts_external_token_extglob_pattern = 11,
|
||||
ts_external_token__bare_dollar = 12,
|
||||
ts_external_token__immediate_double_hash = 13,
|
||||
ts_external_token_LT_LT = 14,
|
||||
ts_external_token_LT_LT_DASH = 15,
|
||||
ts_external_token_heredoc_redirect_token1 = 16,
|
||||
ts_external_token_LPAREN = 17,
|
||||
ts_external_token_esac = 18,
|
||||
ts_external_token___error_recovery = 19,
|
||||
ts_external_token_file_descriptor = 0,
|
||||
ts_external_token__empty_value = 1,
|
||||
ts_external_token__concat = 2,
|
||||
ts_external_token_variable_name = 3,
|
||||
ts_external_token_regex = 4,
|
||||
ts_external_token__expansion_word = 5,
|
||||
ts_external_token_extglob_pattern = 6,
|
||||
ts_external_token__bare_dollar = 7,
|
||||
ts_external_token__immediate_double_hash = 8,
|
||||
ts_external_token_terminator_token1 = 9,
|
||||
ts_external_token_LPAREN = 10,
|
||||
ts_external_token___error_recovery = 11,
|
||||
};
|
||||
|
||||
#endif // EXTERNAL_SCANNER_SYMBOL_IDENTIFIERS_H
|
||||
|
|
|
|||
|
|
@ -17,23 +17,21 @@ enum e_field_identifiers {
|
|||
field_arg = 1,
|
||||
field_args = 2,
|
||||
field_body = 3,
|
||||
field_cases = 4,
|
||||
field_cmd = 5,
|
||||
field_cond = 6,
|
||||
field_cmd = 4,
|
||||
field_cond = 5,
|
||||
field_del = 6,
|
||||
field_dest = 7,
|
||||
field_elif = 8,
|
||||
field_else = 9,
|
||||
field_len = 10,
|
||||
field_lhs = 11,
|
||||
field_name = 12,
|
||||
field_op = 13,
|
||||
field_redr = 14,
|
||||
field_rhs = 15,
|
||||
field_stmt = 16,
|
||||
field_term = 17,
|
||||
field_then = 18,
|
||||
field_value = 19,
|
||||
field_var = 20,
|
||||
field_else = 8,
|
||||
field_len = 9,
|
||||
field_lhs = 10,
|
||||
field_name = 11,
|
||||
field_op = 12,
|
||||
field_redr = 13,
|
||||
field_rhs = 14,
|
||||
field_stmt = 15,
|
||||
field_term = 16,
|
||||
field_then = 17,
|
||||
field_value = 18,
|
||||
};
|
||||
|
||||
#endif // FIELD_IDENTIFIERS_H
|
||||
|
|
|
|||
|
|
@ -15,161 +15,120 @@
|
|||
|
||||
enum e_symbols {
|
||||
sym_word = 1,
|
||||
anon_sym_for = 2,
|
||||
anon_sym_in = 3,
|
||||
anon_sym_while = 4,
|
||||
anon_sym_until = 5,
|
||||
anon_sym_do = 6,
|
||||
anon_sym_done = 7,
|
||||
anon_sym_if = 8,
|
||||
anon_sym_then = 9,
|
||||
anon_sym_fi = 10,
|
||||
anon_sym_elif = 11,
|
||||
anon_sym_else = 12,
|
||||
anon_sym_case = 13,
|
||||
anon_sym_esac = 14,
|
||||
anon_sym_LPAREN = 15,
|
||||
anon_sym_PIPE = 16,
|
||||
anon_sym_RPAREN = 17,
|
||||
anon_sym_LF = 18,
|
||||
anon_sym_SEMI_SEMI = 19,
|
||||
anon_sym_LBRACE = 20,
|
||||
anon_sym_RBRACE = 21,
|
||||
anon_sym_AMP_AMP = 22,
|
||||
anon_sym_PIPE_PIPE = 23,
|
||||
anon_sym_BANG = 24,
|
||||
anon_sym_EQ = 25,
|
||||
anon_sym_LT = 26,
|
||||
anon_sym_GT = 27,
|
||||
anon_sym_GT_GT = 28,
|
||||
anon_sym_LT_LT = 29,
|
||||
aux_sym_heredoc_redirect_token1 = 30,
|
||||
anon_sym_DOLLAR_LPAREN_LPAREN = 31,
|
||||
anon_sym_RPAREN_RPAREN = 32,
|
||||
anon_sym_PLUS = 33,
|
||||
anon_sym_DASH = 34,
|
||||
anon_sym_STAR = 35,
|
||||
anon_sym_SLASH = 36,
|
||||
anon_sym_PERCENT = 37,
|
||||
anon_sym_QMARK = 38,
|
||||
anon_sym_COLON = 39,
|
||||
anon_sym_DASH2 = 40,
|
||||
anon_sym_PLUS2 = 41,
|
||||
anon_sym_PLUS_PLUS = 42,
|
||||
anon_sym_DASH_DASH = 43,
|
||||
aux_sym_concatenation_token1 = 44,
|
||||
anon_sym_DOLLAR = 45,
|
||||
anon_sym_DQUOTE = 46,
|
||||
sym_string_content = 47,
|
||||
sym_raw_string = 48,
|
||||
sym_number = 49,
|
||||
anon_sym_POUND = 50,
|
||||
anon_sym_DOLLAR_LBRACE = 51,
|
||||
anon_sym_COLON_DASH = 52,
|
||||
anon_sym_DASH3 = 53,
|
||||
anon_sym_COLON_EQ = 54,
|
||||
anon_sym_EQ2 = 55,
|
||||
anon_sym_COLON_QMARK = 56,
|
||||
anon_sym_QMARK2 = 57,
|
||||
anon_sym_COLON_PLUS = 58,
|
||||
anon_sym_PLUS3 = 59,
|
||||
anon_sym_PERCENT_PERCENT = 60,
|
||||
aux_sym__expansion_regex_token1 = 61,
|
||||
anon_sym_DOLLAR_LPAREN = 62,
|
||||
anon_sym_BQUOTE = 63,
|
||||
sym_comment = 64,
|
||||
sym__comment_word = 65,
|
||||
aux_sym__simple_variable_name_token1 = 66,
|
||||
aux_sym__multiline_variable_name_token1 = 67,
|
||||
anon_sym_AT = 68,
|
||||
anon_sym_0 = 69,
|
||||
aux_sym__word_no_brace_token1 = 70,
|
||||
anon_sym_SEMI = 71,
|
||||
anon_sym_LT_LT_DASH = 72,
|
||||
sym_heredoc_start = 73,
|
||||
sym_simple_heredoc_body = 74,
|
||||
sym__heredoc_body_beginning = 75,
|
||||
sym_heredoc_content = 76,
|
||||
sym_heredoc_end = 77,
|
||||
sym_file_descriptor = 78,
|
||||
sym__empty_value = 79,
|
||||
sym__concat = 80,
|
||||
sym_variable_name = 81,
|
||||
sym_regex = 82,
|
||||
sym__expansion_word = 83,
|
||||
sym_extglob_pattern = 84,
|
||||
sym__bare_dollar = 85,
|
||||
sym__immediate_double_hash = 86,
|
||||
sym___error_recovery = 87,
|
||||
sym_program = 88,
|
||||
sym__statements = 89,
|
||||
aux_sym__terminated_statement = 90,
|
||||
sym__statement_not_pipeline = 91,
|
||||
sym_redirected_statement = 92,
|
||||
sym_for_statement = 93,
|
||||
sym_while_statement = 94,
|
||||
sym_do_group = 95,
|
||||
sym_if_statement = 96,
|
||||
sym_elif_clause = 97,
|
||||
sym_else_clause = 98,
|
||||
sym_case_statement = 99,
|
||||
sym__case_item_last = 100,
|
||||
sym_case_item = 101,
|
||||
sym_function_definition = 102,
|
||||
sym_compound_statement = 103,
|
||||
sym_subshell = 104,
|
||||
sym_pipeline = 105,
|
||||
sym_list = 106,
|
||||
sym_negated_command = 107,
|
||||
sym_command = 108,
|
||||
sym_command_name = 109,
|
||||
sym_variable_assignment = 110,
|
||||
sym__variable_assignments = 111,
|
||||
sym_file_redirect = 112,
|
||||
sym_heredoc_redirect = 113,
|
||||
sym__heredoc_pipeline = 114,
|
||||
sym__heredoc_expression = 115,
|
||||
aux_sym__heredoc_command = 116,
|
||||
sym__heredoc_body = 117,
|
||||
sym_heredoc_body = 118,
|
||||
sym__simple_heredoc_body = 119,
|
||||
sym_arithmetic_expansion = 120,
|
||||
sym__arithmetic_expression = 121,
|
||||
sym_arithmetic_literal = 122,
|
||||
sym_arithmetic_binary_expression = 123,
|
||||
sym_arithmetic_ternary_expression = 124,
|
||||
sym_arithmetic_unary_expression = 125,
|
||||
sym_arithmetic_postfix_expression = 126,
|
||||
sym_arithmetic_parenthesized_expression = 127,
|
||||
sym_concatenation = 128,
|
||||
sym_string = 129,
|
||||
sym_simple_expansion = 130,
|
||||
sym_expansion = 131,
|
||||
sym__expansion_body = 132,
|
||||
sym__expansion_expression = 133,
|
||||
sym__expansion_regex = 134,
|
||||
sym__concatenation_in_expansion = 135,
|
||||
sym_command_substitution = 136,
|
||||
sym__extglob_blob = 137,
|
||||
sym__word_no_brace = 138,
|
||||
sym_terminator = 139,
|
||||
aux_sym__statements_repeat1 = 140,
|
||||
aux_sym_redirected_statement_repeat1 = 141,
|
||||
aux_sym_redirected_statement_repeat2 = 142,
|
||||
aux_sym_for_statement_repeat1 = 143,
|
||||
aux_sym_if_statement_repeat1 = 144,
|
||||
aux_sym_case_statement_repeat1 = 145,
|
||||
aux_sym__case_item_last_repeat1 = 146,
|
||||
aux_sym__case_item_last_repeat2 = 147,
|
||||
aux_sym_pipeline_repeat1 = 148,
|
||||
aux_sym_command_repeat1 = 149,
|
||||
aux_sym_command_repeat2 = 150,
|
||||
aux_sym__variable_assignments_repeat1 = 151,
|
||||
aux_sym_heredoc_body_repeat1 = 152,
|
||||
aux_sym_concatenation_repeat1 = 153,
|
||||
aux_sym_string_repeat1 = 154,
|
||||
aux_sym__expansion_regex_repeat1 = 155,
|
||||
aux_sym__concatenation_in_expansion_repeat1 = 156,
|
||||
anon_sym_LBRACE = 2,
|
||||
anon_sym_RBRACE = 3,
|
||||
anon_sym_LPAREN = 4,
|
||||
anon_sym_RPAREN = 5,
|
||||
anon_sym_PIPE = 6,
|
||||
anon_sym_AMP_AMP = 7,
|
||||
anon_sym_PIPE_PIPE = 8,
|
||||
anon_sym_BANG = 9,
|
||||
anon_sym_EQ = 10,
|
||||
anon_sym_LT = 11,
|
||||
anon_sym_GT = 12,
|
||||
anon_sym_GT_GT = 13,
|
||||
anon_sym_LT_LT = 14,
|
||||
aux_sym_heredoc_redirect_token1 = 15,
|
||||
anon_sym_DOLLAR_LPAREN_LPAREN = 16,
|
||||
anon_sym_RPAREN_RPAREN = 17,
|
||||
anon_sym_PLUS = 18,
|
||||
anon_sym_DASH = 19,
|
||||
anon_sym_STAR = 20,
|
||||
anon_sym_SLASH = 21,
|
||||
anon_sym_PERCENT = 22,
|
||||
anon_sym_QMARK = 23,
|
||||
anon_sym_COLON = 24,
|
||||
anon_sym_DASH2 = 25,
|
||||
anon_sym_PLUS2 = 26,
|
||||
anon_sym_PLUS_PLUS = 27,
|
||||
anon_sym_DASH_DASH = 28,
|
||||
aux_sym_concatenation_token1 = 29,
|
||||
anon_sym_DOLLAR = 30,
|
||||
anon_sym_DQUOTE = 31,
|
||||
sym_string_content = 32,
|
||||
sym_raw_string = 33,
|
||||
sym_number = 34,
|
||||
anon_sym_POUND = 35,
|
||||
anon_sym_DOLLAR_LBRACE = 36,
|
||||
anon_sym_COLON_DASH = 37,
|
||||
anon_sym_DASH3 = 38,
|
||||
anon_sym_COLON_EQ = 39,
|
||||
anon_sym_EQ2 = 40,
|
||||
anon_sym_COLON_QMARK = 41,
|
||||
anon_sym_QMARK2 = 42,
|
||||
anon_sym_COLON_PLUS = 43,
|
||||
anon_sym_PLUS3 = 44,
|
||||
anon_sym_PERCENT_PERCENT = 45,
|
||||
aux_sym__expansion_regex_token1 = 46,
|
||||
anon_sym_DOLLAR_LPAREN = 47,
|
||||
anon_sym_BQUOTE = 48,
|
||||
sym_comment = 49,
|
||||
sym__comment_word = 50,
|
||||
aux_sym__simple_variable_name_token1 = 51,
|
||||
aux_sym__multiline_variable_name_token1 = 52,
|
||||
anon_sym_AT = 53,
|
||||
anon_sym_0 = 54,
|
||||
aux_sym__word_no_brace_token1 = 55,
|
||||
anon_sym_SEMI = 56,
|
||||
anon_sym_SEMI_SEMI = 57,
|
||||
aux_sym_terminator_token1 = 58,
|
||||
sym_file_descriptor = 59,
|
||||
sym__empty_value = 60,
|
||||
sym__concat = 61,
|
||||
sym_variable_name = 62,
|
||||
sym_regex = 63,
|
||||
sym__expansion_word = 64,
|
||||
sym_extglob_pattern = 65,
|
||||
sym__bare_dollar = 66,
|
||||
sym__immediate_double_hash = 67,
|
||||
sym___error_recovery = 68,
|
||||
sym_program = 69,
|
||||
sym__statements = 70,
|
||||
aux_sym__terminated_statement = 71,
|
||||
sym__statement_not_pipeline = 72,
|
||||
sym_redirected_statement = 73,
|
||||
sym_compound_statement = 74,
|
||||
sym_subshell = 75,
|
||||
sym_pipeline = 76,
|
||||
sym_list = 77,
|
||||
sym_negated_command = 78,
|
||||
sym_command = 79,
|
||||
sym_command_name = 80,
|
||||
sym_variable_assignment = 81,
|
||||
sym__variable_assignments = 82,
|
||||
sym_file_redirect = 83,
|
||||
sym_heredoc_redirect = 84,
|
||||
sym_arithmetic_expansion = 85,
|
||||
sym__arithmetic_expression = 86,
|
||||
sym_arithmetic_literal = 87,
|
||||
sym_arithmetic_binary_expression = 88,
|
||||
sym_arithmetic_ternary_expression = 89,
|
||||
sym_arithmetic_unary_expression = 90,
|
||||
sym_arithmetic_postfix_expression = 91,
|
||||
sym_arithmetic_parenthesized_expression = 92,
|
||||
sym_concatenation = 93,
|
||||
sym_string = 94,
|
||||
sym_simple_expansion = 95,
|
||||
sym_expansion = 96,
|
||||
sym__expansion_body = 97,
|
||||
sym__expansion_expression = 98,
|
||||
sym__expansion_regex = 99,
|
||||
sym__concatenation_in_expansion = 100,
|
||||
sym_command_substitution = 101,
|
||||
sym__word_no_brace = 102,
|
||||
sym_terminator = 103,
|
||||
aux_sym__statements_repeat1 = 104,
|
||||
aux_sym_redirected_statement_repeat1 = 105,
|
||||
aux_sym_redirected_statement_repeat2 = 106,
|
||||
aux_sym_pipeline_repeat1 = 107,
|
||||
aux_sym_command_repeat1 = 108,
|
||||
aux_sym_command_repeat2 = 109,
|
||||
aux_sym__variable_assignments_repeat1 = 110,
|
||||
aux_sym_file_redirect_repeat1 = 111,
|
||||
aux_sym_concatenation_repeat1 = 112,
|
||||
aux_sym_string_repeat1 = 113,
|
||||
aux_sym__expansion_regex_repeat1 = 114,
|
||||
aux_sym__concatenation_in_expansion_repeat1 = 115,
|
||||
};
|
||||
|
||||
#endif // SYMBOLS_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue