{
  "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
  "name": "elisp",
  "rules": {
    "source_file": {
      "type": "REPEAT",
      "content": {
        "type": "SYMBOL",
        "name": "_sexp"
      }
    },
    "_sexp": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SYMBOL",
          "name": "special_form"
        },
        {
          "type": "SYMBOL",
          "name": "function_definition"
        },
        {
          "type": "SYMBOL",
          "name": "macro_definition"
        },
        {
          "type": "SYMBOL",
          "name": "list"
        },
        {
          "type": "SYMBOL",
          "name": "vector"
        },
        {
          "type": "SYMBOL",
          "name": "hash_table"
        },
        {
          "type": "SYMBOL",
          "name": "bytecode"
        },
        {
          "type": "SYMBOL",
          "name": "string_text_properties"
        },
        {
          "type": "SYMBOL",
          "name": "_atom"
        },
        {
          "type": "SYMBOL",
          "name": "quote"
        },
        {
          "type": "SYMBOL",
          "name": "unquote_splice"
        },
        {
          "type": "SYMBOL",
          "name": "unquote"
        }
      ]
    },
    "special_form": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "("
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": "and"
            },
            {
              "type": "STRING",
              "value": "catch"
            },
            {
              "type": "STRING",
              "value": "cond"
            },
            {
              "type": "STRING",
              "value": "condition-case"
            },
            {
              "type": "STRING",
              "value": "defconst"
            },
            {
              "type": "STRING",
              "value": "defvar"
            },
            {
              "type": "STRING",
              "value": "function"
            },
            {
              "type": "STRING",
              "value": "if"
            },
            {
              "type": "STRING",
              "value": "interactive"
            },
            {
              "type": "STRING",
              "value": "lambda"
            },
            {
              "type": "STRING",
              "value": "let"
            },
            {
              "type": "STRING",
              "value": "let*"
            },
            {
              "type": "STRING",
              "value": "or"
            },
            {
              "type": "STRING",
              "value": "prog1"
            },
            {
              "type": "STRING",
              "value": "prog2"
            },
            {
              "type": "STRING",
              "value": "progn"
            },
            {
              "type": "STRING",
              "value": "quote"
            },
            {
              "type": "STRING",
              "value": "save-current-buffer"
            },
            {
              "type": "STRING",
              "value": "save-excursion"
            },
            {
              "type": "STRING",
              "value": "save-restriction"
            },
            {
              "type": "STRING",
              "value": "setq"
            },
            {
              "type": "STRING",
              "value": "setq-default"
            },
            {
              "type": "STRING",
              "value": "unwind-protect"
            },
            {
              "type": "STRING",
              "value": "while"
            }
          ]
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "_sexp"
          }
        },
        {
          "type": "STRING",
          "value": ")"
        }
      ]
    },
    "function_definition": {
      "type": "PREC",
      "value": 1,
      "content": {
        "type": "SEQ",
        "members": [
          {
            "type": "STRING",
            "value": "("
          },
          {
            "type": "CHOICE",
            "members": [
              {
                "type": "STRING",
                "value": "defun"
              },
              {
                "type": "STRING",
                "value": "defsubst"
              }
            ]
          },
          {
            "type": "FIELD",
            "name": "name",
            "content": {
              "type": "SYMBOL",
              "name": "symbol"
            }
          },
          {
            "type": "CHOICE",
            "members": [
              {
                "type": "FIELD",
                "name": "parameters",
                "content": {
                  "type": "SYMBOL",
                  "name": "_sexp"
                }
              },
              {
                "type": "BLANK"
              }
            ]
          },
          {
            "type": "CHOICE",
            "members": [
              {
                "type": "FIELD",
                "name": "docstring",
                "content": {
                  "type": "SYMBOL",
                  "name": "string"
                }
              },
              {
                "type": "BLANK"
              }
            ]
          },
          {
            "type": "REPEAT",
            "content": {
              "type": "SYMBOL",
              "name": "_sexp"
            }
          },
          {
            "type": "STRING",
            "value": ")"
          }
        ]
      }
    },
    "macro_definition": {
      "type": "PREC",
      "value": 1,
      "content": {
        "type": "SEQ",
        "members": [
          {
            "type": "STRING",
            "value": "("
          },
          {
            "type": "STRING",
            "value": "defmacro"
          },
          {
            "type": "FIELD",
            "name": "name",
            "content": {
              "type": "SYMBOL",
              "name": "symbol"
            }
          },
          {
            "type": "CHOICE",
            "members": [
              {
                "type": "FIELD",
                "name": "parameters",
                "content": {
                  "type": "SYMBOL",
                  "name": "_sexp"
                }
              },
              {
                "type": "BLANK"
              }
            ]
          },
          {
            "type": "CHOICE",
            "members": [
              {
                "type": "FIELD",
                "name": "docstring",
                "content": {
                  "type": "SYMBOL",
                  "name": "string"
                }
              },
              {
                "type": "BLANK"
              }
            ]
          },
          {
            "type": "REPEAT",
            "content": {
              "type": "SYMBOL",
              "name": "_sexp"
            }
          },
          {
            "type": "STRING",
            "value": ")"
          }
        ]
      }
    },
    "_atom": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SYMBOL",
          "name": "float"
        },
        {
          "type": "SYMBOL",
          "name": "integer"
        },
        {
          "type": "SYMBOL",
          "name": "char"
        },
        {
          "type": "SYMBOL",
          "name": "string"
        },
        {
          "type": "SYMBOL",
          "name": "byte_compiled_file_name"
        },
        {
          "type": "SYMBOL",
          "name": "symbol"
        }
      ]
    },
    "float": {
      "type": "CHOICE",
      "members": [
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "[+-]?[0-9]*\\.[0-9]+"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "[+-]?[0-9]+[eE][0-9]+"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "[+-]?[0-9]*\\.[0-9]+[eE][0-9]+"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "-?1.0[eE]\\+INF"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "-?0.0[eE]\\+NaN"
          }
        }
      ]
    },
    "integer": {
      "type": "CHOICE",
      "members": [
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "[+-]?[0-9]+\\.?"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "#([box]|[0-9][0-9]?r)[0-9a-zA-Z]"
          }
        }
      ]
    },
    "char": {
      "type": "CHOICE",
      "members": [
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "\\?(\\\\.|.)"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "\\?\\\\N\\{[^}]+\\}"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "\\?\\\\u[0-9a-fA-F]{4}"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "\\?\\\\U[0-9a-fA-F]{8}"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "\\?\\\\x[0-9a-fA-F]+"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "\\?\\\\[0-7]{1,3}"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "\\?(\\\\(([CMSHsA]-)|\\^))+(\\\\;|.)"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "\\?\\\\M-\\\\[0-9]{1,3}"
          }
        }
      ]
    },
    "string": {
      "type": "TOKEN",
      "content": {
        "type": "SEQ",
        "members": [
          {
            "type": "STRING",
            "value": "\""
          },
          {
            "type": "REPEAT",
            "content": {
              "type": "CHOICE",
              "members": [
                {
                  "type": "PATTERN",
                  "value": "[^\"\\\\]"
                },
                {
                  "type": "SEQ",
                  "members": [
                    {
                      "type": "STRING",
                      "value": "\\"
                    },
                    {
                      "type": "PATTERN",
                      "value": "(.|\\n)"
                    }
                  ]
                }
              ]
            }
          },
          {
            "type": "STRING",
            "value": "\""
          }
        ]
      }
    },
    "byte_compiled_file_name": {
      "type": "TOKEN",
      "content": {
        "type": "STRING",
        "value": "#$"
      }
    },
    "symbol": {
      "type": "CHOICE",
      "members": [
        {
          "type": "STRING",
          "value": "nil"
        },
        {
          "type": "STRING",
          "value": "t"
        },
        {
          "type": "STRING",
          "value": "defun"
        },
        {
          "type": "STRING",
          "value": "defsubst"
        },
        {
          "type": "STRING",
          "value": "defmacro"
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "\\\\(`|'|,)"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "PATTERN",
            "value": "([^?# \\n\\s\\f()\\[\\]'`,\\\\\";]|\\\\.)([^# \\n\\s\\f()\\[\\]'`,\\\\\";]|\\\\.)*"
          }
        },
        {
          "type": "TOKEN",
          "content": {
            "type": "STRING",
            "value": "##"
          }
        }
      ]
    },
    "quote": {
      "type": "SEQ",
      "members": [
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "STRING",
              "value": "#'"
            },
            {
              "type": "STRING",
              "value": "'"
            },
            {
              "type": "STRING",
              "value": "`"
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "_sexp"
        }
      ]
    },
    "unquote_splice": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": ",@"
        },
        {
          "type": "SYMBOL",
          "name": "_sexp"
        }
      ]
    },
    "unquote": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": ","
        },
        {
          "type": "SYMBOL",
          "name": "_sexp"
        }
      ]
    },
    "dot": {
      "type": "TOKEN",
      "content": {
        "type": "STRING",
        "value": "."
      }
    },
    "list": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "("
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "REPEAT",
              "content": {
                "type": "SYMBOL",
                "name": "_sexp"
              }
            }
          ]
        },
        {
          "type": "STRING",
          "value": ")"
        }
      ]
    },
    "vector": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "["
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "_sexp"
          }
        },
        {
          "type": "STRING",
          "value": "]"
        }
      ]
    },
    "bytecode": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "#["
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "_sexp"
          }
        },
        {
          "type": "STRING",
          "value": "]"
        }
      ]
    },
    "string_text_properties": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "#("
        },
        {
          "type": "SYMBOL",
          "name": "string"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "_sexp"
          }
        },
        {
          "type": "STRING",
          "value": ")"
        }
      ]
    },
    "hash_table": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "#s(hash-table"
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "_sexp"
          }
        },
        {
          "type": "STRING",
          "value": ")"
        }
      ]
    },
    "comment": {
      "type": "TOKEN",
      "content": {
        "type": "PATTERN",
        "value": ";.*"
      }
    }
  },
  "extras": [
    {
      "type": "PATTERN",
      "value": "(\\s|\\f)"
    },
    {
      "type": "SYMBOL",
      "name": "comment"
    }
  ],
  "conflicts": [],
  "precedences": [],
  "externals": [],
  "inline": [],
  "supertypes": [],
  "reserved": {}
}