github-linguist 7.11.0 → 7.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (598) hide show
  1. checksums.yaml +4 -4
  2. data/ext/linguist/lex.linguist_yy.c +1123 -623
  3. data/ext/linguist/lex.linguist_yy.h +433 -66
  4. data/ext/linguist/linguist.c +5 -35
  5. data/ext/linguist/linguist.h +0 -18
  6. data/ext/linguist/tokenizer.l +83 -65
  7. data/grammars/annotation.liquidhaskell.haskell.json +1 -1835
  8. data/grammars/config.xcompose.json +1 -80
  9. data/grammars/documentation.markdown.injection.haxe.json +1 -22
  10. data/grammars/etc.json +1 -987
  11. data/grammars/file.lasso.json +1 -702
  12. data/grammars/hidden.manref.json +1 -29
  13. data/grammars/hidden.regexp.injection-shell.json +1 -28
  14. data/grammars/hint.haskell.json +1 -1762
  15. data/grammars/hint.message.haskell.json +1 -1786
  16. data/grammars/hint.type.haskell.json +1 -1759
  17. data/grammars/injections.etc.json +1 -659
  18. data/grammars/inline.prisma.json +1 -55
  19. data/grammars/markdown.hack.codeblock.json +1 -20
  20. data/grammars/markdown.haxe.codeblock.json +1 -26
  21. data/grammars/markdown.hxml.codeblock.json +1 -26
  22. data/grammars/markdown.lean.codeblock.json +1 -0
  23. data/grammars/markdown.plantuml.codeblock.json +1 -26
  24. data/grammars/objdump.x86asm.json +1 -69
  25. data/grammars/source.4dm.json +1 -1156
  26. data/grammars/source.SASLog.json +1 -18
  27. data/grammars/source.abap.json +1 -335
  28. data/grammars/source.abapcds.json +1 -0
  29. data/grammars/source.abl.json +1 -734
  30. data/grammars/source.abnf.json +1 -294
  31. data/grammars/source.actionscript.3.json +1 -1538
  32. data/grammars/source.acucobol.json +1 -13
  33. data/grammars/source.ada.json +1 -133
  34. data/grammars/source.afm.json +1 -1207
  35. data/grammars/source.agc.json +1 -87
  36. data/grammars/source.agda.json +1 -72
  37. data/grammars/source.ahk.json +1 -195
  38. data/grammars/source.al.json +1 -130
  39. data/grammars/source.alloy.json +1 -40
  40. data/grammars/source.ampl.json +1 -151
  41. data/grammars/source.angelscript.json +1 -186
  42. data/grammars/source.antlr.json +1 -295
  43. data/grammars/source.apache-config.json +1 -346
  44. data/grammars/source.apache-config.mod_perl.json +1 -65
  45. data/grammars/source.apl.json +1 -1427
  46. data/grammars/source.applescript.json +1 -1384
  47. data/grammars/source.asl.json +1 -56
  48. data/grammars/source.asn.json +1 -55
  49. data/grammars/source.asp.json +1 -151
  50. data/grammars/source.aspectj.json +1 -960
  51. data/grammars/source.assembly.json +1 -116
  52. data/grammars/source.ats.json +1 -164
  53. data/grammars/source.autoit.json +1 -167
  54. data/grammars/source.avro.json +1 -381
  55. data/grammars/source.awk.json +1 -384
  56. data/grammars/source.ballerina.json +1 -1785
  57. data/grammars/source.batchfile.json +1 -732
  58. data/grammars/source.bdf.json +1 -425
  59. data/grammars/source.befunge.json +1 -34
  60. data/grammars/source.bf.json +1 -30
  61. data/grammars/source.blitzmax.json +1 -905
  62. data/grammars/source.bnf.json +1 -191
  63. data/grammars/source.boo.json +1 -448
  64. data/grammars/source.boogie.json +1 -0
  65. data/grammars/source.brightauthorproject.json +1 -24
  66. data/grammars/source.brightscript.json +1 -148
  67. data/grammars/source.bsl.json +1 -451
  68. data/grammars/source.bsv.json +1 -277
  69. data/grammars/source.c++.json +1 -436
  70. data/grammars/source.c++.qt.json +1 -29
  71. data/grammars/source.c.ec.json +1 -33
  72. data/grammars/source.c.json +1 -712
  73. data/grammars/source.c.nwscript.json +1 -0
  74. data/grammars/source.c.platform.json +1 -1115
  75. data/grammars/source.c2hs.json +1 -24
  76. data/grammars/source.cabal.json +1 -63
  77. data/grammars/source.cache.cmake.json +1 -70
  78. data/grammars/source.cake.json +1 -13
  79. data/grammars/source.camlp4.ocaml.json +1 -60
  80. data/grammars/source.capnp.json +1 -88
  81. data/grammars/source.ceylon.json +1 -93
  82. data/grammars/source.cfscript.cfc.json +1 -162
  83. data/grammars/source.cfscript.json +1 -737
  84. data/grammars/source.changelogs.rpm-spec.json +1 -91
  85. data/grammars/source.chapel.json +1 -265
  86. data/grammars/source.cirru.json +1 -61
  87. data/grammars/source.clarion.json +1 -146
  88. data/grammars/source.clean.json +1 -222
  89. data/grammars/source.click.json +1 -107
  90. data/grammars/source.clips.json +1 -67
  91. data/grammars/source.clojure.json +1 -429
  92. data/grammars/source.cm.json +1 -49
  93. data/grammars/source.cmake.json +1 -173
  94. data/grammars/source.cobol.json +1 -485
  95. data/grammars/source.coffee.json +1 -1310
  96. data/grammars/source.cool.json +1 -96
  97. data/grammars/source.coq.json +1 -58
  98. data/grammars/source.crystal.json +1 -2694
  99. data/grammars/source.cs.json +1 -4323
  100. data/grammars/source.csound-document.json +1 -175
  101. data/grammars/source.csound-score.json +1 -191
  102. data/grammars/source.csound.json +1 -824
  103. data/grammars/source.css.json +1 -1859
  104. data/grammars/source.css.less.json +1 -536
  105. data/grammars/source.css.mss.json +1 -249
  106. data/grammars/source.css.postcss.sugarss.json +1 -260
  107. data/grammars/source.css.scss.json +1 -1873
  108. data/grammars/source.csx.json +1 -13
  109. data/grammars/source.cuda-c++.json +1 -103
  110. data/grammars/source.curlrc.json +1 -984
  111. data/grammars/source.cwl.json +1 -103
  112. data/grammars/source.cython.json +1 -1912
  113. data/grammars/source.d.json +1 -741
  114. data/grammars/source.dart.json +1 -433
  115. data/grammars/source.data-weave.json +1 -1580
  116. data/grammars/source.desktop.json +1 -86
  117. data/grammars/source.diff.json +1 -153
  118. data/grammars/source.dircolors.json +1 -137
  119. data/grammars/source.direct-x.json +1 -135
  120. data/grammars/source.disasm.json +1 -30
  121. data/grammars/source.ditroff.desc.json +1 -411
  122. data/grammars/source.ditroff.json +1 -1280
  123. data/grammars/source.dm.json +1 -628
  124. data/grammars/source.dmf.json +1 -96
  125. data/grammars/source.dockerfile.json +1 -88
  126. data/grammars/source.dosbox-conf.json +1 -97
  127. data/grammars/source.dot.json +1 -117
  128. data/grammars/source.dylan.json +1 -212
  129. data/grammars/source.ebnf.json +1 -240
  130. data/grammars/source.editorconfig.json +1 -365
  131. data/grammars/source.eiffel.json +1 -133
  132. data/grammars/source.elixir.json +1 -965
  133. data/grammars/source.elm.json +1 -375
  134. data/grammars/source.emacs.lisp.json +1 -1301
  135. data/grammars/source.erlang.json +1 -1647
  136. data/grammars/source.essl.json +1 -37
  137. data/grammars/source.factor.json +1 -252
  138. data/grammars/source.fan.json +1 -341
  139. data/grammars/source.fancy.json +1 -245
  140. data/grammars/source.faust.json +1 -119
  141. data/grammars/source.figctrl.json +1 -252
  142. data/grammars/source.figfont.json +1 -121
  143. data/grammars/source.firestore.json +1 -289
  144. data/grammars/source.fish.json +1 -190
  145. data/grammars/source.fontdir.json +1 -99
  146. data/grammars/source.fontforge.json +1 -355
  147. data/grammars/source.forth.json +1 -84
  148. data/grammars/source.fortran.json +1 -464
  149. data/grammars/source.fortran.modern.json +1 -200
  150. data/grammars/source.fsharp.fsi.json +1 -9
  151. data/grammars/source.fsharp.fsl.json +1 -9
  152. data/grammars/source.fsharp.fsx.json +1 -13
  153. data/grammars/source.fsharp.json +1 -452
  154. data/grammars/source.fstar.json +1 -439
  155. data/grammars/source.futhark.json +1 -167
  156. data/grammars/source.gap.json +1 -163
  157. data/grammars/source.gcode.json +1 -176
  158. data/grammars/source.gdb.json +1 -160
  159. data/grammars/source.gdb.session.json +1 -70
  160. data/grammars/source.gdbregs.json +1 -14
  161. data/grammars/source.gdscript.json +1 -245
  162. data/grammars/source.gedcom.json +1 -196
  163. data/grammars/source.generic-db.json +1 -41
  164. data/grammars/source.gerber.json +1 -321
  165. data/grammars/source.gf.json +1 -51
  166. data/grammars/source.gfm.blade.json +1 -15
  167. data/grammars/source.gfm.json +1 -1913
  168. data/grammars/source.gitattributes.json +1 -111
  169. data/grammars/source.gitconfig.json +1 -450
  170. data/grammars/source.gitignore.json +1 -140
  171. data/grammars/source.glsl.json +1 -139
  172. data/grammars/source.gn.json +1 -345
  173. data/grammars/source.gnuplot.json +1 -260
  174. data/grammars/source.go.json +1 -540
  175. data/grammars/source.golo.json +1 -177
  176. data/grammars/source.gosu.2.json +1 -153
  177. data/grammars/source.grace.json +1 -675
  178. data/grammars/source.graphql.json +1 -978
  179. data/grammars/source.gremlin.json +1 -200
  180. data/grammars/source.groovy.gradle.json +1 -69
  181. data/grammars/source.groovy.json +1 -1374
  182. data/grammars/source.hack.json +1 -2595
  183. data/grammars/source.haproxy-config.json +1 -152
  184. data/grammars/source.harbour.json +1 -388
  185. data/grammars/source.haskell.json +1 -1760
  186. data/grammars/source.hc.json +1 -709
  187. data/grammars/source.hgignore.json +1 -34
  188. data/grammars/source.hlsl.json +1 -211
  189. data/grammars/source.hosts.json +1 -40
  190. data/grammars/source.hql.json +1 -492
  191. data/grammars/source.hsc2hs.json +1 -9
  192. data/grammars/source.hsig.json +1 -1760
  193. data/grammars/source.httpspec.json +1 -283
  194. data/grammars/source.hx.argument.json +1 -80
  195. data/grammars/source.hx.json +1 -2428
  196. data/grammars/source.hx.type.json +1 -8
  197. data/grammars/source.hxml.json +1 -59
  198. data/grammars/source.hy.json +1 -429
  199. data/grammars/source.ideal.json +1 -356
  200. data/grammars/source.idl-dlm.json +1 -105
  201. data/grammars/source.idl.json +1 -246
  202. data/grammars/source.idris.json +1 -523
  203. data/grammars/source.igor.json +1 -369
  204. data/grammars/source.inform7.json +1 -183
  205. data/grammars/source.ini.json +1 -107
  206. data/grammars/source.ini.npmrc.json +1 -311
  207. data/grammars/source.inno.json +1 -133
  208. data/grammars/source.inputrc.json +1 -500
  209. data/grammars/source.io.json +1 -156
  210. data/grammars/source.ioke.json +1 -266
  211. data/grammars/source.isabelle.root.json +1 -64
  212. data/grammars/source.isabelle.theory.json +1 -102
  213. data/grammars/source.j.json +1 -260
  214. data/grammars/source.jasmin.json +1 -294
  215. data/grammars/source.java-properties.json +1 -87
  216. data/grammars/source.java.json +1 -1020
  217. data/grammars/source.jcl.json +1 -46
  218. data/grammars/source.jflex.json +1 -484
  219. data/grammars/source.jison.json +1 -711
  220. data/grammars/source.jisonlex-injection.json +1 -10
  221. data/grammars/source.jisonlex.json +1 -434
  222. data/grammars/source.jolie.json +1 -132
  223. data/grammars/source.jq.json +1 -211
  224. data/grammars/source.js.json +1 -1897
  225. data/grammars/source.js.objj.json +1 -419
  226. data/grammars/source.js.regexp.json +1 -152
  227. data/grammars/source.js.regexp.replacement.json +1 -26
  228. data/grammars/source.jsdoc.json +1 -460
  229. data/grammars/source.json.json +1 -139
  230. data/grammars/source.jsonnet.json +1 -197
  231. data/grammars/source.julia.console.json +1 -51
  232. data/grammars/source.julia.json +1 -991
  233. data/grammars/source.kotlin.json +1 -704
  234. data/grammars/source.lark.json +1 -0
  235. data/grammars/source.lbnf.json +1 -0
  236. data/grammars/source.lcov.json +1 -398
  237. data/grammars/source.lean.json +1 -226
  238. data/grammars/source.lean.markdown.json +1 -2598
  239. data/grammars/source.lex.json +1 -232
  240. data/grammars/source.lex.regexp.json +1 -269
  241. data/grammars/source.lid.json +1 -19
  242. data/grammars/source.lilypond.json +1 -869
  243. data/grammars/source.lisp.json +1 -101
  244. data/grammars/source.litcoffee.json +1 -654
  245. data/grammars/source.livescript.json +1 -603
  246. data/grammars/source.llvm.json +1 -61
  247. data/grammars/source.logos.json +1 -24
  248. data/grammars/source.logtalk.json +1 -310
  249. data/grammars/source.loomscript.json +1 -208
  250. data/grammars/source.lsl.json +1 -241
  251. data/grammars/source.ltspice.symbol.json +1 -294
  252. data/grammars/source.lua.json +1 -275
  253. data/grammars/source.m2.json +1 -125
  254. data/grammars/source.m4.json +1 -229
  255. data/grammars/source.m68k.json +1 -412
  256. data/grammars/source.mailmap.json +1 -28
  257. data/grammars/source.makefile.json +1 -470
  258. data/grammars/source.makegen.json +1 -9
  259. data/grammars/source.man-conf.json +1 -153
  260. data/grammars/source.mask.json +1 -816
  261. data/grammars/source.mata.json +1 -125
  262. data/grammars/source.mathematica.json +1 -416
  263. data/grammars/source.matlab.json +1 -1096
  264. data/grammars/source.maxscript.json +1 -465
  265. data/grammars/source.mcfunction-snapshot.json +1 -24480
  266. data/grammars/source.mcfunction.json +1 -1354
  267. data/grammars/source.mercury.json +1 -246
  268. data/grammars/source.meson.json +1 -165
  269. data/grammars/source.meta-info.json +1 -146
  270. data/grammars/source.ml.json +1 -285
  271. data/grammars/source.mlir.json +1 -109
  272. data/grammars/source.modelica.json +1 -142
  273. data/grammars/source.modula-3.json +1 -88
  274. data/grammars/source.modula2.json +1 -94
  275. data/grammars/source.monkey.json +1 -694
  276. data/grammars/source.moonscript.json +1 -144
  277. data/grammars/source.mql5.json +1 -187
  278. data/grammars/source.msl.json +1 -755
  279. data/grammars/source.mupad.json +1 -131
  280. data/grammars/source.nanorc.json +1 -333
  281. data/grammars/source.nasl.json +1 -155
  282. data/grammars/source.ncl.json +1 -53
  283. data/grammars/source.ne.json +1 -105
  284. data/grammars/source.nemerle.json +1 -132
  285. data/grammars/source.neon.json +1 -381
  286. data/grammars/source.nesc.json +1 -21
  287. data/grammars/source.netlinx.erb.json +1 -34
  288. data/grammars/source.netlinx.json +1 -704
  289. data/grammars/source.nextflow-groovy.json +1 -1359
  290. data/grammars/source.nextflow.json +1 -94
  291. data/grammars/source.nginx.json +1 -815
  292. data/grammars/source.nim.comment.json +1 -82
  293. data/grammars/source.nim.json +1 -1083
  294. data/grammars/source.nim_filter.json +1 -113
  295. data/grammars/source.nimcfg.json +1 -103
  296. data/grammars/source.ninja.json +1 -248
  297. data/grammars/source.nit.json +1 -234
  298. data/grammars/source.nix.json +1 -1196
  299. data/grammars/source.nsis.json +1 -152
  300. data/grammars/source.nu.json +1 -516
  301. data/grammars/source.nunjucks.json +1 -0
  302. data/grammars/source.nut.json +1 -262
  303. data/grammars/source.objc++.json +1 -12
  304. data/grammars/source.objc.json +1 -910
  305. data/grammars/source.objc.platform.json +1 -842
  306. data/grammars/source.objectscript.json +1 -309
  307. data/grammars/source.objectscript_class.json +1 -674
  308. data/grammars/source.objectscript_csp.json +1 -19
  309. data/grammars/source.objectscript_macros.json +1 -226
  310. data/grammars/source.ocaml.json +1 -1418
  311. data/grammars/source.ocamllex.json +1 -298
  312. data/grammars/source.ocamlyacc.json +1 -339
  313. data/grammars/source.odin-ehr.json +1 -806
  314. data/grammars/source.odin.json +1 -402
  315. data/grammars/source.ooc.json +1 -685
  316. data/grammars/source.opa.json +1 -196
  317. data/grammars/source.opal.json +1 -410
  318. data/grammars/source.opalsysdefs.json +1 -66
  319. data/grammars/source.openbsd-pkg.contents.json +1 -128
  320. data/grammars/source.opencobol.json +1 -62
  321. data/grammars/source.opentype.json +1 -448
  322. data/grammars/source.opts.json +1 -108
  323. data/grammars/source.ox.json +1 -89
  324. data/grammars/source.oz.json +1 -77
  325. data/grammars/source.p4.json +1 -122
  326. data/grammars/source.paket.dependencies.json +1 -0
  327. data/grammars/source.paket.lock.json +1 -0
  328. data/grammars/source.pan.json +1 -706
  329. data/grammars/source.papyrus.skyrim.json +1 -1272
  330. data/grammars/source.parrot.pir.json +1 -145
  331. data/grammars/source.pascal.json +1 -143
  332. data/grammars/source.pawn.json +1 -1194
  333. data/grammars/source.pcb.board.json +1 -285
  334. data/grammars/source.pcb.schematic.json +1 -424
  335. data/grammars/source.pcb.sexp.json +1 -232
  336. data/grammars/source.pep8.json +1 -118
  337. data/grammars/source.perl.6.json +1 -309
  338. data/grammars/source.perl.json +1 -2519
  339. data/grammars/source.php.zephir.json +1 -353
  340. data/grammars/source.pic.json +1 -908
  341. data/grammars/source.pig_latin.json +1 -168
  342. data/grammars/source.pike.json +1 -49
  343. data/grammars/source.plist.json +1 -336
  344. data/grammars/source.po.json +1 -222
  345. data/grammars/source.pogoscript.json +1 -79
  346. data/grammars/source.pony.json +1 -245
  347. data/grammars/source.postcss.json +1 -370
  348. data/grammars/source.postscript.json +1 -477
  349. data/grammars/source.pov-ray sdl.json +1 -82
  350. data/grammars/source.powershell.json +1 -981
  351. data/grammars/source.prisma.json +1 -435
  352. data/grammars/source.processing.json +1 -872
  353. data/grammars/source.prolog.eclipse.json +1 -201
  354. data/grammars/source.prolog.json +1 -286
  355. data/grammars/source.protobuf.json +1 -471
  356. data/grammars/source.puppet.json +1 -433
  357. data/grammars/source.purescript.json +1 -861
  358. data/grammars/source.pyjade.json +1 -996
  359. data/grammars/source.python.django.json +1 -29
  360. data/grammars/source.python.json +1 -5292
  361. data/grammars/source.python.salt.json +1 -9
  362. data/grammars/source.q.json +1 -215
  363. data/grammars/source.q_output.json +1 -348
  364. data/grammars/source.qasm.json +1 -66
  365. data/grammars/source.ql.json +1 -1408
  366. data/grammars/source.qmake.json +1 -210
  367. data/grammars/source.qml.json +1 -174
  368. data/grammars/source.qsharp.json +1 -120
  369. data/grammars/source.quake.json +1 -44
  370. data/grammars/source.quoting.raku.json +1 -0
  371. data/grammars/source.r.json +1 -194
  372. data/grammars/source.racket.json +1 -98
  373. data/grammars/source.raku.json +1 -0
  374. data/grammars/source.rascal.json +1 -283
  375. data/grammars/source.reason.hover.type.json +1 -14
  376. data/grammars/source.reason.json +1 -3382
  377. data/grammars/source.rebol.json +1 -637
  378. data/grammars/source.record-jar.json +1 -0
  379. data/grammars/source.red.json +1 -644
  380. data/grammars/source.reg.json +1 -159
  381. data/grammars/source.regexp.extended.json +1 -558
  382. data/grammars/source.regexp.json +1 -1434
  383. data/grammars/source.regexp.posix.json +1 -0
  384. data/grammars/source.regexp.python.json +1 -490
  385. data/grammars/source.regexp.raku.json +1 -0
  386. data/grammars/source.regexp.spin.json +1 -179
  387. data/grammars/source.rego.json +1 -124
  388. data/grammars/source.renpy.json +1 -1948
  389. data/grammars/source.rescript.json +1 -0
  390. data/grammars/source.rexx.json +1 -52
  391. data/grammars/source.ring.json +1 -247
  392. data/grammars/source.rpm-spec.json +1 -765
  393. data/grammars/source.ruby.gemfile.json +1 -24
  394. data/grammars/source.ruby.json +1 -2605
  395. data/grammars/source.ruby.rspec.cucumber.steps.json +1 -261
  396. data/grammars/source.rust.json +1 -629
  397. data/grammars/source.sas.json +1 -286
  398. data/grammars/source.sass.json +1 -1089
  399. data/grammars/source.sassdoc.json +1 -346
  400. data/grammars/source.scad.json +1 -145
  401. data/grammars/source.scala.json +1 -1121
  402. data/grammars/source.scaml.json +1 -451
  403. data/grammars/source.scheme.json +1 -353
  404. data/grammars/source.scilab.json +1 -96
  405. data/grammars/source.sdbl.json +1 -90
  406. data/grammars/source.sed.json +1 -1520
  407. data/grammars/source.shaderlab.json +1 -198
  408. data/grammars/source.shell.json +1 -1272
  409. data/grammars/source.shen.json +1 -143
  410. data/grammars/source.sieve.json +1 -383
  411. data/grammars/source.slice.json +1 -2755
  412. data/grammars/source.smali.json +1 -1610
  413. data/grammars/source.smalltalk.json +1 -187
  414. data/grammars/source.smpl.json +1 -314
  415. data/grammars/source.smt.json +1 -158
  416. data/grammars/source.solidity.json +1 -189
  417. data/grammars/source.sourcepawn.json +1 -651
  418. data/grammars/source.sparql.json +1 -18
  419. data/grammars/source.spin.json +1 -916
  420. data/grammars/source.sqf.json +1 -111
  421. data/grammars/source.sql.json +1 -459
  422. data/grammars/source.ssh-config.json +1 -97
  423. data/grammars/source.stan.json +1 -388
  424. data/grammars/source.stata.json +1 -197
  425. data/grammars/source.strings.json +1 -49
  426. data/grammars/source.stylus.json +1 -1018
  427. data/grammars/source.supercollider.json +1 -93
  428. data/grammars/source.svelte.json +1 -827
  429. data/grammars/source.swift.json +1 -3134
  430. data/grammars/source.sy.json +1 -2954
  431. data/grammars/source.systemverilog.json +1 -1036
  432. data/grammars/source.tags.json +1 -266
  433. data/grammars/source.tcl.json +1 -260
  434. data/grammars/source.tea.json +1 -174
  435. data/grammars/source.terra.json +1 -138
  436. data/grammars/source.terraform.json +1 -694
  437. data/grammars/source.thrift.json +1 -698
  438. data/grammars/source.tl.json +1 -259
  439. data/grammars/source.tla.json +1 -140
  440. data/grammars/source.tnsaudit.json +1 -256
  441. data/grammars/source.toc.json +1 -52
  442. data/grammars/source.toml.json +1 -426
  443. data/grammars/source.ts.json +1 -5581
  444. data/grammars/source.tsql.json +1 -507
  445. data/grammars/source.tsx.json +1 -5834
  446. data/grammars/source.turing.json +1 -1553
  447. data/grammars/source.turtle.json +1 -489
  448. data/grammars/source.txl.json +1 -48
  449. data/grammars/source.ucd.nameslist.json +1 -444
  450. data/grammars/source.ucd.unidata.json +1 -570
  451. data/grammars/source.ucfconstraints.json +1 -67
  452. data/grammars/source.ur.json +1 -31
  453. data/grammars/source.v.json +1 -1010
  454. data/grammars/source.vala.json +1 -800
  455. data/grammars/source.varnish.vcl.json +1 -331
  456. data/grammars/source.vbnet.json +1 -239
  457. data/grammars/source.verilog.json +1 -296
  458. data/grammars/source.vhdl.json +1 -1374
  459. data/grammars/source.vim-snippet.json +1 -645
  460. data/grammars/source.viml.json +1 -1197
  461. data/grammars/source.vtt.json +1 -702
  462. data/grammars/source.vyper.json +1 -213
  463. data/grammars/source.wavefront.mtl.json +1 -1190
  464. data/grammars/source.wavefront.obj.json +1 -1341
  465. data/grammars/source.wdl.json +1 -220
  466. data/grammars/source.webassembly.json +1 -349
  467. data/grammars/source.webidl.json +1 -807
  468. data/grammars/source.wgetrc.json +1 -1640
  469. data/grammars/source.wollok.json +1 -100
  470. data/grammars/source.wsd.json +1 -781
  471. data/grammars/source.x10.json +1 -64
  472. data/grammars/source.x86.json +1 -299
  473. data/grammars/source.x86asm.json +1 -42
  474. data/grammars/source.xc.json +1 -371
  475. data/grammars/source.xlfd.json +1 -462
  476. data/grammars/source.xojo.json +1 -85
  477. data/grammars/source.xq.json +1 -230
  478. data/grammars/source.xtend.json +1 -724
  479. data/grammars/source.yacc.json +1 -626
  480. data/grammars/source.yaml.json +1 -443
  481. data/grammars/source.yaml.salt.json +1 -345
  482. data/grammars/source.yang.json +1 -78
  483. data/grammars/source.yara.json +1 -99
  484. data/grammars/source.yasnippet.json +1 -377
  485. data/grammars/source.zap.json +1 -260
  486. data/grammars/source.zeek.json +1 -412
  487. data/grammars/source.zenscript.json +1 -282
  488. data/grammars/source.zig.json +1 -547
  489. data/grammars/source.zil.json +1 -750
  490. data/grammars/text.bibtex.json +1 -246
  491. data/grammars/text.browserslist.json +1 -0
  492. data/grammars/text.cfml.basic.json +1 -735
  493. data/grammars/text.checksums.json +1 -0
  494. data/grammars/text.conllu.json +1 -45
  495. data/grammars/text.dfy.dafny.json +1 -188
  496. data/grammars/text.elixir.json +1 -52
  497. data/grammars/text.eml.basic.json +1 -296
  498. data/grammars/text.error-list.json +1 -53
  499. data/grammars/text.find-refs.json +1 -926
  500. data/grammars/text.gherkin.feature.json +1 -127
  501. data/grammars/text.haml.json +1 -518
  502. data/grammars/text.hamlc.json +1 -219
  503. data/grammars/text.html.asciidoc.json +1 -478
  504. data/grammars/text.html.asdoc.json +1 -529
  505. data/grammars/text.html.asp.json +1 -53
  506. data/grammars/text.html.basic.json +1 -908
  507. data/grammars/text.html.cfm.json +1 -802
  508. data/grammars/text.html.creole.json +1 -317
  509. data/grammars/text.html.cshtml.json +1 -356
  510. data/grammars/text.html.django.json +1 -63
  511. data/grammars/text.html.ecr.json +1 -48
  512. data/grammars/text.html.elixir.json +1 -21
  513. data/grammars/text.html.erb.json +1 -150
  514. data/grammars/text.html.erlang.yaws.json +1 -67
  515. data/grammars/text.html.factor.json +1 -19
  516. data/grammars/text.html.ftl.json +1 -76
  517. data/grammars/text.html.handlebars.json +1 -845
  518. data/grammars/text.html.javadoc.json +1 -426
  519. data/grammars/text.html.js.json +1 -24
  520. data/grammars/text.html.jsp.json +1 -1196
  521. data/grammars/text.html.liquid.json +1 -25
  522. data/grammars/text.html.mako.json +1 -726
  523. data/grammars/text.html.markdown.source.gfm.apib.json +1 -1298
  524. data/grammars/text.html.markdown.source.gfm.mson.json +1 -1156
  525. data/grammars/text.html.mediawiki.elm-build-output.json +1 -97
  526. data/grammars/text.html.mediawiki.elm-documentation.json +1 -17
  527. data/grammars/text.html.mediawiki.json +1 -946
  528. data/grammars/text.html.nunjucks.json +1 -0
  529. data/grammars/text.html.php.blade.json +1 -3833
  530. data/grammars/text.html.php.json +1 -2507
  531. data/grammars/text.html.riot.json +1 -788
  532. data/grammars/text.html.slash.json +1 -307
  533. data/grammars/text.html.smarty.json +1 -232
  534. data/grammars/text.html.soy.json +1 -606
  535. data/grammars/text.html.ssp.json +1 -43
  536. data/grammars/text.html.tcl.json +1 -37
  537. data/grammars/text.html.twig.json +1 -1344
  538. data/grammars/text.html.vue.json +1 -963
  539. data/grammars/text.idl-idldoc.json +1 -10
  540. data/grammars/text.jade.json +1 -963
  541. data/grammars/text.junit-test-report.json +1 -89
  542. data/grammars/text.log.latex.json +1 -84
  543. data/grammars/text.marko.json +1 -1662
  544. data/grammars/text.muse.json +1 -1471
  545. data/grammars/text.openbsd-pkg.desc.json +1 -78
  546. data/grammars/text.plain.json +1 -18
  547. data/grammars/text.python.console.json +1 -21
  548. data/grammars/text.python.traceback.json +1 -43
  549. data/grammars/text.rdoc.json +1 -44
  550. data/grammars/text.restructuredtext.clean.json +1 -24
  551. data/grammars/text.restructuredtext.json +1 -1765
  552. data/grammars/text.robot.json +1 -63
  553. data/grammars/text.roff.json +1 -6927
  554. data/grammars/text.rtf.json +1 -148
  555. data/grammars/text.runoff.json +1 -308
  556. data/grammars/text.sfd.json +1 -292
  557. data/grammars/text.shell-session.json +1 -29
  558. data/grammars/text.slim.json +1 -527
  559. data/grammars/text.srt.json +1 -166
  560. data/grammars/text.tex.json +1 -264
  561. data/grammars/text.tex.latex.beamer.json +1 -57
  562. data/grammars/text.tex.latex.haskell.json +1 -1826
  563. data/grammars/text.tex.latex.json +1 -1003
  564. data/grammars/text.tex.latex.memoir.json +1 -129
  565. data/grammars/text.tex.latex.rd.json +1 -111
  566. data/grammars/text.texinfo.json +1 -1525
  567. data/grammars/text.vim-help.json +1 -383
  568. data/grammars/text.xml.ant.json +1 -195
  569. data/grammars/text.xml.flex-config.json +1 -2628
  570. data/grammars/text.xml.genshi.json +1 -28
  571. data/grammars/text.xml.json +1 -351
  572. data/grammars/text.xml.plist.json +1 -664
  573. data/grammars/text.xml.pom.json +1 -769
  574. data/grammars/text.xml.svg.json +1 -562
  575. data/grammars/text.xml.xsl.json +1 -88
  576. data/grammars/text.zone_file.json +1 -67
  577. data/grammars/version +1 -1
  578. data/lib/linguist/VERSION +1 -1
  579. data/lib/linguist/classifier.rb +28 -17
  580. data/lib/linguist/generated.rb +23 -3
  581. data/lib/linguist/generic.yml +18 -0
  582. data/lib/linguist/heuristics.yml +57 -22
  583. data/lib/linguist/language.rb +4 -2
  584. data/lib/linguist/languages.json +1 -1
  585. data/lib/linguist/languages.yml +142 -25
  586. data/lib/linguist/linguist.bundle +0 -0
  587. data/lib/linguist/samples.json +1 -1
  588. data/lib/linguist/samples.rb +4 -4
  589. data/lib/linguist/{md5.rb → sha256.rb} +3 -3
  590. data/lib/linguist/strategy/extension.rb +13 -5
  591. data/lib/linguist/vendor.yml +1 -1
  592. metadata +23 -10
  593. data/ext/linguist/strndup.c +0 -10
  594. data/grammars/source.js.css.json +0 -328
  595. data/grammars/source.js.jsx.json +0 -2488
  596. data/grammars/source.perl6fe.json +0 -2769
  597. data/grammars/source.quoting.perl6fe.json +0 -2369
  598. data/grammars/source.regexp.perl6fe.json +0 -244
