github-linguist 7.25.0 → 7.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/ext/linguist/lex.linguist_yy.c +14 -17
  3. data/ext/linguist/lex.linguist_yy.h +2 -2
  4. data/ext/linguist/tokenizer.l +0 -1
  5. data/grammars/inline.graphql.scala.json +1 -0
  6. data/grammars/markdown.curry.codeblock.json +1 -1
  7. data/grammars/markdown.d2.codeblock.json +1 -0
  8. data/grammars/markdown.talon.codeblock.json +1 -0
  9. data/grammars/source.abap.json +1 -1
  10. data/grammars/source.abl.json +1 -1
  11. data/grammars/source.acucobol.json +1 -1
  12. data/grammars/source.aidl.json +1 -1
  13. data/grammars/source.apex.json +1 -0
  14. data/grammars/source.astro.json +1 -1
  15. data/grammars/source.ballerina.json +1 -1
  16. data/grammars/source.bicep.json +1 -1
  17. data/grammars/source.brs.json +1 -1
  18. data/grammars/source.bsl.json +1 -1
  19. data/grammars/source.cds.json +1 -1
  20. data/grammars/source.clar.json +1 -1
  21. data/grammars/source.cobol.json +1 -1
  22. data/grammars/source.cs.json +1 -1
  23. data/grammars/source.d2.json +1 -0
  24. data/grammars/source.dart.json +1 -1
  25. data/grammars/source.denizenscript.json +1 -1
  26. data/grammars/source.did.json +1 -0
  27. data/grammars/source.directivesmf.json +1 -0
  28. data/grammars/source.dm.json +1 -1
  29. data/grammars/source.earthfile.json +1 -1
  30. data/grammars/source.emacs.lisp.json +1 -1
  31. data/grammars/source.fsharp.json +1 -1
  32. data/grammars/source.gfm.blade.json +1 -1
  33. data/grammars/source.gleam.json +1 -1
  34. data/grammars/source.igor.json +1 -1
  35. data/grammars/source.julia.json +1 -1
  36. data/grammars/source.kotlin.json +1 -1
  37. data/grammars/source.lolcode.json +1 -0
  38. data/grammars/source.matlab.json +1 -1
  39. data/grammars/source.mdx.json +1 -0
  40. data/grammars/source.mo.json +1 -1
  41. data/grammars/source.move.json +1 -1
  42. data/grammars/source.nasal.json +1 -0
  43. data/grammars/source.nim.json +1 -1
  44. data/grammars/source.nushell.json +1 -0
  45. data/grammars/source.pact.json +1 -0
  46. data/grammars/source.pddl.json +1 -1
  47. data/grammars/source.pic.json +1 -1
  48. data/grammars/source.pnlgrp.json +1 -1
  49. data/grammars/source.prisma.json +1 -1
  50. data/grammars/source.ql.json +1 -1
  51. data/grammars/source.raku.json +1 -1
  52. data/grammars/source.rbs.json +1 -0
  53. data/grammars/source.rescript.json +1 -1
  54. data/grammars/source.rez.json +1 -0
  55. data/grammars/source.rmcobol.json +1 -0
  56. data/grammars/source.rpgle.json +1 -1
  57. data/grammars/source.scala.json +1 -1
  58. data/grammars/source.scenic.json +1 -1
  59. data/grammars/source.smithy.json +1 -1
  60. data/grammars/source.solidity.json +1 -1
  61. data/grammars/source.soql.json +1 -0
  62. data/grammars/source.stan.json +1 -1
  63. data/grammars/source.talon.json +1 -1
  64. data/grammars/source.tlverilog.json +1 -0
  65. data/grammars/source.toc.json +1 -1
  66. data/grammars/source.ts.json +1 -1
  67. data/grammars/source.tsx.json +1 -1
  68. data/grammars/source.turtle.json +1 -1
  69. data/grammars/source.typst.json +1 -0
  70. data/grammars/source.vba.json +1 -0
  71. data/grammars/source.vyper.json +1 -1
  72. data/grammars/source.wgsl.json +1 -0
  73. data/grammars/source.wit.json +1 -0
  74. data/grammars/source.wwb.json +1 -0
  75. data/grammars/source.yul.json +1 -1
  76. data/grammars/text.adblock.json +1 -1
  77. data/grammars/text.haml.json +1 -1
  78. data/grammars/text.hash-commented.json +1 -1
  79. data/grammars/text.html.markdown.d2.json +1 -0
  80. data/grammars/text.marko.json +1 -1
  81. data/grammars/text.md.json +1 -0
  82. data/grammars/text.pseudoxml.json +1 -0
  83. data/grammars/text.tex.latex.sweave.json +1 -0
  84. data/grammars/text.xml.svg.json +1 -1
  85. data/grammars/version +1 -1
  86. data/lib/linguist/VERSION +1 -1
  87. data/lib/linguist/generated.rb +10 -0
  88. data/lib/linguist/heuristics.rb +2 -0
  89. data/lib/linguist/heuristics.yml +83 -42
  90. data/lib/linguist/languages.json +1 -1
  91. data/lib/linguist/languages.yml +203 -19
  92. data/lib/linguist/samples.json +1 -1
  93. data/lib/linguist/vendor.yml +4 -1
  94. metadata +39 -16
  95. data/grammars/source.gfm.json +0 -1
  96. data/grammars/source.nim_filter.json +0 -1
  97. data/grammars/source.nimcfg.json +0 -1
