|
6 | 6 | {
|
7 | 7 | "include": "#comments"
|
8 | 8 | },
|
| 9 | + { |
| 10 | + "include": "#functions" |
| 11 | + }, |
9 | 12 | {
|
10 | 13 | "include": "#keywords"
|
11 | 14 | },
|
|
20 | 23 | },
|
21 | 24 | {
|
22 | 25 | "include": "#strings"
|
| 26 | + }, |
| 27 | + { |
| 28 | + "include": "#variables" |
23 | 29 | }
|
24 | 30 | ],
|
25 | 31 | "repository": {
|
|
35 | 41 | }
|
36 | 42 | ]
|
37 | 43 | },
|
| 44 | + "functions": { |
| 45 | + "patterns": [ |
| 46 | + { |
| 47 | + "comment": "function definition", |
| 48 | + "name": "meta.function.definition.qsharp", |
| 49 | + "begin": "\\b(function)\\s+([A-Za-z0-9_]+)(\\()", |
| 50 | + "beginCaptures": { |
| 51 | + "1": { |
| 52 | + "name": "keyword.other.qsharp" |
| 53 | + }, |
| 54 | + "2": { |
| 55 | + "name": "entity.name.function.qsharp" |
| 56 | + }, |
| 57 | + "3": { |
| 58 | + "name": "punctuation.brackets.round.qsharp" |
| 59 | + } |
| 60 | + }, |
| 61 | + "end": "\\)", |
| 62 | + "endCaptures": { |
| 63 | + "0": { |
| 64 | + "name": "punctuation.brackets.round.qsharp" |
| 65 | + } |
| 66 | + }, |
| 67 | + "patterns": [ |
| 68 | + { |
| 69 | + "include": "#comments" |
| 70 | + }, |
| 71 | + { |
| 72 | + "include": "#functions" |
| 73 | + }, |
| 74 | + { |
| 75 | + "include": "#keywords" |
| 76 | + }, |
| 77 | + { |
| 78 | + "include": "#operators" |
| 79 | + }, |
| 80 | + { |
| 81 | + "include": "#types" |
| 82 | + }, |
| 83 | + { |
| 84 | + "include": "#constants" |
| 85 | + }, |
| 86 | + { |
| 87 | + "include": "#strings" |
| 88 | + }, |
| 89 | + { |
| 90 | + "include": "#variables" |
| 91 | + } |
| 92 | + ] |
| 93 | + }, |
| 94 | + { |
| 95 | + "comment": "function calls", |
| 96 | + "name": "meta.function.call.qsharp", |
| 97 | + "begin": "\\b(?<!@)([A-Za-z0-9_]+)(\\()", |
| 98 | + "beginCaptures": { |
| 99 | + "1": { |
| 100 | + "name": "entity.name.function.qsharp" |
| 101 | + }, |
| 102 | + "2": { |
| 103 | + "name": "punctuation.brackets.round.qsharp" |
| 104 | + } |
| 105 | + }, |
| 106 | + "end": "\\)", |
| 107 | + "endCaptures": { |
| 108 | + "0": { |
| 109 | + "name": "punctuation.brackets.round.qsharp" |
| 110 | + } |
| 111 | + }, |
| 112 | + "patterns": [ |
| 113 | + { |
| 114 | + "include": "#comments" |
| 115 | + }, |
| 116 | + { |
| 117 | + "include": "#functions" |
| 118 | + }, |
| 119 | + { |
| 120 | + "include": "#keywords" |
| 121 | + }, |
| 122 | + { |
| 123 | + "include": "#operators" |
| 124 | + }, |
| 125 | + { |
| 126 | + "include": "#types" |
| 127 | + }, |
| 128 | + { |
| 129 | + "include": "#constants" |
| 130 | + }, |
| 131 | + { |
| 132 | + "include": "#strings" |
| 133 | + }, |
| 134 | + { |
| 135 | + "include": "#variables" |
| 136 | + } |
| 137 | + ] |
| 138 | + } |
| 139 | + ] |
| 140 | + }, |
38 | 141 | "keywords": {
|
39 | 142 | "patterns": [
|
40 | 143 | {
|
|
72 | 175 | {
|
73 | 176 | "name": "constant.other.result.qsharp",
|
74 | 177 | "match": "\\b(One|Zero)\\b"
|
| 178 | + }, |
| 179 | + { |
| 180 | + "comment": "integers and decimals", |
| 181 | + "name": "constant.numeric.qsharp", |
| 182 | + "match": "\\b[\\d_]*\\.?[\\d_]\\b" |
75 | 183 | }
|
76 | 184 | ]
|
77 | 185 | },
|
|
89 | 197 | ]
|
90 | 198 | }
|
91 | 199 | ]
|
| 200 | + }, |
| 201 | + "variables": { |
| 202 | + "patterns": [ |
| 203 | + { |
| 204 | + "name": "variable.other.qsharp", |
| 205 | + "match": "\\b(?<!@)[A-Za-z0-9_]+\\b" |
| 206 | + } |
| 207 | + ] |
92 | 208 | }
|
93 | 209 | },
|
94 | 210 | "scopeName": "source.qsharp"
|
|
0 commit comments