@@ -1,88 +1 @@
1
- {
2
- "name": "XSL",
3
- "scopeName": "text.xml.xsl",
4
- "patterns": [
5
- {
6
- "name": "meta.tag.xml.template",
7
- "begin": "(\u003c)(xsl)((:))(template)",
8
- "end": "(\u003e)",
9
- "patterns": [
10
- {
11
- "match": " (?:([-_a-zA-Z0-9]+)((:)))?([a-zA-Z-]+)",
12
- "captures": {
13
- "1": {
14
- "name": "entity.other.attribute-name.namespace.xml"
15
- },
16
- "2": {
17
- "name": "entity.other.attribute-name.xml"
18
- },
19
- "3": {
20
- "name": "punctuation.separator.namespace.xml"
21
- },
22
- "4": {
23
- "name": "entity.other.attribute-name.localname.xml"
24
- }
25
- }
26
- },
27
- {
28
- "include": "#doublequotedString"
29
- },
30
- {
31
- "include": "#singlequotedString"
32
- }
33
- ],
34
- "captures": {
35
- "1": {
36
- "name": "punctuation.definition.tag.xml"
37
- },
38
- "2": {
39
- "name": "entity.name.tag.namespace.xml"
40
- },
41
- "3": {
42
- "name": "entity.name.tag.xml"
43
- },
44
- "4": {
45
- "name": "punctuation.separator.namespace.xml"
46
- },
47
- "5": {
48
- "name": "entity.name.tag.localname.xml"
49
- }
50
- }
51
- },
52
- {
53
- "include": "text.xml"
54
- }
55
- ],
56
- "repository": {
57
- "doublequotedString": {
58
- "name": "string.quoted.double.xml",
59
- "begin": "\"",
60
- "end": "\"",
61
- "beginCaptures": {
62
- "0": {
63
- "name": "punctuation.definition.string.begin.xml"
64
- }
65
- },
66
- "endCaptures": {
67
- "0": {
68
- "name": "punctuation.definition.string.end.xml"
69
- }
70
- }
71
- },
72
- "singlequotedString": {
73
- "name": "string.quoted.single.xml",
74
- "begin": "'",
75
- "end": "'",
76
- "beginCaptures": {
77
- "0": {
78
- "name": "punctuation.definition.string.begin.xml"
79
- }
80
- },
81
- "endCaptures": {
82
- "0": {
83
- "name": "punctuation.definition.string.end.xml"
84
- }
85
- }
86
- }
87
- }
88
- }
1
+ {"name":"XSL","scopeName":"text.xml.xsl","patterns":[{"name":"meta.tag.xml.template","begin":"(\u003c)(xsl)((:))(template)","end":"(\u003e)","patterns":[{"match":" (?:([-_a-zA-Z0-9]+)((:)))?([a-zA-Z-]+)","captures":{"1":{"name":"entity.other.attribute-name.namespace.xml"},"2":{"name":"entity.other.attribute-name.xml"},"3":{"name":"punctuation.separator.namespace.xml"},"4":{"name":"entity.other.attribute-name.localname.xml"}}},{"include":"#doublequotedString"},{"include":"#singlequotedString"}],"captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.namespace.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}}},{"include":"text.xml"}],"repository":{"doublequotedString":{"name":"string.quoted.double.xml","begin":"\"","end":"\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}}},"singlequotedString":{"name":"string.quoted.single.xml","begin":"'","end":"'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}}}}}
@@ -1,67 +1 @@
1
- {
2
- "name": "Bind Zone Files",
3
- "scopeName": "text.zone_file",
4
- "patterns": [
5
- {
6
- "name": "comment.line.semicolon.zone_file",
7
- "match": ";.*"
8
- },
9
- {
10
- "name": "keyword.directive.zone_file",
11
- "match": "@"
12
- },
13
- {
14
- "name": "keyword.directive.zone_file",
15
- "match": "\\$(ORIGIN|origin|TTL|ttl|INCLUDE|include)\\s*([^;]*)(;.*)?",
16
- "captures": {
17
- "2": {
18
- "name": "variable.other.directive.zone_file"
19
- },
20
- "3": {
21
- "name": "comment.line.semicolon.zone_file"
22
- }
23
- }
24
- },
25
- {
26
- "name": "variable.other.timeunit.zone_file",
27
- "match": "\\d+(H|h|D|d|W|w|M|m|Y|y)"
28
- },
29
- {
30
- "name": "string.quoted.single.address.zone_file",
31
- "begin": "([A-Za-z0-9_.-]*)\\s+(?:([0-9A-Za-z]*)\\s+)?([I|i][N|n]\\s+[A-Za-z0-9]+)\\s+(.*)\\(",
32
- "end": "\\)",
33
- "patterns": [
34
- {
35
- "name": "comment.line.semicolon.zone_file",
36
- "match": ";.*"
37
- }
38
- ],
39
- "beginCaptures": {
40
- "2": {
41
- "name": "variable.other.timeunit.zone_file"
42
- },
43
- "3": {
44
- "name": "keyword.resourcetype.zone_file"
45
- },
46
- "4": {
47
- "name": "string.quoted.single.resource.address.zone_file"
48
- }
49
- }
50
- },
51
- {
52
- "name": "string.quoted.single.address.zone_file",
53
- "match": "([A-Za-z0-9_.-]*)\\s+(?:([0-9A-Za-z]*)\\s+)?([I|i][N|n]\\s+[A-Za-z0-9]+)\\s+(.*)",
54
- "captures": {
55
- "2": {
56
- "name": "variable.other.timeunit.zone_file"
57
- },
58
- "3": {
59
- "name": "keyword.resourcetype.zone_file"
60
- },
61
- "4": {
62
- "name": "string.quoted.single.resource.address.zone_file"
63
- }
64
- }
65
- }
66
- ]
67
- }
1
+ {"name":"Bind Zone Files","scopeName":"text.zone_file","patterns":[{"name":"comment.line.semicolon.zone_file","match":";.*"},{"name":"keyword.directive.zone_file","match":"@"},{"name":"keyword.directive.zone_file","match":"\\$(ORIGIN|origin|TTL|ttl|INCLUDE|include)\\s*([^;]*)(;.*)?","captures":{"2":{"name":"variable.other.directive.zone_file"},"3":{"name":"comment.line.semicolon.zone_file"}}},{"name":"variable.other.timeunit.zone_file","match":"\\d+(H|h|D|d|W|w|M|m|Y|y)"},{"name":"string.quoted.single.address.zone_file","begin":"([A-Za-z0-9_.-]*)\\s+(?:([0-9A-Za-z]*)\\s+)?([I|i][N|n]\\s+[A-Za-z0-9]+)\\s+(.*)\\(","end":"\\)","patterns":[{"name":"comment.line.semicolon.zone_file","match":";.*"}],"beginCaptures":{"2":{"name":"variable.other.timeunit.zone_file"},"3":{"name":"keyword.resourcetype.zone_file"},"4":{"name":"string.quoted.single.resource.address.zone_file"}}},{"name":"string.quoted.single.address.zone_file","match":"([A-Za-z0-9_.-]*)\\s+(?:([0-9A-Za-z]*)\\s+)?([I|i][N|n]\\s+[A-Za-z0-9]+)\\s+(.*)","captures":{"2":{"name":"variable.other.timeunit.zone_file"},"3":{"name":"keyword.resourcetype.zone_file"},"4":{"name":"string.quoted.single.resource.address.zone_file"}}}]}
data/grammars/version CHANGED
@@ -1 +1 @@
1
- 7.11.0
1
+ 7.13.0
data/lib/linguist/VERSION CHANGED
@@ -1 +1 @@
1
- 7.11.0
1
+ 7.13.0
@@ -39,7 +39,11 @@ module Linguist
39
39
  # Set LINGUIST_DEBUG=1 or =2 to see probabilities per-token or