@@ -64,17 +64,17 @@ disambiguations:
64
64
  - extensions: ['.app']
65
65
  rules:
66
66
  - language: Erlang
67
- pattern: '(?m)^{\s*(?:application|''application'')\s*,\s*(?:[a-z]+[\w@]*|''[^'']+'')\s*,\s*\[.*?\]\s*}\.[ \t]*$'
67
+ pattern: '^\{\s*(?:application|''application'')\s*,\s*(?:[a-z]+[\w@]*|''[^'']+'')\s*,\s*\[(?:.|[\r\n])*\]\s*\}\.[ \t]*$'
68
68
  - extensions: ['.as']
69
69
  rules:
70
70
  - language: ActionScript
71
- 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*)*)?\)))'
71
+ 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*)*)?\)))'
72
72
  - extensions: ['.asc']
73
73
  rules:
74
74
  - language: Public Key
75
75
  pattern: '^(----[- ]BEGIN|ssh-(rsa|dss)) '
76
76
  - language: AsciiDoc
77
- pattern: '^[=-]+(\s|\n)|{{[A-Za-z]'
77
+ pattern: '^[=-]+\s|\{\{[A-Za-z]'
78
78
  - language: AGS Script
79
79
  pattern: '^(\/\/.+|((import|export)\s+)?(function|int|float|char)\s+((room|repeatedly|on|game)_)?([A-Za-z]+[A-Za-z_0-9]+)\s*[;\(])'
80
80
  - extensions: ['.asm']
@@ -89,9 +89,15 @@ disambiguations:
89
89
  - extensions: ['.bas']
90
90
  rules:
91
91
  - language: FreeBasic
92
- pattern: '^[ \t]*#(?:define|endif|endmacro|ifn?def|if|include|lang|macro)\s'
92
+ pattern: '^[ \t]*#(?i)(?:define|endif|endmacro|ifn?def|include|lang|macro)(?:$|\s)'
93
93
  - language: BASIC
94
- pattern: '^\A\s*\d+'
94
+ pattern: '\A\s*\d'
95
+ - language: VBA
96
+ and:
97
+ - named_pattern: vb-module
98
+ - named_pattern: vba
99
+ - language: Visual Basic 6.0
100
+ named_pattern: vb-module
95
101
  - extensions: ['.bb']
96
102
  rules:
97
103
  - language: BlitzBasic
@@ -113,7 +119,7 @@ disambiguations:
113
119
  - extensions: ['.bi']
