linguist-js 2.5.4 → 2.5.5

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.
package/dist/schema.d.ts CHANGED
@@ -1,37 +1,37 @@
1
- import { Category, Language } from './types';
2
- export interface LanguagesScema {
3
- [name: string]: {
4
- language_id: number;
5
- fs_name?: Language;
6
- type: Category;
7
- group?: Language;
8
- color?: `#${string}`;
9
- aliases?: string[];
10
- extensions?: `.${string}`[];
11
- filenames?: string[];
12
- interpreters?: string[];
13
- tm_scope?: `${'source' | 'text'}.${string}`;
14
- ace_mode?: string;
15
- codemirror_mode?: string;
16
- codemirror_mime_type?: `${string}/${string}`;
17
- wrap?: boolean;
18
- };
19
- }
20
- interface HeuristicsRules {
21
- pattern?: string;
22
- named_pattern?: string;
23
- named_patterns?: string[];
24
- negative_pattern?: string;
25
- }
26
- export interface HeuristicsSchema {
27
- disambiguations: Array<{
28
- extensions: string[];
29
- rules: Array<HeuristicsRules & {
30
- language: string | string[];
31
- and?: HeuristicsRules[];
32
- }>;
33
- }>;
34
- named_patterns: Record<string, string | string[]>;
35
- }
36
- export type VendorSchema = string[];
37
- export {};
1
+ import { Category, Language } from './types';
2
+ export interface LanguagesScema {
3
+ [name: string]: {
4
+ language_id: number;
5
+ fs_name?: Language;
6
+ type: Category;
7
+ group?: Language;
8
+ color?: `#${string}`;
9
+ aliases?: string[];
10
+ extensions?: `.${string}`[];
11
+ filenames?: string[];
12
+ interpreters?: string[];
13
+ tm_scope?: `${'source' | 'text'}.${string}`;
14
+ ace_mode?: string;
15
+ codemirror_mode?: string;
16
+ codemirror_mime_type?: `${string}/${string}`;
17
+ wrap?: boolean;
18
+ };
19
+ }
20
+ interface HeuristicsRules {
21
+ pattern?: string;
22
+ named_pattern?: string;
23
+ named_patterns?: string[];
24
+ negative_pattern?: string;
25
+ }
26
+ export interface HeuristicsSchema {
27
+ disambiguations: Array<{
28
+ extensions: string[];
29
+ rules: Array<HeuristicsRules & {
30
+ language: string | string[];
31
+ and?: HeuristicsRules[];
32
+ }>;
33
+ }>;
34
+ named_patterns: Record<string, string | string[]>;
35
+ }
36
+ export type VendorSchema = string[];
37
+ export {};
package/dist/schema.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/types.d.ts CHANGED
@@ -1,47 +1,47 @@
1
- export type LanguageResult = string | null;
2
- export type Language = string;
3
- export type Category = 'data' | 'markup' | 'programming' | 'prose';
4
- export type FilePath = string;
5
- export type Bytes = Integer;
6
- export type Integer = number;
7
- export interface Options {
8
- fileContent?: string | string[];
9
- ignoredFiles?: string[];
10
- ignoredLanguages?: Language[];
11
- categories?: Category[];
12
- keepVendored?: boolean;
13
- keepBinary?: boolean;
14
- relativePaths?: boolean;
15
- childLanguages?: boolean;
16
- quick?: boolean;
17
- offline?: boolean;
18
- checkIgnored?: boolean;
19
- checkAttributes?: boolean;
20
- checkHeuristics?: boolean;
21
- checkShebang?: boolean;
22
- checkModeline?: boolean;
23
- }
24
- export interface Results {
25
- files: {
26
- count: Integer;
27
- bytes: Bytes;
28
- /** Note: Results use slashes as delimiters even on Windows. */
29
- results: Record<FilePath, LanguageResult>;
30
- };
31
- languages: {
32
- count: Integer;
33
- bytes: Bytes;
34
- results: Record<Language, {
35
- bytes: Bytes;
36
- type: Category;
37
- parent?: Language;
38
- color?: `#${string}`;
39
- }>;
40
- };
41
- unknown: {
42
- count: Integer;
43
- bytes: Bytes;
44
- extensions: Record<string, Bytes>;
45
- filenames: Record<string, Bytes>;
46
- };
47
- }
1
+ export type LanguageResult = string | null;
2
+ export type Language = string;
3
+ export type Category = 'data' | 'markup' | 'programming' | 'prose';
4
+ export type FilePath = string;
5
+ export type Bytes = Integer;
6
+ export type Integer = number;
7
+ export interface Options {
8
+ fileContent?: string | string[];
9
+ ignoredFiles?: string[];
10
+ ignoredLanguages?: Language[];
11
+ categories?: Category[];
12
+ keepVendored?: boolean;
13
+ keepBinary?: boolean;
14
+ relativePaths?: boolean;
15
+ childLanguages?: boolean;
16
+ quick?: boolean;
17
+ offline?: boolean;
18
+ checkIgnored?: boolean;
19
+ checkAttributes?: boolean;
20
+ checkHeuristics?: boolean;
21
+ checkShebang?: boolean;
22
+ checkModeline?: boolean;
23
+ }
24
+ export interface Results {
25
+ files: {
26
+ count: Integer;
27
+ bytes: Bytes;
28
+ /** Note: Results use slashes as delimiters even on Windows. */
29
+ results: Record<FilePath, LanguageResult>;
30
+ };
31
+ languages: {
32
+ count: Integer;
33
+ bytes: Bytes;
34
+ results: Record<Language, {
35
+ bytes: Bytes;
36
+ type: Category;
37
+ parent?: Language;
38
+ color?: `#${string}`;
39
+ }>;
40
+ };
41
+ unknown: {
42
+ count: Integer;
43
+ bytes: Bytes;
44
+ extensions: Record<string, Bytes>;
45
+ filenames: Record<string, Bytes>;
46
+ };
47
+ }
package/dist/types.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -18,4 +18,4 @@
18
18
  - (^|/)[Ll]icen[cs]e(\.|$)