40
40
  # per-language. See also #dump_all_tokens, below.
41
41
  def self.train!(db, language, data)
42
- tokens = Tokenizer.tokenize(data)
42
+ tokens = data
43
+ tokens = Tokenizer.tokenize(tokens) if tokens.is_a?(String)
44
+
45
+ counts = Hash.new(0)
46
+ tokens.each { |tok| counts[tok] += 1 }
43
47
 
44
48
  db['tokens_total'] ||= 0
45
49
  db['languages_total'] ||= 0
@@ -47,13 +51,13 @@ module Linguist
47
51
  db['language_tokens'] ||= {}
48
52
  db['languages'] ||= {}
49
53
 
50
- tokens.each do |token|
54
+ counts.each do |token, count|
51
55
  db['tokens'][language] ||= {}
52
56
  db['tokens'][language][token] ||= 0
53
- db['tokens'][language][token] += 1
57
+ db['tokens'][language][token] += count
54
58
  db['language_tokens'][language] ||= 0
55
- db['language_tokens'][language] += 1
56
- db['tokens_total'] += 1
59
+ db['language_tokens'][language] += count
60
+ db['tokens_total'] += count
57
61
  end
58
62
  db['languages'][language] ||= 0
59
63
  db['languages'][language] += 1
@@ -87,6 +91,7 @@ module Linguist
87
91
  @tokens = db['tokens']
