-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqasm.tmLanguage.json
More file actions
74 lines (74 loc) · 2.44 KB
/
qasm.tmLanguage.json
File metadata and controls
74 lines (74 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{
"scopeName": "source.openqasm",
"name": "OpenQASM",
"patterns": [
{ "include": "#comments" },
{ "include": "#strings" },
{ "include": "#numbers" },
{ "include": "#keywords" },
{ "include": "#types" },
{ "include": "#gates" },
{ "include": "#preprocessor" },
{ "include": "#identifiers" }
],
"repository": {
"comments": {
"patterns": [
{ "name": "comment.line.double-slash.qasm", "match": "//.*$" },
{ "name": "comment.block.qasm", "begin": "/\\*", "end": "\\*/", "patterns": [{ "include": "#comments" }] }
]
},
"strings": {
"patterns": [
{ "name": "string.quoted.double.qasm", "begin": "\"", "end": "\"", "patterns": [{ "name": "constant.character.escape.qasm", "match": "\\\\." }] }
]
},
"numbers": {
"patterns": [
{ "name": "constant.numeric.qasm", "match": "\\b(?:(?:0x[0-9A-Fa-f]+)|(?:\\d+\\.\\d*|\\d*\\.\\d+|\\d+)(?:[eE][\\+\\-]?\\d+)?)\\b" }
]
},
"keywords": {
"patterns": [
{
"name": "keyword.control.qasm",
"match": "\\b(?:if|else|for|while|return|break|continue)\\b"
},
{
"name": "keyword.declaration.qasm",
"match": "\\b(?:openqasm|include|gate|opaque|measure|barrier|reset|creg|qreg|const|let|def|defcal|cal|delay|box|end|input|output|qubit|bit|angle|bool|int|float|complex)\\b"
},
{
"name": "keyword.operator.qasm",
"match": "\\b(?:sin|cos|tan|exp|ln|sqrt|pow|mod|pi)\\b"
}
]
},
"types": {
"patterns": [
{ "name": "storage.type.qasm", "match": "\\b(?:qubit|bit|int|uint|float|angle|bool|complex)\\b" },
{ "name": "storage.modifier.qasm", "match": "\\b(?:const|let|input|output)\\b" }
]
},
"gates": {
"patterns": [
{
"name": "support.function.gate.qasm",
"match": "\\b(?:u3|u2|u1|u|x|y|z|h|s|sdg|t|tdg|rx|ry|rz|p|cp|crx|cry|crz|cu1|cu2|cu3|cx|cy|cz|swap|cswap|ccx|ccz|ecr|id|measure|barrier|delay)\\b"
}
]
},
"preprocessor": {
"patterns": [
{ "name": "meta.preprocessor.qasm", "match": "\\b(?:openqasm\\s+\\d+(?:\\.\\d+)?|include\\s+\"[^\"]+\")" }
]
},
"identifiers": {
"patterns": [
{ "name": "variable.other.readwrite.qasm", "match": "\\b([A-Za-z_][A-Za-z0-9_]*)\\b" }
]
}
},
"fileTypes": ["qasm", "qasm2", "qasm3"],
"uuid": "ad3a6f4f-7884-4c9a-9d1b-000000000001"
}