{
  "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
  "name": "Iris",
  "scopeName": "source.iris",
  "fileTypes": ["iris"],
  "patterns": [
    { "include": "#comments" },
    { "include": "#strings" },
    { "include": "#keywords" },
    { "include": "#constants" },
    { "include": "#numbers" },
    { "include": "#functions" },
    { "include": "#types" },
    { "include": "#operators" }
  ],
  "repository": {
    "comments": {
      "patterns": [
        {
          "name": "comment.line.double-slash.iris",
          "match": "//.*?$"
        },
        {
          "name": "comment.block.iris",
          "begin": "/\\*",
          "end": "\\*/",
          "beginCaptures": {
            "0": {
              "name": "punctuation.definition.comment.begin.iris"
            }
          },
          "endCaptures": {
            "0": {
              "name": "punctuation.definition.comment.end.iris"
            }
          }
        }
      ]
    },
    "strings": {
      "patterns": [
        {
          "name": "string.quoted.double.iris",
          "begin": "\"",
          "end": "\"",
          "patterns": [
            {
              "name": "constant.character.escape.iris",
              "match": "\\\\."
            }
          ]
        },
        {
          "name": "string.quoted.single.iris",
          "begin": "'",
          "end": "'",
          "patterns": [
            {
              "name": "constant.character.escape.iris",
              "match": "\\\\."
            }
          ]
        },
        {
          "name": "string.interpolated.template.iris",
          "begin": "`",
          "end": "`",
          "patterns": [
            {
              "name": "constant.character.escape.iris",
              "match": "\\\\."
            },
            {
              "name": "meta.interpolation.iris",
              "begin": "\\$\\{",
              "end": "\\}",
              "patterns": [
                { "include": "#keywords" },
                { "include": "#constants" },
                { "include": "#numbers" },
                { "include": "#functions" },
                { "include": "#types" },
                { "include": "#operators" },
                { "include": "#strings" }
              ]
            }
          ]
        }
      ]
    },
    "keywords": {
      "patterns": [
        {
          "name": "keyword.control.iris",
          "match": "\\b(async|await|break|case|catch|const|continue|default|else|finally|for|function|if|let|new|return|switch|throw|try|var|while)\\b"
        },
        {
          "name": "storage.type.iris",
          "match": "\\b(class|extends|static)\\b"
        }
      ]
    },
    "constants": {
      "patterns": [
        {
          "name": "constant.language.boolean.iris",
          "match": "\\b(true|false)\\b"
        },
        {
          "name": "constant.language.null.iris",
          "match": "\\b(null|undefined)\\b"
        },
        {
          "name": "support.constant.iris",
          "match": "\\b(Promise|String|Object|Array|console)\\b"
        }
      ]
    },
    "numbers": {
      "patterns": [
        {
          "name": "constant.numeric.iris",
          "match": "\\b\\d+(\\.\\d+)?\\b"
        }
      ]
    },
    "functions": {
      "patterns": [
        {
          "name": "entity.name.function.iris",
          "match": "\\b[A-Za-z_][A-Za-z0-9_]*(?=\\s*:\\s*function\\b)"
        },
        {
          "name": "entity.name.function.iris",
          "match": "\\b[A-Za-z_][A-Za-z0-9_]*(?=\\s*\\()"
        },
        {
          "name": "support.function.member.iris",
          "match": "(?<=\\.)[A-Za-z_][A-Za-z0-9_]*\\b"
        }
      ]
    },
    "types": {
      "patterns": [
        {
          "name": "entity.name.type.iris",
          "match": "\\bIris\\b"
        }
      ]
    },
    "operators": {
      "patterns": [
        {
          "name": "keyword.operator.iris",
          "match": "(=>|===|!==|==|!=|<=|>=|&&|\\|\\||[+\\-*/%=<>!])"
        },
        {
          "name": "punctuation.separator.iris",
          "match": "[;,.:]"
        }
      ]
    }
  }
}
