{ "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "openqasm", "scopeName": "source.openqasm", "fileTypes": ["qasm", "inc"], "patterns": [ { "include": "#comments" }, { "include": "#keywords" }, { "include": "#operators" }, { "include": "#types" }, { "include": "#constants" }, { "include": "#strings" }, { "include": "#brackets" }, { "include": "#variables" } ], "repository": { "comments": { "patterns": [ { "name": "comment.line.double-slash", "match": "//.*$" }, { "name": "comment.block", "begin": "/\\*", "end": "\\*/" } ] }, "keywords": { "patterns": [ { "name": "keyword.control.openqasm", "match": "(?)|(\\+)|(-)|(\\*)|(\\*\\*)|(\\/)|(\\^)|(%)|(\\|)|(\\&)|(\\&\\&)|(\\~)|(\\|\\|)|(<<)|(>>)" } ] }, "types": { "patterns": [ { "name": "storage.type.openqasm", "match": "\\b(angle|bit|bool|complex|duration|float|int|stretch|uint|qreg|creg)(\\[[a-zA-Z_][a-zA-Z0-9_]*\\])?\\b" } ] }, "constants": { "patterns": [ { "name": "constant.language.openqasm", "match": "\\b(true|false|theta|pi|θ|π|ℇ|τ|euler|tau|λ|lambda|φ|phi|@)\\b" }, { "comment": "integers and decimals", "name": "constant.numeric.openqasm", "match": "\\b[\\d_]*\\.?[\\d_](im|dt|ns|us|ms|s|)?\\b" } ] }, "strings": { "name": "string.quoted.double.openqasm", "begin": "\"", "end": "\"", "patterns": [ { "name": "constant.character.escape.openqasm", "match": "\\\\." } ] }, "brackets": { "patterns": [ { "name": "punctuation.bracket.openqasm", "match": "[\\[\\]\\(\\)\\{\\}]" } ] }, "variables": { "patterns": [ { "name": "variable.other.openqasm", "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\b" } ] } } }