19
19
  - (^|/)README(\.|$)
20
20
  - (^|/)[Rr]eadme(\.|$)
21
- - ^[Ss]amples?/
21
+ - ^[Ss]amples?/
package/ext/generated.rb CHANGED
@@ -26,6 +26,7 @@ module Linguist
26
26
  generated_net_specflow_feature_file? ||
27
27
  composer_lock? ||
28
28
  cargo_lock? ||
29
+ flake_lock? ||
29
30
  node_modules? ||
30
31
  go_vendor? ||
31
32
  go_lock? ||
@@ -235,6 +236,9 @@ module Linguist
235
236
  def cargo_lock?
236
237
  !!name.match(/Cargo\.lock/)
237
238
  end
239
+ def flake_lock?
240
+ !!name.match(/(^|\/)flake\.lock$/)
241
+ end
238
242
  def vcr_cassette?
239
243
  return false unless extname == '.yml'
240
244
  return false unless lines.count > 2
@@ -392,4 +396,4 @@ module Linguist
392
396
  end.select { |x| x.length == 2 }.to_h
393
397
  end
394
398
  end
395
- end
399
+ end
@@ -30,18 +30,22 @@ disambiguations:
30
30
  rules:
31
31
  - language: AL
32
32
  and:
33
- - pattern: '\b(?i:(CODEUNIT|PAGE|PAGEEXTENSION|PAGECUSTOMIZATION|DOTNET|ENUM|ENUMEXTENSION|VALUE|QUERY|REPORT|TABLE|TABLEEXTENSION|XMLPORT|PROFILE|CONTROLADDIN))\b'
33
+ - pattern: '\b(?i:(CODEUNIT|PAGE|PAGEEXTENSION|PAGECUSTOMIZATION|DOTNET|ENUM|ENUMEXTENSION|VALUE|QUERY|REPORT|TABLE|TABLEEXTENSION|XMLPORT|PROFILE|CONTROLADDIN|REPORTEXTENSION|INTERFACE|PERMISSIONSET|PERMISSIONSETEXTENSION|ENTITLEMENT))\b'
34
34
  - language: Perl
