github-linguist 7.7.0 → 7.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/annotation.liquidhaskell.haskell.json +47 -0
  3. data/grammars/hidden.manref.json +1 -1
  4. data/grammars/hint.haskell.json +47 -0
  5. data/grammars/hint.message.haskell.json +47 -0
  6. data/grammars/hint.type.haskell.json +47 -0
  7. data/grammars/markdown.plantuml.codeblock.json +26 -0
  8. data/grammars/source.4dm.json +1100 -0
  9. data/grammars/source.abap.json +1 -1
  10. data/grammars/source.agda.json +32 -202
  11. data/grammars/source.ahk.json +6 -2
  12. data/grammars/source.chapel.json +4 -4
  13. data/grammars/source.csound.json +1 -1
  14. data/grammars/source.dart.json +57 -31
  15. data/grammars/source.dircolors.json +101 -3
  16. data/grammars/source.editorconfig.json +23 -5
  17. data/grammars/source.elixir.json +8 -0
  18. data/grammars/source.elm.json +1 -1
  19. data/grammars/source.emacs.lisp.json +10 -0
  20. data/grammars/source.faust.json +119 -0
  21. data/grammars/source.gcode.json +166 -8
  22. data/grammars/source.hack.json +4 -18
  23. data/grammars/source.haskell.json +47 -0
  24. data/grammars/source.hlsl.json +9 -5
  25. data/grammars/source.hsig.json +47 -0
  26. data/grammars/source.hx.json +4 -0
  27. data/grammars/source.igor.json +44 -0
  28. data/grammars/source.julia.json +25 -21
  29. data/grammars/source.lean.json +19 -3
  30. data/grammars/source.lean.markdown.json +2598 -0
  31. data/grammars/source.matlab.json +215 -152
  32. data/grammars/source.mcfunction-snapshot.json +1 -1
  33. data/grammars/source.meson.json +1 -1
  34. data/grammars/source.mrc.json +416 -534
  35. data/grammars/source.nasl.json +155 -0
  36. data/grammars/source.nextflow.json +2 -2
  37. data/grammars/source.odin-ehr.json +806 -0
  38. data/grammars/source.odin.json +402 -0
  39. data/grammars/source.prisma.json +7 -0
  40. data/grammars/source.qasm.json +66 -0
  41. data/grammars/source.ql.json +1408 -0
  42. data/grammars/source.scala.json +27 -3
  43. data/grammars/source.sy.json +2088 -183
  44. data/grammars/source.terraform.json +576 -132
  45. data/grammars/source.tnsaudit.json +256 -0
  46. data/grammars/source.ts.json +89 -30
  47. data/grammars/source.tsx.json +89 -30
  48. data/grammars/source.v.json +541 -788
  49. data/grammars/source.viml.json +2 -2
  50. data/grammars/source.webassembly.json +10 -0
  51. data/grammars/source.wsd.json +775 -0
  52. data/grammars/text.tex.latex.haskell.json +47 -0
  53. data/grammars/version +1 -1
  54. data/lib/linguist/VERSION +1 -1
  55. data/lib/linguist/file_blob.rb +1 -1
  56. data/lib/linguist/generated.rb +23 -3
  57. data/lib/linguist/heuristics.yml +48 -3
  58. data/lib/linguist/languages.json +1 -1
  59. data/lib/linguist/languages.yml +156 -34
  60. data/lib/linguist/lazy_blob.rb +10 -10
  61. data/lib/linguist/linguist.bundle +0 -0
  62. data/lib/linguist/samples.json +7739 -2010
  63. data/lib/linguist/shebang.rb +5 -3
  64. data/lib/linguist/vendor.yml +3 -0
  65. metadata +13 -7
  66. data/grammars/source.LS.json +0 -85
  67. data/grammars/source.MCPOST.json +0 -54
  68. data/grammars/source.MOD.json +0 -55
  69. data/grammars/source.apt.json +0 -18
  70. data/grammars/source.yaml-ext.json +0 -324