114
120
  rules:
115
121
  - language: FreeBasic
116
- pattern: '^[ \t]*#(?:define|endif|endmacro|ifn?def|if|include|lang|macro)\s'
122
+ pattern: '^[ \t]*#(?i)(?:define|endif|endmacro|ifn?def|if|include|lang|macro)(?:$|\s)'
117
123
  - extensions: ['.bs']
118
124
  rules:
119
125
  - language: Bikeshed
@@ -124,6 +130,8 @@ disambiguations:
124
130
  - (?i:^\s*(end\ssub)$)
125
131
  - (?i:^\s*(?=^function\s)(?:function\s*\w+\(.*?\)\s*as\s*\w*)|(?::\s*function\(.*?\)\s*as\s*\w*)$)
126
132
  - (?i:^\s*(end\sfunction)$)
133
+ - language: Bluespec BH
134
+ pattern: '^package\s+[A-Za-z_][A-Za-z0-9_'']*(?:\s*\(|\s+where)'
127
135
  - extensions: ['.builds']
128
136
  rules:
129
137
  - language: XML
@@ -145,23 +153,23 @@ disambiguations:
145
153
  - language: Visual Basic 6.0
146
154
  and:
147
155
  - named_pattern: vb-class
148
- - pattern: '^\s*BEGIN\R\s*MultiUse\s*=.*\R\s*Persistable\s*='
156
+ - pattern: '^\s*BEGIN(?:\r?\n|\r)\s*MultiUse\s*=.*(?:\r?\n|\r)\s*Persistable\s*='
149
157
  - language: VBA
150
- named_pattern: vb-class
158
+ named_pattern: vb-class
151
159
  - language: TeX
152
- pattern: '^\s*\\(?:NeedsTeXFormat|ProvidesClass){'
160
+ pattern: '^\s*\\(?:NeedsTeXFormat|ProvidesClass)\{'
153
161
  - language: ObjectScript
154
162
  pattern: '^Class\s'
155
163
  - extensions: ['.cmp']
156
164
  rules:
157
165
  - language: Gerber Image
158
- pattern: '^[DGMT][0-9]{2}\*\r?\n'
166
+ pattern: '^[DGMT][0-9]{2}\*(?:\r?\n|\r)'
159
167
  - extensions: ['.cs']
160
168
  rules:
161
169
  - language: Smalltalk
162
170
  pattern: '![\w\s]+methodsFor: '
163
171
  - language: 'C#'
164
- pattern: '^\s*(using\s+[A-Z][\s\w.]+;|namespace\s*[\w\.]+\s*({|;)|\/\/)'
172
+ pattern: '^\s*(using\s+[A-Z][\s\w.]+;|namespace\s*[\w\.]+\s*(\{|;)|\/\/)'
165
173
  - extensions: ['.csc']
166
174
  rules:
167
175
  - language: GSC
@@ -169,7 +177,7 @@ disambiguations:
169
177
  - extensions: ['.csl']
170
178
  rules:
171
179
  - language: XML
172
- pattern: '(?i:^\s*(\<\?xml|xmlns))'
180
+ pattern: '(?i:^\s*(<\?xml|xmlns))'
173
181
  - language: Kusto
174
182
  pattern: '(^\|\s*(where|extend|project|limit|summarize))|(^\.\w+)'
175
183
  - extensions: ['.d']
@@ -177,10 +185,10 @@ disambiguations:
177
185
  - language: D
178
186
  # see http://dlang.org/spec/grammar
179
187
  # ModuleDeclaration | ImportDeclaration | FuncDeclaration | unittest
180
- pattern: '^module\s+[\w.]*\s*;|import\s+[\w\s,.:]*;|\w+\s+\w+\s*\(.*\)(?:\(.*\))?\s*{[^}]*}|unittest\s*(?:\(.*\))?\s*{[^}]*}'
188
+ pattern: '^module\s+[\w.]*\s*;|import\s+[\w\s,.:]*;|\w+\s+\w+\s*\(.*\)(?:\(.*\))?\s*\{[^}]*\}|unittest\s*(?:\(.*\))?\s*\{[^}]*\}'
181
189
  - language: DTrace
