github-linguist 5.3.3 → 6.0.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 (460) hide show
  1. checksums.yaml +4 -4
  2. data/bin/git-linguist +5 -2
  3. data/ext/linguist/linguist.c +18 -7
  4. data/grammars/annotation.liquidhaskell.haskell.json +969 -862
  5. data/grammars/config.xcompose.json +22 -25
  6. data/grammars/file.lasso.json +296 -309
  7. data/grammars/hint.haskell.json +867 -766
  8. data/grammars/hint.message.haskell.json +867 -766
  9. data/grammars/hint.type.haskell.json +867 -766
  10. data/grammars/objdump.x86asm.json +20 -24
  11. data/grammars/source.Kotlin.json +220 -225
  12. data/grammars/source.LS.json +36 -55
  13. data/grammars/source.MCPOST.json +24 -38
  14. data/grammars/source.MOD.json +26 -41
  15. data/grammars/source.SASLog.json +9 -16
  16. data/grammars/source.abap.json +48 -56
  17. data/grammars/source.abl.json +8 -14
  18. data/grammars/source.abnf.json +88 -98
  19. data/grammars/source.actionscript.3.json +398 -429
  20. data/grammars/source.acucobol.json +5 -8
  21. data/grammars/source.ada.json +46 -53
  22. data/grammars/source.afm.json +548 -554
  23. data/grammars/source.agc.json +34 -37
  24. data/grammars/source.agda.json +79 -91
  25. data/grammars/source.ahk.json +62 -66
  26. data/grammars/source.alloy.json +16 -20
  27. data/grammars/source.ampl.json +41 -47
  28. data/grammars/source.angelscript.json +71 -80
  29. data/grammars/source.antlr.json +131 -136
  30. data/grammars/source.apache-config.json +93 -99
  31. data/grammars/source.apache-config.mod_perl.json +19 -24
  32. data/grammars/source.apl.json +1038 -1029
  33. data/grammars/source.applescript.json +501 -523
  34. data/grammars/source.apt.json +9 -16
  35. data/grammars/source.asn.json +27 -31
  36. data/grammars/source.asp.json +61 -67
  37. data/grammars/source.aspectj.json +385 -391
  38. data/grammars/source.assembly.json +49 -55
  39. data/grammars/source.ats.json +45 -121
  40. data/grammars/source.autoit.json +64 -69
  41. data/grammars/source.awk.json +172 -176
  42. data/grammars/source.ballerina.json +48 -395
  43. data/grammars/source.batchfile.json +269 -269
  44. data/grammars/source.befunge.json +17 -21
  45. data/grammars/source.bf.json +5 -11
  46. data/grammars/source.bison.json +10 -14
  47. data/grammars/source.blitzmax.json +300 -305
  48. data/grammars/source.boo.json +189 -193
  49. data/grammars/source.brightauthorproject.json +8 -13
  50. data/grammars/source.brightscript.json +37 -47
  51. data/grammars/source.bro.json +134 -140
  52. data/grammars/source.bsl.json +152 -193
  53. data/grammars/source.bsv.json +96 -102
  54. data/grammars/source.c++.json +176 -193
  55. data/grammars/source.c++.qt.json +13 -21
  56. data/grammars/source.c.ec.json +15 -21
  57. data/grammars/source.c.json +237 -251
  58. data/grammars/source.c.platform.json +153 -159
  59. data/grammars/source.c2hs.json +3 -6
  60. data/grammars/source.cabal.json +17 -20
  61. data/grammars/source.cache.cmake.json +18 -23
  62. data/grammars/source.cake.json +4 -7
  63. data/grammars/source.camlp4.ocaml.json +24 -27
  64. data/grammars/source.capnp.json +33 -38
  65. data/grammars/source.ceylon.json +44 -50
  66. data/grammars/source.cfscript.cfc.json +78 -86
  67. data/grammars/source.cfscript.json +513 -520
  68. data/grammars/source.changelogs.rpm-spec.json +8 -16
  69. data/grammars/source.chapel.json +109 -87
  70. data/grammars/source.cirru.json +25 -30
  71. data/grammars/source.clarion.json +41 -54
  72. data/grammars/source.clean.json +90 -95
  73. data/grammars/source.click.json +25 -28
  74. data/grammars/source.clips.json +10 -23
  75. data/grammars/source.clojure.json +151 -168
  76. data/grammars/source.cm.json +14 -19
  77. data/grammars/source.cmake.json +53 -61
  78. data/grammars/source.cobol.json +165 -180
  79. data/grammars/source.coffee.json +454 -462
  80. data/grammars/source.cool.json +36 -43
  81. data/grammars/source.coq.json +17 -21
  82. data/grammars/source.crystal.json +889 -983
  83. data/grammars/source.cs.json +739 -740
  84. data/grammars/source.csound-document.json +69 -73
  85. data/grammars/source.csound-score.json +52 -55
  86. data/grammars/source.csound.json +167 -171
  87. data/grammars/source.css.json +683 -688
  88. data/grammars/source.css.less.json +211 -511
  89. data/grammars/source.css.mss.json +94 -101
  90. data/grammars/source.css.postcss.sugarss.json +260 -0
  91. data/grammars/source.csx.json +4 -7
  92. data/grammars/source.cuda-c++.json +47 -81
  93. data/grammars/source.cwl.json +103 -0
  94. data/grammars/source.cython.json +536 -582
  95. data/grammars/source.d.json +243 -252
  96. data/grammars/source.dart.json +161 -166
  97. data/grammars/source.data-weave.json +901 -905
  98. data/grammars/source.desktop.json +29 -33
  99. data/grammars/source.diff.json +43 -52
  100. data/grammars/source.disasm.json +15 -16
  101. data/grammars/source.ditroff.desc.json +73 -84
  102. data/grammars/source.ditroff.json +60 -61
  103. data/grammars/source.dm.json +202 -213
  104. data/grammars/source.dmf.json +44 -47
  105. data/grammars/source.dockerfile.json +29 -34
  106. data/grammars/source.dot.json +46 -55
  107. data/grammars/source.dylan.json +63 -68
  108. data/grammars/source.ebnf.json +55 -62
  109. data/grammars/source.eiffel.json +57 -62
  110. data/grammars/source.elixir.json +321 -366
  111. data/grammars/source.emacs.lisp.json +458 -249
  112. data/grammars/source.erazor.json +49 -57
  113. data/grammars/source.erlang.json +508 -515
  114. data/grammars/source.essl.json +17 -30
  115. data/grammars/source.factor.json +85 -91
  116. data/grammars/source.fan.json +92 -96
  117. data/grammars/source.fancy.json +93 -118
  118. data/grammars/source.fish.json +74 -98
  119. data/grammars/source.fontforge.json +142 -146
  120. data/grammars/source.forth.json +42 -57
  121. data/grammars/source.fortran.json +193 -231
  122. data/grammars/source.fortran.modern.json +77 -103
  123. data/grammars/source.fsharp.fsi.json +1 -6
  124. data/grammars/source.fsharp.fsl.json +1 -6
  125. data/grammars/source.fsharp.fsx.json +1 -6
  126. data/grammars/source.fsharp.json +148 -153
  127. data/grammars/source.gap.json +60 -70
  128. data/grammars/source.gcode.json +9 -16
  129. data/grammars/source.gdb.json +63 -79
  130. data/grammars/source.gdb.session.json +27 -28
  131. data/grammars/source.gdbregs.json +7 -8
  132. data/grammars/source.gdscript.json +92 -96
  133. data/grammars/source.gerber.json +38 -56
  134. data/grammars/source.gfm.json +447 -462
  135. data/grammars/source.glsl.json +58 -83
  136. data/grammars/source.gn.json +188 -193
  137. data/grammars/source.gnuplot.json +104 -120
  138. data/grammars/source.go.json +169 -181
  139. data/grammars/source.golo.json +82 -87
  140. data/grammars/source.gosu.2.json +58 -68
  141. data/grammars/source.grace.json +266 -270
  142. data/grammars/source.graphql.json +586 -596
  143. data/grammars/source.groovy.gradle.json +18 -22
  144. data/grammars/source.groovy.json +422 -433
  145. data/grammars/source.harbour.json +129 -173
  146. data/grammars/source.haskell.json +871 -772
  147. data/grammars/source.haxe.2.json +402 -413
  148. data/grammars/source.hlsl.json +6 -16
  149. data/grammars/source.hsc2hs.json +1 -4
  150. data/grammars/source.hsig.json +871 -770
  151. data/grammars/source.hss.1.json +122 -144
  152. data/grammars/source.httpspec.json +119 -123
  153. data/grammars/source.hxml.json +8 -15
  154. data/grammars/source.ideal.json +125 -125
  155. data/grammars/source.idl-dlm.json +25 -32
  156. data/grammars/source.idl.json +59 -80
  157. data/grammars/source.idris.json +171 -185
  158. data/grammars/source.inform7.json +117 -121
  159. data/grammars/source.ini.json +37 -43
  160. data/grammars/source.io.json +65 -73
  161. data/grammars/source.ioke.json +72 -78
  162. data/grammars/source.isabelle.root.json +26 -30
  163. data/grammars/source.isabelle.theory.json +46 -50
  164. data/grammars/source.j.json +18 -21
  165. data/grammars/source.jasmin.json +45 -50
  166. data/grammars/source.java-properties.json +31 -41
  167. data/grammars/source.java.json +333 -342
  168. data/grammars/source.jcl.json +15 -18
  169. data/grammars/source.jflex.json +166 -172
  170. data/grammars/source.jison.json +331 -334
  171. data/grammars/source.jisonlex-injection.json +1 -2
  172. data/grammars/source.jisonlex.json +148 -151
  173. data/grammars/source.jolie.json +37 -43
  174. data/grammars/source.jq.json +80 -87
  175. data/grammars/source.js.json +798 -818
  176. data/grammars/source.js.jsx.json +2115 -2225
  177. data/grammars/source.js.objj.json +167 -172
  178. data/grammars/source.js.regexp.json +50 -50
  179. data/grammars/source.js.regexp.replacement.json +7 -7
  180. data/grammars/source.jsdoc.json +94 -94
  181. data/grammars/source.json.json +61 -71
  182. data/grammars/source.julia.console.json +5 -6
  183. data/grammars/source.julia.json +237 -234
  184. data/grammars/source.lean.json +55 -67
  185. data/grammars/source.lid.json +6 -10
  186. data/grammars/source.lilypond.json +181 -195
  187. data/grammars/source.lisp.json +40 -50
  188. data/grammars/source.litcoffee.json +169 -183
  189. data/grammars/source.livescript.json +207 -220
  190. data/grammars/source.llvm.json +28 -38
  191. data/grammars/source.logos.json +7 -14
  192. data/grammars/source.logtalk.json +136 -141
  193. data/grammars/source.loomscript.json +77 -83
  194. data/grammars/source.lsl.json +90 -106
  195. data/grammars/source.lua.json +100 -109
  196. data/grammars/source.makefile.json +181 -188
  197. data/grammars/source.makegen.json +3 -7
  198. data/grammars/source.mask.json +260 -265
  199. data/grammars/source.mata.json +38 -46
  200. data/grammars/source.mathematica.json +155 -167
  201. data/grammars/source.matlab.json +407 -684
  202. data/grammars/source.maxscript.json +293 -281
  203. data/grammars/source.mercury.json +179 -184
  204. data/grammars/source.meson.json +52 -58
  205. data/grammars/source.meta-info.json +64 -74
  206. data/grammars/source.ml.json +107 -113
  207. data/grammars/source.modelica.json +51 -59
  208. data/grammars/source.modula2.json +33 -42
  209. data/grammars/source.monkey.json +234 -241
  210. data/grammars/source.moonscript.json +51 -56
  211. data/grammars/source.mql5.json +74 -101
  212. data/grammars/source.mupad.json +30 -72
  213. data/grammars/source.ncl.json +1 -14
  214. data/grammars/source.ne.json +39 -42
  215. data/grammars/source.nemerle.json +58 -63
  216. data/grammars/source.nesc.json +9 -15
  217. data/grammars/source.netlinx.erb.json +13 -25
  218. data/grammars/source.netlinx.json +231 -292
  219. data/grammars/source.nextflow-groovy.json +1360 -0
  220. data/grammars/source.nextflow.json +74 -0
  221. data/grammars/source.nginx.json +274 -287
  222. data/grammars/source.nim.json +442 -483
  223. data/grammars/source.nim_filter.json +6 -26
  224. data/grammars/source.nimcfg.json +38 -51
  225. data/grammars/source.ninja.json +64 -70
  226. data/grammars/source.nit.json +60 -64
  227. data/grammars/source.nix.json +269 -273
  228. data/grammars/source.nmml.json +31 -37
  229. data/grammars/source.nsis.json +66 -72
  230. data/grammars/source.nu.json +129 -139
  231. data/grammars/source.nut.json +129 -133
  232. data/grammars/source.objc++.json +3 -10
  233. data/grammars/source.objc.json +303 -314
  234. data/grammars/source.objc.platform.json +145 -151
  235. data/grammars/source.ocaml.json +506 -514
  236. data/grammars/source.ocamllex.json +108 -115
  237. data/grammars/source.ocamlyacc.json +116 -123
  238. data/grammars/source.ooc.json +148 -155
  239. data/grammars/source.opa.json +39 -49
  240. data/grammars/source.opal.json +84 -89
  241. data/grammars/source.opalsysdefs.json +9 -13
  242. data/grammars/source.opencobol.json +22 -25
  243. data/grammars/source.opentype.json +148 -152
  244. data/grammars/source.ox.json +36 -44
  245. data/grammars/source.oz.json +31 -38
  246. data/grammars/source.p4.json +49 -59
  247. data/grammars/source.pan.json +273 -278
  248. data/grammars/source.papyrus.skyrim.json +705 -781
  249. data/grammars/source.parrot.pir.json +59 -65
  250. data/grammars/source.pascal.json +54 -61
  251. data/grammars/source.pawn.json +835 -849
  252. data/grammars/source.pcb.board.json +153 -158
  253. data/grammars/source.pcb.schematic.json +134 -138
  254. data/grammars/source.pcb.sexp.json +64 -74
  255. data/grammars/source.pep8.json +28 -32
  256. data/grammars/source.perl.6.json +83 -92
  257. data/grammars/source.perl.json +711 -737
  258. data/grammars/source.perl6fe.json +1204 -1218
  259. data/grammars/source.php.zephir.json +80 -89
  260. data/grammars/source.pic.json +137 -142
  261. data/grammars/source.pig_latin.json +76 -80
  262. data/grammars/source.pike.json +23 -36
  263. data/grammars/source.po.json +74 -84
  264. data/grammars/source.pogoscript.json +23 -29
  265. data/grammars/source.pony.json +98 -108
  266. data/grammars/source.postcss.json +370 -0
  267. data/grammars/source.postscript.json +88 -97
  268. data/grammars/source.pov-ray sdl.json +36 -42
  269. data/grammars/source.powershell.json +175 -197
  270. data/grammars/source.processing.json +236 -249
  271. data/grammars/source.prolog.eclipse.json +33 -38
  272. data/grammars/source.prolog.json +66 -72
  273. data/grammars/source.protobuf.json +88 -94
  274. data/grammars/source.puppet.json +144 -151
  275. data/grammars/source.purescript.json +268 -289
  276. data/grammars/source.pyjade.json +256 -281
  277. data/grammars/source.python.django.json +13 -18
  278. data/grammars/source.python.json +3319 -3367
  279. data/grammars/source.python.salt.json +3 -7
  280. data/grammars/source.qmake.json +83 -90
  281. data/grammars/source.qml.json +57 -78
  282. data/grammars/source.quoting.perl6fe.json +666 -669
  283. data/grammars/source.r.json +75 -84
  284. data/grammars/source.racket.json +17 -38
  285. data/grammars/source.rascal.json +77 -80
  286. data/grammars/source.reason.hover.type.json +1 -1
  287. data/grammars/source.reason.json +1025 -1080
  288. data/grammars/source.rebol.json +167 -177
  289. data/grammars/source.red.json +169 -177
  290. data/grammars/source.regexp.babel.json +74 -77
  291. data/grammars/source.regexp.extended.json +4 -5
  292. data/grammars/source.regexp.json +260 -264
  293. data/grammars/source.regexp.perl6fe.json +108 -111
  294. data/grammars/source.regexp.python.json +210 -215
  295. data/grammars/source.regexp.spin.json +63 -72
  296. data/grammars/source.renpy.json +617 -687
  297. data/grammars/source.rexx.json +25 -32
  298. data/grammars/source.ring.json +84 -114
  299. data/grammars/source.rpm-spec.json +392 -401
  300. data/grammars/source.ruby.gemfile.json +9 -12
  301. data/grammars/source.ruby.json +862 -952
  302. data/grammars/source.ruby.rspec.cucumber.steps.json +90 -103
  303. data/grammars/source.rust.json +223 -281
  304. data/grammars/source.sas.json +88 -105
  305. data/grammars/source.sass.json +100 -108
  306. data/grammars/source.sbt.json +16 -23
  307. data/grammars/source.scad.json +60 -67
  308. data/grammars/source.scala.json +215 -228
  309. data/grammars/source.scaml.json +120 -135
  310. data/grammars/source.scheme.json +119 -136
  311. data/grammars/source.scilab.json +40 -47
  312. data/grammars/source.scss.json +369 -403
  313. data/grammars/source.sdbl.json +14 -25
  314. data/grammars/source.shaderlab.json +24 -27
  315. data/grammars/source.shell.json +409 -440
  316. data/grammars/source.shen.json +75 -94
  317. data/grammars/source.smali.json +232 -293
  318. data/grammars/source.smalltalk.json +60 -75
  319. data/grammars/source.smt.json +67 -82
  320. data/grammars/source.solidity.json +35 -54
  321. data/grammars/source.sp.json +40 -45
  322. data/grammars/source.sparql.json +3 -8
  323. data/grammars/source.spin.json +277 -297
  324. data/grammars/source.sqf.json +34 -44
  325. data/grammars/source.sql.json +142 -156
  326. data/grammars/source.stan.json +201 -160
  327. data/grammars/source.stata.json +57 -68
  328. data/grammars/source.strings.json +26 -30
  329. data/grammars/source.stylus.json +558 -565
  330. data/grammars/source.supercollider.json +33 -40
  331. data/grammars/source.swift.json +999 -1077
  332. data/grammars/source.systemverilog.json +351 -365
  333. data/grammars/source.tcl.json +77 -94
  334. data/grammars/source.tea.json +61 -67
  335. data/grammars/source.terra.json +25 -32
  336. data/grammars/source.terraform.json +68 -88
  337. data/grammars/source.thrift.json +300 -306
  338. data/grammars/source.tl.json +112 -117
  339. data/grammars/source.tla.json +65 -69
  340. data/grammars/source.toc.json +21 -25
  341. data/grammars/source.toml.json +117 -122
  342. data/grammars/source.ts.json +2838 -2774
  343. data/grammars/source.tsx.json +180 -184
  344. data/grammars/source.turing.json +970 -974
  345. data/grammars/source.turtle.json +124 -140
  346. data/grammars/source.txl.json +23 -37
  347. data/grammars/source.ucfconstraints.json +16 -21
  348. data/grammars/source.ur.json +15 -27
  349. data/grammars/source.vala.json +221 -235
  350. data/grammars/source.varnish.vcl.json +117 -129
  351. data/grammars/source.vbnet.json +69 -106
  352. data/grammars/source.verilog.json +101 -107
  353. data/grammars/source.vhdl.json +437 -445
  354. data/grammars/source.viml.json +540 -550
  355. data/grammars/source.wavefront.mtl.json +274 -277
  356. data/grammars/source.wavefront.obj.json +781 -784
  357. data/grammars/source.wdl.json +66 -46
  358. data/grammars/source.webassembly.json +97 -102
  359. data/grammars/source.webidl.json +311 -326
  360. data/grammars/source.x10.json +28 -32
  361. data/grammars/source.x86asm.json +21 -26
  362. data/grammars/source.xc.json +164 -172
  363. data/grammars/source.xq.json +81 -92
  364. data/grammars/source.xtend.json +199 -208
  365. data/grammars/source.yaml-ext.json +118 -124
  366. data/grammars/source.yaml.json +155 -174
  367. data/grammars/source.yaml.salt.json +113 -116
  368. data/grammars/source.yang.json +10 -13
  369. data/grammars/source.yara.json +98 -0
  370. data/grammars/text.bibtex.json +95 -100
  371. data/grammars/text.cfml.basic.json +403 -404
  372. data/grammars/text.elixir.json +18 -23
  373. data/grammars/text.error-list.json +15 -16
  374. data/grammars/text.find-refs.json +487 -488
  375. data/grammars/text.gherkin.feature.json +45 -53
  376. data/grammars/text.haml.json +176 -189
  377. data/grammars/text.hamlc.json +82 -88
  378. data/grammars/text.html.abl.json +16 -21
  379. data/grammars/text.html.asciidoc.json +139 -153
  380. data/grammars/text.html.asdoc.json +145 -155
  381. data/grammars/text.html.asp.json +23 -28
  382. data/grammars/text.html.basic.json +323 -338
  383. data/grammars/text.html.cfm.json +316 -325
  384. data/grammars/text.html.creole.json +177 -189
  385. data/grammars/text.html.django.json +27 -33
  386. data/grammars/text.html.ecr.json +21 -25
  387. data/grammars/text.html.elixir.json +3 -9
  388. data/grammars/text.html.erb.json +81 -85
  389. data/grammars/text.html.erlang.yaws.json +24 -29
  390. data/grammars/text.html.factor.json +5 -11
  391. data/grammars/text.html.ftl.json +16 -25
  392. data/grammars/text.html.handlebars.json +579 -598
  393. data/grammars/text.html.javadoc.json +426 -0
  394. data/grammars/text.html.js.json +11 -17
  395. data/grammars/text.html.jsp.json +377 -384
  396. data/grammars/text.html.liquid.json +8 -18
  397. data/grammars/text.html.mako.json +257 -275
  398. data/grammars/text.html.markdown.source.gfm.apib.json +419 -427
  399. data/grammars/text.html.markdown.source.gfm.mson.json +405 -414
  400. data/grammars/text.html.mediawiki.json +318 -344
  401. data/grammars/text.html.php.blade.json +2134 -2140
  402. data/grammars/text.html.php.json +980 -1013
  403. data/grammars/text.html.slash.json +101 -107
  404. data/grammars/text.html.smarty.json +75 -83
  405. data/grammars/text.html.soy.json +250 -253
  406. data/grammars/text.html.ssp.json +18 -24
  407. data/grammars/text.html.tcl.json +17 -24
  408. data/grammars/text.html.twig.json +712 -718
  409. data/grammars/text.idl-idldoc.json +5 -9
  410. data/grammars/text.jade.json +213 -235
  411. data/grammars/text.junit-test-report.json +25 -28
  412. data/grammars/text.log.latex.json +44 -46
  413. data/grammars/text.marko.json +370 -401
  414. data/grammars/text.python.console.json +3 -7
  415. data/grammars/text.python.traceback.json +2 -5
  416. data/grammars/text.rdoc.json +15 -19
  417. data/grammars/text.restructuredtext.clean.json +8 -11
  418. data/grammars/text.restructuredtext.json +886 -873
  419. data/grammars/text.robot.json +26 -36
  420. data/grammars/text.roff.json +2852 -2915
  421. data/grammars/text.runoff.json +56 -69
  422. data/grammars/text.sfd.json +151 -155
  423. data/grammars/text.shell-session.json +5 -8
  424. data/grammars/text.slim.json +184 -210
  425. data/grammars/text.srt.json +54 -57
  426. data/grammars/text.tex.json +98 -105
  427. data/grammars/text.tex.latex.beamer.json +14 -20
  428. data/grammars/text.tex.latex.haskell.json +883 -782
  429. data/grammars/text.tex.latex.json +281 -291
  430. data/grammars/text.tex.latex.memoir.json +39 -46
  431. data/grammars/text.tex.latex.rd.json +32 -38
  432. data/grammars/text.xml.ant.json +62 -69
  433. data/grammars/text.xml.flex-config.json +1009 -1013
  434. data/grammars/text.xml.genshi.json +10 -16
  435. data/grammars/text.xml.json +117 -130
  436. data/grammars/text.xml.pom.json +235 -240
  437. data/grammars/text.xml.xsl.json +31 -37
  438. data/grammars/text.zone_file.json +24 -29
  439. data/lib/linguist/blob.rb +10 -1
  440. data/lib/linguist/blob_helper.rb +4 -1
  441. data/lib/linguist/file_blob.rb +5 -0
  442. data/lib/linguist/generated.rb +16 -0
  443. data/lib/linguist/heuristics.rb +23 -11
  444. data/lib/linguist/language.rb +3 -6
  445. data/lib/linguist/languages.json +1 -1
  446. data/lib/linguist/languages.yml +74 -12
  447. data/lib/linguist/lazy_blob.rb +15 -1
  448. data/lib/linguist/linguist.bundle +0 -0
  449. data/lib/linguist/samples.json +1666 -3381
  450. data/lib/linguist/shebang.rb +2 -0
  451. data/lib/linguist/strategy/modeline.rb +2 -0
  452. data/lib/linguist/vendor.yml +5 -6
  453. data/lib/linguist/version.rb +1 -1
  454. metadata +12 -11
  455. data/grammars/source.elm.json +0 -381
  456. data/grammars/source.nant-build.json +0 -86
  457. data/grammars/source.octave.json +0 -451
  458. data/grammars/text.html.mediawiki.elm-build-output.json +0 -111
  459. data/grammars/text.html.mediawiki.elm-documentation.json +0 -22
  460. data/grammars/text.html.vue.json +0 -936