@@ -21,7 +21,7 @@
21
21
  "repository": {
22
22
  "access-modifier": {
23
23
  "name": "storage.modifier.tsx",
24
- "match": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(abstract|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
24
+ "match": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(abstract|public|protected|private|readonly|static|declare)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
25
25
  },
26
26
  "after-operator-block-as-object-literal": {
27
27
  "name": "meta.objectliteral.tsx",
@@ -1338,7 +1338,7 @@
1338
1338
  },
1339
1339
  {
1340
1340
  "name": "meta.export.default.tsx",
1341
- "begin": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(export)(?:(?:\\s*(=))|(?:\\s+(default)(?=\\s+)))",
1341
+ "begin": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(export)(?:\\s+(type))?(?:(?:\\s*(=))|(?:\\s+(default)(?=\\s+)))",
1342
1342
  "end": "(?=$|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))",
1343
1343
  "patterns": [
1344
1344
  {
@@ -1353,16 +1353,19 @@
1353
1353
  "name": "keyword.control.export.tsx"
1354
1354
  },
1355
1355
  "2": {
1356
- "name": "keyword.operator.assignment.tsx"
1356
+ "name": "keyword.control.type.tsx"
1357
1357
  },
1358
1358
  "3": {
1359
+ "name": "keyword.operator.assignment.tsx"
1360
+ },
1361
+ "4": {
1359
1362
  "name": "keyword.control.default.tsx"
1360
1363
  }
1361
1364
  }
1362
1365
  },
1363
1366
  {
1364
1367
  "name": "meta.export.tsx",
1365
- "begin": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(export)\\b(?!(\\$)|(\\s*:))((?=\\s*[\\{*])|((?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s|,))(?!\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b)))",
1368
+ "begin": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(export)(?:\\s+(type))?\\b(?!(\\$)|(\\s*:))((?=\\s*[\\{*])|((?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s|,))(?!\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b)))",
1366
1369
  "end": "(?=$|;|(?:^\\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\\b))",
1367
1370
  "patterns": [
1368
1371
  {
@@ -1370,8 +1373,11 @@
1370
1373
  }
1371
1374
  ],
1372
1375
  "beginCaptures": {
1373
- "0": {
1376
+ "1": {
1374
1377
  "name": "keyword.control.export.tsx"
1378
+ },
1379
+ "2": {
1380
+ "name": "keyword.control.type.tsx"
1375
1381
  }
1376
1382
  }
1377
1383
  }
@@ -1585,6 +1591,17 @@
1585
1591
  "name": "keyword.operator.relational.tsx",
1586
1592
  "match": "\u003c=|\u003e=|\u003c\u003e|\u003c|\u003e"
1587
1593
  },
1594
+ {
1595
+ "match": "(\\!)\\s*(/)(?![/*])",
1596
+ "captures": {
1597
+ "1": {
1598
+ "name": "keyword.operator.logical.tsx"
1599
+ },
1600
+ "2": {
1601
+ "name": "keyword.operator.arithmetic.tsx"
1602
+ }
1603
+ }
1604
+ },
1588
1605
  {
1589
1606
  "name": "keyword.operator.logical.tsx",
1590
1607
  "match": "\\!|\u0026\u0026|\\|\\||\\?\\?"
@@ -1703,8 +1720,8 @@
1703
1720
  },
1704
1721
  "field-declaration": {
1705
1722
  "name": "meta.field.declaration.tsx",
1706
- "begin": "(?x)(?\u003c!\\()(?:(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(readonly)\\s+)?(?=\\s*((\\b(?\u003c!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?\u003c!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?\u003c!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?\u003c!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(?:(?:(\\?)|(\\!))\\s*)?(=|:|;|,|\\}|$))",
1707
- "end": "(?x)(?=\\}|;|,|$|(^(?!\\s*((\\b(?\u003c!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?\u003c!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?\u003c!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?\u003c!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(?:(?:(\\?)|(\\!))\\s*)?(=|:|;|,|$))))|(?\u003c=\\})",
1723
+ "begin": "(?x)(?\u003c!\\()(?:(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(readonly)\\s+)?(?=\\s*((\\b(?\u003c!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?\u003c!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?\u003c!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?\u003c!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|(\\#?[_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(?:(?:(\\?)|(\\!))\\s*)?(=|:|;|,|\\}|$))",
1724
+ "end": "(?x)(?=\\}|;|,|$|(^(?!\\s*((\\b(?\u003c!\\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\\b(?!\\$))|(\\b(?\u003c!\\$)0(?:b|B)[01][01_]*(n)?\\b(?!\\$))|(\\b(?\u003c!\\$)0(?:o|O)?[0-7][0-7_]*(n)?\\b(?!\\$))|((?\u003c!\\$)(?:\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.1E+3\n (?:\\b[0-9][0-9_]*(\\.)[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1.E+3\n (?:\\B(\\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # .1E+3\n (?:\\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\\b)| # 1E+3\n (?:\\b[0-9][0-9_]*(\\.)[0-9][0-9_]*(n)?\\b)| # 1.1\n (?:\\b[0-9][0-9_]*(\\.)(n)?\\B)| # 1.\n (?:\\B(\\.)[0-9][0-9_]*(n)?\\b)| # .1\n (?:\\b[0-9][0-9_]*(n)?\\b(?!\\.)) # 1\n)(?!\\$))|(\\#?[_$[:alpha:]][_$[:alnum:]]*)|(\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*(?:(?:(\\?)|(\\!))\\s*)?(=|:|;|,|$))))|(?\u003c=\\})",
1708
1725
  "patterns": [
1709
1726
  {
1710
1727
  "include": "#variable-initializer"
@@ -1725,7 +1742,7 @@
1725
1742
  "include": "#comment"
1726
1743
  },
1727
1744
  {
1728
- "match": "(?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(\u003c*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=\u003e)\n )) |\n ((async\\s*)?(\n ((\u003c\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if =\u003e is on new line\n(\n (\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c])*\\\u003e)*\\\u003e)*\u003e\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [\u003c]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=\u003e] # \u003c typeparam extends\n) |\n# arrow function possible to detect only with =\u003e on same line\n(\n (\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c])*\\\u003e)*\\\u003e)*\u003e\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=\u003e # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: \u003c | () | (... | (param: | (param, | (param? | (param= | (param) =\u003e\n(:\\s*(\n (\u003c) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=\u003e)\n ))\n ))\n)) |\n(:\\s*(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((\u003c\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=\u003e|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\u003c[^\u003c\u003e]*\u003e)|[^\u003c\u003e(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(\u003c*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=\u003e)\n )) |\n ((async\\s*)?(\n ((\u003c\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if =\u003e is on new line\n(\n (\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c])*\\\u003e)*\\\u003e)*\u003e\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [\u003c]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=\u003e] # \u003c typeparam extends\n) |\n# arrow function possible to detect only with =\u003e on same line\n(\n (\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c])*\\\u003e)*\\\u003e)*\u003e\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=\u003e # arrow operator\n)\n ))\n)))",
1745
+ "match": "(?x)(\\#?[_$[:alpha:]][_$[:alnum:]]*)(?:(\\?)|(\\!))?(?=\\s*\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(\u003c*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=\u003e)\n )) |\n ((async\\s*)?(\n ((\u003c\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if =\u003e is on new line\n(\n (\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c])*\\\u003e)*\\\u003e)*\u003e\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [\u003c]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=\u003e] # \u003c typeparam extends\n) |\n# arrow function possible to detect only with =\u003e on same line\n(\n (\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c])*\\\u003e)*\\\u003e)*\u003e\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=\u003e # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: \u003c | () | (... | (param: | (param, | (param? | (param= | (param) =\u003e\n(:\\s*(\n (\u003c) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=\u003e)\n ))\n ))\n)) |\n(:\\s*(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((\u003c\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=\u003e|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\u003c[^\u003c\u003e]*\u003e)|[^\u003c\u003e(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(\u003c*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=\u003e)\n )) |\n ((async\\s*)?(\n ((\u003c\\s*$)|([\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if =\u003e is on new line\n(\n (\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c])*\\\u003e)*\\\u003e)*\u003e\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n(\n [\u003c]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=\u003e] # \u003c typeparam extends\n) |\n# arrow function possible to detect only with =\u003e on same line\n(\n (\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c]|\\\u003c\\s*([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\]))([^=\u003c\u003e]|=[^\u003c])*\\\u003e)*\\\u003e)*\u003e\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\)))*)?\\) # parameters\n (\\s*:\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=\u003e # arrow operator\n)\n ))\n)))",
1729
1746
  "captures": {
1730
1747
  "1": {
1731
1748
  "name": "meta.definition.property.tsx entity.name.function.tsx"
@@ -1740,7 +1757,7 @@
1740
1757
  },
1741
1758
  {
1742
1759
  "name": "meta.definition.property.tsx variable.object.property.tsx",
1743
- "match": "[_$[:alpha:]][_$[:alnum:]]*"
1760
+ "match": "\\#?[_$[:alpha:]][_$[:alnum:]]*"
1744
1761
  },
1745
1762
  {
1746
1763
  "name": "keyword.operator.optional.tsx",
@@ -1824,12 +1841,12 @@
1824
1841
  ]
1825
1842
  },
1826
1843
  "function-call": {
1827
- "begin": "(?=(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?\u003c=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e|\\\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))(([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e|\\\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e)*(?\u003c!=)\\\u003e))*(?\u003c!=)\\\u003e)*(?\u003c!=)\u003e\\s*)?\\()",
1828
- "end": "(?\u003c=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?\u003c=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e|\\\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))(([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e|\\\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e)*(?\u003c!=)\\\u003e))*(?\u003c!=)\\\u003e)*(?\u003c!=)\u003e\\s*)?\\()",
1844
+ "begin": "(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?\u003c=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e|\\\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))(([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e|\\\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e)*(?\u003c!=)\\\u003e))*(?\u003c!=)\\\u003e)*(?\u003c!=)\u003e\\s*)?\\()",
1845
+ "end": "(?\u003c=\\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))|(?\u003c=[\\)]))\\s*(?:(\\?\\.\\s*)|(\\!))?(\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e|\\\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))(([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e|\\\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e)*(?\u003c!=)\\\u003e))*(?\u003c!=)\\\u003e)*(?\u003c!=)\u003e\\s*)?\\()",
1829
1846
  "patterns": [
1830
1847
  {
1831
1848
  "name": "meta.function-call.tsx",
1832
- "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*\\s*\\??\\.\\s*)*|(\\??\\.\\s*)?)([_$[:alpha:]][_$[:alnum:]]*))",
1849
+ "begin": "(?=(([_$[:alpha:]][_$[:alnum:]]*)(\\s*\\??\\.\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*))",
1833
1850
  "end": "(?=\\s*(?:(\\?\\.\\s*)|(\\!))?(\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e|\\\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))(([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e|\\\u003c\\s*(((keyof|infer|typeof|readonly)\\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])|(\\'[^\\']*\\')|(\\\"[^\\\"]*\\\")|(\\`[^\\`]*\\`))(?=\\s*([\\\u003c\\\u003e\\,\\.\\[]|=\u003e|\u0026(?!\u0026)|\\|(?!\\|)))))([^\u003c\u003e\\(]|(\\(([^\\(\\)]|(\\([^\\(\\)]*\\)))*\\))|(?\u003c==)\\\u003e)*(?\u003c!=)\\\u003e))*(?\u003c!=)\\\u003e)*(?\u003c!=)\u003e\\s*)?\\()",
1834
1851
  "patterns": [
1835
1852
  {
@@ -1837,7 +1854,7 @@
1837
1854
  },
1838
1855
  {
1839
1856
  "name": "entity.name.function.tsx",
1840
- "match": "([_$[:alpha:]][_$[:alnum:]]*)"
1857
+ "match": "(\\#?[_$[:alpha:]][_$[:alnum:]]*)"
1841
1858
  }
1842
1859
  ]
1843
1860
  },
@@ -1996,7 +2013,7 @@
1996
2013
  }
1997
2014
  },
1998
2015
  {
1999
- "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])",
2016
+ "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])",
2000
2017
  "captures": {
2001
2018
  "1": {
2002
2019
  "name": "punctuation.accessor.tsx"
@@ -2010,7 +2027,7 @@
2010
2027
  }
2011
2028
  },
2012
2029
  {
2013
- "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*([_$[:alpha:]][_$[:alnum:]]*)",
2030
+ "match": "(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(\\#?[_$[:alpha:]][_$[:alnum:]]*)",
2014
2031
  "captures": {
2015
2032
  "1": {
2016
2033
  "name": "punctuation.accessor.tsx"
@@ -2096,7 +2113,7 @@
2096
2113
  },
2097
2114
  "import-declaration": {
2098
2115
  "name": "meta.import.tsx",
2099
- "begin": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)(?!\\s*[:\\(])(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))",
2116
+ "begin": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)(?:\\s+(type)(?!\\s+from))?(?!\\s*[:\\(])(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))",
2100
2117
  "end": "(?\u003c!^import|[^\\._$[:alnum:]]import)(?=;|$|^)",
2101
2118
  "patterns": [
2102
2119
  {
@@ -2135,6 +2152,9 @@
2135
2152
  },
2136
2153
  "3": {
2137
2154
  "name": "keyword.control.import.tsx"
2155
+ },
2156
+ "4": {
2157
+ "name": "keyword.control.type.tsx"
2138
2158
  }
2139
2159
  }
2140
2160
  },
@@ -2142,7 +2162,7 @@
2142
2162
  "patterns": [
2143
2163
  {
2144
2164
  "name": "meta.import-equals.external.tsx",
2145
- "begin": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(require)\\s*(\\()",
2165
+ "begin": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)(?:\\s+(type))?\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(require)\\s*(\\()",
2146
2166
  "end": "\\)",
2147
2167
  "patterns": [
2148
2168
  {
@@ -2163,15 +2183,18 @@
2163
2183
  "name": "keyword.control.import.tsx"
2164
2184
  },
2165
2185
  "4": {
2166
- "name": "variable.other.readwrite.alias.tsx"
2186
+ "name": "keyword.control.type.tsx"
2167
2187
  },
2168
2188
  "5": {
2169
- "name": "keyword.operator.assignment.tsx"
2189
+ "name": "variable.other.readwrite.alias.tsx"
2170
2190
  },
2171
2191
  "6": {
2172
- "name": "keyword.control.require.tsx"
2192
+ "name": "keyword.operator.assignment.tsx"
2173
2193
  },
2174
2194
  "7": {
2195
+ "name": "keyword.control.require.tsx"
2196
+ },
2197
+ "8": {
2175
2198
  "name": "meta.brace.round.tsx"
2176
2199
  }
2177
2200
  },
@@ -2183,7 +2206,7 @@
2183
2206
  },
2184
2207
  {
2185
2208
  "name": "meta.import-equals.internal.tsx",
2186
- "begin": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(?!require\\b)",
2209
+ "begin": "(?\u003c![_$[:alnum:]])(?:(?\u003c=\\.\\.\\.)|(?\u003c!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(import)(?:\\s+(type))?\\s+([_$[:alpha:]][_$[:alnum:]]*)\\s*(=)\\s*(?!require\\b)",
2187
2210
  "end": "(?=;|$|^)",
2188
2211
  "patterns": [
2189
2212
  {
@@ -2222,9 +2245,12 @@
2222
2245
  "name": "keyword.control.import.tsx"
2223
2246
  },
2224
2247
  "4": {
2225
- "name": "variable.other.readwrite.alias.tsx"
2248
+ "name": "keyword.control.type.tsx"
2226
2249
  },
2227
2250
  "5": {
2251
+ "name": "variable.other.readwrite.alias.tsx"
2252
+ },
2253
+ "6": {
2228
2254
  "name": "keyword.operator.assignment.tsx"
2229
2255
  }
2230
2256
  }
@@ -3298,7 +3324,7 @@
3298
3324
  "match": "([_$[:alpha:]][_$[:alnum:]]*)(?=\\s*\\??\\.\\s*prototype\\b(?!\\$))"
3299
3325
  },
3300
3326
  {
3301
- "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
3327
+ "match": "(?x)(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))\\s*(?:\n (\\#?[[:upper:]][_$[:digit:][:upper:]]*) |\n (\\#?[_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)",
3302
3328
  "captures": {
3303
3329
  "1": {
3304
3330
  "name": "punctuation.accessor.tsx"
@@ -3315,7 +3341,7 @@
3315
3341
  }
3316
3342
  },
3317
3343
  {
3318
- "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)",
3344
+ "match": "(?x)(?:\n ([[:upper:]][_$[:digit:][:upper:]]*) |\n ([_$[:alpha:]][_$[:alnum:]]*)\n)(?=\\s*\\??\\.\\s*\\#?[_$[:alpha:]][_$[:alnum:]]*)",
3319
3345
  "captures": {
3320
3346
  "1": {
3321
3347
  "name": "variable.other.constant.object.tsx"
@@ -3602,6 +3628,39 @@
3602
3628
  }
3603
3629
  }
3604
3630
  },
3631
+ {
3632
+ "begin": "(?\u003c=:)\\s*(async)?\\s*(?=\\\u003c\\s*$)",
3633
+ "end": "(?\u003c=\\\u003e)",
3634
+ "patterns": [
3635
+ {
3636
+ "include": "#type-parameters"
3637
+ }
3638
+ ],
3639
+ "beginCaptures": {
3640
+ "1": {
3641
+ "name": "storage.modifier.async.tsx"
3642
+ }
3643
+ }
3644
+ },
3645
+ {
3646
+ "begin": "(?\u003c=\\\u003e)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^\u003c\u003e\\(\\)\\{\\}]|\\\u003c([^\u003c\u003e]|\\\u003c[^\u003c\u003e]+\\\u003e)+\\\u003e|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))",
3647
+ "end": "\\)",
3648
+ "patterns": [
3649
+ {
3650
+ "include": "#expression-inside-possibly-arrow-parens"
3651
+ }
3652
+ ],
3653
+ "beginCaptures": {
3654
+ "1": {
3655
+ "name": "meta.brace.round.tsx"
3656
+ }
3657
+ },
3658
+ "endCaptures": {
3659
+ "0": {
3660
+ "name": "meta.brace.round.tsx"
3661
+ }
3662
+ }
3663
+ },
3605
3664
  {
3606
3665
  "include": "#possibly-arrow-return-type"
3607
3666
  },
@@ -4249,12 +4308,6 @@
4249
4308
  },
4250
4309
  "statements": {
4251
4310
  "patterns": [
4252
- {
4253
- "include": "#string"
4254
- },
4255
- {
4256
- "include": "#comment"
4257
- },
4258
4311
  {
4259
4312
  "include": "#declaration"
4260
4313
  },
@@ -4275,6 +4328,12 @@
4275
4328
  },
4276
4329
  {
4277
4330
  "include": "#punctuation-semicolon"
4331
+ },
4332
+ {
4333
+ "include": "#string"
4334
+ },
4335
+ {
4336
+ "include": "#comment"
4278
4337
  }
4279
4338
  ]
4280
4339
  },
@@ -1,96 +1,30 @@
1
1
  {
2
- "name": "v",
2
+ "name": "V",
3
3
  "scopeName": "source.v",
4
4
  "patterns": [
5
5
  {
6
- "name": "meta.definition.module.v",
7
- "begin": "^\\s*(module)\\s+",
8
- "end": "([0-9a-zA-Z_]*)",
9
- "beginCaptures": {
10
- "1": {
11
- "name": "keyword.module.v"
12
- }
13
- },
14
- "endCaptures": {
15
- "1": {
16
- "name": "entity.name.module.v"
17
- }
18
- }
6
+ "include": "#comments"
19
7
  },
20
8
  {
21
- "name": "meta.definition.import.v",
22
- "begin": "^\\s*(import)\\s+",
23
- "end": "([0-9a-zA-Z_.]*)",
24
- "beginCaptures": {
25
- "1": {
26
- "name": "keyword.import.v"
27
- }
28
- },
29
- "endCaptures": {
30
- "1": {
31
- "name": "entity.name.import.v"
32
- }
33
- }
9
+ "include": "#as"
34
10
  },
35
11
  {
36
- "name": "meta.definition.include.v",
37
- "begin": "^\\s*(#include)",
38
- "end": "\\s+([\\\u003c\"])\\s*(.*)([\\\u003e\"])",
39
- "beginCaptures": {
40
- "1": {
41
- "name": "keyword.include.v"
42
- }
43
- },
44
- "endCaptures": {
45
- "1": {
46
- "name": "string.quoted.double.v"
47
- },
48
- "2": {
49
- "name": "string.quoted.double.v"
50
- },
51
- "3": {
52
- "name": "string.quoted.double.v"
53
- }
54
- }
12
+ "include": "#attributes"
55
13
  },
56
14
  {
57
- "name": "meta.definition.flag.v",
58
- "begin": "^\\s*(#flag)",
59
- "end": "\\s+(.*?)$",
60
- "beginCaptures": {
61
- "1": {
62
- "name": "keyword.flag.v"
63
- }
64
- },
65
- "endCaptures": {
66
- "1": {
67
- "name": "string.quoted.single.v"
68
- }
69
- }
15
+ "include": "#assignment"
70
16
  },
71
17
  {
72
- "name": "meta.definition.reference.v",
73
- "match": "(\u0026)\\s*(?=[0-9a-zA-Z_])",
74
- "captures": {
75
- "1": {
76
- "name": "keyword.operator.address.v"
77
- }
78
- }
18
+ "include": "#module-decl"
79
19
  },
80
20
  {
81
- "name": "meta.definition.escaped.keyword.v",
82
- "match": "((?:@)(?:mut|pub|fn|module|import|const|map|assert|sizeof|type|struct|interface|enum|in|or|match|if|else|for|go|goto|defer|return|i?(?:8|16|nt|64|128)|u?(?:16|32|64|128)|f?(?:32|64)|bool|byte|byteptr|voidptr|string|ustring|rune|none))",
83
- "captures": {
84
- "0": {
85
- "name": "keyword.other.escaped.v"
86
- }
87
- }
21
+ "include": "#import-decl"
88
22
  },
89
23
  {
90
- "include": "#comments"
24
+ "include": "#include-decl"
91
25
  },
92
26
  {
93
- "include": "#attributes"
27
+ "include": "#flag-decl"
94
28
  },
95
29
  {
96
30
  "include": "#brackets"
@@ -99,46 +33,40 @@
99
33
  "include": "#builtin-fix"
100
34
  },
101
35
  {
102
- "include": "#generics"
36
+ "include": "#escaped-fix"
103
37
  },
104
38
  {
105
39
  "include": "#operators"
106
40
  },
107
41
  {
108
- "include": "#function-new-limited-overload"
42
+ "include": "#function-limited-overload-decl"
109
43
  },
110
44
  {
111
- "include": "#function-new-extend"
45
+ "include": "#function-extend-decl"
112
46
  },
113
47
  {
114
- "include": "#function-new"
48
+ "include": "#function-decl"
115
49
  },
116
50
  {
117
51
  "include": "#function-exist"
118
52
  },
119
53
  {
120
- "include": "#type"
121
- },
122
- {
123
- "include": "#enum"
54
+ "include": "#generic"
124
55
  },
125
56
  {
126
- "include": "#struct"
127
- },
128
- {
129
- "include": "#interface"
57
+ "include": "#constants"
130
58
  },
131
59
  {
132
- "include": "#constants"
60
+ "include": "#type"
133
61
  },
134
62
  {
135
- "include": "#variable-assignment"
63
+ "include": "#enum"
136
64
  },
137
65
  {
138
- "include": "#variable-increment-decrement"
66
+ "include": "#interface"
139
67
  },
140
68
  {
141
- "include": "#goto"
69
+ "include": "#struct"
142
70
  },
143
71
  {
144
72
  "include": "#keywords"
@@ -146,57 +74,72 @@
146
74
  {
147
75
  "include": "#storage"
148
76
  },
149
- {
150
- "include": "#std-types"
151
- },
152
- {
153
- "include": "#std-cbased-types"
154
- },
155
77
  {
156
78
  "include": "#numbers"
157
79
  },
158
80
  {
159
81
  "include": "#strings"
82
+ },
83
+ {
84
+ "include": "#types"
160
85
  }
161
86
  ],
162
87
  "repository": {
163
- "attributes": {
164
- "patterns": [
165
- {
166
- "match": "^\\s*((\\[)(unsafe_fn|deprecated|live|inline)(\\]))",
167
- "captures": {
168
- "1": {
169
- "name": "meta.function.attribute.v"
170
- },
171
- "2": {
172
- "name": "punctuation.definition.begin.bracket.square.v"
173
- },
174
- "3": {
175
- "name": "storage.modifier.attribute.v"
88
+ "as": {
89
+ "begin": "\\s+(as)\\s+",
90
+ "end": "([\\w.]*)",
91
+ "beginCaptures": {
92
+ "1": {
93
+ "name": "keyword.as.v"
94
+ }
95
+ },
96
+ "endCaptures": {
97
+ "1": {
98
+ "name": "entity.name.alias.v"
99
+ }
100
+ }
101
+ },
102
+ "assignment": {
103
+ "name": "meta.definition.variable.v",
104
+ "match": "([\\w.]+)\\s*((?:\\:|\\+|\\-|\\*|\\/|\\%|\\\u0026|\\||\\^)?=)\\s*(?=.+)",
105
+ "captures": {
106
+ "1": {
107
+ "patterns": [
108
+ {
109
+ "include": "#illegal-name"
176
110
  },
177
- "4": {
178
- "name": "punctuation.definition.end.bracket.square.v"
111
+ {
112
+ "name": "variable.assignment.other.v",
113
+ "match": "\\w+"
179
114
  }
180
- }
115
+ ]
181
116
  },
182
- {
183
- "match": "(?\u003c=[0-9a-zA-Z_\\s])((\\[)(skip)(\\]))",
184
- "captures": {
185
- "0": {
186
- "name": "meta.struct.attribute.v"
187
- },
188
- "1": {
189
- "name": "punctuation.definition.begin.bracket.square.v"
190
- },
191
- "2": {
192
- "name": "entity.struct.attribute.v"
193
- },
194
- "3": {
195
- "name": "punctuation.definition.end.bracket.square.v"
117
+ "2": {
118
+ "patterns": [
119
+ {
120
+ "include": "#operators"
196
121
  }
197
- }
122
+ ]
198
123
  }
199
- ]
124
+ }
125
+ },
126
+ "attributes": {
127
+ "name": "meta.definition.attribute.v",
128
+ "match": "^\\s*((\\[)(deprecated|unsafe_fn|typedef|live|inline|flag)(\\]))",
129
+ "captures": {
130
+ "1": {
131
+ "name": "meta.function.attribute.v"
132
+ },
133
+ "2": {
134
+ "name": "punctuation.definition.begin.bracket.square.v"
135
+ },
136
+ "3": {
137
+ "name": "storage.modifier.attribute.v"
138
+ },
139
+ "4": {
140
+ "name": "punctuation.definition.end.bracket.square.v"
141
+ }
142
+ }
200
143
  },
201
144
  "brackets": {
202
145
  "patterns": [
@@ -239,8 +182,23 @@
239
182
  }
240
183
  },
241
184
  {
242
- "name": "punctuation.definition.bracket.square.v",
243
- "match": "\\[|\\]"
185
+ "begin": "\\[",
186
+ "end": "\\]",
187
+ "patterns": [
188
+ {
189
+ "include": "$self"
190
+ }
191
+ ],
192
+ "beginCaptures": {
193
+ "0": {
194
+ "name": "punctuation.definition.bracket.square.begin.v"
195
+ }
196
+ },
197
+ "endCaptures": {
198
+ "0": {
199
+ "name": "punctuation.definition.bracket.square.end.v"
200
+ }
201
+ }
244
202
  }
245
203
  ]
246
204
  },
@@ -249,40 +207,24 @@
249
207
  {
250
208
  "patterns": [
251
209
  {
252
- "match": "^\\s*(const)(?=\\s*\\()",
253
- "captures": {
254
- "1": {
255
- "name": "storage.modifier.v"
256
- }
257
- }
258
- },
259
- {
260
- "match": "(assert)(?=\\s*\\()",
261
- "captures": {
262
- "1": {
263
- "name": "keyword.assert.v"
264
- }
265
- }
210
+ "name": "storage.modifier.v",
211
+ "match": "(const)(?=\\s*\\()"
266
212
  },
267
213
  {
268
- "match": "(sizeof)(?=\\s*\\()",
269
- "captures": {
270
- "1": {
271
- "name": "keyword.sizeof.v"
272
- }
273
- }
214
+ "name": "keyword.$1.v",
215
+ "match": "\\b(fn|type|enum|struct|interface|map|assert|sizeof)\\b(?=\\s*\\()"
274
216
  }
275
217
  ]
276
218
  },
277
219
  {
278
220
  "patterns": [
279
221
  {
280
- "match": "(in|or|match|if|else|for|go|goto|defer|return)(?=\\s*\\()",
281
- "captures": {
282
- "1": {
283
- "name": "keyword.control.v"
284
- }
285
- }
222
+ "name": "keyword.control.v",
223
+ "match": "(\\$if|\\$else)(?=\\s*\\()"
224
+ },
225
+ {
226
+ "name": "keyword.control.v",
227
+ "match": "\\b(in|or|break|continue|default|unsafe|match|if|else|for|go|goto|defer|return)\\b(?=\\s*\\()"
286
228
  }
287
229
  ]
288
230
  },
@@ -299,73 +241,10 @@
299
241
  },
300
242
  {
301
243
  "name": "meta.expr.bool.cast.v",
302
- "match": "(bool)(?=\\s*\\()",
303
- "captures": {
304
- "1": {
305
- "name": "storage.type.boolean.v"
306
- }
307
- }
308
- },
309
- {
310
- "name": "meta.expr.byte.cast.v",
311
- "match": "(byte)(?=\\s*\\()",
312
- "captures": {
313
- "1": {
314
- "name": "storage.type.byte.v"
315
- }
316
- }
317
- },
318
- {
319
- "name": "meta.expr.byteptr.cast.v",
320
- "match": "(byteptr)(?=\\s*\\()",
321
- "captures": {
322
- "1": {
323
- "name": "storage.type.byteptr.v"
324
- }
325
- }
326
- },
327
- {
328
- "name": "meta.expr.voidptr.cast.v",
329
- "match": "(voidptr)(?=\\s*\\()",
330
- "captures": {
331
- "1": {
332
- "name": "storage.type.voidptr.v"
333
- }
334
- }
335
- },
336
- {
337
- "name": "meta.expr.string.cast.v",
338
- "match": "(string)(?=\\s*\\()",
339
- "captures": {
340
- "1": {
341
- "name": "storage.type.string.v"
342
- }
343
- }
344
- },
345
- {
346
- "name": "meta.expr.ustring.cast.v",
347
- "match": "(ustring)(?=\\s*\\()",
348
- "captures": {
349
- "1": {
350
- "name": "storage.type.ustring.v"
351
- }
352
- }
353
- },
354
- {
355
- "name": "meta.expr.rune.cast.v",
356
- "match": "(rune)(?=\\s*\\()",
357
- "captures": {
358
- "1": {
359
- "name": "storage.type.rune.v"
360
- }
361
- }
362
- },
363
- {
364
- "name": "meta.expr.none.cast.v",
365
- "match": "(none)(?=\\s*\\()",
244
+ "match": "(bool|byte|byteptr|charptr|voidptr|string|ustring|rune|none)(?=\\s*\\()",
366
245
  "captures": {
367
246
  "1": {
368
- "name": "storage.type.none.v"
247
+ "name": "storage.type.$1.v"
369
248
  }
370
249
  }
371
250
  }
@@ -408,339 +287,248 @@
408
287
  ]
409
288
  },
410
289
  "constants": {
411
- "patterns": [
412
- {
413
- "name": "constant.language.v",
414
- "match": "\\b(true|false)\\b"
415
- },
416
- {
417
- "name": "constant.other.v",
418
- "match": "([0-9A-Z]+)(?=\\s*\\=)"
419
- }
420
- ]
290
+ "name": "constant.language.v",
291
+ "match": "\\b(true|false)\\b"
421
292
  },
422
293
  "enum": {
423
- "patterns": [
424
- {
425
- "name": "meta.definition.enum.v",
426
- "match": "^\\s*(\\benum\\b)\\s+(?:[0-9a-zA-Z_]+\\.)?([0-9a-zA-Z_]*)",
427
- "captures": {
428
- "1": {
429
- "name": "keyword.enum.v"
430
- },
431
- "2": {
432
- "patterns": [
433
- {
434
- "name": "invalid.illegal.v",
435
- "match": "\\d\\w+"
436
- },
437
- {
438
- "name": "entity.name.enum.v",
439
- "match": "\\w+"
440
- }
441
- ]
442
- }
443
- }
444
- }
445
- ]
446
- },
447
- "flags": {
448
- "patterns": [
449
- {
450
- "name": "meta.flag.include.v",
451
- "match": "(-L|I)\\s*(?=.+?)",
452
- "captures": {
453
- "1": {
454
- "name": "keyword.flag.include.v"
455
- }
456
- }
294
+ "name": "meta.definition.enum.v",
295
+ "match": "^\\s*(?:(pub)?\\s+)?(enum)\\s+(?:\\w+\\.)?(\\w*)",
296
+ "captures": {
297
+ "1": {
298
+ "name": "storage.modifier.$1.v"
457
299
  },
458
- {
459
- "name": "meta.flag.linking.v",
460
- "match": "(-l[0-9a-zA-Z._\\-]+)",
461
- "captures": {
462
- "1": {
463
- "name": "entity.name.library.v"
464
- }
465
- }
300
+ "2": {
301
+ "name": "storage.type.enum.v"
466
302
  },
467
- {
468
- "name": "meta.flag.os-specific.linking.v",
469
- "match": "(windows|darwin|linux|bsd)\\s+(?=-(?=l|L))",
470
- "captures": {
471
- "1": {
472
- "name": "keyword.flag.os.v"
473
- }
474
- }
303
+ "3": {
304
+ "name": "entity.name.enum.v"
475
305
  }
476
- ]
306
+ }
477
307
  },
478
- "function-exist": {
479
- "patterns": [
480
- {
481
- "name": "meta.function.v",
482
- "match": "([0-9a-zA-Z_]+)(\\\u003c[0-9a-zA-Z_]*\\\u003e)?(?=\\s*\\()",
483
- "captures": {
484
- "0": {
485
- "name": "meta.function.call.v"
486
- },
487
- "1": {
488
- "patterns": [
489
- {
490
- "name": "invalid.illegal.v",
491
- "match": "\\d\\w+"
492
- },
493
- {
494
- "name": "support.function.v",
495
- "match": "\\w+"
496
- }
497
- ]
498
- },
499
- "2": {
500
- "patterns": [
501
- {
502
- "include": "#function-generic"
503
- }
504
- ]
505
- }
506
- }
308
+ "escaped-fix": {
309
+ "name": "meta.escaped.keyword.v",
310
+ "match": "((?:@)(?:mut|pub|fn|unsafe|module|import|as|const|map|assert|sizeof|type|struct|interface|enum|in|or|match|if|else|for|go|goto|defer|return|i?(?:8|16|nt|64|128)|u?(?:16|32|64|128)|f?(?:32|64)|bool|byte|byteptr|charptr|voidptr|string|ustring|rune|none))",
311
+ "captures": {
312
+ "0": {
313
+ "name": "keyword.other.escaped.v"
507
314
  }
508
- ]
315
+ }
509
316
  },
510
- "function-generic": {
511
- "patterns": [
512
- {
513
- "name": "meta.definition.generic.v",
514
- "match": "(\\\u003c)([0-9a-zA-Z_]+)(\\\u003e)",
515
- "captures": {
516
- "1": {
517
- "name": "punctuation.definition.bracket.angle.begin.v"
518
- },
519
- "2": {
520
- "patterns": [
521
- {
522
- "name": "invalid.illegal.v",
523
- "match": "\\d\\w+"
524
- },
525
- {
526
- "name": "entity.name.generic.v",
527
- "match": "\\w+"
528
- }
529
- ]
317
+ "flag-decl": {
318
+ "name": "meta.flag.v",
319
+ "begin": "^\\s*(#flag)",
320
+ "end": "\\s+(.*?)$",
321
+ "beginCaptures": {
322
+ "1": {
323
+ "name": "keyword.flag.v"
324
+ }
325
+ },
326
+ "endCaptures": {
327
+ "1": {
328
+ "name": "string.quoted.single.v"
329
+ }
330
+ }
331
+ },
332
+ "function-decl": {
333
+ "name": "meta.definition.function.v",
334
+ "begin": "^\\s*(pub)?\\s*(fn)\\s+",
335
+ "end": "(?:(?:C\\.)?)(\\w+)\\s*((?\u003c=[\\w\\s+])(\\\u003c)(\\w+)(\\\u003e))?",
336
+ "beginCaptures": {
337
+ "1": {
338
+ "name": "storage.modifier.v"
339
+ },
340
+ "2": {
341
+ "name": "keyword.function.v"
342
+ }
343
+ },
344
+ "endCaptures": {
345
+ "1": {
346
+ "patterns": [
347
+ {
348
+ "include": "#illegal-name"
530
349
  },
531
- "3": {
532
- "name": "punctuation.definition.bracket.angle.end.v"
350
+ {
351
+ "name": "entity.name.function.v",
352
+ "match": "\\w+"
533
353
  }
534
- }
354
+ ]
355
+ },
356
+ "2": {
357
+ "patterns": [
358
+ {
359
+ "include": "#generic"
360
+ }
361
+ ]
535
362
  }
536
- ]
363
+ }
537
364
  },
538
- "function-new": {
539
- "patterns": [
540
- {
541
- "name": "meta.function.v",
542
- "begin": "^\\s*(pub)?\\s*(fn)\\s+",
543
- "end": "(?:(?:C\\.)?)([0-9a-zA-Z_]+)(\\\u003c[0-9a-zA-Z_]*\\\u003e)?",
544
- "beginCaptures": {
545
- "1": {
546
- "name": "storage.modifier.v"
365
+ "function-exist": {
366
+ "name": "meta.support.function.v",
367
+ "match": "(\\w+)((?\u003c=[\\w\\s+])(\\\u003c)(\\w+)(\\\u003e))?(?=\\s*\\()",
368
+ "captures": {
369
+ "0": {
370
+ "name": "meta.function.call.v"
371
+ },
372
+ "1": {
373
+ "patterns": [
374
+ {
375
+ "include": "#illegal-name"
547
376
  },
548
- "2": {
549
- "name": "keyword.function.v"
377
+ {
378
+ "name": "entity.name.function.v",
379
+ "match": "\\w+"
550
380
  }
551
- },
552
- "endCaptures": {
553
- "0": {
554
- "name": "meta.definition.function.v"
555
- },
556
- "1": {
557
- "patterns": [
558
- {
559
- "name": "invalid.illegal.v",
560
- "match": "\\d\\w+"
561
- },
562
- {
563
- "name": "entity.name.function.v",
564
- "match": "\\w+"
565
- }
566
- ]
567
- },
568
- "2": {
569
- "patterns": [
570
- {
571
- "include": "#function-generic"
572
- }
573
- ]
381
+ ]
382
+ },
383
+ "2": {
384
+ "patterns": [
385
+ {
386
+ "include": "#generic"
574
387
  }
575
- }
388
+ ]
576
389
  }
577
- ]
390
+ }
578
391
  },
579
- "function-new-extend": {
580
- "patterns": [
581
- {
582
- "name": "meta.function.v",
583
- "match": "^\\s*(pub)?\\s*(fn)\\s+(\\()([^\\)]*)(\\))\\s*(?:(?:C\\.)?)([0-9a-zA-Z_]+)(\\\u003c[0-9a-zA-Z_]*\\\u003e)?",
584
- "captures": {
585
- "0": {
586
- "name": "meta.definition.function.v"
587
- },
588
- "1": {
589
- "name": "storage.modifier.v"
590
- },
591
- "2": {
592
- "name": "keyword.function.v"
392
+ "function-extend-decl": {
393
+ "name": "meta.definition.function.v",
394
+ "match": "^\\s*(pub)?\\s*(fn)\\s*(\\()([^\\)]*)(\\))\\s*(?:(?:C\\.)?)(\\w+)\\s*((?\u003c=[\\w\\s+])(\\\u003c)(\\w+)(\\\u003e))?",
395
+ "captures": {
396
+ "1": {
397
+ "name": "storage.modifier.v"
398
+ },
399
+ "2": {
400
+ "name": "keyword.function.v"
401
+ },
402
+ "3": {
403
+ "name": "punctuation.definition.bracket.round.begin.v"
404
+ },
405
+ "4": {
406
+ "patterns": [
407
+ {
408
+ "include": "#brackets"
593
409
  },
594
- "3": {
595
- "name": "punctuation.definition.bracket.round.begin.v"
410
+ {
411
+ "include": "#storage"
596
412
  },
597
- "4": {
598
- "patterns": [
599
- {
600
- "include": "#brackets"
601
- },
602
- {
603
- "include": "#storage"
604
- },
605
- {
606
- "include": "#generics"
607
- },
608
- {
609
- "include": "#std-types"
610
- },
611
- {
612
- "include": "#std-cbased-types"
613
- },
614
- {
615
- "include": "#punctuation"
616
- }
617
- ]
413
+ {
414
+ "include": "#generic"
618
415
  },
619
- "5": {
620
- "name": "punctuation.definition.bracket.round.end.v"
416
+ {
417
+ "include": "#types"
621
418
  },
622
- "6": {
623
- "patterns": [
624
- {
625
- "name": "invalid.illegal.v",
626
- "match": "\\d\\w+"
627
- },
628
- {
629
- "name": "entity.name.function.v",
630
- "match": "\\w+"
631
- }
632
- ]
419
+ {
420
+ "include": "#punctuation"
421
+ }
422
+ ]
423
+ },
424
+ "5": {
425
+ "name": "punctuation.definition.bracket.round.end.v"
426
+ },
427
+ "6": {
428
+ "patterns": [
429
+ {
430
+ "include": "#illegal-name"
633
431
  },
634
- "7": {
635
- "patterns": [
636
- {
637
- "include": "#function-generic"
638
- }
639
- ]
432
+ {
433
+ "name": "entity.name.function.v",
434
+ "match": "\\w+"
640
435
  }
641
- }
436
+ ]
437
+ },
438
+ "7": {
439
+ "patterns": [
440
+ {
441
+ "include": "#generic"
442
+ }
443
+ ]
642
444
  }
643
- ]
445
+ }
644
446
  },
645
- "function-new-limited-overload": {
646
- "patterns": [
647
- {
648
- "name": "meta.function.v",
649
- "match": "^\\s*(pub)?\\s*(fn)\\s+(\\()([^\\)]*)(\\))\\s*([\\+\\-\\*\\/])?\\s*(\\()([^\\)]*)(\\))\\s*(?:(?:C\\.)?)([0-9a-zA-Z_]+)",
650
- "captures": {
651
- "0": {
652
- "name": "meta.definition.function.v"
653
- },
654
- "1": {
655
- "name": "storage.modifier.v"
447
+ "function-limited-overload-decl": {
448
+ "name": "meta.definition.function.v",
449
+ "match": "^\\s*(pub)?\\s*(fn)\\s*(\\()([^\\)]*)(\\))\\s*([\\+\\-\\*\\/])?\\s*(\\()([^\\)]*)(\\))\\s*(?:(?:C\\.)?)(\\w+)",
450
+ "captures": {
451
+ "1": {
452
+ "name": "storage.modifier.v"
453
+ },
454
+ "10": {
455
+ "patterns": [
456
+ {
457
+ "include": "#illegal-name"
656
458
  },
657
- "10": {
658
- "patterns": [
659
- {
660
- "name": "invalid.illegal.v",
661
- "match": "\\d\\w+"
662
- },
663
- {
664
- "name": "entity.name.function.v",
665
- "match": "\\w+"
666
- }
667
- ]
459
+ {
460
+ "name": "entity.name.function.v",
461
+ "match": "\\w+"
462
+ }
463
+ ]
464
+ },
465
+ "2": {
466
+ "name": "keyword.function.v"
467
+ },
468
+ "3": {
469
+ "name": "punctuation.definition.bracket.round.begin.v"
470
+ },
471
+ "4": {
472
+ "patterns": [
473
+ {
474
+ "include": "#brackets"
668
475
  },
669
- "2": {
670
- "name": "keyword.function.v"
476
+ {
477
+ "include": "#storage"
671
478
  },
672
- "3": {
673
- "name": "punctuation.definition.bracket.round.begin.v"
479
+ {
480
+ "include": "#generic"
674
481
  },
675
- "4": {
676
- "patterns": [
677
- {
678
- "include": "#brackets"
679
- },
680
- {
681
- "include": "#storage"
682
- },
683
- {
684
- "include": "#generics"
685
- },
686
- {
687
- "include": "#std-types"
688
- },
689
- {
690
- "include": "#std-cbased-types"
691
- },
692
- {
693
- "include": "#punctuation"
694
- }
695
- ]
482
+ {
483
+ "include": "#types"
696
484
  },
697
- "5": {
698
- "name": "punctuation.definition.bracket.round.end.v"
485
+ {
486
+ "include": "#punctuation"
487
+ }
488
+ ]
489
+ },
490
+ "5": {
491
+ "name": "punctuation.definition.bracket.round.end.v"
492
+ },
493
+ "6": {
494
+ "patterns": [
495
+ {
496
+ "include": "#operators"
497
+ }
498
+ ]
499
+ },
500
+ "7": {
501
+ "name": "punctuation.definition.bracket.round.begin.v"
502
+ },
503
+ "8": {
504
+ "patterns": [
505
+ {
506
+ "include": "#brackets"
699
507
  },
700
- "6": {
701
- "patterns": [
702
- {
703
- "include": "#operators"
704
- }
705
- ]
508
+ {
509
+ "include": "#storage"
706
510
  },
707
- "7": {
708
- "name": "punctuation.definition.bracket.round.begin.v"
511
+ {
512
+ "include": "#generic"
709
513
  },
710
- "8": {
711
- "patterns": [
712
- {
713
- "include": "#brackets"
714
- },
715
- {
716
- "include": "#storage"
717
- },
718
- {
719
- "include": "#generics"
720
- },
721
- {
722
- "include": "#std-types"
723
- },
724
- {
725
- "include": "#std-cbased-types"
726
- },
727
- {
728
- "include": "#punctuation"
729
- }
730
- ]
514
+ {
515
+ "include": "#types"
731
516
  },
732
- "9": {
733
- "name": "punctuation.definition.bracket.round.end.v"
517
+ {
518
+ "include": "#punctuation"
734
519
  }
735
- }
520
+ ]
521
+ },
522
+ "9": {
523
+ "name": "punctuation.definition.bracket.round.end.v"
736
524
  }
737
- ]
525
+ }
738
526
  },
739
- "generics": {
527
+ "generic": {
740
528
  "patterns": [
741
529
  {
742
530
  "name": "meta.definition.generic.v",
743
- "match": "(?\u003c=[\\w\\s])(\\\u003c)([0-9a-zA-Z_]+)(\\\u003e)",
531
+ "match": "(?\u003c=[\\w\\s+])(\\\u003c)(\\w+)(\\\u003e)",
744
532
  "captures": {
745
533
  "1": {
746
534
  "name": "punctuation.definition.bracket.angle.begin.v"
@@ -748,8 +536,7 @@
748
536
  "2": {
749
537
  "patterns": [
750
538
  {
751
- "name": "invalid.illegal.v",
752
- "match": "\\d\\w+"
539
+ "include": "#illegal-name"
753
540
  },
754
541
  {
755
542
  "name": "entity.name.generic.v",
@@ -764,115 +551,107 @@
764
551
  }
765
552
  ]
766
553
  },
554
+ "illegal-name": {
555
+ "name": "invalid.illegal.v",
556
+ "match": "\\d\\w+"
557
+ },
558
+ "import-decl": {
559
+ "name": "meta.import.v",
560
+ "begin": "^\\s*(import)\\s+",
561
+ "end": "([\\w.]+)",
562
+ "beginCaptures": {
563
+ "1": {
564
+ "name": "keyword.import.v"
565
+ }
566
+ },
567
+ "endCaptures": {
568
+ "1": {
569
+ "name": "entity.name.import.v"
570
+ }
571
+ }
572
+ },
573
+ "include-decl": {
574
+ "name": "meta.include.v",
575
+ "begin": "^\\s*(#include)",
576
+ "end": "\\s+(([\\\u003c\"])\\s*(.*)([\\\u003e\"]))",
577
+ "beginCaptures": {
578
+ "1": {
579
+ "name": "keyword.include.v"
580
+ }
581
+ },
582
+ "endCaptures": {
583
+ "1": {
584
+ "name": "string.quoted.double.v"
585
+ }
586
+ }
587
+ },
767
588
  "interface": {
768
- "patterns": [
769
- {
770
- "name": "meta.definition.interface.v",
771
- "match": "^\\s*(\\binterface\\b)\\s+([0-9a-zA-Z_]*)",
772
- "captures": {
773
- "1": {
774
- "name": "keyword.interface.v"
589
+ "name": "meta.definition.interface.v",
590
+ "match": "^\\s*(?:(pub)?\\s+)?(interface)\\s+(\\w*)",
591
+ "captures": {
592
+ "1": {
593
+ "name": "storage.modifier.$1.v"
594
+ },
595
+ "2": {
596
+ "name": "keyword.interface.v"
597
+ },
598
+ "3": {
599
+ "patterns": [
600
+ {
601
+ "include": "#illegal-name"
775
602
  },
776
- "2": {
777
- "patterns": [
778
- {
779
- "name": "invalid.illegal.v",
780
- "match": "\\d\\w+"
781
- },
782
- {
783
- "name": "entity.name.interface.v",
784
- "match": "\\w+"
785
- }
786
- ]
603
+ {
604
+ "name": "entity.name.interface.v",
605
+ "match": "\\w+"
787
606
  }
788
- }
607
+ ]
789
608
  }
790
- ]
609
+ }
791
610
  },
792
611
  "keywords": {
793
612
  "patterns": [
794
613
  {
795
614
  "name": "keyword.control.v",
796
- "match": "\\b(in|or|break|continue|default|match|if|else|for|go|goto|defer|return)\\b"
615
+ "match": "(\\$if|\\$else)"
797
616
  },
798
617
  {
799
618
  "name": "keyword.control.v",
800
- "match": "(\\$if)"
619
+ "match": "\\b(in|or|break|continue|default|unsafe|match|if|else|for|go|goto|defer|return)\\b"
801
620
  },
802
621
  {
803
- "name": "keyword.control.v",
804
- "match": "(\\$else)"
805
- },
806
- {
807
- "name": "keyword.type.v",
808
- "match": "\\btype\\b"
809
- },
810
- {
811
- "name": "keyword.enum.v",
812
- "match": "\\benum\\b"
813
- },
814
- {
815
- "name": "keyword.struct.v",
816
- "match": "\\bstruct\\b"
817
- },
818
- {
819
- "name": "keyword.interface.v",
820
- "match": "\\binterface\\b"
821
- },
822
- {
823
- "name": "keyword.map.v",
824
- "match": "\\bmap\\b"
825
- },
826
- {
827
- "name": "keyword.assert.v",
828
- "match": "\\bassert\\b"
829
- },
830
- {
831
- "name": "keyword.sizeof.v",
832
- "match": "\\bsizeof\\b"
622
+ "name": "keyword.$1.v",
623
+ "match": "\\b(fn|type|enum|struct|interface|map|assert|sizeof)\\b"
833
624
  }
834
625
  ]
835
626
  },
627
+ "module-decl": {
628
+ "name": "meta.module.v",
629
+ "begin": "^\\s*(module)\\s+",
630
+ "end": "([\\w.]+)",
631
+ "beginCaptures": {
632
+ "1": {
633
+ "name": "keyword.module.v"
634
+ }
635
+ },
636
+ "endCaptures": {
637
+ "1": {
638
+ "name": "entity.name.module.v"
639
+ }
640
+ }
641
+ },
836
642
  "numbers": {
837
643
  "patterns": [
838
644
  {
839
- "match": "([-]?)([0-9e]*)([.]){1}([0-9]+)",
840
- "captures": {
841
- "1": {
842
- "name": "constant.numeric.float.v"
843
- },
844
- "2": {
845
- "name": "constant.numeric.float.v"
846
- },
847
- "3": {
848
- "name": "constant.numeric.float.v"
849
- },
850
- "4": {
851
- "name": "constant.numeric.float.v"
852
- }
853
- }
645
+ "name": "constant.numeric.float.v",
646
+ "match": "(?:(?:[-]?)(?:[0-9e]*)(?:[.]){1}(?:[0-9]+))"
854
647
  },
855
648
  {
856
- "match": "(0[xX])([0-9a-fA-F]+)",
857
- "captures": {
858
- "1": {
859
- "name": "constant.numeric.hex.v"
860
- },
861
- "2": {
862
- "name": "constant.numeric.hex.v"
863
- }
864
- }
649
+ "name": "constant.numeric.hex.v",
650
+ "match": "\\b(?:0[xX])(?:[0-9a-fA-F]+)"
865
651
  },
866
652
  {
867
- "match": "\\b([-]?)([0-9]+)",
868
- "captures": {
869
- "1": {
870
- "name": "constant.numeric.integer.v"
871
- },
872
- "2": {
873
- "name": "constant.numeric.integer.v"
874
- }
875
- }
653
+ "name": "constant.numeric.integer.v",
654
+ "match": "\\b(?:[-]?)(?:[0-9]+)"
876
655
  }
877
656
  ]
878
657
  },
@@ -883,106 +662,50 @@
883
662
  "match": "(\\+|\\-|\\*|\\/|\\%|\\+\\+|\\-\\-)"
884
663
  },
885
664
  {
886
- "name": "keyword.operator.relation.v",
887
- "match": "(\\=\\=|\\!\\=|\\\u003e|\\\u003c|\\\u003e\\=|\\\u003c\\=)"
888
- },
889
- {
890
- "name": "keyword.operator.logical.v",
891
- "match": "(\\\u0026\\\u0026|\\|\\||\\!)"
665
+ "name": "keyword.operator.assignment.v",
666
+ "match": "(\\:\\=|\\=|\\+\\=|\\-\\=|\\*\\=|\\/\\=|\\%\\=|\\\u0026\\=|\\|\\=|\\^\\=|\\\u0026\\\u0026\\=|\\|\\|\\=|\\\u003e\\\u003e\\=|\\\u003c\\\u003c\\=)"
892
667
  },
893
668
  {
894
669
  "name": "keyword.operator.bitwise.v",
895
670
  "match": "(\\\u0026|\\||\\^|\u003c(?!\u003c)|\u003e(?!\u003e))"
896
671
  },
897
672
  {
898
- "name": "keyword.operator.assignment.v",
899
- "match": "(\\:\\=|\\=|\\+\\=|\\-\\=|\\*\\=|\\/\\=|\\%\\=|\\\u0026\\=|\\|\\=|\\^\\=|\\\u0026\\\u0026\\=|\\|\\|\\=|\\\u003e\\\u003e\\=|\\\u003c\\\u003c\\=)"
673
+ "name": "keyword.operator.logical.v",
674
+ "match": "(\\\u0026\\\u0026|\\|\\||\\!)"
675
+ },
676
+ {
677
+ "name": "keyword.operator.relation.v",
678
+ "match": "(\\=\\=|\\!\\=|\\\u003e|\\\u003c|\\\u003e\\=|\\\u003c\\=)"
900
679
  }
901
680
  ]
902
681
  },
903
682
  "punctuation": {
904
683
  "patterns": [
905
684
  {
906
- "name": "punctuation.other.dot.v",
685
+ "name": "punctuation.delimiter.period.dot.v",
907
686
  "match": "\\."
908
687
  },
909
688
  {
910
- "name": "punctuation.other.comma.v",
911
- "match": "\\,"
689
+ "name": "punctuation.delimiter.comma.v",
690
+ "match": ","
912
691
  },
913
692
  {
914
- "name": "punctuation.other.colon.v",
915
- "match": "\\:"
693
+ "name": "punctuation.separator.key-value.colon.v",
694
+ "match": ":"
916
695
  },
917
696
  {
918
- "name": "punctuation.other.semicolon.v",
919
- "match": "\\;"
697
+ "name": "punctuation.definition.other.semicolon.v",
698
+ "match": ";"
920
699
  },
921
700
  {
922
- "name": "punctuation.other.questionmark.v",
701
+ "name": "punctuation.definition.other.questionmark.v",
923
702
  "match": "\\?"
924
703
  }
925
704
  ]
926
705
  },
927
- "std-cbased-types": {
928
- "patterns": [
929
- {
930
- "name": "storage.type.numeric.cbased.v",
931
- "match": "\\b(size_t|ptrdiff_t)\\b"
932
- }
933
- ]
934
- },
935
- "std-types": {
936
- "patterns": [
937
- {
938
- "name": "storage.type.boolean.v",
939
- "match": "\\bbool\\b"
940
- },
941
- {
942
- "name": "storage.type.byte.v",
943
- "match": "\\bbyte\\b"
944
- },
945
- {
946
- "name": "storage.type.byteptr.v",
947
- "match": "\\bbyteptr\\b"
948
- },
949
- {
950
- "name": "storage.type.voidptr.v",
951
- "match": "\\bvoidptr\\b"
952
- },
953
- {
954
- "name": "storage.type.string.v",
955
- "match": "\\bstring\\b"
956
- },
957
- {
958
- "name": "storage.type.ustring.v",
959
- "match": "\\bustring\\b"
960
- },
961
- {
962
- "name": "storage.type.rune.v",
963
- "match": "\\brune\\b"
964
- },
965
- {
966
- "name": "storage.type.option.v",
967
- "match": "\\boption\\b"
968
- },
969
- {
970
- "name": "storage.type.numeric.v",
971
- "match": "\\b(i(8|16|nt|64|128)|u(16|32|64|u128)|f(32|64))\\b"
972
- },
973
- {
974
- "name": "storage.type.none.v",
975
- "match": "\\bnone\\b"
976
- }
977
- ]
978
- },
979
706
  "storage": {
980
- "patterns": [
981
- {
982
- "name": "storage.modifier.v",
983
- "match": "\\b(const|mut|pub)\\b"
984
- }
985
- ]
707
+ "name": "storage.modifier.v",
708
+ "match": "\\b(const|mut|pub)\\b"
986
709
  },
987
710
  "string-escaped-char": {
988
711
  "patterns": [
@@ -997,47 +720,39 @@
997
720
  ]
998
721
  },
999
722
  "string-interpolation": {
1000
- "patterns": [
1001
- {
1002
- "name": "meta.string.interpolation.v",
1003
- "match": "(\\$([0-9a-zA-Z_.]+|\\{.*?\\}))",
1004
- "captures": {
1005
- "1": {
1006
- "patterns": [
1007
- {
1008
- "name": "invalid.illegal.v",
1009
- "match": "\\$\\d[\\.\\w]+"
1010
- },
1011
- {
1012
- "name": "variable.other.interpolated.v",
1013
- "match": "\\$([\\.\\w]+|\\{.*?\\})"
1014
- }
1015
- ]
723
+ "name": "meta.string.interpolation.v",
724
+ "match": "(\\$([\\w.]+|\\{.*?\\}))",
725
+ "captures": {
726
+ "1": {
727
+ "patterns": [
728
+ {
729
+ "name": "invalid.illegal.v",
730
+ "match": "\\$\\d[\\.\\w]+"
731
+ },
732
+ {
733
+ "name": "variable.other.interpolated.v",
734
+ "match": "\\$([\\.\\w]+|\\{.*?\\})"
1016
735
  }
1017
- }
736
+ ]
1018
737
  }
1019
- ]
738
+ }
1020
739
  },
1021
740
  "string-placeholder": {
1022
- "patterns": [
1023
- {
1024
- "name": "constant.other.placeholder.v",
1025
- "match": "%(\\[\\d+\\])?([\\+#\\-0\\x20]{,2}((\\d+|\\*)?(\\.?(\\d+|\\*|(\\[\\d+\\])\\*?)?(\\[\\d+\\])?)?))?[vT%tbcdoqxXUbeEfFgGsp]"
1026
- }
1027
- ]
741
+ "name": "constant.other.placeholder.v",
742
+ "match": "%(\\[\\d+\\])?([\\+#\\-0\\x20]{,2}((\\d+|\\*)?(\\.?(\\d+|\\*|(\\[\\d+\\])\\*?)?(\\[\\d+\\])?)?))?[vT%tbcdoqxXUbeEfFgGsp]"
1028
743
  },
1029
744
  "strings": {
1030
745
  "patterns": [
1031
746
  {
1032
747
  "name": "string.quoted.raw.v",
1033
- "begin": "\\`",
1034
- "end": "\\`",
748
+ "begin": "`",
749
+ "end": "`",
1035
750
  "patterns": [
1036
751
  {
1037
- "include": "#string-interpolation"
752
+ "include": "#string-escaped-char"
1038
753
  },
1039
754
  {
1040
- "include": "#string-escaped-char"
755
+ "include": "#string-interpolation"
1041
756
  },
1042
757
  {
1043
758
  "include": "#string-placeholder"
@@ -1056,14 +771,14 @@
1056
771
  },
1057
772
  {
1058
773
  "name": "string.quoted.single.v",
1059
- "begin": "\\'",
1060
- "end": "\\'",
774
+ "begin": "'",
775
+ "end": "'",
1061
776
  "patterns": [
1062
777
  {
1063
- "include": "#string-interpolation"
778
+ "include": "#string-escaped-char"
1064
779
  },
1065
780
  {
1066
- "include": "#string-escaped-char"
781
+ "include": "#string-interpolation"
1067
782
  },
1068
783
  {
1069
784
  "include": "#string-placeholder"
@@ -1086,10 +801,10 @@
1086
801
  "end": "\"",
1087
802
  "patterns": [
1088
803
  {
1089
- "include": "#string-interpolation"
804
+ "include": "#string-escaped-char"
1090
805
  },
1091
806
  {
1092
- "include": "#string-escaped-char"
807
+ "include": "#string-interpolation"
1093
808
  },
1094
809
  {
1095
810
  "include": "#string-placeholder"
@@ -1112,113 +827,151 @@
1112
827
  "patterns": [
1113
828
  {
1114
829
  "name": "meta.definition.struct.v",
1115
- "match": "^\\s*(\\bstruct\\b)\\s+(?:[0-9a-zA-Z_]+\\.)?([0-9a-zA-Z_]*)",
1116
- "captures": {
1117
- "1": {
1118
- "name": "keyword.struct.v"
830
+ "begin": "^\\s*(?:(mut|pub(?:\\s+mut)?|__global)\\s+)?(struct)\\s+([\\w.]+)\\s*({)",
831
+ "end": "\\s*(})",
832
+ "patterns": [
833
+ {
834
+ "include": "#struct-access-modifier"
1119
835
  },
1120
- "2": {
1121
- "patterns": [
1122
- {
1123
- "name": "invalid.illegal.v",
1124
- "match": "\\d\\w+"
836
+ {
837
+ "match": "\\b(\\w+)\\s+([\\w\\[\\]\\*\u0026.]+)(?:\\s*(=)\\s*((?:.(?=$|//|/\\*))*+))?",
838
+ "captures": {
839
+ "1": {
840
+ "name": "variable.other.property.v"
1125
841
  },
1126
- {
1127
- "name": "entity.name.struct.v",
1128
- "match": "\\w+"
842
+ "2": {
843
+ "patterns": [
844
+ {
845
+ "include": "#numbers"
846
+ },
847
+ {
848
+ "include": "#brackets"
849
+ },
850
+ {
851
+ "include": "#types"
852
+ },
853
+ {
854
+ "name": "storage.type.other.v",
855
+ "match": "\\w+"
856
+ }
857
+ ]
858
+ },
859
+ "3": {
860
+ "name": "keyword.operator.assignment.v"
861
+ },
862
+ "4": {
863
+ "patterns": [
864
+ {
865
+ "include": "$self"
866
+ }
867
+ ]
1129
868
  }
1130
- ]
869
+ }
870
+ },
871
+ {
872
+ "include": "#types"
873
+ },
874
+ {
875
+ "include": "$self"
1131
876
  }
1132
- }
1133
- }
1134
- ]
1135
- },
1136
- "type": {
1137
- "patterns": [
1138
- {
1139
- "name": "meta.definition.type.v",
1140
- "match": "^\\s*(\\btype\\b)\\s+([0-9a-zA-Z_]*)\\s+(?:[0-9a-zA-Z]+\\.+)?([0-9a-zA-Z_]*)",
1141
- "captures": {
877
+ ],
878
+ "beginCaptures": {
1142
879
  "1": {
1143
- "name": "keyword.type.v"
880
+ "name": "storage.modifier.$1.v"
1144
881
  },
1145
882
  "2": {
1146
- "patterns": [
1147
- {
1148
- "name": "invalid.illegal.v",
1149
- "match": "\\d\\w+"
1150
- },
1151
- {
1152
- "name": "entity.name.type.v",
1153
- "match": "\\w+"
1154
- }
1155
- ]
883
+ "name": "storage.type.struct.v"
1156
884
  },
1157
885
  "3": {
1158
- "patterns": [
1159
- {
1160
- "name": "invalid.illegal.v",
1161
- "match": "\\d\\w+"
1162
- },
1163
- {
1164
- "name": "entity.name.type.v",
1165
- "match": "\\w+"
1166
- }
1167
- ]
886
+ "name": "entity.name.struct.v"
887
+ },
888
+ "4": {
889
+ "name": "punctuation.definition.bracket.curly.begin.v"
1168
890
  }
1169
- }
1170
- }
1171
- ]
1172
- },
1173
- "variable-assignment": {
1174
- "patterns": [
1175
- {
1176
- "match": "(match|if|else)(?=\\s*\\=\\\u003e)",
1177
- "captures": {
891
+ },
892
+ "endCaptures": {
1178
893
  "1": {
1179
- "name": "keyword.control.v"
894
+ "name": "punctuation.definition.bracket.curly.end.v"
1180
895
  }
1181
896
  }
1182
897
  },
1183
898
  {
1184
- "name": "meta.definition.var.v",
1185
- "match": "([0-9a-zA-Z_.]+)\\s*((?:\\:|\\+|\\-|\\*|\\/|\\%|\\\u0026|\\||\\^)?=)\\s*(?=.+)",
899
+ "name": "meta.definition.struct.v",
900
+ "match": "^\\s*(?:(mut|pub(?:\\s+mut)?|__global)\\s+)?(struct)(?:\\s+([\\w.]+))?",
1186
901
  "captures": {
1187
902
  "1": {
1188
- "name": "variable.other.v"
903
+ "name": "storage.modifier.$1.v"
1189
904
  },
1190
905
  "2": {
1191
- "name": "keyword.operator.assignment.v"
906
+ "name": "storage.type.struct.v"
907
+ },
908
+ "3": {
909
+ "name": "entity.name.struct.v"
1192
910
  }
1193
911
  }
1194
912
  }
1195
913
  ]
1196
914
  },
1197
- "variable-increment-decrement": {
1198
- "patterns": [
1199
- {
1200
- "name": "meta.var.increment.expr.v",
1201
- "match": "([0-9a-zA-Z_.]+)(\\+\\+)",
1202
- "captures": {
1203
- "1": {
1204
- "name": "variable.other.increment.v"
915
+ "struct-access-modifier": {
916
+ "match": "(?\u003c=\\s|^)(mut|pub(?:\\s+mut)?|__global)(:|\\b)",
917
+ "captures": {
918
+ "1": {
919
+ "name": "storage.modifier.$1.v"
920
+ },
921
+ "2": {
922
+ "name": "punctuation.separator.struct.key-value.v"
923
+ }
924
+ }
925
+ },
926
+ "type": {
927
+ "name": "meta.definition.type.v",
928
+ "match": "^\\s*(?:(pub)?\\s+)?(type)\\s+(\\w*)\\s+(?:\\w+\\.+)?(\\w*)",
929
+ "captures": {
930
+ "1": {
931
+ "name": "storage.modifier.$1.v"
932
+ },
933
+ "2": {
934
+ "name": "storage.type.type.v"
935
+ },
936
+ "3": {
937
+ "patterns": [
938
+ {
939
+ "include": "#illegal-name"
1205
940
  },
1206
- "2": {
1207
- "name": "keyword.operator.increment.v"
941
+ {
942
+ "include": "#types"
943
+ },
944
+ {
945
+ "name": "entity.name.type.v",
946
+ "match": "\\w+"
1208
947
  }
1209
- }
948
+ ]
1210
949
  },
1211
- {
1212
- "name": "meta.var.decrement.expr.v",
1213
- "match": "([0-9a-zA-Z_.]+)(\\-\\-)",
1214
- "captures": {
1215
- "1": {
1216
- "name": "variable.other.decrement.v"
950
+ "4": {
951
+ "patterns": [
952
+ {
953
+ "include": "#illegal-name"
1217
954
  },
1218
- "2": {
1219
- "name": "keyword.operator.decrement.v"
955
+ {
956
+ "include": "#types"
957
+ },
958
+ {
959
+ "name": "entity.name.type.v",
960
+ "match": "\\w+"
1220
961
  }
1221
- }
962
+ ]
963
+ }
964
+ }
965
+ },
966
+ "types": {
967
+ "patterns": [
968
+ {
969
+ "name": "storage.type.numeric.v",
970
+ "match": "\\b(i(8|16|nt|64|128)|u(8|16|32|64|128)|f(32|64))\\b"
971
+ },
972
+ {
973
+ "name": "storage.type.$1.v",
974
+ "match": "\\b(bool|byte|byteptr|charptr|voidptr|string|ustring|rune|none)\\b"
1222
975
  }
1223
976
  ]
1224
977
  }