182
190
  # see http://dtrace.org/guide/chp-prog.html, http://dtrace.org/guide/chp-profile.html, http://dtrace.org/guide/chp-opt.html
183
- pattern: '^(\w+:\w*:\w*:\w*|BEGIN|END|provider\s+|(tick|profile)-\w+\s+{[^}]*}|#pragma\s+D\s+(option|attributes|depends_on)\s|#pragma\s+ident\s)'
191
+ pattern: '^(\w+:\w*:\w*:\w*|BEGIN|END|provider\s+|(tick|profile)-\w+\s+\{[^}]*\}|#pragma\s+D\s+(option|attributes|depends_on)\s|#pragma\s+ident\s)'
184
192
  - language: Makefile
185
193
  # path/target : dependency \
186
194
  # target : \
@@ -198,8 +206,8 @@ disambiguations:
198
206
  - language: E
199
207
  pattern:
200
208
  - '^\s*(def|var)\s+(.+):='
201
- - '^\s*(def|to)\s+(\w+)(\(.+\))?\s+{'
202
- - '^\s*(when)\s+(\(.+\))\s+->\s+{'
209
+ - '^\s*(def|to)\s+(\w+)(\(.+\))?\s+\{'
210
+ - '^\s*(when)\s+(\(.+\))\s+->\s+\{'
203
211
  - language: Eiffel
204
212
  pattern:
205
213
  - '^\s*\w+\s*(?:,\s*\w+)*[:]\s*\w+\s'
@@ -218,7 +226,7 @@ disambiguations:
218
226
  - language: Erlang
219
227
  pattern: '^\s*(?:%%|main\s*\(.*?\)\s*->)'
220
228
  - language: JavaScript
221
- pattern: '(?m:\/\/|("|'')use strict\1|export\s+default\s|\/\*.*?\*\/)'
229
+ pattern: '\/\/|("|'')use strict\1|export\s+default\s|\/\*(?:.|[\r\n])*?\*\/'
222
230
  - extensions: ['.ex']
223
231
  rules:
224
232
  - language: Elixir
@@ -254,11 +262,11 @@ disambiguations:
254
262
  - language: VBA
255
263
  and:
256
264
  - named_pattern: vb-form
257
- - pattern: '^\s*Begin\s+{[0-9A-Z\-]*}\s?'
265
+ - pattern: '^\s*Begin\s+\{[0-9A-Z\-]*\}\s?'
258
266
  - language: Visual Basic 6.0
259
267
  and:
260
268
  - named_pattern: vb-form
261
- - pattern: '^\s*Begin\s+VB\.Form\s+'
269
+ - pattern: '^\s*Begin\s+VB\.Form\s+'
262
270
  - extensions: ['.fs']
263
271
  rules:
264
272
  - language: Forth
@@ -272,7 +280,7 @@ disambiguations:
272
280
  - extensions: ['.ftl']
273
281
  rules:
274
282
  - language: FreeMarker
275
- pattern: '^(?:<|[a-zA-Z-][a-zA-Z0-9_-]+[ \t]+\w)|\${\w+[^\n]*?}|^[ \t]*(?:<#--.*?-->|<#([a-z]+)(?=\s|>)[^>]*>.*?</#\1>|\[#--.*?--\]|\[#([a-z]+)(?=\s|\])[^\]]*\].*?\[#\2\])'
283
+ pattern: '^(?:<|[a-zA-Z-][a-zA-Z0-9_-]+[ \t]+\w)|\$\{\w+[^\r\n]*?\}|^[ \t]*(?:<#--.*?-->|<#([a-z]+)(?=\s|>)[^>]*>.*?</#\1>|\[#--.*?--\]|\[#([a-z]+)(?=\s|\])[^\]]*\].*?\[#\2\])'
276
284
  - language: Fluent
