#include <tree_sitter/parser.h>

#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif

#define LANGUAGE_VERSION 13
#define STATE_COUNT 79
#define LARGE_STATE_COUNT 2
#define SYMBOL_COUNT 44
#define ALIAS_COUNT 0
#define TOKEN_COUNT 20
#define EXTERNAL_TOKEN_COUNT 0
#define FIELD_COUNT 1
#define MAX_ALIAS_SEQUENCE_LENGTH 3
#define PRODUCTION_ID_COUNT 2

enum {
  anon_sym_POUND = 1,
  aux_sym_comment_token1 = 2,
  anon_sym_LBRACE = 3,
  anon_sym_COMMA = 4,
  anon_sym_RBRACE = 5,
  anon_sym_EQ = 6,
  anon_sym_pattern = 7,
  anon_sym_file = 8,
  sym_identifier = 9,
  sym__bareword = 10,
  anon_sym_DQUOTE = 11,
  aux_sym_quoted_string_text_fragment_token1 = 12,
  anon_sym_BSLASH = 13,
  anon_sym_BSLASH_DQUOTE = 14,
  anon_sym_BSLASH_BSLASH = 15,
  anon_sym_DOLLAR_LBRACE = 16,
  anon_sym_DOLLAR_LPAREN = 17,
  anon_sym_RPAREN = 18,
  aux_sym__macro_expansion_inner_token1 = 19,
  sym_source_file = 20,
  sym_comment = 21,
  sym_regular = 22,
  sym__regular_assignment = 23,
  sym_pattern = 24,
  sym_pattern_variables = 25,
  sym_pattern_values = 26,
  sym_db_template = 27,
  sym_substitutions = 28,
  sym_string = 29,
  sym_quoted_string = 30,
  sym_quoted_string_text_fragment = 31,
  sym_escape_sequence = 32,
  sym_macro_expansion = 33,
  aux_sym__macro_expansion_inner = 34,
  aux_sym_source_file_repeat1 = 35,
  aux_sym_source_file_repeat2 = 36,
  aux_sym_source_file_repeat3 = 37,
  aux_sym_regular_repeat1 = 38,
  aux_sym_pattern_repeat1 = 39,
  aux_sym_pattern_variables_repeat1 = 40,
  aux_sym_pattern_values_repeat1 = 41,
  aux_sym_quoted_string_repeat1 = 42,
  aux_sym_quoted_string_text_fragment_repeat1 = 43,
};

static const char * const ts_symbol_names[] = {
  [ts_builtin_sym_end] = "end",
  [anon_sym_POUND] = "#",
  [aux_sym_comment_token1] = "comment_token1",
  [anon_sym_LBRACE] = "{",
  [anon_sym_COMMA] = ",",
  [anon_sym_RBRACE] = "}",
  [anon_sym_EQ] = "=",
  [anon_sym_pattern] = "pattern",
  [anon_sym_file] = "file",
  [sym_identifier] = "identifier",
  [sym__bareword] = "_bareword",
  [anon_sym_DQUOTE] = "\"",
  [aux_sym_quoted_string_text_fragment_token1] = "quoted_string_text_fragment_token1",
  [anon_sym_BSLASH] = "\\",
  [anon_sym_BSLASH_DQUOTE] = "\\\"",
  [anon_sym_BSLASH_BSLASH] = "\\\\",
  [anon_sym_DOLLAR_LBRACE] = "${",
  [anon_sym_DOLLAR_LPAREN] = "$(",
  [anon_sym_RPAREN] = ")",
  [aux_sym__macro_expansion_inner_token1] = "_macro_expansion_inner_token1",
  [sym_source_file] = "source_file",
  [sym_comment] = "comment",
  [sym_regular] = "regular",
  [sym__regular_assignment] = "_regular_assignment",
  [sym_pattern] = "pattern",
  [sym_pattern_variables] = "pattern_variables",
  [sym_pattern_values] = "pattern_values",
  [sym_db_template] = "db_template",
  [sym_substitutions] = "substitutions",
  [sym_string] = "string",
  [sym_quoted_string] = "quoted_string",
  [sym_quoted_string_text_fragment] = "quoted_string_text_fragment",
  [sym_escape_sequence] = "escape_sequence",
  [sym_macro_expansion] = "macro_expansion",
  [aux_sym__macro_expansion_inner] = "_macro_expansion_inner",
  [aux_sym_source_file_repeat1] = "source_file_repeat1",
  [aux_sym_source_file_repeat2] = "source_file_repeat2",
  [aux_sym_source_file_repeat3] = "source_file_repeat3",
  [aux_sym_regular_repeat1] = "regular_repeat1",
  [aux_sym_pattern_repeat1] = "pattern_repeat1",
  [aux_sym_pattern_variables_repeat1] = "pattern_variables_repeat1",
  [aux_sym_pattern_values_repeat1] = "pattern_values_repeat1",
  [aux_sym_quoted_string_repeat1] = "quoted_string_repeat1",
  [aux_sym_quoted_string_text_fragment_repeat1] = "quoted_string_text_fragment_repeat1",
};

static const TSSymbol ts_symbol_map[] = {
  [ts_builtin_sym_end] = ts_builtin_sym_end,
  [anon_sym_POUND] = anon_sym_POUND,
  [aux_sym_comment_token1] = aux_sym_comment_token1,
  [anon_sym_LBRACE] = anon_sym_LBRACE,
  [anon_sym_COMMA] = anon_sym_COMMA,
  [anon_sym_RBRACE] = anon_sym_RBRACE,
  [anon_sym_EQ] = anon_sym_EQ,
  [anon_sym_pattern] = anon_sym_pattern,
  [anon_sym_file] = anon_sym_file,
  [sym_identifier] = sym_identifier,
  [sym__bareword] = sym__bareword,
  [anon_sym_DQUOTE] = anon_sym_DQUOTE,
  [aux_sym_quoted_string_text_fragment_token1] = aux_sym_quoted_string_text_fragment_token1,
  [anon_sym_BSLASH] = anon_sym_BSLASH,
  [anon_sym_BSLASH_DQUOTE] = anon_sym_BSLASH_DQUOTE,
  [anon_sym_BSLASH_BSLASH] = anon_sym_BSLASH_BSLASH,
  [anon_sym_DOLLAR_LBRACE] = anon_sym_DOLLAR_LBRACE,
  [anon_sym_DOLLAR_LPAREN] = anon_sym_DOLLAR_LPAREN,
  [anon_sym_RPAREN] = anon_sym_RPAREN,
  [aux_sym__macro_expansion_inner_token1] = aux_sym__macro_expansion_inner_token1,
  [sym_source_file] = sym_source_file,
  [sym_comment] = sym_comment,
  [sym_regular] = sym_regular,
  [sym__regular_assignment] = sym__regular_assignment,
  [sym_pattern] = sym_pattern,
  [sym_pattern_variables] = sym_pattern_variables,
  [sym_pattern_values] = sym_pattern_values,
  [sym_db_template] = sym_db_template,
  [sym_substitutions] = sym_substitutions,
  [sym_string] = sym_string,
  [sym_quoted_string] = sym_quoted_string,
  [sym_quoted_string_text_fragment] = sym_quoted_string_text_fragment,
  [sym_escape_sequence] = sym_escape_sequence,
  [sym_macro_expansion] = sym_macro_expansion,
  [aux_sym__macro_expansion_inner] = aux_sym__macro_expansion_inner,
  [aux_sym_source_file_repeat1] = aux_sym_source_file_repeat1,
  [aux_sym_source_file_repeat2] = aux_sym_source_file_repeat2,
  [aux_sym_source_file_repeat3] = aux_sym_source_file_repeat3,
  [aux_sym_regular_repeat1] = aux_sym_regular_repeat1,
  [aux_sym_pattern_repeat1] = aux_sym_pattern_repeat1,
  [aux_sym_pattern_variables_repeat1] = aux_sym_pattern_variables_repeat1,
  [aux_sym_pattern_values_repeat1] = aux_sym_pattern_values_repeat1,
  [aux_sym_quoted_string_repeat1] = aux_sym_quoted_string_repeat1,
  [aux_sym_quoted_string_text_fragment_repeat1] = aux_sym_quoted_string_text_fragment_repeat1,
};

