github-linguist-grammars 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (335) hide show
  1. checksums.yaml +7 -0
  2. data/grammars/file.lasso.json +713 -0
  3. data/grammars/module.ceylon.json +54 -0
  4. data/grammars/objdump.x86asm.json +73 -0
  5. data/grammars/source.Inform7.json +45 -0
  6. data/grammars/source.Kotlin.json +774 -0
  7. data/grammars/source.LS.json +104 -0
  8. data/grammars/source.MCPOST.json +68 -0
  9. data/grammars/source.MOD.json +70 -0
  10. data/grammars/source.abap.json +176 -0
  11. data/grammars/source.abl.json +138 -0
  12. data/grammars/source.actionscript.3.json +1571 -0
  13. data/grammars/source.acucobol.json +16 -0
  14. data/grammars/source.ada.json +140 -0
  15. data/grammars/source.agda.json +254 -0
  16. data/grammars/source.ahk.json +171 -0
  17. data/grammars/source.alloy.json +44 -0
  18. data/grammars/source.ampl.json +157 -0
  19. data/grammars/source.antlr.json +300 -0
  20. data/grammars/source.apache-config.json +352 -0
  21. data/grammars/source.apache-config.mod_perl.json +70 -0
  22. data/grammars/source.apl.json +442 -0
  23. data/grammars/source.applescript.json +1385 -0
  24. data/grammars/source.apt.json +25 -0
  25. data/grammars/source.asm.x86.json +182 -0
  26. data/grammars/source.asp.json +157 -0
  27. data/grammars/source.aspectj.json +963 -0
  28. data/grammars/source.ats.json +170 -0
  29. data/grammars/source.autoit.3.json +132 -0
  30. data/grammars/source.awk.json +388 -0
  31. data/grammars/source.befunge.json +38 -0
  32. data/grammars/source.bf.json +36 -0
  33. data/grammars/source.bison.json +59 -0
  34. data/grammars/source.blitzmax.json +912 -0
  35. data/grammars/source.boo.json +452 -0
  36. data/grammars/source.brightauthorproject.json +29 -0
  37. data/grammars/source.brightscript.json +158 -0
  38. data/grammars/source.bro.json +409 -0
  39. data/grammars/source.bsv.json +283 -0
  40. data/grammars/source.c++.json +364 -0
  41. data/grammars/source.c++.qt.json +37 -0
  42. data/grammars/source.c.ec.json +39 -0
  43. data/grammars/source.c.json +727 -0
  44. data/grammars/source.c.platform.json +154 -0
  45. data/grammars/source.cache.cmake.json +75 -0
  46. data/grammars/source.cake.json +16 -0
  47. data/grammars/source.camlp4.ocaml.json +63 -0
  48. data/grammars/source.capnp.json +93 -0
  49. data/grammars/source.ceylon.json +77 -0
  50. data/grammars/source.cfscript.cfc.json +170 -0
  51. data/grammars/source.cfscript.json +744 -0
  52. data/grammars/source.chapel.json +240 -0
  53. data/grammars/source.cirru.json +66 -0
  54. data/grammars/source.clarion.json +159 -0
  55. data/grammars/source.clips.json +80 -0
  56. data/grammars/source.clojure.json +397 -0
  57. data/grammars/source.cm.json +54 -0
  58. data/grammars/source.cmake.json +181 -0
  59. data/grammars/source.cobol.json +528 -0
  60. data/grammars/source.coffee.json +678 -0
  61. data/grammars/source.compiled-papyrus.json +11 -0
  62. data/grammars/source.cool.json +103 -0
  63. data/grammars/source.coq.json +62 -0
  64. data/grammars/source.crystal.json +2760 -0
  65. data/grammars/source.cs.json +556 -0
  66. data/grammars/source.css.json +630 -0
  67. data/grammars/source.css.less.json +276 -0
  68. data/grammars/source.css.mss.json +256 -0
  69. data/grammars/source.csx.json +16 -0
  70. data/grammars/source.cuda-c++.json +137 -0
  71. data/grammars/source.cython.json +2108 -0
  72. data/grammars/source.d.json +722 -0
  73. data/grammars/source.dart.json +763 -0
  74. data/grammars/source.desktop.json +90 -0
  75. data/grammars/source.diff.json +162 -0
  76. data/grammars/source.dockerfile.json +89 -0
  77. data/grammars/source.dosbatch.json +70 -0
  78. data/grammars/source.dot.json +126 -0
  79. data/grammars/source.dylan.json +217 -0
  80. data/grammars/source.eiffel.json +138 -0
  81. data/grammars/source.elixir.json +737 -0
  82. data/grammars/source.elm.json +355 -0
  83. data/grammars/source.erazor.json +126 -0
  84. data/grammars/source.erlang.json +1674 -0
  85. data/grammars/source.essl.json +50 -0
  86. data/grammars/source.factor.json +260 -0
  87. data/grammars/source.fan.json +188 -0
  88. data/grammars/source.fancy.json +270 -0
  89. data/grammars/source.fish.json +214 -0
  90. data/grammars/source.forth.json +101 -0
  91. data/grammars/source.fortran.json +499 -0
  92. data/grammars/source.fortran.modern.json +226 -0
  93. data/grammars/source.fsharp.json +403 -0
  94. data/grammars/source.gap.json +167 -0
  95. data/grammars/source.gcode.json +25 -0
  96. data/grammars/source.gdscript.json +154 -0
  97. data/grammars/source.gfm.json +1270 -0
  98. data/grammars/source.glsl.json +71 -0
  99. data/grammars/source.gnuplot.json +276 -0
  100. data/grammars/source.go.json +552 -0
  101. data/grammars/source.golo.json +182 -0
  102. data/grammars/source.gosu.2.json +163 -0
  103. data/grammars/source.grace.json +679 -0
  104. data/grammars/source.groovy.gradle.json +73 -0
  105. data/grammars/source.groovy.json +1385 -0
  106. data/grammars/source.harbour.json +450 -0
  107. data/grammars/source.haskell.json +449 -0
  108. data/grammars/source.haxe.2.json +1243 -0
  109. data/grammars/source.hss.1.json +464 -0
  110. data/grammars/source.httpspec.json +287 -0
  111. data/grammars/source.hxml.json +26 -0
  112. data/grammars/source.hy.json +270 -0
  113. data/grammars/source.idl-dlm.json +112 -0
  114. data/grammars/source.idl.json +267 -0
  115. data/grammars/source.idris.json +537 -0
  116. data/grammars/source.ini.json +113 -0
  117. data/grammars/source.inno.json +65 -0
  118. data/grammars/source.io.json +164 -0
  119. data/grammars/source.ioke.json +272 -0
  120. data/grammars/source.isabelle.root.json +68 -0
  121. data/grammars/source.isabelle.theory.json +106 -0
  122. data/grammars/source.j.json +49 -0
  123. data/grammars/source.jade.json +1009 -0
  124. data/grammars/source.jasmin.json +299 -0
  125. data/grammars/source.java-properties.json +97 -0
  126. data/grammars/source.java.json +1026 -0
  127. data/grammars/source.jcl.json +49 -0
  128. data/grammars/source.jflex.json +490 -0
  129. data/grammars/source.jq.json +218 -0
  130. data/grammars/source.js.json +948 -0
  131. data/grammars/source.js.jsx.json +2937 -0
  132. data/grammars/source.js.objj.json +424 -0
  133. data/grammars/source.js.regexp.json +150 -0
  134. data/grammars/source.js.regexp.replacement.json +30 -0
  135. data/grammars/source.json.json +149 -0
  136. data/grammars/source.julia.json +407 -0
  137. data/grammars/source.lean.json +145 -0
  138. data/grammars/source.lid.json +23 -0
  139. data/grammars/source.lilypond.json +623 -0
  140. data/grammars/source.lisp.json +111 -0
  141. data/grammars/source.litcoffee.json +669 -0
  142. data/grammars/source.livescript.json +616 -0
  143. data/grammars/source.llvm.json +71 -0
  144. data/grammars/source.logos.json +31 -0
  145. data/grammars/source.logtalk.json +315 -0
  146. data/grammars/source.loomscript.json +214 -0
  147. data/grammars/source.lsl.json +216 -0
  148. data/grammars/source.lua.json +191 -0
  149. data/grammars/source.makefile.json +474 -0
  150. data/grammars/source.makegen.json +13 -0
  151. data/grammars/source.man.json +53 -0
  152. data/grammars/source.mask.json +701 -0
  153. data/grammars/source.mata.json +133 -0
  154. data/grammars/source.mathematica.json +429 -0
  155. data/grammars/source.matlab.json +776 -0
  156. data/grammars/source.mercury.json +251 -0
  157. data/grammars/source.ml.json +291 -0
  158. data/grammars/source.modelica.json +142 -0
  159. data/grammars/source.modula2.json +103 -0
  160. data/grammars/source.monkey.json +701 -0
  161. data/grammars/source.moonscript.json +149 -0
  162. data/grammars/source.mupad.json +149 -0
  163. data/grammars/source.nant-build.json +86 -0
  164. data/grammars/source.ncl.json +66 -0
  165. data/grammars/source.nemerle.json +137 -0
  166. data/grammars/source.nesc.json +27 -0
  167. data/grammars/source.netlinx.erb.json +47 -0
  168. data/grammars/source.netlinx.json +768 -0
  169. data/grammars/source.nginx.json +797 -0
  170. data/grammars/source.nim.json +1150 -0
  171. data/grammars/source.nim_filter.json +133 -0
  172. data/grammars/source.nimcfg.json +116 -0
  173. data/grammars/source.ninja.json +66 -0
  174. data/grammars/source.nit.json +238 -0
  175. data/grammars/source.nix.json +1200 -0
  176. data/grammars/source.nmml.json +87 -0
  177. data/grammars/source.nsis.json +150 -0
  178. data/grammars/source.objc++.json +19 -0
  179. data/grammars/source.objc.json +918 -0
  180. data/grammars/source.objc.platform.json +277 -0
  181. data/grammars/source.ocaml.json +1426 -0
  182. data/grammars/source.ocamllex.json +305 -0
  183. data/grammars/source.ocamlyacc.json +346 -0
  184. data/grammars/source.octave.json +451 -0
  185. data/grammars/source.ooc.json +692 -0
  186. data/grammars/source.opa.json +206 -0
  187. data/grammars/source.opal.json +415 -0
  188. data/grammars/source.opalsysdefs.json +70 -0
  189. data/grammars/source.opencobol.json +65 -0
  190. data/grammars/source.ox.json +97 -0
  191. data/grammars/source.oz.json +84 -0
  192. data/grammars/source.papyrus-assembly.json +266 -0
  193. data/grammars/source.papyrus.json +231 -0
  194. data/grammars/source.parrot.pir.json +117 -0
  195. data/grammars/source.pascal.json +150 -0
  196. data/grammars/source.perl.6.json +310 -0
  197. data/grammars/source.perl.json +2413 -0
  198. data/grammars/source.php.zephir.json +362 -0
  199. data/grammars/source.pig_latin.json +172 -0
  200. data/grammars/source.pike.json +62 -0
  201. data/grammars/source.plsql.oracle.json +642 -0
  202. data/grammars/source.po.json +232 -0
  203. data/grammars/source.pogoscript.json +85 -0
  204. data/grammars/source.postscript.json +231 -0
  205. data/grammars/source.powershell.json +755 -0
  206. data/grammars/source.processing.json +885 -0
  207. data/grammars/source.prolog.eclipse.json +206 -0
  208. data/grammars/source.prolog.json +292 -0
  209. data/grammars/source.protobuf.json +395 -0
  210. data/grammars/source.pubspec.json +13 -0
  211. data/grammars/source.puppet.json +494 -0
  212. data/grammars/source.purescript.json +818 -0
  213. data/grammars/source.pyjade.json +1010 -0
  214. data/grammars/source.python.django.json +34 -0
  215. data/grammars/source.python.json +1960 -0
  216. data/grammars/source.python.salt.json +13 -0
  217. data/grammars/source.qmake.json +217 -0
  218. data/grammars/source.qml.json +195 -0
  219. data/grammars/source.r.json +203 -0
  220. data/grammars/source.racket.json +119 -0
  221. data/grammars/source.rebol.json +647 -0
  222. data/grammars/source.red.json +652 -0
  223. data/grammars/source.regexp.babel.json +190 -0
  224. data/grammars/source.regexp.python.json +187 -0
  225. data/grammars/source.regexp.spin.json +188 -0
  226. data/grammars/source.ruby.json +1956 -0
  227. data/grammars/source.ruby.rspec.cucumber.steps.json +274 -0
  228. data/grammars/source.rust.json +269 -0
  229. data/grammars/source.sas.json +322 -0
  230. data/grammars/source.sas_log.json +26 -0
  231. data/grammars/source.sass.json +248 -0
  232. data/grammars/source.sbt.json +36 -0
  233. data/grammars/source.scad.json +152 -0
  234. data/grammars/source.scala.json +739 -0
  235. data/grammars/source.scaml.json +466 -0
  236. data/grammars/source.scheme.json +370 -0
  237. data/grammars/source.scilab.json +103 -0
  238. data/grammars/source.scss.json +1321 -0
  239. data/grammars/source.shell.json +1212 -0
  240. data/grammars/source.smali.json +1668 -0
  241. data/grammars/source.smalltalk.json +135 -0
  242. data/grammars/source.smt.json +173 -0
  243. data/grammars/source.sp.json +118 -0
  244. data/grammars/source.sparql.json +23 -0
  245. data/grammars/source.spin.json +936 -0
  246. data/grammars/source.sqf.json +112 -0
  247. data/grammars/source.sql.json +473 -0
  248. data/grammars/source.stata.json +208 -0
  249. data/grammars/source.strings.json +53 -0
  250. data/grammars/source.stylus.json +1021 -0
  251. data/grammars/source.swift.json +965 -0
  252. data/grammars/source.systemverilog.json +1050 -0
  253. data/grammars/source.tcl.json +277 -0
  254. data/grammars/source.tea.json +180 -0
  255. data/grammars/source.thrift.json +704 -0
  256. data/grammars/source.toml.json +327 -0
  257. data/grammars/source.ts.json +1094 -0
  258. data/grammars/source.tsx.json +1324 -0
  259. data/grammars/source.turtle.json +505 -0
  260. data/grammars/source.txl.json +62 -0
  261. data/grammars/source.ucfconstraints.json +72 -0
  262. data/grammars/source.vala.json +814 -0
  263. data/grammars/source.varnish.vcl.json +343 -0
  264. data/grammars/source.vbnet.json +338 -0
  265. data/grammars/source.verilog.json +302 -0
  266. data/grammars/source.vhdl.json +1349 -0
  267. data/grammars/source.viml.json +224 -0
  268. data/grammars/source.webidl.json +814 -0
  269. data/grammars/source.x10.json +68 -0
  270. data/grammars/source.x86asm.json +47 -0
  271. data/grammars/source.xc.json +379 -0
  272. data/grammars/source.xq.json +241 -0
  273. data/grammars/source.xquery.json +193 -0
  274. data/grammars/source.xtend.json +733 -0
  275. data/grammars/source.yaml.json +334 -0
  276. data/grammars/source.yaml.salt.json +348 -0
  277. data/grammars/text.bibtex.json +251 -0
  278. data/grammars/text.cfml.basic.json +736 -0
  279. data/grammars/text.dart-analysis-output.json +162 -0
  280. data/grammars/text.dart-doccomments.json +19 -0
  281. data/grammars/text.elixir.json +45 -0
  282. data/grammars/text.gherkin.feature.json +135 -0
  283. data/grammars/text.groff.json +113 -0
  284. data/grammars/text.haml.json +299 -0
  285. data/grammars/text.html.abl.json +24 -0
  286. data/grammars/text.html.asciidoc.json +492 -0
  287. data/grammars/text.html.asdoc.json +541 -0
  288. data/grammars/text.html.asp.json +58 -0
  289. data/grammars/text.html.basic.json +552 -0
  290. data/grammars/text.html.cfm.json +811 -0
  291. data/grammars/text.html.creole.json +329 -0
  292. data/grammars/text.html.django.json +69 -0
  293. data/grammars/text.html.elixir.json +18 -0
  294. data/grammars/text.html.erb.json +157 -0
  295. data/grammars/text.html.erlang.yaws.json +72 -0
  296. data/grammars/text.html.factor.json +27 -0
  297. data/grammars/text.html.handlebars.json +783 -0
  298. data/grammars/text.html.jsp.json +1203 -0
  299. data/grammars/text.html.liquid.json +35 -0
  300. data/grammars/text.html.mako.json +729 -0
  301. data/grammars/text.html.markdown.source.gfm.apib.json +1297 -0
  302. data/grammars/text.html.markdown.source.gfm.mson.json +1165 -0
  303. data/grammars/text.html.mediawiki.json +972 -0
  304. data/grammars/text.html.php.json +2607 -0
  305. data/grammars/text.html.slash.json +313 -0
  306. data/grammars/text.html.smarty.json +216 -0
  307. data/grammars/text.html.ssp.json +49 -0
  308. data/grammars/text.html.tcl.json +44 -0
  309. data/grammars/text.html.twig.json +1353 -0
  310. data/grammars/text.html.vue.json +642 -0
  311. data/grammars/text.idl-idldoc.json +14 -0
  312. data/grammars/text.junit-test-report.json +92 -0
  313. data/grammars/text.log.latex.json +86 -0
  314. data/grammars/text.python.console.json +25 -0
  315. data/grammars/text.python.traceback.json +46 -0
  316. data/grammars/text.rdoc.json +48 -0
  317. data/grammars/text.restructuredtext.json +561 -0
  318. data/grammars/text.robot.json +73 -0
  319. data/grammars/text.shell-session.json +48 -0
  320. data/grammars/text.slim.json +527 -0
  321. data/grammars/text.tex.json +271 -0
  322. data/grammars/text.tex.latex.beamer.json +63 -0
  323. data/grammars/text.tex.latex.haskell.json +56 -0
  324. data/grammars/text.tex.latex.json +1013 -0
  325. data/grammars/text.tex.latex.memoir.json +99 -0
  326. data/grammars/text.tex.latex.rd.json +117 -0
  327. data/grammars/text.xml.ant.json +202 -0
  328. data/grammars/text.xml.flex-config.json +2634 -0
  329. data/grammars/text.xml.genshi.json +34 -0
  330. data/grammars/text.xml.json +364 -0
  331. data/grammars/text.xml.pom.json +774 -0
  332. data/grammars/text.xml.xsl.json +94 -0
  333. data/grammars/text.zone_file.json +72 -0
  334. data/lib/linguist/grammars.rb +13 -0
  335. metadata +389 -0
