| 1 |
{ |
| 2 |
"fileTypes": ["sol"], |
| 3 |
"name": "solidity", |
| 4 |
"patterns": [ |
| 5 |
{ |
| 6 |
"include": "#natspec" |
| 7 |
}, |
| 8 |
{ |
| 9 |
"include": "#comment" |
| 10 |
}, |
| 11 |
{ |
| 12 |
"include": "#operator" |
| 13 |
}, |
| 14 |
{ |
| 15 |
"include": "#global" |
| 16 |
}, |
| 17 |
{ |
| 18 |
"include": "#control" |
| 19 |
}, |
| 20 |
{ |
| 21 |
"include": "#constant" |
| 22 |
}, |
| 23 |
{ |
| 24 |
"include": "#primitive" |
| 25 |
}, |
| 26 |
{ |
| 27 |
"include": "#type-primitive" |
| 28 |
}, |
| 29 |
{ |
| 30 |
"include": "#type-modifier-extended-scope" |
| 31 |
}, |
| 32 |
{ |
| 33 |
"include": "#declaration" |
| 34 |
}, |
| 35 |
{ |
| 36 |
"include": "#function-call" |
| 37 |
}, |
| 38 |
{ |
| 39 |
"include": "#assembly" |
| 40 |
}, |
| 41 |
{ |
| 42 |
"include": "#punctuation" |
| 43 |
} |
| 44 |
], |
| 45 |
"repository": { |
| 46 |
"natspec": { |
| 47 |
"patterns": [ |
| 48 |
{ |
| 49 |
"begin": "/\\*\\*", |
| 50 |
"end": "\\*/", |
| 51 |
"name": "comment.block.documentation", |
| 52 |
"patterns": [ |
| 53 |
{ |
| 54 |
"include": "#natspec-tags" |
| 55 |
} |
| 56 |
] |
| 57 |
}, |
| 58 |
{ |
| 59 |
"begin": "///", |
| 60 |
"end": "$", |
| 61 |
"name": "comment.block.documentation", |
| 62 |
"patterns": [ |
| 63 |
{ |
| 64 |
"include": "#natspec-tags" |
| 65 |
} |
| 66 |
] |
| 67 |
} |
| 68 |
] |
| 69 |
}, |
| 70 |
"natspec-tags": { |
| 71 |
"patterns": [ |
| 72 |
{ |
| 73 |
"include": "#comment-todo" |
| 74 |
}, |
| 75 |
{ |
| 76 |
"include": "#natspec-tag-title" |
| 77 |
}, |
| 78 |
{ |
| 79 |
"include": "#natspec-tag-author" |
| 80 |
}, |
| 81 |
{ |
| 82 |
"include": "#natspec-tag-notice" |
| 83 |
}, |
| 84 |
{ |
| 85 |
"include": "#natspec-tag-dev" |
| 86 |
}, |
| 87 |
{ |
| 88 |
"include": "#natspec-tag-param" |
| 89 |
}, |
| 90 |
{ |
| 91 |
"include": "#natspec-tag-return" |
| 92 |
} |
| 93 |
] |
| 94 |
}, |
| 95 |
"natspec-tag-title": { |
| 96 |
"match": "(@title)\\b", |
| 97 |
"name": "storage.type.title.natspec" |
| 98 |
}, |
| 99 |
"natspec-tag-author": { |
| 100 |
"match": "(@author)\\b", |
| 101 |
"name": "storage.type.author.natspec" |
| 102 |
}, |
| 103 |
"natspec-tag-notice": { |
| 104 |
"match": "(@notice)\\b", |
| 105 |
"name": "storage.type.dev.natspec" |
| 106 |
}, |
| 107 |
"natspec-tag-dev": { |
| 108 |
"match": "(@dev)\\b", |
| 109 |
"name": "storage.type.dev.natspec" |
| 110 |
}, |
| 111 |
"natspec-tag-param": { |
| 112 |
"match": "(@param)(\\s+([A-Za-z_]\\w*))?\\b", |
| 113 |
"captures": { |
| 114 |
"1": { |
| 115 |
"name": "storage.type.param.natspec" |
| 116 |
}, |
| 117 |
"3": { |
| 118 |
"name": "variable.other.natspec" |
| 119 |
} |
| 120 |
} |
| 121 |
}, |
| 122 |
"natspec-tag-return": { |
| 123 |
"match": "(@return)(\\s+([A-Za-z_]\\w*))?\\b", |
| 124 |
"captures": { |
| 125 |
"1": { |
| 126 |
"name": "storage.type.return.natspec" |
| 127 |
}, |
| 128 |
"3": { |
| 129 |
"name": "variable.other.natspec" |
| 130 |
} |
| 131 |
} |
| 132 |
}, |
| 133 |
"comment": { |
| 134 |
"patterns": [ |
| 135 |
{ |
| 136 |
"include": "#comment-line" |
| 137 |
}, |
| 138 |
{ |
| 139 |
"include": "#comment-block" |
| 140 |
} |
| 141 |
] |
| 142 |
}, |
| 143 |
"comment-todo": { |
| 144 |
"match": "(?i)\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP|SUPPRESS|LINT|\\w+-disable|\\w+-suppress)\\b(?-i)", |
| 145 |
"name": "keyword.comment.todo" |
| 146 |
}, |
| 147 |
"comment-line": { |
| 148 |
"begin": "(?<!tp:)//", |
| 149 |
"end": "$", |
| 150 |
"name": "comment.line", |
| 151 |
"patterns": [ |
| 152 |
{ |
| 153 |
"include": "#comment-todo" |
| 154 |
} |
| 155 |
] |
| 156 |
}, |
| 157 |
"comment-block": { |
| 158 |
"begin": "/\\*", |
| 159 |
"end": "\\*/", |
| 160 |
"name": "comment.block", |
| 161 |
"patterns": [ |
| 162 |
{ |
| 163 |
"include": "#comment-todo" |
| 164 |
} |
| 165 |
] |
| 166 |
}, |
| 167 |
"operator": { |
| 168 |
"patterns": [ |
| 169 |
{ |
| 170 |
"include": "#operator-logic" |
| 171 |
}, |
| 172 |
{ |
| 173 |
"include": "#operator-mapping" |
| 174 |
}, |
| 175 |
{ |
| 176 |
"include": "#operator-arithmetic" |
| 177 |
}, |
| 178 |
{ |
| 179 |
"include": "#operator-binary" |
| 180 |
}, |
| 181 |
{ |
| 182 |
"include": "#operator-assignment" |
| 183 |
} |
| 184 |
] |
| 185 |
}, |
| 186 |
"operator-logic": { |
| 187 |
"match": "(==|\\!=|<(?!<)|<=|>(?!>)|>=|\\&\\&|\\|\\||\\:(?!=)|\\?|\\!)", |
| 188 |
"name": "keyword.operator.logic" |
| 189 |
}, |
| 190 |
"operator-mapping": { |
| 191 |
"match": "(=>)", |
| 192 |
"name": "keyword.operator.mapping" |
| 193 |
}, |
| 194 |
"operator-arithmetic": { |
| 195 |
"match": "(\\+|\\-|\\/|\\*)", |
| 196 |
"name": "keyword.operator.arithmetic" |
| 197 |
}, |
| 198 |
"operator-binary": { |
| 199 |
"match": "(\\^|\\&|\\||<<|>>)", |
| 200 |
"name": "keyword.operator.binary" |
| 201 |
}, |
| 202 |
"operator-assignment": { |
| 203 |
"match": "(\\:?=)", |
| 204 |
"name": "keyword.operator.assignment" |
| 205 |
}, |
| 206 |
"control": { |
| 207 |
"patterns": [ |
| 208 |
{ |
| 209 |
"include": "#control-flow" |
| 210 |
}, |
| 211 |
{ |
| 212 |
"include": "#control-using" |
| 213 |
}, |
| 214 |
{ |
| 215 |
"include": "#control-import" |
| 216 |
}, |
| 217 |
{ |
| 218 |
"include": "#control-pragma" |
| 219 |
}, |
| 220 |
{ |
| 221 |
"include": "#control-underscore" |
| 222 |
}, |
| 223 |
{ |
| 224 |
"include": "#control-unchecked" |
| 225 |
}, |
| 226 |
{ |
| 227 |
"include": "#control-other" |
| 228 |
} |
| 229 |
] |
| 230 |
}, |
| 231 |
"control-flow": { |
| 232 |
"patterns": [ |
| 233 |
{ |
| 234 |
"match": "\\b(if|else|for|while|do|break|continue|try|catch|finally|throw|return)\\b", |
| 235 |
"name": "keyword.control.flow" |
| 236 |
}, |
| 237 |
{ |
| 238 |
"begin": "\\b(returns)\\b", |
| 239 |
"beginCaptures": { |
| 240 |
"1": { |
| 241 |
"name": "keyword.control.flow.return" |
| 242 |
} |
| 243 |
}, |
| 244 |
"end": "(?=\\))", |
| 245 |
"patterns": [ |
| 246 |
{ |
| 247 |
"include": "#declaration-function-parameters" |
| 248 |
} |
| 249 |
] |
| 250 |
} |
| 251 |
] |
| 252 |
}, |
| 253 |
"control-using": { |
| 254 |
"patterns": [ |
| 255 |
{ |
| 256 |
"match": "\\b(using)\\b\\s+\\b([A-Za-z\\d_]+)\\b\\s+\\b(for)\\b\\s+\\b([A-Za-z\\d_]+)", |
| 257 |
"captures": { |
| 258 |
"1": { |
| 259 |
"name": "keyword.control.using" |
| 260 |
}, |
| 261 |
"2": { |
| 262 |
"name": "entity.name.type.library" |
| 263 |
}, |
| 264 |
"3": { |
| 265 |
"name": "keyword.control.for" |
| 266 |
}, |
| 267 |
"4": { |
| 268 |
"name": "entity.name.type" |
| 269 |
} |
| 270 |
} |
| 271 |
}, |
| 272 |
{ |
| 273 |
"match": "\\b(using)\\b", |
| 274 |
"name": "keyword.control.using" |
| 275 |
} |
| 276 |
] |
| 277 |
}, |
| 278 |
"control-import": { |
| 279 |
"patterns": [ |
| 280 |
{ |
| 281 |
"begin": "\\b(import)\\b", |
| 282 |
"beginCaptures": { |
| 283 |
"1": { |
| 284 |
"name": "keyword.control.import" |
| 285 |
} |
| 286 |
}, |
| 287 |
"end": "(?=\\;)", |
| 288 |
"patterns": [ |
| 289 |
{ |
| 290 |
"begin": "((?=\\{))", |
| 291 |
"end": "((?=\\}))", |
| 292 |
"patterns": [ |
| 293 |
{ |
| 294 |
"match": "\\b(\\w+)\\b", |
| 295 |
"name": "entity.name.type.interface" |
| 296 |
} |
| 297 |
] |
| 298 |
}, |
| 299 |
{ |
| 300 |
"match": "\\b(from)\\b", |
| 301 |
"name": "keyword.control.import.from" |
| 302 |
}, |
| 303 |
{ |
| 304 |
"include": "#string" |
| 305 |
}, |
| 306 |
{ |
| 307 |
"include": "#punctuation" |
| 308 |
} |
| 309 |
] |
| 310 |
}, |
| 311 |
{ |
| 312 |
"match": "\\b(import)\\b", |
| 313 |
"name": "keyword.control.import" |
| 314 |
} |
| 315 |
] |
| 316 |
}, |
| 317 |
"control-unchecked": { |
| 318 |
"match": "\\b(unchecked)\\b", |
| 319 |
"name": "keyword.control.unchecked" |
| 320 |
}, |
| 321 |
"control-pragma": { |
| 322 |
"match": "\\b(pragma)(?:\\s+([A-Za-z_]\\w+)\\s+([^\\s]+))?\\b", |
| 323 |
"captures": { |
| 324 |
"1": { |
| 325 |
"name": "keyword.control.pragma" |
| 326 |
}, |
| 327 |
"2": { |
| 328 |
"name": "entity.name.tag.pragma" |
| 329 |
}, |
| 330 |
"3": { |
| 331 |
"name": "constant.other.pragma" |
| 332 |
} |
| 333 |
} |
| 334 |
}, |
| 335 |
"control-underscore": { |
| 336 |
"match": "\\b(_)\\b", |
| 337 |
"name": "constant.other.underscore" |
| 338 |
}, |
| 339 |
"control-other": { |
| 340 |
"match": "\\b(new|delete|emit)\\b", |
| 341 |
"name": "keyword.control" |
| 342 |
}, |
| 343 |
"constant": { |
| 344 |
"patterns": [ |
| 345 |
{ |
| 346 |
"include": "#constant-boolean" |
| 347 |
}, |
| 348 |
{ |
| 349 |
"include": "#constant-time" |
| 350 |
}, |
| 351 |
{ |
| 352 |
"include": "#constant-currency" |
| 353 |
} |
| 354 |
] |
| 355 |
}, |
| 356 |
"constant-boolean": { |
| 357 |
"match": "\\b(true|false)\\b", |
| 358 |
"name": "constant.language.boolean" |
| 359 |
}, |
| 360 |
"constant-time": { |
| 361 |
"match": "\\b(seconds|minutes|hours|days|weeks|years)\\b", |
| 362 |
"name": "constant.language.time" |
| 363 |
}, |
| 364 |
"constant-currency": { |
| 365 |
"match": "\\b(ether|wei|gwei|finney|szabo)\\b", |
| 366 |
"name": "constant.language.currency" |
| 367 |
}, |
| 368 |
"number": { |
| 369 |
"patterns": [ |
| 370 |
{ |
| 371 |
"include": "#number-decimal" |
| 372 |
}, |
| 373 |
{ |
| 374 |
"include": "#number-hex" |
| 375 |
}, |
| 376 |
{ |
| 377 |
"include": "#number-scientific" |
| 378 |
} |
| 379 |
] |
| 380 |
}, |
| 381 |
"number-decimal": { |
| 382 |
"match": "\\b([0-9_]+(\\.[0-9_]+)?)\\b", |
| 383 |
"name": "constant.numeric.decimal" |
| 384 |
}, |
| 385 |
"number-hex": { |
| 386 |
"match": "\\b(0[xX][a-fA-F0-9]+)\\b", |
| 387 |
"name": "constant.numeric.hexadecimal" |
| 388 |
}, |
| 389 |
"number-scientific": { |
| 390 |
"match": "\\b(?:0\\.(?:0[1-9]|[1-9][0-9_]?)|[1-9][0-9_]*(?:\\.\\d{1,2})?)(?:e[+-]?[0-9_]+)?", |
| 391 |
"name": "constant.numeric.scientific" |
| 392 |
}, |
| 393 |
"string": { |
| 394 |
"patterns": [ |
| 395 |
{ |
| 396 |
"match": "\\\".*?\\\"", |
| 397 |
"name": "string.quoted.double" |
| 398 |
}, |
| 399 |
{ |
| 400 |
"match": "\\'.*?\\'", |
| 401 |
"name": "string.quoted.single" |
| 402 |
} |
| 403 |
] |
| 404 |
}, |
| 405 |
"primitive": { |
| 406 |
"patterns": [ |
| 407 |
{ |
| 408 |
"include": "#number-decimal" |
| 409 |
}, |
| 410 |
{ |
| 411 |
"include": "#number-hex" |
| 412 |
}, |
| 413 |
{ |
| 414 |
"include": "#number-scientific" |
| 415 |
}, |
| 416 |
{ |
| 417 |
"include": "#string" |
| 418 |
} |
| 419 |
] |
| 420 |
}, |
| 421 |
"type-primitive": { |
| 422 |
"patterns": [ |
| 423 |
{ |
| 424 |
"begin": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b(?:\\[\\])(\\()", |
| 425 |
"beginCaptures": { |
| 426 |
"1": { |
| 427 |
"name": "support.type.primitive" |
| 428 |
} |
| 429 |
}, |
| 430 |
"end": "(\\))", |
| 431 |
"patterns": [ |
| 432 |
{ |
| 433 |
"include": "#primitive" |
| 434 |
}, |
| 435 |
{ |
| 436 |
"include": "#punctuation" |
| 437 |
}, |
| 438 |
{ |
| 439 |
"include": "#global" |
| 440 |
}, |
| 441 |
{ |
| 442 |
"include": "#variable" |
| 443 |
} |
| 444 |
] |
| 445 |
}, |
| 446 |
{ |
| 447 |
"match": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b", |
| 448 |
"name": "support.type.primitive" |
| 449 |
} |
| 450 |
] |
| 451 |
}, |
| 452 |
"global": { |
| 453 |
"patterns": [ |
| 454 |
{ |
| 455 |
"include": "#global-variables" |
| 456 |
}, |
| 457 |
{ |
| 458 |
"include": "#global-functions" |
| 459 |
} |
| 460 |
] |
| 461 |
}, |
| 462 |
"global-variables": { |
| 463 |
"patterns": [ |
| 464 |
{ |
| 465 |
"match": "\\b(this)\\b", |
| 466 |
"name": "variable.language.this" |
| 467 |
}, |
| 468 |
{ |
| 469 |
"match": "\\b(super)\\b", |
| 470 |
"name": "variable.language.super" |
| 471 |
}, |
| 472 |
{ |
| 473 |
"match": "\\b(abi)\\b", |
| 474 |
"name": "variable.language.builtin.abi" |
| 475 |
}, |
| 476 |
{ |
| 477 |
"match": "\\b(msg\\.sender|msg|block|tx|now)\\b", |
| 478 |
"name": "variable.language.transaction" |
| 479 |
}, |
| 480 |
{ |
| 481 |
"match": "\\b(tx\\.origin|tx\\.gasprice|msg\\.data|msg\\.sig|msg\\.value)\\b", |
| 482 |
"name": "variable.language.transaction" |
| 483 |
} |
| 484 |
] |
| 485 |
}, |
| 486 |
"global-functions": { |
| 487 |
"patterns": [ |
| 488 |
{ |
| 489 |
"match": "\\b(require|assert|revert)\\b", |
| 490 |
"name": "keyword.control.exceptions" |
| 491 |
}, |
| 492 |
{ |
| 493 |
"match": "\\b(selfdestruct|suicide)\\b", |
| 494 |
"name": "keyword.control.contract" |
| 495 |
}, |
| 496 |
{ |
| 497 |
"match": "\\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\\b", |
| 498 |
"name": "support.function.math" |
| 499 |
}, |
| 500 |
{ |
| 501 |
"match": "\\b(unicode)\\b", |
| 502 |
"name": "support.function.string" |
| 503 |
}, |
| 504 |
{ |
| 505 |
"match": "\\b(blockhash|gasleft)\\b", |
| 506 |
"name": "variable.language.transaction" |
| 507 |
}, |
| 508 |
{ |
| 509 |
"match": "\\b(type)\\b", |
| 510 |
"name": "variable.language.type" |
| 511 |
} |
| 512 |
] |
| 513 |
}, |
| 514 |
"type-modifier-access": { |
| 515 |
"match": "\\b(internal|external|private|public)\\b", |
| 516 |
"name": "storage.type.modifier.access" |
| 517 |
}, |
| 518 |
"type-modifier-payable": { |
| 519 |
"match": "\\b(nonpayable|payable)\\b", |
| 520 |
"name": "storage.type.modifier.payable" |
| 521 |
}, |
| 522 |
"type-modifier-constant": { |
| 523 |
"match": "\\b(constant)\\b", |
| 524 |
"name": "storage.type.modifier.readonly" |
| 525 |
}, |
| 526 |
"type-modifier-immutable": { |
| 527 |
"match": "\\b(immutable)\\b", |
| 528 |
"name": "storage.type.modifier.readonly" |
| 529 |
}, |
| 530 |
"type-modifier-extended-scope": { |
| 531 |
"match": "\\b(pure|view|inherited|indexed|storage|memory|virtual|calldata|override|abstract)\\b", |
| 532 |
"name": "storage.type.modifier.extendedscope" |
| 533 |
}, |
| 534 |
"variable": { |
| 535 |
"patterns": [ |
| 536 |
{ |
| 537 |
"match": "\\b(\\_\\w+)\\b", |
| 538 |
"captures": { |
| 539 |
"1": { |
| 540 |
"name": "variable.parameter.function" |
| 541 |
} |
| 542 |
} |
| 543 |
}, |
| 544 |
{ |
| 545 |
"match": "(?:\\.)(\\w+)\\b", |
| 546 |
"captures": { |
| 547 |
"1": { |
| 548 |
"name": "support.variable.property" |
| 549 |
} |
| 550 |
} |
| 551 |
}, |
| 552 |
{ |
| 553 |
"match": "\\b(\\w+)\\b", |
| 554 |
"captures": { |
| 555 |
"1": { |
| 556 |
"name": "variable.parameter.other" |
| 557 |
} |
| 558 |
} |
| 559 |
} |
| 560 |
] |
| 561 |
}, |
| 562 |
"modifier-call": { |
| 563 |
"patterns": [ |
| 564 |
{ |
| 565 |
"include": "#function-call" |
| 566 |
}, |
| 567 |
{ |
| 568 |
"match": "\\b(\\w+)\\b", |
| 569 |
"name": "entity.name.function.modifier" |
| 570 |
} |
| 571 |
] |
| 572 |
}, |
| 573 |
"declaration": { |
| 574 |
"patterns": [ |
| 575 |
{ |
| 576 |
"include": "#declaration-contract" |
| 577 |
}, |
| 578 |
{ |
| 579 |
"include": "#declaration-interface" |
| 580 |
}, |
| 581 |
{ |
| 582 |
"include": "#declaration-library" |
| 583 |
}, |
| 584 |
{ |
| 585 |
"include": "#declaration-function" |
| 586 |
}, |
| 587 |
{ |
| 588 |
"include": "#declaration-modifier" |
| 589 |
}, |
| 590 |
{ |
| 591 |
"include": "#declaration-constructor" |
| 592 |
}, |
| 593 |
{ |
| 594 |
"include": "#declaration-event" |
| 595 |
}, |
| 596 |
{ |
| 597 |
"include": "#declaration-storage" |
| 598 |
}, |
| 599 |
{ |
| 600 |
"include": "#declaration-error" |
| 601 |
} |
| 602 |
] |
| 603 |
}, |
| 604 |
"declaration-storage-field": { |
| 605 |
"patterns": [ |
| 606 |
{ |
| 607 |
"include": "#comment" |
| 608 |
}, |
| 609 |
{ |
| 610 |
"include": "#control" |
| 611 |
}, |
| 612 |
{ |
| 613 |
"include": "#type-primitive" |
| 614 |
}, |
| 615 |
{ |
| 616 |
"include": "#type-modifier-access" |
| 617 |
}, |
| 618 |
{ |
| 619 |
"include": "#type-modifier-immutable" |
| 620 |
}, |
| 621 |
{ |
| 622 |
"include": "#type-modifier-extend-scope" |
| 623 |
}, |
| 624 |
{ |
| 625 |
"include": "#type-modifier-payable" |
| 626 |
}, |
| 627 |
{ |
| 628 |
"include": "#type-modifier-constant" |
| 629 |
}, |
| 630 |
{ |
| 631 |
"include": "#primitive" |
| 632 |
}, |
| 633 |
{ |
| 634 |
"include": "#constant" |
| 635 |
}, |
| 636 |
{ |
| 637 |
"include": "#operator" |
| 638 |
}, |
| 639 |
{ |
| 640 |
"include": "#punctuation" |
| 641 |
} |
| 642 |
] |
| 643 |
}, |
| 644 |
"declaration-storage": { |
| 645 |
"patterns": [ |
| 646 |
{ |
| 647 |
"include": "#declaration-storage-mapping" |
| 648 |
}, |
| 649 |
{ |
| 650 |
"include": "#declaration-struct" |
| 651 |
}, |
| 652 |
{ |
| 653 |
"include": "#declaration-enum" |
| 654 |
}, |
| 655 |
{ |
| 656 |
"include": "#declaration-storage-field" |
| 657 |
} |
| 658 |
] |
| 659 |
}, |
| 660 |
"declaration-contract": { |
| 661 |
"patterns": [ |
| 662 |
{ |
| 663 |
"begin": "\\b(contract)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", |
| 664 |
"end": "(?=\\{)", |
| 665 |
"beginCaptures": { |
| 666 |
"1": { |
| 667 |
"name": "storage.type.contract" |
| 668 |
}, |
| 669 |
"2": { |
| 670 |
"name": "entity.name.type.contract" |
| 671 |
}, |
| 672 |
"3": { |
| 673 |
"name": "storage.modifier.is" |
| 674 |
} |
| 675 |
}, |
| 676 |
"patterns": [ |
| 677 |
{ |
| 678 |
"match": "\\b(\\w+)\\b", |
| 679 |
"name": "entity.name.type.contract.extend" |
| 680 |
} |
| 681 |
] |
| 682 |
}, |
| 683 |
{ |
| 684 |
"match": "\\b(contract)(\\s+([A-Za-z_]\\w*))?\\b", |
| 685 |
"captures": { |
| 686 |
"1": { |
| 687 |
"name": "storage.type.contract" |
| 688 |
}, |
| 689 |
"2": { |
| 690 |
"name": "entity.name.type.contract" |
| 691 |
} |
| 692 |
} |
| 693 |
} |
| 694 |
] |
| 695 |
}, |
| 696 |
"declaration-interface": { |
| 697 |
"patterns": [ |
| 698 |
{ |
| 699 |
"begin": "\\b(interface)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", |
| 700 |
"end": "(?=\\{)", |
| 701 |
"beginCaptures": { |
| 702 |
"1": { |
| 703 |
"name": "storage.type.interface" |
| 704 |
}, |
| 705 |
"2": { |
| 706 |
"name": "entity.name.type.interface" |
| 707 |
}, |
| 708 |
"3": { |
| 709 |
"name": "storage.modifier.is" |
| 710 |
} |
| 711 |
}, |
| 712 |
"patterns": [ |
| 713 |
{ |
| 714 |
"match": "\\b(\\w+)\\b", |
| 715 |
"name": "entity.name.type.interface.extend" |
| 716 |
} |
| 717 |
] |
| 718 |
}, |
| 719 |
{ |
| 720 |
"match": "\\b(interface)(\\s+([A-Za-z_]\\w*))?\\b", |
| 721 |
"captures": { |
| 722 |
"1": { |
| 723 |
"name": "storage.type.interface" |
| 724 |
}, |
| 725 |
"2": { |
| 726 |
"name": "entity.name.type.interface" |
| 727 |
} |
| 728 |
} |
| 729 |
} |
| 730 |
] |
| 731 |
}, |
| 732 |
"declaration-library": { |
| 733 |
"match": "\\b(library)(\\s+([A-Za-z_]\\w*))?\\b", |
| 734 |
"captures": { |
| 735 |
"1": { |
| 736 |
"name": "storage.type.library" |
| 737 |
}, |
| 738 |
"3": { |
| 739 |
"name": "entity.name.type.library" |
| 740 |
} |
| 741 |
} |
| 742 |
}, |
| 743 |
"declaration-struct": { |
| 744 |
"patterns": [ |
| 745 |
{ |
| 746 |
"match": "\\b(struct)(\\s+([A-Za-z_]\\w*))?\\b", |
| 747 |
"captures": { |
| 748 |
"1": { |
| 749 |
"name": "storage.type.struct" |
| 750 |
}, |
| 751 |
"3": { |
| 752 |
"name": "entity.name.type.struct" |
| 753 |
} |
| 754 |
} |
| 755 |
}, |
| 756 |
{ |
| 757 |
"begin": "\\b(struct)\\b\\s*(\\w+)?\\b\\s*(?=\\{)", |
| 758 |
"beginCaptures": { |
| 759 |
"1": { |
| 760 |
"name": "storage.type.struct" |
| 761 |
}, |
| 762 |
"2": { |
| 763 |
"name": "entity.name.type.struct" |
| 764 |
} |
| 765 |
}, |
| 766 |
"end": "(?=\\})", |
| 767 |
"patterns": [ |
| 768 |
{ |
| 769 |
"include": "#type-primitive" |
| 770 |
}, |
| 771 |
{ |
| 772 |
"include": "#variable" |
| 773 |
}, |
| 774 |
{ |
| 775 |
"include": "#punctuation" |
| 776 |
}, |
| 777 |
{ |
| 778 |
"include": "#comment" |
| 779 |
} |
| 780 |
] |
| 781 |
} |
| 782 |
] |
| 783 |
}, |
| 784 |
"declaration-event": { |
| 785 |
"patterns": [ |
| 786 |
{ |
| 787 |
"begin": "\\b(event)\\b(?:\\s+(\\w+)\\b)?", |
| 788 |
"end": "(?=\\))", |
| 789 |
"beginCaptures": { |
| 790 |
"1": { |
| 791 |
"name": "storage.type.event" |
| 792 |
}, |
| 793 |
"2": { |
| 794 |
"name": "entity.name.type.event" |
| 795 |
} |
| 796 |
}, |
| 797 |
"patterns": [ |
| 798 |
{ |
| 799 |
"include": "#type-primitive" |
| 800 |
}, |
| 801 |
{ |
| 802 |
"match": "\\b(?:(indexed)\\s)?(\\w+)(?:,\\s*|)", |
| 803 |
"captures": { |
| 804 |
"1": { |
| 805 |
"name": "storage.type.modifier.indexed" |
| 806 |
}, |
| 807 |
"2": { |
| 808 |
"name": "variable.parameter.event" |
| 809 |
} |
| 810 |
} |
| 811 |
}, |
| 812 |
{ |
| 813 |
"include": "#punctuation" |
| 814 |
} |
| 815 |
] |
| 816 |
}, |
| 817 |
{ |
| 818 |
"match": "\\b(event)(\\s+([A-Za-z_]\\w*))?\\b", |
| 819 |
"captures": { |
| 820 |
"1": { |
| 821 |
"name": "storage.type.event" |
| 822 |
}, |
| 823 |
"3": { |
| 824 |
"name": "entity.name.type.event" |
| 825 |
} |
| 826 |
} |
| 827 |
} |
| 828 |
] |
| 829 |
}, |
| 830 |
"declaration-constructor": { |
| 831 |
"patterns": [ |
| 832 |
{ |
| 833 |
"begin": "\\b(constructor)\\b", |
| 834 |
"beginCaptures": { |
| 835 |
"1": { |
| 836 |
"name": "storage.type.constructor" |
| 837 |
} |
| 838 |
}, |
| 839 |
"end": "(?=\\{)", |
| 840 |
"patterns": [ |
| 841 |
{ |
| 842 |
"begin": "\\G\\s*(?=\\()", |
| 843 |
"end": "(?=\\))", |
| 844 |
"patterns": [ |
| 845 |
{ |
| 846 |
"include": "#declaration-function-parameters" |
| 847 |
} |
| 848 |
] |
| 849 |
}, |
| 850 |
{ |
| 851 |
"begin": "(?<=\\))", |
| 852 |
"end": "(?=\\{)", |
| 853 |
"patterns": [ |
| 854 |
{ |
| 855 |
"include": "#type-modifier-access" |
| 856 |
}, |
| 857 |
{ |
| 858 |
"include": "#function-call" |
| 859 |
} |
| 860 |
] |
| 861 |
} |
| 862 |
] |
| 863 |
}, |
| 864 |
{ |
| 865 |
"match": "\\b(constructor)\\b", |
| 866 |
"captures": { |
| 867 |
"1": { |
| 868 |
"name": "storage.type.constructor" |
| 869 |
} |
| 870 |
} |
| 871 |
} |
| 872 |
] |
| 873 |
}, |
| 874 |
"declaration-enum": { |
| 875 |
"patterns": [ |
| 876 |
{ |
| 877 |
"begin": "\\b(enum)\\s+(\\w+)\\b", |
| 878 |
"beginCaptures": { |
| 879 |
"1": { |
| 880 |
"name": "storage.type.enum" |
| 881 |
}, |
| 882 |
"2": { |
| 883 |
"name": "entity.name.type.enum" |
| 884 |
} |
| 885 |
}, |
| 886 |
"end": "(?=\\})", |
| 887 |
"patterns": [ |
| 888 |
{ |
| 889 |
"match": "\\b(\\w+)\\b", |
| 890 |
"name": "variable.other.enummember" |
| 891 |
}, |
| 892 |
{ |
| 893 |
"include": "#punctuation" |
| 894 |
} |
| 895 |
] |
| 896 |
}, |
| 897 |
{ |
| 898 |
"match": "\\b(enum)(\\s+([A-Za-z_]\\w*))?\\b", |
| 899 |
"captures": { |
| 900 |
"1": { |
| 901 |
"name": "storage.type.enum" |
| 902 |
}, |
| 903 |
"3": { |
| 904 |
"name": "entity.name.type.enum" |
| 905 |
} |
| 906 |
} |
| 907 |
} |
| 908 |
] |
| 909 |
}, |
| 910 |
"declaration-function-parameters": { |
| 911 |
"begin": "\\G\\s*(?=\\()", |
| 912 |
"end": "(?=\\))", |
| 913 |
"patterns": [ |
| 914 |
{ |
| 915 |
"include": "#type-primitive" |
| 916 |
}, |
| 917 |
{ |
| 918 |
"include": "#type-modifier-extended-scope" |
| 919 |
}, |
| 920 |
{ |
| 921 |
"match": "\\b([A-Z]\\w*)\\b", |
| 922 |
"captures": { |
| 923 |
"1": { |
| 924 |
"name": "storage.type.struct" |
| 925 |
} |
| 926 |
} |
| 927 |
}, |
| 928 |
{ |
| 929 |
"include": "#variable" |
| 930 |
}, |
| 931 |
{ |
| 932 |
"include": "#punctuation" |
| 933 |
}, |
| 934 |
{ |
| 935 |
"include": "#comment" |
| 936 |
} |
| 937 |
] |
| 938 |
}, |
| 939 |
"declaration-function": { |
| 940 |
"patterns": [ |
| 941 |
{ |
| 942 |
"begin": "\\b(function)\\s+(\\w+)\\b", |
| 943 |
"beginCaptures": { |
| 944 |
"1": { |
| 945 |
"name": "storage.type.function" |
| 946 |
}, |
| 947 |
"2": { |
| 948 |
"name": "entity.name.function" |
| 949 |
} |
| 950 |
}, |
| 951 |
"end": "(?=\\{|;)", |
| 952 |
"patterns": [ |
| 953 |
{ |
| 954 |
"include": "#natspec" |
| 955 |
}, |
| 956 |
{ |
| 957 |
"include": "#global" |
| 958 |
}, |
| 959 |
{ |
| 960 |
"include": "#declaration-function-parameters" |
| 961 |
}, |
| 962 |
{ |
| 963 |
"include": "#type-modifier-access" |
| 964 |
}, |
| 965 |
{ |
| 966 |
"include": "#type-modifier-payable" |
| 967 |
}, |
| 968 |
{ |
| 969 |
"include": "#type-modifier-immutable" |
| 970 |
}, |
| 971 |
{ |
| 972 |
"include": "#type-modifier-extended-scope" |
| 973 |
}, |
| 974 |
{ |
| 975 |
"include": "#control-flow" |
| 976 |
}, |
| 977 |
{ |
| 978 |
"include": "#function-call" |
| 979 |
}, |
| 980 |
{ |
| 981 |
"include": "#modifier-call" |
| 982 |
}, |
| 983 |
{ |
| 984 |
"include": "#punctuation" |
| 985 |
} |
| 986 |
] |
| 987 |
}, |
| 988 |
{ |
| 989 |
"match": "\\b(function)\\s+([A-Za-z_]\\w*)\\b", |
| 990 |
"captures": { |
| 991 |
"1": { |
| 992 |
"name": "storage.type.function" |
| 993 |
}, |
| 994 |
"2": { |
| 995 |
"name": "entity.name.function" |
| 996 |
} |
| 997 |
} |
| 998 |
} |
| 999 |
] |
| 1000 |
}, |
| 1001 |
"declaration-modifier": { |
| 1002 |
"patterns": [ |
| 1003 |
{ |
| 1004 |
"begin": "\\b(modifier)\\b\\s*(\\w+)", |
| 1005 |
"beginCaptures": { |
| 1006 |
"1": { |
| 1007 |
"name": "storage.type.function.modifier" |
| 1008 |
}, |
| 1009 |
"2": { |
| 1010 |
"name": "entity.name.function.modifier" |
| 1011 |
} |
| 1012 |
}, |
| 1013 |
"end": "(?=\\{)", |
| 1014 |
"patterns": [ |
| 1015 |
{ |
| 1016 |
"include": "#declaration-function-parameters" |
| 1017 |
}, |
| 1018 |
{ |
| 1019 |
"begin": "(?<=\\))", |
| 1020 |
"end": "(?=\\{)", |
| 1021 |
"patterns": [ |
| 1022 |
{ |
| 1023 |
"include": "#declaration-function-parameters" |
| 1024 |
}, |
| 1025 |
{ |
| 1026 |
"include": "#type-modifier-access" |
| 1027 |
}, |
| 1028 |
{ |
| 1029 |
"include": "#type-modifier-payable" |
| 1030 |
}, |
| 1031 |
{ |
| 1032 |
"include": "#type-modifier-immutable" |
| 1033 |
}, |
| 1034 |
{ |
| 1035 |
"include": "#type-modifier-extended-scope" |
| 1036 |
}, |
| 1037 |
{ |
| 1038 |
"include": "#function-call" |
| 1039 |
}, |
| 1040 |
{ |
| 1041 |
"include": "#modifier-call" |
| 1042 |
}, |
| 1043 |
{ |
| 1044 |
"include": "#control-flow" |
| 1045 |
} |
| 1046 |
] |
| 1047 |
} |
| 1048 |
] |
| 1049 |
}, |
| 1050 |
{ |
| 1051 |
"match": "\\b(modifier)(\\s+([A-Za-z_]\\w*))?\\b", |
| 1052 |
"captures": { |
| 1053 |
"1": { |
| 1054 |
"name": "storage.type.modifier" |
| 1055 |
}, |
| 1056 |
"3": { |
| 1057 |
"name": "entity.name.function" |
| 1058 |
} |
| 1059 |
} |
| 1060 |
} |
| 1061 |
] |
| 1062 |
}, |
| 1063 |
"declaration-storage-mapping": { |
| 1064 |
"patterns": [ |
| 1065 |
{ |
| 1066 |
"begin": "\\b(mapping)\\b", |
| 1067 |
"beginCaptures": { |
| 1068 |
"1": { |
| 1069 |
"name": "storage.type.mapping" |
| 1070 |
} |
| 1071 |
}, |
| 1072 |
"end": "(?=\\))", |
| 1073 |
"patterns": [ |
| 1074 |
{ |
| 1075 |
"include": "#declaration-storage-mapping" |
| 1076 |
}, |
| 1077 |
{ |
| 1078 |
"include": "#type-primitive" |
| 1079 |
}, |
| 1080 |
{ |
| 1081 |
"include": "#punctuation" |
| 1082 |
}, |
| 1083 |
{ |
| 1084 |
"include": "#operator" |
| 1085 |
} |
| 1086 |
] |
| 1087 |
}, |
| 1088 |
{ |
| 1089 |
"match": "\\b(mapping)\\b", |
| 1090 |
"name": "storage.type.mapping" |
| 1091 |
} |
| 1092 |
] |
| 1093 |
}, |
| 1094 |
"declaration-error": { |
| 1095 |
"match": "\\b(error)(\\s+([A-Za-z_]\\w*))?\\b", |
| 1096 |
"captures": { |
| 1097 |
"1": { |
| 1098 |
"name": "storage.type.error" |
| 1099 |
}, |
| 1100 |
"3": { |
| 1101 |
"name": "entity.name.type.error" |
| 1102 |
} |
| 1103 |
} |
| 1104 |
}, |
| 1105 |
"function-call": { |
| 1106 |
"match": "\\b([A-Za-z_]\\w*)\\s*(\\()", |
| 1107 |
"captures": { |
| 1108 |
"1": { |
| 1109 |
"name": "entity.name.function" |
| 1110 |
}, |
| 1111 |
"2": { |
| 1112 |
"name": "punctuation.parameters.begin" |
| 1113 |
} |
| 1114 |
} |
| 1115 |
}, |
| 1116 |
"assembly": { |
| 1117 |
"patterns": [ |
| 1118 |
{ |
| 1119 |
"match": "\\b(assembly)\\b", |
| 1120 |
"name": "keyword.control.assembly" |
| 1121 |
}, |
| 1122 |
{ |
| 1123 |
"match": "\\b(let)\\b", |
| 1124 |
"name": "storage.type.assembly" |
| 1125 |
} |
| 1126 |
] |
| 1127 |
}, |
| 1128 |
"punctuation": { |
| 1129 |
"patterns": [ |
| 1130 |
{ |
| 1131 |
"match": ";", |
| 1132 |
"name": "punctuation.terminator.statement" |
| 1133 |
}, |
| 1134 |
{ |
| 1135 |
"match": "\\.", |
| 1136 |
"name": "punctuation.accessor" |
| 1137 |
}, |
| 1138 |
{ |
| 1139 |
"match": ",", |
| 1140 |
"name": "punctuation.separator" |
| 1141 |
}, |
| 1142 |
{ |
| 1143 |
"match": "\\{", |
| 1144 |
"name": "punctuation.brace.curly.begin" |
| 1145 |
}, |
| 1146 |
{ |
| 1147 |
"match": "\\}", |
| 1148 |
"name": "punctuation.brace.curly.end" |
| 1149 |
}, |
| 1150 |
{ |
| 1151 |
"match": "\\[", |
| 1152 |
"name": "punctuation.brace.square.begin" |
| 1153 |
}, |
| 1154 |
{ |
| 1155 |
"match": "\\]", |
| 1156 |
"name": "punctuation.brace.square.end" |
| 1157 |
}, |
| 1158 |
{ |
| 1159 |
"match": "\\(", |
| 1160 |
"name": "punctuation.parameters.begin" |
| 1161 |
}, |
| 1162 |
{ |
| 1163 |
"match": "\\)", |
| 1164 |
"name": "punctuation.parameters.end" |
| 1165 |
} |
| 1166 |
] |
| 1167 |
} |
| 1168 |
}, |
| 1169 |
"scopeName": "source.solidity", |
| 1170 |
"uuid": "ad87d2cd-8575-4afe-984e-9421a3788933" |
| 1171 |
} |
| 1172 |
|