| 1 |
{ |
| 2 |
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", |
| 3 |
"scopeName": "source.tasl", |
| 4 |
"name": "tasl", |
| 5 |
"fileTypes": ["tasl"], |
| 6 |
"patterns": [ |
| 7 |
{ |
| 8 |
"include": "#comment" |
| 9 |
}, |
| 10 |
{ |
| 11 |
"include": "#namespace" |
| 12 |
}, |
| 13 |
{ |
| 14 |
"include": "#type" |
| 15 |
}, |
| 16 |
{ |
| 17 |
"include": "#class" |
| 18 |
}, |
| 19 |
{ |
| 20 |
"include": "#edge" |
| 21 |
} |
| 22 |
], |
| 23 |
"repository": { |
| 24 |
"comment": { |
| 25 |
"match": "(#).*$", |
| 26 |
"name": "comment.line.number-sign.tasl", |
| 27 |
"captures": { |
| 28 |
"1": { |
| 29 |
"name": "punctuation.definition.comment.tasl" |
| 30 |
} |
| 31 |
} |
| 32 |
}, |
| 33 |
"namespace": { |
| 34 |
"match": "(?:^\\s*)(namespace)\\b(.*)", |
| 35 |
"captures": { |
| 36 |
"1": { |
| 37 |
"name": "keyword.control.tasl.namespace" |
| 38 |
}, |
| 39 |
"2": { |
| 40 |
"patterns": [ |
| 41 |
{ |
| 42 |
"include": "#namespaceURI" |
| 43 |
}, |
| 44 |
{ |
| 45 |
"match": "[a-zA-Z][a-zA-Z0-9]*\\b", |
| 46 |
"name": "entity.name" |
| 47 |
} |
| 48 |
] |
| 49 |
} |
| 50 |
} |
| 51 |
}, |
| 52 |
"type": { |
| 53 |
"begin": "(?:^\\s*)(type)\\b", |
| 54 |
"beginCaptures": { |
| 55 |
"1": { |
| 56 |
"name": "keyword.control.tasl.type" |
| 57 |
} |
| 58 |
}, |
| 59 |
"end": "$", |
| 60 |
"patterns": [ |
| 61 |
{ |
| 62 |
"include": "#expression" |
| 63 |
} |
| 64 |
] |
| 65 |
}, |
| 66 |
"class": { |
| 67 |
"begin": "(?:^\\s*)(class)\\b", |
| 68 |
"beginCaptures": { |
| 69 |
"1": { |
| 70 |
"name": "keyword.control.tasl.class" |
| 71 |
} |
| 72 |
}, |
| 73 |
"end": "$", |
| 74 |
"patterns": [ |
| 75 |
{ |
| 76 |
"include": "#key" |
| 77 |
}, |
| 78 |
{ |
| 79 |
"include": "#export" |
| 80 |
}, |
| 81 |
{ |
| 82 |
"include": "#expression" |
| 83 |
} |
| 84 |
] |
| 85 |
}, |
| 86 |
"edge": { |
| 87 |
"begin": "(?:^\\s*)(edge)\\b", |
| 88 |
"beginCaptures": { |
| 89 |
"1": { |
| 90 |
"name": "keyword.control.tasl.edge" |
| 91 |
} |
| 92 |
}, |
| 93 |
"end": "$", |
| 94 |
"patterns": [ |
| 95 |
{ |
| 96 |
"include": "#key" |
| 97 |
}, |
| 98 |
{ |
| 99 |
"include": "#export" |
| 100 |
}, |
| 101 |
{ |
| 102 |
"match": "=/", |
| 103 |
"name": "punctuation.separator.tasl.edge.source" |
| 104 |
}, |
| 105 |
{ |
| 106 |
"match": "/=>", |
| 107 |
"name": "punctuation.separator.tasl.edge.target" |
| 108 |
}, |
| 109 |
{ |
| 110 |
"match": "=>", |
| 111 |
"name": "punctuation.separator.tasl.edge" |
| 112 |
}, |
| 113 |
{ |
| 114 |
"include": "#expression" |
| 115 |
} |
| 116 |
] |
| 117 |
}, |
| 118 |
"export": { |
| 119 |
"match": "::", |
| 120 |
"name": "keyword.operator.tasl.export" |
| 121 |
}, |
| 122 |
"expression": { |
| 123 |
"patterns": [ |
| 124 |
{ |
| 125 |
"include": "#literal" |
| 126 |
}, |
| 127 |
{ |
| 128 |
"include": "#uri" |
| 129 |
}, |
| 130 |
{ |
| 131 |
"include": "#product" |
| 132 |
}, |
| 133 |
{ |
| 134 |
"include": "#coproduct" |
| 135 |
}, |
| 136 |
{ |
| 137 |
"include": "#reference" |
| 138 |
}, |
| 139 |
{ |
| 140 |
"include": "#optional" |
| 141 |
}, |
| 142 |
{ |
| 143 |
"include": "#identifier" |
| 144 |
} |
| 145 |
] |
| 146 |
}, |
| 147 |
"literal": { |
| 148 |
"patterns": [ |
| 149 |
{ |
| 150 |
"include": "#datatype" |
| 151 |
} |
| 152 |
] |
| 153 |
}, |
| 154 |
"uri": { |
| 155 |
"match": "<>", |
| 156 |
"name": "variable.other.constant" |
| 157 |
}, |
| 158 |
"product": { |
| 159 |
"begin": "{", |
| 160 |
"beginCaptures": { |
| 161 |
"0": { |
| 162 |
"name": "punctuation.definition.block.tasl.product" |
| 163 |
} |
| 164 |
}, |
| 165 |
"end": "}", |
| 166 |
"endCaptures": { |
| 167 |
"0": { |
| 168 |
"name": "punctuation.definition.block.tasl.product" |
| 169 |
} |
| 170 |
}, |
| 171 |
"patterns": [ |
| 172 |
{ |
| 173 |
"include": "#comment" |
| 174 |
}, |
| 175 |
{ |
| 176 |
"include": "#term" |
| 177 |
}, |
| 178 |
{ |
| 179 |
"include": "#component" |
| 180 |
} |
| 181 |
] |
| 182 |
}, |
| 183 |
"component": { |
| 184 |
"begin": "->", |
| 185 |
"end": "$", |
| 186 |
"beginCaptures": { |
| 187 |
"0": { |
| 188 |
"name": "punctuation.separator.tasl.component" |
| 189 |
} |
| 190 |
}, |
| 191 |
"patterns": [ |
| 192 |
{ |
| 193 |
"include": "#expression" |
| 194 |
} |
| 195 |
] |
| 196 |
}, |
| 197 |
"coproduct": { |
| 198 |
"begin": "\\[", |
| 199 |
"beginCaptures": { |
| 200 |
"0": { |
| 201 |
"name": "punctuation.definition.block.tasl.coproduct" |
| 202 |
} |
| 203 |
}, |
| 204 |
"end": "\\]", |
| 205 |
"endCaptures": { |
| 206 |
"0": { |
| 207 |
"name": "punctuation.definition.block.tasl.coproduct" |
| 208 |
} |
| 209 |
}, |
| 210 |
"patterns": [ |
| 211 |
{ |
| 212 |
"include": "#comment" |
| 213 |
}, |
| 214 |
{ |
| 215 |
"include": "#term" |
| 216 |
}, |
| 217 |
{ |
| 218 |
"include": "#option" |
| 219 |
} |
| 220 |
] |
| 221 |
}, |
| 222 |
"option": { |
| 223 |
"begin": "<-", |
| 224 |
"end": "$", |
| 225 |
"beginCaptures": { |
| 226 |
"0": { |
| 227 |
"name": "punctuation.separator.tasl.option" |
| 228 |
} |
| 229 |
}, |
| 230 |
"patterns": [ |
| 231 |
{ |
| 232 |
"include": "#expression" |
| 233 |
} |
| 234 |
] |
| 235 |
}, |
| 236 |
"reference": { |
| 237 |
"match": "(\\*)\\s*(.*)", |
| 238 |
"captures": { |
| 239 |
"1": { |
| 240 |
"name": "markup.bold keyword.operator" |
| 241 |
}, |
| 242 |
"2": { |
| 243 |
"patterns": [ |
| 244 |
{ |
| 245 |
"include": "#key" |
| 246 |
} |
| 247 |
] |
| 248 |
} |
| 249 |
} |
| 250 |
}, |
| 251 |
"identifier": { |
| 252 |
"match": "([a-zA-Z][a-zA-Z0-9]*)\\b", |
| 253 |
"captures": { |
| 254 |
"1": { |
| 255 |
"name": "variable" |
| 256 |
} |
| 257 |
} |
| 258 |
}, |
| 259 |
"optional": { |
| 260 |
"begin": "\\?", |
| 261 |
"beginCaptures": { |
| 262 |
"0": { |
| 263 |
"name": "keyword.operator" |
| 264 |
} |
| 265 |
}, |
| 266 |
"end": "$", |
| 267 |
"patterns": [ |
| 268 |
{ |
| 269 |
"include": "#expression" |
| 270 |
} |
| 271 |
] |
| 272 |
}, |
| 273 |
"namespaceURI": { |
| 274 |
"match": "[a-z]+:[a-zA-Z0-9-._~:\\/?#\\[\\]@!$&'()*+,;%=]+", |
| 275 |
"name": "markup.underline.link" |
| 276 |
}, |
| 277 |
"key": { |
| 278 |
"match": "[a-zA-Z][a-zA-Z0-9]*:(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})+", |
| 279 |
"name": "markup.bold entity.name.class" |
| 280 |
}, |
| 281 |
"datatype": { |
| 282 |
"match": "[a-zA-Z][a-zA-Z0-9]*:(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})+", |
| 283 |
"name": "string.regexp" |
| 284 |
}, |
| 285 |
"term": { |
| 286 |
"match": "[a-zA-Z][a-zA-Z0-9]*:(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})+", |
| 287 |
"name": "entity.other.tasl.key" |
| 288 |
} |
| 289 |
} |
| 290 |
} |
| 291 |
|