35
+ - extensions: ['.app']
36
+ rules:
37
+ - language: Erlang
38
+ pattern: '^\{\s*(?:application|''application'')\s*,\s*(?:[a-z]+[\w@]*|''[^'']+'')\s*,\s*\[(?:.|[\r\n])*\]\s*\}\.[ \t]*$'
35
39
  - extensions: ['.as']
36
40
  rules:
37
41
  - language: ActionScript
38
- 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*)*)?\)))'
42
+ 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*)*)?\)))'
39
43
  - extensions: ['.asc']
40
44
  rules:
41
45
  - language: Public Key
42
46
  pattern: '^(----[- ]BEGIN|ssh-(rsa|dss)) '
43
47
  - language: AsciiDoc
44
- pattern: '^[=-]+(\s|\n)|{{[A-Za-z]'
48
+ pattern: '^[=-]+(\s|\n)|\{\{[A-Za-z]'
45
49
  - language: AGS Script
46
50
  pattern: '^(\/\/.+|((import|export)\s+)?(function|int|float|char)\s+((room|repeatedly|on|game)_)?([A-Za-z]+[A-Za-z_0-9]+)\s*[;\(])'
47
51
  - extensions: ['.asm']
@@ -56,9 +60,15 @@ disambiguations:
56
60
  - extensions: ['.bas']
57
61
  rules:
58
62
  - language: FreeBasic
59
- pattern: '^[ \t]*#(?:define|endif|endmacro|ifn?def|if|include|lang|macro)\s'
63
+ pattern: '^[ \t]*#(?i)(?:define|endif|endmacro|ifn?def|include|lang|macro)(?:$|\s)'
60
64
  - language: BASIC
61
- pattern: '^\s*\d+'
65
+ pattern: '\A\s*\d'
66
+ - language: VBA
67
+ and:
68
+ - named_pattern: vb-module
69
+ - named_pattern: vba
70
+ - language: Visual Basic 6.0
71
+ named_pattern: vb-module
62
72
  - extensions: ['.bb']
63
73
  rules:
64
74
  - language: BlitzBasic
@@ -80,7 +90,7 @@ disambiguations:
80
90
  - extensions: ['.bi']
81
91
  rules:
82
92
  - language: FreeBasic
83
- pattern: '^[ \t]*#(?:define|endif|endmacro|ifn?def|if|include|lang|macro)\s'
93
+ pattern: '^[ \t]*#(?i)(?:define|endif|endmacro|ifn?def|if|include|lang|macro)(?:$|\s)'
84
94
  - extensions: ['.bs']
85
95
  rules:
86
96
  - language: Bikeshed
@@ -112,11 +122,11 @@ disambiguations:
112
122
  - language: Visual Basic 6.0
113
123
  and:
114
124
  - named_pattern: vb-class
115
- - pattern: '^\s*BEGIN\R\s*MultiUse\s*=.*\R\s*Persistable\s*='
125
+ - pattern: '^\s*BEGIN(?:\r?\n|\r)\s*MultiUse\s*=.*(?:\r?\n|\r)\s*Persistable\s*='
116
126
  - language: VBA
117
- named_pattern: vb-class
127
+ named_pattern: vb-class
118
128
  - language: TeX
119
- pattern: '^\s*\\(?:NeedsTeXFormat|ProvidesClass){'
129
+ pattern: '^\s*\\(?:NeedsTeXFormat|ProvidesClass)\{'
120
130
  - language: ObjectScript
121
131
  pattern: '^Class\s'
122
132
  - extensions: ['.cmp']
@@ -128,7 +138,7 @@ disambiguations:
128
138
  - language: Smalltalk
129
139
  pattern: '![\w\s]+methodsFor: '
130
140
  - language: 'C#'
131
- pattern: '^\s*(using\s+[A-Z][\s\w.]+;|namespace\s*[\w\.]+\s*({|;)|\/\/)'
141
+ pattern: '^\s*(using\s+[A-Z][\s\w.]+;|namespace\s*[\w\.]+\s*(\{|;)|\/\/)'
132
142
  - extensions: ['.csc']
133
143
  rules:
134
144
  - language: GSC