static const TSSymbolMetadata ts_symbol_metadata[] = {
  [ts_builtin_sym_end] = {
    .visible = false,
    .named = true,
  },
  [anon_sym_POUND] = {
    .visible = true,
    .named = false,
  },
  [aux_sym_comment_token1] = {
    .visible = false,
    .named = false,
  },
  [anon_sym_LBRACE] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_COMMA] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_RBRACE] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_EQ] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_pattern] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_file] = {
    .visible = true,
    .named = false,
  },
  [sym_identifier] = {
    .visible = true,
    .named = true,
  },
  [sym__bareword] = {
    .visible = false,
    .named = true,
  },
  [anon_sym_DQUOTE] = {
    .visible = true,
    .named = false,
  },
  [aux_sym_quoted_string_text_fragment_token1] = {
    .visible = false,
    .named = false,
  },
  [anon_sym_BSLASH] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_BSLASH_DQUOTE] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_BSLASH_BSLASH] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_DOLLAR_LBRACE] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_DOLLAR_LPAREN] = {
    .visible = true,
    .named = false,
  },
  [anon_sym_RPAREN] = {
    .visible = true,
    .named = false,
  },
  [aux_sym__macro_expansion_inner_token1] = {
    .visible = false,
    .named = false,
  },
  [sym_source_file] = {
    .visible = true,
    .named = true,
  },
  [sym_comment] = {
    .visible = true,
    .named = true,
  },
  [sym_regular] = {
    .visible = true,
    .named = true,
  },
  [sym__regular_assignment] = {
    .visible = false,
    .named = true,
  },
  [sym_pattern] = {
    .visible = true,
    .named = true,
  },
  [sym_pattern_variables] = {
    .visible = true,
    .named = true,
  },
  [sym_pattern_values] = {
    .visible = true,
    .named = true,
  },
  [sym_db_template] = {
    .visible = true,
    .named = true,
  },
  [sym_substitutions] = {
    .visible = true,
    .named = true,
  },
  [sym_string] = {
    .visible = true,
    .named = true,
  },
  [sym_quoted_string] = {
    .visible = true,
    .named = true,
  },
  [sym_quoted_string_text_fragment] = {
    .visible = true,
    .named = true,
  },
  [sym_escape_sequence] = {
    .visible = true,
    .named = true,
  },
  [sym_macro_expansion] = {
    .visible = true,
    .named = true,
  },
  [aux_sym__macro_expansion_inner] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_source_file_repeat1] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_source_file_repeat2] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_source_file_repeat3] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_regular_repeat1] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_pattern_repeat1] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_pattern_variables_repeat1] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_pattern_values_repeat1] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_quoted_string_repeat1] = {
    .visible = false,
    .named = false,
  },
  [aux_sym_quoted_string_text_fragment_repeat1] = {
    .visible = false,
    .named = false,
  },
};

enum {
  field_file = 1,
};

static const char * const ts_field_names[] = {
  [0] = NULL,
  [field_file] = "file",
};

static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = {
  [1] = {.index = 0, .length = 1},
};

static const TSFieldMapEntry ts_field_map_entries[] = {
  [0] =
    {field_file, 1},
};

static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = {
  [0] = {0},
};

static const uint16_t ts_non_terminal_alias_map[] = {
  0,
};