277
285
  pattern: '^-?[a-zA-Z][a-zA-Z0-9_-]* *=|\{\$-?[a-zA-Z][-\w]*(?:\.[a-zA-Z][-\w]*)?\}'
278
286
  - extensions: ['.g']
@@ -280,7 +288,7 @@ disambiguations:
280
288
  - language: GAP
281
289
  pattern: '\s*(Declare|BindGlobal|KeyDependentOperation|Install(Method|GlobalFunction)|SetPackageInfo)'
282
290
  - language: G-code
283
- pattern: '^[MG][0-9]+\n'
291
+ pattern: '^[MG][0-9]+(?:\r?\n|\r)'
284
292
  - extensions: ['.gd']
285
293
  rules:
286
294
  - language: GAP
@@ -290,7 +298,7 @@ disambiguations:
290
298
  - extensions: ['.gml']
291
299
  rules:
292
300
  - language: XML
293
- pattern: '(?i:^\s*(\<\?xml|xmlns))'
301
+ pattern: '(?i:^\s*(<\?xml|xmlns))'
294
302
  - language: Graph Modeling Language
295
303
  pattern: '(?i:^\s*(graph|node)\s+\[$)'
296
304
  - language: Gerber Image
@@ -347,21 +355,21 @@ disambiguations:
347
355
  pattern: '^<\?(?:php)?'
348
356
  - language: SourcePawn
349
357
  pattern:
350
- - '^public\s+(?:SharedPlugin(?:\s+|:)__pl_\w+\s*=(?:\s*{)?|(?:void\s+)?__pl_\w+_SetNTVOptional\(\)(?:\s*{)?)'
358
+ - '^public\s+(?:SharedPlugin(?:\s+|:)__pl_\w+\s*=(?:\s*\{)?|(?:void\s+)?__pl_\w+_SetNTVOptional\(\)(?:\s*\{)?)'
351
359
  - '^methodmap\s+\w+\s+<\s+\w+'
352
360
  - '^\s*MarkNativeAsOptional\s*\('
353
361
  - language: NASL
354
362
  pattern:
355
363
  - '^\s*include\s*\(\s*(?:"|'')[\\/\w\-\.:\s]+\.(?:nasl|inc)\s*(?:"|'')\s*\)\s*;'
356
364
  - '^\s*(?:global|local)_var\s+(?:\w+(?:\s*=\s*[\w\-"'']+)?\s*)(?:,\s*\w+(?:\s*=\s*[\w\-"'']+)?\s*)*+\s*;'
357
- - '^\s*namespace\s+\w+\s*{'
358
- - '^\s*object\s+\w+\s*(?:extends\s+\w+(?:::\w+)?)?\s*{'
359
- - '^\s*(?:public\s+|private\s+|\s*)function\s+\w+\s*\([\w\s,]*\)\s*{'
365
+ - '^\s*namespace\s+\w+\s*\{'
366
+ - '^\s*object\s+\w+\s*(?:extends\s+\w+(?:::\w+)?)?\s*\{'
367
+ - '^\s*(?:public\s+|private\s+|\s*)function\s+\w+\s*\([\w\s,]*\)\s*\{'
360
368
  - language: POV-Ray SDL
361
369
  pattern: '^\s*#(declare|local|macro|while)\s'
362
370
  - language: Pascal
363
371
  pattern:
364
- - '(?i:^\s*{\$(?:mode|ifdef|undef|define)[ ]+[a-z0-9_]+})'
372
+ - '(?i:^\s*\{\$(?:mode|ifdef|undef|define)[ ]+[a-z0-9_]+\})'
365
373
  - '^\s*end[.;]\s*$'
366
374
  - extensions: ['.json']
367
375
  rules:
@@ -383,7 +391,7 @@ disambiguations:
383
391
  - extensions: ['.ls']