@@ -0,0 +1,2937 @@
1
+ {
2
+ "name": "Babel ES6 JavaScript",
3
+ "comment": "27Apr15",
4
+ "scopeName": "source.js.jsx",
5
+ "foldingStartMarker": "(/\\*|\\{|\\()",
6
+ "foldingEndMarker": "(\\*/|\\}|\\))",
7
+ "firstLineMatch": "^#!\\s*/.*\\b(node|js)$\\n?",
8
+ "fileTypes": [
9
+ "js",
10
+ "es6",
11
+ "babel",
12
+ "jsx"
13
+ ],
14
+ "patterns": [
15
+ {
16
+ "include": "#core"
17
+ }
18
+ ],
19
+ "repository": {
20
+ "core": {
21
+ "patterns": [
22
+ {
23
+ "include": "#literal-function-labels"
24
+ },
25
+ {
26
+ "include": "#literal-arrow-function-labels"
27
+ },
28
+ {
29
+ "include": "#literal-labels"
30
+ },
31
+ {
32
+ "include": "#flowtype-type-aliases"
33
+ },
34
+ {
35
+ "include": "#flowtype-interface"
36
+ },
37
+ {
38
+ "include": "#flowtype-declare"
39
+ },
40
+ {
41
+ "include": "#literal-keywords"
42
+ },
43
+ {
44
+ "include": "#literal-for"
45
+ },
46
+ {
47
+ "include": "#literal-switch"
48
+ },
49
+ {
50
+ "include": "#expression"
51
+ },
52
+ {
53
+ "include": "#literal-punctuation"
54
+ }
55
+ ]
56
+ },
57
+ "expression": {
58
+ "patterns": [
59
+ {
60
+ "include": "#jsx"
61
+ },
62
+ {
63
+ "include": "#es7-decorators"
64
+ },
65
+ {
66
+ "include": "#support"
67
+ },
68
+ {
69
+ "include": "#literal-function-labels"
70
+ },
71
+ {
72
+ "include": "#literal-arrow-function-labels"
73
+ },
74
+ {
75
+ "include": "#literal-function"
76
+ },
77
+ {
78
+ "include": "#literal-arrow-function"
79
+ },
80
+ {
81
+ "include": "#literal-prototype",
82
+ "comment": " after literal-function, which includes some prototype strings"
83
+ },
84
+ {
85
+ "include": "#literal-regexp",
86
+ "comment": "before operators to avoid abiguities"
87
+ },
88
+ {
89
+ "include": "#literal-number"
90
+ },
91
+ {
92
+ "include": "#literal-quasi"
93
+ },
94
+ {
95
+ "include": "#literal-string"
96
+ },
97
+ {
98
+ "include": "#literal-language-constant"
99
+ },
100
+ {
101
+ "include": "#literal-language-variable"
102
+ },
103
+ {
104
+ "include": "#literal-method"
105
+ },
106
+ {
107
+ "include": "#literal-module"
108
+ },
109
+ {
110
+ "include": "#literal-class"
111
+ },
112
+ {
113
+ "include": "#literal-constructor"
114
+ },
115
+ {
116
+ "include": "#literal-method-call"
117
+ },
118
+ {
119
+ "include": "#literal-function-call"
120
+ },
121
+ {
122
+ "include": "#comments"
123
+ },
124
+ {
125
+ "include": "#brackets"
126
+ },
127
+ {
128
+ "include": "#literal-operators"
129
+ },
130
+ {
131
+ "include": "#literal-variable"
132
+ }
133
+ ]
134
+ },
135
+ "literal-function-labels": {
136
+ "patterns": [
137
+ {
138
+ "comment": " e.g. play: function(arg1, arg2) { }",
139
+ "name": "meta.function.json.js",
140
+ "begin": "\\s*([_$a-zA-Z][$\\w]*)\\s*(:)\\s*(?:(async)\\s+)?\\s*(\\bfunction\\b)\\s*(?:(\\*)\\s*)?\\s*(?=\\(|<)",
141
+ "end": "(?=\\{)",
142
+ "applyEndPatternLast": "1",
143
+ "beginCaptures": {
144
+ "1": {
145
+ "name": "entity.name.function.js"
146
+ },
147
+ "2": {
148
+ "name": "punctuation.separator.key-value.js"
149
+ },
150
+ "3": {
151
+ "name": "storage.type.js"
152
+ },
153
+ "4": {
154
+ "name": "storage.type.function.js"
155
+ },
156
+ "5": {
157
+ "name": "keyword.generator.asterisk.js"
158
+ }
159
+ },
160
+ "patterns": [
161
+ {
162
+ "include": "#flowtype"
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ "comment": "e.g. 'play': function(arg1, arg2) { }",
168
+ "name": "meta.function.json.js",
169
+ "begin": "\\s*(('|\\\")(\\b[_$a-zA-Z][$\\w]*)(\\k<2>))\\s*(:)\\s*(async)?\\s+(\\bfunction\\b)\\s*(\\*\\s*)?\\s*(?=\\(|<)",
170
+ "end": "(?=\\{)",
171
+ "applyEndPatternLast": "1",
172
+ "beginCaptures": {
173
+ "1": {
174
+ "name": "string.quoted.js"
175
+ },
176
+ "2": {
177
+ "name": "punctuation.definition.string.begin.js"
178
+ },
179
+ "3": {
180
+ "name": "entity.name.function.js"
181
+ },
182
+ "4": {
183
+ "name": "punctuation.definition.string.end.js"
184
+ },
185
+ "5": {
186
+ "name": "punctuation.separator.key-value.js"
187
+ },
188
+ "6": {
189
+ "name": "storage.type.js"
190
+ },
191
+ "7": {
192
+ "name": "storage.type.function.js"
193
+ },
194
+ "8": {
195
+ "name": "keyword.generator.asterisk.js"
196
+ }
197
+ },
198
+ "patterns": [
199
+ {
200
+ "include": "#flowtype"
201
+ }
202
+ ]
203
+ }
204
+ ]
205
+ },
206
+ "literal-arrow-function-labels": {
207
+ "patterns": [
208
+ {
209
+ "comment": "# e.g. play: async <T>(args) => { }",
210
+ "name": "meta.function.json.arrow.js",
211
+ "begin": "\\s*(\\b[_$a-zA-Z][$\\w]*)\\s*(:)\\s*(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*(\\((?:(?>[^()]+)|\\g<-1>)*\\))\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
212
+ "end": "\\s*(=>)",
213
+ "applyEndPatternLast": "1",
214
+ "beginCaptures": {
215
+ "1": {
216
+ "name": "entity.name.function.js"
217
+ },
218
+ "2": {
219
+ "name": "punctuation.separator.key-value.js"
220
+ },
221
+ "3": {
222
+ "name": "storage.type.js"
223
+ }
224
+ },
225
+ "endCaptures": {
226
+ "1": {
227
+ "name": "storage.type.function.arrow.js"
228
+ }
229
+ },
230
+ "patterns": [
231
+ {
232
+ "include": "#flowtype"
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ "comment": "# e.g. play: arg => { }",
238
+ "name": "meta.function.json.arrow.js",
239
+ "begin": "\\s*(\\b[_$a-zA-Z][$\\w]*)\\s*(:)\\s*(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*([_$a-zA-Z][$\\w]*)\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
240
+ "end": "\\s*(=>)",
241
+ "beginCaptures": {
242
+ "1": {
243
+ "name": "entity.name.function.js"
244
+ },
245
+ "2": {
246
+ "name": "punctuation.separator.key-value.js"
247
+ },
248
+ "3": {
249
+ "name": "storage.type.js"
250
+ }
251
+ },
252
+ "endCaptures": {
253
+ "1": {
254
+ "name": "storage.type.function.arrow.js"
255
+ }
256
+ },
257
+ "patterns": [
258
+ {
259
+ "include": "#flowtype-polymorphs"
260
+ },
261
+ {
262
+ "include": "#flowtype-variable"
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ "comment": "# e.g. 'play': (args) => { }",
268
+ "name": "meta.function.json.arrow.js",
269
+ "begin": "\\s*(('|\\\")(\\b[_$a-zA-Z][$\\w]*)(\\k<2>))\\s*(:)\\s*(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*(\\((?:(?>[^()]+)|\\g<-1>)*\\))\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
270
+ "end": "\\s*(=>)",
271
+ "applyEndPatternLast": "1",
272
+ "endCaptures": {
273
+ "1": {
274
+ "name": "storage.type.function.arrow.js"
275
+ }
276
+ },
277
+ "beginCaptures": {
278
+ "1": {
279
+ "name": "string.quoted.js"
280
+ },
281
+ "2": {
282
+ "name": "punctuation.definition.string.begin.js"
283
+ },
284
+ "3": {
285
+ "name": "entity.name.function.js"
286
+ },
287
+ "4": {
288
+ "name": "punctuation.definition.string.end.js"
289
+ },
290
+ "5": {
291
+ "name": "punctuation.separator.key-value.js"
292
+ },
293
+ "6": {
294
+ "name": "storage.type.js"
295
+ }
296
+ },
297
+ "patterns": [
298
+ {
299
+ "include": "#flowtype"
300
+ }
301
+ ]
302
+ },
303
+ {
304
+ "comment": "# e.g. 'play': arg => { }",
305
+ "name": "meta.function.json.arrow.js",
306
+ "begin": "\\s*(('|\\\")(\\b[_$a-zA-Z][$\\w]*)(\\k<2>))\\s*(:)\\s*(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*([_$a-zA-Z][$\\w]*)\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
307
+ "end": "\\s*(=>)",
308
+ "beginCaptures": {
309
+ "1": {
310
+ "name": "string.quoted.js"
311
+ },
312
+ "2": {
313
+ "name": "punctuation.definition.string.begin.js"
314
+ },
315
+ "3": {
316
+ "name": "entity.name.function.js"
317
+ },
318
+ "4": {
319
+ "name": "punctuation.definition.string.end.js"
320
+ },
321
+ "5": {
322
+ "name": "punctuation.separator.key-value.js"
323
+ },
324
+ "6": {
325
+ "name": "storage.type.js"
326
+ }
327
+ },
328
+ "endCaptures": {
329
+ "1": {
330
+ "name": "storage.type.function.arrow.js"
331
+ }
332
+ },
333
+ "patterns": [
334
+ {
335
+ "include": "#flowtype-polymorphs"
336
+ },
337
+ {
338
+ "include": "#flowtype-variable"
339
+ }
340
+ ]
341
+ }
342
+ ]
343
+ },
344
+ "literal-labels": {
345
+ "patterns": [
346
+ {
347
+ "begin": "(?<!\\?)(?<!\\?\\s)(?=(((')((?:[^']|\\\\')*)('))|((\")((?:[^\"]|\\\\\")*)(\")))\\s*:)",
348
+ "end": ":",
349
+ "endCaptures": {
350
+ "0": {
351
+ "name": "punctuation.separator.key-value.js"
352
+ }
353
+ },
354
+ "patterns": [
355
+ {
356
+ "include": "#literal-string"
357
+ }
358
+ ]
359
+ },
360
+ {
361
+ "name": "constant.other.object.key.js",
362
+ "match": "(?<!\\.|\\?|\\?\\s)([_$a-zA-Z][$\\w]*)\\s*(:)",
363
+ "captures": {
364
+ "1": {
365
+ "name": "string.unquoted.js"
366
+ },
367
+ "2": {
368
+ "name": "punctuation.separator.key-value.js"
369
+ }
370
+ }
371
+ }
372
+ ]
373
+ },
374
+ "literal-keywords": {
375
+ "patterns": [
376
+ {
377
+ "include": "#literal-keyword-storage"
378
+ },
379
+ {
380
+ "name": "keyword.control.flow.js",
381
+ "match": "(?<!\\.)\\b(yield)\\b(?:\\s*(\\*))?",
382
+ "captures": {
383
+ "1": {
384
+ "name": "keyword.control.flow.js"
385
+ },
386
+ "2": {
387
+ "name": "keyword.generator.asterisk.js"
388
+ }
389
+ }
390
+ },
391
+ {
392
+ "name": "keyword.control.flow.js",
393
+ "match": "(?<!\\.)\\b(await|return)\\b"
394
+ },
395
+ {
396
+ "name": "keyword.control.conditional.js",
397
+ "match": "(?<!\\.)\\b(if|else)\\b"
398
+ },
399
+ {
400
+ "name": "keyword.control.trycatch.js",
401
+ "match": "(?<!\\.)\\b(catch|finally|throw|try)\\b"
402
+ },
403
+ {
404
+ "name": "keyword.control.loop.js",
405
+ "match": "(?<!\\.)\\b(break|continue|do|goto|while)\\b"
406
+ }
407
+ ]
408
+ },
409
+ "literal-for": {
410
+ "patterns": [
411
+ {
412
+ "name": "meta.for.js",
413
+ "begin": "(?<!\\.)\\b(for)\\b",
414
+ "end": "\\)",
415
+ "endCaptures": {
416
+ "0": {
417
+ "name": "meta.brace.round.js"
418
+ }
419
+ },
420
+ "beginCaptures": {
421
+ "1": {
422
+ "name": "keyword.control.loop.js"
423
+ }
424
+ },
425
+ "patterns": [
426
+ {
427
+ "begin": "\\(",
428
+ "end": "(?=\\))",
429
+ "beginCaptures": {
430
+ "0": {
431
+ "name": "meta.brace.round.js"
432
+ }
433
+ },
434
+ "patterns": [
435
+ {
436
+ "include": "#literal-keyword-storage"
437
+ },
438
+ {
439
+ "include": "#expression"
440
+ },
441
+ {
442
+ "include": "#literal-punctuation"
443
+ }
444
+ ]
445
+ }
446
+ ]
447
+ }
448
+ ]
449
+ },
450
+ "literal-switch": {
451
+ "patterns": [
452
+ {
453
+ "name": "meta.switch.js",
454
+ "begin": "(?<!\\.)\\b(switch)\\b",
455
+ "end": "\\}",
456
+ "beginCaptures": {
457
+ "1": {
458
+ "name": "keyword.control.switch.js"
459
+ }
460
+ },
461
+ "endCaptures": {
462
+ "0": {
463
+ "name": "meta.brace.curly.js"
464
+ }
465
+ },
466
+ "patterns": [
467
+ {
468
+ "include": "#round-brackets"
469
+ },
470
+ {
471
+ "begin": "\\{",
472
+ "end": "(?=})",
473
+ "beginCaptures": {
474
+ "0": {
475
+ "name": "meta.brace.curly.js"
476
+ }
477
+ },
478
+ "patterns": [
479
+ {
480
+ "begin": "(?<!\\.)\\b(case|default)\\b",
481
+ "end": "(?=:)",
482
+ "beginCaptures": {
483
+ "1": {
484
+ "name": "keyword.control.switch.js"
485
+ }
486
+ },
487
+ "patterns": [
488
+ {
489
+ "include": "#expression"
490
+ }
491
+ ]
492
+ },
493
+ {
494
+ "include": "$self"
495
+ }
496
+ ]
497
+ }
498
+ ]
499
+ }
500
+ ]
501
+ },
502
+ "brackets": {
503
+ "patterns": [
504
+ {
505
+ "include": "#round-brackets"
506
+ },
507
+ {
508
+ "include": "#square-brackets"
509
+ },
510
+ {
511
+ "include": "#curly-brackets"
512
+ }
513
+ ]
514
+ },
515
+ "round-brackets": {
516
+ "patterns": [
517
+ {
518
+ "comment": "try to avoid ternary operators",
519
+ "name": "meta.group.braces.round",
520
+ "begin": "\\s*(^|:|;|(?<=:|;))\\s*(\\()(?=(('|\\\\\\\")(\\\\b[_$a-zA-Z][$\\\\w]*)(\\\\k<2>))|[^:?]*+(:|$))",
521
+ "end": "\\)",
522
+ "beginCaptures": {
523
+ "2": {
524
+ "name": "meta.brace.round.js"
525
+ }
526
+ },
527
+ "endCaptures": {
528
+ "0": {
529
+ "name": "meta.brace.round.js"
530
+ }
531
+ },
532
+ "patterns": [
533
+ {
534
+ "include": "#flowtype-typecast"
535
+ },
536
+ {
537
+ "include": "#expression"
538
+ }
539
+ ]
540
+ },
541
+ {
542
+ "name": "meta.group.braces.round",
543
+ "begin": "\\(",
544
+ "end": "\\)",
545
+ "endCaptures": {
546
+ "0": {
547
+ "name": "meta.brace.round.js"
548
+ }
549
+ },
550
+ "beginCaptures": {
551
+ "0": {
552
+ "name": "meta.brace.round.js"
553
+ }
554
+ },
555
+ "patterns": [
556
+ {
557
+ "include": "#expression"
558
+ }
559
+ ]
560
+ }
561
+ ]
562
+ },
563
+ "square-brackets": {
564
+ "patterns": [
565
+ {
566
+ "name": "meta.group.braces.square",
567
+ "begin": "\\[",
568
+ "end": "\\]",
569
+ "endCaptures": {
570
+ "0": {
571
+ "name": "meta.brace.square.js"
572
+ }
573
+ },
574
+ "beginCaptures": {
575
+ "0": {
576
+ "name": "meta.brace.square.js"
577
+ }
578
+ },
579
+ "patterns": [
580
+ {
581
+ "include": "#expression"
582
+ }
583
+ ]
584
+ }
585
+ ]
586
+ },
587
+ "curly-brackets": {
588
+ "patterns": [
589
+ {
590
+ "name": "meta.group.braces.curly",
591
+ "begin": "\\{",
592
+ "end": "\\}",
593
+ "endCaptures": {
594
+ "0": {
595
+ "name": "meta.brace.curly.js"
596
+ }
597
+ },
598
+ "beginCaptures": {
599
+ "0": {
600
+ "name": "meta.brace.curly.js"
601
+ }
602
+ },
603
+ "patterns": [
604
+ {
605
+ "include": "$self"
606
+ }
607
+ ]
608
+ }
609
+ ]
610
+ },
611
+ "jsdoc": {
612
+ "patterns": [
613
+ {
614
+ "comment": "common doc @ keywords",
615
+ "match": "(?<!\\w)@(abstract|alias|author|class|constructor|deprecated|enum|event|example|extends|fires|ignore|inheritdoc|member|method|param|private|property|protected|readonly|requires|return|since|static|throws|type|var)\\b",
616
+ "name": "storage.type.class.doc"
617
+ },
618
+ {
619
+ "comment": "additional jsdoc keywords",
620
+ "match": "(?<!\\w)@(access|also|arg|arguments|augments|borrows|callback|classdesc|constant|const|constructs|copyright|default|defaultvalue|desc|description|emits|exception|exports|external|file|fileoverview|function|func|global|host|implements|inner|instance|interface|kind|lends|license|listens|memberof|mixes|mixin|module|name|namsepace|overview|prop|public|returns|see|summary|this|todo|tutorial|typedef|undocumented|variation|version|virtual)\\b",
621
+ "name": "storage.type.class.jsdoc"
622
+ },
623
+ {
624
+ "comment": "additional jsduck keywords",
625
+ "match": "(?<!\\w)@(accessor|alternateClassName|aside|cfg|chainable|docauthor|evented|experimental|ftype|hide|inheritable|localdoc|markdown|mixins|new|override|preventable|ptype|removed|scss mixin|singleton|template|uses|xtype)\\b",
626
+ "name": "storage.type.class.jsduck"
627
+ }
628
+ ]
629
+ },
630
+ "comments": {
631
+ "patterns": [
632
+ {
633
+ "include": "#special-comments-conditional-compilation"
634
+ },
635
+ {
636
+ "name": "comment.block.documentation.js",
637
+ "begin": "/\\*\\*(?!/)",
638
+ "end": "\\*/",
639
+ "captures": {
640
+ "0": {
641
+ "name": "punctuation.definition.comment.js"
642
+ }
643
+ },
644
+ "patterns": [
645
+ {
646
+ "include": "#jsdoc"
647
+ }
648
+ ]
649
+ },
650
+ {
651
+ "name": "comment.block.js",
652
+ "begin": "/\\*",
653
+ "end": "\\*/",
654
+ "captures": {
655
+ "0": {
656
+ "name": "punctuation.definition.comment.js"
657
+ }
658
+ }
659
+ },
660
+ {
661
+ "name": "comment.block.html.js",
662
+ "match": "(<!--|-->)",
663
+ "captures": {
664
+ "0": {
665
+ "name": "punctuation.definition.comment.js"
666
+ }
667
+ }
668
+ },
669
+ {
670
+ "name": "comment.line.double-slash.js",
671
+ "begin": "(//)",
672
+ "end": "$",
673
+ "beginCaptures": {
674
+ "1": {
675
+ "name": "punctuation.definition.comment.js"
676
+ }
677
+ }
678
+ },
679
+ {
680
+ "name": "comment.line.shebang.js",
681
+ "match": "^(#!).*$\\n?",
682
+ "captures": {
683
+ "1": {
684
+ "name": "punctuation.definition.comment.js"
685
+ }
686
+ }
687
+ }
688
+ ]
689
+ },
690
+ "special-comments-conditional-compilation": {
691
+ "patterns": [
692
+ {
693
+ "name": "comment.block.conditional.js",
694
+ "begin": "/\\*(?=@)",
695
+ "end": "\\*/",
696
+ "captures": {
697
+ "0": {
698
+ "name": "punctuation.definition.comment.js"
699
+ }
700
+ },
701
+ "endCaptures": {
702
+ "1": {
703
+ "name": "keyword.control.conditional.js"
704
+ },
705
+ "2": {
706
+ "name": "punctuation.definition.keyword.js"
707
+ }
708
+ },
709
+ "patterns": [
710
+ {
711
+ "name": "punctuation.definition.comment.js",
712
+ "match": "/\\*"
713
+ },
714
+ {
715
+ "include": "$self"
716
+ }
717
+ ]
718
+ },
719
+ {
720
+ "name": "keyword.control.conditional.js",
721
+ "match": "(?!@)(@)(if|elif|else|end|ifdef|endif|cc_on|set)\\b",
722
+ "captures": {
723
+ "1": {
724
+ "name": "punctuation.definition.keyword.js"
725
+ }
726
+ }
727
+ },
728
+ {
729
+ "name": "variable.other.conditional.js",
730
+ "match": "(?!@)(@)(_win32|_win16|_mac|_alpha|_x86|_mc680x0|_PowerPC|_jscript|_jscript_build|_jscript_version|_debug|_fast|[a-zA-Z]\\w+)",
731
+ "captures": {
732
+ "1": {
733
+ "name": "punctuation.definition.variable.js"
734
+ }
735
+ }
736
+ }
737
+ ]
738
+ },
739
+ "literal-punctuation": {
740
+ "patterns": [
741
+ {
742
+ "name": "punctuation.terminator.statement.js",
743
+ "match": "\\;"
744
+ },
745
+ {
746
+ "name": "meta.delimiter.comma.js",
747
+ "match": ","
748
+ }
749
+ ]
750
+ },
751
+ "literal-keyword-storage": {
752
+ "patterns": [
753
+ {
754
+ "comment": "these statements must end in a ; ",
755
+ "begin": "(?<!\\.)\\b(const|let|var)\\b\\s+(?=[$_\\p{L}](?:[$\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}-]*+\\s*:))",
756
+ "end": "\\;",
757
+ "beginCaptures": {
758
+ "1": {
759
+ "name": "storage.type.js"
760
+ }
761
+ },
762
+ "endCaptures": {
763
+ "0": {
764
+ "name": "punctuationterminator.statement.js"
765
+ }
766
+ },
767
+ "patterns": [
768
+ {
769
+ "include": "#flowtype-variable"
770
+ }
771
+ ]
772
+ },
773
+ {
774
+ "comment": "these statements must end in a ; ",
775
+ "begin": "(?<!\\.)\\b(const|let|var)\\b\\s+(?=(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})\\s*:)",
776
+ "end": "\\;",
777
+ "beginCaptures": {
778
+ "1": {
779
+ "name": "storage.type.js"
780
+ }
781
+ },
782
+ "endCaptures": {
783
+ "0": {
784
+ "name": "punctuationterminator.statement.js"
785
+ }
786
+ },
787
+ "patterns": [
788
+ {
789
+ "include": "#flowtype-destruct-lhs"
790
+ }
791
+ ]
792
+ },
793
+ {
794
+ "comment": "these statements must end in a ; ",
795
+ "begin": "(?<!\\.)\\b(const|let|var)\\b\\s+(?=(\\[(?:(?>[^\\[\\]]+)|\\g<-1>)*\\])\\s*:)",
796
+ "end": "\\;",
797
+ "beginCaptures": {
798
+ "1": {
799
+ "name": "storage.type.js"
800
+ }
801
+ },
802
+ "endCaptures": {
803
+ "0": {
804
+ "name": "punctuationterminator.statement.js"
805
+ }
806
+ },
807
+ "patterns": [
808
+ {
809
+ "include": "#flowtype-destruct-lhs"
810
+ }
811
+ ]
812
+ },
813
+ {
814
+ "comment": "var statements that done start with a flow indicator",
815
+ "name": "storage.type.js",
816
+ "match": "(?<!\\.)\\b(const|let|var)\\b"
817
+ }
818
+ ]
819
+ },
820
+ "literal-function": {
821
+ "patterns": [
822
+ {
823
+ "comment": "e.g. function play<T>(arg1, arg2) { }",
824
+ "name": "meta.function.js",
825
+ "begin": "\\s*(?:\\b(async)\\b\\s+)?\\s*(\\bfunction\\b)\\s*(\\*?)\\s*([_$a-zA-Z][$\\w]*)?\\s*(?=\\(|<)",
826
+ "end": "(?=\\{)",
827
+ "applyEndPatternLast": "1",
828
+ "beginCaptures": {
829
+ "1": {
830
+ "name": "storage.type.js"
831
+ },
832
+ "2": {
833
+ "name": "storage.type.function.js"
834
+ },
835
+ "3": {
836
+ "name": "keyword.generator.asterisk.js"
837
+ },
838
+ "4": {
839
+ "name": "entity.name.function.js"
840
+ }
841
+ },
842
+ "patterns": [
843
+ {
844
+ "include": "#flowtype"
845
+ }
846
+ ]
847
+ },
848
+ {
849
+ "comment": "e.g. play = function(arg1, arg2) { }",
850
+ "name": "meta.function.js",
851
+ "begin": "(\\b[_$a-zA-Z][$\\w]*)\\s*=\\s*(?:(async)\\s+)?\\s*(\\bfunction\\b)\\s*(\\*?)\\s*([_$a-zA-Z][$\\w]*)?\\s*(?=\\(|<)",
852
+ "end": "(?=\\{)",
853
+ "applyEndPatternLast": "1",
854
+ "beginCaptures": {
855
+ "1": {
856
+ "name": "entity.name.function.js"
857
+ },
858
+ "2": {
859
+ "name": "storage.type.js"
860
+ },
861
+ "3": {
862
+ "name": "storage.type.function.js"
863
+ },
864
+ "4": {
865
+ "name": "keyword.generator.asterisk.js"
866
+ },
867
+ "5": {
868
+ "name": "entity.name.function.js"
869
+ }
870
+ },
871
+ "patterns": [
872
+ {
873
+ "include": "#flowtype"
874
+ }
875
+ ]
876
+ },
877
+ {
878
+ "comment": "e.g. Sound.prototype.play = function(arg1, arg2) { }",
879
+ "name": "meta.prototype.function.js",
880
+ "begin": "(\\b_?[A-Z][$\\w]*)?(\\.)(prototype)(\\.)([_$a-zA-Z][$\\w]*)\\s*=\\s*(?:(async)\\s+)?\\s*(\\bfunction\\b)\\s*(\\*?)\\s*([_$a-zA-Z][$\\w]*)?\\s*(?=\\(|<)",
881
+ "end": "(?=\\{)",
882
+ "applyEndPatternLast": "1",
883
+ "beginCaptures": {
884
+ "1": {
885
+ "name": "entity.name.class.js"
886
+ },
887
+ "2": {
888
+ "name": "keyword.operator.accessor.js"
889
+ },
890
+ "3": {
891
+ "name": "variable.language.prototype.js"
892
+ },
893
+ "4": {
894
+ "name": "keyword.operator.accessor.js"
895
+ },
896
+ "5": {
897
+ "name": "entity.name.function.js"
898
+ },
899
+ "6": {
900
+ "name": "storage.type.js"
901
+ },
902
+ "7": {
903
+ "name": "storage.type.function.js"
904
+ },
905
+ "8": {
906
+ "name": "keyword.generator.asterisk.js"
907
+ },
908
+ "9": {
909
+ "name": "entity.name.function.js"
910
+ }
911
+ },
912
+ "patterns": [
913
+ {
914
+ "include": "#flowtype"
915
+ }
916
+ ]
917
+ },
918
+ {
919
+ "comment": "e.g. Sound.play = function(arg1, arg2) { }",
920
+ "name": "meta.function.static.js",
921
+ "begin": "(\\b_?[A-Z][$\\w]*)?(\\.)([_$a-zA-Z][$\\w]*)\\s*=\\s*(?:(async)\\s+)?\\s*(\\bfunction\\b)\\s*(\\*?)\\s*([_$a-zA-Z][$\\w]*)?\\s*(?=\\(|<)",
922
+ "end": "(?=\\{)",
923
+ "applyEndPatternLast": "1",
924
+ "beginCaptures": {
925
+ "1": {
926
+ "name": "entity.name.class.js"
927
+ },
928
+ "2": {
929
+ "name": "keyword.operator.accessor.js"
930
+ },
931
+ "3": {
932
+ "name": "entity.name.function.js"
933
+ },
934
+ "4": {
935
+ "name": "storage.type.js"
936
+ },
937
+ "5": {
938
+ "name": "storage.type.function.js"
939
+ },
940
+ "6": {
941
+ "name": "keyword.generator.asterisk.js"
942
+ },
943
+ "7": {
944
+ "name": "entity.name.function.js"
945
+ }
946
+ },
947
+ "patterns": [
948
+ {
949
+ "include": "#flowtype"
950
+ }
951
+ ]
952
+ }
953
+ ]
954
+ },
955
+ "literal-quasi": {
956
+ "patterns": [
957
+ {
958
+ "name": "string.quasi.js",
959
+ "begin": "([a-zA-Z$_][\\w$_]*)?(`)",
960
+ "end": "(?<!\\\\)`",
961
+ "beginCaptures": {
962
+ "1": {
963
+ "name": "entity.quasi.tag.name.js"
964
+ },
965
+ "2": {
966
+ "name": "punctuation.definition.quasi.begin.js"
967
+ }
968
+ },
969
+ "endCaptures": {
970
+ "0": {
971
+ "name": "punctuation.definition.quasi.end.js"
972
+ }
973
+ },
974
+ "patterns": [
975
+ {
976
+ "name": "entity.quasi.element.js",
977
+ "begin": "(?<!\\\\)\\${",
978
+ "end": "}",
979
+ "beginCaptures": {
980
+ "0": {
981
+ "name": "punctuation.quasi.element.begin.js"
982
+ }
983
+ },
984
+ "endCaptures": {
985
+ "0": {
986
+ "name": "punctuation.quasi.element.end.js"
987
+ }
988
+ },
989
+ "patterns": [
990
+ {
991
+ "include": "#expression"
992
+ }
993
+ ]
994
+ }
995
+ ]
996
+ }
997
+ ]
998
+ },
999
+ "literal-operators": {
1000
+ "patterns": [
1001
+ {
1002
+ "name": "keyword.operator.js",
1003
+ "match": "(?<!\\.)\\b(delete|in|instanceof|new|of|typeof|void|with)\\b"
1004
+ },
1005
+ {
1006
+ "name": "keyword.operator.logical.js",
1007
+ "match": "!(?!=)|&&|\\|\\|"
1008
+ },
1009
+ {
1010
+ "name": "keyword.operator.assignment.js",
1011
+ "match": "=(?!=)"
1012
+ },
1013
+ {
1014
+ "name": "keyword.operator.assignment.augmented.js",
1015
+ "match": "%=|&=|\\*=|\\+=|-=|/=|\\^=|\\|=|<<=|>>=|>>>="
1016
+ },
1017
+ {
1018
+ "name": "keyword.operator.bitwise.js",
1019
+ "match": "~|<<|>>>|>>|&|\\^|\\|"
1020
+ },
1021
+ {
1022
+ "name": "keyword.operator.relational.js",
1023
+ "match": "<=|>=|<|>"
1024
+ },
1025
+ {
1026
+ "name": "keyword.operator.comparison.js",
1027
+ "match": "===|!==|==|!="
1028
+ },
1029
+ {
1030
+ "name": "keyword.operator.arithmetic.js",
1031
+ "match": "--|\\+\\+|/|%|\\*|\\+|-"
1032
+ },
1033
+ {
1034
+ "name": "keyword.operator.ternary.js",
1035
+ "match": "\\?|:"
1036
+ },
1037
+ {
1038
+ "name": "keyword.operator.spread.js",
1039
+ "match": "(?<!\\.)\\.\\.\\."
1040
+ },
1041
+ {
1042
+ "name": "keyword.operator.accessor.js",
1043
+ "match": "\\."
1044
+ }
1045
+ ]
1046
+ },
1047
+ "literal-function-call": {
1048
+ "patterns": [
1049
+ {
1050
+ "begin": "([_$a-zA-Z][$\\w]*)\\s*(?=\\()",
1051
+ "end": "(?=.)",
1052
+ "applyEndPatternLast": "1",
1053
+ "beginCaptures": {
1054
+ "1": {
1055
+ "name": "entity.name.function.js"
1056
+ }
1057
+ },
1058
+ "patterns": [
1059
+ {
1060
+ "include": "#flowtype"
1061
+ }
1062
+ ]
1063
+ }
1064
+ ]
1065
+ },
1066
+ "literal-language-constant": {
1067
+ "patterns": [
1068
+ {
1069
+ "name": "constant.language.boolean.true.js",
1070
+ "match": "(?<!\\.)\\btrue\\b"
1071
+ },
1072
+ {
1073
+ "name": "constant.language.boolean.false.js",
1074
+ "match": "(?<!\\.)\\bfalse\\b"
1075
+ },
1076
+ {
1077
+ "name": "constant.language.null.js",
1078
+ "match": "(?<!\\.)\\bnull\\b"
1079
+ },
1080
+ {
1081
+ "name": "constant.language.undefined.js",
1082
+ "match": "(?<!\\.)\\bundefined\\b"
1083
+ },
1084
+ {
1085
+ "name": "constant.language.nan.js",
1086
+ "match": "(?<!\\.)\\bNaN\\b"
1087
+ }
1088
+ ]
1089
+ },
1090
+ "support": {
1091
+ "patterns": [
1092
+ {
1093
+ "name": "support.class.builtin.js",
1094
+ "match": "\\b(Array|ArrayBuffer|Boolean|DataView|Date|Float(32|64)Array|Int(8|16|32)Array|Function|GeneratorFunction|Map|Math|Number|Object|Promise|Proxy|RegExp|Set|String|Uint(8|16|32)Array|Uint8ClampedArray|WeakMap|WeakSet)\\b"
1095
+ },
1096
+ {
1097
+ "name": "support.function.js",
1098
+ "match": "(?<!\\.)\\b(decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|unescape)\\b"
1099
+ },
1100
+ {
1101
+ "name": "support.function.mutator.js",
1102
+ "match": "\\.(shift|sort|splice|unshift|pop|push|reverse)\\b"
1103
+ },
1104
+ {
1105
+ "name": "support.class.error.js",
1106
+ "match": "(?<!\\.)\\b((Eval|Range|Reference|Syntax|Type|URI)?Error)\\b"
1107
+ },
1108
+ {
1109
+ "name": "keyword.other.js",
1110
+ "match": "(?<!\\.)\\b(debugger)\\b"
1111
+ },
1112
+ {
1113
+ "name": "support.type.object.dom.js",
1114
+ "match": "(?<!\\.)\\b(document|window)\\b"
1115
+ },
1116
+ {
1117
+ "name": "support.constant.dom.js",
1118
+ "match": "\\b(ELEMENT_NODE|ATTRIBUTE_NODE|TEXT_NODE|CDATA_SECTION_NODE|ENTITY_REFERENCE_NODE|ENTITY_NODE|PROCESSING_INSTRUCTION_NODE|COMMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE|DOCUMENT_FRAGMENT_NODE|NOTATION_NODE|INDEX_SIZE_ERR|DOMSTRING_SIZE_ERR|HIERARCHY_REQUEST_ERR|WRONG_DOCUMENT_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR|NOT_SUPPORTED_ERR|INUSE_ATTRIBUTE_ERR)\\b"
1119
+ },
1120
+ {
1121
+ "match": "(?<!\\.)\\b(console)(?:(\\.)(warn|info|log|error|time|timeEnd|assert))?\\b",
1122
+ "captures": {
1123
+ "1": {
1124
+ "name": "support.type.object.console.js"
1125
+ },
1126
+ "2": {
1127
+ "name": "keyword.operator.accessor.js"
1128
+ },
1129
+ "3": {
1130
+ "name": "support.function.console.js"
1131
+ }
1132
+ }
1133
+ },
1134
+ {
1135
+ "name": "support.module.node.js",
1136
+ "match": "(?<!\\.)\\b(natives|buffer|child_process|cluster|crypto|dgram|dns|fs|http|https|net|os|path|punycode|string|string_decoder|readline|repl|tls|tty|util|vm|zlib)\\b"
1137
+ },
1138
+ {
1139
+ "match": "(?<!\\.)\\b(process)(?:(\\.)(stdout|stderr|stdin|argv|execPath|execArgv|env|exitCode|version|versions|config|pid|title|arch|platform|mainModule))?\\b",
1140
+ "captures": {
1141
+ "1": {
1142
+ "name": "support.type.object.process.js"
1143
+ },
1144
+ "2": {
1145
+ "name": "keyword.operator.accessor.js"
1146
+ },
1147
+ "3": {
1148
+ "name": "support.type.object.process.js"
1149
+ }
1150
+ }
1151
+ },
1152
+ {
1153
+ "match": "(?<!\\.)\\b(process)(?:(\\.)(abort|chdir|cwd|exit|getgid|setgid|getuid|setuid|setgroups|getgroups|initgroups|kill|memoryUsage|nextTick|umask|uptime|hrtime))?\\b",
1154
+ "captures": {
1155
+ "1": {
1156
+ "name": "support.type.object.process.js"
1157
+ },
1158
+ "2": {
1159
+ "name": "keyword.operator.accessor.js"
1160
+ },
1161
+ "3": {
1162
+ "name": "support.function.process.js"
1163
+ }
1164
+ }
1165
+ },
1166
+ {
1167
+ "match": "\\b(((?<!\\.)module\\.((?<!\\,)exports|id|require|parent|filename|loaded|children)|exports))\\b",
1168
+ "captures": {
1169
+ "1": {
1170
+ "name": "support.type.object.module.js"
1171
+ },
1172
+ "2": {
1173
+ "name": "keyword.operator.accessor.js"
1174
+ },
1175
+ "3": {
1176
+ "name": "support.type.object.module.js"
1177
+ }
1178
+ }
1179
+ },
1180
+ {
1181
+ "name": "support.type.object.node.js",
1182
+ "match": "(?<!\\.)\\b(global|GLOBAL|root|__dirname|__filename)\\b"
1183
+ },
1184
+ {
1185
+ "name": "support.class.node.js",
1186
+ "match": "\\b(Buffer|EventEmitter|Server|Pipe|Socket|REPLServer|ReadStream|WriteStream|Stream|Inflate|Deflate|InflateRaw|DeflateRaw|GZip|GUnzip|Unzip|Zip)\\b"
1187
+ },
1188
+ {
1189
+ "name": "meta.tag.mustache.js",
1190
+ "begin": "{{",
1191
+ "end": "}}"
1192
+ }
1193
+ ]
1194
+ },
1195
+ "literal-class": {
1196
+ "patterns": [
1197
+ {
1198
+ "comment": "Classes",
1199
+ "begin": "(?<!\\.)\\b(class)\\s+",
1200
+ "end": "\\s*(})",
1201
+ "beginCaptures": {
1202
+ "0": {
1203
+ "name": "meta.class.js"
1204
+ },
1205
+ "1": {
1206
+ "name": "storage.type.class.js"
1207
+ }
1208
+ },
1209
+ "endCaptures": {
1210
+ "1": {
1211
+ "name": "punctuation.section.class.end.js"
1212
+ }
1213
+ },
1214
+ "patterns": [
1215
+ {
1216
+ "include": "#flowtype-polymorphs"
1217
+ },
1218
+ {
1219
+ "match": "\\s*\\b(extends)\\b\\s*",
1220
+ "captures": {
1221
+ "0": {
1222
+ "name": "meta.class.extends.js"
1223
+ },
1224
+ "1": {
1225
+ "name": "storage.type.extends.js"
1226
+ }
1227
+ }
1228
+ },
1229
+ {
1230
+ "include": "#flowtype-class-name"
1231
+ },
1232
+ {
1233
+ "begin": "{",
1234
+ "end": "(?=})",
1235
+ "contentName": "meta.class.body.js",
1236
+ "beginCaptures": {
1237
+ "0": {
1238
+ "name": "punctuation.section.class.begin.js"
1239
+ }
1240
+ },
1241
+ "patterns": [
1242
+ {
1243
+ "include": "#brackets"
1244
+ },
1245
+ {
1246
+ "include": "#es7-decorators"
1247
+ },
1248
+ {
1249
+ "include": "#comments"
1250
+ },
1251
+ {
1252
+ "include": "#es7-class-properties"
1253
+ },
1254
+ {
1255
+ "include": "#literal-method"
1256
+ },
1257
+ {
1258
+ "include": "#flowtype-class-fields"
1259
+ },
1260
+ {
1261
+ "include": "#expression"
1262
+ }
1263
+ ]
1264
+ }
1265
+ ]
1266
+ }
1267
+ ]
1268
+ },
1269
+ "literal-method-call": {
1270
+ "patterns": [
1271
+ {
1272
+ "name": "meta.function-call.static.without-arguments.js",
1273
+ "comment": "e.g Abc.aaa()",
1274
+ "match": "(?:(?<=\\.)|\\b)([A-Z][$\\w]*)\\s*(\\.)([_$a-zA-Z][$\\w]*)\\s*(\\(\\s*\\))",
1275
+ "captures": {
1276
+ "1": {
1277
+ "name": "variable.other.class.js"
1278
+ },
1279
+ "2": {
1280
+ "name": "keyword.operator.accessor.js"
1281
+ },
1282
+ "3": {
1283
+ "name": "entity.name.function.js"
1284
+ },
1285
+ "4": {
1286
+ "name": "meta.group.braces.round.function.arguments.js"
1287
+ }
1288
+ }
1289
+ },
1290
+ {
1291
+ "name": "meta.function-call.static.with-arguments.js",
1292
+ "match": "(?:(?<=\\.)|\\b)([A-Z][$\\w]*)\\s*(\\.)([_$a-zA-Z][$\\w]*)\\s*(?=\\()",
1293
+ "captures": {
1294
+ "1": {
1295
+ "name": "variable.other.class.js"
1296
+ },
1297
+ "2": {
1298
+ "name": "keyword.operator.accessor.js"
1299
+ },
1300
+ "3": {
1301
+ "name": "entity.name.function.js"
1302
+ }
1303
+ }
1304
+ },
1305
+ {
1306
+ "name": "meta.function-call.method.without-arguments.js",
1307
+ "match": "(?<=\\.)([_$a-zA-Z][$\\w]*)\\s*(\\(\\s*\\))",
1308
+ "captures": {
1309
+ "1": {
1310
+ "name": "entity.name.function.js"
1311
+ },
1312
+ "2": {
1313
+ "name": "meta.group.braces.round.function.arguments.js"
1314
+ }
1315
+ }
1316
+ },
1317
+ {
1318
+ "name": "meta.function-call.method.with-arguments.js",
1319
+ "match": "(?<=\\.)([_$a-zA-Z][$\\w]*)\\s*(?=\\()",
1320
+ "captures": {
1321
+ "1": {
1322
+ "name": "entity.name.function.js"
1323
+ }
1324
+ }
1325
+ }
1326
+ ]
1327
+ },
1328
+ "literal-language-variable": {
1329
+ "patterns": [
1330
+ {
1331
+ "name": "variable.language.arguments.js",
1332
+ "match": "(?<!(?<!\\.\\.)\\.)\\b(arguments)\\b"
1333
+ },
1334
+ {
1335
+ "name": "variable.language.super.js",
1336
+ "match": "(?<!(?<!\\.\\.)\\.)\\b(super)\\b"
1337
+ },
1338
+ {
1339
+ "name": "variable.language.this.js",
1340
+ "match": "(?<!(?<!\\.\\.)\\.)\\b(this)\\b"
1341
+ },
1342
+ {
1343
+ "name": "variable.language.self.js",
1344
+ "match": "(?<!(?<!\\.\\.)\\.)\\b(self)\\b"
1345
+ },
1346
+ {
1347
+ "name": "variable.language.proto.js",
1348
+ "match": "(?<=\\.)\\b(__proto__)\\b"
1349
+ },
1350
+ {
1351
+ "name": "variable.language.constructor.js",
1352
+ "match": "(?<=\\.)\\b(constructor)\\b"
1353
+ },
1354
+ {
1355
+ "name": "variable.language.prototype.js",
1356
+ "match": "(?<=\\.)\\b(prototype)\\b"
1357
+ }
1358
+ ]
1359
+ },
1360
+ "string-content": {
1361
+ "patterns": [
1362
+ {
1363
+ "name": "constant.character.escape.newline.js",
1364
+ "match": "\\\\\\s*\\n"
1365
+ },
1366
+ {
1367
+ "name": "constant.character.escape",
1368
+ "match": "\\\\\\\\|\\\\'|\\\\b|\\\\f|\\\\n|\\\\r|\\\\t|\\\\v|\\\\\"|\\0"
1369
+ },
1370
+ {
1371
+ "name": "constant.character.escape",
1372
+ "match": "\\\\u((\\{[0-9a-fA-F]+\\})|[0-9a-fA-F]{4})"
1373
+ },
1374
+ {
1375
+ "name": "constant.character.escape",
1376
+ "match": "\\\\x[0-9a-fA-F]{2}"
1377
+ }
1378
+ ]
1379
+ },
1380
+ "literal-number": {
1381
+ "patterns": [
1382
+ {
1383
+ "name": "invalid.illegal.numeric.hex.js",
1384
+ "match": "\\s*(?i)(?:\\B[-+]|\\b)0x[0-9a-f]*\\.(\\B|\\b[0-9]+)"
1385
+ },
1386
+ {
1387
+ "name": "invalid.illegal.numeric.octal.js",
1388
+ "match": "\\s*(?:\\B[-+]|\\b)0[0-9]+\\.(\\B|\\b[0-9]+)"
1389
+ },
1390
+ {
1391
+ "name": "constant.numeric.js",
1392
+ "match": "(?i)\\s*(?:\\B[-+])?(?:\\b0b[0-1]*|\\b0o[0-7]*|\\b0x[0-9a-f]*|(\\B\\.[0-9]+|\\b[0-9]+(\\.[0-9]*)?)(e[-+]?[0-9]+)?)"
1393
+ },
1394
+ {
1395
+ "name": "constant.language.infinity.js",
1396
+ "match": "\\s*(?:\\B[-+]|\\b)(Infinity)\\b"
1397
+ }
1398
+ ]
1399
+ },
1400
+ "literal-constructor": {
1401
+ "patterns": [
1402
+ {
1403
+ "name": "meta.instance.constructor",
1404
+ "begin": "(new)\\s+(?=[_$a-zA-Z][$\\w.]*)",
1405
+ "end": "(?![_$a-zA-Z][$\\w.]*)",
1406
+ "beginCaptures": {
1407
+ "1": {
1408
+ "name": "keyword.operator.new.js"
1409
+ }
1410
+ },
1411
+ "patterns": [
1412
+ {
1413
+ "include": "#support"
1414
+ },
1415
+ {
1416
+ "match": "([_$a-zA-Z][$\\w.]*\\.)?([_$a-zA-Z][$\\w]*)",
1417
+ "captures": {
1418
+ "2": {
1419
+ "name": "entity.name.type.new.js"
1420
+ }
1421
+ }
1422
+ }
1423
+ ]
1424
+ }
1425
+ ]
1426
+ },
1427
+ "literal-arrow-function": {
1428
+ "patterns": [
1429
+ {
1430
+ "comment": "e.g. (args) => { }",
1431
+ "name": "meta.function.arrow.js",
1432
+ "begin": "(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*(\\((?:(?>[^()]+)|\\g<-1>)*\\))\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
1433
+ "end": "\\s*(=>)",
1434
+ "applyEndPatternLast": "1",
1435
+ "endCaptures": {
1436
+ "1": {
1437
+ "name": "storage.type.function.arrow.js"
1438
+ }
1439
+ },
1440
+ "beginCaptures": {
1441
+ "1": {
1442
+ "name": "storage.type.js"
1443
+ }
1444
+ },
1445
+ "patterns": [
1446
+ {
1447
+ "include": "#flowtype"
1448
+ }
1449
+ ]
1450
+ },
1451
+ {
1452
+ "comment": "# e.g. arg => { }",
1453
+ "name": "meta.function.arrow.js",
1454
+ "begin": "(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*([_$a-zA-Z][$\\w]*)\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
1455
+ "end": "\\s*(=>)",
1456
+ "beginCaptures": {
1457
+ "1": {
1458
+ "name": "storage.type.js"
1459
+ }
1460
+ },
1461
+ "endCaptures": {
1462
+ "1": {
1463
+ "name": "storage.type.function.arrow.js"
1464
+ }
1465
+ },
1466
+ "patterns": [
1467
+ {
1468
+ "include": "#flowtype-polymorphs"
1469
+ },
1470
+ {
1471
+ "include": "#flowtype-variable"
1472
+ }
1473
+ ]
1474
+ },
1475
+ {
1476
+ "comment": "# e.g. play = (args) => { }",
1477
+ "name": "meta.function.arrow.js",
1478
+ "begin": "(\\b[_$a-zA-Z][$\\w]*)\\s*(=)\\s*(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*(\\((?:(?>[^()]+)|\\g<-1>)*\\))\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
1479
+ "end": "\\s*(=>)",
1480
+ "applyEndPatternLast": "1",
1481
+ "beginCaptures": {
1482
+ "1": {
1483
+ "name": "entity.name.function.js"
1484
+ },
1485
+ "2": {
1486
+ "name": "keyword.operator.equals.js"
1487
+ },
1488
+ "3": {
1489
+ "name": "storage.type.js"
1490
+ }
1491
+ },
1492
+ "endCaptures": {
1493
+ "1": {
1494
+ "name": "storage.type.function.arrow.js"
1495
+ }
1496
+ },
1497
+ "patterns": [
1498
+ {
1499
+ "include": "#flowtype"
1500
+ }
1501
+ ]
1502
+ },
1503
+ {
1504
+ "comment": "# e.g. play = arg => { }",
1505
+ "name": "meta.function.arrow.js",
1506
+ "begin": "(\\b[_$a-zA-Z][$\\w]*)\\s*(=)\\s*(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*([_$a-zA-Z][$\\w]*)\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
1507
+ "end": "\\s*(=>)",
1508
+ "beginCaptures": {
1509
+ "1": {
1510
+ "name": "entity.name.function.js"
1511
+ },
1512
+ "2": {
1513
+ "name": "keyword.operator.equals.js"
1514
+ },
1515
+ "3": {
1516
+ "name": "storage.type.js"
1517
+ }
1518
+ },
1519
+ "endCaptures": {
1520
+ "1": {
1521
+ "name": "storage.type.function.arrow.js"
1522
+ }
1523
+ },
1524
+ "patterns": [
1525
+ {
1526
+ "include": "#flowtype-polymorphs"
1527
+ },
1528
+ {
1529
+ "include": "#flowtype-variable"
1530
+ }
1531
+ ]
1532
+ },
1533
+ {
1534
+ "comment": "Sound.prototype.play = (args) => { }",
1535
+ "name": "meta.prototype.function.arrow.js",
1536
+ "begin": "(\\b[A-Z][$\\w]*)?(\\.)(prototype)(\\.)([_$a-zA-Z][$\\w]*)\\s*(=)\\s*(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*(\\((?:(?>[^()]+)|\\g<-1>)*\\))\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
1537
+ "end": "\\s*(=>)",
1538
+ "applyEndPatternLast": "1",
1539
+ "beginCaptures": {
1540
+ "1": {
1541
+ "name": "entity.name.class.js"
1542
+ },
1543
+ "2": {
1544
+ "name": "keyword.operator.accessor.js"
1545
+ },
1546
+ "3": {
1547
+ "name": "variable.language.prototype.js"
1548
+ },
1549
+ "4": {
1550
+ "name": "keyword.operator.accessor.js"
1551
+ },
1552
+ "5": {
1553
+ "name": "entity.name.function.js"
1554
+ },
1555
+ "6": {
1556
+ "name": "keyword.operator.equals.js"
1557
+ },
1558
+ "7": {
1559
+ "name": "storage.type.js"
1560
+ }
1561
+ },
1562
+ "endCaptures": {
1563
+ "1": {
1564
+ "name": "storage.type.function.arrow.js"
1565
+ }
1566
+ },
1567
+ "patterns": [
1568
+ {
1569
+ "include": "#flowtype"
1570
+ }
1571
+ ]
1572
+ },
1573
+ {
1574
+ "comment": "# e.g. Sound.prototype.play = arg => { }",
1575
+ "name": "meta.prototype.function.arrow.js",
1576
+ "begin": "(\\b_?[A-Z][$\\w]*)?(\\.)(prototype)(\\.)([_$a-zA-Z][$\\w]*)\\s*(=)\\s*(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*([_$a-zA-Z][$\\w]*)\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
1577
+ "end": "\\s*(=>)",
1578
+ "beginCaptures": {
1579
+ "1": {
1580
+ "name": "entity.name.class.js"
1581
+ },
1582
+ "2": {
1583
+ "name": "keyword.operator.accessor.js"
1584
+ },
1585
+ "3": {
1586
+ "name": "variable.language.prototype.js"
1587
+ },
1588
+ "4": {
1589
+ "name": "keyword.operator.accessor.js"
1590
+ },
1591
+ "5": {
1592
+ "name": "entity.name.function.js"
1593
+ },
1594
+ "6": {
1595
+ "name": "keyword.operator.equals.js"
1596
+ },
1597
+ "7": {
1598
+ "name": "storage.type.js"
1599
+ }
1600
+ },
1601
+ "endCaptures": {
1602
+ "1": {
1603
+ "name": "storage.type.function.arrow.js"
1604
+ }
1605
+ },
1606
+ "patterns": [
1607
+ {
1608
+ "include": "#flowtype-polymorphs"
1609
+ },
1610
+ {
1611
+ "include": "#flowtype-variable"
1612
+ }
1613
+ ]
1614
+ },
1615
+ {
1616
+ "comment": "e.g. Sound.play = (args) => { }",
1617
+ "name": "meta.function.static.arrow.js",
1618
+ "begin": "(\\b_?[A-Z][$\\w]*)?(\\.)([_$a-zA-Z][$\\w]*)\\s*(=)\\s*(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*(\\((?:(?>[^()]+)|\\g<-1>)*\\))\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
1619
+ "end": "\\s*(=>)",
1620
+ "applyEndPatternLast": "1",
1621
+ "beginCaptures": {
1622
+ "1": {
1623
+ "name": "entity.name.class.js"
1624
+ },
1625
+ "2": {
1626
+ "name": "keyword.operator.accessor.js"
1627
+ },
1628
+ "3": {
1629
+ "name": "entity.name.function.js"
1630
+ },
1631
+ "4": {
1632
+ "name": "keyword.operator.accessor.js"
1633
+ },
1634
+ "5": {
1635
+ "name": "storage.type.js"
1636
+ }
1637
+ },
1638
+ "endCaptures": {
1639
+ "1": {
1640
+ "name": "storage.type.function.arrow.js"
1641
+ }
1642
+ },
1643
+ "patterns": [
1644
+ {
1645
+ "include": "#flowtype"
1646
+ }
1647
+ ]
1648
+ },
1649
+ {
1650
+ "comment": "# e.g. Sound.play = arg => { }",
1651
+ "name": "meta.function.static.arrow.js",
1652
+ "begin": "(\\b_?[A-Z][$\\w]*)?(\\.)([_$a-zA-Z][$\\w]*)\\s*(=)\\s*(\\basync\\b)?\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?\\s*([_$a-zA-Z][$\\w]*)\\s*(?:\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s*=>)",
1653
+ "end": "\\s*(=>)",
1654
+ "beginCaptures": {
1655
+ "1": {
1656
+ "name": "entity.name.class.js"
1657
+ },
1658
+ "2": {
1659
+ "name": "keyword.operator.accessor.js"
1660
+ },
1661
+ "3": {
1662
+ "name": "entity.name.function.js"
1663
+ },
1664
+ "4": {
1665
+ "name": "keyword.operator.accessor.js"
1666
+ },
1667
+ "5": {
1668
+ "name": "storage.type.js"
1669
+ }
1670
+ },
1671
+ "endCaptures": {
1672
+ "1": {
1673
+ "name": "storage.type.function.arrow.js"
1674
+ }
1675
+ },
1676
+ "patterns": [
1677
+ {
1678
+ "include": "#flowtype-polymorphs"
1679
+ },
1680
+ {
1681
+ "include": "#flowtype-variable"
1682
+ }
1683
+ ]
1684
+ }
1685
+ ]
1686
+ },
1687
+ "literal-method": {
1688
+ "patterns": [
1689
+ {
1690
+ "comment": " e.g. play<T,T>(arg1, arg2): Type<T> { }",
1691
+ "name": "meta.function.method.js",
1692
+ "begin": "(?:\\b(static)\\s+)?(?:\\b(async)\\s+)?(?:(\\*)\\s*)?([_$a-zA-Z][$\\w]*)\\s*(?=(<(?:(?>[^<>]+)|\\g<-1>)*>)?(\\((?:(?>[^()]+)|\\g<-1>)*\\))\\s*(\\s*(:|\\|)(\\s*[$_a-zA-Z0-9]+(<(?:(?>[^<>]+)|\\g<-1>)*>)?|\\s*(\\{(?:(?>[^{}]+)|\\g<-1>)*\\})|\\s*(\\s*([\"']).*?\\k<-1>(?<!\\\\.))|\\s*[x0-9A-Fa-f]+))*\\s{)",
1693
+ "end": "(?={)",
1694
+ "applyEndPatternLast": "1",
1695
+ "beginCaptures": {
1696
+ "1": {
1697
+ "name": "storage.modifier.js"
1698
+ },
1699
+ "2": {
1700
+ "name": "storage.type.js"
1701
+ },
1702
+ "3": {
1703
+ "name": "keyword.generator.asterisk.js"
1704
+ },
1705
+ "4": {
1706
+ "name": "entity.name.function.method.js"
1707
+ }
1708
+ },
1709
+ "patterns": [
1710
+ {
1711
+ "include": "#flowtype"
1712
+ }
1713
+ ]
1714
+ },
1715
+ {
1716
+ "comment": " getter/setter ",
1717
+ "name": "meta.accessor.js",
1718
+ "begin": "\\b(?:(static)\\s+)?(get|set)\\s+([_$a-zA-Z][$\\w]*)\\s*(?=\\()",
1719
+ "end": "(?={)",
1720
+ "applyEndPatternLast": "1",
1721
+ "beginCaptures": {
1722
+ "1": {
1723
+ "name": "storage.modifier.static.js"
1724
+ },
1725
+ "2": {
1726
+ "name": "storage.type.accessor.js"
1727
+ },
1728
+ "3": {
1729
+ "name": "entity.name.accessor.js"
1730
+ }
1731
+ },
1732
+ "patterns": [
1733
+ {
1734
+ "include": "#flowtype"
1735
+ }
1736
+ ]
1737
+ }
1738
+ ]
1739
+ },
1740
+ "literal-regexp": {
1741
+ "patterns": [
1742
+ {
1743
+ "name": "string.regexp.js",
1744
+ "begin": "(?<=\\.|\\(|,|{|}|\\[|;|,|<|>|<=|>=|==|!=|===|!==|\\+|-|\\*|%|\\+\\+|--|<<|>>|>>>|&|\\||\\^|!|~|&&|\\|\\||\\?|:|=|\\+=|-=|\\*=|%=|<<=|>>=|>>>=|&=|\\|=|\\^=|/|/=|\\Wnew|\\Wdelete|\\Wvoid|\\Wtypeof|\\Winstanceof|\\Win|\\Wdo|\\Wreturn|\\Wcase|\\Wthrow|^new|^delete|^void|^typeof|^instanceof|^in|^do|^return|^case|^throw|^)\\s*(/)(?!/|\\*|$)",
1745
+ "end": "(/)([gimy]*)",
1746
+ "beginCaptures": {
1747
+ "1": {
1748
+ "name": "punctuation.definition.string.begin.js"
1749
+ }
1750
+ },
1751
+ "endCaptures": {
1752
+ "1": {
1753
+ "name": "punctuation.definition.string.end.js"
1754
+ },
1755
+ "2": {
1756
+ "name": "keyword.other.js"
1757
+ }
1758
+ },
1759
+ "patterns": [
1760
+ {
1761
+ "include": "source.regexp.babel"
1762
+ }
1763
+ ]
1764
+ }
1765
+ ]
1766
+ },
1767
+ "literal-string": {
1768
+ "patterns": [
1769
+ {
1770
+ "name": "string.quoted.single.js",
1771
+ "begin": "\\s*'",
1772
+ "end": "(')|(\\n)",
1773
+ "beginCaptures": {
1774
+ "0": {
1775
+ "name": "punctuation.definition.string.begin.js"
1776
+ }
1777
+ },
1778
+ "endCaptures": {
1779
+ "1": {
1780
+ "name": "punctuation.definition.string.end.js"
1781
+ },
1782
+ "2": {
1783
+ "name": "invalid.illegal.newline.js"
1784
+ }
1785
+ },
1786
+ "patterns": [
1787
+ {
1788
+ "include": "#string-content"
1789
+ }
1790
+ ]
1791
+ },
1792
+ {
1793
+ "name": "string.quoted.double.js",
1794
+ "begin": "\\s*\"",
1795
+ "end": "(\")|(\\n)",
1796
+ "beginCaptures": {
1797
+ "0": {
1798
+ "name": "punctuation.definition.string.begin.js"
1799
+ }
1800
+ },
1801
+ "endCaptures": {
1802
+ "1": {
1803
+ "name": "punctuation.definition.string.end.js"
1804
+ },
1805
+ "2": {
1806
+ "name": "invalid.illegal.newline.js"
1807
+ }
1808
+ },
1809
+ "patterns": [
1810
+ {
1811
+ "include": "#string-content"
1812
+ }
1813
+ ]
1814
+ }
1815
+ ]
1816
+ },
1817
+ "literal-module": {
1818
+ "patterns": [
1819
+ {
1820
+ "name": "keyword.control.module.js",
1821
+ "match": "(?<!\\.)\\b(import|export|default|from|as)\\b"
1822
+ }
1823
+ ]
1824
+ },
1825
+ "literal-variable": {
1826
+ "patterns": [
1827
+ {
1828
+ "comment": "e.g. CONSTANT",
1829
+ "name": "variable.other.constant.js",
1830
+ "match": "[A-Z][_$\\dA-Z]*\\b"
1831
+ },
1832
+ {
1833
+ "comment": "e.g. dollar vars",
1834
+ "name": "variable.other.dollar.js",
1835
+ "match": "(\\$)[$\\w]+",
1836
+ "captures": {
1837
+ "0": {
1838
+ "name": "punctuation.dollar.js"
1839
+ }
1840
+ }
1841
+ },
1842
+ {
1843
+ "comment": "e.g. Class.property",
1844
+ "name": "meta.property.class.js",
1845
+ "match": "\\b([A-Z][$\\w]*)\\s*(\\.)([_$a-zA-Z][$\\w]*)",
1846
+ "captures": {
1847
+ "1": {
1848
+ "name": "variable.other.class.js"
1849
+ },
1850
+ "2": {
1851
+ "name": "keyword.operator.accessor.js"
1852
+ },
1853
+ "3": {
1854
+ "name": "variable.other.property.static.js"
1855
+ }
1856
+ }
1857
+ },
1858
+ {
1859
+ "comment": "e.g. obj.property",
1860
+ "name": "variable.other.object.js",
1861
+ "match": "(?<!\\.)[_$a-zA-Z][$\\w]*\\s*(?=[\\[\\.])",
1862
+ "captures": {
1863
+ "1": {
1864
+ "name": "variable.other.object.js"
1865
+ }
1866
+ }
1867
+ },
1868
+ {
1869
+ "comment": "e.g. obj.property",
1870
+ "name": "meta.property.object.js",
1871
+ "match": "(?<=\\.)\\s*[_$a-zA-Z][$\\w]*",
1872
+ "captures": {
1873
+ "0": {
1874
+ "name": "variable.other.property.js"
1875
+ }
1876
+ }
1877
+ },
1878
+ {
1879
+ "name": "variable.other.readwrite.js",
1880
+ "match": "[_$a-zA-Z][$\\w]*"
1881
+ }
1882
+ ]
1883
+ },
1884
+ "literal-prototype": {
1885
+ "patterns": [
1886
+ {
1887
+ "comment": "e.g. Sound.prototype",
1888
+ "name": "meta.prototype.access.js",
1889
+ "match": "([_$a-zA-Z][$\\w]*)(\\.)(prototype)\\b",
1890
+ "captures": {
1891
+ "1": {
1892
+ "name": "entity.name.class.js"
1893
+ },
1894
+ "2": {
1895
+ "name": "keyword.operator.accessor.js"
1896
+ },
1897
+ "3": {
1898
+ "name": "variable.language.prototype.js"
1899
+ }
1900
+ }
1901
+ },
1902
+ {
1903
+ "comment": "e.g. Sound.prototype = { }",
1904
+ "name": "meta.prototype.declaration.js",
1905
+ "match": "([_$a-zA-Z][$\\w]*)(\\.)(prototype)\\s*=\\s*",
1906
+ "captures": {
1907
+ "1": {
1908
+ "name": "entity.name.class.js"
1909
+ },
1910
+ "2": {
1911
+ "name": "keyword.operator.accessor.js"
1912
+ },
1913
+ "3": {
1914
+ "name": "variable.language.prototype.js"
1915
+ }
1916
+ }
1917
+ }
1918
+ ]
1919
+ },
1920
+ "es7-class-properties": {
1921
+ "patterns": [
1922
+ {
1923
+ "comment": "stage 0 proposal: https://gist.github.com/jeffmo/054df782c05639da2adb",
1924
+ "match": "\\b(static)?\\s*\\b([_$a-zA-Z][$\\w]*)\\s*(=)",
1925
+ "captures": {
1926
+ "1": {
1927
+ "name": "storage.modifier.static.js"
1928
+ },
1929
+ "2": {
1930
+ "name": "variable.other.property.js"
1931
+ },
1932
+ "3": {
1933
+ "name": "storage.type.js"
1934
+ }
1935
+ }
1936
+ }
1937
+ ]
1938
+ },
1939
+ "es7-decorators": {
1940
+ "patterns": [
1941
+ {
1942
+ "comment": "https://github.com/wycats/javascript-decorators",
1943
+ "name": "tag.decorator.js",
1944
+ "match": "(?!@)(@)([_$a-zA-Z][$\\w]*)\\b",
1945
+ "captures": {
1946
+ "1": {
1947
+ "name": "punctuation.definition.tag.js"
1948
+ },
1949
+ "2": {
1950
+ "name": "entity.name.tag.js"
1951
+ }
1952
+ }
1953
+ }
1954
+ ]
1955
+ },
1956
+ "jsx": {
1957
+ "comment": "but excludes using unicode esc characters, <ZWNJ> and <ZWJ> as per the draft. Will anyone use these?",
1958
+ "patterns": [
1959
+ {
1960
+ "include": "#jsx-tag-element-name"
1961
+ }
1962
+ ]
1963
+ },
1964
+ "jsx-tag-element-name": {
1965
+ "patterns": [
1966
+ {
1967
+ "comment": "Tags that end > are trapped in #jsx-tag-termination",
1968
+ "name": "meta.tag.jsx",
1969
+ "begin": "(<)([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}-](?<!\\.\\.))*+)(?=[ />\\t\\n])(?<!\\.)",
1970
+ "end": "(</)(\\2)(>)|(/>)",
1971
+ "beginCaptures": {
1972
+ "1": {
1973
+ "name": "punctuation.definition.tag.jsx"
1974
+ },
1975
+ "2": {
1976
+ "name": "entity.name.tag.open.jsx"
1977
+ }
1978
+ },
1979
+ "endCaptures": {
1980
+ "1": {
1981
+ "name": "punctuation.definition.tag.jsx"
1982
+ },
1983
+ "2": {
1984
+ "name": "entity.name.tag.close.jsx"
1985
+ },
1986
+ "3": {
1987
+ "name": "punctuation.definition.tag.jsx"
1988
+ },
1989
+ "4": {
1990
+ "name": "punctuation.definition.tag.jsx"
1991
+ }
1992
+ },
1993
+ "patterns": [
1994
+ {
1995
+ "include": "#jsx-tag-termination"
1996
+ },
1997
+ {
1998
+ "include": "#jsx-tag-attributes"
1999
+ }
2000
+ ]
2001
+ }
2002
+ ]
2003
+ },
2004
+ "jsx-tag-termination": {
2005
+ "patterns": [
2006
+ {
2007
+ "comment": "uses non consuming search for </ in </tag>",
2008
+ "begin": ">",
2009
+ "end": "(?=</)",
2010
+ "beginCaptures": {
2011
+ "0": {
2012
+ "name": "punctuation.definition.tag.jsx"
2013
+ }
2014
+ },
2015
+ "patterns": [
2016
+ {
2017
+ "include": "#jsx-evaluated-code"
2018
+ },
2019
+ {
2020
+ "include": "#jsx-entities"
2021
+ },
2022
+ {
2023
+ "include": "#jsx-tag-element-name"
2024
+ }
2025
+ ]
2026
+ }
2027
+ ]
2028
+ },
2029
+ "jsx-tag-attributes": {
2030
+ "patterns": [
2031
+ {
2032
+ "include": "#jsx-attribute-name"
2033
+ },
2034
+ {
2035
+ "include": "#jsx-assignment"
2036
+ },
2037
+ {
2038
+ "include": "#jsx-string-double-quoted"
2039
+ },
2040
+ {
2041
+ "include": "#jsx-string-single-quoted"
2042
+ },
2043
+ {
2044
+ "include": "#jsx-evaluated-code"
2045
+ },
2046
+ {
2047
+ "include": "#jsx-tag-element-name"
2048
+ },
2049
+ {
2050
+ "include": "#jsx-tag-attributes"
2051
+ },
2052
+ {
2053
+ "include": "#comments"
2054
+ }
2055
+ ]
2056
+ },
2057
+ "jsx-spread-attribute": {
2058
+ "patterns": [
2059
+ {
2060
+ "comment": "Spread attribute { ... AssignmentExpression }",
2061
+ "match": "(?<!\\.)\\.\\.\\.",
2062
+ "name": "keyword.operator.spread.jsx"
2063
+ }
2064
+ ]
2065
+ },
2066
+ "jsx-attribute-name": {
2067
+ "patterns": [
2068
+ {
2069
+ "comment": "look for attribute name",
2070
+ "match": "(?<!\\S)([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}-](?<!\\.\\.))*+)(?<!\\.)(?=//|/\\*|=|\\s)",
2071
+ "captures": {
2072
+ "0": {
2073
+ "name": "entity.other.attribute-name.jsx"
2074
+ }
2075
+ }
2076
+ }
2077
+ ]
2078
+ },
2079
+ "jsx-assignment": {
2080
+ "patterns": [
2081
+ {
2082
+ "comment": "look for attribute assignment",
2083
+ "name": "keyword.operator.assignment.jsx",
2084
+ "match": "=(?=\\s*(?:'|\"|{|/\\*|<|//|\\n))"
2085
+ }
2086
+ ]
2087
+ },
2088
+ "jsx-string-double-quoted": {
2089
+ "name": "string.quoted.double.js",
2090
+ "begin": "\"",
2091
+ "end": "\"(?<!\\\\\")",
2092
+ "beginCaptures": {
2093
+ "0": {
2094
+ "name": "punctuation.definition.string.begin.jsx"
2095
+ }
2096
+ },
2097
+ "endCaptures": {
2098
+ "0": {
2099
+ "name": "punctuation.definition.string.end.jsx"
2100
+ }
2101
+ },
2102
+ "patterns": [
2103
+ {
2104
+ "include": "#jsx-entities"
2105
+ }
2106
+ ]
2107
+ },
2108
+ "jsx-string-single-quoted": {
2109
+ "name": "string.quoted.single.js",
2110
+ "begin": "'",
2111
+ "end": "'(?<!\\\\')",
2112
+ "beginCaptures": {
2113
+ "0": {
2114
+ "name": "punctuation.definition.string.begin.jsx"
2115
+ }
2116
+ },
2117
+ "endCaptures": {
2118
+ "0": {
2119
+ "name": "punctuation.definition.string.end.jsx"
2120
+ }
2121
+ },
2122
+ "patterns": [
2123
+ {
2124
+ "include": "#jsx-entities"
2125
+ }
2126
+ ]
2127
+ },
2128
+ "jsx-evaluated-code": {
2129
+ "name": "meta.embedded.expression.js",
2130
+ "begin": "{",
2131
+ "end": "}",
2132
+ "beginCaptures": {
2133
+ "0": {
2134
+ "name": "punctuation.section.embedded.begin.jsx"
2135
+ }
2136
+ },
2137
+ "endCaptures": {
2138
+ "0": {
2139
+ "name": "punctuation.section.embedded.end.jsx"
2140
+ }
2141
+ },
2142
+ "contentName": "source.js.jsx",
2143
+ "patterns": [
2144
+ {
2145
+ "include": "#jsx-string-double-quoted"
2146
+ },
2147
+ {
2148
+ "include": "#jsx-string-single-quoted"
2149
+ },
2150
+ {
2151
+ "include": "#jsx-spread-attribute"
2152
+ },
2153
+ {
2154
+ "include": "#expression"
2155
+ }
2156
+ ]
2157
+ },
2158
+ "jsx-entities": {
2159
+ "patterns": [
2160
+ {
2161
+ "comment": "Embeded HTML entities &blah",
2162
+ "match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
2163
+ "captures": {
2164
+ "0": {
2165
+ "name": "constant.character.entity.jsx"
2166
+ },
2167
+ "1": {
2168
+ "name": "punctuation.definition.entity.jsx"
2169
+ },
2170
+ "2": {
2171
+ "name": "entity.name.tag.html.jsx"
2172
+ },
2173
+ "3": {
2174
+ "name": "punctuation.definition.entity.jsx"
2175
+ }
2176
+ }
2177
+ },
2178
+ {
2179
+ "comment": "Entity with & and invalid name",
2180
+ "match": "&\\S*;",
2181
+ "name": "invalid.illegal.bad-ampersand.jsx"
2182
+ }
2183
+ ]
2184
+ },
2185
+ "flowtype": {
2186
+ "patterns": [
2187
+ {
2188
+ "include": "#flowtype-polymorphs"
2189
+ },
2190
+ {
2191
+ "include": "#flowtype-bracketed-parameters"
2192
+ },
2193
+ {
2194
+ "include": "#flowtype-return"
2195
+ }
2196
+ ]
2197
+ },
2198
+ "flowtype-return": {
2199
+ "patterns": [
2200
+ {
2201
+ "comment": "maybe an issue if a object literal is returned and the start of func block isn't on same line!",
2202
+ "begin": "(?<=\\))\\s*(:)",
2203
+ "end": "\\s*(?={|;|\\n|=>)",
2204
+ "applyEndPatternLast": "1",
2205
+ "beginCaptures": {
2206
+ "1": {
2207
+ "name": "punctuation.type.flowtype"
2208
+ }
2209
+ },
2210
+ "patterns": [
2211
+ {
2212
+ "include": "#flowtype-parse-types"
2213
+ }
2214
+ ]
2215
+ }
2216
+ ]
2217
+ },
2218
+ "flowtype-variable": {
2219
+ "patterns": [
2220
+ {
2221
+ "comment": "name of variable spread var or optional ? var with flowtype :",
2222
+ "match": "\\s*((?<!\\.)\\.\\.\\.)?([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}])*+)\\s*(\\?)?(?!\\()",
2223
+ "captures": {
2224
+ "1": {
2225
+ "name": "keyword.operator.spread.js"
2226
+ },
2227
+ "2": {
2228
+ "name": "storage.type.variable.js"
2229
+ },
2230
+ "3": {
2231
+ "name": "puntuation.optional.parameter.js"
2232
+ }
2233
+ }
2234
+ },
2235
+ {
2236
+ "include": "#flowtype-vars-and-props"
2237
+ }
2238
+ ]
2239
+ },
2240
+ "flowtype-destruct-lhs": {
2241
+ "comment": "use this pattern to colour code the variable part correctly",
2242
+ "patterns": [
2243
+ {
2244
+ "begin": "\\s*{",
2245
+ "end": "\\s*}",
2246
+ "patterns": [
2247
+ {
2248
+ "include": "#flowtype-destruct-lhs"
2249
+ }
2250
+ ]
2251
+ },
2252
+ {
2253
+ "begin": "\\s*\\[",
2254
+ "end": "\\s*\\]",
2255
+ "patterns": [
2256
+ {
2257
+ "include": "#flowtype-destruct-lhs"
2258
+ }
2259
+ ]
2260
+ },
2261
+ {
2262
+ "comment": "string as destructor target",
2263
+ "match": "\\s*((['\\\"]).*?\\k<-1>(?<!\\\\.))\\s*(:)\\s*(([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}])*+))",
2264
+ "captures": {
2265
+ "1": {
2266
+ "name": "string.quoted.js"
2267
+ },
2268
+ "3": {
2269
+ "name": "punctuation"
2270
+ },
2271
+ "4": {
2272
+ "name": "storage.type.variable.property.js"
2273
+ }
2274
+ }
2275
+ },
2276
+ {
2277
+ "comment": "prop name : var name as destructor target",
2278
+ "match": "\\s*([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}])*+)\\s*(:)\\s*(([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}])*+))",
2279
+ "captures": {
2280
+ "1": {
2281
+ "name": "string.unquoted.js"
2282
+ },
2283
+ "2": {
2284
+ "name": "punctuation"
2285
+ },
2286
+ "3": {
2287
+ "name": "storage.type.variable.property.js"
2288
+ }
2289
+ }
2290
+ },
2291
+ {
2292
+ "comment": "var name as destructor target",
2293
+ "match": "\\s*((?<!\\.)\\.\\.\\.)?([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}])*+)",
2294
+ "captures": {
2295
+ "1": {
2296
+ "name": "keyword.operator.spread.js"
2297
+ },
2298
+ "2": {
2299
+ "name": "storage.type.variable.js"
2300
+ }
2301
+ }
2302
+ },
2303
+ {
2304
+ "match": ","
2305
+ },
2306
+ {
2307
+ "include": "#flowtype-vars-and-props"
2308
+ }
2309
+ ]
2310
+ },
2311
+ "flowtype-object-property": {
2312
+ "patterns": [
2313
+ {
2314
+ "comment": "name of property which can be a string",
2315
+ "match": "\\s*(('|\\\").*?(\\k<2>(?<!\\\\.)))|([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}])*+)",
2316
+ "captures": {
2317
+ "0": {
2318
+ "name": "storage.type.variable.property.flowtype"
2319
+ }
2320
+ }
2321
+ },
2322
+ {
2323
+ "include": "#flowtype-vars-and-props"
2324
+ }
2325
+ ]
2326
+ },
2327
+ "flowtype-vars-and-props": {
2328
+ "patterns": [
2329
+ {
2330
+ "comment": "typed entity :",
2331
+ "begin": "\\s*(:)",
2332
+ "end": "(?=.|\\n)",
2333
+ "applyEndPatternLast": "1",
2334
+ "beginCaptures": {
2335
+ "1": {
2336
+ "name": "punctuation.type.flowtype"
2337
+ }
2338
+ },
2339
+ "patterns": [
2340
+ {
2341
+ "include": "#flowtype-parse-types"
2342
+ }
2343
+ ]
2344
+ },
2345
+ {
2346
+ "comment": "commas",
2347
+ "begin": "\\s*,",
2348
+ "end": "(?=.)",
2349
+ "applyEndPatternLast": "1",
2350
+ "patterns": [
2351
+ {
2352
+ "include": "#flowtype-variable"
2353
+ }
2354
+ ]
2355
+ },
2356
+ {
2357
+ "comment": "A decorator",
2358
+ "match": "@"
2359
+ },
2360
+ {
2361
+ "include": "#flowtype-bracketed-parameters"
2362
+ },
2363
+ {
2364
+ "include": "#flowtype-parse-operators"
2365
+ },
2366
+ {
2367
+ "include": "#expression"
2368
+ }
2369
+ ]
2370
+ },
2371
+ "flowtype-parse-operators": {
2372
+ "patterns": [
2373
+ {
2374
+ "comment": "call back with a form ) => type",
2375
+ "begin": "(?<=\\))\\s*=>",
2376
+ "end": "(?=.)",
2377
+ "applyEndPatternLast": "1",
2378
+ "beginCaptures": {
2379
+ "0": {
2380
+ "name": "storage.type.function.arrow.js"
2381
+ }
2382
+ },
2383
+ "patterns": [
2384
+ {
2385
+ "include": "#flowtype-parse-types"
2386
+ }
2387
+ ]
2388
+ },
2389
+ {
2390
+ "comment": "some form of default assignment for func args",
2391
+ "begin": "\\s*=(?!>)",
2392
+ "end": "\\s*(?=,|;|\\))",
2393
+ "beginCaptures": {
2394
+ "0": {
2395
+ "name": "keyword.operator.assignment.js"
2396
+ }
2397
+ },
2398
+ "patterns": [
2399
+ {
2400
+ "include": "#expression"
2401
+ }
2402
+ ]
2403
+ }
2404
+ ]
2405
+ },
2406
+ "flowtype-parse-types": {
2407
+ "patterns": [
2408
+ {
2409
+ "name": "keyword.operator.flowtype",
2410
+ "match": "\\s*\\btypeof\\b\\s*"
2411
+ },
2412
+ {
2413
+ "comment": "primitive flowtypes",
2414
+ "match": "\\s*(?:(\\?)?)\\s*\\b((?>any|boolean|mixed|number|string|void))\\b",
2415
+ "captures": {
2416
+ "1": {
2417
+ "name": "punctuation.flowtype"
2418
+ },
2419
+ "2": {
2420
+ "name": "support.type.builtin.primitve.flowtype"
2421
+ }
2422
+ }
2423
+ },
2424
+ {
2425
+ "comment": "Built-in Class Types",
2426
+ "match": "\\s*(?:(\\?)?)\\s*\\b((?>Boolean|Function|Number|Object|String))\\b",
2427
+ "captures": {
2428
+ "1": {
2429
+ "name": "punctuation.flowtype"
2430
+ },
2431
+ "2": {
2432
+ "name": "support.type.builtin.class.flowtype"
2433
+ }
2434
+ }
2435
+ },
2436
+ {
2437
+ "comment": "custom Class Types e.g. Abc ",
2438
+ "match": "\\s*(?:(\\?)?)\\s*([$_[\\p{Lu}\\p{Lt}\\p{Lm}\\p{Lo}]][$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}]*)",
2439
+ "captures": {
2440
+ "1": {
2441
+ "name": "punctuation.flowtype"
2442
+ },
2443
+ "2": {
2444
+ "name": "support.type.class.flowtype"
2445
+ }
2446
+ }
2447
+ },
2448
+ {
2449
+ "comment": "custom primitive/var Types e.g. abc ",
2450
+ "match": "\\s*(?:(\\?)?)\\s*([$_\\p{L}][$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}]*)",
2451
+ "captures": {
2452
+ "1": {
2453
+ "name": "punctuation.flowtype"
2454
+ },
2455
+ "2": {
2456
+ "name": "support.type.primitive.flowtype"
2457
+ }
2458
+ }
2459
+ },
2460
+ {
2461
+ "comment": "Type Unions |",
2462
+ "name": "kewyword.operator.union.flowtype",
2463
+ "match": "\\s*\\|"
2464
+ },
2465
+ {
2466
+ "comment": "intersection of types &",
2467
+ "name": "kewyword.operator.intersection.flowtype",
2468
+ "match": "\\s*\\&"
2469
+ },
2470
+ {
2471
+ "comment": "as per React declares in flowtype github",
2472
+ "name": "kewyword.operator.existential.flowtype",
2473
+ "match": "\\s*\\*"
2474
+ },
2475
+ {
2476
+ "include": "#literal-string"
2477
+ },
2478
+ {
2479
+ "include": "#literal-number"
2480
+ },
2481
+ {
2482
+ "include": "#flowtype-polymorphs"
2483
+ },
2484
+ {
2485
+ "include": "#flowtype-bracketed-parameters"
2486
+ },
2487
+ {
2488
+ "include": "#flowtype-parse-objects"
2489
+ },
2490
+ {
2491
+ "include": "#flowtype-parse-operators"
2492
+ },
2493
+ {
2494
+ "include": "#flowtype-parse-array"
2495
+ },
2496
+ {
2497
+ "include": "#comments"
2498
+ }
2499
+ ]
2500
+ },
2501
+ "flowtype-bracketed-parameters": {
2502
+ "patterns": [
2503
+ {
2504
+ "comment": "Get parameters within a function/method call",
2505
+ "begin": "\\s*(\\()",
2506
+ "end": "\\s*(\\))",
2507
+ "beginCaptures": {
2508
+ "1": {
2509
+ "name": "punctuation.definition.parameters.begin.js"
2510
+ }
2511
+ },
2512
+ "endCaptures": {
2513
+ "1": {
2514
+ "name": "punctuation.definition.parameters.begin.js"
2515
+ }
2516
+ },
2517
+ "patterns": [
2518
+ {
2519
+ "include": "#flowtype-variable"
2520
+ }
2521
+ ]
2522
+ }
2523
+ ]
2524
+ },
2525
+ "flowtype-polymorphs": {
2526
+ "comment": "Support Bounded Polymorphism http://flowtype.org/blog/2015/03/12/Bounded-Polymorphism.html",
2527
+ "patterns": [
2528
+ {
2529
+ "comment": "Built-in Class Types with elements of type <T>",
2530
+ "begin": "\\s*\\b((?>Array|Class))\\s*(<)",
2531
+ "end": "\\s*(>)",
2532
+ "beginCaptures": {
2533
+ "1": {
2534
+ "name": "support.type.builtin.flowtype"
2535
+ },
2536
+ "2": {
2537
+ "name": "punctuation.flowtype"
2538
+ }
2539
+ },
2540
+ "endCaptures": {
2541
+ "1": {
2542
+ "name": "punctuation.flowtype"
2543
+ }
2544
+ },
2545
+ "patterns": [
2546
+ {
2547
+ "match": "\\s*,",
2548
+ "name": "punctuation.type.separator.flowtype"
2549
+ },
2550
+ {
2551
+ "match": "\\s*:",
2552
+ "name": "punctuation.type.separator.flowtype"
2553
+ },
2554
+ {
2555
+ "include": "#flowtype-parse-types"
2556
+ }
2557
+ ]
2558
+ },
2559
+ {
2560
+ "comment": "just the polymorph bit like this <K,V>(arg,arg)",
2561
+ "begin": "\\s*(<)",
2562
+ "end": "\\s*(>)",
2563
+ "beginCaptures": {
2564
+ "1": {
2565
+ "name": "punctutation.flowtype"
2566
+ }
2567
+ },
2568
+ "endCaptures": {
2569
+ "1": {
2570
+ "name": "punctutation.flowtype"
2571
+ }
2572
+ },
2573
+ "patterns": [
2574
+ {
2575
+ "match": "\\s*,",
2576
+ "name": "punctuation.type.separator.flowtype"
2577
+ },
2578
+ {
2579
+ "match": "\\s*:",
2580
+ "name": "punctuation.type.separator.flowtype"
2581
+ },
2582
+ {
2583
+ "include": "#flowtype-parse-types"
2584
+ }
2585
+ ]
2586
+ }
2587
+ ]
2588
+ },
2589
+ "flowtype-parse-objects": {
2590
+ "comment": "object literal flowtype not be preceded by either : | = symbols",
2591
+ "begin": "(?<=:|\\||\\=)\\s*(\\{)",
2592
+ "end": "\\s*(\\})",
2593
+ "applyEndPatternLast": "1",
2594
+ "beginCaptures": {
2595
+ "1": {
2596
+ "name": "meta.brace.round.open.flowtype"
2597
+ }
2598
+ },
2599
+ "endCaptures": {
2600
+ "1": {
2601
+ "name": "meta.brace.round.close.flowtype"
2602
+ }
2603
+ },
2604
+ "patterns": [
2605
+ {
2606
+ "include": "#flowtype-object-property"
2607
+ }
2608
+ ]
2609
+ },
2610
+ "flowtype-parse-array": {
2611
+ "comment": "arrays such as [name: string, dob: Date]",
2612
+ "begin": "\\s*(\\[)",
2613
+ "end": "\\s*(\\])",
2614
+ "beginCaptures": {
2615
+ "1": {
2616
+ "name": "meta.brace.square.open.flowtype"
2617
+ }
2618
+ },
2619
+ "endCaptures": {
2620
+ "1": {
2621
+ "name": "meta.brace.square.end.flowtype"
2622
+ }
2623
+ },
2624
+ "patterns": [
2625
+ {
2626
+ "include": "#flowtype-parse-types"
2627
+ }
2628
+ ]
2629
+ },
2630
+ "flowtype-class-fields": {
2631
+ "comment": "flow supports field names in classe bodies, such as namevar: string",
2632
+ "match": "\\s*(\\bstatic\\b)?\\s*([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}])*+)\\b\\s*\\??\\s*(:[^;]*)(;|$)",
2633
+ "captures": {
2634
+ "1": {
2635
+ "name": "storage.modifier.static.js"
2636
+ },
2637
+ "2": {
2638
+ "name": "storage.type.variable.flowtype"
2639
+ },
2640
+ "3": {
2641
+ "patterns": [
2642
+ {
2643
+ "include": "#flowtype-parse-types"
2644
+ }
2645
+ ]
2646
+ }
2647
+ }
2648
+ },
2649
+ "flowtype-type-aliases": {
2650
+ "patterns": [
2651
+ {
2652
+ "comment": "import for types",
2653
+ "name": "keyword.control.module.js",
2654
+ "match": "(?<!\\.)\\b(import)\\b\\s*(type)\\b"
2655
+ },
2656
+ {
2657
+ "comment": "handle other types",
2658
+ "begin": "\\s*\\b(type)\\s+(?=[$_\\p{L}])",
2659
+ "end": "\\s*;|\\n",
2660
+ "beginCaptures": {
2661
+ "1": {
2662
+ "name": "storage.type.flowtype"
2663
+ }
2664
+ },
2665
+ "endCaptures": {
2666
+ "1": {
2667
+ "name": "punctuation.object.end.flowtype"
2668
+ }
2669
+ },
2670
+ "patterns": [
2671
+ {
2672
+ "match": "\\s="
2673
+ },
2674
+ {
2675
+ "begin": "\\s*{",
2676
+ "end": "\\s*}",
2677
+ "applyEndPatternLast": "1",
2678
+ "beginCaptures": {
2679
+ "0": {
2680
+ "name": "meta.brace.curly.js"
2681
+ }
2682
+ },
2683
+ "endCaptures": {
2684
+ "0": {
2685
+ "name": "meta.brace.curly.js"
2686
+ }
2687
+ },
2688
+ "patterns": [
2689
+ {
2690
+ "include": "#flowtype"
2691
+ },
2692
+ {
2693
+ "include": "#flowtype-variable"
2694
+ },
2695
+ {
2696
+ "include": "#comments"
2697
+ },
2698
+ {
2699
+ "include": "#flowtype-function-name"
2700
+ }
2701
+ ]
2702
+ },
2703
+ {
2704
+ "include": "#flowtype"
2705
+ },
2706
+ {
2707
+ "include": "#flowtype-parse-types"
2708
+ },
2709
+ {
2710
+ "include": "#comments"
2711
+ },
2712
+ {
2713
+ "include": "#flowtype-function-name"
2714
+ }
2715
+ ]
2716
+ }
2717
+ ]
2718
+ },
2719
+ "flowtype-interface": {
2720
+ "patterns": [
2721
+ {
2722
+ "comment": "find declare module and declare class defs",
2723
+ "begin": "\\s*\\b(interface)\\s+(?=[$_\\p{L}])",
2724
+ "end": "\\s*;|\\n",
2725
+ "applyEndPatternLast": "1",
2726
+ "beginCaptures": {
2727
+ "1": {
2728
+ "name": "storage.type.function.js"
2729
+ }
2730
+ },
2731
+ "patterns": [
2732
+ {
2733
+ "include": "#flowtype"
2734
+ },
2735
+ {
2736
+ "include": "#flowtype-interface-name"
2737
+ },
2738
+ {
2739
+ "begin": "{",
2740
+ "end": "(?=})",
2741
+ "contentName": "meta.class.body.js",
2742
+ "beginCaptures": {
2743
+ "0": {
2744
+ "name": "punctuation.section.class.begin.js"
2745
+ }
2746
+ },
2747
+ "patterns": [
2748
+ {
2749
+ "include": "#flowtype"
2750
+ },
2751
+ {
2752
+ "include": "#flowtype-class-fields"
2753
+ },
2754
+ {
2755
+ "include": "#comments"
2756
+ },
2757
+ {
2758
+ "include": "#flowtype-function-name"
2759
+ }
2760
+ ]
2761
+ }
2762
+ ]
2763
+ }
2764
+ ]
2765
+ },
2766
+ "flowtype-function-name": {
2767
+ "match": "\\s*(\\bstatic\\b)?\\s*([$_\\p{L}][$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}]*)?\\s*(?!:)(?=\\(|<.*\\()",
2768
+ "captures": {
2769
+ "1": {
2770
+ "name": "storage.modifier.static.js"
2771
+ },
2772
+ "2": {
2773
+ "name": "entity.name.function.js"
2774
+ }
2775
+ }
2776
+ },
2777
+ "flowtype-class-name": {
2778
+ "comment": "look for classes names but dont assume uppercase start char",
2779
+ "match": "\\s*([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}])*+)",
2780
+ "name": "entity.name.class.js"
2781
+ },
2782
+ "flowtype-interface-name": {
2783
+ "comment": "look for interface names but dont assume uppercase start char",
2784
+ "match": "\\s*([$_\\p{L}](?:[$.\\p{L}\\p{Mn}\\p{Mc}\\p{Nd}\\p{Nl}\\p{Pc}])*+)",
2785
+ "name": "support.type.interface.js"
2786
+ },
2787
+ "flowtype-declare": {
2788
+ "patterns": [
2789
+ {
2790
+ "begin": "\\s*\\b(declare)\\s+(?=(class|function|module|var))\\b",
2791
+ "end": "(?=.)",
2792
+ "applyEndPatternLast": "1",
2793
+ "beginCaptures": {
2794
+ "1": {
2795
+ "name": "support.type.declare.flowtype"
2796
+ }
2797
+ },
2798
+ "patterns": [
2799
+ {
2800
+ "include": "#flowtype-declare-classes"
2801
+ },
2802
+ {
2803
+ "include": "#flowtype-declare-modules"
2804
+ },
2805
+ {
2806
+ "include": "#flowtype-declare-function"
2807
+ },
2808
+ {
2809
+ "include": "#flowtype-declare-vars"
2810
+ }
2811
+ ]
2812
+ }
2813
+ ]
2814
+ },
2815
+ "flowtype-declare-modules": {
2816
+ "match": "\\s*\\bmodule\\b\\s+",
2817
+ "name": "support.type.object.module.js"
2818
+ },
2819
+ "flowtype-declare-classes": {
2820
+ "patterns": [
2821
+ {
2822
+ "begin": "\\s*\\b(class)\\s+",
2823
+ "end": "}",
2824
+ "applyEndPatternLast": "1",
2825
+ "beginCaptures": {
2826
+ "1": {
2827
+ "name": "support.type.class.flowtype"
2828
+ }
2829
+ },
2830
+ "patterns": [
2831
+ {
2832
+ "begin": "\\s*\\b(extends)\\b\\s*",
2833
+ "end": "(?={)",
2834
+ "beginCaptures": {
2835
+ "1": {
2836
+ "name": "storage.type.extends.js"
2837
+ }
2838
+ },
2839
+ "patterns": [
2840
+ {
2841
+ "include": "#flowtype-class-name"
2842
+ },
2843
+ {
2844
+ "include": "#flowtype-polymorphs"
2845
+ }
2846
+ ]
2847
+ },
2848
+ {
2849
+ "begin": "{",
2850
+ "end": "(?=})",
2851
+ "contentName": "meta.class.body.js",
2852
+ "beginCaptures": {
2853
+ "0": {
2854
+ "name": "punctuation.section.class.begin.js"
2855
+ }
2856
+ },
2857
+ "patterns": [
2858
+ {
2859
+ "include": "#flowtype"
2860
+ },
2861
+ {
2862
+ "include": "#flowtype-class-fields"
2863
+ },
2864
+ {
2865
+ "include": "#comments"
2866
+ },
2867
+ {
2868
+ "include": "#flowtype-function-name"
2869
+ }
2870
+ ]
2871
+ },
2872
+ {
2873
+ "include": "#flowtype-class-name"
2874
+ },
2875
+ {
2876
+ "include": "#flowtype-polymorphs"
2877
+ }
2878
+ ]
2879
+ }
2880
+ ]
2881
+ },
2882
+ "flowtype-declare-function": {
2883
+ "patterns": [
2884
+ {
2885
+ "begin": "\\s*\\b(function)\\s+",
2886
+ "end": "(;)",
2887
+ "applyEndPatternLast": "1",
2888
+ "beginCaptures": {
2889
+ "1": {
2890
+ "name": "storage.type.function.js"
2891
+ }
2892
+ },
2893
+ "patterns": [
2894
+ {
2895
+ "include": "#flowtype"
2896
+ },
2897
+ {
2898
+ "include": "#flowtype-function-name"
2899
+ }
2900
+ ]
2901
+ }
2902
+ ]
2903
+ },
2904
+ "flowtype-declare-vars": {
2905
+ "patterns": [
2906
+ {
2907
+ "begin": "\\s*\\b(var)\\s+",
2908
+ "end": "(;)",
2909
+ "applyEndPatternLast": "1",
2910
+ "beginCaptures": {
2911
+ "1": {
2912
+ "name": "storage.type.var.js"
2913
+ }
2914
+ },
2915
+ "patterns": [
2916
+ {
2917
+ "include": "#flowtype-variable"
2918
+ }
2919
+ ]
2920
+ }
2921
+ ]
2922
+ },
2923
+ "flowtype-typecast": {
2924
+ "patterns": [
2925
+ {
2926
+ "begin": "\\s*:",
2927
+ "end": "(?=\\s*\\))",
2928
+ "patterns": [
2929
+ {
2930
+ "include": "#flowtype-parse-types"
2931
+ }
2932
+ ]
2933
+ }
2934
+ ]
2935
+ }
2936
+ }
2937
+ }