88
92
  @language_tokens = db['language_tokens']
89
93
  @languages = db['languages']
94
+ @unknown_logprob = Math.log(1 / db['tokens_total'].to_f)
90
95
  end
91
96
 
92
97
  # Internal: Guess language of data
@@ -103,9 +108,12 @@ module Linguist
103
108
 
104
109
  debug_dump_all_tokens(tokens, languages) if verbosity >= 2
105
110
 
111
+ counts = Hash.new(0)
112
+ tokens.each { |tok| counts[tok] += 1 }
113
+
106
114
  languages.each do |language|
107
- scores[language] = tokens_probability(tokens, language) + language_probability(language)
108
- debug_dump_probabilities(tokens, language, scores[language]) if verbosity >= 1
115
+ scores[language] = tokens_probability(counts, language) + language_probability(language)
116
+ debug_dump_probabilities(counts, language, scores[language]) if verbosity >= 1
109
117
  end
110
118
 
111
119
  scores.sort { |a, b| b[1] <=> a[1] }.map { |score| [score[0], score[1]] }
@@ -117,23 +125,27 @@ module Linguist
117
125
  # language - Language to check.
118
126
  #
119
127
  # Returns Float between 0.0 and 1.0.
120
- def tokens_probability(tokens, language)
121
- tokens.inject(0.0) do |sum, token|
122
- sum += Math.log(token_probability(token, language))
128
+ def tokens_probability(counts, language)
129
+ sum = 0
130
+ counts.each do |token, count|
131
+ sum += count * token_probability(token, language)
123
132
  end