static bool ts_lex(TSLexer *lexer, TSStateId state) {
  START_LEXER();
  eof = lexer->eof(lexer);
  switch (state) {
    case 0:
      if (eof) ADVANCE(16);
      if (lookahead == '"') ADVANCE(32);
      if (lookahead == '#') ADVANCE(17);
      if (lookahead == '$') ADVANCE(5);
      if (lookahead == ')') ADVANCE(44);
      if (lookahead == ',') ADVANCE(25);
      if (lookahead == '=') ADVANCE(27);
      if (lookahead == '\\') ADVANCE(35);
      if (lookahead == 'f') ADVANCE(9);
      if (lookahead == 'p') ADVANCE(6);
      if (lookahead == '{') ADVANCE(24);
      if (lookahead == '}') ADVANCE(26);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') SKIP(15)
      END_STATE();
    case 1:
      if (lookahead == '"') ADVANCE(32);
      if (lookahead == '#') ADVANCE(17);
      if (lookahead == '$') ADVANCE(5);
      if (lookahead == ',') ADVANCE(25);
      if (lookahead == '}') ADVANCE(26);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') SKIP(1)
      if (('+' <= lookahead && lookahead <= '<') ||
          lookahead == '>' ||
          ('A' <= lookahead && lookahead <= ']') ||
          lookahead == '_' ||
          ('a' <= lookahead && lookahead <= 'z')) ADVANCE(31);
      END_STATE();
    case 2:
      if (lookahead == '"') ADVANCE(32);
      if (lookahead == '#') ADVANCE(18);
      if (lookahead == '$') ADVANCE(5);
      if (lookahead == '\\') ADVANCE(35);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(33);
      if (lookahead != 0) ADVANCE(34);
      END_STATE();
    case 3:
      if (lookahead == '#') ADVANCE(17);
      if (lookahead == '$') ADVANCE(5);
      if (lookahead == ',') ADVANCE(25);
      if (lookahead == '{') ADVANCE(24);
      if (lookahead == '}') ADVANCE(26);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') SKIP(3)
      if (('0' <= lookahead && lookahead <= '9') ||
          ('A' <= lookahead && lookahead <= 'Z') ||
          lookahead == '_' ||
          ('a' <= lookahead && lookahead <= 'z')) ADVANCE(30);
      END_STATE();
    case 4:
      if (lookahead == '#') ADVANCE(19);
      if (lookahead == '$') ADVANCE(46);
      if (lookahead == ')') ADVANCE(44);
      if (lookahead == '}') ADVANCE(26);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(45);
      if (lookahead != 0) ADVANCE(47);
      END_STATE();
    case 5:
      if (lookahead == '(') ADVANCE(41);
      if (lookahead == '{') ADVANCE(38);
      END_STATE();
    case 6:
      if (lookahead == 'a') ADVANCE(13);
      END_STATE();
    case 7:
      if (lookahead == 'e') ADVANCE(29);
      END_STATE();
    case 8:
      if (lookahead == 'e') ADVANCE(12);
      END_STATE();
    case 9:
      if (lookahead == 'i') ADVANCE(10);
      END_STATE();
    case 10:
      if (lookahead == 'l') ADVANCE(7);
      END_STATE();
    case 11:
      if (lookahead == 'n') ADVANCE(28);
      END_STATE();
    case 12:
      if (lookahead == 'r') ADVANCE(11);
      END_STATE();
    case 13:
      if (lookahead == 't') ADVANCE(14);
      END_STATE();
    case 14:
      if (lookahead == 't') ADVANCE(8);
      END_STATE();
    case 15:
      if (eof) ADVANCE(16);
      if (lookahead == '"') ADVANCE(32);
      if (lookahead == '#') ADVANCE(17);
      if (lookahead == '$') ADVANCE(5);
      if (lookahead == ')') ADVANCE(44);
      if (lookahead == ',') ADVANCE(25);
      if (lookahead == '=') ADVANCE(27);
      if (lookahead == 'f') ADVANCE(9);
      if (lookahead == 'p') ADVANCE(6);
      if (lookahead == '{') ADVANCE(24);
      if (lookahead == '}') ADVANCE(26);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') SKIP(15)
      END_STATE();
    case 16:
      ACCEPT_TOKEN(ts_builtin_sym_end);
      END_STATE();
    case 17:
      ACCEPT_TOKEN(anon_sym_POUND);
      END_STATE();
    case 18:
      ACCEPT_TOKEN(anon_sym_POUND);
      if (lookahead != 0 &&
          lookahead != '"' &&
          lookahead != '$' &&
          lookahead != '\\') ADVANCE(34);
      END_STATE();
    case 19:
      ACCEPT_TOKEN(anon_sym_POUND);
      if (lookahead != 0 &&
          lookahead != ')' &&
          lookahead != '}') ADVANCE(47);
      END_STATE();
    case 20:
      ACCEPT_TOKEN(anon_sym_POUND);
      if (lookahead != 0 &&
          lookahead != '\n') ADVANCE(23);
      END_STATE();
    case 21:
      ACCEPT_TOKEN(aux_sym_comment_token1);
      if (lookahead == '#') ADVANCE(20);
      if (lookahead == '$') ADVANCE(22);
      if (lookahead == '\t' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(21);
      if (lookahead != 0 &&
          lookahead != '\n') ADVANCE(23);
      END_STATE();
    case 22:
      ACCEPT_TOKEN(aux_sym_comment_token1);
      if (lookahead == '(') ADVANCE(43);
      if (lookahead == '{') ADVANCE(40);
      if (lookahead != 0 &&
          lookahead != '\n') ADVANCE(23);
      END_STATE();
    case 23:
      ACCEPT_TOKEN(aux_sym_comment_token1);
      if (lookahead != 0 &&
          lookahead != '\n') ADVANCE(23);
      END_STATE();
    case 24:
      ACCEPT_TOKEN(anon_sym_LBRACE);
      END_STATE();
    case 25:
      ACCEPT_TOKEN(anon_sym_COMMA);
      END_STATE();
    case 26:
      ACCEPT_TOKEN(anon_sym_RBRACE);
      END_STATE();
    case 27:
      ACCEPT_TOKEN(anon_sym_EQ);
      END_STATE();
    case 28:
      ACCEPT_TOKEN(anon_sym_pattern);
      END_STATE();
    case 29:
      ACCEPT_TOKEN(anon_sym_file);
      END_STATE();
    case 30:
      ACCEPT_TOKEN(sym_identifier);
      if (('0' <= lookahead && lookahead <= '9') ||
          ('A' <= lookahead && lookahead <= 'Z') ||
          lookahead == '_' ||
          ('a' <= lookahead && lookahead <= 'z')) ADVANCE(30);
      END_STATE();
    case 31:
      ACCEPT_TOKEN(sym__bareword);
      if (lookahead == '+' ||
          ('-' <= lookahead && lookahead <= '<') ||
          lookahead == '>' ||
          ('A' <= lookahead && lookahead <= ']') ||
          lookahead == '_' ||
          ('a' <= lookahead && lookahead <= 'z')) ADVANCE(31);
      END_STATE();
    case 32:
      ACCEPT_TOKEN(anon_sym_DQUOTE);
      END_STATE();
    case 33:
      ACCEPT_TOKEN(aux_sym_quoted_string_text_fragment_token1);
      if (lookahead == '#') ADVANCE(18);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(33);
      if (lookahead != 0 &&
          (lookahead < '"' || '$' < lookahead) &&
          lookahead != '\\') ADVANCE(34);
      END_STATE();
    case 34:
      ACCEPT_TOKEN(aux_sym_quoted_string_text_fragment_token1);
      if (lookahead != 0 &&
          lookahead != '"' &&
          lookahead != '$' &&
          lookahead != '\\') ADVANCE(34);
      END_STATE();
    case 35:
      ACCEPT_TOKEN(anon_sym_BSLASH);
      if (lookahead == '"') ADVANCE(36);
      if (lookahead == '\\') ADVANCE(37);
      END_STATE();
    case 36:
      ACCEPT_TOKEN(anon_sym_BSLASH_DQUOTE);
      END_STATE();
    case 37:
      ACCEPT_TOKEN(anon_sym_BSLASH_BSLASH);
      END_STATE();
    case 38:
      ACCEPT_TOKEN(anon_sym_DOLLAR_LBRACE);
      END_STATE();
    case 39:
      ACCEPT_TOKEN(anon_sym_DOLLAR_LBRACE);
      if (lookahead != 0 &&
          lookahead != ')' &&
          lookahead != '}') ADVANCE(47);
      END_STATE();
    case 40:
      ACCEPT_TOKEN(anon_sym_DOLLAR_LBRACE);
      if (lookahead != 0 &&
          lookahead != '\n') ADVANCE(23);
      END_STATE();
    case 41:
      ACCEPT_TOKEN(anon_sym_DOLLAR_LPAREN);
      END_STATE();
    case 42:
      ACCEPT_TOKEN(anon_sym_DOLLAR_LPAREN);
      if (lookahead != 0 &&
          lookahead != ')' &&
          lookahead != '}') ADVANCE(47);
      END_STATE();
    case 43:
      ACCEPT_TOKEN(anon_sym_DOLLAR_LPAREN);
      if (lookahead != 0 &&
          lookahead != '\n') ADVANCE(23);
      END_STATE();
    case 44:
      ACCEPT_TOKEN(anon_sym_RPAREN);
      END_STATE();
    case 45:
      ACCEPT_TOKEN(aux_sym__macro_expansion_inner_token1);
      if (lookahead == '#') ADVANCE(19);
      if (lookahead == '$') ADVANCE(46);
      if (lookahead == '\t' ||
          lookahead == '\n' ||
          lookahead == '\r' ||
          lookahead == ' ') ADVANCE(45);
      if (lookahead != 0 &&
          lookahead != ')' &&
          lookahead != '}') ADVANCE(47);
      END_STATE();
    case 46:
      ACCEPT_TOKEN(aux_sym__macro_expansion_inner_token1);
      if (lookahead == '(') ADVANCE(42);
      if (lookahead == '{') ADVANCE(39);
      if (lookahead != 0 &&
          lookahead != ')' &&
          lookahead != '}') ADVANCE(47);
      END_STATE();
    case 47:
      ACCEPT_TOKEN(aux_sym__macro_expansion_inner_token1);
      if (lookahead != 0 &&
          lookahead != ')' &&
          lookahead != '}') ADVANCE(47);
      END_STATE();
    default:
      return false;
  }
}

static const TSLexMode ts_lex_modes[STATE_COUNT] = {
  [0] = {.lex_state = 0},
  [1] = {.lex_state = 0},
  [2] = {.lex_state = 2},
  [3] = {.lex_state = 2},
  [4] = {.lex_state = 2},
  [5] = {.lex_state = 2},
  [6] = {.lex_state = 2},
  [7] = {.lex_state = 0},
  [8] = {.lex_state = 0},
  [9] = {.lex_state = 1},
  [10] = {.lex_state = 1},
  [11] = {.lex_state = 2},
  [12] = {.lex_state = 1},
  [13] = {.lex_state = 2},
  [14] = {.lex_state = 0},
  [15] = {.lex_state = 0},
  [16] = {.lex_state = 0},
  [17] = {.lex_state = 0},
  [18] = {.lex_state = 2},
  [19] = {.lex_state = 2},
  [20] = {.lex_state = 2},
  [21] = {.lex_state = 3},
  [22] = {.lex_state = 4},
  [23] = {.lex_state = 1},
  [24] = {.lex_state = 1},
  [25] = {.lex_state = 3},
  [26] = {.lex_state = 0},
  [27] = {.lex_state = 0},
  [28] = {.lex_state = 0},
  [29] = {.lex_state = 0},
  [30] = {.lex_state = 0},
  [31] = {.lex_state = 0},
  [32] = {.lex_state = 3},
  [33] = {.lex_state = 1},
  [34] = {.lex_state = 0},
  [35] = {.lex_state = 0},
  [36] = {.lex_state = 3},
  [37] = {.lex_state = 0},
  [38] = {.lex_state = 0},
  [39] = {.lex_state = 1},
  [40] = {.lex_state = 0},
  [41] = {.lex_state = 1},
  [42] = {.lex_state = 3},
  [43] = {.lex_state = 1},
  [44] = {.lex_state = 3},
  [45] = {.lex_state = 0},
  [46] = {.lex_state = 4},
  [47] = {.lex_state = 4},
  [48] = {.lex_state = 3},
  [49] = {.lex_state = 0},
  [50] = {.lex_state = 4},
  [51] = {.lex_state = 3},
  [52] = {.lex_state = 3},
  [53] = {.lex_state = 0},
  [54] = {.lex_state = 3},
  [55] = {.lex_state = 0},
  [56] = {.lex_state = 1},
  [57] = {.lex_state = 3},
  [58] = {.lex_state = 3},
  [59] = {.lex_state = 4},
  [60] = {.lex_state = 4},
  [61] = {.lex_state = 4},
  [62] = {.lex_state = 0},
  [63] = {.lex_state = 0},
  [64] = {.lex_state = 0},
  [65] = {.lex_state = 0},
  [66] = {.lex_state = 3},
  [67] = {.lex_state = 3},
  [68] = {.lex_state = 0},
  [69] = {.lex_state = 0},
  [70] = {.lex_state = 4},
  [71] = {.lex_state = 4},
  [72] = {.lex_state = 4},
  [73] = {.lex_state = 4},
  [74] = {.lex_state = 0},
  [75] = {.lex_state = 0},
  [76] = {.lex_state = 21},
  [77] = {(TSStateId)(-1)},
  [78] = {(TSStateId)(-1)},
};

static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = {
  [0] = {
    [sym_comment] = STATE(0),
    [sym_macro_expansion] = STATE(0),
    [ts_builtin_sym_end] = ACTIONS(1),
    [anon_sym_POUND] = ACTIONS(3),
    [anon_sym_LBRACE] = ACTIONS(1),
    [anon_sym_COMMA] = ACTIONS(1),
    [anon_sym_RBRACE] = ACTIONS(1),
    [anon_sym_EQ] = ACTIONS(1),
    [anon_sym_pattern] = ACTIONS(1),
    [anon_sym_file] = ACTIONS(1),
    [anon_sym_DQUOTE] = ACTIONS(1),
    [anon_sym_BSLASH] = ACTIONS(1),
    [anon_sym_BSLASH_DQUOTE] = ACTIONS(1),
    [anon_sym_BSLASH_BSLASH] = ACTIONS(1),
    [anon_sym_DOLLAR_LBRACE] = ACTIONS(5),
    [anon_sym_DOLLAR_LPAREN] = ACTIONS(7),
    [anon_sym_RPAREN] = ACTIONS(1),
  },
  [1] = {
    [sym_source_file] = STATE(75),
    [sym_comment] = STATE(1),
    [sym_regular] = STATE(53),
    [sym_pattern] = STATE(55),
    [sym_db_template] = STATE(64),
    [sym_macro_expansion] = STATE(1),
    [aux_sym_source_file_repeat1] = STATE(34),
    [aux_sym_source_file_repeat2] = STATE(29),
    [aux_sym_source_file_repeat3] = STATE(28),
    [ts_builtin_sym_end] = ACTIONS(9),
    [anon_sym_POUND] = ACTIONS(3),
    [anon_sym_LBRACE] = ACTIONS(11),
    [anon_sym_pattern] = ACTIONS(13),
    [anon_sym_file] = ACTIONS(15),
    [anon_sym_DOLLAR_LBRACE] = ACTIONS(5),
    [anon_sym_DOLLAR_LPAREN] = ACTIONS(7),
  },
};

static const uint16_t ts_small_parse_table[] = {
  [0] = 10,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(19), 1,
      anon_sym_DQUOTE,
    ACTIONS(25), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(27), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(5), 1,
      aux_sym_quoted_string_repeat1,
    STATE(11), 1,
      aux_sym_quoted_string_text_fragment_repeat1,
    ACTIONS(21), 2,
      aux_sym_quoted_string_text_fragment_token1,
      anon_sym_BSLASH,
    ACTIONS(23), 2,
      anon_sym_BSLASH_DQUOTE,
      anon_sym_BSLASH_BSLASH,
    STATE(2), 2,
      sym_comment,
      sym_macro_expansion,
    STATE(19), 2,
      sym_quoted_string_text_fragment,
      sym_escape_sequence,
  [35] = 10,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(25), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(27), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(29), 1,
      anon_sym_DQUOTE,
    STATE(5), 1,
      aux_sym_quoted_string_repeat1,
    STATE(11), 1,
      aux_sym_quoted_string_text_fragment_repeat1,
    ACTIONS(21), 2,
      aux_sym_quoted_string_text_fragment_token1,
      anon_sym_BSLASH,
    ACTIONS(23), 2,
      anon_sym_BSLASH_DQUOTE,
      anon_sym_BSLASH_BSLASH,
    STATE(3), 2,
      sym_comment,
      sym_macro_expansion,
    STATE(19), 2,
      sym_quoted_string_text_fragment,
      sym_escape_sequence,
  [70] = 10,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(25), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(27), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(31), 1,
      anon_sym_DQUOTE,
    STATE(3), 1,
      aux_sym_quoted_string_repeat1,
    STATE(11), 1,
      aux_sym_quoted_string_text_fragment_repeat1,
    ACTIONS(21), 2,
      aux_sym_quoted_string_text_fragment_token1,
      anon_sym_BSLASH,
    ACTIONS(23), 2,
      anon_sym_BSLASH_DQUOTE,
      anon_sym_BSLASH_BSLASH,
    STATE(4), 2,
      sym_comment,
      sym_macro_expansion,
    STATE(19), 2,
      sym_quoted_string_text_fragment,
      sym_escape_sequence,
  [105] = 9,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(25), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(27), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(33), 1,
      anon_sym_DQUOTE,
    STATE(11), 1,
      aux_sym_quoted_string_text_fragment_repeat1,
    ACTIONS(35), 2,
      aux_sym_quoted_string_text_fragment_token1,
      anon_sym_BSLASH,
    ACTIONS(38), 2,
      anon_sym_BSLASH_DQUOTE,
      anon_sym_BSLASH_BSLASH,
    STATE(19), 2,
      sym_quoted_string_text_fragment,
      sym_escape_sequence,
    STATE(5), 3,
      sym_comment,
      sym_macro_expansion,
      aux_sym_quoted_string_repeat1,
  [138] = 10,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(25), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(27), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(41), 1,
      anon_sym_DQUOTE,
    STATE(2), 1,
      aux_sym_quoted_string_repeat1,
    STATE(11), 1,
      aux_sym_quoted_string_text_fragment_repeat1,
    ACTIONS(21), 2,
      aux_sym_quoted_string_text_fragment_token1,
      anon_sym_BSLASH,
    ACTIONS(23), 2,
      anon_sym_BSLASH_DQUOTE,
      anon_sym_BSLASH_BSLASH,
    STATE(6), 2,
      sym_comment,
      sym_macro_expansion,
    STATE(19), 2,
      sym_quoted_string_text_fragment,
      sym_escape_sequence,
  [173] = 11,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(11), 1,
      anon_sym_LBRACE,
    ACTIONS(13), 1,
      anon_sym_pattern,
    ACTIONS(43), 1,
      anon_sym_RBRACE,
    STATE(26), 1,
      aux_sym_source_file_repeat1,
    STATE(35), 1,
      aux_sym_source_file_repeat2,
    STATE(53), 1,
      sym_regular,
    STATE(55), 1,
      sym_pattern,
    STATE(7), 2,
      sym_comment,
      sym_macro_expansion,
  [208] = 8,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(47), 1,
      anon_sym_LBRACE,
    STATE(14), 1,
      aux_sym_pattern_repeat1,
    STATE(40), 1,
      sym_pattern_values,
    STATE(8), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(45), 3,
      ts_builtin_sym_end,
      anon_sym_RBRACE,
      anon_sym_pattern,
  [236] = 10,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(49), 1,
      anon_sym_RBRACE,
    ACTIONS(51), 1,
      sym__bareword,
    ACTIONS(53), 1,
      anon_sym_DQUOTE,
    STATE(12), 1,
      aux_sym_pattern_values_repeat1,
    STATE(23), 1,
      sym_string,
    STATE(39), 1,
      sym_quoted_string,
    STATE(9), 2,
      sym_comment,
      sym_macro_expansion,
  [268] = 9,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(55), 1,
      anon_sym_RBRACE,
    ACTIONS(57), 1,
      sym__bareword,
    ACTIONS(60), 1,
      anon_sym_DQUOTE,
    STATE(23), 1,
      sym_string,
    STATE(39), 1,
      sym_quoted_string,
    STATE(10), 3,
      sym_comment,
      sym_macro_expansion,
      aux_sym_pattern_values_repeat1,
  [298] = 8,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(25), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(27), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(63), 1,
      anon_sym_DQUOTE,
    STATE(13), 1,
      aux_sym_quoted_string_text_fragment_repeat1,
    ACTIONS(21), 2,
      aux_sym_quoted_string_text_fragment_token1,
      anon_sym_BSLASH,
    ACTIONS(65), 2,
      anon_sym_BSLASH_DQUOTE,
      anon_sym_BSLASH_BSLASH,
    STATE(11), 2,
      sym_comment,
      sym_macro_expansion,
  [326] = 10,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(51), 1,
      sym__bareword,
    ACTIONS(53), 1,
      anon_sym_DQUOTE,
    ACTIONS(67), 1,
      anon_sym_RBRACE,
    STATE(10), 1,
      aux_sym_pattern_values_repeat1,
    STATE(23), 1,
      sym_string,
    STATE(39), 1,
      sym_quoted_string,
    STATE(12), 2,
      sym_comment,
      sym_macro_expansion,
  [358] = 7,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(25), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(27), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(69), 1,
      anon_sym_DQUOTE,
    ACTIONS(71), 2,
      aux_sym_quoted_string_text_fragment_token1,
      anon_sym_BSLASH,
    ACTIONS(74), 2,
      anon_sym_BSLASH_DQUOTE,
      anon_sym_BSLASH_BSLASH,
    STATE(13), 3,
      sym_comment,
      sym_macro_expansion,
      aux_sym_quoted_string_text_fragment_repeat1,
  [384] = 8,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(47), 1,
      anon_sym_LBRACE,
    STATE(15), 1,
      aux_sym_pattern_repeat1,
    STATE(40), 1,
      sym_pattern_values,
    STATE(14), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(76), 3,
      ts_builtin_sym_end,
      anon_sym_RBRACE,
      anon_sym_pattern,
  [412] = 7,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(80), 1,
      anon_sym_LBRACE,
    STATE(40), 1,
      sym_pattern_values,
    ACTIONS(78), 3,
      ts_builtin_sym_end,
      anon_sym_RBRACE,
      anon_sym_pattern,
    STATE(15), 3,
      sym_comment,
      sym_macro_expansion,
      aux_sym_pattern_repeat1,
  [438] = 7,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(85), 1,
      anon_sym_pattern,
    STATE(55), 1,
      sym_pattern,
    ACTIONS(83), 2,
      ts_builtin_sym_end,
      anon_sym_RBRACE,
    STATE(16), 3,
      sym_comment,
      sym_macro_expansion,
      aux_sym_source_file_repeat2,
  [463] = 7,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(90), 1,
      anon_sym_LBRACE,
    STATE(53), 1,
      sym_regular,
    ACTIONS(88), 2,
      ts_builtin_sym_end,
      anon_sym_RBRACE,
    STATE(17), 3,
      sym_comment,
      sym_macro_expansion,
      aux_sym_source_file_repeat1,
  [488] = 6,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(25), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(27), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(95), 2,
      anon_sym_BSLASH_DQUOTE,
      anon_sym_BSLASH_BSLASH,
    STATE(18), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(93), 3,
      anon_sym_DQUOTE,
      aux_sym_quoted_string_text_fragment_token1,
      anon_sym_BSLASH,
  [511] = 6,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(25), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(27), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(99), 2,
      anon_sym_BSLASH_DQUOTE,
      anon_sym_BSLASH_BSLASH,
    STATE(19), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(97), 3,
      anon_sym_DQUOTE,
      aux_sym_quoted_string_text_fragment_token1,
      anon_sym_BSLASH,
  [534] = 6,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(25), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(27), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(103), 2,
      anon_sym_BSLASH_DQUOTE,
      anon_sym_BSLASH_BSLASH,
    STATE(20), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(101), 3,
      anon_sym_DQUOTE,
      aux_sym_quoted_string_text_fragment_token1,
      anon_sym_BSLASH,
  [557] = 8,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(105), 1,
      anon_sym_RBRACE,
    ACTIONS(107), 1,
      sym_identifier,
    STATE(36), 1,
      aux_sym_regular_repeat1,
    STATE(58), 1,
      sym__regular_assignment,
    STATE(21), 2,
      sym_comment,
      sym_macro_expansion,
  [583] = 6,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(111), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(114), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(117), 1,
      aux_sym__macro_expansion_inner_token1,
    ACTIONS(109), 2,
      anon_sym_RBRACE,
      anon_sym_RPAREN,
    STATE(22), 3,
      sym_comment,
      sym_macro_expansion,
      aux_sym__macro_expansion_inner,
  [605] = 6,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(120), 1,
      anon_sym_COMMA,
    STATE(23), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(122), 3,
      anon_sym_RBRACE,
      sym__bareword,
      anon_sym_DQUOTE,
  [627] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(24), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(124), 4,
      anon_sym_COMMA,
      anon_sym_RBRACE,
      sym__bareword,
      anon_sym_DQUOTE,
  [647] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(25), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(126), 4,
      anon_sym_LBRACE,
      anon_sym_COMMA,
      anon_sym_RBRACE,
      sym_identifier,
  [667] = 8,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(11), 1,
      anon_sym_LBRACE,
    ACTIONS(128), 1,
      anon_sym_RBRACE,
    STATE(17), 1,
      aux_sym_source_file_repeat1,
    STATE(53), 1,
      sym_regular,
    STATE(26), 2,
      sym_comment,
      sym_macro_expansion,
  [693] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(27), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(130), 4,
      ts_builtin_sym_end,
      anon_sym_LBRACE,
      anon_sym_RBRACE,
      anon_sym_pattern,
  [713] = 8,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(15), 1,
      anon_sym_file,
    ACTIONS(132), 1,
      ts_builtin_sym_end,
    STATE(30), 1,
      aux_sym_source_file_repeat3,
    STATE(64), 1,
      sym_db_template,
    STATE(28), 2,
      sym_comment,
      sym_macro_expansion,
  [739] = 8,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(13), 1,
      anon_sym_pattern,
    ACTIONS(132), 1,
      ts_builtin_sym_end,
    STATE(16), 1,
      aux_sym_source_file_repeat2,
    STATE(55), 1,
      sym_pattern,
    STATE(29), 2,
      sym_comment,
      sym_macro_expansion,
  [765] = 7,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(134), 1,
      ts_builtin_sym_end,
    ACTIONS(136), 1,
      anon_sym_file,
    STATE(64), 1,
      sym_db_template,
    STATE(30), 3,
      sym_comment,
      sym_macro_expansion,
      aux_sym_source_file_repeat3,
  [789] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(31), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(139), 4,
      ts_builtin_sym_end,
      anon_sym_LBRACE,
      anon_sym_RBRACE,
      anon_sym_pattern,
  [809] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(32), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(124), 4,
      anon_sym_LBRACE,
      anon_sym_COMMA,
      anon_sym_RBRACE,
      sym_identifier,
  [829] = 8,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(141), 1,
      sym__bareword,
    ACTIONS(143), 1,
      anon_sym_DQUOTE,
    STATE(25), 1,
      sym_quoted_string,
    STATE(51), 1,
      sym_string,
    STATE(33), 2,
      sym_comment,
      sym_macro_expansion,
  [855] = 8,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(11), 1,
      anon_sym_LBRACE,
    ACTIONS(132), 1,
      ts_builtin_sym_end,
    STATE(17), 1,
      aux_sym_source_file_repeat1,
    STATE(53), 1,
      sym_regular,
    STATE(34), 2,
      sym_comment,
      sym_macro_expansion,
  [881] = 8,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(13), 1,
      anon_sym_pattern,
    ACTIONS(128), 1,
      anon_sym_RBRACE,
    STATE(16), 1,
      aux_sym_source_file_repeat2,
    STATE(55), 1,
      sym_pattern,
    STATE(35), 2,
      sym_comment,
      sym_macro_expansion,
  [907] = 7,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(145), 1,
      anon_sym_RBRACE,
    ACTIONS(147), 1,
      sym_identifier,
    STATE(58), 1,
      sym__regular_assignment,
    STATE(36), 3,
      sym_comment,
      sym_macro_expansion,
      aux_sym_regular_repeat1,
  [931] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(37), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(150), 4,
      ts_builtin_sym_end,
      anon_sym_LBRACE,
      anon_sym_RBRACE,
      anon_sym_pattern,
  [951] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(38), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(152), 4,
      ts_builtin_sym_end,
      anon_sym_LBRACE,
      anon_sym_RBRACE,
      anon_sym_pattern,
  [971] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(39), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(126), 4,
      anon_sym_COMMA,
      anon_sym_RBRACE,
      sym__bareword,
      anon_sym_DQUOTE,
  [991] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(40), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(154), 4,
      ts_builtin_sym_end,
      anon_sym_LBRACE,
      anon_sym_RBRACE,
      anon_sym_pattern,
  [1011] = 8,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(141), 1,
      sym__bareword,
    ACTIONS(143), 1,
      anon_sym_DQUOTE,
    STATE(25), 1,
      sym_quoted_string,
    STATE(63), 1,
      sym_string,
    STATE(41), 2,
      sym_comment,
      sym_macro_expansion,
  [1037] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(42), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(156), 4,
      anon_sym_LBRACE,
      anon_sym_COMMA,
      anon_sym_RBRACE,
      sym_identifier,
  [1057] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(43), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(156), 4,
      anon_sym_COMMA,
      anon_sym_RBRACE,
      sym__bareword,
      anon_sym_DQUOTE,
  [1077] = 8,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(107), 1,
      sym_identifier,
    ACTIONS(158), 1,
      anon_sym_RBRACE,
    STATE(21), 1,
      aux_sym_regular_repeat1,
    STATE(58), 1,
      sym__regular_assignment,
    STATE(44), 2,
      sym_comment,
      sym_macro_expansion,
  [1103] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(45), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(160), 3,
      ts_builtin_sym_end,
      anon_sym_LBRACE,
      anon_sym_RBRACE,
  [1122] = 3,
    ACTIONS(17), 1,
      anon_sym_POUND,
    STATE(46), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(162), 5,
      anon_sym_RBRACE,
      anon_sym_DOLLAR_LBRACE,
      anon_sym_DOLLAR_LPAREN,
      anon_sym_RPAREN,
      aux_sym__macro_expansion_inner_token1,
  [1137] = 7,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(164), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(166), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(168), 1,
      anon_sym_RPAREN,
    ACTIONS(170), 1,
      aux_sym__macro_expansion_inner_token1,
    STATE(22), 1,
      aux_sym__macro_expansion_inner,
    STATE(47), 2,
      sym_comment,
      sym_macro_expansion,
  [1160] = 6,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(172), 1,
      anon_sym_COMMA,
    ACTIONS(174), 2,
      anon_sym_RBRACE,
      sym_identifier,
    STATE(48), 2,
      sym_comment,
      sym_macro_expansion,
  [1181] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(49), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(176), 3,
      ts_builtin_sym_end,
      anon_sym_LBRACE,
      anon_sym_RBRACE,
  [1200] = 7,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(164), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(166), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(168), 1,
      anon_sym_RBRACE,
    ACTIONS(170), 1,
      aux_sym__macro_expansion_inner_token1,
    STATE(22), 1,
      aux_sym__macro_expansion_inner,
    STATE(50), 2,
      sym_comment,
      sym_macro_expansion,
  [1223] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(51), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(178), 3,
      anon_sym_COMMA,
      anon_sym_RBRACE,
      sym_identifier,
  [1242] = 7,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(180), 1,
      anon_sym_RBRACE,
    ACTIONS(182), 1,
      sym_identifier,
    STATE(54), 1,
      aux_sym_pattern_variables_repeat1,
    STATE(52), 2,
      sym_comment,
      sym_macro_expansion,
  [1265] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(53), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(184), 3,
      ts_builtin_sym_end,
      anon_sym_LBRACE,
      anon_sym_RBRACE,
  [1284] = 6,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(186), 1,
      anon_sym_RBRACE,
    ACTIONS(188), 1,
      sym_identifier,
    STATE(54), 3,
      sym_comment,
      sym_macro_expansion,
      aux_sym_pattern_variables_repeat1,
  [1305] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(55), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(191), 3,
      ts_builtin_sym_end,
      anon_sym_RBRACE,
      anon_sym_pattern,
  [1324] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    STATE(56), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(55), 3,
      anon_sym_RBRACE,
      sym__bareword,
      anon_sym_DQUOTE,
  [1343] = 7,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(182), 1,
      sym_identifier,
    ACTIONS(193), 1,
      anon_sym_RBRACE,
    STATE(52), 1,
      aux_sym_pattern_variables_repeat1,
    STATE(57), 2,
      sym_comment,
      sym_macro_expansion,
  [1366] = 6,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(195), 1,
      anon_sym_COMMA,
    ACTIONS(197), 2,
      anon_sym_RBRACE,
      sym_identifier,
    STATE(58), 2,
      sym_comment,
      sym_macro_expansion,
  [1387] = 3,
    ACTIONS(17), 1,
      anon_sym_POUND,
    STATE(59), 2,
      sym_comment,
      sym_macro_expansion,
    ACTIONS(199), 5,
      anon_sym_RBRACE,
      anon_sym_DOLLAR_LBRACE,
      anon_sym_DOLLAR_LPAREN,
      anon_sym_RPAREN,
      aux_sym__macro_expansion_inner_token1,
  [1402] = 7,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(164), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(166), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(170), 1,
      aux_sym__macro_expansion_inner_token1,
    ACTIONS(201), 1,
      anon_sym_RPAREN,
    STATE(22), 1,
      aux_sym__macro_expansion_inner,
    STATE(60), 2,
      sym_comment,
      sym_macro_expansion,
  [1425] = 7,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(164), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(166), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(170), 1,
      aux_sym__macro_expansion_inner_token1,
    ACTIONS(201), 1,
      anon_sym_RBRACE,
    STATE(22), 1,
      aux_sym__macro_expansion_inner,
    STATE(61), 2,
      sym_comment,
      sym_macro_expansion,
  [1448] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(203), 2,
      ts_builtin_sym_end,
      anon_sym_file,
    STATE(62), 2,
      sym_comment,
      sym_macro_expansion,
  [1466] = 6,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(205), 1,
      anon_sym_LBRACE,
    STATE(69), 1,
      sym_substitutions,
    STATE(63), 2,
      sym_comment,
      sym_macro_expansion,
  [1486] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(207), 2,
      ts_builtin_sym_end,
      anon_sym_file,
    STATE(64), 2,
      sym_comment,
      sym_macro_expansion,
  [1504] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(209), 2,
      ts_builtin_sym_end,
      anon_sym_file,
    STATE(65), 2,
      sym_comment,
      sym_macro_expansion,
  [1522] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(145), 2,
      anon_sym_RBRACE,
      sym_identifier,
    STATE(66), 2,
      sym_comment,
      sym_macro_expansion,
  [1540] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(186), 2,
      anon_sym_RBRACE,
      sym_identifier,
    STATE(67), 2,
      sym_comment,
      sym_macro_expansion,
  [1558] = 6,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(211), 1,
      anon_sym_LBRACE,
    STATE(8), 1,
      sym_pattern_variables,
    STATE(68), 2,
      sym_comment,
      sym_macro_expansion,
  [1578] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(213), 2,
      ts_builtin_sym_end,
      anon_sym_file,
    STATE(69), 2,
      sym_comment,
      sym_macro_expansion,
  [1596] = 6,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(164), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(166), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(170), 1,
      aux_sym__macro_expansion_inner_token1,
    STATE(60), 1,
      aux_sym__macro_expansion_inner,
    STATE(70), 2,
      sym_comment,
      sym_macro_expansion,
  [1616] = 6,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(164), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(166), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(170), 1,
      aux_sym__macro_expansion_inner_token1,
    STATE(61), 1,
      aux_sym__macro_expansion_inner,
    STATE(71), 2,
      sym_comment,
      sym_macro_expansion,
  [1636] = 6,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(164), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(166), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(170), 1,
      aux_sym__macro_expansion_inner_token1,
    STATE(50), 1,
      aux_sym__macro_expansion_inner,
    STATE(72), 2,
      sym_comment,
      sym_macro_expansion,
  [1656] = 6,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(164), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(166), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(170), 1,
      aux_sym__macro_expansion_inner_token1,
    STATE(47), 1,
      aux_sym__macro_expansion_inner,
    STATE(73), 2,
      sym_comment,
      sym_macro_expansion,
  [1676] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(215), 1,
      anon_sym_EQ,
    STATE(74), 2,
      sym_comment,
      sym_macro_expansion,
  [1693] = 5,
    ACTIONS(3), 1,
      anon_sym_POUND,
    ACTIONS(5), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(7), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(217), 1,
      ts_builtin_sym_end,
    STATE(75), 2,
      sym_comment,
      sym_macro_expansion,
  [1710] = 5,
    ACTIONS(17), 1,
      anon_sym_POUND,
    ACTIONS(25), 1,
      anon_sym_DOLLAR_LBRACE,
    ACTIONS(27), 1,
      anon_sym_DOLLAR_LPAREN,
    ACTIONS(219), 1,
      aux_sym_comment_token1,
    STATE(76), 2,
      sym_comment,
      sym_macro_expansion,
  [1727] = 1,
    ACTIONS(221), 1,
      ts_builtin_sym_end,
  [1731] = 1,
    ACTIONS(223), 1,
      ts_builtin_sym_end,
};

static const uint32_t ts_small_parse_table_map[] = {
  [SMALL_STATE(2)] = 0,
  [SMALL_STATE(3)] = 35,
  [SMALL_STATE(4)] = 70,
  [SMALL_STATE(5)] = 105,
  [SMALL_STATE(6)] = 138,
  [SMALL_STATE(7)] = 173,
  [SMALL_STATE(8)] = 208,
  [SMALL_STATE(9)] = 236,
  [SMALL_STATE(10)] = 268,
  [SMALL_STATE(11)] = 298,
  [SMALL_STATE(12)] = 326,
  [SMALL_STATE(13)] = 358,
  [SMALL_STATE(14)] = 384,
  [SMALL_STATE(15)] = 412,
  [SMALL_STATE(16)] = 438,
  [SMALL_STATE(17)] = 463,
  [SMALL_STATE(18)] = 488,
  [SMALL_STATE(19)] = 511,
  [SMALL_STATE(20)] = 534,
  [SMALL_STATE(21)] = 557,
  [SMALL_STATE(22)] = 583,
  [SMALL_STATE(23)] = 605,
  [SMALL_STATE(24)] = 627,
  [SMALL_STATE(25)] = 647,
  [SMALL_STATE(26)] = 667,
  [SMALL_STATE(27)] = 693,
  [SMALL_STATE(28)] = 713,
  [SMALL_STATE(29)] = 739,
  [SMALL_STATE(30)] = 765,
  [SMALL_STATE(31)] = 789,
  [SMALL_STATE(32)] = 809,
  [SMALL_STATE(33)] = 829,
  [SMALL_STATE(34)] = 855,
  [SMALL_STATE(35)] = 881,
  [SMALL_STATE(36)] = 907,
  [SMALL_STATE(37)] = 931,
  [SMALL_STATE(38)] = 951,
  [SMALL_STATE(39)] = 971,
  [SMALL_STATE(40)] = 991,
  [SMALL_STATE(41)] = 1011,
  [SMALL_STATE(42)] = 1037,
  [SMALL_STATE(43)] = 1057,
  [SMALL_STATE(44)] = 1077,
  [SMALL_STATE(45)] = 1103,
  [SMALL_STATE(46)] = 1122,
  [SMALL_STATE(47)] = 1137,
  [SMALL_STATE(48)] = 1160,
  [SMALL_STATE(49)] = 1181,
  [SMALL_STATE(50)] = 1200,
  [SMALL_STATE(51)] = 1223,
  [SMALL_STATE(52)] = 1242,
  [SMALL_STATE(53)] = 1265,
  [SMALL_STATE(54)] = 1284,
  [SMALL_STATE(55)] = 1305,
  [SMALL_STATE(56)] = 1324,
  [SMALL_STATE(57)] = 1343,
  [SMALL_STATE(58)] = 1366,
  [SMALL_STATE(59)] = 1387,
  [SMALL_STATE(60)] = 1402,
  [SMALL_STATE(61)] = 1425,
  [SMALL_STATE(62)] = 1448,
  [SMALL_STATE(63)] = 1466,
  [SMALL_STATE(64)] = 1486,
  [SMALL_STATE(65)] = 1504,
  [SMALL_STATE(66)] = 1522,
  [SMALL_STATE(67)] = 1540,
  [SMALL_STATE(68)] = 1558,
  [SMALL_STATE(69)] = 1578,
  [SMALL_STATE(70)] = 1596,
  [SMALL_STATE(71)] = 1616,
  [SMALL_STATE(72)] = 1636,
  [SMALL_STATE(73)] = 1656,
  [SMALL_STATE(74)] = 1676,
  [SMALL_STATE(75)] = 1693,
  [SMALL_STATE(76)] = 1710,
  [SMALL_STATE(77)] = 1727,
  [SMALL_STATE(78)] = 1731,
};

static const TSParseActionEntry ts_parse_actions[] = {
  [0] = {.entry = {.count = 0, .reusable = false}},
  [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(),
  [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT(76),
  [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(71),
  [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(70),
  [9] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0),
  [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(44),
  [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68),
  [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41),
  [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(76),
  [19] = {.entry = {.count = 1, .reusable = false}}, SHIFT(32),
  [21] = {.entry = {.count = 1, .reusable = false}}, SHIFT(20),
  [23] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18),
  [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(71),
  [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(70),
  [29] = {.entry = {.count = 1, .reusable = false}}, SHIFT(24),
  [31] = {.entry = {.count = 1, .reusable = false}}, SHIFT(43),
  [33] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_quoted_string_repeat1, 2),
  [35] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_quoted_string_repeat1, 2), SHIFT_REPEAT(20),
  [38] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_quoted_string_repeat1, 2), SHIFT_REPEAT(18),
  [41] = {.entry = {.count = 1, .reusable = false}}, SHIFT(42),
  [43] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62),
  [45] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern, 2),
  [47] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9),
  [49] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27),
  [51] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39),
  [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4),
  [55] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_pattern_values_repeat1, 2),
  [57] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_pattern_values_repeat1, 2), SHIFT_REPEAT(39),
  [60] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_pattern_values_repeat1, 2), SHIFT_REPEAT(4),
  [63] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_quoted_string_text_fragment, 1),
  [65] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_quoted_string_text_fragment, 1),
  [67] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38),
  [69] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_quoted_string_text_fragment_repeat1, 2),
  [71] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_quoted_string_text_fragment_repeat1, 2), SHIFT_REPEAT(20),
  [74] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_quoted_string_text_fragment_repeat1, 2),
  [76] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern, 3),
  [78] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_pattern_repeat1, 2),
  [80] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_pattern_repeat1, 2), SHIFT_REPEAT(9),
  [83] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2),
  [85] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 2), SHIFT_REPEAT(68),
  [88] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2),
  [90] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2), SHIFT_REPEAT(44),
  [93] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_escape_sequence, 1),
  [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_escape_sequence, 1),
  [97] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_quoted_string_repeat1, 1),
  [99] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_quoted_string_repeat1, 1),
  [101] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_quoted_string_text_fragment_repeat1, 1),
  [103] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_quoted_string_text_fragment_repeat1, 1),
  [105] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49),
  [107] = {.entry = {.count = 1, .reusable = true}}, SHIFT(74),
  [109] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym__macro_expansion_inner, 2),
  [111] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__macro_expansion_inner, 2), SHIFT_REPEAT(72),
  [114] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__macro_expansion_inner, 2), SHIFT_REPEAT(73),
  [117] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__macro_expansion_inner, 2), SHIFT_REPEAT(59),
  [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56),
  [122] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_pattern_values_repeat1, 1),
  [124] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_quoted_string, 3),
  [126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_string, 1),
  [128] = {.entry = {.count = 1, .reusable = true}}, SHIFT(65),
  [130] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern_values, 2),
  [132] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1),
  [134] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat3, 2),
  [136] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat3, 2), SHIFT_REPEAT(41),
  [139] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern_variables, 3),
  [141] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25),
  [143] = {.entry = {.count = 1, .reusable = true}}, SHIFT(6),
  [145] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_regular_repeat1, 2),
  [147] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_regular_repeat1, 2), SHIFT_REPEAT(74),
  [150] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern_variables, 2),
  [152] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pattern_values, 3),
  [154] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_pattern_repeat1, 1),
  [156] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_quoted_string, 2),
  [158] = {.entry = {.count = 1, .reusable = true}}, SHIFT(45),
  [160] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_regular, 2),
  [162] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_macro_expansion, 3),
  [164] = {.entry = {.count = 1, .reusable = false}}, SHIFT(72),
  [166] = {.entry = {.count = 1, .reusable = false}}, SHIFT(73),
  [168] = {.entry = {.count = 1, .reusable = false}}, SHIFT(46),
  [170] = {.entry = {.count = 1, .reusable = false}}, SHIFT(59),
  [172] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67),
  [174] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_pattern_variables_repeat1, 1),
  [176] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_regular, 3),
  [178] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__regular_assignment, 3),
  [180] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31),
  [182] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48),
  [184] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 1),
  [186] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_pattern_variables_repeat1, 2),
  [188] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_pattern_variables_repeat1, 2), SHIFT_REPEAT(48),
  [191] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat2, 1),
  [193] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37),
  [195] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66),
  [197] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_regular_repeat1, 1),
  [199] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym__macro_expansion_inner, 1),
  [201] = {.entry = {.count = 1, .reusable = false}}, SHIFT(78),
  [203] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_substitutions, 2),
  [205] = {.entry = {.count = 1, .reusable = true}}, SHIFT(7),
  [207] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat3, 1),
  [209] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_substitutions, 3),
  [211] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57),
  [213] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_db_template, 3, .production_id = 1),
  [215] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33),
  [217] = {.entry = {.count = 1, .reusable = true}},  ACCEPT_INPUT(),
  [219] = {.entry = {.count = 1, .reusable = false}}, SHIFT(77),
  [221] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2),
  [223] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_macro_expansion, 3),
};