384
392
  rules:
385
393
  - language: LoomScript
386
- pattern: '^\s*package\s*[\w\.\/\*\s]*\s*{'
394
+ pattern: '^\s*package\s*[\w\.\/\*\s]*\s*\{'
387
395
  - language: LiveScript
388
396
  - extensions: ['.lsp', '.lisp']
389
397
  rules:
@@ -408,7 +416,7 @@ disambiguations:
408
416
  - language: MATLAB
409
417
  pattern: '^\s*%'
410
418
  - language: Limbo
411
- pattern: '^\w+\s*:\s*module\s*{'
419
+ pattern: '^\w+\s*:\s*module\s*\{'
412
420
  - extensions: ['.m4']
413
421
  rules:
414
422
  - language: M4Sugar
@@ -425,7 +433,7 @@ disambiguations:
425
433
  - language: Win32 Message File
426
434
  pattern: '(?i)^[ \t]*(?>\/\*\s*)?MessageId=|^\.$'
427
435
  - language: M4
428
- pattern: '^dnl|^divert\((?:-?\d+)?\)|^\w+\(`[^\n]*?''[),]'
436
+ pattern: '^dnl|^divert\((?:-?\d+)?\)|^\w+\(`[^\r\n]*?''[),]'
429
437
  - language: Monkey C
430
438
  pattern: '\b(?:using|module|function|class|var)\s+\w'
431
439
  - extensions: ['.md']
@@ -470,7 +478,7 @@ disambiguations:
470
478
  - language: XML
471
479
  pattern: '^\s*<\?xml\s+version'
472
480
  - language: Gerber Image
473
- pattern: '^[DGMT][0-9]{2}\*\r?\n'
481
+ pattern: '^[DGMT][0-9]{2}\*(?:\r?\n|\r)'
474
482
  - language: Text
475
483
  pattern: 'THE_TITLE'
476
484
  - extensions: ['.nl']
@@ -478,6 +486,11 @@ disambiguations:
478
486
  - language: NL
479
487
  pattern: '^(b|g)[0-9]+ '
480
488
  - language: NewLisp
489
+ - extensions: ['.nu']
490
+ rules:
491
+ - language: Nushell
492
+ pattern: '^\s*(import|export|module|def|let|let-env) '
493
+ - language: Nu
481
494
  - extensions: ['.odin']
482
495
  rules:
483
496
  - language: Object Data Instance Notation
@@ -529,7 +542,7 @@ disambiguations:
529
542
  - extensions: ['.pod']
530
543
  rules:
531
544
  - language: Pod 6
532
- pattern: '^[\s&&[^\n]]*=(comment|begin pod|begin para|item\d+)'
545
+ pattern: '^[\s&&[^\r\n]]*=(comment|begin pod|begin para|item\d+)'
533
546
  - language: Pod
534
547
  - extensions: ['.pp']
535
548
  rules:
@@ -568,7 +581,7 @@ disambiguations:
568
581
  - extensions: ['.q']
569
582
  rules:
570
583
  - language: q
571
- pattern: '((?i:[A-Z.][\w.]*:{)|(^|\n)\\(cd?|d|l|p|ts?) )'
584
+ pattern: '((?i:[A-Z.][\w.]*:\{)|^\\(cd?|d|l|p|ts?) )'
572
585
  - language: HiveQL
573
586
  pattern: '(?i:SELECT\s+[\w*,]+\s+FROM|(CREATE|ALTER|DROP)\s(DATABASE|SCHEMA|TABLE))'
574
587
  - extensions: ['.qs']
@@ -581,6 +594,8 @@ disambiguations:
581
594
  rules:
582
595
  - language: Rebol
583
596
  pattern: '(?i:\bRebol\b)'
597
+ - language: Rez
598
+ pattern: '(#include\s+["<](Types\.r|Carbon\/Carbon\.r)[">])|((resource|data|type)\s+''[A-Za-z0-9]{4}''\s+((\(.*\)\s+){0,1}){)'
584
599
  - language: R