133
+ sum
124
134
  end
125
135
 
126
- # Internal: Probably of token in language occurring - P(F | C)
136
+ # Internal: Log-probability of token in language occurring - P(F | C)
127
137
  #
128
138
  # token - String token.
129
139
  # language - Language to check.
130
140
  #
131
- # Returns Float between 0.0 and 1.0.
141
+ # Returns Float.
132
142
  def token_probability(token, language)
133
- if @tokens[language][token].to_f == 0.0
134
- 1 / @tokens_total.to_f
143
+ count = @tokens[language][token]
144
+ if count.nil? || count == 0
145
+ # This is usually the most common case, so we cache the result.
146
+ @unknown_logprob
135
147
  else
136
- @tokens[language][token].to_f / @language_tokens[language].to_f
148
+ Math.log(count.to_f / @language_tokens[language].to_f)
137
149
  end
138
150
  end
139
151
 
@@ -178,12 +190,11 @@ module Linguist
178
190
  token_map.sort.each { |tok, count|
179
191
  arr = languages.map { |lang| [lang, token_probability(tok, lang)] }
180
192
  min = arr.map { |a,b| b }.min
181
- minlog = Math.log(min)
182
193
  if !arr.inject(true) { |result, n| result && n[1] == arr[0][1] }
183
194
  printf "%#{maxlen}s%5d", tok, count
184
195
 
185
196
  puts arr.map { |ent|
186
- ent[1] == min ? " -" : sprintf("%10.3f", count * (Math.log(ent[1]) - minlog))
197
+ ent[1] == min ? " -" : sprintf("%10.3f", count * (ent[1] - min))
187
198
  }.join
188
199
  end
189
200
  }
