{
  "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
  "name": "html",
  "rules": {
    "document": {
      "type": "REPEAT",
      "content": {
        "type": "SYMBOL",
        "name": "_node"
      }
    },
    "doctype": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "<!"
        },
        {
          "type": "ALIAS",
          "content": {
            "type": "SYMBOL",
            "name": "_doctype"
          },
          "named": false,
          "value": "doctype"
        },
        {
          "type": "PATTERN",
          "value": "[^>]+"
        },
        {
          "type": "STRING",
          "value": ">"
        }
      ]
    },
    "_doctype": {
      "type": "PATTERN",
      "value": "[Dd][Oo][Cc][Tt][Yy][Pp][Ee]"
    },
    "_node": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SYMBOL",
          "name": "doctype"
        },
        {
          "type": "SYMBOL",
          "name": "entity"
        },
        {
          "type": "SYMBOL",
          "name": "text"
        },
        {
          "type": "SYMBOL",
          "name": "element"
        },
        {
          "type": "SYMBOL",
          "name": "erroneous_end_tag"
        }
      ]
    },
    "element": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SEQ",
          "members": [
            {
              "type": "SYMBOL",
              "name": "start_tag"
            },
            {
              "type": "REPEAT",
              "content": {
                "type": "SYMBOL",
                "name": "_node"
              }
            },
            {
              "type": "CHOICE",
              "members": [
                {
                  "type": "SYMBOL",
                  "name": "end_tag"
                },
                {
                  "type": "SYMBOL",
                  "name": "_implicit_end_tag"
                }
              ]
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "_raw_text_element"
        },
        {
          "type": "SYMBOL",
          "name": "self_closing_tag"
        }
      ]
    },
    "_raw_text_element": {
      "type": "SEQ",
      "members": [
        {
          "type": "ALIAS",
          "content": {
            "type": "SYMBOL",
            "name": "_raw_text_start_tag"
          },
          "named": true,
          "value": "start_tag"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SYMBOL",
              "name": "raw_text"
            },
            {
              "type": "BLANK"
            }
          ]
        },
        {
          "type": "SYMBOL",
          "name": "end_tag"
        }
      ]
    },
    "start_tag": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "<"
        },
        {
          "type": "FIELD",
          "name": "name",
          "content": {
            "type": "ALIAS",
            "content": {
              "type": "SYMBOL",
              "name": "_start_tag_name"
            },
            "named": true,
            "value": "tag_name"
          }
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "attribute"
          }
        },
        {
          "type": "STRING",
          "value": ">"
        }
      ]
    },
    "_raw_text_start_tag": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "<"
        },
        {
          "type": "FIELD",
          "name": "name",
          "content": {
            "type": "ALIAS",
            "content": {
              "type": "SYMBOL",
              "name": "_raw_text_start_tag_name"
            },
            "named": true,
            "value": "tag_name"
          }
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "attribute"
          }
        },
        {
          "type": "STRING",
          "value": ">"
        }
      ]
    },
    "self_closing_tag": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "<"
        },
        {
          "type": "FIELD",
          "name": "name",
          "content": {
            "type": "ALIAS",
            "content": {
              "type": "SYMBOL",
              "name": "_start_tag_name"
            },
            "named": true,
            "value": "tag_name"
          }
        },
        {
          "type": "REPEAT",
          "content": {
            "type": "SYMBOL",
            "name": "attribute"
          }
        },
        {
          "type": "STRING",
          "value": "/>"
        }
      ]
    },
    "end_tag": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "</"
        },
        {
          "type": "FIELD",
          "name": "name",
          "content": {
            "type": "ALIAS",
            "content": {
              "type": "SYMBOL",
              "name": "_end_tag_name"
            },
            "named": true,
            "value": "tag_name"
          }
        },
        {
          "type": "STRING",
          "value": ">"
        }
      ]
    },
    "erroneous_end_tag": {
      "type": "SEQ",
      "members": [
        {
          "type": "STRING",
          "value": "</"
        },
        {
          "type": "SYMBOL",
          "name": "erroneous_end_tag_name"
        },
        {
          "type": "STRING",
          "value": ">"
        }
      ]
    },
    "attribute": {
      "type": "SEQ",
      "members": [
        {
          "type": "SYMBOL",
          "name": "attribute_name"
        },
        {
          "type": "CHOICE",
          "members": [
            {
              "type": "SEQ",
              "members": [
                {
                  "type": "STRING",
                  "value": "="
                },
                {
                  "type": "CHOICE",
                  "members": [
                    {
                      "type": "SYMBOL",
                      "name": "attribute_value"
                    },
                    {
                      "type": "SYMBOL",
                      "name": "quoted_attribute_value"
                    }
                  ]
                }
              ]
            },
            {
              "type": "BLANK"
            }
          ]
        }
      ]
    },
    "attribute_name": {
      "type": "PATTERN",
      "value": "[^<>\"'/=\\s]+"
    },
    "attribute_value": {
      "type": "PATTERN",
      "value": "[^<>\"'=\\s`]+"
    },
    "quoted_attribute_value": {
      "type": "CHOICE",
      "members": [
        {
          "type": "SEQ",
          "members": [
            {
              "type": "STRING",
              "value": "'"
            },
            {
              "type": "CHOICE",
              "members": [
                {
                  "type": "ALIAS",
                  "content": {
                    "type": "PATTERN",
                    "value": "[^']+"
                  },
                  "named": true,
                  "value": "attribute_value"
                },
                {
                  "type": "BLANK"
                }
              ]
            },
            {
              "type": "STRING",
              "value": "'"
            }
          ]
        },
        {
          "type": "SEQ",
          "members": [
            {
              "type": "STRING",
              "value": "\""
            },
            {
              "type": "CHOICE",
              "members": [
                {
                  "type": "ALIAS",
                  "content": {
                    "type": "PATTERN",
                    "value": "[^\"]+"
                  },
                  "named": true,
                  "value": "attribute_value"
                },
                {
                  "type": "BLANK"
                }
              ]
            },
            {
              "type": "STRING",
              "value": "\""
            }
          ]
        }
      ]
    },
    "entity": {
      "type": "PATTERN",
      "value": "&(#([xX][0-9a-fA-F]{1,6}|[0-9]{1,7})|[A-Za-z][A-Za-z0-9]*);?"
    }
  },
  "extras": [
    {
      "type": "SYMBOL",
      "name": "comment"
    },
    {
      "type": "PATTERN",
      "value": "\\s+"
    }
  ],
  "conflicts": [],
  "precedences": [],
  "externals": [
    {
      "type": "SYMBOL",
      "name": "_start_tag_name"
    },
    {
      "type": "SYMBOL",
      "name": "_raw_text_start_tag_name"
    },
    {
      "type": "SYMBOL",
      "name": "_end_tag_name"
    },
    {
      "type": "SYMBOL",
      "name": "erroneous_end_tag_name"
    },
    {
      "type": "STRING",
      "value": "/>"
    },
    {
      "type": "SYMBOL",
      "name": "_implicit_end_tag"
    },
    {
      "type": "SYMBOL",
      "name": "raw_text"
    },
    {
      "type": "SYMBOL",
      "name": "comment"
    },
    {
      "type": "SYMBOL",
      "name": "text"
    }
  ],
  "inline": [],
  "supertypes": [],
  "reserved": {}
}