{
  "scopeName": "text.html.winged-html",
  "injectionSelector": "L:text.html.derivative",
  "patterns": [
    {
      "include": "#data-point"
    },
    {
      "include": "#logic-node-for"
    },
    {
      "include": "#logic-node-plugin"
    },
    {
      "include": "#logic-node-slot"
    },
    {
      "include": "#logic-node-if"
    },
    {
      "include": "#logic-node-elif"
    },
    {
      "include": "#logic-node-else"
    },
    {
      "include": "#logic-node-end"
    },
    {
      "include": "#logic-node-foreignView"
    },
    {
      "include": "#subview"
    },
    {
      "include": "#subview-end"
    },
    {
      "include": "#data-point-br"
    },
    {
      "include": "#event-binder"
    },
    {
      "include": "#event-binder-complement"
    },
    {
      "include": "#comment"
    },
    {
      "include": "#comment-br"
    },
    {
      "include": "#method-binder"
    },
    {
      "include": "#ref-binder"
    },
    {
      "include": "#value-binder"
    }
  ],
  "repository": {
    "data-point": {
      "match": "{{(.*?)}}",
      "name": "variable.other.constant.winged",
      "captures": {
        "1": {
          "patterns": [
            {
              "include": "#data-point-props"
            },
            {
              "include": "source.js"
            }
          ]
        }
      }
    },
    "data-point-props": {
      "match": "props",
      "name": "keyword.control.winged"
    },
    "data-point-number": {
      "match": "[0-9][0-9]*[0-9]|[0-9]",
      "name": "constant.numeric.winged"
    },
    "data-point-string": {
      "begin": "['\"]",
      "end": "['\"]",
      "name": "string.quoted.single.winged",
      "patterns": [
        {
          "include": "#data-point-operator"
        },
        {
          "include": "#data-point-string"
        }
      ]
    },
    "data-point-variable": {
      "match": "[a-zA-Z0-9_]+",
      "name": "variable.other.winged"
    },
    "data-point-operator": {
      "match": "[?!:.>)<(=,]",
      "name": "keyword.operator.ternary.winged"
    },
    "logic-node-for": {
      "begin": "<For ",
      "end": ">",
      "name": "keyword.control.winged",
      "patterns": [
        {
          "include": "#winged-attr-for"
        },
        {
          "include": "#winged-attr-for-key"
        }
      ]
    },
    "logic-node-plugin": {
      "begin": "<Plugin ",
      "end": ">",
      "name": "keyword.control.winged",
      "patterns": [
        {
          "include": "#winged-attr-plugin"
        },
        {
          "include": "#winged-attr-plugin-slot-scope"
        }
      ]
    },
    "logic-node-slot": {
      "begin": "<Slot ",
      "end": ">",
      "name": "keyword.control.winged",
      "patterns": [
        {
          "include": "#winged-attr-slot-name"
        },
        {
          "include": "#winged-attr-slot-accept"
        },
        {
          "include": "#winged-attr-slot-scope"
        }
      ]
    },
    "logic-node-if": {
      "begin": "<If ",
      "end": ">",
      "name": "keyword.control.winged",
      "patterns": [
        {
          "include": "#winged-attr-if"
        }
      ]
    },
    "logic-node-elif": {
      "begin": "<Elif ",
      "end": "/>",
      "name": "keyword.control.winged",
      "patterns": [
        {
          "include": "#winged-attr-if"
        }
      ]
    },
    "logic-node-foreignView": {
      "begin": "<ForeignView ",
      "end": "/>",
      "name": "keyword.control.winged",
      "patterns": [
        {
          "include": "#winged-attr-foreignView"
        }
      ]
    },
    "winged-attr-foreignView": {
      "match": "(.*?)(=)([\"'])(.*?)([\"'])",
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "string.double.single.winged"
        },
        "4": {
          "patterns": [
            {
              "include": "#data-point"
            }
          ],
          "name": "string.double.single.winged"
        },
        "5": {
          "name": "string.double.single.winged"
        }
      }
    },
    "winged-attr-for": {
      "match": "(list|item|index|key)(=)([\"'])(.*?)([\"'])",
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "string.double.single.winged"
        },
        "4": {
          "name": "variable.other.winged"
        },
        "5": {
          "name": "string.double.single.winged"
        }
      }
    },
    "winged-attr-plugin": {
      "match": "(slot)(=)([\"'])(.*?)([\"'])",
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "string.double.single.winged"
        },
        "4": {
          "name": "string.double.single.winged"
        },
        "5": {
          "name": "string.double.single.winged"
        }
      }
    },
    "winged-attr-plugin-slot-scope": {
      "match": "(slot-scope)(=)([\"'])(.*?)([\"'])",
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "string.double.single.winged"
        },
        "4": {
          "name": "string.double.single.winged"
        },
        "5": {
          "name": "string.double.single.winged"
        }
      }
    },
    "winged-attr-slot-name": {
      "match": "(name)(=)([\"'])(.*?)([\"'])",
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "string.double.single.winged"
        },
        "4": {
          "name": "string.double.single.winged"
        },
        "5": {
          "name": "string.double.single.winged"
        }
      }
    },
    "winged-attr-slot-accept": {
      "match": "(accept)(=)([\"'])(.*?)([\"'])",
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "string.double.single.winged"
        },
        "4": {
          "patterns": [
            {
              "include": "#winged-attr-slot-accept-complement"
            }
          ]
        },
        "5": {
          "name": "string.double.single.winged"
        }
      }
    },
    "winged-attr-slot-accept-complement": {
      "match": "([a-zA-Z0-9]*)(:)([a-zA-Z0-9]*)(,)?*",
      "captures": {
        "1": {
          "name": "variable.other.readwrite.js"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "support.function.winged"
        },
        "4": {
          "name": "punctuation.separator.key-value.html"
        }
      }
    },
    "winged-attr-slot-scope": {
      "match": "(scope)(=)([\"'])(.*?)([\"'])",
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "string.double.single.winged"
        },
        "4": {
          "name": "variable.other.readwrite.js"
        },
        "5": {
          "name": "string.double.single.winged"
        }
      }
    },
    "winged-attr-if": {
      "match": "(cond)(=)([\"])(.*?)([\"])",
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "string.double.single.winged"
        },
        "4": {
          "patterns": [
            {
              "include": "source.js"
            }
          ]
        },
        "5": {
          "name": "string.double.single.winged"
        }
      }
    },
    "winged-attr-for-key": {
      "match": "(key)(=)([\"'])(.*?)([\"'])",
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "string.double.single.winged"
        },
        "4": {
          "name": "string.quoted.double.winged"
        },
        "5": {
          "name": "string.double.single.winged"
        }
      }
    },
    "logic-node-end": {
      "match": "</For>|</Plugin>|<Else />|</Slot>|</If>",
      "name": "keyword.control.winged"
    },
    "subview": {
      "begin": "<[A-Z][a-z]**",
      "end": ">",
      "name": "support.function.winged",
      "patterns": [
        {
          "include": "#subview-attr"
        },
        {
          "include": "#subview-attr-complement"
        }
      ]
    },
    "subview-end": {
      "match": "</([A-Z][a-z]*)*>",
      "name": "support.function.winged"
    },
    "subview-attr": {
      "match": "(\\S+)(=)([\"])(.*?)([\"])",
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "string.double.single.winged"
        },
        "4": {
          "name": "string.double.single.winged",
          "patterns": [
            {
              "include": "#data-point"
            }
          ]
        },
        "5": {
          "name": "string.double.single.winged"
        }
      }
    },
    "subview-attr-complement": {
      "match": "(\\S+)(=)({{.*?}})",
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "2": {
          "name": "punctuation.separator.key-value.html"
        },
        "3": {
          "name": "variable.other.constant.winged",
          "patterns": [
            {
              "include": "#data-point"
            }
          ]
        }
      }
    },
    "event-binder-param-br": {
      "begin": "\\({",
      "end": "}\\)",
      "name": "keyword.winged",
      "patterns": [
        {
          "include": "#data-point-number"
        },
        {
          "include": "#data-point-string"
        },
        {
          "include": "#data-point-variable"
        },
        {
          "include": "#data-point-operator"
        }
      ]
    },
    "event-binder": {
      "begin": "(@)(bind|catch):([a-zA-Z0-9]*)(=)(\")",
      "beginCaptures": {
        "1": {
          "name": "keyword.winged"
        },
        "2": {
          "name": "keyword.winged"
        },
        "3": {
          "name": "entity.other.attribute-name.html"
        },
        "5": {
          "name": "string.quoted.double.html"
        }
      },
      "end": "(\")",
      "endCaptures": {
        "1": {
          "name": "string.quoted.double.html"
        }
      },
      "name": "punctuation.separator.key-value.html",
      "patterns": [
        {
          "include": "source.js"
        }
      ]
    },
    "event-binder-complement": {
      "begin": ":([a-zA-Z0-9]*)(=)(\")",
      "beginCaptures": {
        "1": {
          "name": "entity.other.attribute-name.html"
        },
        "3": {
          "name": "string.quoted.double.html"
        }
      },
      "end": "(\")",
      "endCaptures": {
        "1": {
          "name": "string.quoted.double.html"
        }
      },
      "name": "punctuation.separator.key-value.html",
      "patterns": [
        {
          "include": "source.js"
        }
      ]
    },
    "comment": {
      "match": "<!--(.*?)-->",
      "name": "comment.block.winged"
    },
    "comment-br": {
      "begin": "<!--",
      "end": "-->",
      "name": "comment.block.winged",
      "patterns": [
        {
          "include": "#comment-basic"
        },
        {
          "include": "#comment-logic-node"
        },
        {
          "include": "#comment-logic-node-end"
        },
        {
          "include": "#comment-data-point"
        },
        {
          "include": "#comment-subview-end"
        }
      ]
    },
    "comment-basic": {
      "match": "<(.*?)>",
      "name": "comment.block.winged"
    },
    "comment-logic-node": {
      "match": "(.*?)<(For|If|Else|Elif|Slot|Plugin)(.*?)>",
      "name": "comment.block.winged"
    },
    "comment-logic-node-end": {
      "match": "(.*?)(</For>|</Plugin>|<Else />|</Slot>|</If>)",
      "name": "comment.block.winged"
    },
    "comment-data-point": {
      "match": "(.*?){{(.*?)}}",
      "name": "comment.block.winged"
    },
    "comment-subview-end": {
      "match": "(.*?)</([A-Z][a-z]*)*>",
      "name": "comment.block.winged"
    },
    "method-binder": {
      "begin": "(@)(method):([a-zA-Z0-9]*)(=)(\")",
      "beginCaptures": {
        "1": {
          "name": "keyword.winged"
        },
        "2": {
          "name": "keyword.winged"
        },
        "3": {
          "name": "entity.other.attribute-name.html"
        },
        "5": {
          "name": "string.quoted.double.html"
        }
      },
      "end": "(\")",
      "endCaptures": {
        "1": {
          "name": "string.quoted.double.html"
        }
      },
      "name": "punctuation.separator.key-value.html",
      "patterns": [
        {
          "include": "source.js"
        }
      ]
    },
    "ref-binder": {
      "begin": "(@)(ref)(=)(\")",
      "beginCaptures": {
        "1": {
          "name": "keyword.winged"
        },
        "2": {
          "name": "keyword.winged"
        },
        "4": {
          "name": "string.quoted.double.html"
        }
      },
      "end": "(\")",
      "endCaptures": {
        "1": {
          "name": "string.quoted.double.html"
        }
      },
      "name": "text.html.derivative",
      "patterns": [
        {
          "include": "source.js"
        }
      ]
    },
    "value-binder": {
      "begin": "(@)(value)(=)(\")",
      "beginCaptures": {
        "1": {
          "name": "keyword.winged"
        },
        "2": {
          "name": "keyword.winged"
        },
        "4": {
          "name": "string.quoted.double.html"
        }
      },
      "end": "(\")",
      "endCaptures": {
        "1": {
          "name": "string.quoted.double.html"
        }
      },
      "name": "text.html.derivative",
      "patterns": [
        {
          "include": "source.js"
        }
      ]
    }
  }
}