@@ -83,6 +83,7 @@ module Linguist
83
83
  generated_apache_thrift? ||
84
84
  generated_jni_header? ||
85
85
  vcr_cassette? ||
86
+ generated_antlr? ||
86
87
  generated_module? ||
87
88
  generated_unity3d_meta? ||
88
89
  generated_racc? ||
@@ -98,7 +99,8 @@ module Linguist
98
99
  generated_gimp? ||
99
100
  generated_visualstudio6? ||
100
101
  generated_haxe? ||
101
- generated_jooq?
102
+ generated_jooq? ||
103
+ generated_pascal_tlb?
102
104
  end
103
105
 
104
106
  # Internal: Is the blob an Xcode file?
@@ -240,7 +242,7 @@ module Linguist
240
242
  #
241
243
  # Returns true or false
242
244
  def generated_net_designer_file?
243
- name.downcase =~ /\.designer\.(cs|vb)$/
245
+ !!name.match(/\.designer\.(cs|vb)$/i)
244
246
  end
245
247
 
246
248
  # Internal: Is this a codegen file for Specflow feature file?
@@ -251,7 +253,7 @@ module Linguist
251
253
  #
252
254
  # Returns true or false
253
255
  def generated_net_specflow_feature_file?
254
- name.downcase =~ /\.feature\.cs$/
256
+ !!name.match(/\.feature\.cs$/i)
255
257
  end