@@ -136,15 +146,15 @@ disambiguations:
136
146
  - extensions: ['.csl']
137
147
  rules:
138
148
  - language: XML
139
- pattern: '(?i:^\s*(\<\?xml|xmlns))'
149
+ pattern: '(?i:^\s*(<\?xml|xmlns))'
140
150
  - language: Kusto
141
151
  pattern: '(^\|\s*(where|extend|project|limit|summarize))|(^\.\w+)'
142
152
  - extensions: ['.d']
143
153
  rules:
144
154
  - language: D
145
- pattern: '^module\s+[\w.]*\s*;|import\s+[\w\s,.:]*;|\w+\s+\w+\s*\(.*\)(?:\(.*\))?\s*{[^}]*}|unittest\s*(?:\(.*\))?\s*{[^}]*}'
155
+ pattern: '^module\s+[\w.]*\s*;|import\s+[\w\s,.:]*;|\w+\s+\w+\s*\(.*\)(?:\(.*\))?\s*\{[^}]*\}|unittest\s*(?:\(.*\))?\s*\{[^}]*\}'
146
156
  - language: DTrace
147
- 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)'
157
+ 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)'
148
158
  - language: Makefile
149
159
  pattern: '([\/\\].*:\s+.*\s\\$|: \\$|^[ %]:|^[\w\s\/\\.]+\w+\.\w+\s*:\s+[\w\s\/\\.]+\w+\.\w+)'
150
160
  - extensions: ['.dsp']
@@ -158,8 +168,8 @@ disambiguations:
158
168
  - language: E
159
169
  pattern:
160
170
  - '^\s*(def|var)\s+(.+):='
161
- - '^\s*(def|to)\s+(\w+)(\(.+\))?\s+{'
162
- - '^\s*(when)\s+(\(.+\))\s+->\s+{'
171
+ - '^\s*(def|to)\s+(\w+)(\(.+\))?\s+\{'
172
+ - '^\s*(when)\s+(\(.+\))\s+->\s+\{'
163
173
  - language: Eiffel
164
174
  pattern:
165
175
  - '^\s*\w+\s*(?:,\s*\w+)*[:]\s*\w+\s'
@@ -178,7 +188,7 @@ disambiguations:
178
188
  - language: Erlang
179
189
  pattern: '^\s*(?:%%|main\s*\(.*?\)\s*->)'
180
190
  - language: JavaScript
181
- pattern: '(?m:\/\/|("|'')use strict\1|export\s+default\s|\/\*.*?\*\/)'
191
+ pattern: '\/\/|("|'')use strict\1|export\s+default\s|\/\*(?:.|[\r\n])*?\*\/'
182
192
  - extensions: ['.ex']
183
193
  rules:
184
194
  - language: Elixir
@@ -205,34 +215,25 @@ disambiguations:
205
215
  - extensions: ['.fr']
206
216
  rules:
207
217
  - language: Forth
208
- pattern: '^(: |also |new-device|previous )'
209
- - language: Frege
210
- pattern: '^\s*(import|module|package|data|type) '
211
- - language: Text
218
+ pattern: '^(: '- language: Fregepattern: '^\s*(import|module|package|data|type) '- language: Text'
212
219
  - extensions: ['.frm']
213
220
  rules:
214
221
  - language: VBA
215
222
  and:
216
223
  - named_pattern: vb-form
217
- - pattern: '^\s*Begin\s+{[0-9A-Z\-]*}\s?'
224
+ - pattern: '^\s*Begin\s+\{[0-9A-Z\-]*\}\s?'
218
225
  - language: Visual Basic 6.0
219
226
  and:
220
227
  - named_pattern: vb-form
221
- - pattern: '^\s*Begin\s+VB\.Form\s+'
228
+ - pattern: '^\s*Begin\s+VB\.Form\s+'
222
229
  - extensions: ['.fs']
223
230
  rules:
224
231
  - language: Forth