@@ -1,13 +1,8 @@
1
1
  {
2
2
  "name": "Papyrus - Skyrim",
3
3
  "scopeName": "source.papyrus.skyrim",
4
- "fileTypes": [
5
- "psc"
6
- ],
7
- "uuid": "01a6e257-d5f5-46f0-8795-b04ebd6eeaa7",
8
4
  "patterns": [
9
5
  {
10
- "comment": "Empty line",
11
6
  "name": "meta.emptyline.papyrus",
12
7
  "match": "^\\s*$"
13
8
  },
@@ -88,133 +83,74 @@
88
83
  }
89
84
  ],
90
85
  "repository": {
91
- "endOfLine": {
86
+ "addExpression": {
92
87
  "patterns": [
93
88
  {
94
- "include": "#commentBlock"
95
- },
96
- {
97
- "include": "#commentLine"
98
- },
99
- {
100
- "include": "#whitespace"
101
- },
102
- {
103
- "include": "#multiline"
89
+ "name": "keyword.operator.papyrus",
90
+ "match": "(\\+|\\-)"
104
91
  },
105
92
  {
106
- "include": "#unmatched"
93
+ "include": "#multExpression"
107
94
  }
108
95
  ]
109
96
  },
110
- "comments": {
97
+ "andExpression": {
111
98
  "patterns": [
112
99
  {
113
- "include": "#commentBlock"
114
- },
115
- {
116
- "include": "#commentLine"
100
+ "name": "keyword.operator.papyrus",
101
+ "match": "\\\u0026\\\u0026"
117
102
  },
118
103
  {
119
- "include": "#commentDocumentation"
104
+ "include": "#boolExpression"
120
105
  }
121
106
  ]
122
107
  },
123
- "commentBlock": {
108
+ "arrayAtom": {
124
109
  "patterns": [
125
110
  {
126
- "comment": "Comment block",
127
- "name": "comment.block.papyrus",
128
- "begin": ";/",
129
- "end": "/;"
130
- }
131
- ]
132
- },
133
- "commentLine": {
134
- "patterns": [
111
+ "name": "meta.array.papyrus",
112
+ "begin": "\\[",
113
+ "end": "\\]",
114
+ "patterns": [
115
+ {
116
+ "include": "#expression"
117
+ }
118
+ ]
119
+ },
135
120
  {
136
- "comment": "Single line comment",
137
- "name": "comment.line.papyrus",
138
- "match": ";.*$"
121
+ "include": "#atom"
139
122
  }
140
123
  ]
141
124
  },
142
- "commentDocumentation": {
125
+ "arrayFuncOrId": {
143
126
  "patterns": [
144
127
  {
145
- "comment": "Documentation comment",
146
- "name": "comment.documentation.papyrus",
147
- "begin": "^\\s*\\{",
148
- "end": "\\}"
149
- }
150
- ]
151
- },
152
- "scriptHeader": {
153
- "patterns": [
128
+ "include": "#funcOrId"
129
+ },
154
130
  {
155
- "comment": "Scriptheader",
156
- "name": "meta.scriptheader.papyrus",
157
- "begin": "(?i)^\\s*(scriptname)\\s+",
158
- "beginCaptures": {
159
- "1": {
160
- "name": "keyword.other.papyrus"
161
- }
162
- },
163
- "end": "([\\n\\r])",
131
+ "name": "meta.arrayelement.papyrus",
132
+ "begin": "\\[",
133
+ "end": "\\]",
164
134
  "patterns": [
165
135
  {
166
- "comment": "Script parent declaration",
167
- "name": "keyword.other.papyrus",
168
- "match": "(?i)\\b(extends)\\b"
169
- },
170
- {
171
- "comment": "Script flags",
172
- "name": "keyword.other.papyrus",
173
- "match": "(?i)\\b(hidden|conditional)\\b"
174
- },
175
- {
176
- "include": "#illegalKeywords"
177
- },
178
- {
179
- "include": "#illegalSpecialVariables"
180
- },
181
- {
182
- "include": "#illegalBaseTypes"
183
- },
184
- {
185
- "include": "#typeIdentifier"
186
- },
187
- {
188
- "include": "#endOfLine"
136
+ "include": "#expression"
189
137
  }
190
138
  ]
191
139
  }
192
140
  ]
193
141
  },
194
- "import": {
142
+ "assign": {
195
143
  "patterns": [
196
144
  {
197
- "comment": "Import statement",
198
- "name": "meta.import.papyrus",
199
- "begin": "(?i)^\\s*(import)\\s+",
200
- "beginCaptures": {
201
- "1": {
202
- "name": "keyword.other.papyrus"
203
- }
204
- },
145
+ "name": "meta.assign.papyrus",
146
+ "begin": "^\\s*",
205
147
  "end": "([\\n\\r])",
206
148
  "patterns": [
207
149
  {
208
- "include": "#illegalKeywords"
209
- },
210
- {
211
- "include": "#illegalSpecialVariables"
212
- },
213
- {
214
- "include": "#illegalBaseTypes"
150
+ "include": "#assignmentOperators"
215
151
  },
216
152
  {
217
- "include": "#typeIdentifier"
153
+ "include": "#expression"
218
154
  },
219
155
  {
220
156
  "include": "#endOfLine"
@@ -223,431 +159,207 @@
223
159
  }
224
160
  ]
225
161
  },
226
- "state": {
162
+ "assignmentOperators": {
227
163
  "patterns": [
228
164
  {
229
- "comment": "State declaration",
230
- "name": "meta.state.papyrus",
231
- "begin": "(?i)^\\s*(?:(auto)\\s+)?(state)\\s+",
165
+ "name": "keyword.operator.papyrus",
166
+ "match": "(\\=|\\+\\=|\\-\\=|\\*\\=|\\/\\=|\\%\\=)"
167
+ }
168
+ ]
169
+ },
170
+ "atom": {
171
+ "patterns": [
172
+ {
173
+ "name": "meta.newarray.papyrus",
174
+ "begin": "(?i)\\b(new)\\s+([_a-z][0-9_a-z]*)\\[",
175
+ "end": "\\]",
176
+ "patterns": [
177
+ {
178
+ "include": "#integer"
179
+ }
180
+ ],
232
181
  "beginCaptures": {
233
182
  "1": {
234
- "name": "keyword.other.papyrus"
183
+ "name": "keyword.operator.papyrus"
235
184
  },
236
185
  "2": {
237
- "name": "keyword.other.papyrus"
186
+ "name": "storage.type.papyrus"
238
187
  }
239
- },
240
- "end": "([\\n\\r])",
188
+ }
189
+ },
190
+ {
191
+ "name": "meta.parenthesis.papyrus",
192
+ "begin": "\\(",
193
+ "end": "(\\)|[\\n\\r])",
241
194
  "patterns": [
242
195
  {
243
- "include": "#illegalKeywords"
244
- },
245
- {
246
- "include": "#illegalSpecialVariables"
247
- },
248
- {
249
- "include": "#illegalBaseTypes"
250
- },
251
- {
252
- "include": "#identifier"
253
- },
254
- {
255
- "include": "#endOfLine"
196
+ "include": "#expression"
256
197
  }
257
198
  ]
199
+ },
200
+ {
201
+ "include": "#funcOrId"
258
202
  }
259
203
  ]
260
204
  },
261
- "endState": {
205
+ "baseTypes": {
262
206
  "patterns": [
263
207
  {
264
- "comment": "EndState statement",
265
- "name": "meta.endstate.papyrus",
266
- "begin": "(?i)^\\s*(endstate)\\b",
267
- "beginCaptures": {
268
- "1": {
269
- "name": "keyword.other.papyrus"
270
- }
271
- },
272
- "end": "([\\n\\r])",
273
- "patterns": [
274
- {
275
- "include": "#endOfLine"
276
- }
277
- ]
208
+ "name": "storage.type.papyrus",
209
+ "match": "(?i)\\b(bool|float|int|string)\\b"
278
210
  }
279
211
  ]
280
212
  },
281
- "property": {
213
+ "bool": {
282
214
  "patterns": [
283
215
  {
284
- "comment": "Property declaration",
285
- "name": "meta.property.papyrus",
286
- "begin": "(?i)^\\s*([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+(property)\\s+",
287
- "beginCaptures": {
288
- "1": {
289
- "name": "storage.type.papyrus"
290
- },
291
- "2": {
292
- "name": "keyword.other.papyrus"
293
- }
294
- },
295
- "end": "([\\n\\r])",
296
- "patterns": [
297
- {
298
- "comment": "Assignment operator",
299
- "name": "keyword.operator.assignment.papyrus",
300
- "match": "(\\=)"
301
- },
302
- {
303
- "include": "#constants"
304
- },
305
- {
306
- "include": "#propertyFlags"
307
- },
308
- {
309
- "include": "#illegalKeywords"
310
- },
311
- {
312
- "include": "#illegalSpecialVariables"
313
- },
314
- {
315
- "include": "#illegalBaseTypes"
316
- },
317
- {
318
- "include": "#identifier"
319
- },
320
- {
321
- "include": "#endOfLine"
322
- }
323
- ]
216
+ "name": "constant.language.boolean.papyrus",
217
+ "match": "(?i)\\b(true|false|none)\\b"
324
218
  }
325
219
  ]
326
220
  },
327
- "propertyFlags": {
221
+ "boolExpression": {
328
222
  "patterns": [
329
223
  {
330
- "comment": "Property flags",
331
- "name": "keyword.other.papyrus",
332
- "match": "(?i)\\b(auto|autoreadonly|conditional|hidden)\\b"
224
+ "name": "keyword.operator.papyrus",
225
+ "match": "(\\=\\=|\\!\\=|\\\u003c\\=|\\\u003e\\=|\\\u003c|\\\u003e)"
226
+ },
227
+ {
228
+ "include": "#addExpression"
333
229
  }
334
230
  ]
335
231
  },
336
- "endProperty": {
232
+ "brackets": {
337
233
  "patterns": [
338
234
  {
339
- "comment": "EndProperty statement",
340
- "name": "meta.endproperty.papyrus",
341
- "begin": "(?i)^\\s*(endproperty)\\b",
342
- "beginCaptures": {
343
- "1": {
344
- "name": "keyword.other.papyrus"
345
- }
346
- },
347
- "end": "([\\n\\r])",
348
- "patterns": [
349
- {
350
- "include": "#endOfLine"
351
- }
352
- ]
235
+ "name": "meta.array.papyrus",
236
+ "match": "\\[\\]"
353
237
  }
354
238
  ]
355
239
  },
356
- "function": {
240
+ "castAtom": {
357
241
  "patterns": [
358
242
  {
359
- "comment": "Function declaration",
360
- "name": "meta.function.papyrus",
361
- "begin": "(?i)^\\s*(?:([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+)?(function)\\s+",
362
- "beginCaptures": {
243
+ "name": "meta.cast.papyrus",
244
+ "match": "(?i)\\b(as)\\s+([_a-z][0-9_a-z]*)\\b",
245
+ "captures": {
363
246
  "1": {
364
- "name": "storage.type.papyrus"
247
+ "name": "keyword.operator.papyrus"
365
248
  },
366
249
  "2": {
367
- "name": "keyword.control.functionstart.papyrus"
368
- },
369
- "3": {
370
- "name": "entity.name.function.papyrus"
250
+ "name": "storage.type.papyrus"
371
251
  }
372
- },
373
- "end": "([\\n\\r])",
374
- "patterns": [
375
- {
376
- "include": "#functionParameters"
377
- },
378
- {
379
- "include": "#functionFlags"
380
- },
381
- {
382
- "include": "#illegalKeywords"
383
- },
384
- {
385
- "include": "#illegalSpecialVariables"
386
- },
387
- {
388
- "include": "#illegalBaseTypes"
389
- },
390
- {
391
- "include": "#functionIdentifier"
392
- },
393
- {
394
- "include": "#endOfLine"
395
- }
396
- ]
397
- }
398
- ]
399
- },
400
- "functionParameters": {
401
- "patterns": [
402
- {
403
- "comment": "Function parameters",
404
- "name": "meta.functionparameters.papyrus",
405
- "begin": "\\(",
406
- "end": "\\)",
407
- "patterns": [
408
- {
409
- "comment": "Assignment operator",
410
- "name": "keyword.operator.assignment.papyrus",
411
- "match": "(\\=)"
412
- },
413
- {
414
- "include": "#constants"
415
- },
416
- {
417
- "include": "#illegalKeywords"
418
- },
419
- {
420
- "include": "#illegalSpecialVariables"
421
- },
422
- {
423
- "include": "#functionParameter"
424
- },
425
- {
426
- "include": "#comma"
427
- },
428
- {
429
- "include": "#multiline"
430
- },
431
- {
432
- "include": "#whitespace"
433
- },
434
- {
435
- "include": "#unmatched"
436
- }
437
- ]
438
- }
439
- ]
440
- },
441
- "functionParameter": {
442
- "patterns": [
443
- {
444
- "include": "#functionParameterIdentifier"
445
- },
446
- {
447
- "include": "#typeIdentifier"
252
+ }
448
253
  },
449
254
  {
450
- "include": "#brackets"
255
+ "include": "#dotAtom"
451
256
  }
452
257
  ]
453
258
  },
454
- "functionParameterIdentifier": {
259
+ "comma": {
455
260
  "patterns": [
456
261
  {
457
- "comment": "Event parameter identifier",
458
- "name": "variable.parameter.papyrus",
459
- "match": "(?i)\\b([_a-z][0-9_a-z]*)\\s*(?=(\\,|\\)|\\=))"
262
+ "name": "meta.comma.papyrus",
263
+ "match": "\\,"
460
264
  }
461
265
  ]
462
266
  },
463
- "functionFlags": {
267
+ "commentBlock": {
464
268
  "patterns": [
465
269
  {
466
- "comment": "Function flags",
467
- "name": "keyword.other.papyrus",
468
- "match": "(?i)\\b(native|global)\\b"
270
+ "name": "comment.block.papyrus",
271
+ "begin": ";/",
272
+ "end": "/;"
469
273
  }
470
274
  ]
471
275
  },
472
- "endFunction": {
276
+ "commentDocumentation": {
473
277
  "patterns": [
474
278
  {
475
- "comment": "EndFunction statement",
476
- "name": "meta.endfunction.papyrus",
477
- "begin": "(?i)^\\s*(endfunction)\\b",
478
- "beginCaptures": {
479
- "1": {
480
- "name": "keyword.other.papyrus"
481
- }
482
- },
483
- "end": "([\\n\\r])",
484
- "patterns": [
485
- {
486
- "include": "#endOfLine"
487
- }
488
- ]
279
+ "name": "comment.documentation.papyrus",
280
+ "begin": "^\\s*\\{",
281
+ "end": "\\}"
489
282
  }
490
283
  ]
491
284
  },
492
- "event": {
285
+ "commentLine": {
493
286
  "patterns": [
494
287
  {
495
- "comment": "Event declaration",
496
- "name": "meta.event.papyrus",
497
- "begin": "(?i)^\\s*(event)\\s+",
498
- "beginCaptures": {
499
- "1": {
500
- "name": "keyword.control.eventstart.papyrus"
501
- },
502
- "2": {
503
- "name": "entity.name.function.papyrus"
504
- }
505
- },
506
- "end": "([\\n\\r])",
507
- "patterns": [
508
- {
509
- "include": "#eventParameters"
510
- },
511
- {
512
- "include": "#eventFlags"
513
- },
514
- {
515
- "include": "#illegalKeywords"
516
- },
517
- {
518
- "include": "#illegalSpecialVariables"
519
- },
520
- {
521
- "include": "#illegalBaseTypes"
522
- },
523
- {
524
- "include": "#functionIdentifier"
525
- },
526
- {
527
- "include": "#endOfLine"
528
- }
529
- ]
288
+ "name": "comment.line.papyrus",
289
+ "match": ";.*$"
530
290
  }
531
291
  ]
532
292
  },
533
- "eventParameters": {
293
+ "comments": {
534
294
  "patterns": [
535
295
  {
536
- "comment": "Event parameters",
537
- "name": "meta.eventparameters.papyrus",
538
- "begin": "\\(",
539
- "end": "\\)",
540
- "patterns": [
541
- {
542
- "include": "#illegalKeywords"
543
- },
544
- {
545
- "include": "#illegalSpecialVariables"
546
- },
547
- {
548
- "include": "#eventParameter"
549
- },
550
- {
551
- "include": "#comma"
552
- },
553
- {
554
- "include": "#multiline"
555
- },
556
- {
557
- "include": "#whitespace"
558
- },
559
- {
560
- "include": "#unmatched"
561
- }
562
- ]
296
+ "include": "#commentBlock"
297
+ },
298
+ {
299
+ "include": "#commentLine"
300
+ },
301
+ {
302
+ "include": "#commentDocumentation"
563
303
  }
564
304
  ]
565
305
  },
566
- "eventParameter": {
306
+ "constants": {
567
307
  "patterns": [
568
308
  {
569
- "include": "#eventParameterIdentifier"
309
+ "include": "#bool"
570
310
  },
571
311
  {
572
- "include": "#typeIdentifier"
312
+ "include": "#float"
573
313
  },
574
314
  {
575
- "include": "#brackets"
576
- }
577
- ]
578
- },
579
- "eventParameterIdentifier": {
580
- "patterns": [
315
+ "include": "#integer"
316
+ },
581
317
  {
582
- "comment": "Event parameter identifier",
583
- "name": "variable.parameter.papyrus",
584
- "match": "(?i)\\b([_a-z][0-9_a-z]*)\\s*(?=(\\,|\\)))"
318
+ "include": "#string"
585
319
  }
586
320
  ]
587
321
  },
588
- "eventFlags": {
322
+ "dotAtom": {
589
323
  "patterns": [
590
324
  {
591
- "comment": "Event flags",
592
- "name": "keyword.other.papyrus",
593
- "match": "(?i)(?<=\\))\\s*(native)\\b"
325
+ "name": "keyword.operator.papyrus",
326
+ "match": "\\."
327
+ },
328
+ {
329
+ "include": "#constants"
330
+ },
331
+ {
332
+ "include": "#arrayAtom"
333
+ },
334
+ {
335
+ "include": "#arrayFuncOrId"
594
336
  }
595
337
  ]
596
338
  },
597
- "endEvent": {
339
+ "else": {
598
340
  "patterns": [
599
341
  {
600
- "comment": "EndEvent statement",
601
- "name": "meta.endevent.papyrus",
602
- "begin": "(?i)^\\s*(endevent)\\b",
603
- "beginCaptures": {
604
- "1": {
605
- "name": "keyword.other.papyrus"
606
- }
607
- },
342
+ "name": "meta.else.papyrus",
343
+ "begin": "(?i)^\\s*(else)\\b",
608
344
  "end": "([\\n\\r])",
609
345
  "patterns": [
610
346
  {
611
347
  "include": "#endOfLine"
612
348
  }
613
- ]
614
- }
615
- ]
616
- },
617
- "return": {
618
- "patterns": [
619
- {
620
- "comment": "Return statements",
621
- "name": "meta.return.papyrus",
622
- "begin": "(?i)^\\s*(return)\\b",
349
+ ],
623
350
  "beginCaptures": {
624
351
  "1": {
625
352
  "name": "keyword.other.papyrus"
626
353
  }
627
- },
628
- "end": "([\\n\\r])",
629
- "patterns": [
630
- {
631
- "include": "#expression"
632
- },
633
- {
634
- "include": "#endOfLine"
635
- }
636
- ]
354
+ }
637
355
  }
638
356
  ]
639
357
  },
640
- "if": {
358
+ "elseif": {
641
359
  "patterns": [
642
360
  {
643
- "comment": "If statement",
644
- "name": "meta.if.papyrus",
645
- "begin": "(?i)^\\s*(if)\\b",
646
- "beginCaptures": {
647
- "1": {
648
- "name": "keyword.other.papyrus"
649
- }
650
- },
361
+ "name": "meta.elseif.papyrus",
362
+ "begin": "(?i)^\\s*(elseif)\\b",
651
363
  "end": "([\\n\\r])",
652
364
  "patterns": [
653
365
  {
@@ -656,588 +368,778 @@
656
368
  {
657
369
  "include": "#endOfLine"
658
370
  }
659
- ]
371
+ ],
372
+ "beginCaptures": {
373
+ "1": {
374
+ "name": "keyword.other.papyrus"
375
+ }
376
+ }
660
377
  }
661
378
  ]
662
379
  },
663
- "elseif": {
380
+ "endEvent": {
664
381
  "patterns": [
665
382
  {
666
- "comment": "ElseIf statement",
667
- "name": "meta.elseif.papyrus",
668
- "begin": "(?i)^\\s*(elseif)\\b",
669
- "beginCaptures": {
670
- "1": {
671
- "name": "keyword.other.papyrus"
672
- }
673
- },
383
+ "name": "meta.endevent.papyrus",
384
+ "begin": "(?i)^\\s*(endevent)\\b",
674
385
  "end": "([\\n\\r])",
675
386
  "patterns": [
676
- {
677
- "include": "#expression"
678
- },
679
387
  {
680
388
  "include": "#endOfLine"
681
389
  }
682
- ]
390
+ ],
391
+ "beginCaptures": {
392
+ "1": {
393
+ "name": "keyword.other.papyrus"
394
+ }
395
+ }
683
396
  }
684
397
  ]
685
398
  },
686
- "else": {
399
+ "endFunction": {
687
400
  "patterns": [
688
401
  {
689
- "comment": "Else statement",
690
- "name": "meta.else.papyrus",
691
- "begin": "(?i)^\\s*(else)\\b",
692
- "beginCaptures": {
693
- "1": {
694
- "name": "keyword.other.papyrus"
695
- }
696
- },
402
+ "name": "meta.endfunction.papyrus",
403
+ "begin": "(?i)^\\s*(endfunction)\\b",
697
404
  "end": "([\\n\\r])",
698
405
  "patterns": [
699
406
  {
700
407
  "include": "#endOfLine"
701
408
  }
702
- ]
409
+ ],
410
+ "beginCaptures": {
411
+ "1": {
412
+ "name": "keyword.other.papyrus"
413
+ }
414
+ }
703
415
  }
704
416
  ]
705
417
  },
706
418
  "endIf": {
707
419
  "patterns": [
708
420
  {
709
- "comment": "EndIf statement",
710
421
  "name": "meta.endif.papyrus",
711
422
  "begin": "(?i)^\\s*(endif)\\b",
712
- "beginCaptures": {
713
- "1": {
714
- "name": "keyword.other.papyrus"
715
- }
716
- },
717
423
  "end": "([\\n\\r])",
718
424
  "patterns": [
719
425
  {
720
426
  "include": "#endOfLine"
721
427
  }
722
- ]
428
+ ],
429
+ "beginCaptures": {
430
+ "1": {
431
+ "name": "keyword.other.papyrus"
432
+ }
433
+ }
723
434
  }
724
435
  ]
725
436
  },
726
- "while": {
437
+ "endOfLine": {
727
438
  "patterns": [
728
439
  {
729
- "comment": "While statement",
730
- "name": "meta.while.papyrus",
731
- "begin": "(?i)^\\s*(while)\\b",
440
+ "include": "#commentBlock"
441
+ },
442
+ {
443
+ "include": "#commentLine"
444
+ },
445
+ {
446
+ "include": "#whitespace"
447
+ },
448
+ {
449
+ "include": "#multiline"
450
+ },
451
+ {
452
+ "include": "#unmatched"
453
+ }
454
+ ]
455
+ },
456
+ "endProperty": {
457
+ "patterns": [
458
+ {
459
+ "name": "meta.endproperty.papyrus",
460
+ "begin": "(?i)^\\s*(endproperty)\\b",
461
+ "end": "([\\n\\r])",
462
+ "patterns": [
463
+ {
464
+ "include": "#endOfLine"
465
+ }
466
+ ],
732
467
  "beginCaptures": {
733
468
  "1": {
734
469
  "name": "keyword.other.papyrus"
735
470
  }
736
- },
471
+ }
472
+ }
473
+ ]
474
+ },
475
+ "endState": {
476
+ "patterns": [
477
+ {
478
+ "name": "meta.endstate.papyrus",
479
+ "begin": "(?i)^\\s*(endstate)\\b",
737
480
  "end": "([\\n\\r])",
738
481
  "patterns": [
739
- {
740
- "include": "#expression"
741
- },
742
482
  {
743
483
  "include": "#endOfLine"
744
484
  }
745
- ]
485
+ ],
486
+ "beginCaptures": {
487
+ "1": {
488
+ "name": "keyword.other.papyrus"
489
+ }
490
+ }
746
491
  }
747
492
  ]
748
493
  },
749
494
  "endWhile": {
750
495
  "patterns": [
751
496
  {
752
- "comment": "EndWhile statement",
753
497
  "name": "meta.endwhile.papyrus",
754
498
  "begin": "(?i)^\\s*(endwhile)\\b",
755
- "beginCaptures": {
756
- "1": {
757
- "name": "keyword.other.papyrus"
758
- }
759
- },
760
499
  "end": "([\\n\\r])",
761
500
  "patterns": [
762
501
  {
763
502
  "include": "#endOfLine"
764
503
  }
765
- ]
504
+ ],
505
+ "beginCaptures": {
506
+ "1": {
507
+ "name": "keyword.other.papyrus"
508
+ }
509
+ }
766
510
  }
767
511
  ]
768
512
  },
769
- "variable": {
513
+ "event": {
770
514
  "patterns": [
771
515
  {
772
- "comment": "Variable declaration with a default value",
773
- "name": "meta.variable.papyrus",
774
- "begin": "(?i)^\\s*([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+([_a-z][0-9_a-z]*)(?:\\s*(\\=)\\s*)",
775
- "beginCaptures": {
776
- "1": {
777
- "name": "storage.type.papyrus"
778
- },
779
- "2": {
780
- "name": "variable.other.papyrus"
781
- },
782
- "3": {
783
- "name": "keyword.operator.papyrus"
784
- }
785
- },
516
+ "name": "meta.event.papyrus",
517
+ "begin": "(?i)^\\s*(event)\\s+",
786
518
  "end": "([\\n\\r])",
787
519
  "patterns": [
788
520
  {
789
- "include": "#constants"
521
+ "include": "#eventParameters"
790
522
  },
791
523
  {
792
- "name": "keyword.other.papyrus",
793
- "match": "(?i)(?:\\b(conditional)\\b)"
524
+ "include": "#eventFlags"
794
525
  },
795
526
  {
796
- "include": "#expression"
527
+ "include": "#illegalKeywords"
528
+ },
529
+ {
530
+ "include": "#illegalSpecialVariables"
531
+ },
532
+ {
533
+ "include": "#illegalBaseTypes"
534
+ },
535
+ {
536
+ "include": "#functionIdentifier"
797
537
  },
798
538
  {
799
539
  "include": "#endOfLine"
800
540
  }
801
- ]
802
- },
803
- {
804
- "comment": "Scriptwide variable declaration without a default value",
805
- "name": "meta.variable.papyrus",
806
- "begin": "(?i)^\\s*([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+([_a-z][0-9_a-z]*)(?:\\s+(conditional)\\b)?",
541
+ ],
807
542
  "beginCaptures": {
808
543
  "1": {
809
- "name": "storage.type.papyrus"
544
+ "name": "keyword.control.eventstart.papyrus"
810
545
  },
811
546
  "2": {
812
- "name": "variable.other.papyrus"
813
- },
814
- "3": {
815
- "name": "keyword.other.papyrus"
816
- }
817
- },
818
- "end": "([\\n\\r])",
819
- "patterns": [
820
- {
821
- "include": "#endOfLine"
547
+ "name": "entity.name.function.papyrus"
822
548
  }
823
- ]
549
+ }
824
550
  }
825
551
  ]
826
552
  },
827
- "expression": {
553
+ "eventFlags": {
828
554
  "patterns": [
829
555
  {
830
- "comment": "OR",
831
- "name": "keyword.operator.papyrus",
832
- "match": "\\|\\|"
833
- },
834
- {
835
- "include": "#andExpression"
836
- },
837
- {
838
- "include": "#endOfLine"
556
+ "name": "keyword.other.papyrus",
557
+ "match": "(?i)(?\u003c=\\))\\s*(native)\\b"
839
558
  }
840
559
  ]
841
560
  },
842
- "andExpression": {
561
+ "eventParameter": {
843
562
  "patterns": [
844
563
  {
845
- "comment": "AND",
846
- "name": "keyword.operator.papyrus",
847
- "match": "\\&\\&"
564
+ "include": "#eventParameterIdentifier"
848
565
  },
849
566
  {
850
- "include": "#boolExpression"
567
+ "include": "#typeIdentifier"
568
+ },
569
+ {
570
+ "include": "#brackets"
851
571
  }
852
572
  ]
853
573
  },
854
- "boolExpression": {
574
+ "eventParameterIdentifier": {
855
575
  "patterns": [
856
576
  {
857
- "comment": "Comparison operators",
858
- "name": "keyword.operator.papyrus",
859
- "match": "(\\=\\=|\\!\\=|\\<\\=|\\>\\=|\\<|\\>)"
860
- },
861
- {
862
- "include": "#addExpression"
577
+ "name": "variable.parameter.papyrus",
578
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)\\s*(?=(\\,|\\)))"
863
579
  }
864
580
  ]
865
581
  },
866
- "addExpression": {
582
+ "eventParameters": {
867
583
  "patterns": [
868
584
  {
869
- "comment": "Addition or subtraction",
870
- "name": "keyword.operator.papyrus",
871
- "match": "(\\+|\\-)"
872
- },
873
- {
874
- "include": "#multExpression"
585
+ "name": "meta.eventparameters.papyrus",
586
+ "begin": "\\(",
587
+ "end": "\\)",
588
+ "patterns": [
589
+ {
590
+ "include": "#illegalKeywords"
591
+ },
592
+ {
593
+ "include": "#illegalSpecialVariables"
594
+ },
595
+ {
596
+ "include": "#eventParameter"
597
+ },
598
+ {
599
+ "include": "#comma"
600
+ },
601
+ {
602
+ "include": "#multiline"
603
+ },
604
+ {
605
+ "include": "#whitespace"
606
+ },
607
+ {
608
+ "include": "#unmatched"
609
+ }
610
+ ]
875
611
  }
876
612
  ]
877
613
  },
878
- "multExpression": {
614
+ "expression": {
879
615
  "patterns": [
880
616
  {
881
- "comment": "Multiplication, division, or modulus",
882
617
  "name": "keyword.operator.papyrus",
883
- "match": "(\\*|/|\\%)"
618
+ "match": "\\|\\|"
884
619
  },
885
620
  {
886
- "include": "#unaryExpression"
621
+ "include": "#andExpression"
622
+ },
623
+ {
624
+ "include": "#endOfLine"
887
625
  }
888
626
  ]
889
627
  },
890
- "unaryExpression": {
628
+ "float": {
891
629
  "patterns": [
892
630
  {
893
- "comment": "Unary minus or NOT",
894
- "name": "keyword.operator.papyrus",
895
- "match": "(\\-|\\!)"
631
+ "include": "#unaryMinus"
896
632
  },
897
633
  {
898
- "include": "#castAtom"
634
+ "name": "constant.numeric.float.papyrus",
635
+ "match": "\\b(\\d+\\.\\d+)\\b"
899
636
  }
900
637
  ]
901
638
  },
902
- "castAtom": {
639
+ "funcOrId": {
903
640
  "patterns": [
904
641
  {
905
- "comment": "Cast",
906
- "name": "meta.cast.papyrus",
907
- "match": "(?i)\\b(as)\\s+([_a-z][0-9_a-z]*)\\b",
908
- "captures": {
909
- "1": {
910
- "name": "keyword.operator.papyrus"
911
- },
912
- "2": {
913
- "name": "storage.type.papyrus"
914
- }
915
- }
642
+ "name": "keyword.other.papyrus",
643
+ "match": "(?i)\\b(length)\\b"
916
644
  },
917
645
  {
918
- "include": "#dotAtom"
919
- }
920
- ]
921
- },
922
- "dotAtom": {
923
- "patterns": [
646
+ "include": "#functionCall"
647
+ },
924
648
  {
925
- "comment": "Dot",
926
- "name": "keyword.operator.papyrus",
927
- "match": "\\."
649
+ "include": "#illegalKeywords"
928
650
  },
929
651
  {
930
- "include": "#constants"
652
+ "include": "#illegalBaseTypes"
931
653
  },
932
654
  {
933
- "include": "#arrayAtom"
655
+ "include": "#specialVariables"
934
656
  },
935
657
  {
936
- "include": "#arrayFuncOrId"
658
+ "include": "#identifier"
937
659
  }
938
660
  ]
939
661
  },
940
- "arrayAtom": {
662
+ "function": {
941
663
  "patterns": [
942
664
  {
943
- "comment": "Array",
944
- "name": "meta.array.papyrus",
945
- "begin": "\\[",
946
- "end": "\\]",
665
+ "name": "meta.function.papyrus",
666
+ "begin": "(?i)^\\s*(?:([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+)?(function)\\s+",
667
+ "end": "([\\n\\r])",
947
668
  "patterns": [
948
669
  {
949
- "include": "#expression"
670
+ "include": "#functionParameters"
671
+ },
672
+ {
673
+ "include": "#functionFlags"
674
+ },
675
+ {
676
+ "include": "#illegalKeywords"
677
+ },
678
+ {
679
+ "include": "#illegalSpecialVariables"
680
+ },
681
+ {
682
+ "include": "#illegalBaseTypes"
683
+ },
684
+ {
685
+ "include": "#functionIdentifier"
686
+ },
687
+ {
688
+ "include": "#endOfLine"
950
689
  }
951
- ]
952
- },
953
- {
954
- "include": "#atom"
690
+ ],
691
+ "beginCaptures": {
692
+ "1": {
693
+ "name": "storage.type.papyrus"
694
+ },
695
+ "2": {
696
+ "name": "keyword.control.functionstart.papyrus"
697
+ },
698
+ "3": {
699
+ "name": "entity.name.function.papyrus"
700
+ }
701
+ }
955
702
  }
956
703
  ]
957
704
  },
958
- "atom": {
705
+ "functionCall": {
959
706
  "patterns": [
960
707
  {
961
- "comment": "New array",
962
- "name": "meta.newarray.papyrus",
963
- "begin": "(?i)\\b(new)\\s+([_a-z][0-9_a-z]*)\\[",
708
+ "name": "meta.functioncall.papyrus",
709
+ "begin": "(?i)\\b([_a-z][0-9_a-z]*)\\(",
710
+ "end": "\\)",
711
+ "patterns": [
712
+ {
713
+ "include": "#functionCallParameters"
714
+ }
715
+ ],
964
716
  "beginCaptures": {
965
717
  "1": {
966
- "name": "keyword.operator.papyrus"
967
- },
968
- "2": {
969
- "name": "storage.type.papyrus"
718
+ "name": "variable.other.papyrus"
970
719
  }
971
- },
972
- "end": "\\]",
973
- "patterns": [
974
- {
975
- "include": "#integer"
720
+ }
721
+ }
722
+ ]
723
+ },
724
+ "functionCallParameter": {
725
+ "patterns": [
726
+ {
727
+ "name": "meta.functioncallparameter.papyrus",
728
+ "match": "(?i)\\b(?:([_a-z][0-9_a-z]*)\\s*(\\=)(?!\\=))?",
729
+ "captures": {
730
+ "1": {
731
+ "name": "variable.parameter.papyrus"
732
+ },
733
+ "2": {
734
+ "name": "keyword.operator.papyrus"
976
735
  }
977
- ]
736
+ }
978
737
  },
979
738
  {
980
- "comment": "Parenthesis",
981
- "name": "meta.parenthesis.papyrus",
982
- "begin": "\\(",
983
- "end": "(\\)|[\\n\\r])",
984
- "patterns": [
985
- {
986
- "include": "#expression"
987
- }
988
- ]
739
+ "include": "#expression"
740
+ }
741
+ ]
742
+ },
743
+ "functionCallParameters": {
744
+ "patterns": [
745
+ {
746
+ "include": "#comma"
989
747
  },
990
748
  {
991
- "include": "#funcOrId"
749
+ "include": "#functionCallParameter"
992
750
  }
993
751
  ]
994
752
  },
995
- "funcOrId": {
753
+ "functionFlags": {
996
754
  "patterns": [
997
755
  {
998
- "comment": "Length",
999
756
  "name": "keyword.other.papyrus",
1000
- "match": "(?i)\\b(length)\\b"
1001
- },
757
+ "match": "(?i)\\b(native|global)\\b"
758
+ }
759
+ ]
760
+ },
761
+ "functionIdentifier": {
762
+ "patterns": [
1002
763
  {
1003
- "include": "#functionCall"
1004
- },
764
+ "name": "entity.name.function.papyrus",
765
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)\\s*(?=\\()"
766
+ }
767
+ ]
768
+ },
769
+ "functionParameter": {
770
+ "patterns": [
1005
771
  {
1006
- "include": "#illegalKeywords"
772
+ "include": "#functionParameterIdentifier"
1007
773
  },
1008
774
  {
1009
- "include": "#illegalBaseTypes"
775
+ "include": "#typeIdentifier"
1010
776
  },
1011
777
  {
1012
- "include": "#specialVariables"
1013
- },
778
+ "include": "#brackets"
779
+ }
780
+ ]
781
+ },
782
+ "functionParameterIdentifier": {
783
+ "patterns": [
1014
784
  {
1015
- "include": "#identifier"
785
+ "name": "variable.parameter.papyrus",
786
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)\\s*(?=(\\,|\\)|\\=))"
1016
787
  }
1017
788
  ]
1018
789
  },
1019
- "functionCall": {
790
+ "functionParameters": {
1020
791
  "patterns": [
1021
792
  {
1022
- "comment": "Function call",
1023
- "name": "meta.functioncall.papyrus",
1024
- "begin": "(?i)\\b([_a-z][0-9_a-z]*)\\(",
1025
- "beginCaptures": {
1026
- "1": {
1027
- "name": "variable.other.papyrus"
1028
- }
1029
- },
793
+ "name": "meta.functionparameters.papyrus",
794
+ "begin": "\\(",
1030
795
  "end": "\\)",
1031
796
  "patterns": [
1032
797
  {
1033
- "include": "#functionCallParameters"
798
+ "name": "keyword.operator.assignment.papyrus",
799
+ "match": "(\\=)"
800
+ },
801
+ {
802
+ "include": "#constants"
803
+ },
804
+ {
805
+ "include": "#illegalKeywords"
806
+ },
807
+ {
808
+ "include": "#illegalSpecialVariables"
809
+ },
810
+ {
811
+ "include": "#functionParameter"
812
+ },
813
+ {
814
+ "include": "#comma"
815
+ },
816
+ {
817
+ "include": "#multiline"
818
+ },
819
+ {
820
+ "include": "#whitespace"
821
+ },
822
+ {
823
+ "include": "#unmatched"
1034
824
  }
1035
825
  ]
1036
826
  }
1037
827
  ]
1038
828
  },
1039
- "functionCallParameters": {
829
+ "identifier": {
1040
830
  "patterns": [
1041
831
  {
1042
- "include": "#comma"
1043
- },
1044
- {
1045
- "include": "#functionCallParameter"
832
+ "name": "variable.other.papyrus",
833
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)\\b"
1046
834
  }
1047
835
  ]
1048
836
  },
1049
- "functionCallParameter": {
837
+ "if": {
1050
838
  "patterns": [
1051
839
  {
1052
- "comment": "Specific parameter",
1053
- "name": "meta.functioncallparameter.papyrus",
1054
- "match": "(?i)\\b(?:([_a-z][0-9_a-z]*)\\s*(\\=)(?!\\=))?",
1055
- "captures": {
1056
- "1": {
1057
- "name": "variable.parameter.papyrus"
840
+ "name": "meta.if.papyrus",
841
+ "begin": "(?i)^\\s*(if)\\b",
842
+ "end": "([\\n\\r])",
843
+ "patterns": [
844
+ {
845
+ "include": "#expression"
1058
846
  },
1059
- "2": {
1060
- "name": "keyword.operator.papyrus"
847
+ {
848
+ "include": "#endOfLine"
849
+ }
850
+ ],
851
+ "beginCaptures": {
852
+ "1": {
853
+ "name": "keyword.other.papyrus"
1061
854
  }
1062
855
  }
1063
- },
856
+ }
857
+ ]
858
+ },
859
+ "illegalBaseTypes": {
860
+ "patterns": [
1064
861
  {
1065
- "include": "#expression"
862
+ "name": "meta.invalid.papyrus",
863
+ "match": "(?i)\\b(bool|float|int|string)\\b"
1066
864
  }
1067
865
  ]
1068
866
  },
1069
- "arrayFuncOrId": {
867
+ "illegalKeywords": {
1070
868
  "patterns": [
1071
869
  {
1072
- "include": "#funcOrId"
1073
- },
870
+ "name": "meta.invalid.papyrus",
871
+ "match": "(?i)\\b(as|auto|autoreadonly|else|elseif|endevent|endfunction|endif|endproperty|endstate|endwhile|event|extends|false|function|global|if|import|length|native|new|none|property|return|scriptname|state|true|while)\\b"
872
+ }
873
+ ]
874
+ },
875
+ "illegalSpecialVariables": {
876
+ "patterns": [
1074
877
  {
1075
- "comment": "Array element access",
1076
- "name": "meta.arrayelement.papyrus",
1077
- "begin": "\\[",
1078
- "end": "\\]",
1079
- "patterns": [
1080
- {
1081
- "include": "#expression"
1082
- }
1083
- ]
878
+ "name": "meta.invalid.papyrus",
879
+ "match": "(?i)\\b(parent|self)\\b"
1084
880
  }
1085
881
  ]
1086
882
  },
1087
- "assign": {
883
+ "import": {
1088
884
  "patterns": [
1089
885
  {
1090
- "comment": "Assign statement",
1091
- "name": "meta.assign.papyrus",
1092
- "begin": "^\\s*",
886
+ "name": "meta.import.papyrus",
887
+ "begin": "(?i)^\\s*(import)\\s+",
1093
888
  "end": "([\\n\\r])",
1094
889
  "patterns": [
1095
890
  {
1096
- "include": "#assignmentOperators"
891
+ "include": "#illegalKeywords"
1097
892
  },
1098
893
  {
1099
- "include": "#expression"
894
+ "include": "#illegalSpecialVariables"
895
+ },
896
+ {
897
+ "include": "#illegalBaseTypes"
898
+ },
899
+ {
900
+ "include": "#typeIdentifier"
1100
901
  },
1101
902
  {
1102
903
  "include": "#endOfLine"
1103
904
  }
1104
- ]
905
+ ],
906
+ "beginCaptures": {
907
+ "1": {
908
+ "name": "keyword.other.papyrus"
909
+ }
910
+ }
1105
911
  }
1106
912
  ]
1107
913
  },
1108
- "assignmentOperators": {
914
+ "integer": {
1109
915
  "patterns": [
1110
916
  {
1111
- "comment": "Assignment operators",
1112
- "name": "keyword.operator.papyrus",
1113
- "match": "(\\=|\\+\\=|\\-\\=|\\*\\=|\\/\\=|\\%\\=)"
917
+ "include": "#unaryMinus"
918
+ },
919
+ {
920
+ "name": "constant.numeric.integer.papyrus",
921
+ "match": "(?i)\\b(0x[0-9a-f]+|\\d+)\\b"
1114
922
  }
1115
923
  ]
1116
924
  },
1117
- "comma": {
925
+ "keywords": {
1118
926
  "patterns": [
1119
927
  {
1120
- "comment": "Comma",
1121
- "name": "meta.comma.papyrus",
1122
- "match": "\\,"
928
+ "name": "keyword.other.papyrus",
929
+ "match": "(?i)\\b(as|auto|autoreadonly|else|elseif|endevent|endfunction|endif|endproperty|endstate|endwhile|event|extends|false|function|global|if|import|length|native|new|none|property|return|scriptname|state|true|while)\\b"
1123
930
  }
1124
931
  ]
1125
932
  },
1126
- "whitespace": {
933
+ "multExpression": {
1127
934
  "patterns": [
1128
935
  {
1129
- "comment": "Whitespace",
1130
- "name": "meta.whitespace.papyrus",
1131
- "match": "([ \\t])"
936
+ "name": "keyword.operator.papyrus",
937
+ "match": "(\\*|/|\\%)"
938
+ },
939
+ {
940
+ "include": "#unaryExpression"
1132
941
  }
1133
942
  ]
1134
943
  },
1135
944
  "multiline": {
1136
945
  "patterns": [
1137
946
  {
1138
- "comment": "Multiline",
1139
947
  "name": "meta.multiline.papyrus",
1140
948
  "begin": "\\\\",
949
+ "end": "([\\n\\r])",
950
+ "patterns": [
951
+ {
952
+ "include": "#commentBlock"
953
+ },
954
+ {
955
+ "include": "#commentLine"
956
+ },
957
+ {
958
+ "include": "#whitespace"
959
+ },
960
+ {
961
+ "include": "#unmatched"
962
+ }
963
+ ],
1141
964
  "beginCaptures": {
1142
965
  "0": {
1143
966
  "name": "keyword.operator.papyrus"
1144
967
  }
1145
- },
968
+ }
969
+ }
970
+ ]
971
+ },
972
+ "parameterIdentifier": {
973
+ "patterns": [
974
+ {
975
+ "name": "variable.parameter.papyrus",
976
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)\\b"
977
+ }
978
+ ]
979
+ },
980
+ "property": {
981
+ "patterns": [
982
+ {
983
+ "name": "meta.property.papyrus",
984
+ "begin": "(?i)^\\s*([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+(property)\\s+",
1146
985
  "end": "([\\n\\r])",
1147
986
  "patterns": [
1148
987
  {
1149
- "include": "#commentBlock"
988
+ "name": "keyword.operator.assignment.papyrus",
989
+ "match": "(\\=)"
1150
990
  },
1151
991
  {
1152
- "include": "#commentLine"
992
+ "include": "#constants"
1153
993
  },
1154
994
  {
1155
- "include": "#whitespace"
995
+ "include": "#propertyFlags"
996
+ },
997
+ {
998
+ "include": "#illegalKeywords"
999
+ },
1000
+ {
1001
+ "include": "#illegalSpecialVariables"
1002
+ },
1003
+ {
1004
+ "include": "#illegalBaseTypes"
1005
+ },
1006
+ {
1007
+ "include": "#identifier"
1008
+ },
1009
+ {
1010
+ "include": "#endOfLine"
1011
+ }
1012
+ ],
1013
+ "beginCaptures": {
1014
+ "1": {
1015
+ "name": "storage.type.papyrus"
1156
1016
  },
1157
- {
1158
- "include": "#unmatched"
1017
+ "2": {
1018
+ "name": "keyword.other.papyrus"
1159
1019
  }
1160
- ]
1161
- }
1162
- ]
1163
- },
1164
- "unmatched": {
1165
- "patterns": [
1166
- {
1167
- "comment": "Unmatched",
1168
- "name": "meta.invalid.papyrus",
1169
- "match": "([^\\n\\r])"
1020
+ }
1170
1021
  }
1171
1022
  ]
1172
1023
  },
1173
- "unaryMinus": {
1024
+ "propertyFlags": {
1174
1025
  "patterns": [
1175
1026
  {
1176
- "comment": "Unary minus",
1177
- "name": "keyword.operator.papyrus",
1178
- "match": "\\-(?=\\d)"
1027
+ "name": "keyword.other.papyrus",
1028
+ "match": "(?i)\\b(auto|autoreadonly|conditional|hidden)\\b"
1179
1029
  }
1180
1030
  ]
1181
1031
  },
1182
- "constants": {
1032
+ "return": {
1183
1033
  "patterns": [
1184
1034
  {
1185
- "include": "#bool"
1186
- },
1187
- {
1188
- "include": "#float"
1189
- },
1190
- {
1191
- "include": "#integer"
1192
- },
1193
- {
1194
- "include": "#string"
1035
+ "name": "meta.return.papyrus",
1036
+ "begin": "(?i)^\\s*(return)\\b",
1037
+ "end": "([\\n\\r])",
1038
+ "patterns": [
1039
+ {
1040
+ "include": "#expression"
1041
+ },
1042
+ {
1043
+ "include": "#endOfLine"
1044
+ }
1045
+ ],
1046
+ "beginCaptures": {
1047
+ "1": {
1048
+ "name": "keyword.other.papyrus"
1049
+ }
1050
+ }
1195
1051
  }
1196
1052
  ]
1197
1053
  },
1198
- "bool": {
1054
+ "scriptHeader": {
1199
1055
  "patterns": [
1200
1056
  {
1201
- "comment": "Boolean literal",
1202
- "name": "constant.language.boolean.papyrus",
1203
- "match": "(?i)\\b(true|false|none)\\b"
1057
+ "name": "meta.scriptheader.papyrus",
1058
+ "begin": "(?i)^\\s*(scriptname)\\s+",
1059
+ "end": "([\\n\\r])",
1060
+ "patterns": [
1061
+ {
1062
+ "name": "keyword.other.papyrus",
1063
+ "match": "(?i)\\b(extends)\\b"
1064
+ },
1065
+ {
1066
+ "name": "keyword.other.papyrus",
1067
+ "match": "(?i)\\b(hidden|conditional)\\b"
1068
+ },
1069
+ {
1070
+ "include": "#illegalKeywords"
1071
+ },
1072
+ {
1073
+ "include": "#illegalSpecialVariables"
1074
+ },
1075
+ {
1076
+ "include": "#illegalBaseTypes"
1077
+ },
1078
+ {
1079
+ "include": "#typeIdentifier"
1080
+ },
1081
+ {
1082
+ "include": "#endOfLine"
1083
+ }
1084
+ ],
1085
+ "beginCaptures": {
1086
+ "1": {
1087
+ "name": "keyword.other.papyrus"
1088
+ }
1089
+ }
1204
1090
  }
1205
1091
  ]
1206
1092
  },
1207
- "float": {
1093
+ "specialVariables": {
1208
1094
  "patterns": [
1209
1095
  {
1210
- "include": "#unaryMinus"
1211
- },
1212
- {
1213
- "comment": "Float literal",
1214
- "name": "constant.numeric.float.papyrus",
1215
- "match": "\\b(\\d+\\.\\d+)\\b"
1096
+ "name": "keyword.other.papyrus",
1097
+ "match": "(?i)\\b(parent|self)\\b"
1216
1098
  }
1217
1099
  ]
1218
1100
  },
1219
- "integer": {
1101
+ "state": {
1220
1102
  "patterns": [
1221
1103
  {
1222
- "include": "#unaryMinus"
1223
- },
1224
- {
1225
- "comment": "Integer literal",
1226
- "name": "constant.numeric.integer.papyrus",
1227
- "match": "(?i)\\b(0x[0-9a-f]+|\\d+)\\b"
1104
+ "name": "meta.state.papyrus",
1105
+ "begin": "(?i)^\\s*(?:(auto)\\s+)?(state)\\s+",
1106
+ "end": "([\\n\\r])",
1107
+ "patterns": [
1108
+ {
1109
+ "include": "#illegalKeywords"
1110
+ },
1111
+ {
1112
+ "include": "#illegalSpecialVariables"
1113
+ },
1114
+ {
1115
+ "include": "#illegalBaseTypes"
1116
+ },
1117
+ {
1118
+ "include": "#identifier"
1119
+ },
1120
+ {
1121
+ "include": "#endOfLine"
1122
+ }
1123
+ ],
1124
+ "beginCaptures": {
1125
+ "1": {
1126
+ "name": "keyword.other.papyrus"
1127
+ },
1128
+ "2": {
1129
+ "name": "keyword.other.papyrus"
1130
+ }
1131
+ }
1228
1132
  }
1229
1133
  ]
1230
1134
  },
1231
1135
  "string": {
1232
1136
  "patterns": [
1233
1137
  {
1234
- "comment": "String literal",
1235
1138
  "name": "string.quoted.double",
1236
1139
  "begin": "\\\"",
1237
1140
  "end": "\\\"",
1238
1141
  "patterns": [
1239
1142
  {
1240
- "comment": "Escape sequences",
1241
1143
  "name": "constant.character.escape.papyrus",
1242
1144
  "match": "(\\\\.)"
1243
1145
  }
@@ -1245,104 +1147,126 @@
1245
1147
  }
1246
1148
  ]
1247
1149
  },
1248
- "keywords": {
1249
- "patterns": [
1250
- {
1251
- "comment": "Keywords",
1252
- "name": "keyword.other.papyrus",
1253
- "match": "(?i)\\b(as|auto|autoreadonly|else|elseif|endevent|endfunction|endif|endproperty|endstate|endwhile|event|extends|false|function|global|if|import|length|native|new|none|property|return|scriptname|state|true|while)\\b"
1254
- }
1255
- ]
1256
- },
1257
- "illegalKeywords": {
1150
+ "typeIdentifier": {
1258
1151
  "patterns": [
1259
1152
  {
1260
- "comment": "Keywords",
1261
- "name": "meta.invalid.papyrus",
1262
- "match": "(?i)\\b(as|auto|autoreadonly|else|elseif|endevent|endfunction|endif|endproperty|endstate|endwhile|event|extends|false|function|global|if|import|length|native|new|none|property|return|scriptname|state|true|while)\\b"
1153
+ "name": "storage.type.papyrus",
1154
+ "match": "(?i)\\b([_a-z][0-9_a-z]*)\\b"
1263
1155
  }
1264
1156
  ]
1265
1157
  },
1266
- "specialVariables": {
1158
+ "unaryExpression": {
1267
1159
  "patterns": [
1268
1160
  {
1269
- "comment": "Special variables",
1270
- "name": "keyword.other.papyrus",
1271
- "match": "(?i)\\b(parent|self)\\b"
1272
- }
1273
- ]
1274
- },
1275
- "illegalSpecialVariables": {
1276
- "patterns": [
1161
+ "name": "keyword.operator.papyrus",
1162
+ "match": "(\\-|\\!)"
1163
+ },
1277
1164
  {
1278
- "comment": "Special variables",
1279
- "name": "meta.invalid.papyrus",
1280
- "match": "(?i)\\b(parent|self)\\b"
1165
+ "include": "#castAtom"
1281
1166
  }
1282
1167
  ]
1283
1168
  },
1284
- "baseTypes": {
1169
+ "unaryMinus": {
1285
1170
  "patterns": [
1286
1171
  {
1287
- "comment": "Type",
1288
- "name": "storage.type.papyrus",
1289
- "match": "(?i)\\b(bool|float|int|string)\\b"
1172
+ "name": "keyword.operator.papyrus",
1173
+ "match": "\\-(?=\\d)"
1290
1174
  }
1291
1175
  ]
1292
1176
  },
1293
- "illegalBaseTypes": {
1177
+ "unmatched": {
1294
1178
  "patterns": [
1295
1179
  {
1296
- "comment": "Type",
1297
1180
  "name": "meta.invalid.papyrus",
1298
- "match": "(?i)\\b(bool|float|int|string)\\b"
1299
- }
1300
- ]
1301
- },
1302
- "identifier": {
1303
- "patterns": [
1304
- {
1305
- "comment": "Identifier",
1306
- "name": "variable.other.papyrus",
1307
- "match": "(?i)\\b([_a-z][0-9_a-z]*)\\b"
1181
+ "match": "([^\\n\\r])"
1308
1182
  }
1309
1183
  ]
1310
1184
  },
1311
- "functionIdentifier": {
1185
+ "variable": {
1312
1186
  "patterns": [
1313
1187
  {
1314
- "comment": "Function/event identifier",
1315
- "name": "entity.name.function.papyrus",
1316
- "match": "(?i)\\b([_a-z][0-9_a-z]*)\\s*(?=\\()"
1317
- }
1318
- ]
1319
- },
1320
- "typeIdentifier": {
1321
- "patterns": [
1188
+ "name": "meta.variable.papyrus",
1189
+ "begin": "(?i)^\\s*([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+([_a-z][0-9_a-z]*)(?:\\s*(\\=)\\s*)",
1190
+ "end": "([\\n\\r])",
1191
+ "patterns": [
1192
+ {
1193
+ "include": "#constants"
1194
+ },
1195
+ {
1196
+ "name": "keyword.other.papyrus",
1197
+ "match": "(?i)(?:\\b(conditional)\\b)"
1198
+ },
1199
+ {
1200
+ "include": "#expression"
1201
+ },
1202
+ {
1203
+ "include": "#endOfLine"
1204
+ }
1205
+ ],
1206
+ "beginCaptures": {
1207
+ "1": {
1208
+ "name": "storage.type.papyrus"
1209
+ },
1210
+ "2": {
1211
+ "name": "variable.other.papyrus"
1212
+ },
1213
+ "3": {
1214
+ "name": "keyword.operator.papyrus"
1215
+ }
1216
+ }
1217
+ },
1322
1218
  {
1323
- "comment": "Type identifier",
1324
- "name": "storage.type.papyrus",
1325
- "match": "(?i)\\b([_a-z][0-9_a-z]*)\\b"
1219
+ "name": "meta.variable.papyrus",
1220
+ "begin": "(?i)^\\s*([_a-z][0-9_a-z]*)(?:\\[\\])?\\s+([_a-z][0-9_a-z]*)(?:\\s+(conditional)\\b)?",
1221
+ "end": "([\\n\\r])",
1222
+ "patterns": [
1223
+ {
1224
+ "include": "#endOfLine"
1225
+ }
1226
+ ],
1227
+ "beginCaptures": {
1228
+ "1": {
1229
+ "name": "storage.type.papyrus"
1230
+ },
1231
+ "2": {
1232
+ "name": "variable.other.papyrus"
1233
+ },
1234
+ "3": {
1235
+ "name": "keyword.other.papyrus"
1236
+ }
1237
+ }
1326
1238
  }
1327
1239
  ]
1328
1240
  },
1329
- "parameterIdentifier": {
1241
+ "while": {
1330
1242
  "patterns": [
1331
1243
  {
1332
- "comment": "Parameter identifier",
1333
- "name": "variable.parameter.papyrus",
1334
- "match": "(?i)\\b([_a-z][0-9_a-z]*)\\b"
1244
+ "name": "meta.while.papyrus",
1245
+ "begin": "(?i)^\\s*(while)\\b",
1246
+ "end": "([\\n\\r])",
1247
+ "patterns": [
1248
+ {
1249
+ "include": "#expression"
1250
+ },
1251
+ {
1252
+ "include": "#endOfLine"
1253
+ }
1254
+ ],
1255
+ "beginCaptures": {
1256
+ "1": {
1257
+ "name": "keyword.other.papyrus"
1258
+ }
1259
+ }
1335
1260
  }
1336
1261
  ]
1337
1262
  },
1338
- "brackets": {
1263
+ "whitespace": {
1339
1264
  "patterns": [
1340
1265
  {
1341
- "comment": "Brackets",
1342
- "name": "meta.array.papyrus",
1343
- "match": "\\[\\]"
1266
+ "name": "meta.whitespace.papyrus",
1267
+ "match": "([ \\t])"
1344
1268
  }
1345
1269
  ]
1346
1270
  }
1347
1271
  }
1348
- }
1272
+ }