256
258
 
257
259
  # Internal: Is the blob of JS a parser generated by PEG.js?
@@ -441,6 +443,14 @@ module Linguist
441
443
  return lines[-2].include?("recorded_with: VCR")
442
444
  end
443
445
 
446
+ # Is this a generated ANTLR file?
447
+ #
448
+ # Returns true or false
449
+ def generated_antlr?
450
+ return false unless extname == '.g'
451
+ return lines[1].include?("generated by Xtest")
452
+ end
453
+
444
454
  # Internal: Is this a compiled C/C++ file from Cython?
445
455
  #
446
456
  # Cython-compiled C/C++ files typically contain:
@@ -708,6 +718,16 @@ module Linguist
708
718
  lines.first(2).any? { |l| l.include? 'This file is generated by jOOQ.' }
709
719
  end
710
720
 
721
+ # Internal: Is this a generated Delphi Interface file for a type library?
722
+ #
723
+ # Delphi Type Library Import tool generates *_TLB.pas files based on .ridl files.
724
+ # They are not meant to be altered by humans.
725
+ #
726
+ # Returns true or false
727
+ def generated_pascal_tlb?
728
+ !!name.match(/_tlb\.pas$/i)
729
+ end
730
+
711
731
  # Internal: Extract a Hash of name/content pairs from an HTML <meta> tag
712
732
  def extract_html_meta(match)