225
- pattern: '^(: |new-device)'
226
- - language: 'F#'
227
- pattern: '^\s*(#light|import|let|module|namespace|open|type)'
228
- - language: GLSL
229
- pattern: '^\s*(#version|precision|uniform|varying|vec[234])'
230
- - language: Filterscript
231
- pattern: '#include|#pragma\s+(rs|version)|__attribute__'
232
+ pattern: '^(: '- language: 'F#'pattern: '^\s*(#light|import|let|module|namespace|open|type)'- language: GLSLpattern: '^\s*(#version|precision|uniform|varying|vec[234])'- language: Filterscriptpattern: '#include|#pragma\s+(rs|version)|__attribute__''
232
233
  - extensions: ['.ftl']
233
234
  rules:
234
235
  - language: FreeMarker
235
- pattern: '^(?:<|[a-zA-Z-][a-zA-Z0-9_-]+[ \t]+\w)|\${\w+[^\n]*?}|^[ \t]*(?:<#--.*?-->|<#([a-z]+)(?=\s|>)[^>]*>.*?</#\1>|\[#--.*?--\]|\[#([a-z]+)(?=\s|\])[^\]]*\].*?\[#\2\])'
236
+ pattern: '^(?:<|[a-zA-Z-][a-zA-Z0-9_-]+[ \t]+\w)|\$\{\w+[^\n]*?\}|^[ \t]*(?:<#--.*?-->|<#([a-z]+)(?=\s|>)[^>]*>.*?</#\1>|\[#--.*?--\]|\[#([a-z]+)(?=\s|\])[^\]]*\].*?\[#\2\])'
236
237
  - language: Fluent
237
238
  pattern: '^-?[a-zA-Z][a-zA-Z0-9_-]* *=|\{\$-?[a-zA-Z][-\w]*(?:\.[a-zA-Z][-\w]*)?\}'
238
239
  - extensions: ['.g']
@@ -250,7 +251,7 @@ disambiguations:
250
251
  - extensions: ['.gml']
251
252
  rules:
252
253
  - language: XML
253
- pattern: '(?i:^\s*(\<\?xml|xmlns))'
254
+ pattern: '(?i:^\s*(<\?xml|xmlns))'
254
255
  - language: Graph Modeling Language
255
256
  pattern: '(?i:^\s*(graph|node)\s+\[$)'
256
257
  - language: Gerber Image
@@ -307,21 +308,21 @@ disambiguations:
307
308
  pattern: '^<\?(?:php)?'
308
309
  - language: SourcePawn
309
310
  pattern:
310
- - '^public\s+(?:SharedPlugin(?:\s+|:)__pl_\w+\s*=(?:\s*{)?|(?:void\s+)?__pl_\w+_SetNTVOptional\(\)(?:\s*{)?)'
311
+ - '^public\s+(?:SharedPlugin(?:\s+|:)__pl_\w+\s*=(?:\s*\{)?|(?:void\s+)?__pl_\w+_SetNTVOptional\(\)(?:\s*\{)?)'
311
312
  - '^methodmap\s+\w+\s+<\s+\w+'
312
313
  - '^\s*MarkNativeAsOptional\s*\('
313
314
  - language: NASL
314
315
  pattern:
315
316
  - '^\s*include\s*\(\s*(?:"|'')[\\/\w\-\.:\s]+\.(?:nasl|inc)\s*(?:"|'')\s*\)\s*;'
316
317
  - '^\s*(?:global|local)_var\s+(?:\w+(?:\s*=\s*[\w\-"'']+)?\s*)(?:,\s*\w+(?:\s*=\s*[\w\-"'']+)?\s*)*+\s*;'
317
- - '^\s*namespace\s+\w+\s*{'
318
- - '^\s*object\s+\w+\s*(?:extends\s+\w+(?:::\w+)?)?\s*{'
319
- - '^\s*(?:public\s+|private\s+|\s*)function\s+\w+\s*\([\w\s,]*\)\s*{'
318
+ - '^\s*namespace\s+\w+\s*\{'
319
+ - '^\s*object\s+\w+\s*(?:extends\s+\w+(?:::\w+)?)?\s*\{'
320
+ - '^\s*(?:public\s+|private\s+|\s*)function\s+\w+\s*\([\w\s,]*\)\s*\{'
320
321
  - language: POV-Ray SDL
