@codingame/monaco-editor-wrapper 3.9.3 → 4.0.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (537) hide show
  1. package/dist/C2Hs-configuration.json.js +3 -0
  2. package/dist/C2Hs.json.js +3 -0
  3. package/dist/COBOL.tmLanguage.json.js +3 -0
  4. package/dist/Erlang.plist.js +2 -1751
  5. package/dist/Hsc2Hs-configuration.json.js +3 -0
  6. package/dist/Hsc2Hs.json.js +3 -0
  7. package/dist/JavaProperties.tmLanguage.json.js +3 -0
  8. package/dist/Kotlin.tmLanguage.js +2 -723
  9. package/dist/META.json.js +3 -0
  10. package/dist/META.json2.js +3 -0
  11. package/dist/Markdown Redcarpet.json.js +3 -0
  12. package/dist/RMarkdown.json.js +3 -0
  13. package/dist/Rcpp.json.js +3 -0
  14. package/dist/Rd (R Documentation).json.js +3 -0
  15. package/dist/Scala.tmLanguage.json.js +3 -0
  16. package/dist/_commonjsHelpers.js +35 -0
  17. package/dist/_rollupPluginBabelHelpers.js +1 -1
  18. package/dist/add.svg.js +3 -0
  19. package/dist/add.svg2.js +3 -0
  20. package/dist/adddep-dark.svg.js +3 -0
  21. package/dist/adddep-light.svg.js +3 -0
  22. package/dist/alex.json.js +3 -0
  23. package/dist/angular-directives.json.js +3 -0
  24. package/dist/angular-interpolations.json.js +3 -0
  25. package/dist/angular-template-language-configuration.json.js +3 -0
  26. package/dist/arrow-circle-up-dark.svg.js +3 -0
  27. package/dist/arrow-circle-up-light.svg.js +3 -0
  28. package/dist/aspnetcorerazor.tmLanguage.json.js +3 -0
  29. package/dist/atd.json.js +3 -0
  30. package/dist/book-dark.svg.js +3 -0
  31. package/dist/book-light.svg.js +3 -0
  32. package/dist/book-open-dark.svg.js +3 -0
  33. package/dist/book-open-light.svg.js +3 -0
  34. package/dist/buildtarget.json.js +3 -0
  35. package/dist/cabal-configuration.json.js +3 -0
  36. package/dist/cabal.json.js +3 -0
  37. package/dist/codeblock-cabal.json.js +3 -0
  38. package/dist/codeblock-haskell.json.js +3 -0
  39. package/dist/codeblock-literate-haskell.json.js +3 -0
  40. package/dist/codeblock.json.js +3 -0
  41. package/dist/codeblock.json2.js +3 -0
  42. package/dist/configuration/index.d.ts +0 -1
  43. package/dist/cram.json.js +3 -0
  44. package/dist/csharp.json.js +3 -0
  45. package/dist/css.worker.js +1 -1
  46. package/dist/d.json.js +3 -0
  47. package/dist/d.json2.js +3 -0
  48. package/dist/dart-language-configuration.json.js +3 -0
  49. package/dist/dart.json.js +3 -0
  50. package/dist/dcf-configuration.json.js +3 -0
  51. package/dist/dcf.json.js +3 -0
  52. package/dist/diet.json.js +3 -0
  53. package/dist/diet.json2.js +3 -0
  54. package/dist/diet.json3.js +3 -0
  55. package/dist/django-html.tmLanguage.json.js +3 -0
  56. package/dist/django-txt.tmLanguage.json.js +3 -0
  57. package/dist/dml.json.js +3 -0
  58. package/dist/document-search-dark.svg.js +3 -0
  59. package/dist/document-search-light.svg.js +3 -0
  60. package/dist/documentation-inverse.svg.js +3 -0
  61. package/dist/documentation.svg.js +3 -0
  62. package/dist/dub-convert-inverse.svg.js +3 -0
  63. package/dist/dub-convert.svg.js +3 -0
  64. package/dist/dune-project.json.js +3 -0
  65. package/dist/dune-project.json2.js +3 -0
  66. package/dist/dune-workspace.json.js +3 -0
  67. package/dist/dune.json.js +3 -0
  68. package/dist/dune.json2.js +3 -0
  69. package/dist/dune.json3.js +3 -0
  70. package/dist/edit-dub-inverse.svg.js +3 -0
  71. package/dist/edit-dub.svg.js +3 -0
  72. package/dist/edit-source-inverse.svg.js +3 -0
  73. package/dist/edit-source.svg.js +3 -0
  74. package/dist/eex-language-configuration.json.js +3 -0
  75. package/dist/eex.json.js +3 -0
  76. package/dist/elixir-language-configuration.json.js +3 -0
  77. package/dist/elixir.json.js +3 -0
  78. package/dist/erlang.configuration.json.js +3 -0
  79. package/dist/erlang.json.js +3 -0
  80. package/dist/expression.json.js +3 -0
  81. package/dist/extension-web.js.js +3 -0
  82. package/dist/extension-web.js2.js +3 -0
  83. package/dist/extension.browser.js.js +3 -0
  84. package/dist/extensions.d.ts +35 -0
  85. package/dist/features/htmlContribution.js +0 -1
  86. package/dist/features/jsonContribution.d.ts +2 -4
  87. package/dist/features/jsonContribution.js +10 -29
  88. package/dist/features/typescriptContribution.js +2 -2
  89. package/dist/file_type_java.svg.js +3 -0
  90. package/dist/file_type_scala.svg.js +3 -0
  91. package/dist/filters.json.js +3 -0
  92. package/dist/focus-dark.svg.js +3 -0
  93. package/dist/focus-light.svg.js +3 -0
  94. package/dist/general.json.js +3 -0
  95. package/dist/get-inverse.svg.js +3 -0
  96. package/dist/get.svg.js +3 -0
  97. package/dist/go.json.js +3 -0
  98. package/dist/go.mod.language-configuration.json.js +3 -0
  99. package/dist/go.mod.tmGrammar.json.js +3 -0
  100. package/dist/go.sum.tmGrammar.json.js +3 -0
  101. package/dist/govulncheck.tmGrammar.json.js +3 -0
  102. package/dist/happy.json.js +3 -0
  103. package/dist/haskell-configuration.json.js +3 -0
  104. package/dist/haskell.json.js +3 -0
  105. package/dist/hot-reload-tb.png.js +3 -0
  106. package/dist/hot-reload.svg.js +3 -0
  107. package/dist/html-eex.json.js +3 -0
  108. package/dist/html.worker.js +1 -1
  109. package/dist/index.d.ts +2 -3
  110. package/dist/index.js +9 -6
  111. package/dist/index2.js +2 -1351
  112. package/dist/inline-styles.json.js +3 -0
  113. package/dist/inline-template.json.js +3 -0
  114. package/dist/inspector.svg.js +3 -0
  115. package/dist/java-properties-configuration.json.js +3 -0
  116. package/dist/java.json.js +3 -0
  117. package/dist/javascript.json.js +3 -0
  118. package/dist/json.worker.js +1 -1
  119. package/dist/jvm-bytecode-verbose.json.js +3 -0
  120. package/dist/jvm-bytecode.json.js +3 -0
  121. package/dist/kotlin.configuration.json.js +3 -0
  122. package/dist/kotlin.json.js +3 -0
  123. package/dist/lang-config.json.js +3 -0
  124. package/dist/language-configuration.json.js +3 -0
  125. package/dist/language-configuration.json2.js +3 -0
  126. package/dist/language-configuration.json3.js +3 -0
  127. package/dist/language-configuration.json4.js +3 -0
  128. package/dist/language-configuration.json5.js +3 -0
  129. package/dist/language-configuration.json6.js +3 -0
  130. package/dist/language-configuration.json7.js +3 -0
  131. package/dist/language-configuration.json8.js +3 -0
  132. package/dist/languages/index.d.ts +0 -2
  133. package/dist/literate-haskell-configuration.json.js +3 -0
  134. package/dist/literateHaskell.json.js +3 -0
  135. package/dist/main.js +839 -3115
  136. package/dist/markdown-svelte-css.json.js +3 -0
  137. package/dist/markdown-svelte-js.json.js +3 -0
  138. package/dist/markdown-svelte.json.js +3 -0
  139. package/dist/menhir-action.json.js +3 -0
  140. package/dist/menhir.json.js +3 -0
  141. package/dist/menhir.json2.js +3 -0
  142. package/dist/merlin.json.js +3 -0
  143. package/dist/monaco.d.ts +6 -9
  144. package/dist/oasis.json.js +3 -0
  145. package/dist/oasis.json2.js +3 -0
  146. package/dist/ocaml-markdown-codeblock.json.js +3 -0
  147. package/dist/ocaml.interface.json.js +3 -0
  148. package/dist/ocaml.json.js +3 -0
  149. package/dist/ocaml.json2.js +3 -0
  150. package/dist/ocaml.json3.js +3 -0
  151. package/dist/ocamlbuild.json.js +3 -0
  152. package/dist/ocamlbuild.json2.js +3 -0
  153. package/dist/ocamldoc.json.js +3 -0
  154. package/dist/ocamlformat.json.js +3 -0
  155. package/dist/ocamlformat.json2.js +3 -0
  156. package/dist/ocamllex.json.js +3 -0
  157. package/dist/ocamllex.json2.js +3 -0
  158. package/dist/ocamllex.json3.js +3 -0
  159. package/dist/opam-install.json.js +3 -0
  160. package/dist/opam-install.json2.js +3 -0
  161. package/dist/opam.json.js +3 -0
  162. package/dist/opam.json2.js +3 -0
  163. package/dist/outdated-inverse.svg.js +3 -0
  164. package/dist/outdated.svg.js +3 -0
  165. package/dist/pascal.configuration.json.js +3 -0
  166. package/dist/pascal.json.js +3 -0
  167. package/dist/pascal.tmLanguage.js +2 -168
  168. package/dist/performance.svg.js +3 -0
  169. package/dist/pgsql.tmLanguage.js +2 -283
  170. package/dist/pip-requirements.json.js +3 -0
  171. package/dist/pip-requirements.tmLanguage.json.js +3 -0
  172. package/dist/plus-dark.svg.js +3 -0
  173. package/dist/plus-light.svg.js +3 -0
  174. package/dist/postcss.json.js +3 -0
  175. package/dist/preview-right-dark.svg.js +3 -0
  176. package/dist/preview-right-light.svg.js +3 -0
  177. package/dist/pug-svelte-dotblock.json.js +3 -0
  178. package/dist/pug-svelte-tags.json.js +3 -0
  179. package/dist/pug-svelte.json.js +3 -0
  180. package/dist/r-configuration.json.js +3 -0
  181. package/dist/r-snippets.json.js +3 -0
  182. package/dist/r.json.js +3 -0
  183. package/dist/rbuildignore-configuration.json.js +3 -0
  184. package/dist/rbuildignore.json.js +3 -0
  185. package/dist/rd-configuration.json.js +3 -0
  186. package/dist/reason-markdown-codeblock.json.js +3 -0
  187. package/dist/reason.json.js +3 -0
  188. package/dist/reason.json2.js +3 -0
  189. package/dist/ref-group-by-type-dark.svg.js +3 -0
  190. package/dist/ref-group-by-type-light.svg.js +3 -0
  191. package/dist/ref-ungroup-by-type-dark.svg.js +3 -0
  192. package/dist/ref-ungroup-by-type-light.svg.js +3 -0
  193. package/dist/refresh-dark.svg.js +3 -0
  194. package/dist/refresh-dark.svg2.js +3 -0
  195. package/dist/refresh-light.svg.js +3 -0
  196. package/dist/refresh-light.svg2.js +3 -0
  197. package/dist/repl.svg.js +3 -0
  198. package/dist/repl.svg2.js +3 -0
  199. package/dist/rmarkdown.json2.js +3 -0
  200. package/dist/rmd-configuration.json.js +3 -0
  201. package/dist/rnamespace-configuration.json.js +3 -0
  202. package/dist/rnamespace.json.js +3 -0
  203. package/dist/save.svg.js +3 -0
  204. package/dist/save.svg2.js +3 -0
  205. package/dist/scalameta-logo.png.js +3 -0
  206. package/dist/sdl.json.js +3 -0
  207. package/dist/semanticdb.json.js +3 -0
  208. package/dist/services.d.ts +4 -0
  209. package/dist/solidity.configuration.json.js +3 -0
  210. package/dist/solidity.json.js +3 -0
  211. package/dist/solidity.json2.js +3 -0
  212. package/dist/svelte.json.js +3 -0
  213. package/dist/svelte.tmLanguage.json.js +3 -0
  214. package/dist/switch-impl-intf.dark.svg.js +3 -0
  215. package/dist/switch-impl-intf.light.svg.js +3 -0
  216. package/dist/systemverilog.json.js +3 -0
  217. package/dist/systemverilog.tmLanguage.json.js +3 -0
  218. package/dist/tags.json.js +3 -0
  219. package/dist/tasty.json.js +3 -0
  220. package/dist/tcl.json.js +3 -0
  221. package/dist/tcl.json2.js +3 -0
  222. package/dist/template.json.js +3 -0
  223. package/dist/theme/index.d.ts +1 -4
  224. package/dist/tools/EditorOpenHandlerRegistry.d.ts +3 -2
  225. package/dist/ts.worker.js +1 -1
  226. package/dist/typescript.json.js +3 -0
  227. package/dist/upgrade-inverse.svg.js +3 -0
  228. package/dist/upgrade.svg.js +3 -0
  229. package/dist/vim.js +37 -36
  230. package/dist/vs2019_dark.json.js +3 -0
  231. package/dist/vs2019_light.json.js +3 -0
  232. package/dist/worker.js +14 -2
  233. package/dist/x-dark.svg.js +3 -0
  234. package/dist/x-light.svg.js +3 -0
  235. package/package.json +40 -42
  236. package/stats.html +90 -1429
  237. package/dist/COBOL.tmLanguage.js +0 -172
  238. package/dist/HTML (Eex)2.js +0 -100
  239. package/dist/JSON.tmLanguage.js +0 -221
  240. package/dist/JSONC.tmLanguage.js +0 -221
  241. package/dist/JavaProperties.tmLanguage.js +0 -116
  242. package/dist/JavaScript.tmLanguage.js +0 -5929
  243. package/dist/JavaScriptReact.tmLanguage.js +0 -5929
  244. package/dist/META.js +0 -100
  245. package/dist/MagicPython.tmLanguage.js +0 -4221
  246. package/dist/MagicRegExp.tmLanguage.js +0 -505
  247. package/dist/Markdown Redcarpet.js +0 -221
  248. package/dist/RMarkdown.js +0 -25
  249. package/dist/Rcpp.js +0 -50
  250. package/dist/Rd (R Documentation).js +0 -131
  251. package/dist/Regular Expressions (JavaScript).tmLanguage.js +0 -166
  252. package/dist/Scala.tmLanguage.js +0 -1324
  253. package/dist/TypeScript.tmLanguage.js +0 -5680
  254. package/dist/TypeScriptReact.tmLanguage.js +0 -5929
  255. package/dist/angular.js +0 -62
  256. package/dist/asp-vb-net.tmlanguage.js +0 -247
  257. package/dist/aspnetcorerazor.js +0 -72
  258. package/dist/aspnetcorerazor.tmLanguage.js +0 -1825
  259. package/dist/atd.js +0 -110
  260. package/dist/atd2.js +0 -114
  261. package/dist/buildignore.r.js +0 -5
  262. package/dist/buildtarget.js +0 -53
  263. package/dist/c.js +0 -101
  264. package/dist/c.tmLanguage.js +0 -3565
  265. package/dist/cabal.js +0 -10
  266. package/dist/cabal.tmLanguage.js +0 -66
  267. package/dist/clojure.js +0 -68
  268. package/dist/clojure.tmLanguage.js +0 -439
  269. package/dist/cobol.js +0 -6
  270. package/dist/cobol2.js +0 -341
  271. package/dist/codeblock-cabal.js +0 -42
  272. package/dist/codeblock-haskell.js +0 -42
  273. package/dist/codeblock-literate-haskell.js +0 -42
  274. package/dist/codeblock.js +0 -59
  275. package/dist/codeblock2.js +0 -36
  276. package/dist/codeblock3.js +0 -95
  277. package/dist/coffeescript-coffeescript.code-snippets.js +0 -18
  278. package/dist/coffeescript.js +0 -91
  279. package/dist/coffeescript.tmLanguage.js +0 -1324
  280. package/dist/configuration/files.d.ts +0 -6
  281. package/dist/cpp-c.code-snippets.js +0 -18
  282. package/dist/cpp-cpp.code-snippets.js +0 -18
  283. package/dist/cpp.js +0 -101
  284. package/dist/cpp.tmLanguage.js +0 -16648
  285. package/dist/cpptools.js +0 -2631
  286. package/dist/cram.js +0 -257
  287. package/dist/csharp.js +0 -92
  288. package/dist/csharp.tmLanguage.js +0 -4992
  289. package/dist/css.js +0 -106
  290. package/dist/css.tmLanguage.js +0 -1873
  291. package/dist/cuda-cpp.js +0 -101
  292. package/dist/cuda-cpp.tmLanguage.js +0 -19993
  293. package/dist/d-diet.js +0 -92
  294. package/dist/d.js +0 -3212
  295. package/dist/d2.js +0 -97
  296. package/dist/d3.js +0 -609
  297. package/dist/dart.js +0 -543
  298. package/dist/dart2.js +0 -103
  299. package/dist/dart3.js +0 -1130
  300. package/dist/dcf.js +0 -93
  301. package/dist/debian-control.r.js +0 -69
  302. package/dist/diet.js +0 -758
  303. package/dist/diet2.js +0 -100
  304. package/dist/django-html.js +0 -155
  305. package/dist/django-html.tmLanguage.js +0 -715
  306. package/dist/django-txt.js +0 -155
  307. package/dist/django-txt.tmLanguage.js +0 -269
  308. package/dist/dml.js +0 -169
  309. package/dist/dml2.js +0 -90
  310. package/dist/dockercompose.js +0 -82
  311. package/dist/dpp.js +0 -97
  312. package/dist/dscript.js +0 -90
  313. package/dist/dune-project.js +0 -481
  314. package/dist/dune-project2.js +0 -65
  315. package/dist/dune-workspace.js +0 -298
  316. package/dist/dune-workspace2.js +0 -65
  317. package/dist/dune.js +0 -2962
  318. package/dist/dune2.js +0 -65
  319. package/dist/eex.js +0 -55
  320. package/dist/elixir-snippets.js +0 -184
  321. package/dist/elixir.js +0 -2341
  322. package/dist/elixir2.js +0 -69
  323. package/dist/elixir3.js +0 -40
  324. package/dist/erlang-erlang.js +0 -195
  325. package/dist/erlang.js +0 -81
  326. package/dist/erlang2.js +0 -86
  327. package/dist/expression.js +0 -846
  328. package/dist/features/extensionConfigurations.d.ts +0 -1
  329. package/dist/features/extensionConfigurations.js +0 -44
  330. package/dist/fsharp-fsharp.code-snippets.js +0 -18
  331. package/dist/fsharp.js +0 -80
  332. package/dist/fsharp.tmLanguage.js +0 -1844
  333. package/dist/go.js +0 -103
  334. package/dist/go.mod.js +0 -8
  335. package/dist/go.mod.tmGrammar.js +0 -182
  336. package/dist/go.sum.tmGrammar.js +0 -55
  337. package/dist/go.tmLanguage.js +0 -1025
  338. package/dist/go.work.js +0 -8
  339. package/dist/govulncheck.tmGrammar.js +0 -138
  340. package/dist/groovy-groovy.code-snippets.js +0 -229
  341. package/dist/groovy.js +0 -79
  342. package/dist/groovy.tmLanguage.js +0 -1391
  343. package/dist/haskell.js +0 -88
  344. package/dist/haskell.tmLanguage.js +0 -629
  345. package/dist/haskell2.js +0 -16
  346. package/dist/html (eex).js +0 -31
  347. package/dist/html-derivative.tmLanguage.js +0 -57
  348. package/dist/html-html.code-snippets.js +0 -20
  349. package/dist/html.js +0 -11
  350. package/dist/html.tmLanguage.js +0 -2652
  351. package/dist/html.tmLanguage2.js +0 -107
  352. package/dist/inline-styles.js +0 -104
  353. package/dist/inline-template.js +0 -88
  354. package/dist/jade.js +0 -11
  355. package/dist/java-java.js +0 -125
  356. package/dist/java-properties.js +0 -73
  357. package/dist/java.js +0 -98
  358. package/dist/java.tmLanguage.js +0 -1863
  359. package/dist/java2.js +0 -917
  360. package/dist/javascript-javascript.code-snippets.js +0 -205
  361. package/dist/javascript.js +0 -197
  362. package/dist/javascriptreact.js +0 -197
  363. package/dist/jsdoc.js.injection.tmLanguage.js +0 -32
  364. package/dist/jsdoc.ts.injection.tmLanguage.js +0 -32
  365. package/dist/json.js +0 -75
  366. package/dist/jsonc.js +0 -75
  367. package/dist/jsx-tags.js +0 -158
  368. package/dist/julia.js +0 -89
  369. package/dist/julia.tmLanguage.js +0 -954
  370. package/dist/jvm-bytecode-verbose.js +0 -1231
  371. package/dist/jvm-bytecode.js +0 -565
  372. package/dist/kotlin-kotlin.js +0 -117
  373. package/dist/kotlin.js +0 -103
  374. package/dist/kotlinscript.js +0 -103
  375. package/dist/languages/extensions/extensionConfigurationLoader.d.ts +0 -3
  376. package/dist/languages/extensions/grammarLoader.d.ts +0 -2
  377. package/dist/languages/extensions/languageConfigurationLoader.d.ts +0 -2
  378. package/dist/languages/extensions/snippetLoader.d.ts +0 -2
  379. package/dist/languages/extensions/themeLoader.d.ts +0 -2
  380. package/dist/languages/snippets/index.d.ts +0 -1
  381. package/dist/languages/textMate/index.d.ts +0 -1
  382. package/dist/languages/textMate/semanticTokens.d.ts +0 -1
  383. package/dist/literate haskell.js +0 -88
  384. package/dist/literateHaskell.tmLanguage.js +0 -70
  385. package/dist/lua.js +0 -84
  386. package/dist/lua.tmLanguage.js +0 -914
  387. package/dist/lua2.js +0 -2853
  388. package/dist/markdown-basics-markdown.code-snippets.js +0 -121
  389. package/dist/markdown-svelte-css.js +0 -37
  390. package/dist/markdown-svelte-js.js +0 -37
  391. package/dist/markdown-svelte.js +0 -59
  392. package/dist/markdown-vue.js +0 -54
  393. package/dist/markdown.js +0 -49
  394. package/dist/markdown.tmLanguage.js +0 -3042
  395. package/dist/menhir-action.js +0 -51
  396. package/dist/menhir.js +0 -597
  397. package/dist/merlin.js +0 -111
  398. package/dist/namespace.r.js +0 -88
  399. package/dist/oasis.js +0 -99
  400. package/dist/objective-c.js +0 -79
  401. package/dist/objective-c.tmLanguage.js +0 -3763
  402. package/dist/objective-cpp.js +0 -79
  403. package/dist/ocaml-dune-project.js +0 -38
  404. package/dist/ocaml-dune.js +0 -53
  405. package/dist/ocaml-markdown-codeblock.js +0 -42
  406. package/dist/ocaml-ocaml.js +0 -88
  407. package/dist/ocaml-ocamllex.js +0 -12
  408. package/dist/ocaml.META.js +0 -29
  409. package/dist/ocaml.interface.js +0 -292
  410. package/dist/ocaml.interface2.js +0 -114
  411. package/dist/ocaml.js +0 -903
  412. package/dist/ocaml.menhir.js +0 -81
  413. package/dist/ocaml.oasis.js +0 -18
  414. package/dist/ocaml.ocamlbuild.js +0 -45
  415. package/dist/ocaml.ocamlformat.js +0 -8
  416. package/dist/ocaml.ocamllex.js +0 -60
  417. package/dist/ocaml.opam-install.js +0 -49
  418. package/dist/ocaml.opam.js +0 -69
  419. package/dist/ocaml2.js +0 -114
  420. package/dist/ocaml3.js +0 -136
  421. package/dist/ocamlbuild.js +0 -189
  422. package/dist/ocamldoc.js +0 -54
  423. package/dist/ocamlformat.js +0 -206
  424. package/dist/ocamllex.js +0 -133
  425. package/dist/omnisharp-csharp.js +0 -508
  426. package/dist/omnisharp.js +0 -594
  427. package/dist/opam-install.js +0 -40
  428. package/dist/opam.js +0 -140
  429. package/dist/pascal-pascal.js +0 -382
  430. package/dist/pascal.js +0 -80
  431. package/dist/pascal2.js +0 -26
  432. package/dist/perl.js +0 -93
  433. package/dist/perl.tmLanguage.js +0 -2986
  434. package/dist/perl6.js +0 -86
  435. package/dist/perl6.tmLanguage.js +0 -323
  436. package/dist/php-php.code-snippets.js +0 -267
  437. package/dist/php.js +0 -154
  438. package/dist/php.tmLanguage.js +0 -4036
  439. package/dist/pip-requirements.js +0 -8
  440. package/dist/pip-requirements.tmLanguage.js +0 -89
  441. package/dist/plaintext.js +0 -11
  442. package/dist/platform.tmLanguage.js +0 -1135
  443. package/dist/postcss.src.yaml.js +0 -393
  444. package/dist/postgres.js +0 -80
  445. package/dist/postgresql.js +0 -75
  446. package/dist/powershell.js +0 -107
  447. package/dist/powershell.tmLanguage.js +0 -1037
  448. package/dist/pug-svelte-dotblock.js +0 -69
  449. package/dist/pug-svelte-tags.js +0 -215
  450. package/dist/pug-svelte.js +0 -307
  451. package/dist/python.js +0 -236
  452. package/dist/r.js +0 -664
  453. package/dist/r2.js +0 -88
  454. package/dist/rbuildignore.js +0 -39
  455. package/dist/rd.js +0 -81
  456. package/dist/reason-markdown-codeblock.js +0 -42
  457. package/dist/reason.js +0 -79
  458. package/dist/rmd.js +0 -84
  459. package/dist/rnamespace.js +0 -283
  460. package/dist/ruby.js +0 -95
  461. package/dist/ruby.tmLanguage.js +0 -2784
  462. package/dist/rust.js +0 -84
  463. package/dist/rust.tmLanguage.js +0 -1178
  464. package/dist/sassdoc.tmLanguage.js +0 -362
  465. package/dist/scala.js +0 -85
  466. package/dist/scalameta.js +0 -224
  467. package/dist/scss.js +0 -117
  468. package/dist/scss.tmLanguage.js +0 -1887
  469. package/dist/sdl.js +0 -162
  470. package/dist/sdl2.js +0 -90
  471. package/dist/semanticdb.js +0 -62
  472. package/dist/shell-unix-bash.tmLanguage.js +0 -2038
  473. package/dist/shellscript.js +0 -93
  474. package/dist/solargraph.js +0 -192
  475. package/dist/solidity-solidity.js +0 -213
  476. package/dist/solidity.js +0 -1224
  477. package/dist/solidity2.js +0 -71
  478. package/dist/solidity3.js +0 -143
  479. package/dist/sql.js +0 -99
  480. package/dist/sql.tmLanguage.js +0 -636
  481. package/dist/svelte.js +0 -120
  482. package/dist/svelte.svelte-vscode-javascript.js +0 -45
  483. package/dist/svelte.svelte-vscode-svelte.js +0 -46
  484. package/dist/svelte.svelte-vscode-typescript.js +0 -43
  485. package/dist/svelte.svelte-vscode.js +0 -383
  486. package/dist/svelte.tmLanguage.src.yaml.js +0 -1099
  487. package/dist/svlangserver-systemverilog.js +0 -395
  488. package/dist/svlangserver.js +0 -85
  489. package/dist/swift-swift.code-snippets.js +0 -183
  490. package/dist/swift.js +0 -90
  491. package/dist/swift.tmLanguage.js +0 -3312
  492. package/dist/systemverilog.js +0 -187
  493. package/dist/systemverilog.tmLanguage.js +0 -1259
  494. package/dist/tasty.js +0 -72
  495. package/dist/tcl-tcl.js +0 -151
  496. package/dist/tcl.js +0 -78
  497. package/dist/tcl.tmlanguage.yaml.js +0 -5490
  498. package/dist/template.js +0 -207
  499. package/dist/theme-defaults~dark_plus.js +0 -210
  500. package/dist/theme-defaults~dark_plus_experimental.js +0 -145
  501. package/dist/theme-defaults~dark_vs.js +0 -412
  502. package/dist/theme-defaults~hc_black.js +0 -471
  503. package/dist/theme-defaults~hc_light.js +0 -595
  504. package/dist/theme-defaults~light_plus.js +0 -212
  505. package/dist/theme-defaults~light_plus_experimental.js +0 -158
  506. package/dist/theme-defaults~light_vs.js +0 -441
  507. package/dist/typescript-basics-typescript.code-snippets.js +0 -313
  508. package/dist/typescript-language-features.js +0 -1103
  509. package/dist/typescript.js +0 -216
  510. package/dist/typescriptreact.js +0 -216
  511. package/dist/vb-vb.code-snippets.js +0 -88
  512. package/dist/vb.js +0 -79
  513. package/dist/verilog.js +0 -187
  514. package/dist/volar-vue.js +0 -289
  515. package/dist/vscode-R-r-snippets.js +0 -534
  516. package/dist/vscode-R-rmarkdown.js +0 -461
  517. package/dist/vscode-R.js +0 -660
  518. package/dist/vscode-django-filters.js +0 -340
  519. package/dist/vscode-django.js +0 -37
  520. package/dist/vscode-go-go.js +0 -276
  521. package/dist/vscode-go.js +0 -1610
  522. package/dist/vscode-groovy.js +0 -28
  523. package/dist/vscode-python.js +0 -706
  524. package/dist/vue-directives.js +0 -25
  525. package/dist/vue-interpolations.js +0 -25
  526. package/dist/vue-sfc-style-variable-injection.js +0 -63
  527. package/dist/vue.js +0 -151
  528. package/dist/vue.tmLanguage.js +0 -1218
  529. package/dist/xml.js +0 -116
  530. package/dist/xml.tmLanguage.js +0 -395
  531. package/dist/xsl.js +0 -39
  532. package/dist/xsl.tmLanguage.js +0 -102
  533. package/dist/yaml.js +0 -82
  534. package/dist/yaml.tmLanguage.js +0 -629
  535. /package/dist/{extensions → editor}/autofold.d.ts +0 -0
  536. /package/dist/{extensions → editor}/cobol.d.ts +0 -0
  537. /package/dist/{extensions → editor}/index.d.ts +0 -0