713
733
  (match.last.sub(/\/\Z/, "").strip.scan(/
@@ -0,0 +1,18 @@
1
+ # This is a list of file extensions considered too common to safely associate
2
+ # with only the formats Linguist recognises. In addition to the stipulated
3
+ # extension requirement, candidate matches must also satisfy a heuristic
4
+ # (or some other strategy) in order to be identified as any one language.
5
+
6
+ ---
7
+ extensions:
8
+ - ".1"
9
+ - ".2"
10
+ - ".3"
11
+ - ".4"
12
+ - ".5"
13
+ - ".6"
14
+ - ".7"
15
+ - ".8"
16
+ - ".9"
17
+ - ".cmp"
18
+ - ".sol"
@@ -28,27 +28,35 @@
28
28
  #
29
29
  ---
30
30
  disambiguations:
31
- - extensions: ['.1', '.1in', '.1m', '.1x', '.2', '.3', '.3in', '.3m', '.3p', '.3pm', '.3qt', '.3x', '.4', '.5', '.6', '.7', '.8', '.9', '.man', '.mdoc']
31
+ - extensions: ['.1', '.2', '.3', '.4', '.5', '.6', '.7', '.8', '.9']
32
32
  rules:
33
- # Document which uses mdoc(7) macros
34
33
  - language: Roff Manpage
35
34
  and:
36
- - pattern: '^[.''][ \t]*Dd +(?:[^"\s]+|"[^"]+")'
37
- - pattern: '^[.''][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)'
38
- - pattern: '^[.''][ \t]*Sh +(?:[^"\s]|"[^"]+")'
39
-
40
- # Document which uses man(7) macros
35
+ - named_pattern: mdoc-date
36
+ - named_pattern: mdoc-title
37
+ - named_pattern: mdoc-heading
41
38
  - language: Roff Manpage
42
39
  and:
43
- - pattern: '^[.''][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)'
44
- - pattern: '^[.''][ \t]*SH +(?:[^"\s]+|"[^"\s]+)'
45
-
46
- # Open-ended fallback to unrendered Roff source
40
+ - named_pattern: man-title
41
+ - named_pattern: man-heading
42
+ - language: Roff
43
+ pattern: '^\.(?:[A-Za-z]{2}(?:\s|$)|\\")'
44
+ - extensions: ['.1in', '.1m', '.1x', '.3in', '.3m', '.3p', '.3pm', '.3qt', '.3x', '.man', '.mdoc']
45
+ rules:
46
+ - language: Roff Manpage
47
+ and:
48
+ - named_pattern: mdoc-date
49
+ - named_pattern: mdoc-title
50
+ - named_pattern: mdoc-heading
51
+ - language: Roff Manpage
52
+ and:
53
+ - named_pattern: man-title
54
+ - named_pattern: man-heading
47
55
  - language: Roff
48
56
  - extensions: ['.al']
49
57
  rules:
50
- # AL Code pattern source from https://github.com/microsoft/AL/blob/master/grammar/alsyntax.tmlanguage - keyword.other.applicationobject.al
51
- - language: AL Code
58
+ # AL pattern source from https://github.com/microsoft/AL/blob/master/grammar/alsyntax.tmlanguage - keyword.other.applicationobject.al
59
+ - language: AL
52
60
  and:
53
61
  - pattern: '\b(?i:(CODEUNIT|PAGE|PAGEEXTENSION|PAGECUSTOMIZATION|DOTNET|ENUM|ENUMEXTENSION|VALUE|QUERY|REPORT|TABLE|TABLEEXTENSION|XMLPORT|PROFILE|CONTROLADDIN))\b'
54
62
  # Open-ended fallback to Perl AutoLoader
@@ -56,8 +64,7 @@ disambiguations:
56
64
  - extensions: ['.as']
57
65
  rules:
58
66
  - language: ActionScript
59
- pattern: '^\s*(package\s+[a-z0-9_\.]+|import\s+[a-zA-Z0-9_\.]+;|class\s+[A-Za-z0-9_]+\s+extends\s+[A-Za-z0-9_]+)'
60
- - language: AngelScript
67
+ pattern: '^\s*(?:package(?:\s+[\w.]+)?\s+(?:{|$)|import\s+[\w.*]+\s*;|(?=.*?(?:intrinsic|extends))(intrinsic\s+)?class\s+[\w<>.]+(?:\s+extends\s+[\w<>.]+)?|(?:(?:public|protected|private|static)\s+)*(?:(?:var|const|local)\s+\w+\s*:\s*[\w<>.]+(?:\s*=.*)?\s*;|function\s+\w+\s*\((?:\s*\w+\s*:\s*[\w<>.]+\s*(,\s*\w+\s*:\s*[\w<>.]+\s*)*)?\)))'
61
68
  - extensions: ['.asc']
62
69
  rules:
63
70
  - language: Public Key
@@ -103,6 +110,10 @@ disambiguations:
103
110
  pattern: '\\\w+{'
104
111
  - language: ObjectScript
105
112
  pattern: '^Class\s'
113
+ - extensions: ['.cmp']
114
+ rules:
115
+ - language: Gerber Image
116
+ pattern: '^[DGMT][0-9]{2}\*\r?\n'
106
117
  - extensions: ['.cs']
107
118
  rules:
108
119
  - language: Smalltalk
@@ -186,14 +197,16 @@ disambiguations:
186
197
  - language: Graph Modeling Language
187
198
  pattern: '(?i:^\s*(graph|node)\s+\[$)'
188
199
  - language: Gerber Image
189
- pattern: '\*\%$'
200
+ pattern: '^[DGMT][0-9]{2}\*$'
190
201
  - language: Game Maker Language
191
202
  - extensions: ['.gs']
192
203
  rules:
193
204
  - language: GLSL
194
205
  pattern: '^#version\s+[0-9]+\b'
195
206
  - language: Gosu
196
- pattern: '^uses java\.'
207
+ pattern: '^uses (java|gw)\.'
208
+ - language: Genie
209
+ pattern: '^\[indent=[0-9]+\]'
197
210
  - extensions: ['.h']
198
211
  rules:
199
212
  - language: Objective-C
@@ -271,6 +284,13 @@ disambiguations:
271
284
  pattern: '^\s*%'
272
285
  - language: Limbo
273
286
  pattern: '^\w+\s*:\s*module\s*{'
287
+ - extensions: ['.m4']
288
+ rules:
289
+ - language: M4Sugar
290
+ pattern:
291
+ - 'AC_DEFUN|AC_PREREQ|AC_INIT'
292
+ - '^_?m4_'
293
+ - language: 'M4'
274
294
  - extensions: ['.mask']
275
295
  rules:
276
296
  - language: Unity3d Asset
@@ -316,6 +336,8 @@ disambiguations:
316
336
  rules:
317
337
  - language: XML
318
338
  pattern: '^\s*<\?xml\s+version'
339
+ - language: Gerber Image
340
+ pattern: '^[DGMT][0-9]{2}\*\r?\n'
319
341
  - language: Text
320
342
  pattern: 'THE_TITLE'
321
343
  - extensions: ['.nl']
@@ -431,6 +453,12 @@ disambiguations:
431
453
  pattern:
432
454
  - '^\s*#(?:(?:if|ifdef|define|pragma)\s+\w|\s*include\s+<[^>]+>)'
433
455
  - '^\s*template\s*<'
456
+ - extensions: ['.res']
457
+ rules:
458
+ - language: ReScript
459
+ pattern:
460
+ - '^\s*(let|module|type)\s+\w*\s+=\s+'
461
+ - '^\s*(?:include|open)\s+\w+\s*$'
434
462
  - extensions: ['.rno']
435
463
  rules:
436
464
  - language: RUNOFF
@@ -448,6 +476,8 @@ disambiguations:
448
476
  pattern: '^(use |fn |mod |pub |macro_rules|impl|#!?\[)'
449
477
  - language: RenderScript
450
478
  pattern: '#include|#pragma\s+(rs|version)|__attribute__'
479
+ - language: XML
480
+ pattern: '^\s*<\?xml'
451
481
  - extensions: ['.s']
452
482
  rules:
453
483
  - language: Motorola 68K Assembly
@@ -463,7 +493,7 @@ disambiguations:
463
493
  - language: Solidity
464
494
  pattern: '\bpragma\s+solidity\b|\b(?:abstract\s+)?contract\s+(?!\d)[a-zA-Z0-9$_]+(?:\s+is\s+(?:[a-zA-Z0-9$_][^\{]*?)?)?\s*\{'
465
495
  - language: Gerber Image
466
- pattern: '^G75\*'
496
+ pattern: '^[DGMT][0-9]{2}\*\r?\n'
467
497
  - extensions: ['.sql']
468
498
  rules:
469
499
  # Postgres
@@ -488,7 +518,7 @@ disambiguations:
488
518
  - language: Perl
489
519
  named_pattern: perl5
490
520
  - language: Raku
491
- named_pattern: perl6
521
+ pattern: '^\s*(?:use\s+v6\b|\bmodule\b|\bmy\s+class\b)'
492
522
  - language: Turing
493
523
  pattern: '^\s*%[ \t]+|^\s*var\s+\w+(\s*:\s*\w+)?\s*:=\s*\w+'
494
524
  - extensions: ['.toc']
@@ -519,16 +549,16 @@ disambiguations:
519
549
  # The following RegExp is simply a collapsed and simplified form of the
520
550
  # VIM_MODELINE pattern in `./lib/linguist/strategy/modeline.rb`.
521
551
  - language: Vim Help File
522
- pattern: '(?:(?:\s|^)vi(?:m[<=>]?\d+|m)?|\sex)(?=:(?=\s*set?\s[^\n:]+:)|:(?!\s* set?\s))(?:(?:\s|\s*:\s*)\w*(?:\s*=(?:[^\\\s]|\\.)*)?)*[\s:](?:filetype|ft|syntax)\s*=help(?=\s|:|$)'
552
+ pattern: '(?:(?:[ \t]|^)vi(?:m[<=>]?\d+|m)?|[ \t]ex)(?=:(?=[ \t]*set?[ \t][^\n:]+:)|:(?![ \t]* set?[ \t]))(?:(?:[ \t]|[ \t]*:[ \t]*)\w*(?:[ \t]*=(?:[^\\[ \t]]|\\.)*)?)*[[ \t]:](?:filetype|ft|syntax)[ \t]*=help(?=[ \t]|:|$)'
523
553
  # HACK: This is a contrived use of heuristics needed to address
524
554
  # an unusual edge-case. See https://git.io/JULye for discussion.
525
555
  - language: Text
526
556
  - extensions: ['.v']
527
557
  rules:
528
558
  - language: Coq
529
- pattern: '\(\*.*?\*\)|(?:^|\s)(?:Proof|Qed)\.(?:$|\s)|(?:^|\s)Require[ \t]+Import\s'
559
+ pattern: '(?:^|\s)(?:Proof|Qed)\.(?:$|\s)|(?:^|\s)Require[ \t]+(Import|Export)\s'
530
560
  - language: Verilog
531
- pattern: '^[ \t]*module\s+[^\s()]+\s+\#?\(|^[ \t]*`(?:ifdef|timescale)\s|^[ \t]*always[ \t]+@'
561
+ pattern: '^[ \t]*module\s+[^\s()]+\s+\#?\(|^[ \t]*`(?:define|ifdef|ifndef|include|timescale)|^[ \t]*always[ \t]+@|^[ \t]*initial[ \t]+(begin|@)'
532
562
  - language: V
533
563
  pattern: '\$(?:if|else)[ \t]|^[ \t]*fn\s+[^\s()]+\(.*?\).*?\{|^[ \t]*for\s*\{'
534
564
  - extensions: ['.vba']
@@ -576,6 +606,11 @@ named_patterns:
576
606
  - '(?im)^\s*move[mp](?:\.[wl])?\b'
577
607
  - '(?im)^\s*btst\b'
578
608
  - '(?im)^\s*dbra\b'
609
+ man-heading: '^[.''][ \t]*SH +(?:[^"\s]+|"[^"\s]+)'
610
+ man-title: '^[.''][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)'
611
+ mdoc-date: '^[.''][ \t]*Dd +(?:[^"\s]+|"[^"]+")'
612
+ mdoc-heading: '^[.''][ \t]*Sh +(?:[^"\s]|"[^"]+")'
613
+ mdoc-title: '^[.''][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)'
579
614
  objectivec: '^\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">])'
580
615
  perl5: '\buse\s+(?:strict\b|v?5\.)'
581
616
  perl6: '^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)'