{
  "fileTypes": [
    "dt"
  ],
  "name": "Diet",
  "scopeName": "source.diet",
  "patterns": [
    {
      "comment": "Doctype declaration.",
      "match": "^(!!!|doctype)(\\s*[a-zA-Z0-9-_]+)?",
      "name": "entity.name.tag.sgml.doctype.diet"
    },
    {
      "begin": "^(\\s*)//-",
      "comment": "Unbuffered (diet-only) comments.",
      "end": "^(?!(\\1\\s)|\\s*$)",
      "name": "comment.unbuffered.block.diet"
    },
    {
      "begin": "^(\\s*)//",
      "comment": "Buffered (html) comments.",
      "end": "^(?!(\\1\\s)|\\s*$)",
      "name": "string.comment.buffered.block.diet",
      "patterns": [
        {
          "captures": {
            "1": {
              "name": "invalid.illegal.comment.comment.block.diet"
            }
          },
          "comment": "Buffered comments inside buffered comments will generate invalid html.",
          "match": "^\\s*(//)(?!-)",
          "name": "string.comment.buffered.block.diet"
        }
      ]
    },
    {
      "begin": "^(\\s*)-$",
      "comment": "Unbuffered code block.",
      "end": "^(?!(\\1\\s)|\\s*$)",
      "name": "source.d",
      "patterns": [
        {
          "include": "source.d"
        }
      ]
    },
    {
      "begin": "^(\\s*)(script)(?=[.#(\\s])((?![^\\n]*type=)|(?=[^\\n]*(text|application)/javascript))",
      "beginCaptures": {
        "2": {
          "name": "entity.name.tag.script.diet"
        }
      },
      "comment": "Script tag with JavaScript code.",
      "end": "^(?!(\\1\\s)|\\s*$)",
      "name": "meta.tag.other",
      "patterns": [
        {
          "begin": "\\G(?=\\()",
          "end": "$",
          "name": "stuff.tag.script.diet",
          "patterns": [
            {
              "include": "#tag_attributes"
            }
          ]
        },
        {
          "begin": "\\G(?=[.#])",
          "end": "$",
          "name": "stuff.tag.script.diet",
          "patterns": [
            {
              "include": "#complete_tag"
            }
          ]
        },
        {
          "include": "source.d"
        }
      ]
    },
    {
      "begin": "^(\\s*)(style)((\\.$)|(?=[.#(].*\\.$))",
      "beginCaptures": {
        "2": {
          "name": "entity.name.tag.script.diet"
        }
      },
      "comment": "Style tag with CSS code.",
      "end": "^(?!(\\1\\s)|\\s*$)",
      "name": "meta.tag.other",
      "patterns": [
        {
          "begin": "\\G(?=\\()",
          "end": "$",
          "name": "stuff.tag.style.diet",
          "patterns": [
            {
              "include": "#tag_attributes"
            }
          ]
        },
        {
          "begin": "\\G(?=[.#])",
          "end": "$",
          "name": "stuff.tag.style.diet",
          "patterns": [
            {
              "include": "#complete_tag"
            }
          ]
        },
        {
          "include": "source.css"
        }
      ]
    },
    {
      "begin": "^(\\s*):(sass)(?=\\(|$)",
      "beginCaptures": {
        "2": {
          "name": "constant.language.name.sass.filter.diet"
        }
      },
      "end": "^(?!(\\1\\s)|\\s*$)",
      "name": "source.sass.filter.diet",
      "patterns": [
        {
          "include": "#tag_attributes"
        },
        {
          "include": "source.sass"
        }
      ]
    },
    {
      "begin": "^(\\s*):(less)(?=\\(|$)",
      "beginCaptures": {
        "2": {
          "name": "constant.language.name.less.filter.diet"
        }
      },
      "end": "^(?!(\\1\\s)|\\s*$)",
      "name": "source.less.filter.diet",
      "patterns": [
        {
          "include": "#tag_attributes"
        },
        {
          "include": "source.less"
        }
      ]
    },
    {
      "begin": "^(\\s*):(stylus)(?=\\(|$)",
      "beginCaptures": {
        "2": {
          "name": "constant.language.name.stylus.filter.diet"
        }
      },
      "end": "^(?!(\\1\\s)|\\s*$)",
      "patterns": [
        {
          "include": "#tag_attributes"
        },
        {
          "include": "source.stylus"
        }
      ]
    },
    {
      "begin": "^(\\s*):(coffee(-?script)?)(?=\\(|$)",
      "beginCaptures": {
        "2": {
          "name": "constant.language.name.coffeescript.filter.diet"
        }
      },
      "end": "^(?!(\\1\\s)|\\s*$)",
      "name": "source.coffeescript.filter.diet",
      "patterns": [
        {
          "include": "#tag_attributes"
        },
        {
          "include": "source.coffee"
        }
      ]
    },
    {
      "begin": "^(\\s*)((:(?=.))|(:$))",
      "beginCaptures": {
        "4": {
          "name": "invalid.illegal.empty.generic.filter.diet"
        }
      },
      "comment": "Generic diet filter.",
      "end": "^(?!(\\1\\s)|\\s*$)",
      "patterns": [
        {
          "begin": "\\G(?<=:)(?=.)",
          "end": "$",
          "name": "name.generic.filter.diet",
          "patterns": [
            {
              "match": "\\G\\(",
              "name": "invalid.illegal.name.generic.filter.diet"
            },
            {
              "match": "[\\w-]",
              "name": "constant.language.name.generic.filter.diet"
            },
            {
              "include": "#tag_attributes"
            },
            {
              "match": "\\W",
              "name": "invalid.illegal.name.generic.filter.diet"
            }
          ]
        }
      ]
    },
    {
      "begin": "^\\s*",
      "comment": "All constructs that generally span a single line starting with any number of white-spaces.",
      "end": "$",
      "patterns": [
        {
          "include": "#inline_diet"
        },
        {
          "include": "#blocks_and_includes"
        },
        {
          "include": "#unbuffered_code"
        },
        {
          "include": "#flow_control"
        },
        {
          "begin": "\\|",
          "comment": "Tag pipe text line.",
          "end": "$",
          "name": "text.block.pipe.diet",
          "patterns": [
            {
              "include": "#inline_diet"
            },
            {
              "include": "#embedded_html"
            },
            {
              "include": "#html_entity"
            },
            {
              "include": "#interpolated_value"
            },
            {
              "include": "#interpolated_error"
            }
          ]
        },
        {
          "include": "#printed_expression"
        },
        {
          "begin": "\\G(?=(#[^\\{\\w-])|[^\\w.#])",
          "comment": "Line starting with characters incompatible with tag name/id/class is standalone text.",
          "end": "$",
          "patterns": [
            {
              "begin": "</?(?=[!#])",
              "end": ">|$",
              "patterns": [
                {
                  "include": "#inline_diet"
                },
                {
                  "include": "#interpolated_value"
                },
                {
                  "include": "#interpolated_error"
                }
              ]
            },
            {
              "include": "#inline_diet"
            },
            {
              "include": "#embedded_html"
            },
            {
              "include": "#html_entity"
            },
            {
              "include": "#interpolated_value"
            },
            {
              "include": "#interpolated_error"
            }
          ]
        },
        {
          "include": "#complete_tag"
        }
      ]
    }
  ],
  "repository": {
    "blocks_and_includes": {
      "captures": {
        "1": {
          "name": "storage.type.import.include.diet"
        },
        "4": {
          "name": "entity.name.type.include.diet"
        }
      },
      "comment": "Template blocks and includes.",
      "match": "(extends|include|block( (append|prepend))?)\\s+(.*)$",
      "name": "meta.first-class.diet"
    },
    "complete_tag": {
      "begin": "(?=[\\w.#])|(:\\s*)",
      "end": "(\\.?$)|(?=:.)",
      "patterns": [
        {
          "include": "#blocks_and_includes"
        },
        {
          "include": "#unbuffered_code"
        },
        {
          "include": "#flow_control"
        },
        {
          "match": "(?<=:)\\w.*$",
          "name": "invalid.illegal.name.tag.diet"
        },
        {
          "include": "#tag_name"
        },
        {
          "include": "#tag_id"
        },
        {
          "include": "#tag_classes"
        },
        {
          "include": "#tag_attributes"
        },
        {
          "captures": {
            "2": {
              "name": "invalid.illegal.end.tag.diet"
            },
            "4": {
              "name": "invalid.illegal.end.tag.diet"
            }
          },
          "match": "((\\.)\\s+$)|((:)\\s*$)"
        },
        {
          "include": "#printed_expression"
        },
        {
          "include": "#tag_text"
        }
      ]
    },
    "embedded_html": {
      "begin": "(?=<[^>]*>)",
      "end": "$|(?=>)",
      "name": "html",
      "patterns": [
        {
          "include": "text.html.basic"
        },
        {
          "include": "#interpolated_value"
        },
        {
          "include": "#interpolated_error"
        }
      ]
    },
    "html_entity": {
      "patterns": [
        {
          "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
          "name": "constant.character.entity.html.text.diet"
        },
        {
          "match": "[<>&]",
          "name": "invalid.illegal.html_entity.text.diet"
        }
      ]
    },
    "inline_diet": {
      "begin": "(?<!\\\\)(#\\[)",
      "captures": {
        "1": {
          "name": "entity.name.function.diet"
        },
        "2": {
          "name": "entity.name.function.diet"
        }
      },
      "end": "(\\])",
      "name": "inline.diet",
      "patterns": [
        {
          "include": "#inline_diet"
        },
        {
          "begin": "(?<!\\])(?=[\\w.#])|(:\\s*)",
          "end": "(?=\\]|(:.)|=|\\s)",
          "name": "tag.inline.diet",
          "patterns": [
            {
              "include": "#tag_name"
            },
            {
              "include": "#tag_id"
            },
            {
              "include": "#tag_classes"
            },
            {
              "include": "#tag_attributes"
            },
            {
              "include": "#inline_diet"
            },
            {
              "match": "\\[",
              "name": "invalid.illegal.tag.diet"
            }
          ]
        },
        {
          "include": "#unbuffered_code"
        },
        {
          "include": "#printed_expression"
        },
        {
          "match": "\\[",
          "name": "invalid.illegal.tag.diet"
        },
        {
          "include": "#inline_diet_text"
        }
      ]
    },
    "inline_diet_text": {
      "begin": null,
      "end": "(?=\\])",
      "patterns": [
        {
          "begin": "\\[",
          "end": "\\]",
          "patterns": [
            {
              "include": "#inline_diet_text"
            }
          ]
        },
        {
          "include": "#inline_diet"
        },
        {
          "include": "#embedded_html"
        },
        {
          "include": "#html_entity"
        },
        {
          "include": "#interpolated_value"
        },
        {
          "include": "#interpolated_error"
        }
      ]
    },
    "interpolated_error": {
      "match": "(?<!\\\\)[#!]\\{(?=[^}]*$)",
      "name": "invalid.illegal.tag.diet"
    },
    "interpolated_value": {
      "begin": "(?<!\\\\)[#!]\\{(?=.*?\\})",
      "end": "\\}",
      "name": "string.interpolated.diet",
      "patterns": [
        {
          "match": "{",
          "name": "invalid.illegal.tag.diet"
        },
        {
          "include": "source.d"
        }
      ]
    },
    "d_braces": {
      "begin": "\\{",
      "end": "\\}",
      "patterns": [
        {
          "include": "#d_braces"
        },
        {
          "include": "source.d"
        }
      ]
    },
    "d_brackets": {
      "begin": "\\[",
      "end": "\\]",
      "patterns": [
        {
          "include": "#d_brackets"
        },
        {
          "include": "source.d"
        }
      ]
    },
    "d_parens": {
      "begin": "\\(",
      "end": "\\)",
      "patterns": [
        {
          "include": "#d_parens"
        },
        {
          "include": "source.d"
        }
      ]
    },
    "printed_expression": {
      "begin": "(!?\\=)\\s*",
      "captures": {
        "1": {
          "name": "constant"
        }
      },
      "end": "(?=\\])|$",
      "name": "source.d",
      "patterns": [
        {
          "include": "#d_brackets"
        },
        {
          "include": "source.d"
        }
      ]
    },
    "string": {
      "begin": "(['\"])",
      "end": "(?<!\\\\)\\1",
      "name": "string.quoted.diet",
      "patterns": [
        {
          "match": "\\\\((x[0-9a-fA-F]{2})|(u[0-9]{4})|.)",
          "name": "constant.character.quoted.diet"
        },
        {
          "include": "#interpolated_value"
        },
        {
          "include": "#interpolated_error"
        }
      ]
    },
    "tag_attribute_name": {
      "captures": {
        "1": {
          "name": "entity.other.attribute-name.tag.diet"
        }
      },
      "match": "([^\\s(),=/!]+)\\s*"
    },
    "tag_attribute_name_paren": {
      "begin": "\\(\\s*",
      "end": "\\)",
      "name": "entity.other.attribute-name.tag.diet",
      "patterns": [
        {
          "include": "#tag_attribute_name_paren"
        },
        {
          "include": "#tag_attribute_name"
        }
      ]
    },
    "tag_attributes": {
      "begin": "(\\(\\s*)",
      "captures": {
        "1": {
          "name": "constant.name.attribute.tag.diet"
        }
      },
      "end": "(\\))",
      "name": "meta.tag.other",
      "patterns": [
        {
          "include": "#tag_attribute_name_paren"
        },
        {
          "include": "#tag_attribute_name"
        },
        {
          "match": "!(?!=)",
          "name": "invalid.illegal.tag.diet"
        },
        {
          "begin": "=\\s*",
          "end": "$|(?=,|(?:\\s+[^!%&*-+~|<>:?/])|\\))",
          "name": "attribute_value",
          "patterns": [
            {
              "include": "#string"
            },
            {
              "include": "#d_parens"
            },
            {
              "include": "#d_brackets"
            },
            {
              "include": "#d_braces"
            },
            {
              "include": "source.d"
            }
          ]
        },
        {
          "begin": "(?<=[%&*-+~|<>:?/])\\s+",
          "end": "$|(?=,|(?:\\s+[^!%&*-+~|<>:?/])|\\))",
          "name": "attribute_value2",
          "patterns": [
            {
              "include": "#string"
            },
            {
              "include": "#d_parens"
            },
            {
              "include": "#d_brackets"
            },
            {
              "include": "#d_braces"
            },
            {
              "include": "source.d"
            }
          ]
        }
      ]
    },
    "tag_classes": {
      "captures": {
        "1": {
          "name": "invalid.illegal.tag.diet"
        }
      },
      "match": "\\.([^\\w-])?[\\w-]*",
      "name": "constant.other.class.diet"
    },
    "tag_id": {
      "match": "#[\\w-]+",
      "name": "constant.other.id.diet"
    },
    "tag_name": {
      "begin": "([#!]\\{(?=.*?\\}))|(\\w(([\\w:-]+[\\w-])|([\\w-]*)))",
      "end": "(\\G(?<!\\5[^\\w-]))|\\}|$",
      "name": "meta.tag.other entity.name.tag.diet",
      "patterns": [
        {
          "begin": "\\G(?<=\\{)",
          "end": "(?=\\})",
          "name": "meta.tag.other entity.name.tag.diet",
          "patterns": [
            {
              "match": "{",
              "name": "invalid.illegal.tag.diet"
            },
            {
              "include": "source.d"
            }
          ]
        }
      ]
    },
    "tag_text": {
      "begin": "(?=.)",
      "end": "$",
      "patterns": [
        {
          "include": "#inline_diet"
        },
        {
          "include": "#embedded_html"
        },
        {
          "include": "#html_entity"
        },
        {
          "include": "#interpolated_value"
        },
        {
          "include": "#interpolated_error"
        }
      ]
    },
    "unbuffered_code": {
      "begin": "(-|(([a-zA-Z0-9_]+)\\s+=))",
      "beginCaptures": {
        "3": {
          "name": "variable.parameter.javascript.embedded.diet"
        }
      },
      "comment": "name = function() {}",
      "end": "(?=\\])|$",
      "name": "source.d",
      "patterns": [
        {
          "include": "#d_brackets"
        },
        {
          "include": "source.d"
        }
      ]
    }
  },
  "uuid": "eee6ba25-6ac2-4f7e-9c70-cddf2bd3448b",
  "version": "https://github.com/davidrios/jade-tmbundle/commit/7c1304aa5a0d916a93fd296d3dd994219ecdc90f",
  "comment": "Original jade syntax modified for diet features"
}
