{
  "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
  "name": "qsharp",
  "fileTypes": ["qs"],
  "patterns": [
    {
      "include": "#comments"
    },
    {
      "include": "#keywords"
    },
    {
      "include": "#operators"
    },
    {
      "include": "#types"
    },
    {
      "include": "#constants"
    },
    {
      "include": "#strings"
    }
  ],
  "repository": {
    "comments": {
      "patterns": [
        {
          "name": "comment.line.double-slash",
          "match": "\\/\\/.*$"
        },
        {
          "name": "comment.documentation",
          "match": "\\/\\/\\/.*$"
        }
      ]
    },
    "keywords": {
      "patterns": [
        {
          "name": "keyword.control.qsharp",
          "match": "\\b(use|borrow|mutable|let|set|if|elif|else|repeat|until|fixup|for|in|while|return|fail|within|apply)\\b"
        },
        {
          "name": "keyword.other.qsharp",
          "match": "\\b(namespace|open|as|internal|newtype|operation|function|body|(a|A)djoint|(c|C)ontrolled|self|auto|distribute|invert|intrinsic)\\b"
        }
      ]
    },
    "operators": {
      "patterns": [
        {
          "name": "keyword.other.operator.qsharp",
          "match": "\\b(not|and|or)\\b|\\b(w/)|(=)|(!)|(<)|(>)|(\\+)|(-)|(\\*)|(\\/)|(\\^)|(%)|(\\|)|(\\&\\&\\&)|(\\~\\~\\~)|(\\.\\.\\.)|(\\.\\.)|(\\?)"
        }
      ]
    },
    "types": {
      "patterns": [
        {
          "name": "storage.type.qsharp",
          "match": "\\b(Int|BigInt|Double|Bool|Qubit|Pauli|Result|Range|String|Unit|Ctl|Adj|is)\\b"
        }
      ]
    },
    "constants": {
      "patterns": [
        {
          "name": "constant.language.qsharp",
          "match": "\\b(true|false|Pauli(I|X|Y|Z))\\b"
        },
        {
          "name": "constant.other.result.qsharp",
          "match": "\\b(One|Zero)\\b"
        }
      ]
    },
    "strings": {
      "patterns": [
        {
          "name": "string.quoted.double.qsharp",
          "begin": "(\\$|)\"",
          "end": "\"",
          "patterns": [
            {
              "name": "constant.character.escape.qsharp",
              "match": "\\\\."
            }
          ]
        }
      ]
    }
  },
  "scopeName": "source.qsharp"
}