585
600
  pattern: '<-|^\s*#'
586
601
  - extensions: ['.re']
@@ -589,7 +604,7 @@ disambiguations:
589
604
  pattern:
590
605
  - '^\s*module\s+type\s'
591
606
  - '^\s*(?:include|open)\s+\w+\s*;\s*$'
592
- - '^\s*let\s+(?:module\s\w+\s*=\s*{|\w+:\s+.*=.*;\s*$)'
607
+ - '^\s*let\s+(?:module\s\w+\s*=\s*\{|\w+:\s+.*=.*;\s*$)'
593
608
  - language: C++
594
609
  pattern:
595
610
  - '^\s*#(?:(?:if|ifdef|define|pragma)\s+\w|\s*include\s+<[^>]+>)'
@@ -609,7 +624,7 @@ disambiguations:
609
624
  - extensions: ['.rpy']
610
625
  rules:
611
626
  - language: Python
612
- pattern: '(?m:^(import|from|class|def)\s)'
627
+ pattern: '^(import|from|class|def)\s'
613
628
  - language: "Ren'Py"
614
629
  - extensions: ['.rs']
615
630
  rules:
@@ -641,7 +656,7 @@ disambiguations:
641
656
  - language: Solidity
642
657
  pattern: '\bpragma\s+solidity\b|\b(?:abstract\s+)?contract\s+(?!\d)[a-zA-Z0-9$_]+(?:\s+is\s+(?:[a-zA-Z0-9$_][^\{]*?)?)?\s*\{'
643
658
  - language: Gerber Image
644
- pattern: '^[DGMT][0-9]{2}\*\r?\n'
659
+ pattern: '^[DGMT][0-9]{2}\*(?:\r?\n|\r)'
645
660
  - extensions: ['.sql']
646
661
  rules:
647
662
  # Postgres
@@ -666,7 +681,7 @@ disambiguations:
666
681
  - language: StringTemplate
667
682
  pattern: '\$\w+[($]|(.)!\s*.+?\s*!\1|<!\s*.+?\s*!>|\[!\s*.+?\s*!\]|\{!\s*.+?\s*!\}'
668
683
  - language: Smalltalk
669
- pattern: '\A\s*[\[{(^"''\w#]|[a-zA-Z_]\w*\s*:=\s*[a-zA-Z_]\w*|class\s*>>\s*[a-zA-Z_]\w*|^[a-zA-Z_]\w*\s+[a-zA-Z_]\w*:|^Class\s*{|if(?:True|False):\s*\['
684
+ pattern: '\A\s*[\[{(^"''\w#]|[a-zA-Z_]\w*\s*:=\s*[a-zA-Z_]\w*|class\s*>>\s*[a-zA-Z_]\w*|^[a-zA-Z_]\w*\s+[a-zA-Z_]\w*:|^Class\s*\{|if(?:True|False):\s*\['
670
685
  - extensions: ['.star']
671
686
  rules:
672
687
  - language: STAR
@@ -675,7 +690,7 @@ disambiguations:
675
690
  - extensions: ['.stl']
676
691
  rules:
677
692
  - language: STL
678
- pattern: '\A\s*solid(?=$|\s)(?m:.*?)\Rendsolid(?:$|\s)'
693
+ pattern: '\A\s*solid(?:$|\s)[\s\S]*^endsolid(?:$|\s)'
679
694
  - extensions: ['.sw']
680
695
  rules:
681
696
  - language: Sway
@@ -696,6 +711,10 @@ disambiguations:
696
711
  rules:
697
712
  - language: Java Server Pages
698
713
  pattern: '<%[@!=\s]?\s*(taglib|tag|include|attribute|variable)\s'
714
+ - extensions: ['.tlv']
715
+ rules:
716
+ - language: TL-Verilog
717
+ pattern: '^\\.{0,10}TLV_version'
699
718
  - extensions: ['.toc']