321
322
  pattern: '^\s*#(declare|local|macro|while)\s'
322
323
  - language: Pascal
323
324
  pattern:
324
- - '(?i:^\s*{\$(?:mode|ifdef|undef|define)[ ]+[a-z0-9_]+})'
325
+ - '(?i:^\s*\{\$(?:mode|ifdef|undef|define)[ ]+[a-z0-9_]+\})'
325
326
  - '^\s*end[.;]\s*$'
326
327
  - extensions: ['.json']
327
328
  rules:
@@ -343,7 +344,7 @@ disambiguations:
343
344
  - extensions: ['.ls']
344
345
  rules:
345
346
  - language: LoomScript
346
- pattern: '^\s*package\s*[\w\.\/\*\s]*\s*{'
347
+ pattern: '^\s*package\s*[\w\.\/\*\s]*\s*\{'
347
348
  - language: LiveScript
348
349
  - extensions: ['.lsp', '.lisp']
349
350
  rules:
@@ -368,7 +369,7 @@ disambiguations:
368
369
  - language: MATLAB
369
370
  pattern: '^\s*%'
370
371
  - language: Limbo
371
- pattern: '^\w+\s*:\s*module\s*{'
372
+ pattern: '^\w+\s*:\s*module\s*\{'
372
373
  - extensions: ['.m4']
373
374
  rules:
374
375
  - language: M4Sugar
@@ -438,6 +439,11 @@ disambiguations:
438
439
  - language: NL
439
440
  pattern: '^(b|g)[0-9]+ '
440
441
  - language: NewLisp
442
+ - extensions: ['.nu']
443
+ rules:
444
+ - language: Nushell
445
+ pattern: '^\s*(import|export|module|def|let|let-env) '
446
+ - language: Nu
441
447
  - extensions: ['.odin']
442
448
  rules:
443
449
  - language: Object Data Instance Notation
@@ -462,20 +468,28 @@ disambiguations:
462
468
  - language: Prolog
463
469
  pattern: '^[^#]*:-'
464
470
  - language: Perl
465
- named_pattern: perl5
471
+ and:
472
+ - negative_pattern: '^\s*use\s+v6\b'
473
+ - named_pattern: perl
466
474
  - language: Raku
467
- named_pattern: perl6
475
+ named_pattern: raku
468
476
  - extensions: ['.plist']
469
477
  rules:
470
478
  - language: XML Property List
471
479
  pattern: '^\s*(?:<\?xml\s|<!DOCTYPE\s+plist|<plist(?:\s+version\s*=\s*(["''])\d+(?:\.\d+)?\1)?\s*>\s*$)'
472
480
  - language: OpenStep Property List
481
+ - extensions: ['.plt']
482
+ rules:
483
+ - language: Prolog
484
+ pattern: '^\s*:-'
473
485
  - extensions: ['.pm']
474
486
  rules:
475
487
  - language: Perl
476
- named_pattern: perl5
488
+ and:
489
+ - negative_pattern: '^\s*use\s+v6\b'
490
+ - named_pattern: perl
477
491
  - language: Raku
478
- named_pattern: perl6
492
+ named_pattern: raku
479
493
  - language: X PixMap
480
494
  pattern: '^\s*\/\* XPM \*\/'
481
495
  - extensions: ['.pod']
@@ -520,7 +534,7 @@ disambiguations:
520
534
  - extensions: ['.q']
521
535
  rules:
522
536
  - language: q
523
- pattern: '((?i:[A-Z.][\w.]*:{)|(^|\n)\\(cd?|d|l|p|ts?) )'
537
+ pattern: '((?i:[A-Z.][\w.]*:\{)|(^|\n)\\(cd?|d|l|p|ts?) )'
524
538
  - language: HiveQL
525
539
  pattern: '(?i:SELECT\s+[\w*,]+\s+FROM|(CREATE|ALTER|DROP)\s(DATABASE|SCHEMA|TABLE))'
526
540
  - extensions: ['.qs']
@@ -541,7 +555,7 @@ disambiguations:
541
555
  pattern:
542
556
  - '^\s*module\s+type\s'
543
557
  - '^\s*(?:include|open)\s+\w+\s*;\s*$'