@@ -1,3312 +0,0 @@
1
- var information_for_contributors = [
2
- "This file has been converted from https://github.com/microsoft/vscode/blob/master/extensions/swift/",
3
- "If you want to provide a fix or improvement, please create a pull request against the original repository.",
4
- "Once accepted there, we are happy to receive an update request."
5
- ];
6
- var version = "https://github.com/textmate/swift.tmbundle/commit/7a35637eb70aef3114b091c4ff6fbf6a2faa881b";
7
- var name = "Swift";
8
- var scopeName = "source.swift";
9
- var comment = "See swift.tmbundle/grammar-test.swift for test cases.";
10
- var patterns = [
11
- {
12
- include: "#root"
13
- }
14
- ];
15
- var repository = {
16
- "async-throws": {
17
- captures: {
18
- "1": {
19
- name: "invalid.illegal.await-must-precede-throws.swift"
20
- },
21
- "2": {
22
- name: "keyword.control.exception.swift"
23
- },
24
- "3": {
25
- name: "keyword.control.async.swift"
26
- }
27
- },
28
- match: "\\b(?:(throws\\s+async|rethrows\\s+async)|(throws|rethrows)|(async))\\b"
29
- },
30
- attributes: {
31
- patterns: [
32
- {
33
- begin: "((@)available)(\\()",
34
- beginCaptures: {
35
- "1": {
36
- name: "storage.modifier.attribute.swift"
37
- },
38
- "2": {
39
- name: "punctuation.definition.attribute.swift"
40
- },
41
- "3": {
42
- name: "punctuation.definition.arguments.begin.swift"
43
- }
44
- },
45
- end: "\\)",
46
- endCaptures: {
47
- "0": {
48
- name: "punctuation.definition.arguments.end.swift"
49
- }
50
- },
51
- name: "meta.attribute.available.swift",
52
- patterns: [
53
- {
54
- captures: {
55
- "1": {
56
- name: "keyword.other.platform.os.swift"
57
- },
58
- "2": {
59
- name: "constant.numeric.swift"
60
- }
61
- },
62
- match: "\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?"
63
- },
64
- {
65
- begin: "\\b(introduced|deprecated|obsoleted)\\s*(:)\\s*",
66
- beginCaptures: {
67
- "1": {
68
- name: "keyword.other.swift"
69
- },
70
- "2": {
71
- name: "punctuation.separator.key-value.swift"
72
- }
73
- },
74
- end: "(?!\\G)",
75
- patterns: [
76
- {
77
- match: "\\b[0-9]+(?:\\.[0-9]+)*\\b",
78
- name: "constant.numeric.swift"
79
- }
80
- ]
81
- },
82
- {
83
- begin: "\\b(message|renamed)\\s*(:)\\s*(?=\")",
84
- beginCaptures: {
85
- "1": {
86
- name: "keyword.other.swift"
87
- },
88
- "2": {
89
- name: "punctuation.separator.key-value.swift"
90
- }
91
- },
92
- end: "(?!\\G)",
93
- patterns: [
94
- {
95
- include: "#literals"
96
- }
97
- ]
98
- },
99
- {
100
- captures: {
101
- "1": {
102
- name: "keyword.other.platform.all.swift"
103
- },
104
- "2": {
105
- name: "keyword.other.swift"
106
- },
107
- "3": {
108
- name: "invalid.illegal.character-not-allowed-here.swift"
109
- }
110
- },
111
- match: "(?:(\\*)|\\b(deprecated|unavailable|noasync)\\b)\\s*(.*?)(?=[,)])"
112
- }
113
- ]
114
- },
115
- {
116
- begin: "((@)objc)(\\()",
117
- beginCaptures: {
118
- "1": {
119
- name: "storage.modifier.attribute.swift"
120
- },
121
- "2": {
122
- name: "punctuation.definition.attribute.swift"
123
- },
124
- "3": {
125
- name: "punctuation.definition.arguments.begin.swift"
126
- }
127
- },
128
- end: "\\)",
129
- endCaptures: {
130
- "0": {
131
- name: "punctuation.definition.arguments.end.swift"
132
- }
133
- },
134
- name: "meta.attribute.objc.swift",
135
- patterns: [
136
- {
137
- captures: {
138
- "1": {
139
- name: "invalid.illegal.missing-colon-after-selector-piece.swift"
140
- }
141
- },
142
- match: "\\w*(?::(?:\\w*:)*(\\w*))?",
143
- name: "entity.name.function.swift"
144
- }
145
- ]
146
- },
147
- {
148
- begin: "(@)(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)",
149
- beginCaptures: {
150
- "0": {
151
- name: "storage.modifier.attribute.swift"
152
- },
153
- "1": {
154
- name: "punctuation.definition.attribute.swift"
155
- },
156
- "2": {
157
- name: "punctuation.definition.identifier.swift"
158
- },
159
- "3": {
160
- name: "punctuation.definition.identifier.swift"
161
- }
162
- },
163
- comment: "any other attribute",
164
- end: "(?!\\G\\()",
165
- name: "meta.attribute.swift",
166
- patterns: [
167
- {
168
- begin: "\\(",
169
- beginCaptures: {
170
- "0": {
171
- name: "punctuation.definition.arguments.begin.swift"
172
- }
173
- },
174
- end: "\\)",
175
- endCaptures: {
176
- "0": {
177
- name: "punctuation.definition.arguments.end.swift"
178
- }
179
- },
180
- name: "meta.arguments.attribute.swift",
181
- patterns: [
182
- {
183
- include: "#expressions"
184
- }
185
- ]
186
- }
187
- ]
188
- }
189
- ]
190
- },
191
- "builtin-functions": {
192
- patterns: [
193
- {
194
- comment: "Member functions in the standard library in Swift 3 which may be used with trailing closures and no parentheses",
195
- match: "(?<=\\.)(?:s(?:ort(?:ed)?|plit)|contains|index|partition|f(?:i(?:lter|rst)|orEach|latMap)|with(?:MutableCharacters|CString|U(?:nsafe(?:Mutable(?:BufferPointer|Pointer(?:s|To(?:Header|Elements)))|BufferPointer)|TF8Buffer))|m(?:in|a(?:p|x)))(?=\\s*[({])\\b",
196
- name: "support.function.swift"
197
- },
198
- {
199
- comment: "Member functions in the standard library in Swift 3",
200
- match: "(?<=\\.)(?:s(?:ymmetricDifference|t(?:oreBytes|arts|ride)|ortInPlace|u(?:ccessor|ffix|btract(?:ing|InPlace|WithOverflow)?)|quareRoot|amePosition)|h(?:oldsUnique(?:Reference|OrPinnedReference)|as(?:Suffix|Prefix))|ne(?:gate(?:d)?|xt)|c(?:o(?:untByEnumerating|py(?:Bytes)?)|lamp(?:ed)?|reate)|t(?:o(?:IntMax|Opaque|UIntMax)|ake(?:RetainedValue|UnretainedValue)|r(?:uncatingRemainder|a(?:nscodedLength|ilSurrogate)))|i(?:s(?:MutableAndUniquelyReferenced(?:OrPinned)?|S(?:trictSu(?:perset(?:Of)?|bset(?:Of)?)|u(?:perset(?:Of)?|bset(?:Of)?))|Continuation|T(?:otallyOrdered|railSurrogate)|Disjoint(?:With)?|Unique(?:Reference|lyReferenced(?:OrPinned)?)|Equal|Le(?:ss(?:ThanOrEqualTo)?|adSurrogate))|n(?:sert(?:ContentsOf)?|tersect(?:ion|InPlace)?|itialize(?:Memory|From)?|dex(?:Of|ForKey)))|o(?:verlaps|bjectAt)|d(?:i(?:stance(?:To)?|vide(?:d|WithOverflow)?)|e(?:s(?:cendant|troy)|code(?:CString)?|initialize|alloc(?:ate(?:Capacity)?)?)|rop(?:First|Last))|u(?:n(?:ion(?:InPlace)?|derestimateCount|wrappedOrError)|p(?:date(?:Value)?|percased))|join(?:ed|WithSeparator)|p(?:op(?:First|Last)|ass(?:Retained|Unretained)|re(?:decessor|fix))|e(?:scape(?:d)?|n(?:code|umerate(?:d)?)|lementsEqual|xclusiveOr(?:InPlace)?)|f(?:orm(?:Remainder|S(?:ymmetricDifference|quareRoot)|TruncatingRemainder|In(?:tersection|dex)|Union)|latten|rom(?:CString(?:RepairingIllFormedUTF8)?|Opaque))|w(?:i(?:thMemoryRebound|dth)|rite(?:To)?)|l(?:o(?:wercased|ad)|e(?:adSurrogate|xicographical(?:Compare|lyPrecedes)))|a(?:ss(?:ign(?:BackwardFrom|From)?|umingMemoryBound)|d(?:d(?:ing(?:Product)?|Product|WithOverflow)?|vanced(?:By)?)|utorelease|ppend(?:ContentsOf)?|lloc(?:ate)?|bs)|r(?:ound(?:ed)?|e(?:serveCapacity|tain|duce|place(?:Range|Subrange)?|verse(?:d)?|quest(?:NativeBuffer|UniqueMutableBackingBuffer)|lease|m(?:ove(?:Range|Subrange|Value(?:ForKey)?|First|Last|A(?:tIndex|ll))?|ainder(?:WithOverflow)?)))|ge(?:nerate|t(?:Objects|Element))|m(?:in(?:imum(?:Magnitude)?|Element)|ove(?:Initialize(?:Memory|BackwardFrom|From)?|Assign(?:From)?)?|ultipl(?:y(?:WithOverflow)?|ied)|easure|a(?:ke(?:Iterator|Description)|x(?:imum(?:Magnitude)?|Element)))|bindMemory)(?=\\s*\\()",
201
- name: "support.function.swift"
202
- },
203
- {
204
- comment: "Member functions in the standard library in Swift 2 only",
205
- match: "(?<=\\.)(?:s(?:uperclassMirror|amePositionIn|tartsWith)|nextObject|c(?:haracterAtIndex|o(?:untByEnumeratingWithState|pyWithZone)|ustom(?:Mirror|PlaygroundQuickLook))|is(?:EmptyInput|ASCII)|object(?:Enumerator|ForKey|AtIndex)|join|put|keyEnumerator|withUnsafeMutablePointerToValue|length|getMirror|m(?:oveInitializeAssignFrom|ember))(?=\\s*\\()",
206
- name: "support.function.swift"
207
- }
208
- ]
209
- },
210
- "builtin-global-functions": {
211
- patterns: [
212
- {
213
- begin: "\\b(type)(\\()\\s*(of)(:)",
214
- beginCaptures: {
215
- "1": {
216
- name: "support.function.dynamic-type.swift"
217
- },
218
- "2": {
219
- name: "punctuation.definition.arguments.begin.swift"
220
- },
221
- "3": {
222
- name: "support.variable.parameter.swift"
223
- },
224
- "4": {
225
- name: "punctuation.separator.argument-label.begin.swift"
226
- }
227
- },
228
- end: "\\)",
229
- endCaptures: {
230
- "0": {
231
- name: "punctuation.definition.arguments.end.swift"
232
- }
233
- },
234
- patterns: [
235
- {
236
- include: "#expressions"
237
- }
238
- ]
239
- },
240
- {
241
- comment: "Global functions available in Swift 3 which may be used with trailing closures and no parentheses",
242
- match: "\\b(?:anyGenerator|autoreleasepool)(?=\\s*[({])\\b",
243
- name: "support.function.swift"
244
- },
245
- {
246
- comment: "Global functions available in Swift 3",
247
- match: "\\b(?:s(?:tride(?:of(?:Value)?)?|izeof(?:Value)?|equence|wap)|numericCast|transcode|is(?:UniquelyReferenced(?:NonObjC)?|KnownUniquelyReferenced)|zip|d(?:ump|ebugPrint)|unsafe(?:BitCast|Downcast|Unwrap|Address(?:Of)?)|pr(?:int|econdition(?:Failure)?)|fatalError|with(?:Unsafe(?:MutablePointer|Pointer)|ExtendedLifetime|VaList)|a(?:ssert(?:ionFailure)?|lignof(?:Value)?|bs)|re(?:peatElement|adLine)|getVaList|m(?:in|ax))(?=\\s*\\()",
248
- name: "support.function.swift"
249
- },
250
- {
251
- comment: "Global functions available in Swift 2 only",
252
- match: "\\b(?:s(?:ort|uffix|pli(?:ce|t))|insert|overlaps|d(?:istance|rop(?:First|Last))|join|prefix|extend|withUnsafe(?:MutablePointers|Pointers)|lazy|advance|re(?:flect|move(?:Range|Last|A(?:tIndex|ll))))(?=\\s*\\()",
253
- name: "support.function.swift"
254
- }
255
- ]
256
- },
257
- "builtin-properties": {
258
- patterns: [
259
- {
260
- comment: "The simpler (?<=\\bProcess\\.|\\bCommandLine\\.) breaks VS Code / Atom, see https://github.com/textmate/swift.tmbundle/issues/29",
261
- match: "(?<=^Process\\.|\\WProcess\\.|^CommandLine\\.|\\WCommandLine\\.)(arguments|argc|unsafeArgv)",
262
- name: "support.variable.swift"
263
- },
264
- {
265
- comment: "Properties in the standard library in Swift 3",
266
- match: "(?<=\\.)(?:s(?:t(?:artIndex|ri(?:ngValue|de))|i(?:ze|gn(?:BitIndex|ificand(?:Bit(?:Count|Pattern)|Width)?|alingNaN)?)|u(?:perclassMirror|mmary|bscriptBaseAddress))|h(?:eader|as(?:hValue|PointerRepresentation))|n(?:ulTerminatedUTF8|ext(?:Down|Up)|a(?:n|tiveOwner))|c(?:haracters|ount(?:TrailingZeros)?|ustom(?:Mirror|PlaygroundQuickLook)|apacity)|i(?:s(?:S(?:ign(?:Minus|aling(?:NaN)?)|ubnormal)|N(?:ormal|aN)|Canonical|Infinite|Zero|Empty|Finite|ASCII)|n(?:dices|finity)|dentity)|owner|de(?:scription|bugDescription)|u(?:n(?:safelyUnwrapped|icodeScalar(?:s)?|derestimatedCount)|tf(?:16|8(?:Start|C(?:String|odeUnitCount))?)|intValue|ppercaseString|lp(?:OfOne)?)|p(?:i|ointee)|e(?:ndIndex|lements|xponent(?:Bit(?:Count|Pattern))?)|value(?:s)?|keys|quietNaN|f(?:irst(?:ElementAddress(?:IfContiguous)?)?|loatingPointClass)|l(?:ittleEndian|owercaseString|eastNo(?:nzeroMagnitude|rmalMagnitude)|a(?:st|zy))|a(?:l(?:ignment|l(?:ocatedElementCount|Zeros))|rray(?:PropertyIsNativeTypeChecked)?)|ra(?:dix|wValue)|greatestFiniteMagnitude|m(?:in|emory|ax)|b(?:yteS(?:ize|wapped)|i(?:nade|tPattern|gEndian)|uffer|ase(?:Address)?))\\b",
267
- name: "support.variable.swift"
268
- },
269
- {
270
- comment: "Properties in the standard library in Swift 2 only",
271
- match: "(?<=\\.)(?:boolValue|disposition|end|objectIdentifier|quickLookObject|start|valueType)\\b",
272
- name: "support.variable.swift"
273
- },
274
- {
275
- comment: "Enum cases in the standard library - note that there is some overlap between these and the properties",
276
- match: "(?<=\\.)(?:s(?:calarValue|i(?:ze|gnalingNaN)|o(?:und|me)|uppressed|prite|et)|n(?:one|egative(?:Subnormal|Normal|Infinity|Zero))|c(?:ol(?:or|lection)|ustomized)|t(?:o(?:NearestOr(?:Even|AwayFromZero)|wardZero)|uple|ext)|i(?:nt|mage)|optional|d(?:ictionary|o(?:uble|wn))|u(?:Int|p|rl)|p(?:o(?:sitive(?:Subnormal|Normal|Infinity|Zero)|int)|lus)|e(?:rror|mptyInput)|view|quietNaN|float|a(?:ttributedString|wayFromZero)|r(?:ectangle|ange)|generated|minus|b(?:ool|ezierPath))\\b",
277
- name: "support.variable.swift"
278
- }
279
- ]
280
- },
281
- "builtin-types": {
282
- comment: "Types provided in the standard library",
283
- patterns: [
284
- {
285
- include: "#builtin-class-type"
286
- },
287
- {
288
- include: "#builtin-enum-type"
289
- },
290
- {
291
- include: "#builtin-protocol-type"
292
- },
293
- {
294
- include: "#builtin-struct-type"
295
- },
296
- {
297
- include: "#builtin-typealias"
298
- },
299
- {
300
- match: "\\bAny\\b",
301
- name: "support.type.any.swift"
302
- }
303
- ],
304
- repository: {
305
- "builtin-class-type": {
306
- comment: "Builtin class types",
307
- match: "\\b(Managed(Buffer|ProtoBuffer)|NonObjectiveCBase|AnyGenerator)\\b",
308
- name: "support.class.swift"
309
- },
310
- "builtin-enum-type": {
311
- patterns: [
312
- {
313
- comment: "CommandLine is an enum, but it acts like a constant",
314
- match: "\\b(?:CommandLine|Process(?=\\.))\\b",
315
- name: "support.constant.swift"
316
- },
317
- {
318
- comment: "The return type of a function that never returns",
319
- match: "\\bNever\\b",
320
- name: "support.constant.never.swift"
321
- },
322
- {
323
- comment: "Enum types in the standard library in Swift 3",
324
- match: "\\b(?:ImplicitlyUnwrappedOptional|Representation|MemoryLayout|FloatingPointClassification|SetIndexRepresentation|SetIteratorRepresentation|FloatingPointRoundingRule|UnicodeDecodingResult|Optional|DictionaryIndexRepresentation|AncestorRepresentation|DisplayStyle|PlaygroundQuickLook|Never|FloatingPointSign|Bit|DictionaryIteratorRepresentation)\\b",
325
- name: "support.type.swift"
326
- },
327
- {
328
- comment: "Enum types in the standard library in Swift 2 only",
329
- match: "\\b(?:MirrorDisposition|QuickLookObject)\\b",
330
- name: "support.type.swift"
331
- }
332
- ]
333
- },
334
- "builtin-protocol-type": {
335
- patterns: [
336
- {
337
- comment: "Protocols in the standard library in Swift 3",
338
- match: "\\b(?:Ra(?:n(?:domAccess(?:Collection|Indexable)|geReplaceable(?:Collection|Indexable))|wRepresentable)|M(?:irrorPath|utable(?:Collection|Indexable))|Bi(?:naryFloatingPoint|twiseOperations|directional(?:Collection|Indexable))|S(?:tr(?:ideable|eamable)|igned(?:Number|Integer)|e(?:tAlgebra|quence))|Hashable|C(?:o(?:llection|mparable)|ustom(?:Reflectable|StringConvertible|DebugStringConvertible|PlaygroundQuickLookable|LeafReflectable)|VarArg)|TextOutputStream|I(?:n(?:teger(?:Arithmetic)?|dexable(?:Base)?)|teratorProtocol)|OptionSet|Un(?:signedInteger|icodeCodec)|E(?:quatable|rror|xpressibleBy(?:BooleanLiteral|String(?:Interpolation|Literal)|NilLiteral|IntegerLiteral|DictionaryLiteral|UnicodeScalarLiteral|ExtendedGraphemeClusterLiteral|FloatLiteral|ArrayLiteral))|FloatingPoint|L(?:osslessStringConvertible|azy(?:SequenceProtocol|CollectionProtocol))|A(?:nyObject|bsoluteValuable))\\b",
339
- name: "support.type.swift"
340
- },
341
- {
342
- comment: "Protocols in the standard library in Swift 2 only",
343
- match: "\\b(?:Ran(?:domAccessIndexType|geReplaceableCollectionType)|GeneratorType|M(?:irror(?:Type|PathType)|utable(?:Sliceable|CollectionType))|B(?:i(?:twiseOperationsType|directionalIndexType)|oolean(?:Type|LiteralConvertible))|S(?:tring(?:InterpolationConvertible|LiteralConvertible)|i(?:nkType|gned(?:NumberType|IntegerType))|e(?:tAlgebraType|quenceType)|liceable)|NilLiteralConvertible|C(?:ollectionType|VarArgType)|Inte(?:rvalType|ger(?:Type|LiteralConvertible|ArithmeticType))|O(?:utputStreamType|ptionSetType)|DictionaryLiteralConvertible|Un(?:signedIntegerType|icode(?:ScalarLiteralConvertible|CodecType))|E(?:rrorType|xten(?:sibleCollectionType|dedGraphemeClusterLiteralConvertible))|F(?:orwardIndexType|loat(?:ingPointType|LiteralConvertible))|A(?:nyCollectionType|rrayLiteralConvertible))\\b",
344
- name: "support.type.swift"
345
- }
346
- ]
347
- },
348
- "builtin-struct-type": {
349
- patterns: [
350
- {
351
- comment: "Structs in the standard library in Swift 3",
352
- match: "\\b(?:R(?:e(?:peat(?:ed)?|versed(?:RandomAccess(?:Collection|Index)|Collection|Index))|an(?:domAccessSlice|ge(?:Replaceable(?:RandomAccessSlice|BidirectionalSlice|Slice)|Generator)?))|Generator(?:Sequence|OfOne)|M(?:irror|utable(?:Ran(?:domAccessSlice|geReplaceable(?:RandomAccessSlice|BidirectionalSlice|Slice))|BidirectionalSlice|Slice)|anagedBufferPointer)|B(?:idirectionalSlice|ool)|S(?:t(?:aticString|ri(?:ng|deT(?:hrough(?:Generator|Iterator)?|o(?:Generator|Iterator)?)))|et(?:I(?:ndex|terator))?|lice)|HalfOpenInterval|C(?:haracter(?:View)?|o(?:ntiguousArray|untable(?:Range|ClosedRange)|llectionOfOne)|OpaquePointer|losed(?:Range(?:I(?:ndex|terator))?|Interval)|VaListPointer)|I(?:n(?:t(?:16|8|32|64)?|d(?:ices|ex(?:ing(?:Generator|Iterator))?))|terator(?:Sequence|OverOne)?)|Zip2(?:Sequence|Iterator)|O(?:paquePointer|bjectIdentifier)|D(?:ictionary(?:I(?:ndex|terator)|Literal)?|ouble|efault(?:RandomAccessIndices|BidirectionalIndices|Indices))|U(?:n(?:safe(?:RawPointer|Mutable(?:RawPointer|BufferPointer|Pointer)|BufferPointer(?:Generator|Iterator)?|Pointer)|icodeScalar(?:View)?|foldSequence|managed)|TF(?:16(?:View)?|8(?:View)?|32)|Int(?:16|8|32|64)?)|Join(?:Generator|ed(?:Sequence|Iterator))|PermutationGenerator|E(?:numerate(?:Generator|Sequence|d(?:Sequence|Iterator))|mpty(?:Generator|Collection|Iterator))|Fl(?:oat(?:80)?|atten(?:Generator|BidirectionalCollection(?:Index)?|Sequence|Collection(?:Index)?|Iterator))|L(?:egacyChildren|azy(?:RandomAccessCollection|Map(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Collection|Iterator)|BidirectionalCollection|Sequence|Collection|Filter(?:Generator|BidirectionalCollection|Sequence|Collection|I(?:ndex|terator))))|A(?:ny(?:RandomAccessCollection|Generator|BidirectionalCollection|Sequence|Hashable|Collection|I(?:ndex|terator))|utoreleasingUnsafeMutablePointer|rray(?:Slice)?))\\b",
353
- name: "support.type.swift"
354
- },
355
- {
356
- comment: "Structs in the standard library in Swift 2 only",
357
- match: "\\b(?:R(?:everse(?:RandomAccess(?:Collection|Index)|Collection|Index)|awByte)|Map(?:Generator|Sequence|Collection)|S(?:inkOf|etGenerator)|Zip2Generator|DictionaryGenerator|Filter(?:Generator|Sequence|Collection(?:Index)?)|LazyForwardCollection|Any(?:RandomAccessIndex|BidirectionalIndex|Forward(?:Collection|Index)))\\b",
358
- name: "support.type.swift"
359
- }
360
- ]
361
- },
362
- "builtin-typealias": {
363
- patterns: [
364
- {
365
- comment: "Typealiases in the standard library in Swift 3",
366
- match: "\\b(?:Raw(?:Significand|Exponent|Value)|B(?:ooleanLiteralType|uffer|ase)|S(?:t(?:orage|r(?:i(?:ngLiteralType|de)|eam(?:1|2)))|ubSequence)|NativeBuffer|C(?:hild(?:ren)?|Bool|S(?:hort|ignedChar)|odeUnit|Char(?:16|32)?|Int|Double|Unsigned(?:Short|Char|Int|Long(?:Long)?)|Float|WideChar|Long(?:Long)?)|I(?:n(?:t(?:Max|egerLiteralType)|d(?:ices|ex(?:Distance)?))|terator)|Distance|U(?:n(?:icodeScalar(?:Type|Index|View|LiteralType)|foldFirstSequence)|TF(?:16(?:Index|View)|8Index)|IntMax)|E(?:lement(?:s)?|x(?:tendedGraphemeCluster(?:Type|LiteralType)|ponent))|V(?:oid|alue)|Key|Float(?:32|LiteralType|64)|AnyClass)\\b",
367
- name: "support.type.swift"
368
- },
369
- {
370
- comment: "Typealiases in the standard library in Swift 2 only",
371
- match: "\\b(?:Generator|PlaygroundQuickLook|UWord|Word)\\b",
372
- name: "support.type.swift"
373
- }
374
- ]
375
- }
376
- }
377
- },
378
- "code-block": {
379
- begin: "\\{",
380
- beginCaptures: {
381
- "0": {
382
- name: "punctuation.section.scope.begin.swift"
383
- }
384
- },
385
- end: "\\}",
386
- endCaptures: {
387
- "0": {
388
- name: "punctuation.section.scope.end.swift"
389
- }
390
- },
391
- patterns: [
392
- {
393
- include: "$self"
394
- }
395
- ]
396
- },
397
- comments: {
398
- patterns: [
399
- {
400
- captures: {
401
- "1": {
402
- name: "punctuation.definition.comment.swift"
403
- }
404
- },
405
- match: "\\A^(#!).*$\\n?",
406
- name: "comment.line.number-sign.swift"
407
- },
408
- {
409
- begin: "/\\*\\*(?!/)",
410
- beginCaptures: {
411
- "0": {
412
- name: "punctuation.definition.comment.begin.swift"
413
- }
414
- },
415
- end: "\\*/",
416
- endCaptures: {
417
- "0": {
418
- name: "punctuation.definition.comment.end.swift"
419
- }
420
- },
421
- name: "comment.block.documentation.swift",
422
- patterns: [
423
- {
424
- include: "#nested"
425
- }
426
- ]
427
- },
428
- {
429
- begin: "/\\*:",
430
- beginCaptures: {
431
- "0": {
432
- name: "punctuation.definition.comment.begin.swift"
433
- }
434
- },
435
- end: "\\*/",
436
- endCaptures: {
437
- "0": {
438
- name: "punctuation.definition.comment.end.swift"
439
- }
440
- },
441
- name: "comment.block.documentation.playground.swift",
442
- patterns: [
443
- {
444
- include: "#nested"
445
- }
446
- ]
447
- },
448
- {
449
- begin: "/\\*",
450
- beginCaptures: {
451
- "0": {
452
- name: "punctuation.definition.comment.begin.swift"
453
- }
454
- },
455
- end: "\\*/",
456
- endCaptures: {
457
- "0": {
458
- name: "punctuation.definition.comment.end.swift"
459
- }
460
- },
461
- name: "comment.block.swift",
462
- patterns: [
463
- {
464
- include: "#nested"
465
- }
466
- ]
467
- },
468
- {
469
- match: "\\*/",
470
- name: "invalid.illegal.unexpected-end-of-block-comment.swift"
471
- },
472
- {
473
- begin: "(^[ \\t]+)?(?=//)",
474
- beginCaptures: {
475
- "1": {
476
- name: "punctuation.whitespace.comment.leading.swift"
477
- }
478
- },
479
- end: "(?!\\G)",
480
- patterns: [
481
- {
482
- begin: "///",
483
- beginCaptures: {
484
- "0": {
485
- name: "punctuation.definition.comment.swift"
486
- }
487
- },
488
- end: "^",
489
- name: "comment.line.triple-slash.documentation.swift"
490
- },
491
- {
492
- begin: "//:",
493
- beginCaptures: {
494
- "0": {
495
- name: "punctuation.definition.comment.swift"
496
- }
497
- },
498
- end: "^",
499
- name: "comment.line.double-slash.documentation.swift"
500
- },
501
- {
502
- begin: "//",
503
- beginCaptures: {
504
- "0": {
505
- name: "punctuation.definition.comment.swift"
506
- }
507
- },
508
- end: "^",
509
- name: "comment.line.double-slash.swift"
510
- }
511
- ]
512
- }
513
- ],
514
- repository: {
515
- nested: {
516
- begin: "/\\*",
517
- end: "\\*/",
518
- patterns: [
519
- {
520
- include: "#nested"
521
- }
522
- ]
523
- }
524
- }
525
- },
526
- "compiler-control": {
527
- patterns: [
528
- {
529
- begin: "^\\s*(#)(if|elseif)\\s+(false)\\b.*?(?=$|//|/\\*)",
530
- beginCaptures: {
531
- "0": {
532
- name: "meta.preprocessor.conditional.swift"
533
- },
534
- "1": {
535
- name: "punctuation.definition.preprocessor.swift"
536
- },
537
- "2": {
538
- name: "keyword.control.preprocessor.conditional.swift"
539
- },
540
- "3": {
541
- name: "constant.language.boolean.swift"
542
- }
543
- },
544
- contentName: "comment.block.preprocessor.swift",
545
- end: "(?=^\\s*(#(elseif|else|endif)\\b))"
546
- },
547
- {
548
- begin: "^\\s*(#)(if|elseif)\\s+",
549
- captures: {
550
- "1": {
551
- name: "punctuation.definition.preprocessor.swift"
552
- },
553
- "2": {
554
- name: "keyword.control.preprocessor.conditional.swift"
555
- }
556
- },
557
- end: "(?=\\s*(?://|/\\*))|$",
558
- name: "meta.preprocessor.conditional.swift",
559
- patterns: [
560
- {
561
- match: "(&&|\\|\\|)",
562
- name: "keyword.operator.logical.swift"
563
- },
564
- {
565
- match: "\\b(true|false)\\b",
566
- name: "constant.language.boolean.swift"
567
- },
568
- {
569
- captures: {
570
- "1": {
571
- name: "keyword.other.condition.swift"
572
- },
573
- "2": {
574
- name: "punctuation.definition.parameters.begin.swift"
575
- },
576
- "3": {
577
- name: "support.constant.platform.architecture.swift"
578
- },
579
- "4": {
580
- name: "punctuation.definition.parameters.end.swift"
581
- }
582
- },
583
- match: "\\b(arch)\\s*(\\()\\s*(?:(arm|arm64|powerpc64|powerpc64le|i386|x86_64|s390x)|\\w+)\\s*(\\))"
584
- },
585
- {
586
- captures: {
587
- "1": {
588
- name: "keyword.other.condition.swift"
589
- },
590
- "2": {
591
- name: "punctuation.definition.parameters.begin.swift"
592
- },
593
- "3": {
594
- name: "support.constant.platform.os.swift"
595
- },
596
- "4": {
597
- name: "punctuation.definition.parameters.end.swift"
598
- }
599
- },
600
- match: "\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))"
601
- },
602
- {
603
- captures: {
604
- "1": {
605
- name: "keyword.other.condition.swift"
606
- },
607
- "2": {
608
- name: "punctuation.definition.parameters.begin.swift"
609
- },
610
- "3": {
611
- name: "entity.name.type.module.swift"
612
- },
613
- "4": {
614
- name: "punctuation.definition.parameters.end.swift"
615
- }
616
- },
617
- match: "\\b(canImport)\\s*(\\()([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)(\\))"
618
- },
619
- {
620
- begin: "\\b(targetEnvironment)\\s*(\\()",
621
- beginCaptures: {
622
- "1": {
623
- name: "keyword.other.condition.swift"
624
- },
625
- "2": {
626
- name: "punctuation.definition.parameters.begin.swift"
627
- }
628
- },
629
- end: "(\\))|$",
630
- endCaptures: {
631
- "1": {
632
- name: "punctuation.definition.parameters.end.swift"
633
- }
634
- },
635
- patterns: [
636
- {
637
- match: "\\b(simulator|UIKitForMac)\\b",
638
- name: "support.constant.platform.environment.swift"
639
- }
640
- ]
641
- },
642
- {
643
- begin: "\\b(swift|compiler)\\s*(\\()",
644
- beginCaptures: {
645
- "1": {
646
- name: "keyword.other.condition.swift"
647
- },
648
- "2": {
649
- name: "punctuation.definition.parameters.begin.swift"
650
- }
651
- },
652
- end: "(\\))|$",
653
- endCaptures: {
654
- "1": {
655
- name: "punctuation.definition.parameters.end.swift"
656
- }
657
- },
658
- patterns: [
659
- {
660
- match: ">=|<",
661
- name: "keyword.operator.comparison.swift"
662
- },
663
- {
664
- match: "\\b[0-9]+(?:\\.[0-9]+)*\\b",
665
- name: "constant.numeric.swift"
666
- }
667
- ]
668
- }
669
- ]
670
- },
671
- {
672
- captures: {
673
- "1": {
674
- name: "punctuation.definition.preprocessor.swift"
675
- },
676
- "2": {
677
- name: "keyword.control.preprocessor.conditional.swift"
678
- },
679
- "3": {
680
- patterns: [
681
- {
682
- match: "\\S+",
683
- name: "invalid.illegal.character-not-allowed-here.swift"
684
- }
685
- ]
686
- }
687
- },
688
- match: "^\\s*(#)(else|endif)(.*?)(?=$|//|/\\*)",
689
- name: "meta.preprocessor.conditional.swift"
690
- },
691
- {
692
- captures: {
693
- "1": {
694
- name: "punctuation.definition.preprocessor.swift"
695
- },
696
- "2": {
697
- name: "keyword.control.preprocessor.sourcelocation.swift"
698
- },
699
- "4": {
700
- name: "punctuation.definition.parameters.begin.swift"
701
- },
702
- "5": {
703
- patterns: [
704
- {
705
- begin: "(file)\\s*(:)\\s*(?=\")",
706
- beginCaptures: {
707
- "1": {
708
- name: "support.variable.parameter.swift"
709
- },
710
- "2": {
711
- name: "punctuation.separator.key-value.swift"
712
- }
713
- },
714
- end: "(?!\\G)",
715
- patterns: [
716
- {
717
- include: "#literals"
718
- }
719
- ]
720
- },
721
- {
722
- captures: {
723
- "1": {
724
- name: "support.variable.parameter.swift"
725
- },
726
- "2": {
727
- name: "punctuation.separator.key-value.swift"
728
- },
729
- "3": {
730
- name: "constant.numeric.integer.swift"
731
- }
732
- },
733
- match: "(line)\\s*(:)\\s*([0-9]+)"
734
- },
735
- {
736
- match: ",",
737
- name: "punctuation.separator.parameters.swift"
738
- },
739
- {
740
- match: "\\S+",
741
- name: "invalid.illegal.character-not-allowed-here.swift"
742
- }
743
- ]
744
- },
745
- "6": {
746
- name: "punctuation.definition.parameters.begin.swift"
747
- },
748
- "7": {
749
- patterns: [
750
- {
751
- match: "\\S+",
752
- name: "invalid.illegal.character-not-allowed-here.swift"
753
- }
754
- ]
755
- }
756
- },
757
- match: "^\\s*(#)(sourceLocation)((\\()([^)]*)(\\)))(.*?)(?=$|//|/\\*)",
758
- name: "meta.preprocessor.sourcelocation.swift"
759
- }
760
- ]
761
- },
762
- declarations: {
763
- patterns: [
764
- {
765
- include: "#function"
766
- },
767
- {
768
- include: "#function-initializer"
769
- },
770
- {
771
- include: "#typed-variable-declaration"
772
- },
773
- {
774
- include: "#import"
775
- },
776
- {
777
- include: "#operator"
778
- },
779
- {
780
- include: "#precedencegroup"
781
- },
782
- {
783
- include: "#protocol"
784
- },
785
- {
786
- include: "#type"
787
- },
788
- {
789
- include: "#extension"
790
- },
791
- {
792
- include: "#typealias"
793
- }
794
- ],
795
- repository: {
796
- "available-types": {
797
- patterns: [
798
- {
799
- include: "#comments"
800
- },
801
- {
802
- include: "#builtin-types"
803
- },
804
- {
805
- include: "#attributes"
806
- },
807
- {
808
- match: "\\basync\\b",
809
- name: "keyword.control.async.swift"
810
- },
811
- {
812
- match: "\\b(?:throws|rethrows)\\b",
813
- name: "keyword.control.exception.swift"
814
- },
815
- {
816
- match: "\\bsome\\b",
817
- name: "keyword.operator.type.opaque.swift"
818
- },
819
- {
820
- match: "\\bany\\b",
821
- name: "keyword.operator.type.existential.swift"
822
- },
823
- {
824
- match: "\\b(?:inout|isolated)\\b",
825
- name: "storage.modifier.swift"
826
- },
827
- {
828
- match: "\\bSelf\\b",
829
- name: "variable.language.swift"
830
- },
831
- {
832
- captures: {
833
- "1": {
834
- name: "keyword.operator.type.function.swift"
835
- }
836
- },
837
- match: "(?<![/=\\-+!*%<>&|\\^~.])(->)(?![/=\\-+!*%<>&|\\^~.])"
838
- },
839
- {
840
- captures: {
841
- "1": {
842
- name: "keyword.operator.type.composition.swift"
843
- }
844
- },
845
- comment: "Swift 3: A & B",
846
- match: "(?<![/=\\-+!*%<>&|\\^~.])(&)(?![/=\\-+!*%<>&|\\^~.])"
847
- },
848
- {
849
- match: "[?!]",
850
- name: "keyword.operator.type.optional.swift"
851
- },
852
- {
853
- match: "\\.\\.\\.",
854
- name: "keyword.operator.function.variadic-parameter.swift"
855
- },
856
- {
857
- comment: "Swift 2: protocol<A, B>",
858
- match: "\\bprotocol\\b",
859
- name: "keyword.operator.type.composition.swift"
860
- },
861
- {
862
- match: "(?<=\\.)(?:Protocol|Type)\\b",
863
- name: "keyword.operator.type.metatype.swift"
864
- },
865
- {
866
- include: "#tuple-type"
867
- },
868
- {
869
- include: "#collection-type"
870
- },
871
- {
872
- include: "#generic-argument-clause"
873
- }
874
- ],
875
- repository: {
876
- "collection-type": {
877
- begin: "\\[",
878
- beginCaptures: {
879
- "0": {
880
- name: "punctuation.section.collection-type.begin.swift"
881
- }
882
- },
883
- comment: "array and dictionary types [Value] and [Key: Value]",
884
- end: "\\]|(?=[>){}])",
885
- endCaptures: {
886
- "0": {
887
- name: "punctuation.section.collection-type.end.swift"
888
- }
889
- },
890
- patterns: [
891
- {
892
- include: "#available-types"
893
- },
894
- {
895
- begin: ":",
896
- beginCaptures: {
897
- "0": {
898
- name: "punctuation.separator.key-value.swift"
899
- }
900
- },
901
- end: "(?=\\]|[>){}])",
902
- patterns: [
903
- {
904
- match: ":",
905
- name: "invalid.illegal.extra-colon-in-dictionary-type.swift"
906
- },
907
- {
908
- include: "#available-types"
909
- }
910
- ]
911
- }
912
- ]
913
- },
914
- "tuple-type": {
915
- begin: "\\(",
916
- beginCaptures: {
917
- "0": {
918
- name: "punctuation.section.tuple-type.begin.swift"
919
- }
920
- },
921
- end: "\\)|(?=[>\\]{}])",
922
- endCaptures: {
923
- "0": {
924
- name: "punctuation.section.tuple-type.end.swift"
925
- }
926
- },
927
- patterns: [
928
- {
929
- include: "#available-types"
930
- }
931
- ]
932
- }
933
- }
934
- },
935
- extension: {
936
- begin: "\\b(extension)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))",
937
- beginCaptures: {
938
- "1": {
939
- name: "storage.type.$1.swift"
940
- },
941
- "2": {
942
- name: "entity.name.type.swift",
943
- patterns: [
944
- {
945
- include: "#available-types"
946
- }
947
- ]
948
- },
949
- "3": {
950
- name: "punctuation.definition.identifier.swift"
951
- },
952
- "4": {
953
- name: "punctuation.definition.identifier.swift"
954
- }
955
- },
956
- end: "(?<=\\})",
957
- name: "meta.definition.type.$1.swift",
958
- patterns: [
959
- {
960
- include: "#comments"
961
- },
962
- {
963
- comment: "SE-0143: Conditional Conformances",
964
- include: "#generic-where-clause"
965
- },
966
- {
967
- include: "#inheritance-clause"
968
- },
969
- {
970
- begin: "\\{",
971
- beginCaptures: {
972
- "0": {
973
- name: "punctuation.definition.type.begin.swift"
974
- }
975
- },
976
- end: "\\}",
977
- endCaptures: {
978
- "0": {
979
- name: "punctuation.definition.type.end.swift"
980
- }
981
- },
982
- name: "meta.definition.type.body.swift",
983
- patterns: [
984
- {
985
- include: "$self"
986
- }
987
- ]
988
- }
989
- ]
990
- },
991
- "function": {
992
- begin: "(?x)\n\t\t\t\t\t\t\\b\n\t\t\t\t\t\t(?:(nonisolated)\\s+)?\n\t\t\t\t\t\t(func)\n\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)\n\t\t\t\t\t\t | (?:\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\\g<oph>\n\t\t\t\t\t\t\t\t\t | (?<opc>\t\t\t\t\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t)*\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t | ( \\. ( \\g<oph> | \\g<opc> | \\. )+ )\t\t\t# Dot operators\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t(?=\\(|<)\n\t\t\t\t\t",
993
- beginCaptures: {
994
- "1": {
995
- name: "storage.modifier.swift"
996
- },
997
- "2": {
998
- name: "storage.type.function.swift"
999
- },
1000
- "3": {
1001
- name: "entity.name.function.swift"
1002
- },
1003
- "4": {
1004
- name: "punctuation.definition.identifier.swift"
1005
- },
1006
- "5": {
1007
- name: "punctuation.definition.identifier.swift"
1008
- }
1009
- },
1010
- end: "(?<=\\})|$(?# functions in protocol declarations or generated interfaces have no body)",
1011
- name: "meta.definition.function.swift",
1012
- patterns: [
1013
- {
1014
- include: "#comments"
1015
- },
1016
- {
1017
- include: "#generic-parameter-clause"
1018
- },
1019
- {
1020
- include: "#parameter-clause"
1021
- },
1022
- {
1023
- include: "#function-result"
1024
- },
1025
- {
1026
- include: "#async-throws"
1027
- },
1028
- {
1029
- comment: "Swift 3: generic constraints after the parameters and return type",
1030
- include: "#generic-where-clause"
1031
- },
1032
- {
1033
- begin: "(\\{)",
1034
- beginCaptures: {
1035
- "1": {
1036
- name: "punctuation.section.function.begin.swift"
1037
- }
1038
- },
1039
- end: "(\\})",
1040
- endCaptures: {
1041
- "1": {
1042
- name: "punctuation.section.function.end.swift"
1043
- }
1044
- },
1045
- name: "meta.definition.function.body.swift",
1046
- patterns: [
1047
- {
1048
- include: "$self"
1049
- }
1050
- ]
1051
- }
1052
- ]
1053
- },
1054
- "function-initializer": {
1055
- begin: "(?<!\\.)\\b(init[?!]*(?# only one is valid, but we want the in⇥ snippet to produce something that looks good))\\s*(?=\\(|<)",
1056
- beginCaptures: {
1057
- "1": {
1058
- name: "storage.type.function.swift",
1059
- patterns: [
1060
- {
1061
- match: "(?<=[?!])[?!]+",
1062
- name: "invalid.illegal.character-not-allowed-here.swift"
1063
- }
1064
- ]
1065
- }
1066
- },
1067
- end: "(?<=\\})|$",
1068
- name: "meta.definition.function.initializer.swift",
1069
- patterns: [
1070
- {
1071
- include: "#comments"
1072
- },
1073
- {
1074
- include: "#generic-parameter-clause"
1075
- },
1076
- {
1077
- include: "#parameter-clause"
1078
- },
1079
- {
1080
- include: "#async-throws"
1081
- },
1082
- {
1083
- comment: "Swift 3: generic constraints after the parameters and return type",
1084
- include: "#generic-where-clause"
1085
- },
1086
- {
1087
- begin: "(\\{)",
1088
- beginCaptures: {
1089
- "1": {
1090
- name: "punctuation.section.function.begin.swift"
1091
- }
1092
- },
1093
- end: "(\\})",
1094
- endCaptures: {
1095
- "1": {
1096
- name: "punctuation.section.function.end.swift"
1097
- }
1098
- },
1099
- name: "meta.definition.function.body.swift",
1100
- patterns: [
1101
- {
1102
- include: "$self"
1103
- }
1104
- ]
1105
- }
1106
- ]
1107
- },
1108
- "function-result": {
1109
- begin: "(?<![/=\\-+!*%<>&|\\^~.])(->)(?![/=\\-+!*%<>&|\\^~.])\\s*",
1110
- beginCaptures: {
1111
- "1": {
1112
- name: "keyword.operator.function-result.swift"
1113
- }
1114
- },
1115
- end: "(?!\\G)(?=\\{|\\bwhere\\b|;)|$",
1116
- name: "meta.function-result.swift",
1117
- patterns: [
1118
- {
1119
- include: "#available-types"
1120
- }
1121
- ]
1122
- },
1123
- "generic-argument-clause": {
1124
- begin: "<",
1125
- beginCaptures: {
1126
- "0": {
1127
- name: "punctuation.separator.generic-argument-clause.begin.swift"
1128
- }
1129
- },
1130
- end: ">|(?=[)\\]{}])",
1131
- endCaptures: {
1132
- "0": {
1133
- name: "punctuation.separator.generic-argument-clause.end.swift"
1134
- }
1135
- },
1136
- name: "meta.generic-argument-clause.swift",
1137
- patterns: [
1138
- {
1139
- include: "#available-types"
1140
- }
1141
- ]
1142
- },
1143
- "generic-parameter-clause": {
1144
- begin: "<",
1145
- beginCaptures: {
1146
- "0": {
1147
- name: "punctuation.separator.generic-parameter-clause.begin.swift"
1148
- }
1149
- },
1150
- end: ">|(?=[^\\w\\d:<>\\s,=&`])(?# characters besides these are never valid in a generic param list -- even if it's not really a valid clause, we should stop trying to parse it if we see one of them.)",
1151
- endCaptures: {
1152
- "0": {
1153
- name: "punctuation.separator.generic-parameter-clause.end.swift"
1154
- }
1155
- },
1156
- name: "meta.generic-parameter-clause.swift",
1157
- patterns: [
1158
- {
1159
- include: "#comments"
1160
- },
1161
- {
1162
- comment: "Swift 2: constraints inside the generic param list",
1163
- include: "#generic-where-clause"
1164
- },
1165
- {
1166
- captures: {
1167
- "1": {
1168
- name: "variable.language.generic-parameter.swift"
1169
- }
1170
- },
1171
- match: "\\b((?!\\d)\\w[\\w\\d]*)\\b"
1172
- },
1173
- {
1174
- match: ",",
1175
- name: "punctuation.separator.generic-parameters.swift"
1176
- },
1177
- {
1178
- begin: "(:)\\s*",
1179
- beginCaptures: {
1180
- "1": {
1181
- name: "punctuation.separator.generic-parameter-constraint.swift"
1182
- }
1183
- },
1184
- end: "(?=[,>]|(?!\\G)\\bwhere\\b)",
1185
- name: "meta.generic-parameter-constraint.swift",
1186
- patterns: [
1187
- {
1188
- begin: "\\G",
1189
- end: "(?=[,>]|(?!\\G)\\bwhere\\b)",
1190
- name: "entity.other.inherited-class.swift",
1191
- patterns: [
1192
- {
1193
- include: "#type-identifier"
1194
- }
1195
- ]
1196
- }
1197
- ]
1198
- }
1199
- ]
1200
- },
1201
- "generic-where-clause": {
1202
- begin: "\\b(where)\\b\\s*",
1203
- beginCaptures: {
1204
- "1": {
1205
- name: "keyword.other.generic-constraint-introducer.swift"
1206
- }
1207
- },
1208
- end: "(?!\\G)$|(?=[>{};\\n]|//|/\\*)",
1209
- name: "meta.generic-where-clause.swift",
1210
- patterns: [
1211
- {
1212
- include: "#comments"
1213
- },
1214
- {
1215
- include: "#requirement-list"
1216
- }
1217
- ],
1218
- repository: {
1219
- "requirement-list": {
1220
- begin: "\\G|,\\s*",
1221
- end: "(?=[,>{};\\n]|//|/\\*)",
1222
- patterns: [
1223
- {
1224
- include: "#comments"
1225
- },
1226
- {
1227
- include: "#constraint"
1228
- },
1229
- {
1230
- include: "#available-types"
1231
- },
1232
- {
1233
- begin: "(?<![/=\\-+!*%<>&|\\^~.])(==)(?![/=\\-+!*%<>&|\\^~.])",
1234
- beginCaptures: {
1235
- "1": {
1236
- name: "keyword.operator.generic-constraint.same-type.swift"
1237
- }
1238
- },
1239
- end: "(?=\\s*[,>{};\\n]|//|/\\*)",
1240
- name: "meta.generic-where-clause.same-type-requirement.swift",
1241
- patterns: [
1242
- {
1243
- include: "#available-types"
1244
- }
1245
- ]
1246
- },
1247
- {
1248
- begin: "(?<![/=\\-+!*%<>&|\\^~.])(:)(?![/=\\-+!*%<>&|\\^~.])",
1249
- beginCaptures: {
1250
- "1": {
1251
- name: "keyword.operator.generic-constraint.conforms-to.swift"
1252
- }
1253
- },
1254
- end: "(?=\\s*[,>{};\\n]|//|/\\*)",
1255
- name: "meta.generic-where-clause.conformance-requirement.swift",
1256
- patterns: [
1257
- {
1258
- begin: "\\G\\s*",
1259
- contentName: "entity.other.inherited-class.swift",
1260
- end: "(?=\\s*[,>{};\\n]|//|/\\*)",
1261
- patterns: [
1262
- {
1263
- include: "#available-types"
1264
- }
1265
- ]
1266
- }
1267
- ]
1268
- }
1269
- ]
1270
- }
1271
- }
1272
- },
1273
- "import": {
1274
- begin: "(?<!\\.)\\b(import)\\s+",
1275
- beginCaptures: {
1276
- "1": {
1277
- name: "keyword.control.import.swift"
1278
- }
1279
- },
1280
- end: "(;)|$\\n?|(?=//|/\\*)",
1281
- endCaptures: {
1282
- "1": {
1283
- name: "punctuation.terminator.statement.swift"
1284
- }
1285
- },
1286
- name: "meta.import.swift",
1287
- patterns: [
1288
- {
1289
- begin: "\\G(?!;|$|//|/\\*)(?:(typealias|struct|class|actor|enum|protocol|var|func)\\s+)?",
1290
- beginCaptures: {
1291
- "1": {
1292
- name: "storage.modifier.swift"
1293
- }
1294
- },
1295
- end: "(?=;|$|//|/\\*)",
1296
- patterns: [
1297
- {
1298
- captures: {
1299
- "1": {
1300
- name: "punctuation.definition.identifier.swift"
1301
- },
1302
- "2": {
1303
- name: "punctuation.definition.identifier.swift"
1304
- }
1305
- },
1306
- match: "(?x)\n\t\t\t\t\t\t\t\t\t\t(?<=\\G|\\.)\n\t\t\t\t\t\t\t\t\t\t(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)\n\t\t\t\t\t\t\t\t\t",
1307
- name: "entity.name.type.swift"
1308
- },
1309
- {
1310
- match: "(?x)\n\t\t\t\t\t\t\t\t\t\t(?<=\\G|\\.)\n\t\t\t\t\t\t\t\t\t\t\\$[0-9]+\n\t\t\t\t\t\t\t\t\t",
1311
- name: "entity.name.type.swift"
1312
- },
1313
- {
1314
- captures: {
1315
- "1": {
1316
- patterns: [
1317
- {
1318
- match: "\\.",
1319
- name: "invalid.illegal.dot-not-allowed-here.swift"
1320
- }
1321
- ]
1322
- }
1323
- },
1324
- match: "(?x)\n\t\t\t\t\t\t\t\t\t\t(?<=\\G|\\.)\n\t\t\t\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\\g<oph>\n\t\t\t\t\t\t\t\t\t\t\t\t | (?<opc>\t\t\t\t\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)*\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t | ( \\. ( \\g<oph> | \\g<opc> | \\. )+ )\t\t\t# Dot operators\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t(?=\\.|;|$|//|/\\*|\\s)\n\t\t\t\t\t\t\t\t\t",
1325
- name: "entity.name.type.swift"
1326
- },
1327
- {
1328
- match: "\\.",
1329
- name: "punctuation.separator.import.swift"
1330
- },
1331
- {
1332
- begin: "(?!\\s*(;|$|//|/\\*))",
1333
- end: "(?=\\s*(;|$|//|/\\*))",
1334
- name: "invalid.illegal.character-not-allowed-here.swift"
1335
- }
1336
- ]
1337
- }
1338
- ]
1339
- },
1340
- "inheritance-clause": {
1341
- begin: "(:)(?=\\s*\\{)|(:)\\s*",
1342
- beginCaptures: {
1343
- "1": {
1344
- name: "invalid.illegal.empty-inheritance-clause.swift"
1345
- },
1346
- "2": {
1347
- name: "punctuation.separator.inheritance-clause.swift"
1348
- }
1349
- },
1350
- end: "(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)",
1351
- name: "meta.inheritance-clause.swift",
1352
- patterns: [
1353
- {
1354
- begin: "\\bclass\\b",
1355
- beginCaptures: {
1356
- "0": {
1357
- name: "storage.type.class.swift"
1358
- }
1359
- },
1360
- end: "(?=[={}]|(?!\\G)\\bwhere\\b)",
1361
- patterns: [
1362
- {
1363
- include: "#comments"
1364
- },
1365
- {
1366
- include: "#more-types"
1367
- }
1368
- ]
1369
- },
1370
- {
1371
- begin: "\\G",
1372
- end: "(?!\\G)$|(?=[={}]|(?!\\G)\\bwhere\\b)",
1373
- patterns: [
1374
- {
1375
- include: "#comments"
1376
- },
1377
- {
1378
- include: "#inherited-type"
1379
- },
1380
- {
1381
- include: "#more-types"
1382
- }
1383
- ]
1384
- }
1385
- ],
1386
- repository: {
1387
- "inherited-type": {
1388
- begin: "(?=[`\\p{L}_])",
1389
- end: "(?!\\G)",
1390
- name: "entity.other.inherited-class.swift",
1391
- patterns: [
1392
- {
1393
- include: "#type-identifier"
1394
- }
1395
- ]
1396
- },
1397
- "more-types": {
1398
- begin: ",\\s*",
1399
- end: "(?!\\G)(?!//|/\\*)|(?=[,={}]|(?!\\G)\\bwhere\\b)",
1400
- name: "meta.inheritance-list.more-types",
1401
- patterns: [
1402
- {
1403
- include: "#comments"
1404
- },
1405
- {
1406
- include: "#inherited-type"
1407
- },
1408
- {
1409
- include: "#more-types"
1410
- }
1411
- ]
1412
- }
1413
- }
1414
- },
1415
- operator: {
1416
- begin: "(?x)\n\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\\b(prefix|infix|postfix)\n\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t)?\n\t\t\t\t\t\t\\b\n\t\t\t\t\t\t(operator)\n\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\\g<oph>\n\t\t\t\t\t\t\t\t | \\.\t\t\t\t\t\t\t\t\t# Invalid dot\n\t\t\t\t\t\t\t\t | (?<opc>\t\t\t\t\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)*+\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t | ( \\. ( \\g<oph> | \\g<opc> | \\. )++ )\t\t\t# Dot operators\n\t\t\t\t\t\t)\n\t\t\t\t\t\t\\s*\n\t\t\t\t\t",
1417
- beginCaptures: {
1418
- "1": {
1419
- name: "storage.modifier.swift"
1420
- },
1421
- "2": {
1422
- name: "storage.type.function.operator.swift"
1423
- },
1424
- "3": {
1425
- name: "entity.name.function.operator.swift"
1426
- },
1427
- "4": {
1428
- patterns: [
1429
- {
1430
- match: "\\.",
1431
- name: "invalid.illegal.dot-not-allowed-here.swift"
1432
- }
1433
- ]
1434
- }
1435
- },
1436
- end: "(;)|$\\n?|(?=//|/\\*)",
1437
- endCaptures: {
1438
- "1": {
1439
- name: "punctuation.terminator.statement.swift"
1440
- }
1441
- },
1442
- name: "meta.definition.operator.swift",
1443
- patterns: [
1444
- {
1445
- include: "#swift2"
1446
- },
1447
- {
1448
- include: "#swift3"
1449
- },
1450
- {
1451
- match: "((?!$|;|//|/\\*)\\S)+",
1452
- name: "invalid.illegal.character-not-allowed-here.swift"
1453
- }
1454
- ],
1455
- repository: {
1456
- swift2: {
1457
- begin: "\\G(\\{)",
1458
- beginCaptures: {
1459
- "1": {
1460
- name: "punctuation.definition.operator.begin.swift"
1461
- }
1462
- },
1463
- end: "(\\})",
1464
- endCaptures: {
1465
- "1": {
1466
- name: "punctuation.definition.operator.end.swift"
1467
- }
1468
- },
1469
- patterns: [
1470
- {
1471
- include: "#comments"
1472
- },
1473
- {
1474
- captures: {
1475
- "1": {
1476
- name: "storage.modifier.swift"
1477
- },
1478
- "2": {
1479
- name: "keyword.other.operator.associativity.swift"
1480
- }
1481
- },
1482
- match: "\\b(associativity)\\s+(left|right)\\b"
1483
- },
1484
- {
1485
- captures: {
1486
- "1": {
1487
- name: "storage.modifier.swift"
1488
- },
1489
- "2": {
1490
- name: "constant.numeric.integer.swift"
1491
- }
1492
- },
1493
- match: "\\b(precedence)\\s+([0-9]+)\\b"
1494
- },
1495
- {
1496
- captures: {
1497
- "1": {
1498
- name: "storage.modifier.swift"
1499
- }
1500
- },
1501
- match: "\\b(assignment)\\b"
1502
- }
1503
- ]
1504
- },
1505
- swift3: {
1506
- captures: {
1507
- "2": {
1508
- name: "entity.other.inherited-class.swift",
1509
- patterns: [
1510
- {
1511
- include: "#types-precedencegroup"
1512
- }
1513
- ]
1514
- },
1515
- "3": {
1516
- name: "punctuation.definition.identifier.swift"
1517
- },
1518
- "4": {
1519
- name: "punctuation.definition.identifier.swift"
1520
- }
1521
- },
1522
- match: "\\G(:)\\s*((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))"
1523
- }
1524
- }
1525
- },
1526
- "parameter-clause": {
1527
- begin: "(\\()",
1528
- beginCaptures: {
1529
- "1": {
1530
- name: "punctuation.definition.parameters.begin.swift"
1531
- }
1532
- },
1533
- end: "(\\))(?:\\s*(async)\\b)?",
1534
- endCaptures: {
1535
- "1": {
1536
- name: "punctuation.definition.parameters.end.swift"
1537
- },
1538
- "2": {
1539
- name: "keyword.control.async.swift"
1540
- }
1541
- },
1542
- name: "meta.parameter-clause.swift",
1543
- patterns: [
1544
- {
1545
- include: "#parameter-list"
1546
- }
1547
- ]
1548
- },
1549
- "parameter-list": {
1550
- patterns: [
1551
- {
1552
- captures: {
1553
- "1": {
1554
- name: "entity.name.function.swift"
1555
- },
1556
- "2": {
1557
- name: "punctuation.definition.identifier.swift"
1558
- },
1559
- "3": {
1560
- name: "punctuation.definition.identifier.swift"
1561
- },
1562
- "4": {
1563
- name: "variable.parameter.function.swift"
1564
- },
1565
- "5": {
1566
- name: "punctuation.definition.identifier.swift"
1567
- },
1568
- "6": {
1569
- name: "punctuation.definition.identifier.swift"
1570
- }
1571
- },
1572
- comment: "External parameter labels are considered part of the function name",
1573
- match: "((?<q1>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q1>))\\s+((?<q2>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q2>))(?=\\s*:)"
1574
- },
1575
- {
1576
- captures: {
1577
- "1": {
1578
- name: "variable.parameter.function.swift"
1579
- },
1580
- "2": {
1581
- name: "entity.name.function.swift"
1582
- },
1583
- "3": {
1584
- name: "punctuation.definition.identifier.swift"
1585
- },
1586
- "4": {
1587
- name: "punctuation.definition.identifier.swift"
1588
- }
1589
- },
1590
- comment: "If no external label is given, the name is both the external label and the internal variable name",
1591
- match: "(((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)))(?=\\s*:)"
1592
- },
1593
- {
1594
- begin: ":\\s*(?!\\s)",
1595
- end: "(?=[,)])",
1596
- patterns: [
1597
- {
1598
- include: "#available-types"
1599
- },
1600
- {
1601
- match: ":",
1602
- name: "invalid.illegal.extra-colon-in-parameter-list.swift"
1603
- },
1604
- {
1605
- begin: "=",
1606
- beginCaptures: {
1607
- "0": {
1608
- name: "keyword.operator.assignment.swift"
1609
- }
1610
- },
1611
- comment: "a parameter's default value",
1612
- end: "(?=[,)])",
1613
- patterns: [
1614
- {
1615
- include: "#expressions"
1616
- }
1617
- ]
1618
- }
1619
- ]
1620
- }
1621
- ]
1622
- },
1623
- precedencegroup: {
1624
- begin: "\\b(precedencegroup)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*(?=\\{)",
1625
- beginCaptures: {
1626
- "1": {
1627
- name: "storage.type.precedencegroup.swift"
1628
- },
1629
- "2": {
1630
- name: "entity.name.type.precedencegroup.swift"
1631
- },
1632
- "3": {
1633
- name: "punctuation.definition.identifier.swift"
1634
- },
1635
- "4": {
1636
- name: "punctuation.definition.identifier.swift"
1637
- }
1638
- },
1639
- end: "(?!\\G)",
1640
- name: "meta.definition.precedencegroup.swift",
1641
- patterns: [
1642
- {
1643
- begin: "\\{",
1644
- beginCaptures: {
1645
- "0": {
1646
- name: "punctuation.definition.precedencegroup.begin.swift"
1647
- }
1648
- },
1649
- end: "\\}",
1650
- endCaptures: {
1651
- "0": {
1652
- name: "punctuation.definition.precedencegroup.end.swift"
1653
- }
1654
- },
1655
- patterns: [
1656
- {
1657
- include: "#comments"
1658
- },
1659
- {
1660
- captures: {
1661
- "1": {
1662
- name: "storage.modifier.swift"
1663
- },
1664
- "2": {
1665
- name: "entity.other.inherited-class.swift",
1666
- patterns: [
1667
- {
1668
- include: "#types-precedencegroup"
1669
- }
1670
- ]
1671
- },
1672
- "3": {
1673
- name: "punctuation.definition.identifier.swift"
1674
- },
1675
- "4": {
1676
- name: "punctuation.definition.identifier.swift"
1677
- }
1678
- },
1679
- match: "\\b(higherThan|lowerThan)\\s*:\\s*((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))"
1680
- },
1681
- {
1682
- captures: {
1683
- "1": {
1684
- name: "storage.modifier.swift"
1685
- },
1686
- "2": {
1687
- name: "keyword.other.operator.associativity.swift"
1688
- }
1689
- },
1690
- match: "\\b(associativity)\\b(?:\\s*:\\s*(right|left|none)\\b)?"
1691
- },
1692
- {
1693
- captures: {
1694
- "1": {
1695
- name: "storage.modifier.swift"
1696
- },
1697
- "2": {
1698
- name: "constant.language.boolean.swift"
1699
- }
1700
- },
1701
- match: "\\b(assignment)\\b(?:\\s*:\\s*(true|false)\\b)?"
1702
- }
1703
- ]
1704
- }
1705
- ]
1706
- },
1707
- protocol: {
1708
- begin: "\\b(protocol)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))",
1709
- beginCaptures: {
1710
- "1": {
1711
- name: "storage.type.$1.swift"
1712
- },
1713
- "2": {
1714
- name: "entity.name.type.$1.swift"
1715
- },
1716
- "3": {
1717
- name: "punctuation.definition.identifier.swift"
1718
- },
1719
- "4": {
1720
- name: "punctuation.definition.identifier.swift"
1721
- }
1722
- },
1723
- end: "(?<=\\})",
1724
- name: "meta.definition.type.protocol.swift",
1725
- patterns: [
1726
- {
1727
- include: "#comments"
1728
- },
1729
- {
1730
- include: "#inheritance-clause"
1731
- },
1732
- {
1733
- comment: "SE-0142: Permit where clauses to constrain associated types",
1734
- include: "#generic-where-clause"
1735
- },
1736
- {
1737
- begin: "\\{",
1738
- beginCaptures: {
1739
- "0": {
1740
- name: "punctuation.definition.type.begin.swift"
1741
- }
1742
- },
1743
- end: "\\}",
1744
- endCaptures: {
1745
- "0": {
1746
- name: "punctuation.definition.type.end.swift"
1747
- }
1748
- },
1749
- name: "meta.definition.type.body.swift",
1750
- patterns: [
1751
- {
1752
- include: "#protocol-method"
1753
- },
1754
- {
1755
- include: "#protocol-initializer"
1756
- },
1757
- {
1758
- include: "#associated-type"
1759
- },
1760
- {
1761
- include: "$self"
1762
- }
1763
- ]
1764
- }
1765
- ],
1766
- repository: {
1767
- "associated-type": {
1768
- begin: "\\b(associatedtype)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*",
1769
- beginCaptures: {
1770
- "1": {
1771
- name: "keyword.other.declaration-specifier.swift"
1772
- },
1773
- "2": {
1774
- name: "variable.language.associatedtype.swift"
1775
- },
1776
- "3": {
1777
- name: "punctuation.definition.identifier.swift"
1778
- },
1779
- "4": {
1780
- name: "punctuation.definition.identifier.swift"
1781
- }
1782
- },
1783
- end: "(?!\\G)$|(?=[;}]|$)",
1784
- name: "meta.definition.associatedtype.swift",
1785
- patterns: [
1786
- {
1787
- include: "#inheritance-clause"
1788
- },
1789
- {
1790
- comment: "SE-0142: Permit where clauses to constrain associated types",
1791
- include: "#generic-where-clause"
1792
- },
1793
- {
1794
- include: "#typealias-assignment"
1795
- }
1796
- ]
1797
- },
1798
- "protocol-initializer": {
1799
- begin: "(?<!\\.)\\b(init[?!]*(?# only one is valid, but we want the in⇥ snippet to produce something that looks good))\\s*(?=\\(|<)",
1800
- beginCaptures: {
1801
- "1": {
1802
- name: "storage.type.function.swift",
1803
- patterns: [
1804
- {
1805
- match: "(?<=[?!])[?!]+",
1806
- name: "invalid.illegal.character-not-allowed-here.swift"
1807
- }
1808
- ]
1809
- }
1810
- },
1811
- end: "$|(?=;|//|/\\*|\\})",
1812
- name: "meta.definition.function.initializer.swift",
1813
- patterns: [
1814
- {
1815
- include: "#comments"
1816
- },
1817
- {
1818
- include: "#generic-parameter-clause"
1819
- },
1820
- {
1821
- include: "#parameter-clause"
1822
- },
1823
- {
1824
- include: "#async-throws"
1825
- },
1826
- {
1827
- comment: "Swift 3: generic constraints after the parameters and return type",
1828
- include: "#generic-where-clause"
1829
- },
1830
- {
1831
- begin: "\\{",
1832
- beginCaptures: {
1833
- "0": {
1834
- name: "punctuation.section.function.begin.swift"
1835
- }
1836
- },
1837
- end: "\\}",
1838
- endCaptures: {
1839
- "0": {
1840
- name: "punctuation.section.function.end.swift"
1841
- }
1842
- },
1843
- name: "invalid.illegal.function-body-not-allowed-in-protocol.swift",
1844
- patterns: [
1845
- {
1846
- include: "$self"
1847
- }
1848
- ]
1849
- }
1850
- ]
1851
- },
1852
- "protocol-method": {
1853
- begin: "(?x)\n\t\t\t\t\t\t\t\t\\b\n\t\t\t\t\t\t\t\t(func)\n\t\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)\n\t\t \t\t\t\t\t\t | (?:\n\t\t \t\t\t\t\t\t\t\t(\n\t\t \t\t\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t# operator-head\n\t\t \t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t \t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t \t\t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t\t\t(\n\t\t \t\t\t\t\t\t\t\t\t\t\\g<oph>\n\t\t \t\t\t\t\t\t\t\t\t | (?<opc>\t\t\t\t\t\t\t\t# operator-character\n\t\t \t\t\t\t\t\t\t\t\t\t\t[\\x{0300}-\\x{036F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t \t\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t \t\t\t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t\t\t)*\n\t\t \t\t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t\t | ( \\. ( \\g<oph> | \\g<opc> | \\. )+ )\t\t\t# Dot operators\n\t\t \t\t\t\t\t\t\t)\n\t\t \t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t\t\t(?=\\(|<)\n\t\t\t\t\t\t\t",
1854
- beginCaptures: {
1855
- "1": {
1856
- name: "storage.type.function.swift"
1857
- },
1858
- "2": {
1859
- name: "entity.name.function.swift"
1860
- },
1861
- "3": {
1862
- name: "punctuation.definition.identifier.swift"
1863
- },
1864
- "4": {
1865
- name: "punctuation.definition.identifier.swift"
1866
- }
1867
- },
1868
- end: "$|(?=;|//|/\\*|\\})",
1869
- name: "meta.definition.function.swift",
1870
- patterns: [
1871
- {
1872
- include: "#comments"
1873
- },
1874
- {
1875
- include: "#generic-parameter-clause"
1876
- },
1877
- {
1878
- include: "#parameter-clause"
1879
- },
1880
- {
1881
- include: "#function-result"
1882
- },
1883
- {
1884
- include: "#async-throws"
1885
- },
1886
- {
1887
- comment: "Swift 3: generic constraints after the parameters and return type",
1888
- include: "#generic-where-clause"
1889
- },
1890
- {
1891
- begin: "\\{",
1892
- beginCaptures: {
1893
- "0": {
1894
- name: "punctuation.section.function.begin.swift"
1895
- }
1896
- },
1897
- end: "\\}",
1898
- endCaptures: {
1899
- "0": {
1900
- name: "punctuation.section.function.end.swift"
1901
- }
1902
- },
1903
- name: "invalid.illegal.function-body-not-allowed-in-protocol.swift",
1904
- patterns: [
1905
- {
1906
- include: "$self"
1907
- }
1908
- ]
1909
- }
1910
- ]
1911
- }
1912
- }
1913
- },
1914
- type: {
1915
- patterns: [
1916
- {
1917
- begin: "\\b(class(?!\\s+(?:func|var|let)\\b)|struct|actor)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))",
1918
- beginCaptures: {
1919
- "1": {
1920
- name: "storage.type.$1.swift"
1921
- },
1922
- "2": {
1923
- name: "entity.name.type.$1.swift"
1924
- },
1925
- "3": {
1926
- name: "punctuation.definition.identifier.swift"
1927
- },
1928
- "4": {
1929
- name: "punctuation.definition.identifier.swift"
1930
- }
1931
- },
1932
- end: "(?<=\\})",
1933
- name: "meta.definition.type.$1.swift",
1934
- patterns: [
1935
- {
1936
- include: "#comments"
1937
- },
1938
- {
1939
- include: "#generic-parameter-clause"
1940
- },
1941
- {
1942
- comment: "Swift 3: generic constraints after the generic param list",
1943
- include: "#generic-where-clause"
1944
- },
1945
- {
1946
- include: "#inheritance-clause"
1947
- },
1948
- {
1949
- begin: "\\{",
1950
- beginCaptures: {
1951
- "0": {
1952
- name: "punctuation.definition.type.begin.swift"
1953
- }
1954
- },
1955
- end: "\\}",
1956
- endCaptures: {
1957
- "0": {
1958
- name: "punctuation.definition.type.end.swift"
1959
- }
1960
- },
1961
- name: "meta.definition.type.body.swift",
1962
- patterns: [
1963
- {
1964
- include: "$self"
1965
- }
1966
- ]
1967
- }
1968
- ]
1969
- },
1970
- {
1971
- include: "#type-enum"
1972
- }
1973
- ]
1974
- },
1975
- "type-enum": {
1976
- begin: "\\b(enum)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))",
1977
- beginCaptures: {
1978
- "1": {
1979
- name: "storage.type.$1.swift"
1980
- },
1981
- "2": {
1982
- name: "entity.name.type.$1.swift"
1983
- },
1984
- "3": {
1985
- name: "punctuation.definition.identifier.swift"
1986
- },
1987
- "4": {
1988
- name: "punctuation.definition.identifier.swift"
1989
- }
1990
- },
1991
- end: "(?<=\\})",
1992
- name: "meta.definition.type.$1.swift",
1993
- patterns: [
1994
- {
1995
- include: "#comments"
1996
- },
1997
- {
1998
- include: "#generic-parameter-clause"
1999
- },
2000
- {
2001
- comment: "Swift 3: generic constraints after the generic param list",
2002
- include: "#generic-where-clause"
2003
- },
2004
- {
2005
- include: "#inheritance-clause"
2006
- },
2007
- {
2008
- begin: "\\{",
2009
- beginCaptures: {
2010
- "0": {
2011
- name: "punctuation.definition.type.begin.swift"
2012
- }
2013
- },
2014
- end: "\\}",
2015
- endCaptures: {
2016
- "0": {
2017
- name: "punctuation.definition.type.end.swift"
2018
- }
2019
- },
2020
- name: "meta.definition.type.body.swift",
2021
- patterns: [
2022
- {
2023
- include: "#enum-case-clause"
2024
- },
2025
- {
2026
- include: "$self"
2027
- }
2028
- ]
2029
- }
2030
- ],
2031
- repository: {
2032
- "associated-values": {
2033
- begin: "\\G\\(",
2034
- beginCaptures: {
2035
- "0": {
2036
- name: "punctuation.definition.parameters.begin.swift"
2037
- }
2038
- },
2039
- end: "\\)",
2040
- endCaptures: {
2041
- "0": {
2042
- name: "punctuation.definition.parameters.end.swift"
2043
- }
2044
- },
2045
- patterns: [
2046
- {
2047
- include: "#comments"
2048
- },
2049
- {
2050
- begin: "(?x)\n\t\t\t\t\t\t\t\t\t\t(?:(_)|((?<q1>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k<q1>))\n\t\t\t\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t\t\t\t\t(((?<q2>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k<q2>))\n\t\t\t\t\t\t\t\t\t\t\\s*(:)",
2051
- beginCaptures: {
2052
- "1": {
2053
- name: "entity.name.function.swift"
2054
- },
2055
- "2": {
2056
- name: "invalid.illegal.distinct-labels-not-allowed.swift"
2057
- },
2058
- "5": {
2059
- name: "variable.parameter.function.swift"
2060
- },
2061
- "7": {
2062
- name: "punctuation.separator.argument-label.swift"
2063
- }
2064
- },
2065
- end: "(?=[,)\\]])",
2066
- patterns: [
2067
- {
2068
- include: "#available-types"
2069
- }
2070
- ]
2071
- },
2072
- {
2073
- begin: "(((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k<q>))\\s*(:)",
2074
- beginCaptures: {
2075
- "1": {
2076
- name: "entity.name.function.swift"
2077
- },
2078
- "2": {
2079
- name: "variable.parameter.function.swift"
2080
- },
2081
- "4": {
2082
- name: "punctuation.separator.argument-label.swift"
2083
- }
2084
- },
2085
- end: "(?=[,)\\]])",
2086
- patterns: [
2087
- {
2088
- include: "#available-types"
2089
- }
2090
- ]
2091
- },
2092
- {
2093
- begin: "(?![,)\\]])(?=\\S)",
2094
- comment: "an element without a label (i.e. anything else)",
2095
- end: "(?=[,)\\]])",
2096
- patterns: [
2097
- {
2098
- include: "#available-types"
2099
- },
2100
- {
2101
- match: ":",
2102
- name: "invalid.illegal.extra-colon-in-parameter-list.swift"
2103
- }
2104
- ]
2105
- }
2106
- ]
2107
- },
2108
- "enum-case": {
2109
- begin: "(?x)((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*",
2110
- beginCaptures: {
2111
- "1": {
2112
- name: "constant.other.swift"
2113
- }
2114
- },
2115
- end: "(?<=\\))|(?![=(])",
2116
- patterns: [
2117
- {
2118
- include: "#comments"
2119
- },
2120
- {
2121
- include: "#associated-values"
2122
- },
2123
- {
2124
- include: "#raw-value-assignment"
2125
- }
2126
- ]
2127
- },
2128
- "enum-case-clause": {
2129
- begin: "\\b(case)\\b\\s*",
2130
- beginCaptures: {
2131
- "1": {
2132
- name: "storage.type.enum.case.swift"
2133
- }
2134
- },
2135
- end: "(?=[;}])|(?!\\G)(?!//|/\\*)(?=[^\\s,])",
2136
- patterns: [
2137
- {
2138
- include: "#comments"
2139
- },
2140
- {
2141
- include: "#enum-case"
2142
- },
2143
- {
2144
- include: "#more-cases"
2145
- }
2146
- ]
2147
- },
2148
- "more-cases": {
2149
- begin: ",\\s*",
2150
- end: "(?!\\G)(?!//|/\\*)(?=[;}]|[^\\s,])",
2151
- name: "meta.enum-case.more-cases",
2152
- patterns: [
2153
- {
2154
- include: "#comments"
2155
- },
2156
- {
2157
- include: "#enum-case"
2158
- },
2159
- {
2160
- include: "#more-cases"
2161
- }
2162
- ]
2163
- },
2164
- "raw-value-assignment": {
2165
- begin: "(=)\\s*",
2166
- beginCaptures: {
2167
- "1": {
2168
- name: "keyword.operator.assignment.swift"
2169
- }
2170
- },
2171
- end: "(?!\\G)",
2172
- patterns: [
2173
- {
2174
- include: "#comments"
2175
- },
2176
- {
2177
- include: "#literals"
2178
- }
2179
- ]
2180
- }
2181
- }
2182
- },
2183
- "type-identifier": {
2184
- begin: "((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*",
2185
- beginCaptures: {
2186
- "1": {
2187
- name: "meta.type-name.swift",
2188
- patterns: [
2189
- {
2190
- include: "#builtin-types"
2191
- }
2192
- ]
2193
- },
2194
- "2": {
2195
- name: "punctuation.definition.identifier.swift"
2196
- },
2197
- "3": {
2198
- name: "punctuation.definition.identifier.swift"
2199
- }
2200
- },
2201
- end: "(?!<)",
2202
- patterns: [
2203
- {
2204
- begin: "(?=<)",
2205
- end: "(?!\\G)",
2206
- patterns: [
2207
- {
2208
- include: "#generic-argument-clause"
2209
- }
2210
- ]
2211
- }
2212
- ]
2213
- },
2214
- typealias: {
2215
- begin: "\\b(typealias)\\s+((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*",
2216
- beginCaptures: {
2217
- "1": {
2218
- name: "keyword.other.declaration-specifier.swift"
2219
- },
2220
- "2": {
2221
- name: "entity.name.type.typealias.swift"
2222
- },
2223
- "3": {
2224
- name: "punctuation.definition.identifier.swift"
2225
- },
2226
- "4": {
2227
- name: "punctuation.definition.identifier.swift"
2228
- }
2229
- },
2230
- end: "(?!\\G)$|(?=;|//|/\\*|$)",
2231
- name: "meta.definition.typealias.swift",
2232
- patterns: [
2233
- {
2234
- begin: "\\G(?=<)",
2235
- end: "(?!\\G)",
2236
- patterns: [
2237
- {
2238
- include: "#generic-parameter-clause"
2239
- }
2240
- ]
2241
- },
2242
- {
2243
- include: "#typealias-assignment"
2244
- }
2245
- ]
2246
- },
2247
- "typealias-assignment": {
2248
- begin: "(=)\\s*",
2249
- beginCaptures: {
2250
- "1": {
2251
- name: "keyword.operator.assignment.swift"
2252
- }
2253
- },
2254
- end: "(?!\\G)$|(?=;|//|/\\*|$)",
2255
- patterns: [
2256
- {
2257
- include: "#available-types"
2258
- }
2259
- ]
2260
- },
2261
- "typed-variable-declaration": {
2262
- begin: "(?x)\n\t\t\t\t\t\t\\b(?:(async)\\s+)?(let|var)\\b\\s+\n\t\t\t\t\t\t(?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>)\\s*\n\t\t\t\t\t\t:\n\t\t\t\t\t",
2263
- beginCaptures: {
2264
- "1": {
2265
- name: "keyword.control.async.swift"
2266
- },
2267
- "2": {
2268
- name: "keyword.other.declaration-specifier.swift"
2269
- }
2270
- },
2271
- end: "(?=$|[={])",
2272
- patterns: [
2273
- {
2274
- include: "#available-types"
2275
- }
2276
- ]
2277
- },
2278
- "types-precedencegroup": {
2279
- patterns: [
2280
- {
2281
- comment: "Precedence groups in the standard library",
2282
- match: "\\b(?:BitwiseShift|Assignment|RangeFormation|Casting|Addition|NilCoalescing|Comparison|LogicalConjunction|LogicalDisjunction|Default|Ternary|Multiplication|FunctionArrow)Precedence\\b",
2283
- name: "support.type.swift"
2284
- }
2285
- ]
2286
- }
2287
- }
2288
- },
2289
- expressions: {
2290
- patterns: [
2291
- {
2292
- include: "#comments"
2293
- },
2294
- {
2295
- include: "#code-block"
2296
- },
2297
- {
2298
- include: "#attributes"
2299
- },
2300
- {
2301
- include: "#closure-parameter"
2302
- },
2303
- {
2304
- include: "#literals"
2305
- },
2306
- {
2307
- include: "#operators"
2308
- },
2309
- {
2310
- include: "#builtin-types"
2311
- },
2312
- {
2313
- include: "#builtin-functions"
2314
- },
2315
- {
2316
- include: "#builtin-global-functions"
2317
- },
2318
- {
2319
- include: "#builtin-properties"
2320
- },
2321
- {
2322
- include: "#compound-name"
2323
- },
2324
- {
2325
- include: "#keywords"
2326
- },
2327
- {
2328
- include: "#function-call-expression"
2329
- },
2330
- {
2331
- include: "#subscript-expression"
2332
- },
2333
- {
2334
- include: "#parenthesized-expression"
2335
- },
2336
- {
2337
- include: "#member-reference"
2338
- },
2339
- {
2340
- include: "#availability-condition"
2341
- },
2342
- {
2343
- match: "\\b_\\b",
2344
- name: "support.variable.discard-value.swift"
2345
- }
2346
- ],
2347
- repository: {
2348
- "availability-condition": {
2349
- begin: "\\B(#(?:un)?available)(\\()",
2350
- beginCaptures: {
2351
- "1": {
2352
- name: "support.function.availability-condition.swift"
2353
- },
2354
- "2": {
2355
- name: "punctuation.definition.arguments.begin.swift"
2356
- }
2357
- },
2358
- end: "\\)",
2359
- endCaptures: {
2360
- "0": {
2361
- name: "punctuation.definition.arguments.end.swift"
2362
- }
2363
- },
2364
- patterns: [
2365
- {
2366
- captures: {
2367
- "1": {
2368
- name: "keyword.other.platform.os.swift"
2369
- },
2370
- "2": {
2371
- name: "constant.numeric.swift"
2372
- }
2373
- },
2374
- match: "\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))"
2375
- },
2376
- {
2377
- captures: {
2378
- "1": {
2379
- name: "keyword.other.platform.all.swift"
2380
- },
2381
- "2": {
2382
- name: "invalid.illegal.character-not-allowed-here.swift"
2383
- }
2384
- },
2385
- match: "(\\*)\\s*(.*?)(?=[,)])"
2386
- },
2387
- {
2388
- match: "[^\\s,)]+",
2389
- name: "invalid.illegal.character-not-allowed-here.swift"
2390
- }
2391
- ]
2392
- },
2393
- "closure-parameter": {
2394
- match: "\\$[0-9]+",
2395
- name: "variable.language.closure-parameter.swift"
2396
- },
2397
- "compound-name": {
2398
- captures: {
2399
- "1": {
2400
- name: "entity.name.function.compound-name.swift"
2401
- },
2402
- "2": {
2403
- name: "punctuation.definition.entity.swift"
2404
- },
2405
- "3": {
2406
- name: "punctuation.definition.entity.swift"
2407
- },
2408
- "4": {
2409
- patterns: [
2410
- {
2411
- captures: {
2412
- "1": {
2413
- name: "punctuation.definition.entity.swift"
2414
- },
2415
- "2": {
2416
- name: "punctuation.definition.entity.swift"
2417
- }
2418
- },
2419
- match: "(?<q>`?)(?!_:)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>):",
2420
- name: "entity.name.function.compound-name.swift"
2421
- }
2422
- ]
2423
- }
2424
- },
2425
- comment: "a reference to a function with disambiguating argument labels, such as foo(_:), foo(bar:), etc.",
2426
- match: "(?x)\n\t\t\t\t\t\t((?<q1>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q1>)) \t\t# function name\n\t\t\t\t\t\t\\(\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t((?<q2>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q2>)) \t# argument label\n\t\t\t\t\t\t\t\t\t:\t\t\t\t\t\t\t\t\t\t\t\t# colon\n\t\t\t\t\t\t\t\t)+\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\\)\n\t\t\t\t\t"
2427
- },
2428
- "expression-element-list": {
2429
- patterns: [
2430
- {
2431
- include: "#comments"
2432
- },
2433
- {
2434
- begin: "((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*(:)",
2435
- beginCaptures: {
2436
- "1": {
2437
- name: "support.function.any-method.swift"
2438
- },
2439
- "2": {
2440
- name: "punctuation.definition.identifier.swift"
2441
- },
2442
- "3": {
2443
- name: "punctuation.definition.identifier.swift"
2444
- },
2445
- "4": {
2446
- name: "punctuation.separator.argument-label.swift"
2447
- }
2448
- },
2449
- comment: "an element with a label",
2450
- end: "(?=[,)\\]])",
2451
- patterns: [
2452
- {
2453
- include: "#expressions"
2454
- }
2455
- ]
2456
- },
2457
- {
2458
- begin: "(?![,)\\]])(?=\\S)",
2459
- comment: "an element without a label (i.e. anything else)",
2460
- end: "(?=[,)\\]])",
2461
- patterns: [
2462
- {
2463
- include: "#expressions"
2464
- }
2465
- ]
2466
- }
2467
- ]
2468
- },
2469
- "function-call-expression": {
2470
- patterns: [
2471
- {
2472
- begin: "((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))\\s*(\\()",
2473
- beginCaptures: {
2474
- "1": {
2475
- name: "support.function.any-method.swift"
2476
- },
2477
- "2": {
2478
- name: "punctuation.definition.identifier.swift"
2479
- },
2480
- "3": {
2481
- name: "punctuation.definition.identifier.swift"
2482
- },
2483
- "4": {
2484
- name: "punctuation.definition.arguments.begin.swift"
2485
- }
2486
- },
2487
- comment: "foo(args) -- a call whose callee is a highlightable name",
2488
- end: "\\)",
2489
- endCaptures: {
2490
- "0": {
2491
- name: "punctuation.definition.arguments.end.swift"
2492
- }
2493
- },
2494
- name: "meta.function-call.swift",
2495
- patterns: [
2496
- {
2497
- include: "#expression-element-list"
2498
- }
2499
- ]
2500
- },
2501
- {
2502
- begin: "(?<=[`\\])}>\\p{L}_\\p{N}\\p{M}])\\s*(\\()",
2503
- beginCaptures: {
2504
- "1": {
2505
- name: "punctuation.definition.arguments.begin.swift"
2506
- }
2507
- },
2508
- comment: "[Int](args) -- a call whose callee is a more complicated expression",
2509
- end: "\\)",
2510
- endCaptures: {
2511
- "0": {
2512
- name: "punctuation.definition.arguments.end.swift"
2513
- }
2514
- },
2515
- name: "meta.function-call.swift",
2516
- patterns: [
2517
- {
2518
- include: "#expression-element-list"
2519
- }
2520
- ]
2521
- }
2522
- ]
2523
- },
2524
- "member-reference": {
2525
- patterns: [
2526
- {
2527
- captures: {
2528
- "1": {
2529
- name: "variable.other.swift"
2530
- },
2531
- "2": {
2532
- name: "punctuation.definition.identifier.swift"
2533
- },
2534
- "3": {
2535
- name: "punctuation.definition.identifier.swift"
2536
- }
2537
- },
2538
- match: "(?<=\\.)((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*(\\k<q>))"
2539
- }
2540
- ]
2541
- },
2542
- "parenthesized-expression": {
2543
- begin: "\\(",
2544
- beginCaptures: {
2545
- "0": {
2546
- name: "punctuation.section.tuple.begin.swift"
2547
- }
2548
- },
2549
- comment: "correctly matching closure expressions is too hard (depends on trailing \"in\") so we just tack on some basics to the end of parenthesized-expression",
2550
- end: "(\\))\\s*((?:\\b(?:async|throws|rethrows)\\s)*)",
2551
- endCaptures: {
2552
- "1": {
2553
- name: "punctuation.section.tuple.end.swift"
2554
- },
2555
- "2": {
2556
- patterns: [
2557
- {
2558
- match: "\\brethrows\\b",
2559
- name: "invalid.illegal.rethrows-only-allowed-on-function-declarations.swift"
2560
- },
2561
- {
2562
- include: "#async-throws"
2563
- }
2564
- ]
2565
- }
2566
- },
2567
- patterns: [
2568
- {
2569
- include: "#expression-element-list"
2570
- }
2571
- ]
2572
- },
2573
- "subscript-expression": {
2574
- begin: "(?<=[`\\p{L}_\\p{N}\\p{M}])\\s*(\\[)",
2575
- beginCaptures: {
2576
- "1": {
2577
- name: "punctuation.definition.arguments.begin.swift"
2578
- }
2579
- },
2580
- end: "\\]",
2581
- endCaptures: {
2582
- "0": {
2583
- name: "punctuation.definition.arguments.end.swift"
2584
- }
2585
- },
2586
- name: "meta.subscript-expression.swift",
2587
- patterns: [
2588
- {
2589
- include: "#expression-element-list"
2590
- }
2591
- ]
2592
- }
2593
- }
2594
- },
2595
- keywords: {
2596
- patterns: [
2597
- {
2598
- match: "(?<!\\.)\\b(?:if|else|guard|where|switch|case|default|fallthrough)\\b",
2599
- name: "keyword.control.branch.swift"
2600
- },
2601
- {
2602
- match: "(?<!\\.)\\b(?:continue|break|fallthrough|return)\\b",
2603
- name: "keyword.control.transfer.swift"
2604
- },
2605
- {
2606
- match: "(?<!\\.)\\b(?:while|for|in)\\b",
2607
- name: "keyword.control.loop.swift"
2608
- },
2609
- {
2610
- captures: {
2611
- "1": {
2612
- name: "keyword.control.loop.swift"
2613
- },
2614
- "2": {
2615
- name: "punctuation.whitespace.trailing.repeat.swift"
2616
- }
2617
- },
2618
- comment: "extra scopes for repeat-while snippet",
2619
- match: "(?<!\\.)\\b(repeat)\\b(\\s*)"
2620
- },
2621
- {
2622
- match: "(?<!\\.)\\bdefer\\b",
2623
- name: "keyword.control.defer.swift"
2624
- },
2625
- {
2626
- captures: {
2627
- "1": {
2628
- name: "invalid.illegal.try-must-precede-await.swift"
2629
- },
2630
- "2": {
2631
- name: "keyword.control.await.swift"
2632
- }
2633
- },
2634
- match: "(?<!\\.)\\b(?:(await\\s+try)|(await)\\b)"
2635
- },
2636
- {
2637
- match: "(?<!\\.)\\b(?:catch|throws?|rethrows|try)\\b|\\btry[?!]\\B",
2638
- name: "keyword.control.exception.swift"
2639
- },
2640
- {
2641
- captures: {
2642
- "1": {
2643
- name: "keyword.control.exception.swift"
2644
- },
2645
- "2": {
2646
- name: "punctuation.whitespace.trailing.do.swift"
2647
- }
2648
- },
2649
- comment: "extra scopes for do-catch snippet",
2650
- match: "(?<!\\.)\\b(do)\\b(\\s*)"
2651
- },
2652
- {
2653
- captures: {
2654
- "1": {
2655
- name: "keyword.control.async.swift"
2656
- },
2657
- "2": {
2658
- name: "storage.modifier.swift"
2659
- },
2660
- "3": {
2661
- name: "keyword.other.declaration-specifier.swift"
2662
- }
2663
- },
2664
- match: "(?<!\\.)\\b(?:(?:(async)|(nonisolated))\\s+)?(let|var)\\b"
2665
- },
2666
- {
2667
- match: "(?<!\\.)\\b(?:associatedtype|operator|typealias)\\b",
2668
- name: "keyword.other.declaration-specifier.swift"
2669
- },
2670
- {
2671
- match: "(?<!\\.)\\b(class|enum|extension|precedencegroup|protocol|struct|actor)\\b",
2672
- name: "storage.type.$1.swift"
2673
- },
2674
- {
2675
- match: "(?<!\\.)\\b(?:inout|static|final|lazy|mutating|nonmutating|optional|indirect|required|override|dynamic|convenience|infix|prefix|postfix)\\b",
2676
- name: "storage.modifier.swift"
2677
- },
2678
- {
2679
- match: "\\binit[?!]|\\binit\\b|(?<!\\.)\\b(?:func|deinit|subscript|didSet|get|set|willSet)\\b",
2680
- name: "storage.type.function.swift"
2681
- },
2682
- {
2683
- match: "(?<!\\.)\\b(?:fileprivate|private|internal|public|open)\\b",
2684
- name: "keyword.other.declaration-specifier.accessibility.swift"
2685
- },
2686
- {
2687
- comment: "matches weak, unowned, unowned(safe), unowned(unsafe)",
2688
- match: "(?<!\\.)\\bunowned\\((?:safe|unsafe)\\)|(?<!\\.)\\b(?:weak|unowned)\\b",
2689
- name: "keyword.other.capture-specifier.swift"
2690
- },
2691
- {
2692
- captures: {
2693
- "1": {
2694
- name: "keyword.operator.type.swift"
2695
- },
2696
- "2": {
2697
- name: "keyword.operator.type.metatype.swift"
2698
- }
2699
- },
2700
- match: "(?<=\\.)(?:(dynamicType|self)|(Protocol|Type))\\b"
2701
- },
2702
- {
2703
- match: "(?<!\\.)\\b(?:super|self|Self)\\b",
2704
- name: "variable.language.swift"
2705
- },
2706
- {
2707
- match: "\\B(?:#file|#filePath|#fileID|#line|#column|#function|#dsohandle)\\b|\\b(?:__FILE__|__LINE__|__COLUMN__|__FUNCTION__|__DSO_HANDLE__)\\b",
2708
- name: "support.variable.swift"
2709
- },
2710
- {
2711
- match: "(?<!\\.)\\bimport\\b",
2712
- name: "keyword.control.import.swift"
2713
- }
2714
- ]
2715
- },
2716
- literals: {
2717
- patterns: [
2718
- {
2719
- include: "#boolean"
2720
- },
2721
- {
2722
- include: "#numeric"
2723
- },
2724
- {
2725
- include: "#string"
2726
- },
2727
- {
2728
- match: "\\bnil\\b",
2729
- name: "constant.language.nil.swift"
2730
- },
2731
- {
2732
- comment: "object \"literals\" used in playgrounds",
2733
- match: "\\B#(colorLiteral|imageLiteral|fileLiteral)\\b",
2734
- name: "support.function.object-literal.swift"
2735
- },
2736
- {
2737
- match: "\\B#keyPath\\b",
2738
- name: "support.function.key-path.swift"
2739
- },
2740
- {
2741
- begin: "\\B(#selector)(\\()(?:\\s*(getter|setter)\\s*(:))?",
2742
- beginCaptures: {
2743
- "1": {
2744
- name: "support.function.selector-reference.swift"
2745
- },
2746
- "2": {
2747
- name: "punctuation.definition.arguments.begin.swift"
2748
- },
2749
- "3": {
2750
- name: "support.variable.parameter.swift"
2751
- },
2752
- "4": {
2753
- name: "punctuation.separator.argument-label.swift"
2754
- }
2755
- },
2756
- end: "\\)",
2757
- endCaptures: {
2758
- "0": {
2759
- name: "punctuation.definition.arguments.end.swift"
2760
- }
2761
- },
2762
- patterns: [
2763
- {
2764
- include: "#expressions"
2765
- }
2766
- ]
2767
- }
2768
- ],
2769
- repository: {
2770
- boolean: {
2771
- match: "\\b(true|false)\\b",
2772
- name: "constant.language.boolean.swift"
2773
- },
2774
- numeric: {
2775
- patterns: [
2776
- {
2777
- comment: "0.1, -4_2.5, 6.022e23, 10E-5",
2778
- match: "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)[0-9][0-9_]*(?=\\.[0-9]|[eE])(?:\\.[0-9][0-9_]*)?(?:[eE][-+]?[0-9][0-9_]*)?\\b(?!\\.[0-9])",
2779
- name: "constant.numeric.float.decimal.swift"
2780
- },
2781
- {
2782
- comment: "-0x1.ap2_3, 0x31p-4",
2783
- match: "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x[0-9a-fA-F][0-9a-fA-F_]*)(?:\\.[0-9a-fA-F][0-9a-fA-F_]*)?[pP][-+]?[0-9][0-9_]*\\b(?!\\.[0-9])",
2784
- name: "constant.numeric.float.hexadecimal.swift"
2785
- },
2786
- {
2787
- comment: "0x1p, 0x1p_2, 0x1.5pa, 0x1.1p+1f, 0x1pz",
2788
- match: "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x[0-9a-fA-F][0-9a-fA-F_]*)(?:\\.[0-9a-fA-F][0-9a-fA-F_]*)?(?:[pP][-+]?\\w*)\\b(?!\\.[0-9])",
2789
- name: "invalid.illegal.numeric.float.invalid-exponent.swift"
2790
- },
2791
- {
2792
- comment: "0x1.5w (note that 0x1.f may be a valid expression)",
2793
- match: "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)(0x[0-9a-fA-F][0-9a-fA-F_]*)\\.[0-9][\\w.]*",
2794
- name: "invalid.illegal.numeric.float.missing-exponent.swift"
2795
- },
2796
- {
2797
- comment: "-.5, .2f (note that 1.-.5 may be a valid expression)",
2798
- match: "(?<=\\s|^)\\-?\\.[0-9][\\w.]*",
2799
- name: "invalid.illegal.numeric.float.missing-leading-zero.swift"
2800
- },
2801
- {
2802
- comment: "0b_0_1, 0x_1p+3q",
2803
- match: "(\\B\\-|\\b)0[box]_[0-9a-fA-F_]*(?:[pPeE][+-]?\\w+)?[\\w.]+",
2804
- name: "invalid.illegal.numeric.leading-underscore.swift"
2805
- },
2806
- {
2807
- comment: "tuple positional member: not really a numeric literal, but not invalid",
2808
- match: "(?<=[\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)[0-9]+\\b"
2809
- },
2810
- {
2811
- comment: "0b010, 0b1_0",
2812
- match: "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)0b[01][01_]*\\b(?!\\.[0-9])",
2813
- name: "constant.numeric.integer.binary.swift"
2814
- },
2815
- {
2816
- comment: "0o1, 0o7_3",
2817
- match: "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)0o[0-7][0-7_]*\\b(?!\\.[0-9])",
2818
- name: "constant.numeric.integer.octal.swift"
2819
- },
2820
- {
2821
- comment: "02, 3_456",
2822
- match: "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)[0-9][0-9_]*\\b(?!\\.[0-9])",
2823
- name: "constant.numeric.integer.decimal.swift"
2824
- },
2825
- {
2826
- comment: "0x4, 0xF_7",
2827
- match: "(\\B\\-|\\b)(?<![\\[\\](){}\\p{L}_\\p{N}\\p{M}]\\.)0x[0-9a-fA-F][0-9a-fA-F_]*\\b(?!\\.[0-9])",
2828
- name: "constant.numeric.integer.hexadecimal.swift"
2829
- },
2830
- {
2831
- match: "(\\B\\-|\\b)[0-9][\\w.]*",
2832
- name: "invalid.illegal.numeric.other.swift"
2833
- }
2834
- ]
2835
- },
2836
- string: {
2837
- patterns: [
2838
- {
2839
- begin: "\"\"\"",
2840
- beginCaptures: {
2841
- "0": {
2842
- name: "punctuation.definition.string.begin.swift"
2843
- }
2844
- },
2845
- comment: "SE-0168: Multi-Line String Literals",
2846
- end: "\"\"\"(#*)",
2847
- endCaptures: {
2848
- "0": {
2849
- name: "punctuation.definition.string.end.swift"
2850
- },
2851
- "1": {
2852
- name: "invalid.illegal.extra-closing-delimiter.swift"
2853
- }
2854
- },
2855
- name: "string.quoted.double.block.swift",
2856
- patterns: [
2857
- {
2858
- match: "\\G.+(?=\"\"\")|\\G.+",
2859
- name: "invalid.illegal.content-after-opening-delimiter.swift"
2860
- },
2861
- {
2862
- match: "\\\\\\s*\\n",
2863
- name: "constant.character.escape.newline.swift"
2864
- },
2865
- {
2866
- include: "#string-guts"
2867
- },
2868
- {
2869
- comment: "Allow \\(\"\"\"...\"\"\") to appear inside a block string",
2870
- match: "\\S((?!\\\\\\().)*(?=\"\"\")",
2871
- name: "invalid.illegal.content-before-closing-delimiter.swift"
2872
- }
2873
- ]
2874
- },
2875
- {
2876
- begin: "#\"\"\"",
2877
- beginCaptures: {
2878
- "0": {
2879
- name: "punctuation.definition.string.begin.swift"
2880
- }
2881
- },
2882
- end: "\"\"\"#(#*)",
2883
- endCaptures: {
2884
- "0": {
2885
- name: "punctuation.definition.string.end.swift"
2886
- },
2887
- "1": {
2888
- name: "invalid.illegal.extra-closing-delimiter.swift"
2889
- }
2890
- },
2891
- name: "string.quoted.double.block.raw.swift",
2892
- patterns: [
2893
- {
2894
- match: "\\G.+(?=\"\"\")|\\G.+",
2895
- name: "invalid.illegal.content-after-opening-delimiter.swift"
2896
- },
2897
- {
2898
- match: "\\\\#\\s*\\n",
2899
- name: "constant.character.escape.newline.swift"
2900
- },
2901
- {
2902
- include: "#raw-string-guts"
2903
- },
2904
- {
2905
- comment: "Allow \\(\"\"\"...\"\"\") to appear inside a block string",
2906
- match: "\\S((?!\\\\#\\().)*(?=\"\"\")",
2907
- name: "invalid.illegal.content-before-closing-delimiter.swift"
2908
- }
2909
- ]
2910
- },
2911
- {
2912
- begin: "(##+)\"\"\"",
2913
- beginCaptures: {
2914
- "0": {
2915
- name: "punctuation.definition.string.begin.swift"
2916
- }
2917
- },
2918
- end: "\"\"\"\\1(#*)",
2919
- endCaptures: {
2920
- "0": {
2921
- name: "punctuation.definition.string.end.swift"
2922
- },
2923
- "1": {
2924
- name: "invalid.illegal.extra-closing-delimiter.swift"
2925
- }
2926
- },
2927
- name: "string.quoted.double.block.raw.swift",
2928
- patterns: [
2929
- {
2930
- match: "\\G.+(?=\"\"\")|\\G.+",
2931
- name: "invalid.illegal.content-after-opening-delimiter.swift"
2932
- }
2933
- ]
2934
- },
2935
- {
2936
- begin: "\"",
2937
- beginCaptures: {
2938
- "0": {
2939
- name: "punctuation.definition.string.begin.swift"
2940
- }
2941
- },
2942
- end: "\"(#*)",
2943
- endCaptures: {
2944
- "0": {
2945
- name: "punctuation.definition.string.end.swift"
2946
- },
2947
- "1": {
2948
- name: "invalid.illegal.extra-closing-delimiter.swift"
2949
- }
2950
- },
2951
- name: "string.quoted.double.single-line.swift",
2952
- patterns: [
2953
- {
2954
- match: "\\r|\\n",
2955
- name: "invalid.illegal.returns-not-allowed.swift"
2956
- },
2957
- {
2958
- include: "#string-guts"
2959
- }
2960
- ]
2961
- },
2962
- {
2963
- begin: "(##+)\"",
2964
- beginCaptures: {
2965
- "0": {
2966
- name: "punctuation.definition.string.begin.raw.swift"
2967
- }
2968
- },
2969
- comment: "SE-0168: raw string literals (more than one #, grammar limitations prevent us from supporting escapes)",
2970
- end: "\"\\1(#*)",
2971
- endCaptures: {
2972
- "0": {
2973
- name: "punctuation.definition.string.end.raw.swift"
2974
- },
2975
- "1": {
2976
- name: "invalid.illegal.extra-closing-delimiter.swift"
2977
- }
2978
- },
2979
- name: "string.quoted.double.single-line.raw.swift",
2980
- patterns: [
2981
- {
2982
- match: "\\r|\\n",
2983
- name: "invalid.illegal.returns-not-allowed.swift"
2984
- }
2985
- ]
2986
- },
2987
- {
2988
- begin: "#\"",
2989
- beginCaptures: {
2990
- "0": {
2991
- name: "punctuation.definition.string.begin.raw.swift"
2992
- }
2993
- },
2994
- comment: "SE-0168: raw string literals (one #, escapes supported)",
2995
- end: "\"#(#*)",
2996
- endCaptures: {
2997
- "0": {
2998
- name: "punctuation.definition.string.end.raw.swift"
2999
- },
3000
- "1": {
3001
- name: "invalid.illegal.extra-closing-delimiter.swift"
3002
- }
3003
- },
3004
- name: "string.quoted.double.single-line.raw.swift",
3005
- patterns: [
3006
- {
3007
- match: "\\r|\\n",
3008
- name: "invalid.illegal.returns-not-allowed.swift"
3009
- },
3010
- {
3011
- include: "#raw-string-guts"
3012
- }
3013
- ]
3014
- }
3015
- ],
3016
- repository: {
3017
- "raw-string-guts": {
3018
- comment: "the same as #string-guts but with # in escapes",
3019
- patterns: [
3020
- {
3021
- match: "\\\\#[0\\\\tnr\"']",
3022
- name: "constant.character.escape.swift"
3023
- },
3024
- {
3025
- match: "\\\\#u\\{[0-9a-fA-F]{1,8}\\}",
3026
- name: "constant.character.escape.unicode.swift"
3027
- },
3028
- {
3029
- begin: "\\\\#\\(",
3030
- beginCaptures: {
3031
- "0": {
3032
- name: "punctuation.section.embedded.begin.swift"
3033
- }
3034
- },
3035
- contentName: "source.swift",
3036
- end: "(\\))",
3037
- endCaptures: {
3038
- "0": {
3039
- name: "punctuation.section.embedded.end.swift"
3040
- },
3041
- "1": {
3042
- name: "source.swift"
3043
- }
3044
- },
3045
- name: "meta.embedded.line.swift",
3046
- patterns: [
3047
- {
3048
- include: "$self"
3049
- },
3050
- {
3051
- begin: "\\(",
3052
- comment: "Nested parens",
3053
- end: "\\)"
3054
- }
3055
- ]
3056
- },
3057
- {
3058
- match: "\\\\#.",
3059
- name: "invalid.illegal.escape-not-recognized"
3060
- }
3061
- ]
3062
- },
3063
- "string-guts": {
3064
- patterns: [
3065
- {
3066
- match: "\\\\[0\\\\tnr\"']",
3067
- name: "constant.character.escape.swift"
3068
- },
3069
- {
3070
- match: "\\\\u\\{[0-9a-fA-F]{1,8}\\}",
3071
- name: "constant.character.escape.unicode.swift"
3072
- },
3073
- {
3074
- begin: "\\\\\\(",
3075
- beginCaptures: {
3076
- "0": {
3077
- name: "punctuation.section.embedded.begin.swift"
3078
- }
3079
- },
3080
- contentName: "source.swift",
3081
- end: "(\\))",
3082
- endCaptures: {
3083
- "0": {
3084
- name: "punctuation.section.embedded.end.swift"
3085
- },
3086
- "1": {
3087
- name: "source.swift"
3088
- }
3089
- },
3090
- name: "meta.embedded.line.swift",
3091
- patterns: [
3092
- {
3093
- include: "$self"
3094
- },
3095
- {
3096
- begin: "\\(",
3097
- comment: "Nested parens",
3098
- end: "\\)"
3099
- }
3100
- ]
3101
- },
3102
- {
3103
- match: "\\\\.",
3104
- name: "invalid.illegal.escape-not-recognized"
3105
- }
3106
- ]
3107
- }
3108
- }
3109
- }
3110
- }
3111
- },
3112
- operators: {
3113
- patterns: [
3114
- {
3115
- comment: "Type casting",
3116
- match: "\\b(is\\b|as([!?]\\B|\\b))",
3117
- name: "keyword.operator.type-casting.swift"
3118
- },
3119
- {
3120
- begin: "(?x)\n\t\t\t\t\t\t(?=\n\t\t\t\t\t\t\t(?<oph>\t\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\n\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t | \\.\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\\g<oph>\t\t\t\t\t\t\t# operator-head\n\t\t\t\t\t\t\t | \\.\n\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t",
3121
- comment: "This rule helps us speed up the matching.",
3122
- end: "(?!\\G)",
3123
- patterns: [
3124
- {
3125
- captures: {
3126
- "0": {
3127
- patterns: [
3128
- {
3129
- match: "\\G(\\+\\+|\\-\\-)$",
3130
- name: "keyword.operator.increment-or-decrement.swift"
3131
- },
3132
- {
3133
- match: "\\G(\\+|\\-)$",
3134
- name: "keyword.operator.arithmetic.unary.swift"
3135
- },
3136
- {
3137
- match: "\\G!$",
3138
- name: "keyword.operator.logical.not.swift"
3139
- },
3140
- {
3141
- match: "\\G~$",
3142
- name: "keyword.operator.bitwise.not.swift"
3143
- },
3144
- {
3145
- match: ".+",
3146
- name: "keyword.operator.custom.prefix.swift"
3147
- }
3148
- ]
3149
- }
3150
- },
3151
- comment: "Prefix unary operator",
3152
- match: "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?<=^|[\\s(\\[{,;:])\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?![\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t"
3153
- },
3154
- {
3155
- captures: {
3156
- "0": {
3157
- patterns: [
3158
- {
3159
- match: "\\G(\\+\\+|\\-\\-)$",
3160
- name: "keyword.operator.increment-or-decrement.swift"
3161
- },
3162
- {
3163
- match: "\\G!$",
3164
- name: "keyword.operator.increment-or-decrement.swift"
3165
- },
3166
- {
3167
- match: ".+",
3168
- name: "keyword.operator.custom.postfix.swift"
3169
- }
3170
- ]
3171
- }
3172
- },
3173
- comment: "Postfix unary operator",
3174
- match: "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?<!^|[\\s(\\[{,;:])\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?=[\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t"
3175
- },
3176
- {
3177
- captures: {
3178
- "0": {
3179
- patterns: [
3180
- {
3181
- match: "\\G=$",
3182
- name: "keyword.operator.assignment.swift"
3183
- },
3184
- {
3185
- match: "\\G(\\+|\\-|\\*|/|%|<<|>>|&|\\^|\\||&&|\\|\\|)=$",
3186
- name: "keyword.operator.assignment.compound.swift"
3187
- },
3188
- {
3189
- match: "\\G(\\+|\\-|\\*|/)$",
3190
- name: "keyword.operator.arithmetic.swift"
3191
- },
3192
- {
3193
- match: "\\G&(\\+|\\-|\\*)$",
3194
- name: "keyword.operator.arithmetic.overflow.swift"
3195
- },
3196
- {
3197
- match: "\\G%$",
3198
- name: "keyword.operator.arithmetic.remainder.swift"
3199
- },
3200
- {
3201
- match: "\\G(==|!=|>|<|>=|<=|~=)$",
3202
- name: "keyword.operator.comparison.swift"
3203
- },
3204
- {
3205
- match: "\\G\\?\\?$",
3206
- name: "keyword.operator.coalescing.swift"
3207
- },
3208
- {
3209
- match: "\\G(&&|\\|\\|)$",
3210
- name: "keyword.operator.logical.swift"
3211
- },
3212
- {
3213
- match: "\\G(&|\\||\\^|<<|>>)$",
3214
- name: "keyword.operator.bitwise.swift"
3215
- },
3216
- {
3217
- match: "\\G(===|!==)$",
3218
- name: "keyword.operator.bitwise.swift"
3219
- },
3220
- {
3221
- match: "\\G\\?$",
3222
- name: "keyword.operator.ternary.swift"
3223
- },
3224
- {
3225
- match: ".+",
3226
- name: "keyword.operator.custom.infix.swift"
3227
- }
3228
- ]
3229
- }
3230
- },
3231
- comment: "Infix operator",
3232
- match: "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t[/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t"
3233
- },
3234
- {
3235
- captures: {
3236
- "0": {
3237
- patterns: [
3238
- {
3239
- match: ".+",
3240
- name: "keyword.operator.custom.prefix.dot.swift"
3241
- }
3242
- ]
3243
- }
3244
- },
3245
- comment: "Dot prefix unary operator",
3246
- match: "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?<=^|[\\s(\\[{,;:])\n\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t\t | [/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?![\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t"
3247
- },
3248
- {
3249
- captures: {
3250
- "0": {
3251
- patterns: [
3252
- {
3253
- match: ".+",
3254
- name: "keyword.operator.custom.postfix.dot.swift"
3255
- }
3256
- ]
3257
- }
3258
- },
3259
- comment: "Dot postfix unary operator",
3260
- match: "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t(?<!^|[\\s(\\[{,;:])\n\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t\t | [/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t\t(?=[\\s)\\]},;:]|\\z)\n\t\t\t\t\t\t\t"
3261
- },
3262
- {
3263
- captures: {
3264
- "0": {
3265
- patterns: [
3266
- {
3267
- match: "\\G\\.\\.[.<]$",
3268
- name: "keyword.operator.range.swift"
3269
- },
3270
- {
3271
- match: ".+",
3272
- name: "keyword.operator.custom.infix.dot.swift"
3273
- }
3274
- ]
3275
- }
3276
- },
3277
- comment: "Dot infix operator",
3278
- match: "(?x)\n\t\t\t\t\t\t\t\t\\G\t\t\t\t\t\t\t\t\t\t# Matching from the beginning ensures\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# that we start with operator-head\n\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t(?!(//|/\\*|\\*/))\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\\.\t\t\t\t\t\t\t\t# dot\n\t\t\t\t\t\t\t\t\t | [/=\\-+!*%<>&|^~?]\t\t\t\t# operator-head\n\t\t\t\t\t\t\t\t\t | [\\x{00A1}-\\x{00A7}]\n\t\t\t\t\t\t\t\t\t | [\\x{00A9}\\x{00AB}]\n\t\t\t\t\t\t\t\t\t | [\\x{00AC}\\x{00AE}]\n\t\t\t\t\t\t\t\t\t | [\\x{00B0}-\\x{00B1}\\x{00B6}\\x{00BB}\\x{00BF}\\x{00D7}\\x{00F7}]\n\t\t\t\t\t\t\t\t\t | [\\x{2016}-\\x{2017}\\x{2020}-\\x{2027}]\n\t\t\t\t\t\t\t\t\t | [\\x{2030}-\\x{203E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2041}-\\x{2053}]\n\t\t\t\t\t\t\t\t\t | [\\x{2055}-\\x{205E}]\n\t\t\t\t\t\t\t\t\t | [\\x{2190}-\\x{23FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2500}-\\x{2775}]\n\t\t\t\t\t\t\t\t\t | [\\x{2794}-\\x{2BFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{2E00}-\\x{2E7F}]\n\t\t\t\t\t\t\t\t\t | [\\x{3001}-\\x{3003}]\n\t\t\t\t\t\t\t\t\t | [\\x{3008}-\\x{3030}]\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t | [\\x{0300}-\\x{036F}]\t\t\t\t# operator-character\n\t\t\t\t\t\t\t\t\t | [\\x{1DC0}-\\x{1DFF}]\n\t\t\t\t\t\t\t\t\t | [\\x{20D0}-\\x{20FF}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE00}-\\x{FE0F}]\n\t\t\t\t\t\t\t\t\t | [\\x{FE20}-\\x{FE2F}]\n\t\t\t\t\t\t\t\t\t | [\\x{E0100}-\\x{E01EF}]\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)++\n\t\t\t\t\t\t\t"
3279
- }
3280
- ]
3281
- },
3282
- {
3283
- match: ":",
3284
- name: "keyword.operator.ternary.swift"
3285
- }
3286
- ]
3287
- },
3288
- root: {
3289
- patterns: [
3290
- {
3291
- include: "#compiler-control"
3292
- },
3293
- {
3294
- include: "#declarations"
3295
- },
3296
- {
3297
- include: "#expressions"
3298
- }
3299
- ]
3300
- }
3301
- };
3302
- var swift_tmLanguage = {
3303
- information_for_contributors: information_for_contributors,
3304
- version: version,
3305
- name: name,
3306
- scopeName: scopeName,
3307
- comment: comment,
3308
- patterns: patterns,
3309
- repository: repository
3310
- };
3311
-
3312
- export { comment, swift_tmLanguage as default, information_for_contributors, name, patterns, repository, scopeName, version };