diff --git a/corpus/control_flow.txt b/corpus/control_flow.txt index c230409..a904a09 100644 --- a/corpus/control_flow.txt +++ b/corpus/control_flow.txt @@ -15,3 +15,31 @@ done (do_group (command (command_name) (argument)) (command (command_name) (argument))))) + +==================================== +If statements +==================================== + +if cat some_file | grep -v ok; then + echo one +elif cat other_file | grep -v ok; then + echo two +else + exit +fi + +--- + +(program + (if_statement + (pipeline + (command (command_name) (argument)) + (command (command_name) (argument) (argument))) + (command (command_name) (argument)) + (elif_clause + (pipeline + (command (command_name) (argument)) + (command (command_name) (argument) (argument))) + (command (command_name) (argument))) + (else_clause + (command (command_name))))) diff --git a/grammar.js b/grammar.js index 42bdcd5..ddfe5ed 100644 --- a/grammar.js +++ b/grammar.js @@ -26,6 +26,7 @@ module.exports = grammar({ statement: $ => choice( $.command, $.while_statement, + $.if_statement, $.pipeline, $.list ), @@ -36,6 +37,28 @@ module.exports = grammar({ $.do_group ), + if_statement: $ => seq( + 'if', + $._terminated_statement, + 'then', + repeat($._terminated_statement), + repeat($.elif_clause), + optional($.else_clause), + 'fi' + ), + + elif_clause: $ => seq( + 'elif', + $._terminated_statement, + 'then', + repeat($._terminated_statement) + ), + + else_clause: $ => seq( + 'else', + repeat($._terminated_statement) + ), + do_group: $ => seq( 'do', repeat($._terminated_statement), diff --git a/src/grammar.json b/src/grammar.json index eff1e6d..1299160 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -45,6 +45,10 @@ "type": "SYMBOL", "name": "while_statement" }, + { + "type": "SYMBOL", + "name": "if_statement" + }, { "type": "SYMBOL", "name": "pipeline" @@ -72,6 +76,93 @@ } ] }, + "if_statement": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "if" + }, + { + "type": "SYMBOL", + "name": "_terminated_statement" + }, + { + "type": "STRING", + "value": "then" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_terminated_statement" + } + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "elif_clause" + } + }, + { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "else_clause" + }, + { + "type": "BLANK" + } + ] + }, + { + "type": "STRING", + "value": "fi" + } + ] + }, + "elif_clause": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "elif" + }, + { + "type": "SYMBOL", + "name": "_terminated_statement" + }, + { + "type": "STRING", + "value": "then" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_terminated_statement" + } + } + ] + }, + "else_clause": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "else" + }, + { + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "_terminated_statement" + } + } + ] + }, "do_group": { "type": "SEQ", "members": [ diff --git a/src/parser.c b/src/parser.c index b3b6f48..013fa15 100644 --- a/src/parser.c +++ b/src/parser.c @@ -4,9 +4,9 @@ #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #define LANGUAGE_VERSION 3 -#define STATE_COUNT 114 -#define SYMBOL_COUNT 50 -#define TOKEN_COUNT 32 +#define STATE_COUNT 145 +#define SYMBOL_COUNT 59 +#define TOKEN_COUNT 37 #define EXTERNAL_TOKEN_COUNT 4 #define MAX_RENAME_SEQUENCE_LENGTH 5 @@ -19,52 +19,61 @@ enum { anon_sym_SEMI_SEMI = 6, anon_sym_LF = 7, anon_sym_while = 8, - anon_sym_do = 9, - anon_sym_done = 10, - aux_sym_SLASH_BSLASHs_PLUS_SLASH = 11, - anon_sym_PIPE = 12, - anon_sym_PIPE_AMP = 13, - anon_sym_AMP_AMP = 14, - anon_sym_PIPE_PIPE = 15, - anon_sym_EQ = 16, - anon_sym_DOLLAR = 17, - anon_sym_DOLLAR_LBRACE = 18, - anon_sym_COLON = 19, - anon_sym_COLON_QMARK = 20, - anon_sym_RBRACE = 21, - anon_sym_LT = 22, - anon_sym_GT = 23, - anon_sym_LT_AMP = 24, - anon_sym_GT_AMP = 25, - anon_sym_LT_LT = 26, - anon_sym_LT_LT_DASH = 27, - sym_file_descriptor = 28, - sym_leading_word = 29, - sym_word = 30, - sym_comment = 31, - sym_program = 32, - sym__terminated_statement = 33, - sym_while_statement = 34, - sym_do_group = 35, - sym_command = 36, - sym_pipeline = 37, - sym_list = 38, - sym_environment_variable_assignment = 39, - sym_expansion = 40, - sym_operator_expansion = 41, - sym_file_redirect = 42, - sym_heredoc_redirect = 43, - sym_heredoc = 44, - aux_sym_program_repeat1 = 45, - aux_sym_command_repeat1 = 46, - aux_sym_command_repeat2 = 47, - aux_sym_command_repeat3 = 48, - aux_sym_heredoc_repeat1 = 49, - rename_sym_1 = 50, - rename_sym_argument = 51, - rename_sym_command_name = 52, - rename_sym_file_name = 53, - rename_sym_variable_name = 54, + anon_sym_if = 9, + anon_sym_then = 10, + anon_sym_fi = 11, + anon_sym_elif = 12, + anon_sym_else = 13, + anon_sym_do = 14, + anon_sym_done = 15, + aux_sym_SLASH_BSLASHs_PLUS_SLASH = 16, + anon_sym_PIPE = 17, + anon_sym_PIPE_AMP = 18, + anon_sym_AMP_AMP = 19, + anon_sym_PIPE_PIPE = 20, + anon_sym_EQ = 21, + anon_sym_DOLLAR = 22, + anon_sym_DOLLAR_LBRACE = 23, + anon_sym_COLON = 24, + anon_sym_COLON_QMARK = 25, + anon_sym_RBRACE = 26, + anon_sym_LT = 27, + anon_sym_GT = 28, + anon_sym_LT_AMP = 29, + anon_sym_GT_AMP = 30, + anon_sym_LT_LT = 31, + anon_sym_LT_LT_DASH = 32, + sym_file_descriptor = 33, + sym_leading_word = 34, + sym_word = 35, + sym_comment = 36, + sym_program = 37, + sym__terminated_statement = 38, + sym_while_statement = 39, + sym_if_statement = 40, + sym_elif_clause = 41, + sym_else_clause = 42, + sym_do_group = 43, + sym_command = 44, + sym_pipeline = 45, + sym_list = 46, + sym_environment_variable_assignment = 47, + sym_expansion = 48, + sym_operator_expansion = 49, + sym_file_redirect = 50, + sym_heredoc_redirect = 51, + sym_heredoc = 52, + aux_sym_program_repeat1 = 53, + aux_sym_if_statement_repeat1 = 54, + aux_sym_command_repeat1 = 55, + aux_sym_command_repeat2 = 56, + aux_sym_command_repeat3 = 57, + aux_sym_heredoc_repeat1 = 58, + rename_sym_1 = 59, + rename_sym_argument = 60, + rename_sym_command_name = 61, + rename_sym_file_name = 62, + rename_sym_variable_name = 63, }; static const char *ts_symbol_names[] = { @@ -77,6 +86,11 @@ static const char *ts_symbol_names[] = { [anon_sym_SEMI_SEMI] = ";;", [anon_sym_LF] = "\n", [anon_sym_while] = "while", + [anon_sym_if] = "if", + [anon_sym_then] = "then", + [anon_sym_fi] = "fi", + [anon_sym_elif] = "elif", + [anon_sym_else] = "else", [anon_sym_do] = "do", [anon_sym_done] = "done", [aux_sym_SLASH_BSLASHs_PLUS_SLASH] = "/\\s+/", @@ -103,6 +117,9 @@ static const char *ts_symbol_names[] = { [sym_program] = "program", [sym__terminated_statement] = "_terminated_statement", [sym_while_statement] = "while_statement", + [sym_if_statement] = "if_statement", + [sym_elif_clause] = "elif_clause", + [sym_else_clause] = "else_clause", [sym_do_group] = "do_group", [sym_command] = "command", [sym_pipeline] = "pipeline", @@ -114,6 +131,7 @@ static const char *ts_symbol_names[] = { [sym_heredoc_redirect] = "heredoc_redirect", [sym_heredoc] = "heredoc", [aux_sym_program_repeat1] = "program_repeat1", + [aux_sym_if_statement_repeat1] = "if_statement_repeat1", [aux_sym_command_repeat1] = "command_repeat1", [aux_sym_command_repeat2] = "command_repeat2", [aux_sym_command_repeat3] = "command_repeat3", @@ -180,6 +198,36 @@ static const TSSymbolMetadata ts_symbol_metadata[SYMBOL_COUNT] = { .structural = true, .extra = false, }, + [anon_sym_if] = { + .visible = true, + .named = false, + .structural = true, + .extra = false, + }, + [anon_sym_then] = { + .visible = true, + .named = false, + .structural = true, + .extra = false, + }, + [anon_sym_fi] = { + .visible = true, + .named = false, + .structural = true, + .extra = false, + }, + [anon_sym_elif] = { + .visible = true, + .named = false, + .structural = true, + .extra = false, + }, + [anon_sym_else] = { + .visible = true, + .named = false, + .structural = true, + .extra = false, + }, [anon_sym_do] = { .visible = true, .named = false, @@ -336,6 +384,24 @@ static const TSSymbolMetadata ts_symbol_metadata[SYMBOL_COUNT] = { .structural = true, .extra = false, }, + [sym_if_statement] = { + .visible = true, + .named = true, + .structural = true, + .extra = false, + }, + [sym_elif_clause] = { + .visible = true, + .named = true, + .structural = true, + .extra = false, + }, + [sym_else_clause] = { + .visible = true, + .named = true, + .structural = true, + .extra = false, + }, [sym_do_group] = { .visible = true, .named = true, @@ -402,6 +468,12 @@ static const TSSymbolMetadata ts_symbol_metadata[SYMBOL_COUNT] = { .structural = true, .extra = false, }, + [aux_sym_if_statement_repeat1] = { + .visible = false, + .named = false, + .structural = true, + .extra = false, + }, [aux_sym_command_repeat1] = { .visible = false, .named = false, @@ -507,19 +579,27 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { SKIP(18); if (lookahead == 'd') ADVANCE(19); - if (lookahead == 'w') + if (lookahead == 'e') ADVANCE(23); + if (lookahead == 'f') + ADVANCE(29); + if (lookahead == 'i') + ADVANCE(31); + if (lookahead == 't') + ADVANCE(33); + if (lookahead == 'w') + ADVANCE(37); if (lookahead == '|') - ADVANCE(28); + ADVANCE(42); if (lookahead == '}') - ADVANCE(30); + ADVANCE(44); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(31); + ADVANCE(45); END_STATE(); case 1: ACCEPT_TOKEN(ts_builtin_sym_end); @@ -611,68 +691,123 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { ACCEPT_TOKEN(anon_sym_done); END_STATE(); case 23: - if (lookahead == 'h') + if (lookahead == 'l') ADVANCE(24); END_STATE(); case 24: if (lookahead == 'i') ADVANCE(25); + if (lookahead == 's') + ADVANCE(27); END_STATE(); case 25: - if (lookahead == 'l') + if (lookahead == 'f') ADVANCE(26); END_STATE(); case 26: - if (lookahead == 'e') - ADVANCE(27); + ACCEPT_TOKEN(anon_sym_elif); END_STATE(); case 27: - ACCEPT_TOKEN(anon_sym_while); + if (lookahead == 'e') + ADVANCE(28); END_STATE(); case 28: - ACCEPT_TOKEN(anon_sym_PIPE); - if (lookahead == '|') - ADVANCE(29); + ACCEPT_TOKEN(anon_sym_else); END_STATE(); case 29: - ACCEPT_TOKEN(anon_sym_PIPE_PIPE); + if (lookahead == 'i') + ADVANCE(30); END_STATE(); case 30: - ACCEPT_TOKEN(anon_sym_RBRACE); + ACCEPT_TOKEN(anon_sym_fi); END_STATE(); case 31: - ACCEPT_TOKEN(sym_file_descriptor); - if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(31); + if (lookahead == 'f') + ADVANCE(32); END_STATE(); case 32: + ACCEPT_TOKEN(anon_sym_if); + END_STATE(); + case 33: + if (lookahead == 'h') + ADVANCE(34); + END_STATE(); + case 34: + if (lookahead == 'e') + ADVANCE(35); + END_STATE(); + case 35: + if (lookahead == 'n') + ADVANCE(36); + END_STATE(); + case 36: + ACCEPT_TOKEN(anon_sym_then); + END_STATE(); + case 37: + if (lookahead == 'h') + ADVANCE(38); + END_STATE(); + case 38: + if (lookahead == 'i') + ADVANCE(39); + END_STATE(); + case 39: + if (lookahead == 'l') + ADVANCE(40); + END_STATE(); + case 40: + if (lookahead == 'e') + ADVANCE(41); + END_STATE(); + case 41: + ACCEPT_TOKEN(anon_sym_while); + END_STATE(); + case 42: + ACCEPT_TOKEN(anon_sym_PIPE); + if (lookahead == '|') + ADVANCE(43); + END_STATE(); + case 43: + ACCEPT_TOKEN(anon_sym_PIPE_PIPE); + END_STATE(); + case 44: + ACCEPT_TOKEN(anon_sym_RBRACE); + END_STATE(); + case 45: + ACCEPT_TOKEN(sym_file_descriptor); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE(45); + END_STATE(); + case 46: if (lookahead == 0) ADVANCE(1); if (lookahead == '#') ADVANCE(2); if (lookahead == '<') - ADVANCE(33); + ADVANCE(47); if (lookahead == '>') - ADVANCE(36); + ADVANCE(50); if (lookahead == '\\') - SKIP(38); + SKIP(52); + if (lookahead == 'i') + ADVANCE(53); if (lookahead == 'w') - ADVANCE(39); + ADVANCE(55); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(32); + SKIP(46); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(44); + ADVANCE(60); if ((lookahead < '0' || lookahead > '>') && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 33: + case 47: ACCEPT_TOKEN(anon_sym_LT); if (lookahead == '&') - ADVANCE(34); + ADVANCE(48); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -684,9 +819,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 34: + case 48: ACCEPT_TOKEN(anon_sym_LT_AMP); if (lookahead != 0 && lookahead != '\t' && @@ -699,9 +834,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 35: + case 49: ACCEPT_TOKEN(sym_leading_word); if (lookahead != 0 && lookahead != '\t' && @@ -714,12 +849,12 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 36: + case 50: ACCEPT_TOKEN(anon_sym_GT); if (lookahead == '&') - ADVANCE(37); + ADVANCE(51); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -731,9 +866,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 37: + case 51: ACCEPT_TOKEN(anon_sym_GT_AMP); if (lookahead != 0 && lookahead != '\t' && @@ -746,16 +881,48 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 38: + case 52: if (lookahead == '\n') - SKIP(32); + SKIP(46); END_STATE(); - case 39: + case 53: + ACCEPT_TOKEN(sym_leading_word); + if (lookahead == 'f') + ADVANCE(54); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 54: + ACCEPT_TOKEN(anon_sym_if); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 55: ACCEPT_TOKEN(sym_leading_word); if (lookahead == 'h') - ADVANCE(40); + ADVANCE(56); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -767,12 +934,12 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 40: + case 56: ACCEPT_TOKEN(sym_leading_word); if (lookahead == 'i') - ADVANCE(41); + ADVANCE(57); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -784,12 +951,12 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 41: + case 57: ACCEPT_TOKEN(sym_leading_word); if (lookahead == 'l') - ADVANCE(42); + ADVANCE(58); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -801,12 +968,12 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 42: + case 58: ACCEPT_TOKEN(sym_leading_word); if (lookahead == 'e') - ADVANCE(43); + ADVANCE(59); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -818,9 +985,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 43: + case 59: ACCEPT_TOKEN(anon_sym_while); if (lookahead != 0 && lookahead != '\t' && @@ -833,52 +1000,54 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 44: + case 60: ACCEPT_TOKEN(sym_file_descriptor); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(44); + ADVANCE(60); END_STATE(); - case 45: + case 61: if (lookahead == '#') ADVANCE(2); if (lookahead == '<') - ADVANCE(33); + ADVANCE(47); if (lookahead == '>') - ADVANCE(36); + ADVANCE(50); if (lookahead == '\\') - SKIP(46); + SKIP(62); + if (lookahead == 'i') + ADVANCE(53); if (lookahead == 'w') - ADVANCE(39); + ADVANCE(55); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(45); + SKIP(61); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(44); + ADVANCE(60); if (lookahead != 0 && (lookahead < '0' || lookahead > '>') && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 46: + case 62: if (lookahead == '\n') - SKIP(45); + SKIP(61); END_STATE(); - case 47: + case 63: if (lookahead == '#') ADVANCE(2); if (lookahead == '\\') - SKIP(48); + SKIP(64); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(47); + SKIP(63); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(49); + ADVANCE(65); if (lookahead != 0 && lookahead != '#' && lookahead != '$' && @@ -888,18 +1057,18 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '>' && lookahead != '{' && lookahead != '}') - ADVANCE(50); + ADVANCE(66); END_STATE(); - case 48: + case 64: if (lookahead == '\n') - SKIP(47); + SKIP(63); END_STATE(); - case 49: + case 65: ACCEPT_TOKEN(sym_file_descriptor); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(49); + ADVANCE(65); END_STATE(); - case 50: + case 66: ACCEPT_TOKEN(sym_word); if (lookahead != 0 && lookahead != '\t' && @@ -915,35 +1084,35 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '\\' && lookahead != '{' && lookahead != '}') - ADVANCE(50); + ADVANCE(66); END_STATE(); - case 51: + case 67: if (lookahead == '#') ADVANCE(2); if (lookahead == '<') - ADVANCE(52); + ADVANCE(68); if (lookahead == '>') ADVANCE(16); if (lookahead == '\\') - SKIP(53); + SKIP(69); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(51); + SKIP(67); END_STATE(); - case 52: + case 68: ACCEPT_TOKEN(anon_sym_LT); if (lookahead == '&') ADVANCE(12); END_STATE(); - case 53: + case 69: if (lookahead == '\n') - SKIP(51); + SKIP(67); END_STATE(); - case 54: + case 70: if (lookahead == '\n') - ADVANCE(55); + ADVANCE(71); if (lookahead == '#') ADVANCE(2); if (lookahead == '&') @@ -957,99 +1126,105 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '>') ADVANCE(16); if (lookahead == '\\') - SKIP(57); + SKIP(73); if (lookahead == '|') - ADVANCE(58); + ADVANCE(74); if (lookahead == '\t' || lookahead == '\r' || lookahead == ' ') - ADVANCE(56); + ADVANCE(72); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(31); + ADVANCE(45); END_STATE(); - case 55: + case 71: ACCEPT_TOKEN(anon_sym_LF); if (lookahead == '\n') - ADVANCE(55); + ADVANCE(71); if (lookahead == '\t' || lookahead == '\r' || lookahead == ' ') - ADVANCE(56); + ADVANCE(72); END_STATE(); - case 56: + case 72: ACCEPT_TOKEN(aux_sym_SLASH_BSLASHs_PLUS_SLASH); if (lookahead == '\n') - ADVANCE(55); + ADVANCE(71); if (lookahead == '\t' || lookahead == '\r' || lookahead == ' ') - ADVANCE(56); + ADVANCE(72); END_STATE(); - case 57: + case 73: if (lookahead == '\n') - SKIP(54); + SKIP(70); END_STATE(); - case 58: + case 74: ACCEPT_TOKEN(anon_sym_PIPE); if (lookahead == '&') - ADVANCE(59); + ADVANCE(75); if (lookahead == '|') - ADVANCE(29); + ADVANCE(43); END_STATE(); - case 59: + case 75: ACCEPT_TOKEN(anon_sym_PIPE_AMP); END_STATE(); - case 60: + case 76: if (lookahead == 0) ADVANCE(1); if (lookahead == '#') ADVANCE(2); if (lookahead == '\\') - SKIP(61); + SKIP(77); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(60); + SKIP(76); END_STATE(); - case 61: + case 77: if (lookahead == '\n') - SKIP(60); + SKIP(76); END_STATE(); - case 62: + case 78: if (lookahead == 0) ADVANCE(1); if (lookahead == '#') ADVANCE(2); if (lookahead == '<') - ADVANCE(33); + ADVANCE(47); if (lookahead == '>') - ADVANCE(36); + ADVANCE(50); if (lookahead == '\\') - SKIP(63); + SKIP(79); if (lookahead == 'd') - ADVANCE(64); + ADVANCE(80); + if (lookahead == 'e') + ADVANCE(84); + if (lookahead == 'f') + ADVANCE(90); + if (lookahead == 'i') + ADVANCE(53); if (lookahead == 'w') - ADVANCE(39); + ADVANCE(55); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(62); + SKIP(78); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(44); + ADVANCE(60); if ((lookahead < '0' || lookahead > '>') && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 63: + case 79: if (lookahead == '\n') - SKIP(62); + SKIP(78); END_STATE(); - case 64: + case 80: ACCEPT_TOKEN(sym_leading_word); if (lookahead == 'o') - ADVANCE(65); + ADVANCE(81); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -1061,12 +1236,12 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 65: + case 81: ACCEPT_TOKEN(sym_leading_word); if (lookahead == 'n') - ADVANCE(66); + ADVANCE(82); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -1078,12 +1253,12 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 66: + case 82: ACCEPT_TOKEN(sym_leading_word); if (lookahead == 'e') - ADVANCE(67); + ADVANCE(83); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -1095,9 +1270,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 67: + case 83: ACCEPT_TOKEN(anon_sym_done); if (lookahead != 0 && lookahead != '\t' && @@ -1110,11 +1285,143 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 68: + case 84: + ACCEPT_TOKEN(sym_leading_word); + if (lookahead == 'l') + ADVANCE(85); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 85: + ACCEPT_TOKEN(sym_leading_word); + if (lookahead == 'i') + ADVANCE(86); + if (lookahead == 's') + ADVANCE(88); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 86: + ACCEPT_TOKEN(sym_leading_word); + if (lookahead == 'f') + ADVANCE(87); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 87: + ACCEPT_TOKEN(anon_sym_elif); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 88: + ACCEPT_TOKEN(sym_leading_word); + if (lookahead == 'e') + ADVANCE(89); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 89: + ACCEPT_TOKEN(anon_sym_else); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 90: + ACCEPT_TOKEN(sym_leading_word); + if (lookahead == 'i') + ADVANCE(91); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 91: + ACCEPT_TOKEN(anon_sym_fi); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 92: if (lookahead == '\n') - ADVANCE(69); + ADVANCE(93); if (lookahead == '#') ADVANCE(2); if (lookahead == '&') @@ -1122,73 +1429,90 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == ';') ADVANCE(9); if (lookahead == '\\') - SKIP(70); + SKIP(94); if (lookahead == '|') - ADVANCE(58); + ADVANCE(74); if (lookahead == '\t' || lookahead == '\r' || lookahead == ' ') - SKIP(68); + SKIP(92); END_STATE(); - case 69: + case 93: ACCEPT_TOKEN(anon_sym_LF); END_STATE(); - case 70: + case 94: if (lookahead == '\n') - SKIP(68); + SKIP(92); END_STATE(); - case 71: + case 95: if (lookahead == '#') ADVANCE(2); if (lookahead == '<') - ADVANCE(33); + ADVANCE(47); if (lookahead == '>') - ADVANCE(36); + ADVANCE(50); if (lookahead == '\\') - SKIP(72); + SKIP(96); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(71); + SKIP(95); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(44); + ADVANCE(60); if (lookahead != 0 && (lookahead < '0' || lookahead > '>') && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 72: + case 96: if (lookahead == '\n') - SKIP(71); + SKIP(95); END_STATE(); - case 73: + case 97: if (lookahead == '#') ADVANCE(2); if (lookahead == '\\') - SKIP(74); + SKIP(98); if (lookahead == 'd') - ADVANCE(75); + ADVANCE(99); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(73); + SKIP(97); END_STATE(); - case 74: + case 98: if (lookahead == '\n') - SKIP(73); + SKIP(97); END_STATE(); - case 75: + case 99: if (lookahead == 'o') - ADVANCE(76); + ADVANCE(100); END_STATE(); - case 76: + case 100: ACCEPT_TOKEN(anon_sym_do); END_STATE(); - case 77: + case 101: + if (lookahead == '#') + ADVANCE(2); + if (lookahead == '\\') + SKIP(102); + if (lookahead == 't') + ADVANCE(33); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') + SKIP(101); + END_STATE(); + case 102: if (lookahead == '\n') - ADVANCE(69); + SKIP(101); + END_STATE(); + case 103: + if (lookahead == '\n') + ADVANCE(93); if (lookahead == '#') ADVANCE(2); if (lookahead == '$') @@ -1202,29 +1526,29 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '>') ADVANCE(16); if (lookahead == '\\') - SKIP(78); + SKIP(104); if (lookahead == '|') - ADVANCE(79); + ADVANCE(105); if (lookahead == '\t' || lookahead == '\r' || lookahead == ' ') - SKIP(77); + SKIP(103); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(49); + ADVANCE(65); if (lookahead != 0 && (lookahead < '{' || lookahead > '}')) - ADVANCE(50); + ADVANCE(66); END_STATE(); - case 78: + case 104: if (lookahead == '\n') - SKIP(77); + SKIP(103); END_STATE(); - case 79: + case 105: ACCEPT_TOKEN(anon_sym_PIPE); if (lookahead == '&') - ADVANCE(59); + ADVANCE(75); if (lookahead == '|') - ADVANCE(80); + ADVANCE(106); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -1237,9 +1561,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '>' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(50); + ADVANCE(66); END_STATE(); - case 80: + case 106: ACCEPT_TOKEN(anon_sym_PIPE_PIPE); if (lookahead != 0 && lookahead != '\t' && @@ -1255,18 +1579,18 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '\\' && lookahead != '{' && lookahead != '}') - ADVANCE(50); + ADVANCE(66); END_STATE(); - case 81: + case 107: if (lookahead == '#') ADVANCE(2); if (lookahead == '\\') - SKIP(82); + SKIP(108); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(81); + SKIP(107); if (lookahead != 0 && lookahead != '#' && lookahead != '$' && @@ -1276,30 +1600,30 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '>' && lookahead != '{' && lookahead != '}') - ADVANCE(50); + ADVANCE(66); END_STATE(); - case 82: + case 108: if (lookahead == '\n') - SKIP(81); + SKIP(107); END_STATE(); - case 83: + case 109: if (lookahead == '#') ADVANCE(2); if (lookahead == '\\') - SKIP(84); + SKIP(110); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(83); + SKIP(109); END_STATE(); - case 84: + case 110: if (lookahead == '\n') - SKIP(83); + SKIP(109); END_STATE(); - case 85: + case 111: if (lookahead == '\n') - ADVANCE(69); + ADVANCE(93); if (lookahead == '#') ADVANCE(2); if (lookahead == '&') @@ -1311,54 +1635,62 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '>') ADVANCE(16); if (lookahead == '\\') - SKIP(86); + SKIP(112); if (lookahead == '|') - ADVANCE(58); + ADVANCE(74); if (lookahead == '\t' || lookahead == '\r' || lookahead == ' ') - SKIP(85); + SKIP(111); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(31); + ADVANCE(45); END_STATE(); - case 86: + case 112: if (lookahead == '\n') - SKIP(85); + SKIP(111); END_STATE(); - case 87: + case 113: if (lookahead == 0) ADVANCE(1); if (lookahead == '#') ADVANCE(2); if (lookahead == '<') - ADVANCE(33); + ADVANCE(47); if (lookahead == '>') - ADVANCE(36); + ADVANCE(50); if (lookahead == '\\') - SKIP(88); + SKIP(114); if (lookahead == 'd') - ADVANCE(89); + ADVANCE(115); + if (lookahead == 'e') + ADVANCE(84); + if (lookahead == 'f') + ADVANCE(90); + if (lookahead == 'i') + ADVANCE(53); + if (lookahead == 't') + ADVANCE(117); if (lookahead == 'w') - ADVANCE(39); + ADVANCE(55); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(87); + SKIP(113); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(44); + ADVANCE(60); if ((lookahead < '0' || lookahead > '>') && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 88: + case 114: if (lookahead == '\n') - SKIP(87); + SKIP(113); END_STATE(); - case 89: + case 115: ACCEPT_TOKEN(sym_leading_word); if (lookahead == 'o') - ADVANCE(90); + ADVANCE(116); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -1370,12 +1702,12 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 90: + case 116: ACCEPT_TOKEN(anon_sym_do); if (lookahead == 'n') - ADVANCE(66); + ADVANCE(82); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -1387,76 +1719,263 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 91: + case 117: + ACCEPT_TOKEN(sym_leading_word); + if (lookahead == 'h') + ADVANCE(118); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 118: + ACCEPT_TOKEN(sym_leading_word); + if (lookahead == 'e') + ADVANCE(119); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 119: + ACCEPT_TOKEN(sym_leading_word); + if (lookahead == 'n') + ADVANCE(120); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 120: + ACCEPT_TOKEN(anon_sym_then); + if (lookahead != 0 && + lookahead != '\t' && + lookahead != '\n' && + lookahead != '\r' && + lookahead != ' ' && + lookahead != '#' && + lookahead != ':' && + lookahead != ';' && + lookahead != '=' && + lookahead != '\\' && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 121: if (lookahead == '#') ADVANCE(2); if (lookahead == '<') - ADVANCE(33); + ADVANCE(47); if (lookahead == '>') - ADVANCE(36); + ADVANCE(50); if (lookahead == '\\') - SKIP(92); + SKIP(122); if (lookahead == 'd') - ADVANCE(64); + ADVANCE(80); + if (lookahead == 'i') + ADVANCE(53); if (lookahead == 'w') - ADVANCE(39); + ADVANCE(55); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(91); + SKIP(121); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(44); + ADVANCE(60); if (lookahead != 0 && (lookahead < '0' || lookahead > '>') && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 92: + case 122: if (lookahead == '\n') - SKIP(91); + SKIP(121); END_STATE(); - case 93: + case 123: if (lookahead == '#') ADVANCE(2); if (lookahead == '\\') - SKIP(94); + SKIP(124); + if (lookahead == 'd') + ADVANCE(99); + if (lookahead == 't') + ADVANCE(33); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(93); + SKIP(123); + END_STATE(); + case 124: + if (lookahead == '\n') + SKIP(123); + END_STATE(); + case 125: + if (lookahead == '#') + ADVANCE(2); + if (lookahead == '<') + ADVANCE(47); + if (lookahead == '>') + ADVANCE(50); + if (lookahead == '\\') + SKIP(126); + if (lookahead == 'e') + ADVANCE(84); + if (lookahead == 'f') + ADVANCE(90); + if (lookahead == 'i') + ADVANCE(53); + if (lookahead == 'w') + ADVANCE(55); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') + SKIP(125); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE(60); + if (lookahead != 0 && + (lookahead < '0' || lookahead > '>') && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 126: + if (lookahead == '\n') + SKIP(125); + END_STATE(); + case 127: + if (lookahead == '#') + ADVANCE(2); + if (lookahead == '\\') + SKIP(128); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') + SKIP(127); if (lookahead != 0 && lookahead != ':' && lookahead != ';' && lookahead != '=' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 94: + case 128: if (lookahead == '\n') - SKIP(93); + SKIP(127); END_STATE(); - case 95: + case 129: if (lookahead == '#') ADVANCE(2); if (lookahead == '$') ADVANCE(3); if (lookahead == '\\') - SKIP(96); + SKIP(130); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(95); + SKIP(129); END_STATE(); - case 96: + case 130: if (lookahead == '\n') - SKIP(95); + SKIP(129); END_STATE(); - case 97: + case 131: + if (lookahead == '#') + ADVANCE(2); + if (lookahead == '<') + ADVANCE(47); + if (lookahead == '>') + ADVANCE(50); + if (lookahead == '\\') + SKIP(132); + if (lookahead == 'f') + ADVANCE(90); + if (lookahead == 'i') + ADVANCE(53); + if (lookahead == 'w') + ADVANCE(55); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') + SKIP(131); + if (('0' <= lookahead && lookahead <= '9')) + ADVANCE(60); + if (lookahead != 0 && + (lookahead < '0' || lookahead > '>') && + (lookahead < '{' || lookahead > '}')) + ADVANCE(49); + END_STATE(); + case 132: + if (lookahead == '\n') + SKIP(131); + END_STATE(); + case 133: + if (lookahead == '#') + ADVANCE(2); + if (lookahead == '\\') + SKIP(134); + if (lookahead == 'e') + ADVANCE(23); + if (lookahead == 'f') + ADVANCE(29); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') + SKIP(133); + END_STATE(); + case 134: + if (lookahead == '\n') + SKIP(133); + END_STATE(); + case 135: + if (lookahead == '#') + ADVANCE(2); + if (lookahead == '\\') + SKIP(136); + if (lookahead == 'f') + ADVANCE(29); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') + SKIP(135); + END_STATE(); + case 136: + if (lookahead == '\n') + SKIP(135); + END_STATE(); + case 137: if (lookahead == '#') ADVANCE(2); if (lookahead == ':') @@ -1464,68 +1983,68 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (lookahead == '=') ADVANCE(15); if (lookahead == '\\') - SKIP(98); + SKIP(138); if (lookahead == '}') - ADVANCE(30); + ADVANCE(44); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(97); + SKIP(137); END_STATE(); - case 98: + case 138: if (lookahead == '\n') - SKIP(97); + SKIP(137); END_STATE(); - case 99: + case 139: if (lookahead == '#') ADVANCE(2); if (lookahead == '\\') - SKIP(100); + SKIP(140); if (lookahead == '}') - ADVANCE(30); + ADVANCE(44); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(99); + SKIP(139); END_STATE(); - case 100: + case 140: if (lookahead == '\n') - SKIP(99); + SKIP(139); END_STATE(); - case 101: + case 141: if (lookahead == '\n') - ADVANCE(69); + ADVANCE(93); if (lookahead == '#') ADVANCE(2); if (lookahead == '&') - ADVANCE(102); + ADVANCE(142); if (lookahead == ';') ADVANCE(9); if (lookahead == '<') - ADVANCE(104); + ADVANCE(144); if (lookahead == '>') - ADVANCE(36); + ADVANCE(50); if (lookahead == '\\') - SKIP(107); + SKIP(147); if (lookahead == '|') - ADVANCE(58); + ADVANCE(74); if (lookahead == '\t' || lookahead == '\r' || lookahead == ' ') - SKIP(101); + SKIP(141); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(44); + ADVANCE(60); if (lookahead != 0 && (lookahead < '0' || lookahead > '>') && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 102: + case 142: ACCEPT_TOKEN(sym_leading_word); if (lookahead == '&') - ADVANCE(103); + ADVANCE(143); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -1537,9 +2056,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 103: + case 143: ACCEPT_TOKEN(anon_sym_AMP_AMP); if (lookahead != 0 && lookahead != '\t' && @@ -1552,14 +2071,14 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 104: + case 144: ACCEPT_TOKEN(anon_sym_LT); if (lookahead == '&') - ADVANCE(34); + ADVANCE(48); if (lookahead == '<') - ADVANCE(105); + ADVANCE(145); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -1569,12 +2088,12 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { (lookahead < ':' || lookahead > '=') && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 105: + case 145: ACCEPT_TOKEN(anon_sym_LT_LT); if (lookahead == '-') - ADVANCE(106); + ADVANCE(146); if (lookahead != 0 && lookahead != '\t' && lookahead != '\n' && @@ -1586,9 +2105,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 106: + case 146: ACCEPT_TOKEN(anon_sym_LT_LT_DASH); if (lookahead != 0 && lookahead != '\t' && @@ -1601,38 +2120,38 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { lookahead != '=' && lookahead != '\\' && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 107: + case 147: if (lookahead == '\n') - SKIP(101); + SKIP(141); END_STATE(); - case 108: + case 148: if (lookahead == '#') ADVANCE(2); if (lookahead == '<') - ADVANCE(33); + ADVANCE(47); if (lookahead == '>') - ADVANCE(36); + ADVANCE(50); if (lookahead == '\\') - SKIP(109); + SKIP(149); if (lookahead == '}') - ADVANCE(30); + ADVANCE(44); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') - SKIP(108); + SKIP(148); if (('0' <= lookahead && lookahead <= '9')) - ADVANCE(44); + ADVANCE(60); if (lookahead != 0 && (lookahead < '0' || lookahead > '>') && (lookahead < '{' || lookahead > '}')) - ADVANCE(35); + ADVANCE(49); END_STATE(); - case 109: + case 149: if (lookahead == '\n') - SKIP(108); + SKIP(148); END_STATE(); default: return false; @@ -1641,119 +2160,150 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { static TSLexMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0, .external_lex_state = 1}, - [1] = {.lex_state = 32}, - [2] = {.lex_state = 45}, - [3] = {.lex_state = 47}, - [4] = {.lex_state = 51}, - [5] = {.lex_state = 54}, - [6] = {.lex_state = 60}, - [7] = {.lex_state = 62}, - [8] = {.lex_state = 68}, - [9] = {.lex_state = 71}, - [10] = {.lex_state = 32}, - [11] = {.lex_state = 71}, - [12] = {.lex_state = 73}, - [13] = {.lex_state = 68}, - [14] = {.lex_state = 71}, - [15] = {.lex_state = 71}, - [16] = {.lex_state = 47}, - [17] = {.lex_state = 77}, - [18] = {.lex_state = 81}, - [19] = {.lex_state = 47}, - [20] = {.lex_state = 83, .external_lex_state = 2}, - [21] = {.lex_state = 51}, - [22] = {.lex_state = 85}, - [23] = {.lex_state = 85}, - [24] = {.lex_state = 87}, - [25] = {.lex_state = 45}, - [26] = {.lex_state = 45}, - [27] = {.lex_state = 62}, - [28] = {.lex_state = 54}, - [29] = {.lex_state = 71}, - [30] = {.lex_state = 91}, - [31] = {.lex_state = 68}, - [32] = {.lex_state = 73}, - [33] = {.lex_state = 71}, - [34] = {.lex_state = 71}, - [35] = {.lex_state = 81}, - [36] = {.lex_state = 93}, - [37] = {.lex_state = 77}, - [38] = {.lex_state = 77}, - [39] = {.lex_state = 77}, - [40] = {.lex_state = 85}, - [41] = {.lex_state = 71}, - [42] = {.lex_state = 85}, - [43] = {.lex_state = 85}, - [44] = {.lex_state = 85}, - [45] = {.lex_state = 95, .external_lex_state = 3}, - [46] = {.lex_state = 85}, - [47] = {.lex_state = 47}, - [48] = {.lex_state = 85}, - [49] = {.lex_state = 68}, - [50] = {.lex_state = 68}, - [51] = {.lex_state = 77}, - [52] = {.lex_state = 85}, - [53] = {.lex_state = 68}, - [54] = {.lex_state = 91}, - [55] = {.lex_state = 77}, - [56] = {.lex_state = 97}, - [57] = {.lex_state = 77}, - [58] = {.lex_state = 77}, - [59] = {.lex_state = 85}, - [60] = {.lex_state = 95, .external_lex_state = 3}, - [61] = {.lex_state = 85}, - [62] = {.lex_state = 81}, - [63] = {.lex_state = 93}, - [64] = {.lex_state = 95, .external_lex_state = 3}, - [65] = {.lex_state = 85}, - [66] = {.lex_state = 85}, - [67] = {.lex_state = 77}, - [68] = {.lex_state = 85}, - [69] = {.lex_state = 68}, - [70] = {.lex_state = 81}, - [71] = {.lex_state = 77}, - [72] = {.lex_state = 95, .external_lex_state = 3}, - [73] = {.lex_state = 97}, - [74] = {.lex_state = 95, .external_lex_state = 3}, - [75] = {.lex_state = 85}, - [76] = {.lex_state = 85}, - [77] = {.lex_state = 99}, - [78] = {.lex_state = 81}, - [79] = {.lex_state = 95, .external_lex_state = 3}, - [80] = {.lex_state = 77}, - [81] = {.lex_state = 99}, - [82] = {.lex_state = 95, .external_lex_state = 3}, - [83] = {.lex_state = 68}, - [84] = {.lex_state = 81}, - [85] = {.lex_state = 81}, - [86] = {.lex_state = 93}, - [87] = {.lex_state = 81}, - [88] = {.lex_state = 77, .external_lex_state = 3}, - [89] = {.lex_state = 47}, - [90] = {.lex_state = 101}, - [91] = {.lex_state = 95, .external_lex_state = 3}, - [92] = {.lex_state = 85}, - [93] = {.lex_state = 87}, - [94] = {.lex_state = 68}, - [95] = {.lex_state = 71}, - [96] = {.lex_state = 77, .external_lex_state = 3}, - [97] = {.lex_state = 101}, - [98] = {.lex_state = 85}, - [99] = {.lex_state = 62}, - [100] = {.lex_state = 77}, - [101] = {.lex_state = 85}, - [102] = {.lex_state = 108}, - [103] = {.lex_state = 77, .external_lex_state = 3}, - [104] = {.lex_state = 97}, - [105] = {.lex_state = 99}, - [106] = {.lex_state = 101}, - [107] = {.lex_state = 101}, - [108] = {.lex_state = 47}, - [109] = {.lex_state = 85}, - [110] = {.lex_state = 77, .external_lex_state = 3}, - [111] = {.lex_state = 77, .external_lex_state = 3}, - [112] = {.lex_state = 101}, - [113] = {.lex_state = 101}, + [1] = {.lex_state = 46}, + [2] = {.lex_state = 61}, + [3] = {.lex_state = 61}, + [4] = {.lex_state = 63}, + [5] = {.lex_state = 67}, + [6] = {.lex_state = 70}, + [7] = {.lex_state = 76}, + [8] = {.lex_state = 78}, + [9] = {.lex_state = 92}, + [10] = {.lex_state = 95}, + [11] = {.lex_state = 46}, + [12] = {.lex_state = 95}, + [13] = {.lex_state = 97}, + [14] = {.lex_state = 92}, + [15] = {.lex_state = 101}, + [16] = {.lex_state = 95}, + [17] = {.lex_state = 95}, + [18] = {.lex_state = 63}, + [19] = {.lex_state = 103}, + [20] = {.lex_state = 107}, + [21] = {.lex_state = 63}, + [22] = {.lex_state = 109, .external_lex_state = 2}, + [23] = {.lex_state = 67}, + [24] = {.lex_state = 111}, + [25] = {.lex_state = 111}, + [26] = {.lex_state = 113}, + [27] = {.lex_state = 61}, + [28] = {.lex_state = 61}, + [29] = {.lex_state = 78}, + [30] = {.lex_state = 70}, + [31] = {.lex_state = 95}, + [32] = {.lex_state = 121}, + [33] = {.lex_state = 92}, + [34] = {.lex_state = 123}, + [35] = {.lex_state = 125}, + [36] = {.lex_state = 95}, + [37] = {.lex_state = 95}, + [38] = {.lex_state = 107}, + [39] = {.lex_state = 127}, + [40] = {.lex_state = 103}, + [41] = {.lex_state = 103}, + [42] = {.lex_state = 103}, + [43] = {.lex_state = 111}, + [44] = {.lex_state = 95}, + [45] = {.lex_state = 111}, + [46] = {.lex_state = 111}, + [47] = {.lex_state = 111}, + [48] = {.lex_state = 129, .external_lex_state = 3}, + [49] = {.lex_state = 111}, + [50] = {.lex_state = 63}, + [51] = {.lex_state = 111}, + [52] = {.lex_state = 92}, + [53] = {.lex_state = 92}, + [54] = {.lex_state = 103}, + [55] = {.lex_state = 111}, + [56] = {.lex_state = 92}, + [57] = {.lex_state = 121}, + [58] = {.lex_state = 92}, + [59] = {.lex_state = 61}, + [60] = {.lex_state = 131}, + [61] = {.lex_state = 133}, + [62] = {.lex_state = 135}, + [63] = {.lex_state = 125}, + [64] = {.lex_state = 133}, + [65] = {.lex_state = 103}, + [66] = {.lex_state = 137}, + [67] = {.lex_state = 103}, + [68] = {.lex_state = 103}, + [69] = {.lex_state = 111}, + [70] = {.lex_state = 129, .external_lex_state = 3}, + [71] = {.lex_state = 111}, + [72] = {.lex_state = 107}, + [73] = {.lex_state = 127}, + [74] = {.lex_state = 129, .external_lex_state = 3}, + [75] = {.lex_state = 111}, + [76] = {.lex_state = 111}, + [77] = {.lex_state = 103}, + [78] = {.lex_state = 111}, + [79] = {.lex_state = 92}, + [80] = {.lex_state = 101}, + [81] = {.lex_state = 131}, + [82] = {.lex_state = 92}, + [83] = {.lex_state = 135}, + [84] = {.lex_state = 133}, + [85] = {.lex_state = 133}, + [86] = {.lex_state = 107}, + [87] = {.lex_state = 103}, + [88] = {.lex_state = 129, .external_lex_state = 3}, + [89] = {.lex_state = 137}, + [90] = {.lex_state = 129, .external_lex_state = 3}, + [91] = {.lex_state = 111}, + [92] = {.lex_state = 111}, + [93] = {.lex_state = 125}, + [94] = {.lex_state = 92}, + [95] = {.lex_state = 135}, + [96] = {.lex_state = 139}, + [97] = {.lex_state = 107}, + [98] = {.lex_state = 129, .external_lex_state = 3}, + [99] = {.lex_state = 125}, + [100] = {.lex_state = 92}, + [101] = {.lex_state = 103}, + [102] = {.lex_state = 139}, + [103] = {.lex_state = 129, .external_lex_state = 3}, + [104] = {.lex_state = 125}, + [105] = {.lex_state = 92}, + [106] = {.lex_state = 92}, + [107] = {.lex_state = 107}, + [108] = {.lex_state = 107}, + [109] = {.lex_state = 127}, + [110] = {.lex_state = 107}, + [111] = {.lex_state = 103, .external_lex_state = 3}, + [112] = {.lex_state = 63}, + [113] = {.lex_state = 141}, + [114] = {.lex_state = 129, .external_lex_state = 3}, + [115] = {.lex_state = 111}, + [116] = {.lex_state = 113}, + [117] = {.lex_state = 92}, + [118] = {.lex_state = 133}, + [119] = {.lex_state = 135}, + [120] = {.lex_state = 95}, + [121] = {.lex_state = 103, .external_lex_state = 3}, + [122] = {.lex_state = 141}, + [123] = {.lex_state = 111}, + [124] = {.lex_state = 78}, + [125] = {.lex_state = 133}, + [126] = {.lex_state = 103}, + [127] = {.lex_state = 111}, + [128] = {.lex_state = 125}, + [129] = {.lex_state = 148}, + [130] = {.lex_state = 103, .external_lex_state = 3}, + [131] = {.lex_state = 137}, + [132] = {.lex_state = 139}, + [133] = {.lex_state = 141}, + [134] = {.lex_state = 141}, + [135] = {.lex_state = 63}, + [136] = {.lex_state = 92}, + [137] = {.lex_state = 92}, + [138] = {.lex_state = 135}, + [139] = {.lex_state = 111}, + [140] = {.lex_state = 103, .external_lex_state = 3}, + [141] = {.lex_state = 103, .external_lex_state = 3}, + [142] = {.lex_state = 141}, + [143] = {.lex_state = 141}, + [144] = {.lex_state = 92}, }; enum { @@ -1789,24 +2339,28 @@ static bool ts_external_scanner_states[4][EXTERNAL_TOKEN_COUNT] = { static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [0] = { - [sym_program] = STATE(6), - [sym__terminated_statement] = STATE(93), - [sym_while_statement] = STATE(94), - [sym_do_group] = STATE(31), - [sym_command] = STATE(94), - [sym_pipeline] = STATE(94), - [sym_list] = STATE(94), - [sym_environment_variable_assignment] = STATE(95), - [sym_expansion] = STATE(96), - [sym_operator_expansion] = STATE(96), - [sym_file_redirect] = STATE(97), - [sym_heredoc_redirect] = STATE(98), - [sym_heredoc] = STATE(46), - [aux_sym_program_repeat1] = STATE(99), - [aux_sym_command_repeat1] = STATE(11), - [aux_sym_command_repeat2] = STATE(100), - [aux_sym_command_repeat3] = STATE(101), - [aux_sym_heredoc_repeat1] = STATE(64), + [sym_program] = STATE(7), + [sym__terminated_statement] = STATE(116), + [sym_while_statement] = STATE(117), + [sym_if_statement] = STATE(117), + [sym_elif_clause] = STATE(118), + [sym_else_clause] = STATE(119), + [sym_do_group] = STATE(33), + [sym_command] = STATE(117), + [sym_pipeline] = STATE(117), + [sym_list] = STATE(117), + [sym_environment_variable_assignment] = STATE(120), + [sym_expansion] = STATE(121), + [sym_operator_expansion] = STATE(121), + [sym_file_redirect] = STATE(122), + [sym_heredoc_redirect] = STATE(123), + [sym_heredoc] = STATE(49), + [aux_sym_program_repeat1] = STATE(124), + [aux_sym_if_statement_repeat1] = STATE(125), + [aux_sym_command_repeat1] = STATE(12), + [aux_sym_command_repeat2] = STATE(126), + [aux_sym_command_repeat3] = STATE(127), + [aux_sym_heredoc_repeat1] = STATE(74), [sym__simple_heredoc] = ACTIONS(1), [sym__heredoc_beginning] = ACTIONS(3), [sym__heredoc_middle] = ACTIONS(5), @@ -1815,437 +2369,451 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_SEMI] = ACTIONS(11), [anon_sym_SEMI_SEMI] = ACTIONS(13), [anon_sym_while] = ACTIONS(15), - [anon_sym_do] = ACTIONS(17), - [anon_sym_done] = ACTIONS(19), - [anon_sym_PIPE] = ACTIONS(21), - [anon_sym_AMP_AMP] = ACTIONS(23), - [anon_sym_PIPE_PIPE] = ACTIONS(23), - [anon_sym_EQ] = ACTIONS(25), - [anon_sym_DOLLAR] = ACTIONS(27), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(29), - [anon_sym_COLON] = ACTIONS(31), - [anon_sym_COLON_QMARK] = ACTIONS(33), - [anon_sym_RBRACE] = ACTIONS(35), - [anon_sym_LT] = ACTIONS(37), - [anon_sym_GT] = ACTIONS(37), - [anon_sym_LT_AMP] = ACTIONS(39), - [anon_sym_GT_AMP] = ACTIONS(39), - [anon_sym_LT_LT] = ACTIONS(41), - [anon_sym_LT_LT_DASH] = ACTIONS(43), - [sym_file_descriptor] = ACTIONS(45), - [sym_comment] = ACTIONS(47), + [anon_sym_if] = ACTIONS(17), + [anon_sym_then] = ACTIONS(19), + [anon_sym_fi] = ACTIONS(21), + [anon_sym_elif] = ACTIONS(23), + [anon_sym_else] = ACTIONS(25), + [anon_sym_do] = ACTIONS(27), + [anon_sym_done] = ACTIONS(29), + [anon_sym_PIPE] = ACTIONS(31), + [anon_sym_AMP_AMP] = ACTIONS(33), + [anon_sym_PIPE_PIPE] = ACTIONS(33), + [anon_sym_EQ] = ACTIONS(35), + [anon_sym_DOLLAR] = ACTIONS(37), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(39), + [anon_sym_COLON] = ACTIONS(41), + [anon_sym_COLON_QMARK] = ACTIONS(43), + [anon_sym_RBRACE] = ACTIONS(45), + [anon_sym_LT] = ACTIONS(47), + [anon_sym_GT] = ACTIONS(47), + [anon_sym_LT_AMP] = ACTIONS(49), + [anon_sym_GT_AMP] = ACTIONS(49), + [anon_sym_LT_LT] = ACTIONS(51), + [anon_sym_LT_LT_DASH] = ACTIONS(53), + [sym_file_descriptor] = ACTIONS(55), + [sym_comment] = ACTIONS(57), }, [1] = { - [sym_program] = STATE(6), - [sym__terminated_statement] = STATE(7), - [sym_while_statement] = STATE(8), - [sym_command] = STATE(8), - [sym_pipeline] = STATE(8), - [sym_list] = STATE(8), - [sym_environment_variable_assignment] = STATE(9), - [sym_file_redirect] = STATE(9), - [aux_sym_program_repeat1] = STATE(10), - [aux_sym_command_repeat1] = STATE(11), - [ts_builtin_sym_end] = ACTIONS(49), - [anon_sym_while] = ACTIONS(51), - [anon_sym_LT] = ACTIONS(53), - [anon_sym_GT] = ACTIONS(53), - [anon_sym_LT_AMP] = ACTIONS(53), - [anon_sym_GT_AMP] = ACTIONS(53), - [sym_file_descriptor] = ACTIONS(55), - [sym_leading_word] = ACTIONS(57), - [sym_comment] = ACTIONS(47), - }, - [2] = { - [sym__terminated_statement] = STATE(12), - [sym_while_statement] = STATE(13), - [sym_command] = STATE(13), - [sym_pipeline] = STATE(13), - [sym_list] = STATE(13), - [sym_environment_variable_assignment] = STATE(9), - [sym_file_redirect] = STATE(9), - [aux_sym_command_repeat1] = STATE(11), - [anon_sym_while] = ACTIONS(51), - [anon_sym_LT] = ACTIONS(53), - [anon_sym_GT] = ACTIONS(53), - [anon_sym_LT_AMP] = ACTIONS(53), - [anon_sym_GT_AMP] = ACTIONS(53), - [sym_file_descriptor] = ACTIONS(55), - [sym_leading_word] = ACTIONS(57), - [sym_comment] = ACTIONS(47), - }, - [3] = { - [sym_file_descriptor] = ACTIONS(59), - [sym_word] = ACTIONS(61), - [sym_comment] = ACTIONS(47), - }, - [4] = { - [anon_sym_LT] = ACTIONS(63), - [anon_sym_GT] = ACTIONS(63), + [sym_program] = STATE(7), + [sym__terminated_statement] = STATE(8), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_program_repeat1] = STATE(11), + [aux_sym_command_repeat1] = STATE(12), + [ts_builtin_sym_end] = ACTIONS(59), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), [anon_sym_LT_AMP] = ACTIONS(65), [anon_sym_GT_AMP] = ACTIONS(65), - [sym_comment] = ACTIONS(47), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), + }, + [2] = { + [sym__terminated_statement] = STATE(13), + [sym_while_statement] = STATE(14), + [sym_if_statement] = STATE(14), + [sym_command] = STATE(14), + [sym_pipeline] = STATE(14), + [sym_list] = STATE(14), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), + }, + [3] = { + [sym__terminated_statement] = STATE(15), + [sym_while_statement] = STATE(14), + [sym_if_statement] = STATE(14), + [sym_command] = STATE(14), + [sym_pipeline] = STATE(14), + [sym_list] = STATE(14), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), + }, + [4] = { + [sym_file_descriptor] = ACTIONS(71), + [sym_word] = ACTIONS(73), + [sym_comment] = ACTIONS(57), }, [5] = { - [sym_file_redirect] = STATE(22), - [sym_heredoc_redirect] = STATE(22), - [aux_sym_command_repeat3] = STATE(23), - [anon_sym_SEMI] = ACTIONS(67), - [anon_sym_SEMI_SEMI] = ACTIONS(67), - [anon_sym_LF] = ACTIONS(67), - [aux_sym_SLASH_BSLASHs_PLUS_SLASH] = ACTIONS(69), - [anon_sym_PIPE] = ACTIONS(67), - [anon_sym_PIPE_AMP] = ACTIONS(67), - [anon_sym_AMP_AMP] = ACTIONS(67), - [anon_sym_PIPE_PIPE] = ACTIONS(67), - [anon_sym_EQ] = ACTIONS(71), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_comment] = ACTIONS(79), + [anon_sym_LT] = ACTIONS(75), + [anon_sym_GT] = ACTIONS(75), + [anon_sym_LT_AMP] = ACTIONS(77), + [anon_sym_GT_AMP] = ACTIONS(77), + [sym_comment] = ACTIONS(57), }, [6] = { - [ts_builtin_sym_end] = ACTIONS(81), - [sym_comment] = ACTIONS(47), - }, - [7] = { - [ts_builtin_sym_end] = ACTIONS(83), - [anon_sym_while] = ACTIONS(85), - [anon_sym_done] = ACTIONS(85), + [sym_file_redirect] = STATE(24), + [sym_heredoc_redirect] = STATE(24), + [aux_sym_command_repeat3] = STATE(25), + [anon_sym_SEMI] = ACTIONS(79), + [anon_sym_SEMI_SEMI] = ACTIONS(79), + [anon_sym_LF] = ACTIONS(79), + [aux_sym_SLASH_BSLASHs_PLUS_SLASH] = ACTIONS(81), + [anon_sym_PIPE] = ACTIONS(79), + [anon_sym_PIPE_AMP] = ACTIONS(79), + [anon_sym_AMP_AMP] = ACTIONS(79), + [anon_sym_PIPE_PIPE] = ACTIONS(79), + [anon_sym_EQ] = ACTIONS(83), [anon_sym_LT] = ACTIONS(85), [anon_sym_GT] = ACTIONS(85), [anon_sym_LT_AMP] = ACTIONS(85), [anon_sym_GT_AMP] = ACTIONS(85), - [sym_file_descriptor] = ACTIONS(85), - [sym_leading_word] = ACTIONS(87), - [sym_comment] = ACTIONS(47), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_comment] = ACTIONS(91), + }, + [7] = { + [ts_builtin_sym_end] = ACTIONS(93), + [sym_comment] = ACTIONS(57), }, [8] = { - [anon_sym_SEMI] = ACTIONS(89), - [anon_sym_SEMI_SEMI] = ACTIONS(89), - [anon_sym_LF] = ACTIONS(89), - [anon_sym_PIPE] = ACTIONS(91), - [anon_sym_PIPE_AMP] = ACTIONS(91), - [anon_sym_AMP_AMP] = ACTIONS(93), - [anon_sym_PIPE_PIPE] = ACTIONS(93), - [sym_comment] = ACTIONS(79), + [ts_builtin_sym_end] = ACTIONS(95), + [anon_sym_while] = ACTIONS(97), + [anon_sym_if] = ACTIONS(97), + [anon_sym_fi] = ACTIONS(97), + [anon_sym_elif] = ACTIONS(97), + [anon_sym_else] = ACTIONS(97), + [anon_sym_done] = ACTIONS(97), + [anon_sym_LT] = ACTIONS(97), + [anon_sym_GT] = ACTIONS(97), + [anon_sym_LT_AMP] = ACTIONS(97), + [anon_sym_GT_AMP] = ACTIONS(97), + [sym_file_descriptor] = ACTIONS(97), + [sym_leading_word] = ACTIONS(99), + [sym_comment] = ACTIONS(57), }, [9] = { - [anon_sym_LT] = ACTIONS(95), - [anon_sym_GT] = ACTIONS(95), - [anon_sym_LT_AMP] = ACTIONS(95), - [anon_sym_GT_AMP] = ACTIONS(95), - [sym_file_descriptor] = ACTIONS(95), - [sym_leading_word] = ACTIONS(97), - [sym_comment] = ACTIONS(47), + [anon_sym_SEMI] = ACTIONS(101), + [anon_sym_SEMI_SEMI] = ACTIONS(101), + [anon_sym_LF] = ACTIONS(101), + [anon_sym_PIPE] = ACTIONS(103), + [anon_sym_PIPE_AMP] = ACTIONS(103), + [anon_sym_AMP_AMP] = ACTIONS(105), + [anon_sym_PIPE_PIPE] = ACTIONS(105), + [sym_comment] = ACTIONS(91), }, [10] = { - [sym__terminated_statement] = STATE(27), - [sym_while_statement] = STATE(8), - [sym_command] = STATE(8), - [sym_pipeline] = STATE(8), - [sym_list] = STATE(8), - [sym_environment_variable_assignment] = STATE(9), - [sym_file_redirect] = STATE(9), - [aux_sym_command_repeat1] = STATE(11), - [ts_builtin_sym_end] = ACTIONS(99), - [anon_sym_while] = ACTIONS(51), - [anon_sym_LT] = ACTIONS(53), - [anon_sym_GT] = ACTIONS(53), - [anon_sym_LT_AMP] = ACTIONS(53), - [anon_sym_GT_AMP] = ACTIONS(53), - [sym_file_descriptor] = ACTIONS(55), - [sym_leading_word] = ACTIONS(57), - [sym_comment] = ACTIONS(47), - }, - [11] = { - [sym_environment_variable_assignment] = STATE(29), - [sym_file_redirect] = STATE(29), - [anon_sym_LT] = ACTIONS(53), - [anon_sym_GT] = ACTIONS(53), - [anon_sym_LT_AMP] = ACTIONS(53), - [anon_sym_GT_AMP] = ACTIONS(53), - [sym_file_descriptor] = ACTIONS(55), - [sym_leading_word] = ACTIONS(101), - [sym_comment] = ACTIONS(47), - }, - [12] = { - [sym_do_group] = STATE(31), - [anon_sym_do] = ACTIONS(103), - [sym_comment] = ACTIONS(47), - }, - [13] = { - [anon_sym_SEMI] = ACTIONS(105), - [anon_sym_SEMI_SEMI] = ACTIONS(105), - [anon_sym_LF] = ACTIONS(105), - [anon_sym_PIPE] = ACTIONS(91), - [anon_sym_PIPE_AMP] = ACTIONS(91), - [anon_sym_AMP_AMP] = ACTIONS(93), - [anon_sym_PIPE_PIPE] = ACTIONS(93), - [sym_comment] = ACTIONS(79), - }, - [14] = { [anon_sym_LT] = ACTIONS(107), [anon_sym_GT] = ACTIONS(107), [anon_sym_LT_AMP] = ACTIONS(107), [anon_sym_GT_AMP] = ACTIONS(107), [sym_file_descriptor] = ACTIONS(107), [sym_leading_word] = ACTIONS(109), - [sym_comment] = ACTIONS(47), + [sym_comment] = ACTIONS(57), + }, + [11] = { + [sym__terminated_statement] = STATE(29), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_command_repeat1] = STATE(12), + [ts_builtin_sym_end] = ACTIONS(111), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), + }, + [12] = { + [sym_environment_variable_assignment] = STATE(31), + [sym_file_redirect] = STATE(31), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(113), + [sym_comment] = ACTIONS(57), + }, + [13] = { + [sym_do_group] = STATE(33), + [anon_sym_do] = ACTIONS(115), + [sym_comment] = ACTIONS(57), + }, + [14] = { + [anon_sym_SEMI] = ACTIONS(117), + [anon_sym_SEMI_SEMI] = ACTIONS(117), + [anon_sym_LF] = ACTIONS(117), + [anon_sym_PIPE] = ACTIONS(103), + [anon_sym_PIPE_AMP] = ACTIONS(103), + [anon_sym_AMP_AMP] = ACTIONS(105), + [anon_sym_PIPE_PIPE] = ACTIONS(105), + [sym_comment] = ACTIONS(91), }, [15] = { - [anon_sym_LT] = ACTIONS(111), - [anon_sym_GT] = ACTIONS(111), - [anon_sym_LT_AMP] = ACTIONS(111), - [anon_sym_GT_AMP] = ACTIONS(111), - [sym_file_descriptor] = ACTIONS(111), - [sym_leading_word] = ACTIONS(113), - [sym_comment] = ACTIONS(47), + [anon_sym_then] = ACTIONS(119), + [sym_comment] = ACTIONS(57), }, [16] = { - [sym_file_descriptor] = ACTIONS(115), - [sym_word] = ACTIONS(117), - [sym_comment] = ACTIONS(47), + [anon_sym_LT] = ACTIONS(121), + [anon_sym_GT] = ACTIONS(121), + [anon_sym_LT_AMP] = ACTIONS(121), + [anon_sym_GT_AMP] = ACTIONS(121), + [sym_file_descriptor] = ACTIONS(121), + [sym_leading_word] = ACTIONS(123), + [sym_comment] = ACTIONS(57), }, [17] = { - [sym_expansion] = STATE(38), - [sym_operator_expansion] = STATE(38), - [sym_file_redirect] = STATE(22), - [sym_heredoc_redirect] = STATE(22), - [aux_sym_command_repeat2] = STATE(39), - [aux_sym_command_repeat3] = STATE(40), - [anon_sym_SEMI] = ACTIONS(119), - [anon_sym_SEMI_SEMI] = ACTIONS(119), - [anon_sym_LF] = ACTIONS(119), - [anon_sym_PIPE] = ACTIONS(119), - [anon_sym_PIPE_AMP] = ACTIONS(119), - [anon_sym_AMP_AMP] = ACTIONS(119), - [anon_sym_PIPE_PIPE] = ACTIONS(119), - [anon_sym_DOLLAR] = ACTIONS(121), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(123), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_word] = ACTIONS(125), - [sym_comment] = ACTIONS(79), + [anon_sym_LT] = ACTIONS(125), + [anon_sym_GT] = ACTIONS(125), + [anon_sym_LT_AMP] = ACTIONS(125), + [anon_sym_GT_AMP] = ACTIONS(125), + [sym_file_descriptor] = ACTIONS(125), + [sym_leading_word] = ACTIONS(127), + [sym_comment] = ACTIONS(57), }, [18] = { - [sym_word] = ACTIONS(127), - [sym_comment] = ACTIONS(47), - }, - [19] = { [sym_file_descriptor] = ACTIONS(129), [sym_word] = ACTIONS(131), - [sym_comment] = ACTIONS(47), + [sym_comment] = ACTIONS(57), + }, + [19] = { + [sym_expansion] = STATE(41), + [sym_operator_expansion] = STATE(41), + [sym_file_redirect] = STATE(24), + [sym_heredoc_redirect] = STATE(24), + [aux_sym_command_repeat2] = STATE(42), + [aux_sym_command_repeat3] = STATE(43), + [anon_sym_SEMI] = ACTIONS(133), + [anon_sym_SEMI_SEMI] = ACTIONS(133), + [anon_sym_LF] = ACTIONS(133), + [anon_sym_PIPE] = ACTIONS(133), + [anon_sym_PIPE_AMP] = ACTIONS(133), + [anon_sym_AMP_AMP] = ACTIONS(133), + [anon_sym_PIPE_PIPE] = ACTIONS(133), + [anon_sym_DOLLAR] = ACTIONS(135), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(137), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_word] = ACTIONS(139), + [sym_comment] = ACTIONS(91), }, [20] = { - [sym_heredoc] = STATE(46), - [sym__simple_heredoc] = ACTIONS(133), - [sym__heredoc_beginning] = ACTIONS(135), - [sym_comment] = ACTIONS(47), + [sym_word] = ACTIONS(141), + [sym_comment] = ACTIONS(57), }, [21] = { - [anon_sym_LT] = ACTIONS(137), - [anon_sym_GT] = ACTIONS(137), - [anon_sym_LT_AMP] = ACTIONS(139), - [anon_sym_GT_AMP] = ACTIONS(139), - [sym_comment] = ACTIONS(47), + [sym_file_descriptor] = ACTIONS(143), + [sym_word] = ACTIONS(145), + [sym_comment] = ACTIONS(57), }, [22] = { - [anon_sym_SEMI] = ACTIONS(141), - [anon_sym_SEMI_SEMI] = ACTIONS(141), - [anon_sym_LF] = ACTIONS(141), - [anon_sym_PIPE] = ACTIONS(141), - [anon_sym_PIPE_AMP] = ACTIONS(141), - [anon_sym_AMP_AMP] = ACTIONS(141), - [anon_sym_PIPE_PIPE] = ACTIONS(141), - [anon_sym_LT] = ACTIONS(141), - [anon_sym_GT] = ACTIONS(141), - [anon_sym_LT_AMP] = ACTIONS(141), - [anon_sym_GT_AMP] = ACTIONS(141), - [anon_sym_LT_LT] = ACTIONS(141), - [anon_sym_LT_LT_DASH] = ACTIONS(141), - [sym_file_descriptor] = ACTIONS(141), - [sym_comment] = ACTIONS(79), + [sym_heredoc] = STATE(49), + [sym__simple_heredoc] = ACTIONS(147), + [sym__heredoc_beginning] = ACTIONS(149), + [sym_comment] = ACTIONS(57), }, [23] = { - [sym_file_redirect] = STATE(48), - [sym_heredoc_redirect] = STATE(48), - [anon_sym_SEMI] = ACTIONS(119), - [anon_sym_SEMI_SEMI] = ACTIONS(119), - [anon_sym_LF] = ACTIONS(119), - [anon_sym_PIPE] = ACTIONS(119), - [anon_sym_PIPE_AMP] = ACTIONS(119), - [anon_sym_AMP_AMP] = ACTIONS(119), - [anon_sym_PIPE_PIPE] = ACTIONS(119), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_comment] = ACTIONS(79), - }, - [24] = { - [ts_builtin_sym_end] = ACTIONS(143), - [anon_sym_while] = ACTIONS(145), - [anon_sym_do] = ACTIONS(145), - [anon_sym_done] = ACTIONS(145), - [anon_sym_LT] = ACTIONS(145), - [anon_sym_GT] = ACTIONS(145), - [anon_sym_LT_AMP] = ACTIONS(145), - [anon_sym_GT_AMP] = ACTIONS(145), - [sym_file_descriptor] = ACTIONS(145), - [sym_leading_word] = ACTIONS(147), - [sym_comment] = ACTIONS(47), - }, - [25] = { - [sym_while_statement] = STATE(49), - [sym_command] = STATE(49), - [sym_pipeline] = STATE(49), - [sym_list] = STATE(49), - [sym_environment_variable_assignment] = STATE(9), - [sym_file_redirect] = STATE(9), - [aux_sym_command_repeat1] = STATE(11), - [anon_sym_while] = ACTIONS(51), - [anon_sym_LT] = ACTIONS(53), - [anon_sym_GT] = ACTIONS(53), - [anon_sym_LT_AMP] = ACTIONS(53), - [anon_sym_GT_AMP] = ACTIONS(53), - [sym_file_descriptor] = ACTIONS(55), - [sym_leading_word] = ACTIONS(57), - [sym_comment] = ACTIONS(47), - }, - [26] = { - [sym_while_statement] = STATE(50), - [sym_command] = STATE(50), - [sym_pipeline] = STATE(50), - [sym_list] = STATE(50), - [sym_environment_variable_assignment] = STATE(9), - [sym_file_redirect] = STATE(9), - [aux_sym_command_repeat1] = STATE(11), - [anon_sym_while] = ACTIONS(51), - [anon_sym_LT] = ACTIONS(53), - [anon_sym_GT] = ACTIONS(53), - [anon_sym_LT_AMP] = ACTIONS(53), - [anon_sym_GT_AMP] = ACTIONS(53), - [sym_file_descriptor] = ACTIONS(55), - [sym_leading_word] = ACTIONS(57), - [sym_comment] = ACTIONS(47), - }, - [27] = { - [ts_builtin_sym_end] = ACTIONS(149), - [anon_sym_while] = ACTIONS(151), - [anon_sym_done] = ACTIONS(151), [anon_sym_LT] = ACTIONS(151), [anon_sym_GT] = ACTIONS(151), - [anon_sym_LT_AMP] = ACTIONS(151), - [anon_sym_GT_AMP] = ACTIONS(151), - [sym_file_descriptor] = ACTIONS(151), - [sym_leading_word] = ACTIONS(153), - [sym_comment] = ACTIONS(47), + [anon_sym_LT_AMP] = ACTIONS(153), + [anon_sym_GT_AMP] = ACTIONS(153), + [sym_comment] = ACTIONS(57), }, - [28] = { - [sym_file_redirect] = STATE(22), - [sym_heredoc_redirect] = STATE(22), - [aux_sym_command_repeat3] = STATE(52), + [24] = { [anon_sym_SEMI] = ACTIONS(155), [anon_sym_SEMI_SEMI] = ACTIONS(155), [anon_sym_LF] = ACTIONS(155), - [aux_sym_SLASH_BSLASHs_PLUS_SLASH] = ACTIONS(157), [anon_sym_PIPE] = ACTIONS(155), [anon_sym_PIPE_AMP] = ACTIONS(155), [anon_sym_AMP_AMP] = ACTIONS(155), [anon_sym_PIPE_PIPE] = ACTIONS(155), - [anon_sym_EQ] = ACTIONS(71), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_comment] = ACTIONS(79), + [anon_sym_LT] = ACTIONS(155), + [anon_sym_GT] = ACTIONS(155), + [anon_sym_LT_AMP] = ACTIONS(155), + [anon_sym_GT_AMP] = ACTIONS(155), + [anon_sym_LT_LT] = ACTIONS(155), + [anon_sym_LT_LT_DASH] = ACTIONS(155), + [sym_file_descriptor] = ACTIONS(155), + [sym_comment] = ACTIONS(91), }, - [29] = { + [25] = { + [sym_file_redirect] = STATE(51), + [sym_heredoc_redirect] = STATE(51), + [anon_sym_SEMI] = ACTIONS(133), + [anon_sym_SEMI_SEMI] = ACTIONS(133), + [anon_sym_LF] = ACTIONS(133), + [anon_sym_PIPE] = ACTIONS(133), + [anon_sym_PIPE_AMP] = ACTIONS(133), + [anon_sym_AMP_AMP] = ACTIONS(133), + [anon_sym_PIPE_PIPE] = ACTIONS(133), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_comment] = ACTIONS(91), + }, + [26] = { + [ts_builtin_sym_end] = ACTIONS(157), + [anon_sym_while] = ACTIONS(159), + [anon_sym_if] = ACTIONS(159), + [anon_sym_then] = ACTIONS(159), + [anon_sym_fi] = ACTIONS(159), + [anon_sym_elif] = ACTIONS(159), + [anon_sym_else] = ACTIONS(159), + [anon_sym_do] = ACTIONS(159), + [anon_sym_done] = ACTIONS(159), [anon_sym_LT] = ACTIONS(159), [anon_sym_GT] = ACTIONS(159), [anon_sym_LT_AMP] = ACTIONS(159), [anon_sym_GT_AMP] = ACTIONS(159), [sym_file_descriptor] = ACTIONS(159), [sym_leading_word] = ACTIONS(161), - [sym_comment] = ACTIONS(47), + [sym_comment] = ACTIONS(57), + }, + [27] = { + [sym_while_statement] = STATE(52), + [sym_if_statement] = STATE(52), + [sym_command] = STATE(52), + [sym_pipeline] = STATE(52), + [sym_list] = STATE(52), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), + }, + [28] = { + [sym_while_statement] = STATE(53), + [sym_if_statement] = STATE(53), + [sym_command] = STATE(53), + [sym_pipeline] = STATE(53), + [sym_list] = STATE(53), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), + }, + [29] = { + [ts_builtin_sym_end] = ACTIONS(163), + [anon_sym_while] = ACTIONS(165), + [anon_sym_if] = ACTIONS(165), + [anon_sym_fi] = ACTIONS(165), + [anon_sym_elif] = ACTIONS(165), + [anon_sym_else] = ACTIONS(165), + [anon_sym_done] = ACTIONS(165), + [anon_sym_LT] = ACTIONS(165), + [anon_sym_GT] = ACTIONS(165), + [anon_sym_LT_AMP] = ACTIONS(165), + [anon_sym_GT_AMP] = ACTIONS(165), + [sym_file_descriptor] = ACTIONS(165), + [sym_leading_word] = ACTIONS(167), + [sym_comment] = ACTIONS(57), }, [30] = { - [sym__terminated_statement] = STATE(7), - [sym_while_statement] = STATE(8), - [sym_command] = STATE(8), - [sym_pipeline] = STATE(8), - [sym_list] = STATE(8), - [sym_environment_variable_assignment] = STATE(9), - [sym_file_redirect] = STATE(9), - [aux_sym_program_repeat1] = STATE(54), - [aux_sym_command_repeat1] = STATE(11), - [anon_sym_while] = ACTIONS(51), - [anon_sym_done] = ACTIONS(163), - [anon_sym_LT] = ACTIONS(53), - [anon_sym_GT] = ACTIONS(53), - [anon_sym_LT_AMP] = ACTIONS(53), - [anon_sym_GT_AMP] = ACTIONS(53), - [sym_file_descriptor] = ACTIONS(55), - [sym_leading_word] = ACTIONS(57), - [sym_comment] = ACTIONS(47), + [sym_file_redirect] = STATE(24), + [sym_heredoc_redirect] = STATE(24), + [aux_sym_command_repeat3] = STATE(55), + [anon_sym_SEMI] = ACTIONS(169), + [anon_sym_SEMI_SEMI] = ACTIONS(169), + [anon_sym_LF] = ACTIONS(169), + [aux_sym_SLASH_BSLASHs_PLUS_SLASH] = ACTIONS(171), + [anon_sym_PIPE] = ACTIONS(169), + [anon_sym_PIPE_AMP] = ACTIONS(169), + [anon_sym_AMP_AMP] = ACTIONS(169), + [anon_sym_PIPE_PIPE] = ACTIONS(169), + [anon_sym_EQ] = ACTIONS(83), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_comment] = ACTIONS(91), }, [31] = { - [anon_sym_SEMI] = ACTIONS(165), - [anon_sym_SEMI_SEMI] = ACTIONS(165), - [anon_sym_LF] = ACTIONS(165), - [anon_sym_PIPE] = ACTIONS(165), - [anon_sym_PIPE_AMP] = ACTIONS(165), - [anon_sym_AMP_AMP] = ACTIONS(165), - [anon_sym_PIPE_PIPE] = ACTIONS(165), - [sym_comment] = ACTIONS(79), + [anon_sym_LT] = ACTIONS(173), + [anon_sym_GT] = ACTIONS(173), + [anon_sym_LT_AMP] = ACTIONS(173), + [anon_sym_GT_AMP] = ACTIONS(173), + [sym_file_descriptor] = ACTIONS(173), + [sym_leading_word] = ACTIONS(175), + [sym_comment] = ACTIONS(57), }, [32] = { - [anon_sym_do] = ACTIONS(143), - [sym_comment] = ACTIONS(47), + [sym__terminated_statement] = STATE(8), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_program_repeat1] = STATE(57), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_done] = ACTIONS(177), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), }, [33] = { - [anon_sym_LT] = ACTIONS(167), - [anon_sym_GT] = ACTIONS(167), - [anon_sym_LT_AMP] = ACTIONS(167), - [anon_sym_GT_AMP] = ACTIONS(167), - [sym_file_descriptor] = ACTIONS(167), - [sym_leading_word] = ACTIONS(169), - [sym_comment] = ACTIONS(47), - }, - [34] = { - [anon_sym_LT] = ACTIONS(171), - [anon_sym_GT] = ACTIONS(171), - [anon_sym_LT_AMP] = ACTIONS(171), - [anon_sym_GT_AMP] = ACTIONS(171), - [sym_file_descriptor] = ACTIONS(171), - [sym_leading_word] = ACTIONS(173), - [sym_comment] = ACTIONS(47), - }, - [35] = { - [sym_word] = ACTIONS(175), - [sym_comment] = ACTIONS(47), - }, - [36] = { - [sym_leading_word] = ACTIONS(177), - [sym_comment] = ACTIONS(47), - }, - [37] = { [anon_sym_SEMI] = ACTIONS(179), [anon_sym_SEMI_SEMI] = ACTIONS(179), [anon_sym_LF] = ACTIONS(179), @@ -2253,153 +2821,87 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_PIPE_AMP] = ACTIONS(179), [anon_sym_AMP_AMP] = ACTIONS(179), [anon_sym_PIPE_PIPE] = ACTIONS(179), - [anon_sym_DOLLAR] = ACTIONS(179), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(179), - [anon_sym_LT] = ACTIONS(179), - [anon_sym_GT] = ACTIONS(179), - [anon_sym_LT_AMP] = ACTIONS(179), - [anon_sym_GT_AMP] = ACTIONS(179), - [anon_sym_LT_LT] = ACTIONS(179), - [anon_sym_LT_LT_DASH] = ACTIONS(179), - [sym_file_descriptor] = ACTIONS(179), - [sym_word] = ACTIONS(179), - [sym_comment] = ACTIONS(79), + [sym_comment] = ACTIONS(91), }, - [38] = { - [anon_sym_SEMI] = ACTIONS(181), - [anon_sym_SEMI_SEMI] = ACTIONS(181), - [anon_sym_LF] = ACTIONS(181), - [anon_sym_PIPE] = ACTIONS(181), - [anon_sym_PIPE_AMP] = ACTIONS(181), - [anon_sym_AMP_AMP] = ACTIONS(181), - [anon_sym_PIPE_PIPE] = ACTIONS(181), - [anon_sym_DOLLAR] = ACTIONS(181), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(181), - [anon_sym_LT] = ACTIONS(181), - [anon_sym_GT] = ACTIONS(181), - [anon_sym_LT_AMP] = ACTIONS(181), - [anon_sym_GT_AMP] = ACTIONS(181), - [anon_sym_LT_LT] = ACTIONS(181), - [anon_sym_LT_LT_DASH] = ACTIONS(181), - [sym_file_descriptor] = ACTIONS(181), - [sym_word] = ACTIONS(181), - [sym_comment] = ACTIONS(79), + [34] = { + [anon_sym_then] = ACTIONS(157), + [anon_sym_do] = ACTIONS(157), + [sym_comment] = ACTIONS(57), }, - [39] = { - [sym_expansion] = STATE(58), - [sym_operator_expansion] = STATE(58), - [sym_file_redirect] = STATE(22), - [sym_heredoc_redirect] = STATE(22), - [aux_sym_command_repeat3] = STATE(59), - [anon_sym_SEMI] = ACTIONS(183), - [anon_sym_SEMI_SEMI] = ACTIONS(183), - [anon_sym_LF] = ACTIONS(183), - [anon_sym_PIPE] = ACTIONS(183), - [anon_sym_PIPE_AMP] = ACTIONS(183), - [anon_sym_AMP_AMP] = ACTIONS(183), - [anon_sym_PIPE_PIPE] = ACTIONS(183), - [anon_sym_DOLLAR] = ACTIONS(121), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(123), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_word] = ACTIONS(185), - [sym_comment] = ACTIONS(79), + [35] = { + [sym__terminated_statement] = STATE(8), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_elif_clause] = STATE(61), + [sym_else_clause] = STATE(62), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_program_repeat1] = STATE(63), + [aux_sym_if_statement_repeat1] = STATE(64), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_fi] = ACTIONS(181), + [anon_sym_elif] = ACTIONS(183), + [anon_sym_else] = ACTIONS(185), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), }, - [40] = { - [sym_file_redirect] = STATE(48), - [sym_heredoc_redirect] = STATE(48), - [anon_sym_SEMI] = ACTIONS(183), - [anon_sym_SEMI_SEMI] = ACTIONS(183), - [anon_sym_LF] = ACTIONS(183), - [anon_sym_PIPE] = ACTIONS(183), - [anon_sym_PIPE_AMP] = ACTIONS(183), - [anon_sym_AMP_AMP] = ACTIONS(183), - [anon_sym_PIPE_PIPE] = ACTIONS(183), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_comment] = ACTIONS(79), - }, - [41] = { + [36] = { [anon_sym_LT] = ACTIONS(187), [anon_sym_GT] = ACTIONS(187), [anon_sym_LT_AMP] = ACTIONS(187), [anon_sym_GT_AMP] = ACTIONS(187), [sym_file_descriptor] = ACTIONS(187), [sym_leading_word] = ACTIONS(189), - [sym_comment] = ACTIONS(47), + [sym_comment] = ACTIONS(57), }, - [42] = { - [anon_sym_SEMI] = ACTIONS(109), - [anon_sym_SEMI_SEMI] = ACTIONS(109), - [anon_sym_LF] = ACTIONS(109), - [anon_sym_PIPE] = ACTIONS(109), - [anon_sym_PIPE_AMP] = ACTIONS(109), - [anon_sym_AMP_AMP] = ACTIONS(109), - [anon_sym_PIPE_PIPE] = ACTIONS(109), - [anon_sym_LT] = ACTIONS(109), - [anon_sym_GT] = ACTIONS(109), - [anon_sym_LT_AMP] = ACTIONS(109), - [anon_sym_GT_AMP] = ACTIONS(109), - [anon_sym_LT_LT] = ACTIONS(109), - [anon_sym_LT_LT_DASH] = ACTIONS(109), - [sym_file_descriptor] = ACTIONS(109), - [sym_comment] = ACTIONS(79), - }, - [43] = { - [anon_sym_SEMI] = ACTIONS(113), - [anon_sym_SEMI_SEMI] = ACTIONS(113), - [anon_sym_LF] = ACTIONS(113), - [anon_sym_PIPE] = ACTIONS(113), - [anon_sym_PIPE_AMP] = ACTIONS(113), - [anon_sym_AMP_AMP] = ACTIONS(113), - [anon_sym_PIPE_PIPE] = ACTIONS(113), - [anon_sym_LT] = ACTIONS(113), - [anon_sym_GT] = ACTIONS(113), - [anon_sym_LT_AMP] = ACTIONS(113), - [anon_sym_GT_AMP] = ACTIONS(113), - [anon_sym_LT_LT] = ACTIONS(113), - [anon_sym_LT_LT_DASH] = ACTIONS(113), - [sym_file_descriptor] = ACTIONS(113), - [sym_comment] = ACTIONS(79), - }, - [44] = { - [anon_sym_SEMI] = ACTIONS(191), - [anon_sym_SEMI_SEMI] = ACTIONS(191), - [anon_sym_LF] = ACTIONS(191), - [anon_sym_PIPE] = ACTIONS(191), - [anon_sym_PIPE_AMP] = ACTIONS(191), - [anon_sym_AMP_AMP] = ACTIONS(191), - [anon_sym_PIPE_PIPE] = ACTIONS(191), + [37] = { [anon_sym_LT] = ACTIONS(191), [anon_sym_GT] = ACTIONS(191), [anon_sym_LT_AMP] = ACTIONS(191), [anon_sym_GT_AMP] = ACTIONS(191), - [anon_sym_LT_LT] = ACTIONS(191), - [anon_sym_LT_LT_DASH] = ACTIONS(191), [sym_file_descriptor] = ACTIONS(191), - [sym_comment] = ACTIONS(79), + [sym_leading_word] = ACTIONS(193), + [sym_comment] = ACTIONS(57), }, - [45] = { - [sym_expansion] = STATE(60), - [sym_operator_expansion] = STATE(60), - [aux_sym_heredoc_repeat1] = STATE(64), - [sym__heredoc_middle] = ACTIONS(193), - [sym__heredoc_end] = ACTIONS(195), - [anon_sym_DOLLAR] = ACTIONS(197), + [38] = { + [sym_word] = ACTIONS(195), + [sym_comment] = ACTIONS(57), + }, + [39] = { + [sym_leading_word] = ACTIONS(197), + [sym_comment] = ACTIONS(57), + }, + [40] = { + [anon_sym_SEMI] = ACTIONS(199), + [anon_sym_SEMI_SEMI] = ACTIONS(199), + [anon_sym_LF] = ACTIONS(199), + [anon_sym_PIPE] = ACTIONS(199), + [anon_sym_PIPE_AMP] = ACTIONS(199), + [anon_sym_AMP_AMP] = ACTIONS(199), + [anon_sym_PIPE_PIPE] = ACTIONS(199), + [anon_sym_DOLLAR] = ACTIONS(199), [anon_sym_DOLLAR_LBRACE] = ACTIONS(199), - [sym_comment] = ACTIONS(47), + [anon_sym_LT] = ACTIONS(199), + [anon_sym_GT] = ACTIONS(199), + [anon_sym_LT_AMP] = ACTIONS(199), + [anon_sym_GT_AMP] = ACTIONS(199), + [anon_sym_LT_LT] = ACTIONS(199), + [anon_sym_LT_LT_DASH] = ACTIONS(199), + [sym_file_descriptor] = ACTIONS(199), + [sym_word] = ACTIONS(199), + [sym_comment] = ACTIONS(91), }, - [46] = { + [41] = { [anon_sym_SEMI] = ACTIONS(201), [anon_sym_SEMI_SEMI] = ACTIONS(201), [anon_sym_LF] = ACTIONS(201), @@ -2407,6 +2909,8 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_PIPE_AMP] = ACTIONS(201), [anon_sym_AMP_AMP] = ACTIONS(201), [anon_sym_PIPE_PIPE] = ACTIONS(201), + [anon_sym_DOLLAR] = ACTIONS(201), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(201), [anon_sym_LT] = ACTIONS(201), [anon_sym_GT] = ACTIONS(201), [anon_sym_LT_AMP] = ACTIONS(201), @@ -2414,152 +2918,146 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LT_LT] = ACTIONS(201), [anon_sym_LT_LT_DASH] = ACTIONS(201), [sym_file_descriptor] = ACTIONS(201), - [sym_comment] = ACTIONS(79), + [sym_word] = ACTIONS(201), + [sym_comment] = ACTIONS(91), }, - [47] = { - [sym_file_descriptor] = ACTIONS(203), + [42] = { + [sym_expansion] = STATE(68), + [sym_operator_expansion] = STATE(68), + [sym_file_redirect] = STATE(24), + [sym_heredoc_redirect] = STATE(24), + [aux_sym_command_repeat3] = STATE(69), + [anon_sym_SEMI] = ACTIONS(203), + [anon_sym_SEMI_SEMI] = ACTIONS(203), + [anon_sym_LF] = ACTIONS(203), + [anon_sym_PIPE] = ACTIONS(203), + [anon_sym_PIPE_AMP] = ACTIONS(203), + [anon_sym_AMP_AMP] = ACTIONS(203), + [anon_sym_PIPE_PIPE] = ACTIONS(203), + [anon_sym_DOLLAR] = ACTIONS(135), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(137), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), [sym_word] = ACTIONS(205), - [sym_comment] = ACTIONS(47), + [sym_comment] = ACTIONS(91), }, - [48] = { - [anon_sym_SEMI] = ACTIONS(207), - [anon_sym_SEMI_SEMI] = ACTIONS(207), - [anon_sym_LF] = ACTIONS(207), - [anon_sym_PIPE] = ACTIONS(207), - [anon_sym_PIPE_AMP] = ACTIONS(207), - [anon_sym_AMP_AMP] = ACTIONS(207), - [anon_sym_PIPE_PIPE] = ACTIONS(207), + [43] = { + [sym_file_redirect] = STATE(51), + [sym_heredoc_redirect] = STATE(51), + [anon_sym_SEMI] = ACTIONS(203), + [anon_sym_SEMI_SEMI] = ACTIONS(203), + [anon_sym_LF] = ACTIONS(203), + [anon_sym_PIPE] = ACTIONS(203), + [anon_sym_PIPE_AMP] = ACTIONS(203), + [anon_sym_AMP_AMP] = ACTIONS(203), + [anon_sym_PIPE_PIPE] = ACTIONS(203), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_comment] = ACTIONS(91), + }, + [44] = { [anon_sym_LT] = ACTIONS(207), [anon_sym_GT] = ACTIONS(207), [anon_sym_LT_AMP] = ACTIONS(207), [anon_sym_GT_AMP] = ACTIONS(207), - [anon_sym_LT_LT] = ACTIONS(207), - [anon_sym_LT_LT_DASH] = ACTIONS(207), [sym_file_descriptor] = ACTIONS(207), - [sym_comment] = ACTIONS(79), + [sym_leading_word] = ACTIONS(209), + [sym_comment] = ACTIONS(57), }, - [49] = { - [anon_sym_SEMI] = ACTIONS(209), - [anon_sym_SEMI_SEMI] = ACTIONS(209), - [anon_sym_LF] = ACTIONS(209), - [anon_sym_PIPE] = ACTIONS(209), - [anon_sym_PIPE_AMP] = ACTIONS(209), - [anon_sym_AMP_AMP] = ACTIONS(209), - [anon_sym_PIPE_PIPE] = ACTIONS(209), - [sym_comment] = ACTIONS(79), + [45] = { + [anon_sym_SEMI] = ACTIONS(123), + [anon_sym_SEMI_SEMI] = ACTIONS(123), + [anon_sym_LF] = ACTIONS(123), + [anon_sym_PIPE] = ACTIONS(123), + [anon_sym_PIPE_AMP] = ACTIONS(123), + [anon_sym_AMP_AMP] = ACTIONS(123), + [anon_sym_PIPE_PIPE] = ACTIONS(123), + [anon_sym_LT] = ACTIONS(123), + [anon_sym_GT] = ACTIONS(123), + [anon_sym_LT_AMP] = ACTIONS(123), + [anon_sym_GT_AMP] = ACTIONS(123), + [anon_sym_LT_LT] = ACTIONS(123), + [anon_sym_LT_LT_DASH] = ACTIONS(123), + [sym_file_descriptor] = ACTIONS(123), + [sym_comment] = ACTIONS(91), }, - [50] = { + [46] = { + [anon_sym_SEMI] = ACTIONS(127), + [anon_sym_SEMI_SEMI] = ACTIONS(127), + [anon_sym_LF] = ACTIONS(127), + [anon_sym_PIPE] = ACTIONS(127), + [anon_sym_PIPE_AMP] = ACTIONS(127), + [anon_sym_AMP_AMP] = ACTIONS(127), + [anon_sym_PIPE_PIPE] = ACTIONS(127), + [anon_sym_LT] = ACTIONS(127), + [anon_sym_GT] = ACTIONS(127), + [anon_sym_LT_AMP] = ACTIONS(127), + [anon_sym_GT_AMP] = ACTIONS(127), + [anon_sym_LT_LT] = ACTIONS(127), + [anon_sym_LT_LT_DASH] = ACTIONS(127), + [sym_file_descriptor] = ACTIONS(127), + [sym_comment] = ACTIONS(91), + }, + [47] = { [anon_sym_SEMI] = ACTIONS(211), [anon_sym_SEMI_SEMI] = ACTIONS(211), [anon_sym_LF] = ACTIONS(211), - [anon_sym_PIPE] = ACTIONS(91), - [anon_sym_PIPE_AMP] = ACTIONS(91), + [anon_sym_PIPE] = ACTIONS(211), + [anon_sym_PIPE_AMP] = ACTIONS(211), [anon_sym_AMP_AMP] = ACTIONS(211), [anon_sym_PIPE_PIPE] = ACTIONS(211), - [sym_comment] = ACTIONS(79), + [anon_sym_LT] = ACTIONS(211), + [anon_sym_GT] = ACTIONS(211), + [anon_sym_LT_AMP] = ACTIONS(211), + [anon_sym_GT_AMP] = ACTIONS(211), + [anon_sym_LT_LT] = ACTIONS(211), + [anon_sym_LT_LT_DASH] = ACTIONS(211), + [sym_file_descriptor] = ACTIONS(211), + [sym_comment] = ACTIONS(91), + }, + [48] = { + [sym_expansion] = STATE(70), + [sym_operator_expansion] = STATE(70), + [aux_sym_heredoc_repeat1] = STATE(74), + [sym__heredoc_middle] = ACTIONS(213), + [sym__heredoc_end] = ACTIONS(215), + [anon_sym_DOLLAR] = ACTIONS(217), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(219), + [sym_comment] = ACTIONS(57), + }, + [49] = { + [anon_sym_SEMI] = ACTIONS(221), + [anon_sym_SEMI_SEMI] = ACTIONS(221), + [anon_sym_LF] = ACTIONS(221), + [anon_sym_PIPE] = ACTIONS(221), + [anon_sym_PIPE_AMP] = ACTIONS(221), + [anon_sym_AMP_AMP] = ACTIONS(221), + [anon_sym_PIPE_PIPE] = ACTIONS(221), + [anon_sym_LT] = ACTIONS(221), + [anon_sym_GT] = ACTIONS(221), + [anon_sym_LT_AMP] = ACTIONS(221), + [anon_sym_GT_AMP] = ACTIONS(221), + [anon_sym_LT_LT] = ACTIONS(221), + [anon_sym_LT_LT_DASH] = ACTIONS(221), + [sym_file_descriptor] = ACTIONS(221), + [sym_comment] = ACTIONS(91), + }, + [50] = { + [sym_file_descriptor] = ACTIONS(223), + [sym_word] = ACTIONS(225), + [sym_comment] = ACTIONS(57), }, [51] = { - [sym_expansion] = STATE(38), - [sym_operator_expansion] = STATE(38), - [sym_file_redirect] = STATE(22), - [sym_heredoc_redirect] = STATE(22), - [aux_sym_command_repeat2] = STATE(67), - [aux_sym_command_repeat3] = STATE(68), - [anon_sym_SEMI] = ACTIONS(213), - [anon_sym_SEMI_SEMI] = ACTIONS(213), - [anon_sym_LF] = ACTIONS(213), - [anon_sym_PIPE] = ACTIONS(213), - [anon_sym_PIPE_AMP] = ACTIONS(213), - [anon_sym_AMP_AMP] = ACTIONS(213), - [anon_sym_PIPE_PIPE] = ACTIONS(213), - [anon_sym_DOLLAR] = ACTIONS(121), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(123), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_word] = ACTIONS(125), - [sym_comment] = ACTIONS(79), - }, - [52] = { - [sym_file_redirect] = STATE(48), - [sym_heredoc_redirect] = STATE(48), - [anon_sym_SEMI] = ACTIONS(213), - [anon_sym_SEMI_SEMI] = ACTIONS(213), - [anon_sym_LF] = ACTIONS(213), - [anon_sym_PIPE] = ACTIONS(213), - [anon_sym_PIPE_AMP] = ACTIONS(213), - [anon_sym_AMP_AMP] = ACTIONS(213), - [anon_sym_PIPE_PIPE] = ACTIONS(213), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_comment] = ACTIONS(79), - }, - [53] = { - [anon_sym_SEMI] = ACTIONS(215), - [anon_sym_SEMI_SEMI] = ACTIONS(215), - [anon_sym_LF] = ACTIONS(215), - [anon_sym_PIPE] = ACTIONS(215), - [anon_sym_PIPE_AMP] = ACTIONS(215), - [anon_sym_AMP_AMP] = ACTIONS(215), - [anon_sym_PIPE_PIPE] = ACTIONS(215), - [sym_comment] = ACTIONS(79), - }, - [54] = { - [sym__terminated_statement] = STATE(27), - [sym_while_statement] = STATE(8), - [sym_command] = STATE(8), - [sym_pipeline] = STATE(8), - [sym_list] = STATE(8), - [sym_environment_variable_assignment] = STATE(9), - [sym_file_redirect] = STATE(9), - [aux_sym_command_repeat1] = STATE(11), - [anon_sym_while] = ACTIONS(51), - [anon_sym_done] = ACTIONS(217), - [anon_sym_LT] = ACTIONS(53), - [anon_sym_GT] = ACTIONS(53), - [anon_sym_LT_AMP] = ACTIONS(53), - [anon_sym_GT_AMP] = ACTIONS(53), - [sym_file_descriptor] = ACTIONS(55), - [sym_leading_word] = ACTIONS(57), - [sym_comment] = ACTIONS(47), - }, - [55] = { - [anon_sym_SEMI] = ACTIONS(219), - [anon_sym_SEMI_SEMI] = ACTIONS(219), - [anon_sym_LF] = ACTIONS(219), - [anon_sym_PIPE] = ACTIONS(219), - [anon_sym_PIPE_AMP] = ACTIONS(219), - [anon_sym_AMP_AMP] = ACTIONS(219), - [anon_sym_PIPE_PIPE] = ACTIONS(219), - [anon_sym_DOLLAR] = ACTIONS(219), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(219), - [anon_sym_LT] = ACTIONS(219), - [anon_sym_GT] = ACTIONS(219), - [anon_sym_LT_AMP] = ACTIONS(219), - [anon_sym_GT_AMP] = ACTIONS(219), - [anon_sym_LT_LT] = ACTIONS(219), - [anon_sym_LT_LT_DASH] = ACTIONS(219), - [sym_file_descriptor] = ACTIONS(219), - [sym_word] = ACTIONS(219), - [sym_comment] = ACTIONS(79), - }, - [56] = { - [anon_sym_EQ] = ACTIONS(221), - [anon_sym_COLON] = ACTIONS(223), - [anon_sym_COLON_QMARK] = ACTIONS(221), - [anon_sym_RBRACE] = ACTIONS(225), - [sym_comment] = ACTIONS(47), - }, - [57] = { [anon_sym_SEMI] = ACTIONS(227), [anon_sym_SEMI_SEMI] = ACTIONS(227), [anon_sym_LF] = ACTIONS(227), @@ -2567,8 +3065,6 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_PIPE_AMP] = ACTIONS(227), [anon_sym_AMP_AMP] = ACTIONS(227), [anon_sym_PIPE_PIPE] = ACTIONS(227), - [anon_sym_DOLLAR] = ACTIONS(227), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(227), [anon_sym_LT] = ACTIONS(227), [anon_sym_GT] = ACTIONS(227), [anon_sym_LT_AMP] = ACTIONS(227), @@ -2576,10 +3072,9 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LT_LT] = ACTIONS(227), [anon_sym_LT_LT_DASH] = ACTIONS(227), [sym_file_descriptor] = ACTIONS(227), - [sym_word] = ACTIONS(227), - [sym_comment] = ACTIONS(79), + [sym_comment] = ACTIONS(91), }, - [58] = { + [52] = { [anon_sym_SEMI] = ACTIONS(229), [anon_sym_SEMI_SEMI] = ACTIONS(229), [anon_sym_LF] = ACTIONS(229), @@ -2587,171 +3082,191 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_PIPE_AMP] = ACTIONS(229), [anon_sym_AMP_AMP] = ACTIONS(229), [anon_sym_PIPE_PIPE] = ACTIONS(229), - [anon_sym_DOLLAR] = ACTIONS(229), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(229), - [anon_sym_LT] = ACTIONS(229), - [anon_sym_GT] = ACTIONS(229), - [anon_sym_LT_AMP] = ACTIONS(229), - [anon_sym_GT_AMP] = ACTIONS(229), - [anon_sym_LT_LT] = ACTIONS(229), - [anon_sym_LT_LT_DASH] = ACTIONS(229), - [sym_file_descriptor] = ACTIONS(229), - [sym_word] = ACTIONS(229), - [sym_comment] = ACTIONS(79), + [sym_comment] = ACTIONS(91), }, - [59] = { - [sym_file_redirect] = STATE(48), - [sym_heredoc_redirect] = STATE(48), + [53] = { [anon_sym_SEMI] = ACTIONS(231), [anon_sym_SEMI_SEMI] = ACTIONS(231), [anon_sym_LF] = ACTIONS(231), - [anon_sym_PIPE] = ACTIONS(231), - [anon_sym_PIPE_AMP] = ACTIONS(231), + [anon_sym_PIPE] = ACTIONS(103), + [anon_sym_PIPE_AMP] = ACTIONS(103), [anon_sym_AMP_AMP] = ACTIONS(231), [anon_sym_PIPE_PIPE] = ACTIONS(231), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_comment] = ACTIONS(79), + [sym_comment] = ACTIONS(91), + }, + [54] = { + [sym_expansion] = STATE(41), + [sym_operator_expansion] = STATE(41), + [sym_file_redirect] = STATE(24), + [sym_heredoc_redirect] = STATE(24), + [aux_sym_command_repeat2] = STATE(77), + [aux_sym_command_repeat3] = STATE(78), + [anon_sym_SEMI] = ACTIONS(233), + [anon_sym_SEMI_SEMI] = ACTIONS(233), + [anon_sym_LF] = ACTIONS(233), + [anon_sym_PIPE] = ACTIONS(233), + [anon_sym_PIPE_AMP] = ACTIONS(233), + [anon_sym_AMP_AMP] = ACTIONS(233), + [anon_sym_PIPE_PIPE] = ACTIONS(233), + [anon_sym_DOLLAR] = ACTIONS(135), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(137), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_word] = ACTIONS(139), + [sym_comment] = ACTIONS(91), + }, + [55] = { + [sym_file_redirect] = STATE(51), + [sym_heredoc_redirect] = STATE(51), + [anon_sym_SEMI] = ACTIONS(233), + [anon_sym_SEMI_SEMI] = ACTIONS(233), + [anon_sym_LF] = ACTIONS(233), + [anon_sym_PIPE] = ACTIONS(233), + [anon_sym_PIPE_AMP] = ACTIONS(233), + [anon_sym_AMP_AMP] = ACTIONS(233), + [anon_sym_PIPE_PIPE] = ACTIONS(233), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_comment] = ACTIONS(91), + }, + [56] = { + [anon_sym_SEMI] = ACTIONS(235), + [anon_sym_SEMI_SEMI] = ACTIONS(235), + [anon_sym_LF] = ACTIONS(235), + [anon_sym_PIPE] = ACTIONS(235), + [anon_sym_PIPE_AMP] = ACTIONS(235), + [anon_sym_AMP_AMP] = ACTIONS(235), + [anon_sym_PIPE_PIPE] = ACTIONS(235), + [sym_comment] = ACTIONS(91), + }, + [57] = { + [sym__terminated_statement] = STATE(29), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_done] = ACTIONS(237), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), + }, + [58] = { + [anon_sym_SEMI] = ACTIONS(239), + [anon_sym_SEMI_SEMI] = ACTIONS(239), + [anon_sym_LF] = ACTIONS(239), + [anon_sym_PIPE] = ACTIONS(239), + [anon_sym_PIPE_AMP] = ACTIONS(239), + [anon_sym_AMP_AMP] = ACTIONS(239), + [anon_sym_PIPE_PIPE] = ACTIONS(239), + [sym_comment] = ACTIONS(91), + }, + [59] = { + [sym__terminated_statement] = STATE(80), + [sym_while_statement] = STATE(14), + [sym_if_statement] = STATE(14), + [sym_command] = STATE(14), + [sym_pipeline] = STATE(14), + [sym_list] = STATE(14), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), }, [60] = { - [sym__heredoc_middle] = ACTIONS(233), - [sym__heredoc_end] = ACTIONS(233), - [anon_sym_DOLLAR] = ACTIONS(235), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(233), - [sym_comment] = ACTIONS(47), + [sym__terminated_statement] = STATE(8), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_program_repeat1] = STATE(81), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_fi] = ACTIONS(241), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), }, [61] = { - [anon_sym_SEMI] = ACTIONS(237), - [anon_sym_SEMI_SEMI] = ACTIONS(237), - [anon_sym_LF] = ACTIONS(237), - [anon_sym_PIPE] = ACTIONS(237), - [anon_sym_PIPE_AMP] = ACTIONS(237), - [anon_sym_AMP_AMP] = ACTIONS(237), - [anon_sym_PIPE_PIPE] = ACTIONS(237), - [anon_sym_LT] = ACTIONS(237), - [anon_sym_GT] = ACTIONS(237), - [anon_sym_LT_AMP] = ACTIONS(237), - [anon_sym_GT_AMP] = ACTIONS(237), - [anon_sym_LT_LT] = ACTIONS(237), - [anon_sym_LT_LT_DASH] = ACTIONS(237), - [sym_file_descriptor] = ACTIONS(237), - [sym_comment] = ACTIONS(79), + [anon_sym_fi] = ACTIONS(243), + [anon_sym_elif] = ACTIONS(243), + [anon_sym_else] = ACTIONS(243), + [sym_comment] = ACTIONS(57), }, [62] = { - [sym_word] = ACTIONS(239), - [sym_comment] = ACTIONS(47), + [anon_sym_fi] = ACTIONS(245), + [sym_comment] = ACTIONS(57), }, [63] = { - [sym_leading_word] = ACTIONS(241), - [sym_comment] = ACTIONS(47), + [sym__terminated_statement] = STATE(29), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_elif_clause] = STATE(61), + [sym_else_clause] = STATE(83), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_if_statement_repeat1] = STATE(84), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_fi] = ACTIONS(247), + [anon_sym_elif] = ACTIONS(183), + [anon_sym_else] = ACTIONS(185), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), }, [64] = { - [sym_expansion] = STATE(74), - [sym_operator_expansion] = STATE(74), - [sym__heredoc_middle] = ACTIONS(243), - [sym__heredoc_end] = ACTIONS(245), - [anon_sym_DOLLAR] = ACTIONS(197), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(199), - [sym_comment] = ACTIONS(47), + [sym_elif_clause] = STATE(85), + [sym_else_clause] = STATE(83), + [anon_sym_fi] = ACTIONS(245), + [anon_sym_elif] = ACTIONS(249), + [anon_sym_else] = ACTIONS(251), + [sym_comment] = ACTIONS(57), }, [65] = { - [anon_sym_SEMI] = ACTIONS(169), - [anon_sym_SEMI_SEMI] = ACTIONS(169), - [anon_sym_LF] = ACTIONS(169), - [anon_sym_PIPE] = ACTIONS(169), - [anon_sym_PIPE_AMP] = ACTIONS(169), - [anon_sym_AMP_AMP] = ACTIONS(169), - [anon_sym_PIPE_PIPE] = ACTIONS(169), - [anon_sym_LT] = ACTIONS(169), - [anon_sym_GT] = ACTIONS(169), - [anon_sym_LT_AMP] = ACTIONS(169), - [anon_sym_GT_AMP] = ACTIONS(169), - [anon_sym_LT_LT] = ACTIONS(169), - [anon_sym_LT_LT_DASH] = ACTIONS(169), - [sym_file_descriptor] = ACTIONS(169), - [sym_comment] = ACTIONS(79), - }, - [66] = { - [anon_sym_SEMI] = ACTIONS(173), - [anon_sym_SEMI_SEMI] = ACTIONS(173), - [anon_sym_LF] = ACTIONS(173), - [anon_sym_PIPE] = ACTIONS(173), - [anon_sym_PIPE_AMP] = ACTIONS(173), - [anon_sym_AMP_AMP] = ACTIONS(173), - [anon_sym_PIPE_PIPE] = ACTIONS(173), - [anon_sym_LT] = ACTIONS(173), - [anon_sym_GT] = ACTIONS(173), - [anon_sym_LT_AMP] = ACTIONS(173), - [anon_sym_GT_AMP] = ACTIONS(173), - [anon_sym_LT_LT] = ACTIONS(173), - [anon_sym_LT_LT_DASH] = ACTIONS(173), - [sym_file_descriptor] = ACTIONS(173), - [sym_comment] = ACTIONS(79), - }, - [67] = { - [sym_expansion] = STATE(58), - [sym_operator_expansion] = STATE(58), - [sym_file_redirect] = STATE(22), - [sym_heredoc_redirect] = STATE(22), - [aux_sym_command_repeat3] = STATE(76), - [anon_sym_SEMI] = ACTIONS(247), - [anon_sym_SEMI_SEMI] = ACTIONS(247), - [anon_sym_LF] = ACTIONS(247), - [anon_sym_PIPE] = ACTIONS(247), - [anon_sym_PIPE_AMP] = ACTIONS(247), - [anon_sym_AMP_AMP] = ACTIONS(247), - [anon_sym_PIPE_PIPE] = ACTIONS(247), - [anon_sym_DOLLAR] = ACTIONS(121), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(123), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_word] = ACTIONS(185), - [sym_comment] = ACTIONS(79), - }, - [68] = { - [sym_file_redirect] = STATE(48), - [sym_heredoc_redirect] = STATE(48), - [anon_sym_SEMI] = ACTIONS(247), - [anon_sym_SEMI_SEMI] = ACTIONS(247), - [anon_sym_LF] = ACTIONS(247), - [anon_sym_PIPE] = ACTIONS(247), - [anon_sym_PIPE_AMP] = ACTIONS(247), - [anon_sym_AMP_AMP] = ACTIONS(247), - [anon_sym_PIPE_PIPE] = ACTIONS(247), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_comment] = ACTIONS(79), - }, - [69] = { - [anon_sym_SEMI] = ACTIONS(249), - [anon_sym_SEMI_SEMI] = ACTIONS(249), - [anon_sym_LF] = ACTIONS(249), - [anon_sym_PIPE] = ACTIONS(249), - [anon_sym_PIPE_AMP] = ACTIONS(249), - [anon_sym_AMP_AMP] = ACTIONS(249), - [anon_sym_PIPE_PIPE] = ACTIONS(249), - [sym_comment] = ACTIONS(79), - }, - [70] = { - [sym_word] = ACTIONS(251), - [sym_comment] = ACTIONS(47), - }, - [71] = { [anon_sym_SEMI] = ACTIONS(253), [anon_sym_SEMI_SEMI] = ACTIONS(253), [anon_sym_LF] = ACTIONS(253), @@ -2769,49 +3284,82 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LT_LT_DASH] = ACTIONS(253), [sym_file_descriptor] = ACTIONS(253), [sym_word] = ACTIONS(253), - [sym_comment] = ACTIONS(79), + [sym_comment] = ACTIONS(91), }, - [72] = { - [sym__heredoc_middle] = ACTIONS(255), - [sym__heredoc_end] = ACTIONS(255), - [anon_sym_DOLLAR] = ACTIONS(257), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(255), - [sym_comment] = ACTIONS(47), + [66] = { + [anon_sym_EQ] = ACTIONS(255), + [anon_sym_COLON] = ACTIONS(257), + [anon_sym_COLON_QMARK] = ACTIONS(255), + [anon_sym_RBRACE] = ACTIONS(259), + [sym_comment] = ACTIONS(57), }, - [73] = { - [anon_sym_EQ] = ACTIONS(259), - [anon_sym_COLON] = ACTIONS(261), - [anon_sym_COLON_QMARK] = ACTIONS(259), - [anon_sym_RBRACE] = ACTIONS(263), - [sym_comment] = ACTIONS(47), + [67] = { + [anon_sym_SEMI] = ACTIONS(261), + [anon_sym_SEMI_SEMI] = ACTIONS(261), + [anon_sym_LF] = ACTIONS(261), + [anon_sym_PIPE] = ACTIONS(261), + [anon_sym_PIPE_AMP] = ACTIONS(261), + [anon_sym_AMP_AMP] = ACTIONS(261), + [anon_sym_PIPE_PIPE] = ACTIONS(261), + [anon_sym_DOLLAR] = ACTIONS(261), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(261), + [anon_sym_LT] = ACTIONS(261), + [anon_sym_GT] = ACTIONS(261), + [anon_sym_LT_AMP] = ACTIONS(261), + [anon_sym_GT_AMP] = ACTIONS(261), + [anon_sym_LT_LT] = ACTIONS(261), + [anon_sym_LT_LT_DASH] = ACTIONS(261), + [sym_file_descriptor] = ACTIONS(261), + [sym_word] = ACTIONS(261), + [sym_comment] = ACTIONS(91), }, - [74] = { - [sym__heredoc_middle] = ACTIONS(265), - [sym__heredoc_end] = ACTIONS(265), - [anon_sym_DOLLAR] = ACTIONS(267), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(265), - [sym_comment] = ACTIONS(47), + [68] = { + [anon_sym_SEMI] = ACTIONS(263), + [anon_sym_SEMI_SEMI] = ACTIONS(263), + [anon_sym_LF] = ACTIONS(263), + [anon_sym_PIPE] = ACTIONS(263), + [anon_sym_PIPE_AMP] = ACTIONS(263), + [anon_sym_AMP_AMP] = ACTIONS(263), + [anon_sym_PIPE_PIPE] = ACTIONS(263), + [anon_sym_DOLLAR] = ACTIONS(263), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(263), + [anon_sym_LT] = ACTIONS(263), + [anon_sym_GT] = ACTIONS(263), + [anon_sym_LT_AMP] = ACTIONS(263), + [anon_sym_GT_AMP] = ACTIONS(263), + [anon_sym_LT_LT] = ACTIONS(263), + [anon_sym_LT_LT_DASH] = ACTIONS(263), + [sym_file_descriptor] = ACTIONS(263), + [sym_word] = ACTIONS(263), + [sym_comment] = ACTIONS(91), }, - [75] = { - [anon_sym_SEMI] = ACTIONS(269), - [anon_sym_SEMI_SEMI] = ACTIONS(269), - [anon_sym_LF] = ACTIONS(269), - [anon_sym_PIPE] = ACTIONS(269), - [anon_sym_PIPE_AMP] = ACTIONS(269), - [anon_sym_AMP_AMP] = ACTIONS(269), - [anon_sym_PIPE_PIPE] = ACTIONS(269), - [anon_sym_LT] = ACTIONS(269), - [anon_sym_GT] = ACTIONS(269), - [anon_sym_LT_AMP] = ACTIONS(269), - [anon_sym_GT_AMP] = ACTIONS(269), - [anon_sym_LT_LT] = ACTIONS(269), - [anon_sym_LT_LT_DASH] = ACTIONS(269), - [sym_file_descriptor] = ACTIONS(269), - [sym_comment] = ACTIONS(79), + [69] = { + [sym_file_redirect] = STATE(51), + [sym_heredoc_redirect] = STATE(51), + [anon_sym_SEMI] = ACTIONS(265), + [anon_sym_SEMI_SEMI] = ACTIONS(265), + [anon_sym_LF] = ACTIONS(265), + [anon_sym_PIPE] = ACTIONS(265), + [anon_sym_PIPE_AMP] = ACTIONS(265), + [anon_sym_AMP_AMP] = ACTIONS(265), + [anon_sym_PIPE_PIPE] = ACTIONS(265), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_comment] = ACTIONS(91), }, - [76] = { - [sym_file_redirect] = STATE(48), - [sym_heredoc_redirect] = STATE(48), + [70] = { + [sym__heredoc_middle] = ACTIONS(267), + [sym__heredoc_end] = ACTIONS(267), + [anon_sym_DOLLAR] = ACTIONS(269), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(267), + [sym_comment] = ACTIONS(57), + }, + [71] = { [anon_sym_SEMI] = ACTIONS(271), [anon_sym_SEMI_SEMI] = ACTIONS(271), [anon_sym_LF] = ACTIONS(271), @@ -2819,31 +3367,72 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_PIPE_AMP] = ACTIONS(271), [anon_sym_AMP_AMP] = ACTIONS(271), [anon_sym_PIPE_PIPE] = ACTIONS(271), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_comment] = ACTIONS(79), + [anon_sym_LT] = ACTIONS(271), + [anon_sym_GT] = ACTIONS(271), + [anon_sym_LT_AMP] = ACTIONS(271), + [anon_sym_GT_AMP] = ACTIONS(271), + [anon_sym_LT_LT] = ACTIONS(271), + [anon_sym_LT_LT_DASH] = ACTIONS(271), + [sym_file_descriptor] = ACTIONS(271), + [sym_comment] = ACTIONS(91), + }, + [72] = { + [sym_word] = ACTIONS(273), + [sym_comment] = ACTIONS(57), + }, + [73] = { + [sym_leading_word] = ACTIONS(275), + [sym_comment] = ACTIONS(57), + }, + [74] = { + [sym_expansion] = STATE(90), + [sym_operator_expansion] = STATE(90), + [sym__heredoc_middle] = ACTIONS(277), + [sym__heredoc_end] = ACTIONS(279), + [anon_sym_DOLLAR] = ACTIONS(217), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(219), + [sym_comment] = ACTIONS(57), + }, + [75] = { + [anon_sym_SEMI] = ACTIONS(189), + [anon_sym_SEMI_SEMI] = ACTIONS(189), + [anon_sym_LF] = ACTIONS(189), + [anon_sym_PIPE] = ACTIONS(189), + [anon_sym_PIPE_AMP] = ACTIONS(189), + [anon_sym_AMP_AMP] = ACTIONS(189), + [anon_sym_PIPE_PIPE] = ACTIONS(189), + [anon_sym_LT] = ACTIONS(189), + [anon_sym_GT] = ACTIONS(189), + [anon_sym_LT_AMP] = ACTIONS(189), + [anon_sym_GT_AMP] = ACTIONS(189), + [anon_sym_LT_LT] = ACTIONS(189), + [anon_sym_LT_LT_DASH] = ACTIONS(189), + [sym_file_descriptor] = ACTIONS(189), + [sym_comment] = ACTIONS(91), + }, + [76] = { + [anon_sym_SEMI] = ACTIONS(193), + [anon_sym_SEMI_SEMI] = ACTIONS(193), + [anon_sym_LF] = ACTIONS(193), + [anon_sym_PIPE] = ACTIONS(193), + [anon_sym_PIPE_AMP] = ACTIONS(193), + [anon_sym_AMP_AMP] = ACTIONS(193), + [anon_sym_PIPE_PIPE] = ACTIONS(193), + [anon_sym_LT] = ACTIONS(193), + [anon_sym_GT] = ACTIONS(193), + [anon_sym_LT_AMP] = ACTIONS(193), + [anon_sym_GT_AMP] = ACTIONS(193), + [anon_sym_LT_LT] = ACTIONS(193), + [anon_sym_LT_LT_DASH] = ACTIONS(193), + [sym_file_descriptor] = ACTIONS(193), + [sym_comment] = ACTIONS(91), }, [77] = { - [anon_sym_RBRACE] = ACTIONS(273), - [sym_comment] = ACTIONS(47), - }, - [78] = { - [sym_word] = ACTIONS(275), - [sym_comment] = ACTIONS(47), - }, - [79] = { - [sym__heredoc_middle] = ACTIONS(277), - [sym__heredoc_end] = ACTIONS(277), - [anon_sym_DOLLAR] = ACTIONS(279), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(277), - [sym_comment] = ACTIONS(47), - }, - [80] = { + [sym_expansion] = STATE(68), + [sym_operator_expansion] = STATE(68), + [sym_file_redirect] = STATE(24), + [sym_heredoc_redirect] = STATE(24), + [aux_sym_command_repeat3] = STATE(92), [anon_sym_SEMI] = ACTIONS(281), [anon_sym_SEMI_SEMI] = ACTIONS(281), [anon_sym_LF] = ACTIONS(281), @@ -2851,30 +3440,73 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_PIPE_AMP] = ACTIONS(281), [anon_sym_AMP_AMP] = ACTIONS(281), [anon_sym_PIPE_PIPE] = ACTIONS(281), - [anon_sym_DOLLAR] = ACTIONS(281), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(281), - [anon_sym_LT] = ACTIONS(281), - [anon_sym_GT] = ACTIONS(281), - [anon_sym_LT_AMP] = ACTIONS(281), - [anon_sym_GT_AMP] = ACTIONS(281), - [anon_sym_LT_LT] = ACTIONS(281), - [anon_sym_LT_LT_DASH] = ACTIONS(281), - [sym_file_descriptor] = ACTIONS(281), - [sym_word] = ACTIONS(281), - [sym_comment] = ACTIONS(79), + [anon_sym_DOLLAR] = ACTIONS(135), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(137), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_word] = ACTIONS(205), + [sym_comment] = ACTIONS(91), + }, + [78] = { + [sym_file_redirect] = STATE(51), + [sym_heredoc_redirect] = STATE(51), + [anon_sym_SEMI] = ACTIONS(281), + [anon_sym_SEMI_SEMI] = ACTIONS(281), + [anon_sym_LF] = ACTIONS(281), + [anon_sym_PIPE] = ACTIONS(281), + [anon_sym_PIPE_AMP] = ACTIONS(281), + [anon_sym_AMP_AMP] = ACTIONS(281), + [anon_sym_PIPE_PIPE] = ACTIONS(281), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_comment] = ACTIONS(91), + }, + [79] = { + [anon_sym_SEMI] = ACTIONS(283), + [anon_sym_SEMI_SEMI] = ACTIONS(283), + [anon_sym_LF] = ACTIONS(283), + [anon_sym_PIPE] = ACTIONS(283), + [anon_sym_PIPE_AMP] = ACTIONS(283), + [anon_sym_AMP_AMP] = ACTIONS(283), + [anon_sym_PIPE_PIPE] = ACTIONS(283), + [sym_comment] = ACTIONS(91), + }, + [80] = { + [anon_sym_then] = ACTIONS(285), + [sym_comment] = ACTIONS(57), }, [81] = { - [anon_sym_RBRACE] = ACTIONS(283), - [sym_comment] = ACTIONS(47), + [sym__terminated_statement] = STATE(29), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_fi] = ACTIONS(287), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), }, [82] = { - [sym__heredoc_middle] = ACTIONS(285), - [sym__heredoc_end] = ACTIONS(285), - [anon_sym_DOLLAR] = ACTIONS(287), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(285), - [sym_comment] = ACTIONS(47), - }, - [83] = { [anon_sym_SEMI] = ACTIONS(289), [anon_sym_SEMI_SEMI] = ACTIONS(289), [anon_sym_LF] = ACTIONS(289), @@ -2882,209 +3514,290 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_PIPE_AMP] = ACTIONS(289), [anon_sym_AMP_AMP] = ACTIONS(289), [anon_sym_PIPE_PIPE] = ACTIONS(289), - [sym_comment] = ACTIONS(79), + [sym_comment] = ACTIONS(91), + }, + [83] = { + [anon_sym_fi] = ACTIONS(291), + [sym_comment] = ACTIONS(57), }, [84] = { - [sym_word] = ACTIONS(292), - [sym_comment] = ACTIONS(47), + [sym_elif_clause] = STATE(85), + [sym_else_clause] = STATE(95), + [anon_sym_fi] = ACTIONS(291), + [anon_sym_elif] = ACTIONS(249), + [anon_sym_else] = ACTIONS(251), + [sym_comment] = ACTIONS(57), }, [85] = { - [sym_word] = ACTIONS(294), - [sym_comment] = ACTIONS(47), + [anon_sym_fi] = ACTIONS(293), + [anon_sym_elif] = ACTIONS(293), + [anon_sym_else] = ACTIONS(293), + [sym_comment] = ACTIONS(57), }, [86] = { - [sym_leading_word] = ACTIONS(296), - [sym_comment] = ACTIONS(47), + [sym_word] = ACTIONS(295), + [sym_comment] = ACTIONS(57), }, [87] = { - [sym_word] = ACTIONS(298), - [sym_comment] = ACTIONS(47), + [anon_sym_SEMI] = ACTIONS(297), + [anon_sym_SEMI_SEMI] = ACTIONS(297), + [anon_sym_LF] = ACTIONS(297), + [anon_sym_PIPE] = ACTIONS(297), + [anon_sym_PIPE_AMP] = ACTIONS(297), + [anon_sym_AMP_AMP] = ACTIONS(297), + [anon_sym_PIPE_PIPE] = ACTIONS(297), + [anon_sym_DOLLAR] = ACTIONS(297), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(297), + [anon_sym_LT] = ACTIONS(297), + [anon_sym_GT] = ACTIONS(297), + [anon_sym_LT_AMP] = ACTIONS(297), + [anon_sym_GT_AMP] = ACTIONS(297), + [anon_sym_LT_LT] = ACTIONS(297), + [anon_sym_LT_LT_DASH] = ACTIONS(297), + [sym_file_descriptor] = ACTIONS(297), + [sym_word] = ACTIONS(297), + [sym_comment] = ACTIONS(91), }, [88] = { - [sym__heredoc_middle] = ACTIONS(300), - [sym__heredoc_end] = ACTIONS(300), - [anon_sym_SEMI] = ACTIONS(303), - [anon_sym_SEMI_SEMI] = ACTIONS(303), - [anon_sym_LF] = ACTIONS(303), - [anon_sym_PIPE] = ACTIONS(303), - [anon_sym_PIPE_AMP] = ACTIONS(303), - [anon_sym_AMP_AMP] = ACTIONS(303), - [anon_sym_PIPE_PIPE] = ACTIONS(303), - [anon_sym_DOLLAR] = ACTIONS(303), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(303), - [anon_sym_LT] = ACTIONS(303), - [anon_sym_GT] = ACTIONS(303), - [anon_sym_LT_AMP] = ACTIONS(303), - [anon_sym_GT_AMP] = ACTIONS(303), - [anon_sym_LT_LT] = ACTIONS(303), - [anon_sym_LT_LT_DASH] = ACTIONS(303), - [sym_file_descriptor] = ACTIONS(303), - [sym_word] = ACTIONS(303), - [sym_comment] = ACTIONS(79), + [sym__heredoc_middle] = ACTIONS(299), + [sym__heredoc_end] = ACTIONS(299), + [anon_sym_DOLLAR] = ACTIONS(301), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(299), + [sym_comment] = ACTIONS(57), }, [89] = { - [sym_file_descriptor] = ACTIONS(306), - [sym_word] = ACTIONS(308), - [sym_comment] = ACTIONS(47), + [anon_sym_EQ] = ACTIONS(303), + [anon_sym_COLON] = ACTIONS(305), + [anon_sym_COLON_QMARK] = ACTIONS(303), + [anon_sym_RBRACE] = ACTIONS(307), + [sym_comment] = ACTIONS(57), }, [90] = { - [anon_sym_SEMI] = ACTIONS(310), - [anon_sym_SEMI_SEMI] = ACTIONS(310), - [anon_sym_LF] = ACTIONS(310), - [anon_sym_PIPE] = ACTIONS(310), - [anon_sym_PIPE_AMP] = ACTIONS(310), - [anon_sym_AMP_AMP] = ACTIONS(310), - [anon_sym_PIPE_PIPE] = ACTIONS(310), + [sym__heredoc_middle] = ACTIONS(309), + [sym__heredoc_end] = ACTIONS(309), + [anon_sym_DOLLAR] = ACTIONS(311), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(309), + [sym_comment] = ACTIONS(57), + }, + [91] = { + [anon_sym_SEMI] = ACTIONS(313), + [anon_sym_SEMI_SEMI] = ACTIONS(313), + [anon_sym_LF] = ACTIONS(313), + [anon_sym_PIPE] = ACTIONS(313), + [anon_sym_PIPE_AMP] = ACTIONS(313), + [anon_sym_AMP_AMP] = ACTIONS(313), + [anon_sym_PIPE_PIPE] = ACTIONS(313), [anon_sym_LT] = ACTIONS(313), [anon_sym_GT] = ACTIONS(313), [anon_sym_LT_AMP] = ACTIONS(313), [anon_sym_GT_AMP] = ACTIONS(313), - [anon_sym_LT_LT] = ACTIONS(310), - [anon_sym_LT_LT_DASH] = ACTIONS(310), - [sym_file_descriptor] = ACTIONS(310), - [sym_leading_word] = ACTIONS(310), - [sym_comment] = ACTIONS(79), - }, - [91] = { - [sym__heredoc_middle] = ACTIONS(317), - [sym__heredoc_end] = ACTIONS(317), - [anon_sym_DOLLAR] = ACTIONS(320), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(317), - [sym_comment] = ACTIONS(47), + [anon_sym_LT_LT] = ACTIONS(313), + [anon_sym_LT_LT_DASH] = ACTIONS(313), + [sym_file_descriptor] = ACTIONS(313), + [sym_comment] = ACTIONS(91), }, [92] = { - [anon_sym_SEMI] = ACTIONS(323), - [anon_sym_SEMI_SEMI] = ACTIONS(323), - [anon_sym_LF] = ACTIONS(323), - [anon_sym_PIPE] = ACTIONS(323), - [anon_sym_PIPE_AMP] = ACTIONS(323), - [anon_sym_AMP_AMP] = ACTIONS(323), - [anon_sym_PIPE_PIPE] = ACTIONS(323), - [anon_sym_LT] = ACTIONS(323), - [anon_sym_GT] = ACTIONS(323), - [anon_sym_LT_AMP] = ACTIONS(323), - [anon_sym_GT_AMP] = ACTIONS(323), - [anon_sym_LT_LT] = ACTIONS(323), - [anon_sym_LT_LT_DASH] = ACTIONS(323), - [sym_file_descriptor] = ACTIONS(323), - [sym_comment] = ACTIONS(79), + [sym_file_redirect] = STATE(51), + [sym_heredoc_redirect] = STATE(51), + [anon_sym_SEMI] = ACTIONS(315), + [anon_sym_SEMI_SEMI] = ACTIONS(315), + [anon_sym_LF] = ACTIONS(315), + [anon_sym_PIPE] = ACTIONS(315), + [anon_sym_PIPE_AMP] = ACTIONS(315), + [anon_sym_AMP_AMP] = ACTIONS(315), + [anon_sym_PIPE_PIPE] = ACTIONS(315), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_comment] = ACTIONS(91), }, [93] = { - [sym_do_group] = STATE(31), - [ts_builtin_sym_end] = ACTIONS(326), - [anon_sym_while] = ACTIONS(329), - [anon_sym_do] = ACTIONS(332), - [anon_sym_done] = ACTIONS(329), - [anon_sym_LT] = ACTIONS(329), - [anon_sym_GT] = ACTIONS(329), - [anon_sym_LT_AMP] = ACTIONS(329), - [anon_sym_GT_AMP] = ACTIONS(329), - [sym_file_descriptor] = ACTIONS(329), - [sym_leading_word] = ACTIONS(334), - [sym_comment] = ACTIONS(47), + [sym__terminated_statement] = STATE(8), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_program_repeat1] = STATE(99), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_fi] = ACTIONS(317), + [anon_sym_elif] = ACTIONS(317), + [anon_sym_else] = ACTIONS(317), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), }, [94] = { - [anon_sym_SEMI] = ACTIONS(337), - [anon_sym_SEMI_SEMI] = ACTIONS(337), - [anon_sym_LF] = ACTIONS(337), - [anon_sym_PIPE] = ACTIONS(341), - [anon_sym_PIPE_AMP] = ACTIONS(341), - [anon_sym_AMP_AMP] = ACTIONS(345), - [anon_sym_PIPE_PIPE] = ACTIONS(345), - [sym_comment] = ACTIONS(79), + [anon_sym_SEMI] = ACTIONS(319), + [anon_sym_SEMI_SEMI] = ACTIONS(319), + [anon_sym_LF] = ACTIONS(319), + [anon_sym_PIPE] = ACTIONS(319), + [anon_sym_PIPE_AMP] = ACTIONS(319), + [anon_sym_AMP_AMP] = ACTIONS(319), + [anon_sym_PIPE_PIPE] = ACTIONS(319), + [sym_comment] = ACTIONS(91), }, [95] = { - [anon_sym_LT] = ACTIONS(349), - [anon_sym_GT] = ACTIONS(349), - [anon_sym_LT_AMP] = ACTIONS(349), - [anon_sym_GT_AMP] = ACTIONS(349), - [sym_file_descriptor] = ACTIONS(349), - [sym_leading_word] = ACTIONS(352), - [sym_comment] = ACTIONS(47), + [anon_sym_fi] = ACTIONS(321), + [sym_comment] = ACTIONS(57), }, [96] = { - [sym__heredoc_middle] = ACTIONS(317), - [sym__heredoc_end] = ACTIONS(317), - [anon_sym_SEMI] = ACTIONS(355), - [anon_sym_SEMI_SEMI] = ACTIONS(355), - [anon_sym_LF] = ACTIONS(355), - [anon_sym_PIPE] = ACTIONS(355), - [anon_sym_PIPE_AMP] = ACTIONS(355), - [anon_sym_AMP_AMP] = ACTIONS(355), - [anon_sym_PIPE_PIPE] = ACTIONS(355), - [anon_sym_DOLLAR] = ACTIONS(358), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(358), - [anon_sym_LT] = ACTIONS(355), - [anon_sym_GT] = ACTIONS(355), - [anon_sym_LT_AMP] = ACTIONS(355), - [anon_sym_GT_AMP] = ACTIONS(355), - [anon_sym_LT_LT] = ACTIONS(355), - [anon_sym_LT_LT_DASH] = ACTIONS(355), - [sym_file_descriptor] = ACTIONS(355), - [sym_word] = ACTIONS(355), - [sym_comment] = ACTIONS(79), + [anon_sym_RBRACE] = ACTIONS(323), + [sym_comment] = ACTIONS(57), }, [97] = { - [anon_sym_SEMI] = ACTIONS(363), - [anon_sym_SEMI_SEMI] = ACTIONS(363), - [anon_sym_LF] = ACTIONS(363), - [anon_sym_PIPE] = ACTIONS(363), - [anon_sym_PIPE_AMP] = ACTIONS(363), - [anon_sym_AMP_AMP] = ACTIONS(363), - [anon_sym_PIPE_PIPE] = ACTIONS(363), - [anon_sym_LT] = ACTIONS(366), - [anon_sym_GT] = ACTIONS(366), - [anon_sym_LT_AMP] = ACTIONS(366), - [anon_sym_GT_AMP] = ACTIONS(366), - [anon_sym_LT_LT] = ACTIONS(363), - [anon_sym_LT_LT_DASH] = ACTIONS(363), - [sym_file_descriptor] = ACTIONS(366), - [sym_leading_word] = ACTIONS(352), - [sym_comment] = ACTIONS(79), + [sym_word] = ACTIONS(325), + [sym_comment] = ACTIONS(57), }, [98] = { - [anon_sym_SEMI] = ACTIONS(363), - [anon_sym_SEMI_SEMI] = ACTIONS(363), - [anon_sym_LF] = ACTIONS(363), - [anon_sym_PIPE] = ACTIONS(363), - [anon_sym_PIPE_AMP] = ACTIONS(363), - [anon_sym_AMP_AMP] = ACTIONS(363), - [anon_sym_PIPE_PIPE] = ACTIONS(363), - [anon_sym_LT] = ACTIONS(363), - [anon_sym_GT] = ACTIONS(363), - [anon_sym_LT_AMP] = ACTIONS(363), - [anon_sym_GT_AMP] = ACTIONS(363), - [anon_sym_LT_LT] = ACTIONS(363), - [anon_sym_LT_LT_DASH] = ACTIONS(363), - [sym_file_descriptor] = ACTIONS(363), - [sym_comment] = ACTIONS(79), + [sym__heredoc_middle] = ACTIONS(327), + [sym__heredoc_end] = ACTIONS(327), + [anon_sym_DOLLAR] = ACTIONS(329), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(327), + [sym_comment] = ACTIONS(57), }, [99] = { - [sym__terminated_statement] = STATE(27), - [sym_while_statement] = STATE(8), - [sym_command] = STATE(8), - [sym_pipeline] = STATE(8), - [sym_list] = STATE(8), - [sym_environment_variable_assignment] = STATE(9), - [sym_file_redirect] = STATE(9), - [aux_sym_command_repeat1] = STATE(11), - [ts_builtin_sym_end] = ACTIONS(99), - [anon_sym_while] = ACTIONS(51), - [anon_sym_done] = ACTIONS(217), - [anon_sym_LT] = ACTIONS(53), - [anon_sym_GT] = ACTIONS(53), - [anon_sym_LT_AMP] = ACTIONS(53), - [anon_sym_GT_AMP] = ACTIONS(53), - [sym_file_descriptor] = ACTIONS(55), - [sym_leading_word] = ACTIONS(57), - [sym_comment] = ACTIONS(47), + [sym__terminated_statement] = STATE(29), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_fi] = ACTIONS(331), + [anon_sym_elif] = ACTIONS(331), + [anon_sym_else] = ACTIONS(331), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), }, [100] = { - [sym_expansion] = STATE(58), - [sym_operator_expansion] = STATE(58), - [sym_file_redirect] = STATE(22), - [sym_heredoc_redirect] = STATE(22), - [aux_sym_command_repeat3] = STATE(109), + [anon_sym_SEMI] = ACTIONS(333), + [anon_sym_SEMI_SEMI] = ACTIONS(333), + [anon_sym_LF] = ACTIONS(333), + [anon_sym_PIPE] = ACTIONS(333), + [anon_sym_PIPE_AMP] = ACTIONS(333), + [anon_sym_AMP_AMP] = ACTIONS(333), + [anon_sym_PIPE_PIPE] = ACTIONS(333), + [sym_comment] = ACTIONS(91), + }, + [101] = { + [anon_sym_SEMI] = ACTIONS(335), + [anon_sym_SEMI_SEMI] = ACTIONS(335), + [anon_sym_LF] = ACTIONS(335), + [anon_sym_PIPE] = ACTIONS(335), + [anon_sym_PIPE_AMP] = ACTIONS(335), + [anon_sym_AMP_AMP] = ACTIONS(335), + [anon_sym_PIPE_PIPE] = ACTIONS(335), + [anon_sym_DOLLAR] = ACTIONS(335), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(335), + [anon_sym_LT] = ACTIONS(335), + [anon_sym_GT] = ACTIONS(335), + [anon_sym_LT_AMP] = ACTIONS(335), + [anon_sym_GT_AMP] = ACTIONS(335), + [anon_sym_LT_LT] = ACTIONS(335), + [anon_sym_LT_LT_DASH] = ACTIONS(335), + [sym_file_descriptor] = ACTIONS(335), + [sym_word] = ACTIONS(335), + [sym_comment] = ACTIONS(91), + }, + [102] = { + [anon_sym_RBRACE] = ACTIONS(337), + [sym_comment] = ACTIONS(57), + }, + [103] = { + [sym__heredoc_middle] = ACTIONS(339), + [sym__heredoc_end] = ACTIONS(339), + [anon_sym_DOLLAR] = ACTIONS(341), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(339), + [sym_comment] = ACTIONS(57), + }, + [104] = { + [sym__terminated_statement] = STATE(8), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_elif_clause] = STATE(61), + [sym_else_clause] = STATE(62), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_program_repeat1] = STATE(128), + [aux_sym_if_statement_repeat1] = STATE(64), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_fi] = ACTIONS(343), + [anon_sym_elif] = ACTIONS(346), + [anon_sym_else] = ACTIONS(349), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), + }, + [105] = { + [anon_sym_SEMI] = ACTIONS(352), + [anon_sym_SEMI_SEMI] = ACTIONS(352), + [anon_sym_LF] = ACTIONS(352), + [anon_sym_PIPE] = ACTIONS(352), + [anon_sym_PIPE_AMP] = ACTIONS(352), + [anon_sym_AMP_AMP] = ACTIONS(352), + [anon_sym_PIPE_PIPE] = ACTIONS(352), + [sym_comment] = ACTIONS(91), + }, + [106] = { + [anon_sym_SEMI] = ACTIONS(357), + [anon_sym_SEMI_SEMI] = ACTIONS(357), + [anon_sym_LF] = ACTIONS(357), + [anon_sym_PIPE] = ACTIONS(357), + [anon_sym_PIPE_AMP] = ACTIONS(357), + [anon_sym_AMP_AMP] = ACTIONS(357), + [anon_sym_PIPE_PIPE] = ACTIONS(357), + [sym_comment] = ACTIONS(91), + }, + [107] = { + [sym_word] = ACTIONS(360), + [sym_comment] = ACTIONS(57), + }, + [108] = { + [sym_word] = ACTIONS(362), + [sym_comment] = ACTIONS(57), + }, + [109] = { + [sym_leading_word] = ACTIONS(364), + [sym_comment] = ACTIONS(57), + }, + [110] = { + [sym_word] = ACTIONS(366), + [sym_comment] = ACTIONS(57), + }, + [111] = { + [sym__heredoc_middle] = ACTIONS(368), + [sym__heredoc_end] = ACTIONS(368), [anon_sym_SEMI] = ACTIONS(371), [anon_sym_SEMI_SEMI] = ACTIONS(371), [anon_sym_LF] = ACTIONS(371), @@ -3092,165 +3805,289 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_PIPE_AMP] = ACTIONS(371), [anon_sym_AMP_AMP] = ACTIONS(371), [anon_sym_PIPE_PIPE] = ACTIONS(371), - [anon_sym_DOLLAR] = ACTIONS(121), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(123), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_word] = ACTIONS(185), - [sym_comment] = ACTIONS(79), + [anon_sym_DOLLAR] = ACTIONS(371), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(371), + [anon_sym_LT] = ACTIONS(371), + [anon_sym_GT] = ACTIONS(371), + [anon_sym_LT_AMP] = ACTIONS(371), + [anon_sym_GT_AMP] = ACTIONS(371), + [anon_sym_LT_LT] = ACTIONS(371), + [anon_sym_LT_LT_DASH] = ACTIONS(371), + [sym_file_descriptor] = ACTIONS(371), + [sym_word] = ACTIONS(371), + [sym_comment] = ACTIONS(91), }, - [101] = { - [sym_file_redirect] = STATE(48), - [sym_heredoc_redirect] = STATE(48), - [anon_sym_SEMI] = ACTIONS(374), - [anon_sym_SEMI_SEMI] = ACTIONS(374), - [anon_sym_LF] = ACTIONS(374), - [anon_sym_PIPE] = ACTIONS(374), - [anon_sym_PIPE_AMP] = ACTIONS(374), - [anon_sym_AMP_AMP] = ACTIONS(374), - [anon_sym_PIPE_PIPE] = ACTIONS(374), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_comment] = ACTIONS(79), + [112] = { + [sym_file_descriptor] = ACTIONS(374), + [sym_word] = ACTIONS(376), + [sym_comment] = ACTIONS(57), }, - [102] = { - [anon_sym_RBRACE] = ACTIONS(381), - [anon_sym_LT] = ACTIONS(187), - [anon_sym_GT] = ACTIONS(187), - [anon_sym_LT_AMP] = ACTIONS(187), - [anon_sym_GT_AMP] = ACTIONS(187), - [sym_file_descriptor] = ACTIONS(187), - [sym_leading_word] = ACTIONS(189), - [sym_comment] = ACTIONS(47), + [113] = { + [anon_sym_SEMI] = ACTIONS(378), + [anon_sym_SEMI_SEMI] = ACTIONS(378), + [anon_sym_LF] = ACTIONS(378), + [anon_sym_PIPE] = ACTIONS(378), + [anon_sym_PIPE_AMP] = ACTIONS(378), + [anon_sym_AMP_AMP] = ACTIONS(378), + [anon_sym_PIPE_PIPE] = ACTIONS(378), + [anon_sym_LT] = ACTIONS(381), + [anon_sym_GT] = ACTIONS(381), + [anon_sym_LT_AMP] = ACTIONS(381), + [anon_sym_GT_AMP] = ACTIONS(381), + [anon_sym_LT_LT] = ACTIONS(378), + [anon_sym_LT_LT_DASH] = ACTIONS(378), + [sym_file_descriptor] = ACTIONS(378), + [sym_leading_word] = ACTIONS(378), + [sym_comment] = ACTIONS(91), }, - [103] = { - [sym__heredoc_middle] = ACTIONS(255), - [sym__heredoc_end] = ACTIONS(255), - [anon_sym_SEMI] = ACTIONS(219), - [anon_sym_SEMI_SEMI] = ACTIONS(219), - [anon_sym_LF] = ACTIONS(219), - [anon_sym_PIPE] = ACTIONS(219), - [anon_sym_PIPE_AMP] = ACTIONS(219), - [anon_sym_AMP_AMP] = ACTIONS(219), - [anon_sym_PIPE_PIPE] = ACTIONS(219), - [anon_sym_DOLLAR] = ACTIONS(219), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(219), - [anon_sym_LT] = ACTIONS(219), - [anon_sym_GT] = ACTIONS(219), - [anon_sym_LT_AMP] = ACTIONS(219), - [anon_sym_GT_AMP] = ACTIONS(219), - [anon_sym_LT_LT] = ACTIONS(219), - [anon_sym_LT_LT_DASH] = ACTIONS(219), - [sym_file_descriptor] = ACTIONS(219), - [sym_word] = ACTIONS(219), - [sym_comment] = ACTIONS(79), + [114] = { + [sym__heredoc_middle] = ACTIONS(385), + [sym__heredoc_end] = ACTIONS(385), + [anon_sym_DOLLAR] = ACTIONS(388), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(385), + [sym_comment] = ACTIONS(57), }, - [104] = { - [anon_sym_EQ] = ACTIONS(383), - [anon_sym_COLON] = ACTIONS(385), - [anon_sym_COLON_QMARK] = ACTIONS(383), - [anon_sym_RBRACE] = ACTIONS(387), - [sym_comment] = ACTIONS(47), + [115] = { + [anon_sym_SEMI] = ACTIONS(391), + [anon_sym_SEMI_SEMI] = ACTIONS(391), + [anon_sym_LF] = ACTIONS(391), + [anon_sym_PIPE] = ACTIONS(391), + [anon_sym_PIPE_AMP] = ACTIONS(391), + [anon_sym_AMP_AMP] = ACTIONS(391), + [anon_sym_PIPE_PIPE] = ACTIONS(391), + [anon_sym_LT] = ACTIONS(391), + [anon_sym_GT] = ACTIONS(391), + [anon_sym_LT_AMP] = ACTIONS(391), + [anon_sym_GT_AMP] = ACTIONS(391), + [anon_sym_LT_LT] = ACTIONS(391), + [anon_sym_LT_LT_DASH] = ACTIONS(391), + [sym_file_descriptor] = ACTIONS(391), + [sym_comment] = ACTIONS(91), }, - [105] = { - [anon_sym_RBRACE] = ACTIONS(381), - [sym_comment] = ACTIONS(47), + [116] = { + [sym_do_group] = STATE(33), + [ts_builtin_sym_end] = ACTIONS(394), + [anon_sym_while] = ACTIONS(397), + [anon_sym_if] = ACTIONS(397), + [anon_sym_then] = ACTIONS(400), + [anon_sym_fi] = ACTIONS(397), + [anon_sym_elif] = ACTIONS(397), + [anon_sym_else] = ACTIONS(397), + [anon_sym_do] = ACTIONS(402), + [anon_sym_done] = ACTIONS(397), + [anon_sym_LT] = ACTIONS(397), + [anon_sym_GT] = ACTIONS(397), + [anon_sym_LT_AMP] = ACTIONS(397), + [anon_sym_GT_AMP] = ACTIONS(397), + [sym_file_descriptor] = ACTIONS(397), + [sym_leading_word] = ACTIONS(404), + [sym_comment] = ACTIONS(57), }, - [106] = { - [anon_sym_SEMI] = ACTIONS(310), - [anon_sym_SEMI_SEMI] = ACTIONS(310), - [anon_sym_LF] = ACTIONS(310), - [anon_sym_PIPE] = ACTIONS(310), - [anon_sym_PIPE_AMP] = ACTIONS(310), - [anon_sym_AMP_AMP] = ACTIONS(310), - [anon_sym_PIPE_PIPE] = ACTIONS(310), - [anon_sym_LT] = ACTIONS(310), - [anon_sym_GT] = ACTIONS(310), - [anon_sym_LT_AMP] = ACTIONS(310), - [anon_sym_GT_AMP] = ACTIONS(310), - [anon_sym_LT_LT] = ACTIONS(310), - [anon_sym_LT_LT_DASH] = ACTIONS(310), - [sym_file_descriptor] = ACTIONS(310), - [sym_leading_word] = ACTIONS(310), - [sym_comment] = ACTIONS(79), + [117] = { + [anon_sym_SEMI] = ACTIONS(407), + [anon_sym_SEMI_SEMI] = ACTIONS(407), + [anon_sym_LF] = ACTIONS(407), + [anon_sym_PIPE] = ACTIONS(411), + [anon_sym_PIPE_AMP] = ACTIONS(411), + [anon_sym_AMP_AMP] = ACTIONS(415), + [anon_sym_PIPE_PIPE] = ACTIONS(415), + [sym_comment] = ACTIONS(91), }, - [107] = { - [anon_sym_SEMI] = ACTIONS(389), - [anon_sym_SEMI_SEMI] = ACTIONS(389), - [anon_sym_LF] = ACTIONS(389), - [anon_sym_PIPE] = ACTIONS(389), - [anon_sym_PIPE_AMP] = ACTIONS(389), - [anon_sym_AMP_AMP] = ACTIONS(389), - [anon_sym_PIPE_PIPE] = ACTIONS(389), - [anon_sym_LT] = ACTIONS(389), - [anon_sym_GT] = ACTIONS(389), - [anon_sym_LT_AMP] = ACTIONS(389), - [anon_sym_GT_AMP] = ACTIONS(389), - [anon_sym_LT_LT] = ACTIONS(389), - [anon_sym_LT_LT_DASH] = ACTIONS(389), - [sym_file_descriptor] = ACTIONS(389), - [sym_leading_word] = ACTIONS(389), - [sym_comment] = ACTIONS(79), + [118] = { + [anon_sym_fi] = ACTIONS(419), + [anon_sym_elif] = ACTIONS(419), + [anon_sym_else] = ACTIONS(419), + [sym_comment] = ACTIONS(57), }, - [108] = { - [sym_file_descriptor] = ACTIONS(392), - [sym_word] = ACTIONS(394), - [sym_comment] = ACTIONS(47), + [119] = { + [anon_sym_fi] = ACTIONS(422), + [sym_comment] = ACTIONS(57), }, - [109] = { - [sym_file_redirect] = STATE(48), - [sym_heredoc_redirect] = STATE(48), - [anon_sym_SEMI] = ACTIONS(396), - [anon_sym_SEMI_SEMI] = ACTIONS(396), - [anon_sym_LF] = ACTIONS(396), - [anon_sym_PIPE] = ACTIONS(396), - [anon_sym_PIPE_AMP] = ACTIONS(396), - [anon_sym_AMP_AMP] = ACTIONS(396), - [anon_sym_PIPE_PIPE] = ACTIONS(396), - [anon_sym_LT] = ACTIONS(73), - [anon_sym_GT] = ACTIONS(73), - [anon_sym_LT_AMP] = ACTIONS(73), - [anon_sym_GT_AMP] = ACTIONS(73), - [anon_sym_LT_LT] = ACTIONS(75), - [anon_sym_LT_LT_DASH] = ACTIONS(75), - [sym_file_descriptor] = ACTIONS(77), - [sym_comment] = ACTIONS(79), + [120] = { + [anon_sym_LT] = ACTIONS(424), + [anon_sym_GT] = ACTIONS(424), + [anon_sym_LT_AMP] = ACTIONS(424), + [anon_sym_GT_AMP] = ACTIONS(424), + [sym_file_descriptor] = ACTIONS(424), + [sym_leading_word] = ACTIONS(427), + [sym_comment] = ACTIONS(57), }, - [110] = { - [sym__heredoc_middle] = ACTIONS(285), - [sym__heredoc_end] = ACTIONS(285), - [anon_sym_SEMI] = ACTIONS(281), - [anon_sym_SEMI_SEMI] = ACTIONS(281), - [anon_sym_LF] = ACTIONS(281), - [anon_sym_PIPE] = ACTIONS(281), - [anon_sym_PIPE_AMP] = ACTIONS(281), - [anon_sym_AMP_AMP] = ACTIONS(281), - [anon_sym_PIPE_PIPE] = ACTIONS(281), - [anon_sym_DOLLAR] = ACTIONS(281), - [anon_sym_DOLLAR_LBRACE] = ACTIONS(281), - [anon_sym_LT] = ACTIONS(281), - [anon_sym_GT] = ACTIONS(281), - [anon_sym_LT_AMP] = ACTIONS(281), - [anon_sym_GT_AMP] = ACTIONS(281), - [anon_sym_LT_LT] = ACTIONS(281), - [anon_sym_LT_LT_DASH] = ACTIONS(281), - [sym_file_descriptor] = ACTIONS(281), - [sym_word] = ACTIONS(281), - [sym_comment] = ACTIONS(79), + [121] = { + [sym__heredoc_middle] = ACTIONS(385), + [sym__heredoc_end] = ACTIONS(385), + [anon_sym_SEMI] = ACTIONS(430), + [anon_sym_SEMI_SEMI] = ACTIONS(430), + [anon_sym_LF] = ACTIONS(430), + [anon_sym_PIPE] = ACTIONS(430), + [anon_sym_PIPE_AMP] = ACTIONS(430), + [anon_sym_AMP_AMP] = ACTIONS(430), + [anon_sym_PIPE_PIPE] = ACTIONS(430), + [anon_sym_DOLLAR] = ACTIONS(433), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(433), + [anon_sym_LT] = ACTIONS(430), + [anon_sym_GT] = ACTIONS(430), + [anon_sym_LT_AMP] = ACTIONS(430), + [anon_sym_GT_AMP] = ACTIONS(430), + [anon_sym_LT_LT] = ACTIONS(430), + [anon_sym_LT_LT_DASH] = ACTIONS(430), + [sym_file_descriptor] = ACTIONS(430), + [sym_word] = ACTIONS(430), + [sym_comment] = ACTIONS(91), }, - [111] = { - [sym__heredoc_middle] = ACTIONS(277), - [sym__heredoc_end] = ACTIONS(277), + [122] = { + [anon_sym_SEMI] = ACTIONS(438), + [anon_sym_SEMI_SEMI] = ACTIONS(438), + [anon_sym_LF] = ACTIONS(438), + [anon_sym_PIPE] = ACTIONS(438), + [anon_sym_PIPE_AMP] = ACTIONS(438), + [anon_sym_AMP_AMP] = ACTIONS(438), + [anon_sym_PIPE_PIPE] = ACTIONS(438), + [anon_sym_LT] = ACTIONS(441), + [anon_sym_GT] = ACTIONS(441), + [anon_sym_LT_AMP] = ACTIONS(441), + [anon_sym_GT_AMP] = ACTIONS(441), + [anon_sym_LT_LT] = ACTIONS(438), + [anon_sym_LT_LT_DASH] = ACTIONS(438), + [sym_file_descriptor] = ACTIONS(441), + [sym_leading_word] = ACTIONS(427), + [sym_comment] = ACTIONS(91), + }, + [123] = { + [anon_sym_SEMI] = ACTIONS(438), + [anon_sym_SEMI_SEMI] = ACTIONS(438), + [anon_sym_LF] = ACTIONS(438), + [anon_sym_PIPE] = ACTIONS(438), + [anon_sym_PIPE_AMP] = ACTIONS(438), + [anon_sym_AMP_AMP] = ACTIONS(438), + [anon_sym_PIPE_PIPE] = ACTIONS(438), + [anon_sym_LT] = ACTIONS(438), + [anon_sym_GT] = ACTIONS(438), + [anon_sym_LT_AMP] = ACTIONS(438), + [anon_sym_GT_AMP] = ACTIONS(438), + [anon_sym_LT_LT] = ACTIONS(438), + [anon_sym_LT_LT_DASH] = ACTIONS(438), + [sym_file_descriptor] = ACTIONS(438), + [sym_comment] = ACTIONS(91), + }, + [124] = { + [sym__terminated_statement] = STATE(29), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_elif_clause] = STATE(61), + [sym_else_clause] = STATE(83), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_if_statement_repeat1] = STATE(84), + [aux_sym_command_repeat1] = STATE(12), + [ts_builtin_sym_end] = ACTIONS(111), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_fi] = ACTIONS(446), + [anon_sym_elif] = ACTIONS(450), + [anon_sym_else] = ACTIONS(453), + [anon_sym_done] = ACTIONS(237), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), + }, + [125] = { + [sym_elif_clause] = STATE(85), + [sym_else_clause] = STATE(138), + [anon_sym_fi] = ACTIONS(456), + [anon_sym_elif] = ACTIONS(249), + [anon_sym_else] = ACTIONS(251), + [sym_comment] = ACTIONS(57), + }, + [126] = { + [sym_expansion] = STATE(68), + [sym_operator_expansion] = STATE(68), + [sym_file_redirect] = STATE(24), + [sym_heredoc_redirect] = STATE(24), + [aux_sym_command_repeat3] = STATE(139), + [anon_sym_SEMI] = ACTIONS(458), + [anon_sym_SEMI_SEMI] = ACTIONS(458), + [anon_sym_LF] = ACTIONS(458), + [anon_sym_PIPE] = ACTIONS(458), + [anon_sym_PIPE_AMP] = ACTIONS(458), + [anon_sym_AMP_AMP] = ACTIONS(458), + [anon_sym_PIPE_PIPE] = ACTIONS(458), + [anon_sym_DOLLAR] = ACTIONS(135), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(137), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_word] = ACTIONS(205), + [sym_comment] = ACTIONS(91), + }, + [127] = { + [sym_file_redirect] = STATE(51), + [sym_heredoc_redirect] = STATE(51), + [anon_sym_SEMI] = ACTIONS(461), + [anon_sym_SEMI_SEMI] = ACTIONS(461), + [anon_sym_LF] = ACTIONS(461), + [anon_sym_PIPE] = ACTIONS(461), + [anon_sym_PIPE_AMP] = ACTIONS(461), + [anon_sym_AMP_AMP] = ACTIONS(461), + [anon_sym_PIPE_PIPE] = ACTIONS(461), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_comment] = ACTIONS(91), + }, + [128] = { + [sym__terminated_statement] = STATE(29), + [sym_while_statement] = STATE(9), + [sym_if_statement] = STATE(9), + [sym_elif_clause] = STATE(61), + [sym_else_clause] = STATE(83), + [sym_command] = STATE(9), + [sym_pipeline] = STATE(9), + [sym_list] = STATE(9), + [sym_environment_variable_assignment] = STATE(10), + [sym_file_redirect] = STATE(10), + [aux_sym_if_statement_repeat1] = STATE(84), + [aux_sym_command_repeat1] = STATE(12), + [anon_sym_while] = ACTIONS(61), + [anon_sym_if] = ACTIONS(63), + [anon_sym_fi] = ACTIONS(468), + [anon_sym_elif] = ACTIONS(450), + [anon_sym_else] = ACTIONS(453), + [anon_sym_LT] = ACTIONS(65), + [anon_sym_GT] = ACTIONS(65), + [anon_sym_LT_AMP] = ACTIONS(65), + [anon_sym_GT_AMP] = ACTIONS(65), + [sym_file_descriptor] = ACTIONS(67), + [sym_leading_word] = ACTIONS(69), + [sym_comment] = ACTIONS(57), + }, + [129] = { + [anon_sym_RBRACE] = ACTIONS(471), + [anon_sym_LT] = ACTIONS(207), + [anon_sym_GT] = ACTIONS(207), + [anon_sym_LT_AMP] = ACTIONS(207), + [anon_sym_GT_AMP] = ACTIONS(207), + [sym_file_descriptor] = ACTIONS(207), + [sym_leading_word] = ACTIONS(209), + [sym_comment] = ACTIONS(57), + }, + [130] = { + [sym__heredoc_middle] = ACTIONS(299), + [sym__heredoc_end] = ACTIONS(299), [anon_sym_SEMI] = ACTIONS(253), [anon_sym_SEMI_SEMI] = ACTIONS(253), [anon_sym_LF] = ACTIONS(253), @@ -3268,229 +4105,421 @@ static uint16_t ts_parse_table[STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_LT_LT_DASH] = ACTIONS(253), [sym_file_descriptor] = ACTIONS(253), [sym_word] = ACTIONS(253), - [sym_comment] = ACTIONS(79), + [sym_comment] = ACTIONS(91), }, - [112] = { - [anon_sym_SEMI] = ACTIONS(169), - [anon_sym_SEMI_SEMI] = ACTIONS(169), - [anon_sym_LF] = ACTIONS(169), - [anon_sym_PIPE] = ACTIONS(169), - [anon_sym_PIPE_AMP] = ACTIONS(169), - [anon_sym_AMP_AMP] = ACTIONS(169), - [anon_sym_PIPE_PIPE] = ACTIONS(169), - [anon_sym_LT] = ACTIONS(169), - [anon_sym_GT] = ACTIONS(169), - [anon_sym_LT_AMP] = ACTIONS(169), - [anon_sym_GT_AMP] = ACTIONS(169), - [anon_sym_LT_LT] = ACTIONS(169), - [anon_sym_LT_LT_DASH] = ACTIONS(169), - [sym_file_descriptor] = ACTIONS(169), - [sym_leading_word] = ACTIONS(169), - [sym_comment] = ACTIONS(79), + [131] = { + [anon_sym_EQ] = ACTIONS(473), + [anon_sym_COLON] = ACTIONS(475), + [anon_sym_COLON_QMARK] = ACTIONS(473), + [anon_sym_RBRACE] = ACTIONS(477), + [sym_comment] = ACTIONS(57), }, - [113] = { - [anon_sym_SEMI] = ACTIONS(173), - [anon_sym_SEMI_SEMI] = ACTIONS(173), - [anon_sym_LF] = ACTIONS(173), - [anon_sym_PIPE] = ACTIONS(173), - [anon_sym_PIPE_AMP] = ACTIONS(173), - [anon_sym_AMP_AMP] = ACTIONS(173), - [anon_sym_PIPE_PIPE] = ACTIONS(173), - [anon_sym_LT] = ACTIONS(173), - [anon_sym_GT] = ACTIONS(173), - [anon_sym_LT_AMP] = ACTIONS(173), - [anon_sym_GT_AMP] = ACTIONS(173), - [anon_sym_LT_LT] = ACTIONS(173), - [anon_sym_LT_LT_DASH] = ACTIONS(173), - [sym_file_descriptor] = ACTIONS(173), - [sym_leading_word] = ACTIONS(173), - [sym_comment] = ACTIONS(79), + [132] = { + [anon_sym_RBRACE] = ACTIONS(471), + [sym_comment] = ACTIONS(57), + }, + [133] = { + [anon_sym_SEMI] = ACTIONS(378), + [anon_sym_SEMI_SEMI] = ACTIONS(378), + [anon_sym_LF] = ACTIONS(378), + [anon_sym_PIPE] = ACTIONS(378), + [anon_sym_PIPE_AMP] = ACTIONS(378), + [anon_sym_AMP_AMP] = ACTIONS(378), + [anon_sym_PIPE_PIPE] = ACTIONS(378), + [anon_sym_LT] = ACTIONS(378), + [anon_sym_GT] = ACTIONS(378), + [anon_sym_LT_AMP] = ACTIONS(378), + [anon_sym_GT_AMP] = ACTIONS(378), + [anon_sym_LT_LT] = ACTIONS(378), + [anon_sym_LT_LT_DASH] = ACTIONS(378), + [sym_file_descriptor] = ACTIONS(378), + [sym_leading_word] = ACTIONS(378), + [sym_comment] = ACTIONS(91), + }, + [134] = { + [anon_sym_SEMI] = ACTIONS(479), + [anon_sym_SEMI_SEMI] = ACTIONS(479), + [anon_sym_LF] = ACTIONS(479), + [anon_sym_PIPE] = ACTIONS(479), + [anon_sym_PIPE_AMP] = ACTIONS(479), + [anon_sym_AMP_AMP] = ACTIONS(479), + [anon_sym_PIPE_PIPE] = ACTIONS(479), + [anon_sym_LT] = ACTIONS(479), + [anon_sym_GT] = ACTIONS(479), + [anon_sym_LT_AMP] = ACTIONS(479), + [anon_sym_GT_AMP] = ACTIONS(479), + [anon_sym_LT_LT] = ACTIONS(479), + [anon_sym_LT_LT_DASH] = ACTIONS(479), + [sym_file_descriptor] = ACTIONS(479), + [sym_leading_word] = ACTIONS(479), + [sym_comment] = ACTIONS(91), + }, + [135] = { + [sym_file_descriptor] = ACTIONS(482), + [sym_word] = ACTIONS(484), + [sym_comment] = ACTIONS(57), + }, + [136] = { + [anon_sym_SEMI] = ACTIONS(486), + [anon_sym_SEMI_SEMI] = ACTIONS(486), + [anon_sym_LF] = ACTIONS(486), + [anon_sym_PIPE] = ACTIONS(486), + [anon_sym_PIPE_AMP] = ACTIONS(486), + [anon_sym_AMP_AMP] = ACTIONS(486), + [anon_sym_PIPE_PIPE] = ACTIONS(486), + [sym_comment] = ACTIONS(91), + }, + [137] = { + [anon_sym_SEMI] = ACTIONS(490), + [anon_sym_SEMI_SEMI] = ACTIONS(490), + [anon_sym_LF] = ACTIONS(490), + [anon_sym_PIPE] = ACTIONS(490), + [anon_sym_PIPE_AMP] = ACTIONS(490), + [anon_sym_AMP_AMP] = ACTIONS(490), + [anon_sym_PIPE_PIPE] = ACTIONS(490), + [sym_comment] = ACTIONS(91), + }, + [138] = { + [anon_sym_fi] = ACTIONS(493), + [sym_comment] = ACTIONS(57), + }, + [139] = { + [sym_file_redirect] = STATE(51), + [sym_heredoc_redirect] = STATE(51), + [anon_sym_SEMI] = ACTIONS(495), + [anon_sym_SEMI_SEMI] = ACTIONS(495), + [anon_sym_LF] = ACTIONS(495), + [anon_sym_PIPE] = ACTIONS(495), + [anon_sym_PIPE_AMP] = ACTIONS(495), + [anon_sym_AMP_AMP] = ACTIONS(495), + [anon_sym_PIPE_PIPE] = ACTIONS(495), + [anon_sym_LT] = ACTIONS(85), + [anon_sym_GT] = ACTIONS(85), + [anon_sym_LT_AMP] = ACTIONS(85), + [anon_sym_GT_AMP] = ACTIONS(85), + [anon_sym_LT_LT] = ACTIONS(87), + [anon_sym_LT_LT_DASH] = ACTIONS(87), + [sym_file_descriptor] = ACTIONS(89), + [sym_comment] = ACTIONS(91), + }, + [140] = { + [sym__heredoc_middle] = ACTIONS(339), + [sym__heredoc_end] = ACTIONS(339), + [anon_sym_SEMI] = ACTIONS(335), + [anon_sym_SEMI_SEMI] = ACTIONS(335), + [anon_sym_LF] = ACTIONS(335), + [anon_sym_PIPE] = ACTIONS(335), + [anon_sym_PIPE_AMP] = ACTIONS(335), + [anon_sym_AMP_AMP] = ACTIONS(335), + [anon_sym_PIPE_PIPE] = ACTIONS(335), + [anon_sym_DOLLAR] = ACTIONS(335), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(335), + [anon_sym_LT] = ACTIONS(335), + [anon_sym_GT] = ACTIONS(335), + [anon_sym_LT_AMP] = ACTIONS(335), + [anon_sym_GT_AMP] = ACTIONS(335), + [anon_sym_LT_LT] = ACTIONS(335), + [anon_sym_LT_LT_DASH] = ACTIONS(335), + [sym_file_descriptor] = ACTIONS(335), + [sym_word] = ACTIONS(335), + [sym_comment] = ACTIONS(91), + }, + [141] = { + [sym__heredoc_middle] = ACTIONS(327), + [sym__heredoc_end] = ACTIONS(327), + [anon_sym_SEMI] = ACTIONS(297), + [anon_sym_SEMI_SEMI] = ACTIONS(297), + [anon_sym_LF] = ACTIONS(297), + [anon_sym_PIPE] = ACTIONS(297), + [anon_sym_PIPE_AMP] = ACTIONS(297), + [anon_sym_AMP_AMP] = ACTIONS(297), + [anon_sym_PIPE_PIPE] = ACTIONS(297), + [anon_sym_DOLLAR] = ACTIONS(297), + [anon_sym_DOLLAR_LBRACE] = ACTIONS(297), + [anon_sym_LT] = ACTIONS(297), + [anon_sym_GT] = ACTIONS(297), + [anon_sym_LT_AMP] = ACTIONS(297), + [anon_sym_GT_AMP] = ACTIONS(297), + [anon_sym_LT_LT] = ACTIONS(297), + [anon_sym_LT_LT_DASH] = ACTIONS(297), + [sym_file_descriptor] = ACTIONS(297), + [sym_word] = ACTIONS(297), + [sym_comment] = ACTIONS(91), + }, + [142] = { + [anon_sym_SEMI] = ACTIONS(189), + [anon_sym_SEMI_SEMI] = ACTIONS(189), + [anon_sym_LF] = ACTIONS(189), + [anon_sym_PIPE] = ACTIONS(189), + [anon_sym_PIPE_AMP] = ACTIONS(189), + [anon_sym_AMP_AMP] = ACTIONS(189), + [anon_sym_PIPE_PIPE] = ACTIONS(189), + [anon_sym_LT] = ACTIONS(189), + [anon_sym_GT] = ACTIONS(189), + [anon_sym_LT_AMP] = ACTIONS(189), + [anon_sym_GT_AMP] = ACTIONS(189), + [anon_sym_LT_LT] = ACTIONS(189), + [anon_sym_LT_LT_DASH] = ACTIONS(189), + [sym_file_descriptor] = ACTIONS(189), + [sym_leading_word] = ACTIONS(189), + [sym_comment] = ACTIONS(91), + }, + [143] = { + [anon_sym_SEMI] = ACTIONS(193), + [anon_sym_SEMI_SEMI] = ACTIONS(193), + [anon_sym_LF] = ACTIONS(193), + [anon_sym_PIPE] = ACTIONS(193), + [anon_sym_PIPE_AMP] = ACTIONS(193), + [anon_sym_AMP_AMP] = ACTIONS(193), + [anon_sym_PIPE_PIPE] = ACTIONS(193), + [anon_sym_LT] = ACTIONS(193), + [anon_sym_GT] = ACTIONS(193), + [anon_sym_LT_AMP] = ACTIONS(193), + [anon_sym_GT_AMP] = ACTIONS(193), + [anon_sym_LT_LT] = ACTIONS(193), + [anon_sym_LT_LT_DASH] = ACTIONS(193), + [sym_file_descriptor] = ACTIONS(193), + [sym_leading_word] = ACTIONS(193), + [sym_comment] = ACTIONS(91), + }, + [144] = { + [anon_sym_SEMI] = ACTIONS(498), + [anon_sym_SEMI_SEMI] = ACTIONS(498), + [anon_sym_LF] = ACTIONS(498), + [anon_sym_PIPE] = ACTIONS(498), + [anon_sym_PIPE_AMP] = ACTIONS(498), + [anon_sym_AMP_AMP] = ACTIONS(498), + [anon_sym_PIPE_PIPE] = ACTIONS(498), + [sym_comment] = ACTIONS(91), }, }; static TSParseActionEntry ts_parse_actions[] = { [0] = {.count = 0, .reusable = false, .depends_on_lookahead = false}, - [1] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(44), - [3] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(45), - [5] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(91), - [7] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(92), + [1] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(47), + [3] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(48), + [5] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(114), + [7] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(115), [9] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(0), - [11] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(24), - [13] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(24), + [11] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(26), + [13] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(26), [15] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(2), - [17] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(30), - [19] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(83), - [21] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(25), - [23] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(26), - [25] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(84), - [27] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(85), - [29] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(86), - [31] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(87), - [33] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(87), - [35] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(88), - [37] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(89), - [39] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(89), - [41] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(20), - [43] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(20), - [45] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(90), - [47] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT_EXTRA(), - [49] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_program, 0), - [51] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(2), - [53] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(3), - [55] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(4), - [57] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(5), - [59] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(14), - [61] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(15), - [63] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(16), - [65] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(16), - [67] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 1, .rename_sequence_id = 1), - [69] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(17), - [71] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(18), - [73] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(19), - [75] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(20), - [77] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(21), - [79] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT_EXTRA(), - [81] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, ACCEPT_INPUT(), - [83] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 1), - [85] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_program_repeat1, 1), - [87] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 1), - [89] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(24), - [91] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(25), - [93] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(26), - [95] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_command_repeat1, 1), - [97] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat1, 1), - [99] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_program, 1), - [101] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(28), - [103] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(30), - [105] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(32), - [107] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_file_redirect, 2), - [109] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 2), - [111] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_file_redirect, 2, .rename_sequence_id = 2), - [113] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 2, .rename_sequence_id = 2), - [115] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(33), + [17] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(3), + [19] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(104), + [21] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(105), + [23] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(59), + [25] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(60), + [27] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(32), + [29] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(106), + [31] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(27), + [33] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(28), + [35] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(107), + [37] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(108), + [39] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(109), + [41] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(110), + [43] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(110), + [45] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(111), + [47] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(112), + [49] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(112), + [51] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(22), + [53] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, RECOVER(22), + [55] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, RECOVER(113), + [57] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT_EXTRA(), + [59] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_program, 0), + [61] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(2), + [63] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(3), + [65] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(4), + [67] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(5), + [69] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(6), + [71] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(16), + [73] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(17), + [75] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(18), + [77] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(18), + [79] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 1, .rename_sequence_id = 1), + [81] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(19), + [83] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(20), + [85] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(21), + [87] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(22), + [89] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(23), + [91] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT_EXTRA(), + [93] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, ACCEPT_INPUT(), + [95] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 1), + [97] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_program_repeat1, 1), + [99] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 1), + [101] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(26), + [103] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(27), + [105] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(28), + [107] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_command_repeat1, 1), + [109] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat1, 1), + [111] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_program, 1), + [113] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(30), + [115] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(32), [117] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(34), - [119] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 2, .rename_sequence_id = 3), - [121] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(35), - [123] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(36), - [125] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(37), - [127] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(41), - [129] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(42), - [131] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(43), - [133] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(44), - [135] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(45), - [137] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(47), - [139] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(47), - [141] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat3, 1), - [143] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym__terminated_statement, 2), - [145] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym__terminated_statement, 2), - [147] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym__terminated_statement, 2), - [149] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 2), - [151] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_program_repeat1, 2), - [153] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 2), - [155] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 2, .rename_sequence_id = 4), - [157] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(51), - [159] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_command_repeat1, 2), - [161] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat1, 2), - [163] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(53), - [165] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_while_statement, 3), - [167] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_file_redirect, 3), - [169] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 3), - [171] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_file_redirect, 3, .rename_sequence_id = 5), - [173] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 3, .rename_sequence_id = 5), - [175] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(55), + [119] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(35), + [121] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_file_redirect, 2), + [123] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 2), + [125] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_file_redirect, 2, .rename_sequence_id = 2), + [127] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 2, .rename_sequence_id = 2), + [129] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(36), + [131] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(37), + [133] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 2, .rename_sequence_id = 3), + [135] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(38), + [137] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(39), + [139] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(40), + [141] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(44), + [143] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(45), + [145] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(46), + [147] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(47), + [149] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(48), + [151] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(50), + [153] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(50), + [155] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat3, 1), + [157] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym__terminated_statement, 2), + [159] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym__terminated_statement, 2), + [161] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym__terminated_statement, 2), + [163] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 2), + [165] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_program_repeat1, 2), + [167] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 2), + [169] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 2, .rename_sequence_id = 4), + [171] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(54), + [173] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_command_repeat1, 2), + [175] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat1, 2), [177] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(56), - [179] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 1, .rename_sequence_id = 6), - [181] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 1), - [183] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 3, .rename_sequence_id = 7), - [185] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(57), - [187] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_environment_variable_assignment, 3, .rename_sequence_id = 8), - [189] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_environment_variable_assignment, 3, .rename_sequence_id = 8), - [191] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_heredoc, 1), - [193] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(60), - [195] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(61), - [197] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(62), - [199] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(63), - [201] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_heredoc_redirect, 2), - [203] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(65), - [205] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(66), - [207] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat3, 2), - [209] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_pipeline, 3, .fragile = true), - [211] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_list, 3, .fragile = true), - [213] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 3, .rename_sequence_id = 9), - [215] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_do_group, 2), - [217] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(69), - [219] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_expansion, 2, .rename_sequence_id = 10), - [221] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(70), - [223] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(70), - [225] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(71), - [227] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 2, .rename_sequence_id = 11), - [229] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 2), - [231] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 4, .rename_sequence_id = 12), - [233] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_heredoc_repeat1, 1), - [235] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_heredoc_repeat1, 1), - [237] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_heredoc, 2), - [239] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(72), - [241] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(73), - [243] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(74), - [245] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(75), - [247] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 4, .rename_sequence_id = 13), - [249] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_do_group, 3), - [251] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(77), - [253] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 3, .rename_sequence_id = 14), - [255] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_expansion, 2, .rename_sequence_id = 10), - [257] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_expansion, 2, .rename_sequence_id = 10), - [259] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(78), - [261] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(78), - [263] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(79), - [265] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_heredoc_repeat1, 2), - [267] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_heredoc_repeat1, 2), - [269] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_heredoc, 3), - [271] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 5, .rename_sequence_id = 15), - [273] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(80), - [275] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(81), - [277] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 3, .rename_sequence_id = 14), - [279] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_operator_expansion, 3, .rename_sequence_id = 14), - [281] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 5, .rename_sequence_id = 16), - [283] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(82), - [285] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 5, .rename_sequence_id = 16), - [287] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_operator_expansion, 5, .rename_sequence_id = 16), - [289] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_do_group, 2), REDUCE(sym_do_group, 3), - [292] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(102), - [294] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(103), - [296] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(104), - [298] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(105), - [300] = {.count = 2, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 3, .rename_sequence_id = 14), REDUCE(sym_operator_expansion, 5, .rename_sequence_id = 16), - [303] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 3, .rename_sequence_id = 14), REDUCE(sym_operator_expansion, 5, .rename_sequence_id = 16), - [306] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(106), - [308] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(107), - [310] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 2), REDUCE(sym_file_redirect, 3), - [313] = {.count = 3, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 2), REDUCE(sym_file_redirect, 3), SHIFT(108), - [317] = {.count = 2, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_heredoc_repeat1, 1), REDUCE(aux_sym_heredoc_repeat1, 2), - [320] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_heredoc_repeat1, 1), REDUCE(aux_sym_heredoc_repeat1, 2), - [323] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_heredoc, 2), REDUCE(sym_heredoc, 3), - [326] = {.count = 2, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 1), REDUCE(aux_sym_program_repeat1, 2), - [329] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_program_repeat1, 1), REDUCE(aux_sym_program_repeat1, 2), - [332] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(30), - [334] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 1), REDUCE(aux_sym_program_repeat1, 2), - [337] = {.count = 3, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_pipeline, 3, .fragile = true), REDUCE(sym_list, 3, .fragile = true), SHIFT(24), - [341] = {.count = 3, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_pipeline, 3, .fragile = true), REDUCE(sym_list, 3, .fragile = true), SHIFT(25), - [345] = {.count = 3, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_pipeline, 3, .fragile = true), REDUCE(sym_list, 3, .fragile = true), SHIFT(26), - [349] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_command_repeat1, 1), REDUCE(aux_sym_command_repeat1, 2), - [352] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat1, 1), REDUCE(aux_sym_command_repeat1, 2), - [355] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 1), REDUCE(aux_sym_command_repeat2, 2), - [358] = {.count = 4, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 1), REDUCE(aux_sym_heredoc_repeat1, 1), REDUCE(aux_sym_command_repeat2, 2), REDUCE(aux_sym_heredoc_repeat1, 2), - [363] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat3, 1), REDUCE(aux_sym_command_repeat3, 2), - [366] = {.count = 4, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat1, 1), REDUCE(aux_sym_command_repeat3, 1), REDUCE(aux_sym_command_repeat1, 2), REDUCE(aux_sym_command_repeat3, 2), - [371] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 3, .rename_sequence_id = 7), REDUCE(sym_command, 4, .rename_sequence_id = 13), - [374] = {.count = 6, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 2, .rename_sequence_id = 3), REDUCE(sym_command, 3, .rename_sequence_id = 9), REDUCE(sym_command, 3, .rename_sequence_id = 7), REDUCE(sym_command, 4, .rename_sequence_id = 13), REDUCE(sym_command, 4, .rename_sequence_id = 12), REDUCE(sym_command, 5, .rename_sequence_id = 15), - [381] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(110), - [383] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(87), - [385] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(87), - [387] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(111), - [389] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 2, .rename_sequence_id = 2), REDUCE(sym_file_redirect, 3, .rename_sequence_id = 5), - [392] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(112), - [394] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(113), - [396] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 4, .rename_sequence_id = 12), REDUCE(sym_command, 5, .rename_sequence_id = 15), + [179] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_while_statement, 3), + [181] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(58), + [183] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(59), + [185] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(60), + [187] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_file_redirect, 3), + [189] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 3), + [191] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_file_redirect, 3, .rename_sequence_id = 5), + [193] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 3, .rename_sequence_id = 5), + [195] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(65), + [197] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(66), + [199] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 1, .rename_sequence_id = 6), + [201] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 1), + [203] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 3, .rename_sequence_id = 7), + [205] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(67), + [207] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_environment_variable_assignment, 3, .rename_sequence_id = 8), + [209] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_environment_variable_assignment, 3, .rename_sequence_id = 8), + [211] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_heredoc, 1), + [213] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(70), + [215] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(71), + [217] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(72), + [219] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(73), + [221] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_heredoc_redirect, 2), + [223] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(75), + [225] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(76), + [227] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat3, 2), + [229] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_pipeline, 3, .fragile = true), + [231] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_list, 3, .fragile = true), + [233] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 3, .rename_sequence_id = 9), + [235] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_do_group, 2), + [237] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(79), + [239] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_if_statement, 4), + [241] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_else_clause, 1), + [243] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_if_statement_repeat1, 1), + [245] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(82), + [247] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(82), + [249] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(59), + [251] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(60), + [253] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_expansion, 2, .rename_sequence_id = 10), + [255] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(86), + [257] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(86), + [259] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(87), + [261] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 2, .rename_sequence_id = 11), + [263] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 2), + [265] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 4, .rename_sequence_id = 12), + [267] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_heredoc_repeat1, 1), + [269] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_heredoc_repeat1, 1), + [271] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_heredoc, 2), + [273] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(88), + [275] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(89), + [277] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(90), + [279] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(91), + [281] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 4, .rename_sequence_id = 13), + [283] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_do_group, 3), + [285] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(93), + [287] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_else_clause, 2), + [289] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_if_statement, 5), + [291] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(94), + [293] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_if_statement_repeat1, 2), + [295] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(96), + [297] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 3, .rename_sequence_id = 14), + [299] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_expansion, 2, .rename_sequence_id = 10), + [301] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_expansion, 2, .rename_sequence_id = 10), + [303] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(97), + [305] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(97), + [307] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(98), + [309] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_heredoc_repeat1, 2), + [311] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_heredoc_repeat1, 2), + [313] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_heredoc, 3), + [315] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 5, .rename_sequence_id = 15), + [317] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_elif_clause, 3), + [319] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_if_statement, 6), + [321] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(100), + [323] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(101), + [325] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(102), + [327] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 3, .rename_sequence_id = 14), + [329] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_operator_expansion, 3, .rename_sequence_id = 14), + [331] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_elif_clause, 4), + [333] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_if_statement, 7), + [335] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 5, .rename_sequence_id = 16), + [337] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(103), + [339] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 5, .rename_sequence_id = 16), + [341] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_operator_expansion, 5, .rename_sequence_id = 16), + [343] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_elif_clause, 3), SHIFT(58), + [346] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_elif_clause, 3), SHIFT(59), + [349] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_elif_clause, 3), SHIFT(60), + [352] = {.count = 4, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_if_statement, 4), REDUCE(sym_if_statement, 5), REDUCE(sym_if_statement, 6), REDUCE(sym_if_statement, 7), + [357] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_do_group, 2), REDUCE(sym_do_group, 3), + [360] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(129), + [362] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(130), + [364] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(131), + [366] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(132), + [368] = {.count = 2, .reusable = true, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 3, .rename_sequence_id = 14), REDUCE(sym_operator_expansion, 5, .rename_sequence_id = 16), + [371] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_operator_expansion, 3, .rename_sequence_id = 14), REDUCE(sym_operator_expansion, 5, .rename_sequence_id = 16), + [374] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(133), + [376] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(134), + [378] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 2), REDUCE(sym_file_redirect, 3), + [381] = {.count = 3, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 2), REDUCE(sym_file_redirect, 3), SHIFT(135), + [385] = {.count = 2, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_heredoc_repeat1, 1), REDUCE(aux_sym_heredoc_repeat1, 2), + [388] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_heredoc_repeat1, 1), REDUCE(aux_sym_heredoc_repeat1, 2), + [391] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_heredoc, 2), REDUCE(sym_heredoc, 3), + [394] = {.count = 2, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 1), REDUCE(aux_sym_program_repeat1, 2), + [397] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_program_repeat1, 1), REDUCE(aux_sym_program_repeat1, 2), + [400] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(104), + [402] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(32), + [404] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_program_repeat1, 1), REDUCE(aux_sym_program_repeat1, 2), + [407] = {.count = 3, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_pipeline, 3, .fragile = true), REDUCE(sym_list, 3, .fragile = true), SHIFT(26), + [411] = {.count = 3, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_pipeline, 3, .fragile = true), REDUCE(sym_list, 3, .fragile = true), SHIFT(27), + [415] = {.count = 3, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_pipeline, 3, .fragile = true), REDUCE(sym_list, 3, .fragile = true), SHIFT(28), + [419] = {.count = 2, .reusable = true, .depends_on_lookahead = false}, REDUCE(aux_sym_if_statement_repeat1, 1), REDUCE(aux_sym_if_statement_repeat1, 2), + [422] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(136), + [424] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(aux_sym_command_repeat1, 1), REDUCE(aux_sym_command_repeat1, 2), + [427] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat1, 1), REDUCE(aux_sym_command_repeat1, 2), + [430] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 1), REDUCE(aux_sym_command_repeat2, 2), + [433] = {.count = 4, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat2, 1), REDUCE(aux_sym_heredoc_repeat1, 1), REDUCE(aux_sym_command_repeat2, 2), REDUCE(aux_sym_heredoc_repeat1, 2), + [438] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat3, 1), REDUCE(aux_sym_command_repeat3, 2), + [441] = {.count = 4, .reusable = false, .depends_on_lookahead = false}, REDUCE(aux_sym_command_repeat1, 1), REDUCE(aux_sym_command_repeat3, 1), REDUCE(aux_sym_command_repeat1, 2), REDUCE(aux_sym_command_repeat3, 2), + [446] = {.count = 3, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_else_clause, 2), REDUCE(sym_elif_clause, 4), SHIFT(82), + [450] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_elif_clause, 4), SHIFT(59), + [453] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_elif_clause, 4), SHIFT(60), + [456] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(137), + [458] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 3, .rename_sequence_id = 7), REDUCE(sym_command, 4, .rename_sequence_id = 13), + [461] = {.count = 6, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 2, .rename_sequence_id = 3), REDUCE(sym_command, 3, .rename_sequence_id = 9), REDUCE(sym_command, 3, .rename_sequence_id = 7), REDUCE(sym_command, 4, .rename_sequence_id = 13), REDUCE(sym_command, 4, .rename_sequence_id = 12), REDUCE(sym_command, 5, .rename_sequence_id = 15), + [468] = {.count = 2, .reusable = true, .depends_on_lookahead = true}, REDUCE(sym_elif_clause, 4), SHIFT(82), + [471] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(140), + [473] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(110), + [475] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(110), + [477] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(141), + [479] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_file_redirect, 2, .rename_sequence_id = 2), REDUCE(sym_file_redirect, 3, .rename_sequence_id = 5), + [482] = {.count = 1, .reusable = true, .depends_on_lookahead = true}, SHIFT(142), + [484] = {.count = 1, .reusable = false, .depends_on_lookahead = false}, SHIFT(143), + [486] = {.count = 3, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_if_statement, 5), REDUCE(sym_if_statement, 6), REDUCE(sym_if_statement, 7), + [490] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_if_statement, 5), REDUCE(sym_if_statement, 6), + [493] = {.count = 1, .reusable = true, .depends_on_lookahead = false}, SHIFT(144), + [495] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_command, 4, .rename_sequence_id = 12), REDUCE(sym_command, 5, .rename_sequence_id = 15), + [498] = {.count = 2, .reusable = false, .depends_on_lookahead = false}, REDUCE(sym_if_statement, 6), REDUCE(sym_if_statement, 7), }; void *tree_sitter_bash_external_scanner_create();