544
- - '^\s*let\s+(?:module\s\w+\s*=\s*{|\w+:\s+.*=.*;\s*$)'
558
+ - '^\s*let\s+(?:module\s\w+\s*=\s*\{|\w+:\s+.*=.*;\s*$)'
545
559
  - language: C++
546
560
  pattern:
547
561
  - '^\s*#(?:(?:if|ifdef|define|pragma)\s+\w|\s*include\s+<[^>]+>)'
@@ -561,7 +575,7 @@ disambiguations:
561
575
  - extensions: ['.rpy']
562
576
  rules:
563
577
  - language: Python
564
- pattern: '(?m:^(import|from|class|def)\s)'
578
+ pattern: '^(import|from|class|def)\s'
565
579
  - language: "Ren'Py"
566
580
  - extensions: ['.rs']
567
581
  rules:
@@ -613,7 +627,7 @@ disambiguations:
613
627
  - language: StringTemplate
614
628
  pattern: '\$\w+[($]|(.)!\s*.+?\s*!\1|<!\s*.+?\s*!>|\[!\s*.+?\s*!\]|\{!\s*.+?\s*!\}'
615
629
  - language: Smalltalk
616
- 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*\['
630
+ 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*\['
617
631
  - extensions: ['.star']
618
632
  rules:
619
633
  - language: STAR
@@ -622,11 +636,19 @@ disambiguations:
622
636
  - extensions: ['.stl']
623
637
  rules:
624
638
  - language: STL
625
- pattern: '\A\s*solid(?=$|\s)(?m:.*?)\Rendsolid(?:$|\s)'
639
+ pattern: '\A\s*solid(?=$|\s)(?:.|[\r\n])*?^endsolid(?:$|\s)'
640
+ - extensions: ['.sw']
641
+ rules:
642
+ - language: Sway
643
+ pattern: '^\s*(?:(?:abi|dep|fn|impl|mod|pub|trait)\s|#\[)'
644
+ - language: XML
645
+ pattern: '^\s*<\?xml\s+version'
626
646
  - extensions: ['.t']
627
647
  rules:
628
648
  - language: Perl
629
- named_pattern: perl5
649
+ and:
650
+ - negative_pattern: '^\s*use\s+v6\b'
651
+ - named_pattern: perl
630
652
  - language: Raku
631
653
  pattern: '^\s*(?:use\s+v6\b|\bmodule\b|\bmy\s+class\b)'
632
654
  - language: Turing
@@ -635,6 +657,10 @@ disambiguations:
635
657
  rules:
636
658
  - language: Java Server Pages
637
659
  pattern: '<%[@!=\s]?\s*(taglib|tag|include|attribute|variable)\s'
660
+ - extensions: ['.tlv']
661
+ rules:
662
+ - language: TL-Verilog
663
+ pattern: '^\\.{0,10}TLV_version'
638
664
  - extensions: ['.toc']
639
665
  rules:
640
666
  - language: World of Warcraft Addon Data
@@ -662,31 +688,12 @@ disambiguations:
662
688
  - language: Vim Help File
663
689
  pattern: '(?:(?:^|[ \t])(?:vi|Vi(?=m))(?:m[<=>]?[0-9]+|m)?|[ \t]ex)(?=:(?=[ \t]*set?[ \t][^\r\n:]+:)|:(?![ \t]*set?[ \t]))(?:(?:[ \t]*:[ \t]*|[ \t])\w*(?:[ \t]*=(?:[^\\\s]|\\.)*)?)*[ \t:](?:filetype|ft|syntax)[ \t]*=(help)(?=$|\s|:)'
664
690
  - language: Adblock Filter List
665
- pattern: |-
666
- (?x)\A
667
- \[
668
- (?<version>
669
- (?:
670
- [Aa]d[Bb]lock
671
- (?:[ \t][Pp]lus)?
672
- |
673
- u[Bb]lock
674
- (?:[ \t][Oo]rigin)?
675
- |
676
- [Aa]d[Gg]uard
677
- )
678
- (?:[ \t] \d+(?:\.\d+)*+)?
679
- )
680
- (?:
681
- [ \t]?;[ \t]?
682
- \g<version>
683
- )*+
684
- \]
691
+ pattern: '\A\[(?<version>(?:[Aa]d[Bb]lock(?:[ \t][Pp]lus)?|u[Bb]lock(?:[ \t][Oo]rigin)?|[Aa]d[Gg]uard)(?:[ \t] \d+(?:\.\d+)*+)?)(?:[ \t]?;[ \t]?\g<version>)*+\]'
685
692
  - language: Text
686
693
  - extensions: ['.url']
687
694
  rules:
688
695
  - language: INI
689
- pattern: '^\[InternetShortcut\]\R(?>[^\s\[][^\n]*\R)*URL='
696
+ pattern: '^\[InternetShortcut\](?:\r?\n|\r)(?>[^\s\[][^\n]*(?:\r?\n|\r))*URL='
690
697
  - extensions: ['.v']
691
698
  rules:
692
699
  - language: Coq
@@ -711,7 +718,7 @@ disambiguations:
711
718
  - language: DirectX 3D File
712
719
  pattern: '^xof 030(2|3)(?:txt|bin|tzip|bzip)\b'
713
720
  - language: RPC
714
- pattern: '\b(program|version)\s+\w+\s*{|\bunion\s+\w+\s+switch\s*\('
721
+ pattern: '\b(program|version)\s+\w+\s*\{|\bunion\s+\w+\s+switch\s*\('
715
722
  - language: Logos
716
723
  pattern: '^%(end|ctor|hook|group)\b'
717
724
  - language: Linker Script
@@ -765,7 +772,20 @@ named_patterns:
765
772
  mdoc-heading: '^[.''][ \t]*Sh +(?:[^"\s]|"[^"]+")'
766
773
  mdoc-title: '^[.''][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)'
767
774
  objectivec: '^\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">])'
768
- perl5: '\buse\s+(?:strict\b|v?5\.)'
769
- perl6: '^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)'
770
- vb-class: '^\s*VERSION\s+[0-9]\.[0-9]\s+CLASS'
771
- vb-form: '^\s*VERSION\s+[0-9]\.[0-9]{2}'
775
+ perl:
776
+ - '\buse\s+(?:strict\b|v?5\b)'
777
+ - '^\s*use\s+(?:constant|overload)\b'
778
+ - '^\s*(?:\*|(?:our\s*)?@)EXPORT\s*='
779
+ - '^\s*package\s+[^\W\d]\w*(?:::\w+)*\s*(?:[;{]|\sv?\d)'
780
+ - '[\s$][^\W\d]\w*(?::\w+)*->[a-zA-Z_\[({]'
781
+ raku: '^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)'
782
+ vb-class: '^[ ]*VERSION [0-9]\.[0-9] CLASS'
783
+ vb-form: '^[ ]*VERSION [0-9]\.[0-9]{2}'
784
+ vb-module: '^[ ]*Attribute VB_Name = '
785
+ vba:
786
+ - '\b(?:VBA|[vV]ba)(?:\b|[0-9A-Z_])'
787
+ - '^[ ]*(?:Public|Private)? Declare PtrSafe (?:Sub|Function)\b'
788
+ - '^[ ]*#If Win64\b'
789
+ - '^[ ]*(?:Dim|Const) [0-9a-zA-Z_]*[ ]*As Long(?:Ptr|Long)\b'
790
+ - '^[ ]*Option (?:Private Module|Compare Database)\b'
791
+ - '(?: '- '\b(?:(?:Active)?VBProjects?|VBComponents?|Application\.(?:VBE|ScreenUpdating))\b'- '\b(?:ThisDrawing|AcadObject|Active(?:Explorer|Inspector|Window\.Presentation|Presentation|Document)|Selection\.(?:Find|Paragraphs))\b'- '\b(?:(?:This|Active)?Workbooks?|Worksheets?|Active(?:Sheet|Chart|Cell)|WorksheetFunction)\b'- '\b(?:Range\(".*|Cells\([0-9a-zA-Z_]*, (?:[0-9a-zA-Z_]*|"[a-zA-Z]{1,3}"))\)''