{
  "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
  "name": "Neutron",
  "scopeName": "source.neutron",
  "fileTypes": ["nt"],
  "patterns": [
    { "include": "#comments" },
    { "include": "#tags" },
    { "include": "#strings" }
  ],
  "repository": {
    "comments": {
      "patterns": [
        {
          "name": "comment.line.double-slash.neutron",
          "match": "//.*?$"
        },
        {
          "name": "comment.block.neutron",
          "begin": "/\\*",
          "end": "\\*/",
          "beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.neutron" } },
          "endCaptures": { "0": { "name": "punctuation.definition.comment.end.neutron" } }
        }
      ]
    },
    "tags": {
      "patterns": [
        {
          "name": "meta.tag.opening.neutron",
          "begin": "(<)([A-Za-z_][A-Za-z0-9_-]*)",
          "beginCaptures": {
            "1": { "name": "punctuation.definition.tag.begin.neutron" },
            "2": { "name": "entity.name.tag.neutron" }
          },
          "end": "(/?>)",
          "endCaptures": {
            "1": { "name": "punctuation.definition.tag.end.neutron" }
          },
          "patterns": [
            { "include": "#attributes" }
          ]
        },
        {
          "name": "meta.tag.closing.neutron",
          "match": "(</)([A-Za-z_][A-Za-z0-9_-]*)(>)",
          "captures": {
            "1": { "name": "punctuation.definition.tag.begin.neutron" },
            "2": { "name": "entity.name.tag.neutron" },
            "3": { "name": "punctuation.definition.tag.end.neutron" }
          }
        }
      ]
    },
    "attributes": {
      "patterns": [
        {
          "name": "entity.other.attribute-name.neutron",
          "match": "[A-Za-z_][A-Za-z0-9_-]*(?==)"
        },
        {
          "name": "punctuation.separator.key-value.neutron",
          "match": "="
        },
        {
          "name": "string.quoted.double.neutron",
          "begin": "\"",
          "end": "\"",
          "patterns": [
            { "include": "#style-declaration" }
          ]
        }
      ]
    },
    "style-declaration": {
      "patterns": [
        {
          "name": "meta.style.property.neutron",
          "match": "([a-z-]+)(:)",
          "captures": {
            "1": { "name": "support.type.property-name.neutron" },
            "2": { "name": "punctuation.separator.key-value.neutron" }
          }
        },
        {
          "name": "constant.numeric.color.neutron",
          "match": "#[0-9A-Fa-f]{3,6}\\b"
        },
        {
          "name": "keyword.control.property-value.neutron",
          "match": "\\b(fill|center|start|end|auto|inherit|initial)\\b"
        },
        {
          "name": "constant.numeric.css.neutron",
          "match": "\\b\\d+(\\.\\d+)?(%|px|pt|em|rem)?\\b"
        },
        {
          "name": "punctuation.separator.property.neutron",
          "match": ";"
        }
      ]
    },
    "strings": {
      "patterns": [
        {
          "name": "string.quoted.single.neutron",
          "begin": "'",
          "end": "'",
          "patterns": [
            { "name": "constant.character.escape.neutron", "match": "\\\\." }
          ]
        }
      ]
    }
  }
}