700
719
  rules:
701
720
  - language: World of Warcraft Addon Data
@@ -749,10 +768,15 @@ disambiguations:
749
768
  # HACK: This is a contrived use of heuristics needed to address
750
769
  # an unusual edge-case. See https://git.io/JULye for discussion.
751
770
  - language: Text
771
+ - extensions: ['.typ']
772
+ rules:
773
+ - language: Typst
774
+ pattern: '^#(import|show|let|set)'
775
+ - language: XML
752
776
  - extensions: ['.url']
753
777
  rules:
754
778
  - language: INI
755
- pattern: '^\[InternetShortcut\]\R(?>[^\s\[][^\n]*\R)*URL='
779
+ pattern: '^\[InternetShortcut\](?:\r?\n|\r)(?>[^\s\[][^\r\n]*(?:\r?\n|\r))*URL='
756
780
  - extensions: ['.v']
757
781
  rules:
758
782
  - language: Coq
@@ -777,7 +801,7 @@ disambiguations:
777
801
  - language: DirectX 3D File
778
802
  pattern: '^xof 030(2|3)(?:txt|bin|tzip|bzip)\b'
779
803
  - language: RPC
780
- pattern: '\b(program|version)\s+\w+\s*{|\bunion\s+\w+\s+switch\s*\('
804
+ pattern: '\b(program|version)\s+\w+\s*\{|\bunion\s+\w+\s+switch\s*\('
781
805
  - language: Logos
782
806
  pattern: '^%(end|ctor|hook|group)\b'
783
807
  - language: Linker Script
@@ -838,5 +862,22 @@ named_patterns:
838
862
  - '^\s*package\s+[^\W\d]\w*(?:::\w+)*\s*(?:[;{]|\sv?\d)'
839
863
  - '[\s$][^\W\d]\w*(?::\w+)*->[a-zA-Z_\[({]'
840
864
  raku: '^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)'
841
- vb-class: '^\s*VERSION\s+[0-9]\.[0-9]\s+CLASS'
842
- vb-form: '^\s*VERSION\s+[0-9]\.[0-9]{2}'
865
+ vb-class: '^[ ]*VERSION [0-9]\.[0-9] CLASS'
866
+ vb-form: '^[ ]*VERSION [0-9]\.[0-9]{2}'
867
+ vb-module: '^[ ]*Attribute VB_Name = '
868
+ vba:
869
+ - '\b(?:VBA|[vV]ba)(?:\b|[0-9A-Z_])'
870
+ # VBA7 new 64-bit features
871
+ - '^[ ]*(?:Public|Private)? Declare PtrSafe (?:Sub|Function)\b'
872
+ - '^[ ]*#If Win64\b'
873
+ - '^[ ]*(?:Dim|Const) [0-9a-zA-Z_]*[ ]*As Long(?:Ptr|Long)\b'
874
+ # Top module declarations unique to VBA
875
+ - '^[ ]*Option (?:Private Module|Compare Database)\b'
876
+ # General VBA libraries and objects
877
+ - '(?: |\()(?:Access|Excel|Outlook|PowerPoint|Visio|Word|VBIDE)\.\w'
878
+ - '\b(?:(?:Active)?VBProjects?|VBComponents?|Application\.(?:VBE|ScreenUpdating))\b'
879
+ # AutoCAD, Outlook, PowerPoint and Word objects
880
+ - '\b(?:ThisDrawing|AcadObject|Active(?:Explorer|Inspector|Window\.Presentation|Presentation|Document)|Selection\.(?:Find|Paragraphs))\b'
881
+ # Excel objects
882
+ - '\b(?:(?:This|Active)?Workbooks?|Worksheets?|Active(?:Sheet|Chart|Cell)|WorksheetFunction)\b'
883
+ - '\b(?:Range\(".*|Cells\([0-9a-zA-Z_]*, (?:[0-9a-zA-Z_]*|"[a-zA-Z]{1,3}"))\)'