|
| 1 | +{ |
| 2 | + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", |
| 3 | + "name": "io", |
| 4 | + "scopeName": "source.io", |
| 5 | + "uuid": "3607cc0a-09af-4d1b-bd2d-87fb32c777cd", |
| 6 | + "fileTypes": [".io"], |
| 7 | + "patterns": [ |
| 8 | + { |
| 9 | + "include": "#comments" |
| 10 | + }, |
| 11 | + { |
| 12 | + "include": "#brackets" |
| 13 | + }, |
| 14 | + { |
| 15 | + "include": "#supports" |
| 16 | + }, |
| 17 | + { |
| 18 | + "include": "#keywords" |
| 19 | + }, |
| 20 | + { |
| 21 | + "include": "#strings" |
| 22 | + } |
| 23 | + ], |
| 24 | + "repository": { |
| 25 | + "constants": { |
| 26 | + "patterns": [ |
| 27 | + { |
| 28 | + "name": "constant.numeric.io", |
| 29 | + "match": "\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\b" |
| 30 | + } |
| 31 | + ] |
| 32 | + }, |
| 33 | + "comments": { |
| 34 | + "patterns": [ |
| 35 | + { |
| 36 | + "name": "comment.line.io", |
| 37 | + "match": "(#|//).*" |
| 38 | + }, |
| 39 | + { |
| 40 | + "name": "comment.block.io", |
| 41 | + "begin": "/\\*", |
| 42 | + "beginCaptures": { |
| 43 | + "0": { |
| 44 | + "name": "unctuation.definition.comment.begin.io" |
| 45 | + } |
| 46 | + }, |
| 47 | + "end": "\\*/", |
| 48 | + "endCaptures": { |
| 49 | + "0": { |
| 50 | + "name": "unctuation.definition.comment.end.io" |
| 51 | + } |
| 52 | + } |
| 53 | + } |
| 54 | + ] |
| 55 | + }, |
| 56 | + "brackets": { |
| 57 | + "patterns": [ |
| 58 | + { |
| 59 | + "begin": "\\[", |
| 60 | + "end": "\\]|(?=\\*/)", |
| 61 | + "patterns": [ |
| 62 | + { |
| 63 | + "include": "#brackets" |
| 64 | + } |
| 65 | + ] |
| 66 | + } |
| 67 | + ] |
| 68 | + }, |
| 69 | + "supports": { |
| 70 | + "patterns": [ |
| 71 | + { |
| 72 | + "include": "#class-identifier" |
| 73 | + }, |
| 74 | + { |
| 75 | + "include": "#function-identifier" |
| 76 | + }, |
| 77 | + { |
| 78 | + "name": "support.class.io", |
| 79 | + "match": "\\b(Object|File|Date|URL|Socket|WebRequest|HttpServer|HttpRequestHandler|Server|Thread|Scheduler)\\b" |
| 80 | + }, |
| 81 | + { |
| 82 | + "name": "support.class.import.io", |
| 83 | + "match": "\\b(Importer)\\b" |
| 84 | + }, |
| 85 | + { |
| 86 | + "name": "support.class.error.io", |
| 87 | + "match": "\\b(Exception|Error)\\b" |
| 88 | + }, |
| 89 | + { |
| 90 | + "name": "support.class.test.io", |
| 91 | + "match": "\\b(Suite|Spec|Matcher)\\b" |
| 92 | + }, |
| 93 | + { |
| 94 | + "name": "support.class.type.io", |
| 95 | + "match": "\\b(String|Number|Dictionary|Directory|List|Sequence|Range)\\b" |
| 96 | + }, |
| 97 | + { |
| 98 | + "name": "support.type.io", |
| 99 | + "match": "nil|null|true|false" |
| 100 | + }, |
| 101 | + { |
| 102 | + "name": "support.function.io", |
| 103 | + "match": "\\b(method|block|interpolate|at|atPut|atInsert|with|println|print|run|do)\\b" |
| 104 | + }, |
| 105 | + { |
| 106 | + "name": "support.function.error.io", |
| 107 | + "match": "\\b(raise)\\b" |
| 108 | + }, |
| 109 | + { |
| 110 | + "name": "support.function.test.io", |
| 111 | + "match": "\\b(it|describe|expect|toBe|toEqual|toBeTrue|toBeFalse|toContain|toBeString|toBeNil|toThrowWithMessage|toThrowWithType|toThrow|toHaveSlot|toHaveBeenCalled|toHaveBeenCalledWith|beforeEach|afterEach)\\b" |
| 112 | + }, |
| 113 | + { |
| 114 | + "name": "support.function.conditional.io", |
| 115 | + "match": "\\b(ifTrue|ifFalse|ifTrueIfFalse)\\b" |
| 116 | + }, |
| 117 | + { |
| 118 | + "name": "support.function.casting.io", |
| 119 | + "match": "\\b(asCharacter|asString|asNumber|asMutable|asLowercase|asUppercase|asXML|makeFirstCharacterUppercase|lowercase|uppercase)\\b" |
| 120 | + }, |
| 121 | + { |
| 122 | + "name": "support.function.slot.io", |
| 123 | + "match": "\\b(getSlot|setSlot|addSlot|hasSlot|slotNames)\\b" |
| 124 | + }, |
| 125 | + { |
| 126 | + "name": "support.function.proto.io", |
| 127 | + "match": "\\b(setProtos|setProto|prependProto|appendProto)\\b" |
| 128 | + }, |
| 129 | + { |
| 130 | + "name": "support.function.math.io", |
| 131 | + "match": "\\b(log|log10|mathematical|sqrt|exp|abs|sin|cos|tan|asin|acos|atan|round|floor|ceil|max|min)\\b" |
| 132 | + }, |
| 133 | + { |
| 134 | + "name": "support.function.relational.io", |
| 135 | + "match": "\\b(super)\\b" |
| 136 | + }, |
| 137 | + { |
| 138 | + "name": "support.function.compound.io", |
| 139 | + "match": "\\b(encoding|code|start|fetch|connect|now|year|month|day|hour|minute|second|close|exists|pop|push|join|first|last|keys|hasKey|values|reduce|reverse|reverseReduce|unique|elementsWithName|setItemType|itemType|attributes|sort|sortBy|serialize|slice|split|select|selectInPlace|size|setSize|indexOf|insertAt|flatten|list|vector|map|asyncSend|futureSend|resend|append|appendSeq|beginsWithSeq|betweenSeq|message|openForUpdating|createThread|streamTo|streamWrite|streamReadNextChunk|readBuffer|detect|wait|contains|containsSeq|remove|removeAt|removeFirst|removeLast|setPort|setHostName|argsEvaluatedIn|setPath|doFile|doRelativeFile|writeln|write|getScope|setScope|forwardTo)\\b" |
| 140 | + } |
| 141 | + ] |
| 142 | + }, |
| 143 | + "keywords": { |
| 144 | + "patterns": [ |
| 145 | + { |
| 146 | + "name": "keyword.control.io", |
| 147 | + "match": "\\b(call|clone|init|return|yield|type|sender)\\b" |
| 148 | + }, |
| 149 | + { |
| 150 | + "name": "keyword.control.error.io", |
| 151 | + "match": "\\b(try|catch|pass)\\b" |
| 152 | + }, |
| 153 | + { |
| 154 | + "name": "keyword.control.test.io", |
| 155 | + "match": "\\b(suite|spec|specs)\\b" |
| 156 | + }, |
| 157 | + { |
| 158 | + "name": "keyword.control.conditional.io", |
| 159 | + "match": "\\b(if|then|else)\\b" |
| 160 | + }, |
| 161 | + { |
| 162 | + "name": "keyword.control.relational.io", |
| 163 | + "match": "\\b(self)\\b" |
| 164 | + }, |
| 165 | + { |
| 166 | + "name": "keyword.control.loop.io", |
| 167 | + "match": "\\b(to|loop|repeat|redo|retry|while|for|foreach|reverseForeach|break|continue|pause|resume)\\b" |
| 168 | + }, |
| 169 | + { |
| 170 | + "name": "keyword.operator.assignment.comparison.io", |
| 171 | + "match": "==|!=" |
| 172 | + }, |
| 173 | + { |
| 174 | + "name": "keyword.operator.assignment.relational.io", |
| 175 | + "match": ">=|<=|>|<" |
| 176 | + }, |
| 177 | + { |
| 178 | + "name": "keyword.operator.assignment.logical.io", |
| 179 | + "match": "&&|\\!|\\|\\|" |
| 180 | + }, |
| 181 | + { |
| 182 | + "name": "keyword.operator.assignment.io", |
| 183 | + "match": "\\=|::=|:=" |
| 184 | + }, |
| 185 | + { |
| 186 | + "name": "keyword.operator.bitwise.io", |
| 187 | + "match": "\\&|~|\\^|\\|" |
| 188 | + }, |
| 189 | + { |
| 190 | + "name": "keyword.operator.decrement.io", |
| 191 | + "match": "--" |
| 192 | + }, |
| 193 | + { |
| 194 | + "name": "keyword.operator.increment.io", |
| 195 | + "match": "\\+\\+" |
| 196 | + }, |
| 197 | + { |
| 198 | + "name": "keyword.operator.arithmetic.io", |
| 199 | + "match": "%|\\*|/|-|\\+" |
| 200 | + }, |
| 201 | + { |
| 202 | + "name": "keyword.operator.concat.io", |
| 203 | + "match": "\\.\\." |
| 204 | + }, |
| 205 | + { |
| 206 | + "name": "keyword.operator.word.io", |
| 207 | + "match": "\b(and|or|not|yes|no)\b" |
| 208 | + } |
| 209 | + ] |
| 210 | + }, |
| 211 | + "strings": { |
| 212 | + "name": "string.quoted.io", |
| 213 | + "patterns": [ |
| 214 | + { |
| 215 | + "include": "#string-quoted-double" |
| 216 | + }, |
| 217 | + { |
| 218 | + "include": "#string-quoted-triple" |
| 219 | + } |
| 220 | + ] |
| 221 | + }, |
| 222 | + "class-identifier": { |
| 223 | + "patterns": [ |
| 224 | + { |
| 225 | + "name": "support.class.identifier.io", |
| 226 | + "match": "\\b([[:upper:]](\\w+)?)\\b" |
| 227 | + } |
| 228 | + ] |
| 229 | + }, |
| 230 | + "function-identifier": { |
| 231 | + "patterns": [ |
| 232 | + { |
| 233 | + "name": "support.function.identifier.io", |
| 234 | + "match": "\\b(\\w+(?=\\s*\\(\\)))\\b" |
| 235 | + } |
| 236 | + ] |
| 237 | + }, |
| 238 | + "string-quoted-double": { |
| 239 | + "name": "string.quoted.double.io", |
| 240 | + "begin": "\"", |
| 241 | + "beginCaptures": { |
| 242 | + "0": { |
| 243 | + "name": "punctuation.definition.string.begin.io" |
| 244 | + } |
| 245 | + }, |
| 246 | + "end": "\"", |
| 247 | + "endCaptures": { |
| 248 | + "0": { |
| 249 | + "name": "punctuation.definition.string.end.io" |
| 250 | + } |
| 251 | + }, |
| 252 | + "patterns": [ |
| 253 | + { |
| 254 | + "include": "#string-interpolate" |
| 255 | + }, |
| 256 | + { |
| 257 | + "include": "#string-escape" |
| 258 | + } |
| 259 | + ] |
| 260 | + }, |
| 261 | + "string-quoted-triple": { |
| 262 | + "name": "string.triple.double.io", |
| 263 | + "begin": "\"\"\"", |
| 264 | + "beginCaptures": { |
| 265 | + "0": { |
| 266 | + "name": "punctuation.definition.string.begin.io" |
| 267 | + } |
| 268 | + }, |
| 269 | + "end": "\"\"\"", |
| 270 | + "endCaptures": { |
| 271 | + "0": { |
| 272 | + "name": "punctuation.definition.string.end.io" |
| 273 | + } |
| 274 | + }, |
| 275 | + "patterns": [ |
| 276 | + { |
| 277 | + "include": "#string-interpolate" |
| 278 | + }, |
| 279 | + { |
| 280 | + "include": "#string-escape" |
| 281 | + } |
| 282 | + ] |
| 283 | + }, |
| 284 | + "string-escape": { |
| 285 | + "patterns": [ |
| 286 | + { |
| 287 | + "name": "constant.character.escape.io", |
| 288 | + "match": "\\\\." |
| 289 | + } |
| 290 | + ] |
| 291 | + }, |
| 292 | + "string-interpolate": { |
| 293 | + "name": "meta.interpolate.expression.io", |
| 294 | + "begin": "#\\{", |
| 295 | + "beginCaptures": { |
| 296 | + "0": { |
| 297 | + "name": "punctuation.definition.expression.interpolate.begin.js" |
| 298 | + } |
| 299 | + }, |
| 300 | + "end": "\\}", |
| 301 | + "endCaptures": { |
| 302 | + "0": { |
| 303 | + "name": "punctuation.definition.expression.interpolate.end.js" |
| 304 | + } |
| 305 | + }, |
| 306 | + "patterns": [ |
| 307 | + { |
| 308 | + "name": "variable.interpolate", |
| 309 | + "match": ".+(?=\\})" |
| 310 | + } |
| 311 | + ] |
| 312 | + } |
| 313 | + } |
| 314 | +} |
0 commit comments