#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN32
#define extern __declspec(dllexport)
#endif

extern const TSLanguage *tree_sitter_epics_msi_substitution(void) {
  static const TSLanguage language = {
    .version = LANGUAGE_VERSION,
    .symbol_count = SYMBOL_COUNT,
    .alias_count = ALIAS_COUNT,
    .token_count = TOKEN_COUNT,
    .external_token_count = EXTERNAL_TOKEN_COUNT,
    .state_count = STATE_COUNT,
    .large_state_count = LARGE_STATE_COUNT,
    .production_id_count = PRODUCTION_ID_COUNT,
    .field_count = FIELD_COUNT,
    .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH,
    .parse_table = &ts_parse_table[0][0],
    .small_parse_table = ts_small_parse_table,
    .small_parse_table_map = ts_small_parse_table_map,
    .parse_actions = ts_parse_actions,
    .symbol_names = ts_symbol_names,
    .field_names = ts_field_names,
    .field_map_slices = ts_field_map_slices,
    .field_map_entries = ts_field_map_entries,
    .symbol_metadata = ts_symbol_metadata,
    .public_symbol_map = ts_symbol_map,
    .alias_map = ts_non_terminal_alias_map,
    .alias_sequences = &ts_alias_sequences[0][0],
    .lex_modes = ts_lex_modes,
    .lex_fn = ts_lex,
  };
  return &language;
}
#ifdef __cplusplus
}
#endif
