github-linguist 8.0.1 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/grammars/go.mod.json +1 -1
- data/grammars/liquid.injection.json +1 -1
- data/grammars/markdown.vue.codeblock.json +1 -0
- data/grammars/mdx.vue.codeblock.json +1 -0
- data/grammars/source.QB64.json +1 -0
- data/grammars/source.abap.json +1 -1
- data/grammars/source.abl.json +1 -1
- data/grammars/source.angelscript.json +1 -1
- data/grammars/source.answersetprogramming.json +1 -0
- data/grammars/source.apacheconf.json +1 -0
- data/grammars/source.assembly.json +1 -1
- data/grammars/source.ats.json +1 -1
- data/grammars/source.basic.json +1 -1
- data/grammars/source.bb.json +1 -1
- data/grammars/source.brs.json +1 -1
- data/grammars/source.bsl.json +1 -1
- data/grammars/source.bst.json +1 -0
- data/grammars/source.c.linker.json +1 -0
- data/grammars/source.cairo0.json +1 -1
- data/grammars/source.cmake.json +1 -1
- data/grammars/source.cmakecache.json +1 -0
- data/grammars/source.cobol.json +1 -1
- data/grammars/source.cs.json +1 -1
- data/grammars/source.curry.json +1 -1
- data/grammars/source.dart.json +1 -1
- data/grammars/source.dds.dspf.json +1 -1
- data/grammars/source.erlang.json +1 -1
- data/grammars/source.fsharp.json +1 -1
- data/grammars/source.gdscript.json +1 -1
- data/grammars/source.git-revlist.json +1 -1
- data/grammars/source.gleam.json +1 -1
- data/grammars/source.graphql.json +1 -1
- data/grammars/source.hack.json +1 -1
- data/grammars/source.hcl.json +1 -1
- data/grammars/source.hcl.terraform.json +1 -1
- data/grammars/source.ice.json +1 -1
- data/grammars/source.ispc.json +1 -0
- data/grammars/source.jai.json +1 -0
- data/grammars/source.json.comments.json +1 -0
- data/grammars/source.julia.json +1 -1
- data/grammars/source.just.json +1 -1
- data/grammars/source.kdl.json +1 -0
- data/grammars/source.lean.markdown.json +1 -1
- data/grammars/source.lean4.markdown.json +1 -1
- data/grammars/source.luau.json +1 -1
- data/grammars/source.matlab.json +1 -1
- data/grammars/source.mdx.astro.json +1 -0
- data/grammars/source.mdx.json +1 -1
- data/grammars/source.mo.json +1 -1
- data/grammars/source.moonbit.json +1 -0
- data/grammars/source.msg.json +1 -0
- data/grammars/source.mzn.json +1 -0
- data/grammars/source.ned.json +1 -0
- data/grammars/source.nr.json +1 -1
- data/grammars/source.nushell.json +1 -1
- data/grammars/source.odin.json +1 -1
- data/grammars/source.openesql.json +1 -0
- data/grammars/source.overpassql.json +1 -0
- data/grammars/source.p4.json +1 -1
- data/grammars/source.polar.json +1 -1
- data/grammars/source.powerbuilder.json +1 -1
- data/grammars/source.prisma.json +1 -1
- data/grammars/source.purescript.json +1 -1
- data/grammars/source.ql.json +1 -1
- data/grammars/source.qsharp.json +1 -1
- data/grammars/source.rascal.json +1 -1
- data/grammars/source.rescript.json +1 -1
- data/grammars/source.rpgle.json +1 -1
- data/grammars/source.scala.json +1 -1
- data/grammars/source.scm.json +1 -0
- data/grammars/source.sdbl.json +1 -1
- data/grammars/source.slang.json +1 -0
- data/grammars/source.slice.json +1 -1
- data/grammars/source.sourcepawn.json +1 -1
- data/grammars/source.stan.json +1 -1
- data/grammars/source.swift.json +1 -1
- data/grammars/source.tact.json +1 -0
- data/grammars/source.talon.json +1 -1
- data/grammars/source.templ.json +1 -1
- data/grammars/source.textgrid.json +1 -1
- data/grammars/source.toc.json +1 -1
- data/grammars/source.ts.json +1 -1
- data/grammars/source.ts.prismaClientRawSQL.json +1 -1
- data/grammars/source.tsp.json +1 -0
- data/grammars/source.tsx.json +1 -1
- data/grammars/source.typst.json +1 -1
- data/grammars/source.vba.json +1 -1
- data/grammars/source.vue.json +1 -0
- data/grammars/source.wdl.json +1 -1
- data/grammars/source.xmake.json +1 -0
- data/grammars/text.adblock.json +1 -1
- data/grammars/text.html.liquid.json +1 -1
- data/grammars/text.html.markdown.d2.json +1 -1
- data/grammars/text.md.json +1 -1
- data/grammars/text.rtf.json +1 -1
- data/grammars/version +1 -1
- data/grammars/vue.directives.json +1 -0
- data/grammars/vue.interpolations.json +1 -0
- data/grammars/vue.sfc.style.variable.injection.json +1 -0
- data/lib/linguist/VERSION +1 -1
- data/lib/linguist/generated.rb +32 -1
- data/lib/linguist/generic.yml +1 -0
- data/lib/linguist/heuristics.yml +109 -25
- data/lib/linguist/languages.json +1 -1
- data/lib/linguist/languages.yml +232 -10
- data/lib/linguist/lazy_blob.rb +15 -7
- data/lib/linguist/repository.rb +18 -13
- data/lib/linguist/samples.json +1 -1
- data/lib/linguist/shebang.rb +1 -1
- data/lib/linguist/source/diff.rb +72 -0
- data/lib/linguist/source/repository.rb +64 -0
- data/lib/linguist/source/rugged.rb +95 -0
- metadata +34 -9
- data/grammars/source.apache-config.json +0 -1
- data/grammars/source.apache-config.mod_perl.json +0 -1
- data/grammars/source.cache.cmake.json +0 -1
- data/grammars/text.html.erlang.yaws.json +0 -1
- data/grammars/text.html.vue.json +0 -1
- data/grammars/text.mdx.astro.codeblock.json +0 -1
data/grammars/text.rtf.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"
|
1
|
+
{"name":"Rich Text Format","scopeName":"text.rtf","patterns":[{"begin":"\\{\\\\\\*","end":"}","patterns":[{"include":"$self"}],"beginCaptures":{"0":{"name":"keyword.operator.group.ignorable-destination.begin.rtf"}},"endCaptures":{"0":{"name":"keyword.operator.group.ignorable-destination.end.rtf"}}},{"begin":"\\{","end":"}","patterns":[{"include":"$self"}],"beginCaptures":{"0":{"name":"keyword.operator.group.begin.rtf"}},"endCaptures":{"0":{"name":"keyword.operator.group.end.rtf"}}},{"name":"constant.character.escape.rtf","match":"\\\\[\\\\{}]"},{"name":"keyword.operator.formula.rtf","match":"\\\\\\|"},{"name":"constant.character.escape.non-breaking-space.rtf","match":"\\\\~"},{"name":"constant.character.escape.optional-hyphen.rtf","match":"\\\\-"},{"name":"constant.character.escape.non-breaking-hyphen.rtf","match":"\\\\_"},{"name":"keyword.operator.index-subentry.rtf","match":"\\\\:"},{"name":"keyword.operator.ignorable-destination.rtf","match":"\\\\\\*"},{"name":"support.function.par.rtf","match":"\\\\[\\n\\r]"},{"name":"constant.character.entity.rtf","match":"(\\\\')[0-9A-Fa-f]{2}","captures":{"1":{"name":"punctuation.definition.constant.rtf"}}},{"contentName":"markup.bold.rtf","begin":"\\\\b\\b","end":"(?=\\\\(?:b0(?:\\b|[^\\d])|plain\\b)|})","patterns":[{"include":"$self"}],"beginCaptures":{"0":{"name":"support.function.rtf"}}},{"contentName":"markup.italic.rtf","begin":"\\\\i\\b","end":"(?=\\\\(?:i0(?:\\b|[^\\d])|plain\\b)|})","patterns":[{"include":"$self"}],"beginCaptures":{"0":{"name":"support.function.rtf"}}},{"contentName":"markup.strike.rtf","begin":"\\\\strike\\b","end":"(?=\\\\(?:strike0(?:\\b|[^\\d])|plain\\b)|})","patterns":[{"include":"$self"}],"beginCaptures":{"0":{"name":"support.function.rtf"}}},{"match":"(\\\\[A-Za-z]+)(?:(-?)(\\d+))?","captures":{"1":{"name":"support.function.rtf"},"2":{"name":"keyword.operator.rtf"},"3":{"name":"constant.numeric.rtf"}}},{"name":"invalid.unimplemented.rtf","match":"\\\\[^A-Za-z]"}]}
|
data/grammars/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
9.1.0
|
@@ -0,0 +1 @@
|
|
1
|
+
{"scopeName":"vue.directives","patterns":[{"include":"source.vue#vue-directives"}]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"scopeName":"vue.interpolations","patterns":[{"include":"source.vue#vue-interpolations"}]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"scopeName":"vue.sfc.style.variable.injection","patterns":[{"include":"#vue-sfc-style-variable-injection"}],"repository":{"vue-sfc-style-variable-injection":{"name":"vue.sfc.style.variable.injection.v-bind","begin":"\\b(v-bind)\\s*\\(","end":"\\)","patterns":[{"name":"source.ts.embedded.html.vue","begin":"('|\")","end":"(\\1)","patterns":[{"include":"source.js"}],"beginCaptures":{"1":{"name":"punctuation.definition.tag.begin.html"}},"endCaptures":{"1":{"name":"punctuation.definition.tag.end.html"}}},{"include":"source.js"}],"beginCaptures":{"1":{"name":"entity.name.function"}}}}}
|
data/lib/linguist/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
9.1.0
|
data/lib/linguist/generated.rb
CHANGED
@@ -70,6 +70,7 @@ module Linguist
|
|
70
70
|
poetry_lock? ||
|
71
71
|
pdm_lock? ||
|
72
72
|
uv_lock? ||
|
73
|
+
pixi_lock? ||
|
73
74
|
esy_lock? ||
|
74
75
|
npm_shrinkwrap_or_package_lock? ||
|
75
76
|
pnpm_lock? ||
|
@@ -91,6 +92,7 @@ module Linguist
|
|
91
92
|
generated_protocol_buffer_from_go? ||
|
92
93
|
generated_protocol_buffer? ||
|
93
94
|
generated_javascript_protocol_buffer? ||
|
95
|
+
generated_typescript_protocol_buffer? ||
|
94
96
|
generated_apache_thrift? ||
|
95
97
|
generated_jni_header? ||
|
96
98
|
vcr_cassette? ||
|
@@ -367,6 +369,28 @@ module Linguist
|
|
367
369
|
return lines[5].include?("GENERATED CODE -- DO NOT EDIT!")
|
368
370
|
end
|
369
371
|
|
372
|
+
# Internal: Is the blob a TypeScript source file generated by the
|
373
|
+
# Protocol Buffer compiler?
|
374
|
+
#
|
375
|
+
# Files generated by ts-proto typically start with something like this
|
376
|
+
# (though the versions lines are optional):
|
377
|
+
#
|
378
|
+
# // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
379
|
+
# // versions:
|
380
|
+
# // protoc-gen-ts_proto v1.181.2
|
381
|
+
# // protoc v5.28.2
|
382
|
+
# // source: hello.proto
|
383
|
+
#
|
384
|
+
# /* eslint-disable */
|
385
|
+
#
|
386
|
+
# Returns true or false.
|
387
|
+
def generated_typescript_protocol_buffer?
|
388
|
+
return false unless extname == ".ts"
|
389
|
+
return false unless lines.count > 4
|
390
|
+
|
391
|
+
return lines[0].include?("Code generated by protoc-gen-ts_proto. DO NOT EDIT.")
|
392
|
+
end
|
393
|
+
|
370
394
|
APACHE_THRIFT_EXTENSIONS = ['.rb', '.py', '.go', '.js', '.m', '.java', '.h', '.cc', '.cpp', '.php']
|
371
395
|
|
372
396
|
# Internal: Is the blob generated by Apache Thrift compiler?
|
@@ -431,6 +455,13 @@ module Linguist
|
|
431
455
|
!!name.match(/uv\.lock/)
|
432
456
|
end
|
433
457
|
|
458
|
+
# Internal: Is the blob a generated pixi lock file?
|
459
|
+
#
|
460
|
+
# Returns true or false.
|
461
|
+
def pixi_lock?
|
462
|
+
!!name.match(/pixi\.lock/)
|
463
|
+
end
|
464
|
+
|
434
465
|
# Internal: Is the blob a generated esy lock file?
|
435
466
|
#
|
436
467
|
# Returns true or false.
|
@@ -874,7 +905,7 @@ module Linguist
|
|
874
905
|
#
|
875
906
|
# Returns true or false.
|
876
907
|
def generated_sqlx_query?
|
877
|
-
!!name.match(/(
|
908
|
+
!!name.match(/(?:^|\/)\.sqlx\/query-[a-f\d]{64}\.json$/)
|
878
909
|
end
|
879
910
|
end
|
880
911
|
end
|
data/lib/linguist/generic.yml
CHANGED
data/lib/linguist/heuristics.yml
CHANGED
@@ -68,7 +68,7 @@ disambiguations:
|
|
68
68
|
- extensions: ['.as']
|
69
69
|
rules:
|
70
70
|
- language: ActionScript
|
71
|
-
pattern: '^\s*(?:package(?:\s+[\w.]+)?\s+(?:\{|$)|import\s+[\w.*]+\s*;|(
|
71
|
+
pattern: '^\s*(?:package(?:\s+[\w.]+)?\s+(?:\{|$)|import\s+[\w.*]+\s*;|(?:intrinsic\s+)class\s+[\w<>.]+|\s+class\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
|
@@ -79,6 +79,8 @@ disambiguations:
|
|
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']
|
81
81
|
rules:
|
82
|
+
- language: Assembly
|
83
|
+
pattern: '(?i)mov\s+[^\s]{2,},'
|
82
84
|
- language: Motorola 68K Assembly
|
83
85
|
named_pattern: m68k
|
84
86
|
- extensions: ['.asy']
|
@@ -90,14 +92,18 @@ disambiguations:
|
|
90
92
|
rules:
|
91
93
|
- language: B4X
|
92
94
|
pattern: '\A\W{0,3}(?:.*(?:\r?\n|\r)){0,9}B4(?:J|A|R|i)=true'
|
93
|
-
- language:
|
94
|
-
|
95
|
+
- language: FreeBASIC
|
96
|
+
named_pattern: freebasic
|
97
|
+
- language: FreeBASIC
|
98
|
+
and:
|
99
|
+
- pattern: '(?i)^[ \t]*return '
|
100
|
+
- negative_pattern: '(?i)[ \t]*gosub '
|
95
101
|
- language: BASIC
|
96
102
|
pattern: '\A\s*\d'
|
103
|
+
- language: QuickBASIC
|
104
|
+
named_pattern: quickbasic
|
97
105
|
- language: VBA
|
98
|
-
|
99
|
-
- named_pattern: vb-module
|
100
|
-
- named_pattern: vba
|
106
|
+
named_pattern: vba
|
101
107
|
- language: Visual Basic 6.0
|
102
108
|
named_pattern: vb-module
|
103
109
|
- extensions: ['.bb']
|
@@ -120,17 +126,21 @@ disambiguations:
|
|
120
126
|
pattern: '(>\+>|>\+<)'
|
121
127
|
- extensions: ['.bi']
|
122
128
|
rules:
|
123
|
-
- language:
|
124
|
-
|
129
|
+
- language: FreeBASIC
|
130
|
+
named_pattern: freebasic
|
131
|
+
- language: FreeBASIC
|
132
|
+
and:
|
133
|
+
- pattern: '(?i)^[ \t]*return '
|
134
|
+
- negative_pattern: '(?i)[ \t]*gosub '
|
125
135
|
- extensions: ['.bs']
|
126
136
|
rules:
|
127
137
|
- language: Bikeshed
|
128
|
-
pattern: '^(?i:<pre\s+class)\s*=\s*(''|\"|\b)metadata\b
|
138
|
+
pattern: '^(?i:<pre\s+class)\s*=\s*(''|\"|\b)metadata\b(''|\"|\b)[^>\r\n]*>'
|
129
139
|
- language: BrighterScript
|
130
140
|
pattern:
|
131
|
-
- (?i:^\s*(
|
141
|
+
- (?i:^\s*(?:sub\s*\w+\(.*?\))|(?::\s*sub\(.*?\))$)
|
132
142
|
- (?i:^\s*(end\ssub)$)
|
133
|
-
- (?i:^\s*(
|
143
|
+
- (?i:^\s*(?:function\s*\w+\(.*?\)\s*as\s*\w*)|(?::\s*function\(.*?\)\s*as\s*\w*)$)
|
134
144
|
- (?i:^\s*(end\sfunction)$)
|
135
145
|
- language: Bluespec BH
|
136
146
|
pattern: '^package\s+[A-Za-z_][A-Za-z0-9_'']*(?:\s*\(|\s+where)'
|
@@ -287,7 +297,7 @@ disambiguations:
|
|
287
297
|
- extensions: ['.ftl']
|
288
298
|
rules:
|
289
299
|
- language: FreeMarker
|
290
|
-
pattern: '^(?:<|[a-zA-Z-][a-zA-Z0-9_-]+[ \t]+\w)|\$\{\w+[^\r\n]*?\}|^[ \t]*(?:<#--.*?-->|<#([a-z]+)
|
300
|
+
pattern: '^(?:<|[a-zA-Z-][a-zA-Z0-9_-]+[ \t]+\w)|\$\{\w+[^\r\n]*?\}|^[ \t]*(?:<#--.*?-->|<#(?:[a-z]+)\s[^>]*>.*?</#(?:[a-z]+)>|\[#--.*?--\]|\[#(?:[a-z]+)\s[^\]]*\].*?\[#(?:[a-z]+)\])'
|
291
301
|
- language: Fluent
|
292
302
|
pattern: '^-?[a-zA-Z][a-zA-Z0-9_-]* *=|\{\$-?[a-zA-Z][-\w]*(?:\.[a-zA-Z][-\w]*)?\}'
|
293
303
|
- extensions: ['.g']
|
@@ -355,6 +365,10 @@ disambiguations:
|
|
355
365
|
named_pattern: m68k
|
356
366
|
- language: SWIG
|
357
367
|
pattern: '^[ \t]*%[a-z_]+\b|^%[{}]$'
|
368
|
+
- language: Assembly
|
369
|
+
pattern:
|
370
|
+
- '(?i)mov\s+[^\s]+,'
|
371
|
+
- '^\s+(i?)db\s+[a-z\d]'
|
358
372
|
- extensions: ['.ice']
|
359
373
|
rules:
|
360
374
|
- language: JSON
|
@@ -374,7 +388,7 @@ disambiguations:
|
|
374
388
|
- language: NASL
|
375
389
|
pattern:
|
376
390
|
- '^\s*include\s*\(\s*(?:"|'')[\\/\w\-\.:\s]+\.(?:nasl|inc)\s*(?:"|'')\s*\)\s*;'
|
377
|
-
- '^\s*(?:global|local)_var\s+(?:\w+(?:\s*=\s*[\w\-"'']+)?\s*)(?:,\s*\w+(?:\s*=\s*[\w\-"'']+)?\s*)
|
391
|
+
- '^\s*(?:global|local)_var\s+(?:\w+(?:\s*=\s*[\w\-"'']+)?\s*)(?:,\s*\w+(?:\s*=\s*[\w\-"'']+)?\s*)*\s*;'
|
378
392
|
- '^\s*namespace\s+\w+\s*\{'
|
379
393
|
- '^\s*object\s+\w+\s*(?:extends\s+\w+(?:::\w+)?)?\s*\{'
|
380
394
|
- '^\s*(?:public\s+|private\s+|\s*)function\s+\w+\s*\([\w\s,]*\)\s*\{'
|
@@ -386,6 +400,10 @@ disambiguations:
|
|
386
400
|
- '^\s*end[.;]\s*$'
|
387
401
|
- language: BitBake
|
388
402
|
pattern: '^inherit(\s+[\w.-]+)+\s*$'
|
403
|
+
- language: Assembly
|
404
|
+
pattern:
|
405
|
+
- '^(?i)[^"m]*mov\s+[^\s]+,'
|
406
|
+
- '^\s+(?i)db\s+[a-z\d]'
|
389
407
|
- extensions: ['.json']
|
390
408
|
rules:
|
391
409
|
- language: OASv2-json
|
@@ -409,6 +427,11 @@ disambiguations:
|
|
409
427
|
pattern: '^import [a-z]'
|
410
428
|
- language: Lean 4
|
411
429
|
pattern: '^import [A-Z]'
|
430
|
+
- extensions: ['.lp']
|
431
|
+
rules:
|
432
|
+
- language: Linear Programming
|
433
|
+
pattern: '^(?i:minimize|minimum|min|maximize|maximum|max)(?i:\s+multi-objectives)?$'
|
434
|
+
- language: Answer Set Programming
|
412
435
|
- extensions: ['.ls']
|
413
436
|
rules:
|
414
437
|
- language: LoomScript
|
@@ -452,7 +475,7 @@ disambiguations:
|
|
452
475
|
- extensions: ['.mc']
|
453
476
|
rules:
|
454
477
|
- language: Win32 Message File
|
455
|
-
pattern: '(?i)^[ \t]*(
|
478
|
+
pattern: '(?i)^[ \t]*(\/\*\s*)?MessageId=|^\.$'
|
456
479
|
- language: M4
|
457
480
|
pattern: '^dnl|^divert\((?:-?\d+)?\)|^\w+\(`[^\r\n]*?''[),]'
|
458
481
|
- language: Monkey C
|
@@ -496,6 +519,10 @@ disambiguations:
|
|
496
519
|
- negative_pattern: '/\*'
|
497
520
|
- pattern: '^\s*\.(?:include\s|globa?l\s|[A-Za-z][_A-Za-z0-9]*:)'
|
498
521
|
- language: MAXScript
|
522
|
+
- extensions: ['.msg']
|
523
|
+
rules:
|
524
|
+
- language: OMNeT++ MSG
|
525
|
+
pattern: '^cplusplus\(?[\S]*\)?[\s]*\{?\{?|^namespace[\s]+([^.\s]*\.)*[^.\s]*;|^struct[\s]+[\S]+|^message[\s]+[\S]+(extends )?[\S]*[\s]*|^packet[\s]+[\S]+|^class[\s]+[\S]+(extends )?[\S]*[\s]*|^enum[\s]+[\S]+|^import ([^.\s]*\.)*[^.\s]*;'
|
499
526
|
- extensions: ['.n']
|
500
527
|
rules:
|
501
528
|
- language: Roff
|
@@ -664,7 +691,7 @@ disambiguations:
|
|
664
691
|
- extensions: ['.rno']
|
665
692
|
rules:
|
666
693
|
- language: RUNOFF
|
667
|
-
pattern: '(?i:^\.!|^\f|\f$|^\.end lit(?:eral)?\b|^\.[a-zA-Z].*?;\.[a-zA-Z](?:[; \t])|\^\*[^\s*][^*]*\\\*(
|
694
|
+
pattern: '(?i:^\.!|^\f|\f$|^\.end lit(?:eral)?\b|^\.[a-zA-Z].*?;\.[a-zA-Z](?:[; \t])|\^\*[^\s*][^*]*\\\*(?:$|\s)|^\.c;[ \t]*\w+)'
|
668
695
|
- language: Roff
|
669
696
|
pattern: '^\.\\" '
|
670
697
|
- extensions: ['.rpy']
|
@@ -682,6 +709,10 @@ disambiguations:
|
|
682
709
|
pattern: '^\s*<\?xml'
|
683
710
|
- extensions: ['.s']
|
684
711
|
rules:
|
712
|
+
- language: Unix Assembly
|
713
|
+
pattern: '(?i:mov[lq]?)\s+[%\$]'
|
714
|
+
- language: Assembly
|
715
|
+
pattern: '(?i:mov)\s+[^\s%]{2,},'
|
685
716
|
- language: Motorola 68K Assembly
|
686
717
|
named_pattern: m68k
|
687
718
|
- extensions: ['.sc']
|
@@ -697,10 +728,27 @@ disambiguations:
|
|
697
728
|
- language: Markdown
|
698
729
|
# Markdown syntax for scdoc
|
699
730
|
pattern: '^#+\s+(NAME|SYNOPSIS|DESCRIPTION)'
|
731
|
+
- extensions: ['.scm']
|
732
|
+
rules:
|
733
|
+
- language: Scheme
|
734
|
+
pattern:
|
735
|
+
- '(?:''[\(\*#]|\w->\w|\.\.\.[\s\)]|\([+\-:<>\/=~\)]|~>|[#`]\(|#:\w)'
|
736
|
+
- '^\s*\((?:define\*?|import|library|lambda)'
|
737
|
+
negative_pattern:
|
738
|
+
- '\(#[\w-]+[!\?]'
|
739
|
+
- '[\)\]"_]\s*(?:[\*\+\?]|@\w)'
|
740
|
+
- language: Tree-sitter Query
|
741
|
+
pattern:
|
742
|
+
- '\(#[\w-]+[!\?]'
|
743
|
+
- '[\)\]"_]\s*(?:[\*\+\?]|@\w)'
|
744
|
+
- '(?:^\s*\w+:\s*[\(\[\"])'
|
745
|
+
- '\(#(?:set!|(?:not-)?(?:any-of|match)\?)'
|
746
|
+
negative_pattern:
|
747
|
+
- '\([+\-:<>\/=~\)]'
|
700
748
|
- extensions: ['.sol']
|
701
749
|
rules:
|
702
750
|
- language: Solidity
|
703
|
-
pattern: '\bpragma\s+solidity\b|\b(?:abstract\s+)?contract\s+
|
751
|
+
pattern: '\bpragma\s+solidity\b|\b(?:abstract\s+)?contract\s+[a-zA-Z$_][a-zA-Z0-9$_]*(?:\s+is\s+(?:[a-zA-Z0-9$_][^\{]*?)?)?\s*\{'
|
704
752
|
- language: Gerber Image
|
705
753
|
pattern: '^[DGMT][0-9]{2}\*(?:\r?\n|\r)'
|
706
754
|
- extensions: ['.sql']
|
@@ -725,7 +773,7 @@ disambiguations:
|
|
725
773
|
- extensions: ['.st']
|
726
774
|
rules:
|
727
775
|
- language: StringTemplate
|
728
|
-
pattern: '\$\w+[($]
|
776
|
+
pattern: '\$\w+[($]|.!\s*.+?\s*!.|<!\s*.+?\s*!>|\[!\s*.+?\s*!\]|\{!\s*.+?\s*!\}'
|
729
777
|
- language: Smalltalk
|
730
778
|
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*\['
|
731
779
|
- extensions: ['.star']
|
@@ -737,6 +785,11 @@ disambiguations:
|
|
737
785
|
rules:
|
738
786
|
- language: STL
|
739
787
|
pattern: '\A\s*solid(?:$|\s)[\s\S]*^endsolid(?:$|\s)'
|
788
|
+
- extensions: ['.svx']
|
789
|
+
rules:
|
790
|
+
- language: Survex data
|
791
|
+
pattern: '\A(;|\*[^*]+$)'
|
792
|
+
- language: mdsvex
|
740
793
|
- extensions: ['.sw']
|
741
794
|
rules:
|
742
795
|
- language: Sway
|
@@ -753,6 +806,11 @@ disambiguations:
|
|
753
806
|
pattern: '^\s*(?:use\s+v6\b|\bmodule\b|\bmy\s+class\b)'
|
754
807
|
- language: Turing
|
755
808
|
pattern: '^\s*%[ \t]+|^\s*var\s+\w+(\s*:\s*\w+)?\s*:=\s*\w+'
|
809
|
+
- extensions: ['.tact']
|
810
|
+
rules:
|
811
|
+
- language: JSON
|
812
|
+
pattern: '\A\s*\{\"'
|
813
|
+
- language: Tact
|
756
814
|
- extensions: ['.tag']
|
757
815
|
rules:
|
758
816
|
- language: Java Server Pages
|
@@ -772,6 +830,12 @@ disambiguations:
|
|
772
830
|
- language: XML
|
773
831
|
pattern: '<TS\b'
|
774
832
|
- language: TypeScript
|
833
|
+
- extensions: ['.tsp']
|
834
|
+
rules:
|
835
|
+
- language: TypeSpec
|
836
|
+
pattern: '^(import|using|namespace|interface|op|model|scalar|alias|union|enum)\s'
|
837
|
+
- language: TSPLIB data
|
838
|
+
pattern: '^(NAME|TYPE|DIMENSION|EDGE_WEIGHT_TYPE|EDGE_WEIGHT_FORMAT)\s*:'
|
775
839
|
- extensions: ['.tst']
|
776
840
|
rules:
|
777
841
|
- language: GAP
|
@@ -780,10 +844,9 @@ disambiguations:
|
|
780
844
|
- language: Scilab
|
781
845
|
- extensions: ['.tsx']
|
782
846
|
rules:
|
783
|
-
- language: TSX
|
784
|
-
pattern: '^\s*(import.+(from\s+|require\()[''"]react|\/\/\/\s*<reference\s)'
|
785
847
|
- language: XML
|
786
848
|
pattern: '(?i:^\s*<\?xml\s+version)'
|
849
|
+
- language: TSX
|
787
850
|
- extensions: ['.txt']
|
788
851
|
rules:
|
789
852
|
# The following RegExp is simply a collapsed and simplified form of the
|
@@ -815,7 +878,7 @@ disambiguations:
|
|
815
878
|
(?<!-)\b
|
816
879
|
)*+
|
817
880
|
|
818
|
-
(
|
881
|
+
(?:$|\s)
|
819
882
|
- language: Adblock Filter List
|
820
883
|
pattern: |-
|
821
884
|
(?x)\A
|
@@ -848,7 +911,7 @@ disambiguations:
|
|
848
911
|
- extensions: ['.url']
|
849
912
|
rules:
|
850
913
|
- language: INI
|
851
|
-
pattern: '^\[InternetShortcut\](?:\r?\n|\r)(
|
914
|
+
pattern: '^\[InternetShortcut\](?:\r?\n|\r)([^\s\[][^\r\n]*(?:\r?\n|\r)){0,20}URL='
|
852
915
|
- extensions: ['.v']
|
853
916
|
rules:
|
854
917
|
- language: Coq
|
@@ -914,10 +977,13 @@ named_patterns:
|
|
914
977
|
- '^\s*(?:public\s+)?include\s'
|
915
978
|
- '^\s*(?:(?:public|export|global)\s+)?(?:atom|constant|enum|function|integer|object|procedure|sequence|type)\s'
|
916
979
|
fortran: '^(?i:[c*][^abd-z]| (subroutine|program|end|data)\s|\s*!)'
|
980
|
+
freebasic:
|
981
|
+
- '(?i)^[ \t]*#(?:define|endif|endmacro|ifn?def|include|lang|macro|pragma)(?:$|\s)'
|
982
|
+
- '(?i)^[ \t]*dim( shared)? [a-z_][a-z0-9_]* as [a-z_][a-z0-9_]* ptr'
|
917
983
|
gsc:
|
918
984
|
- '^\s*#\s*(?:using|insert|include|define|namespace)[ \t]+\w'
|
919
|
-
- '^\s*(
|
920
|
-
- '\b(?:level|self)[ \t]+thread[ \t]+(?:\[\[[ \t]*(
|
985
|
+
- '^\s*((?:autoexec|private)\s+){0,2}function\s+((?:autoexec|private)\s+){0,2}\w+\s*\('
|
986
|
+
- '\b(?:level|self)[ \t]+thread[ \t]+(?:\[\[[ \t]*(\w+\.)+[ \t]*\]\]|\w+)[ \t]*\([^\r\n\)]*\)[ \t]*;'
|
921
987
|
- '^[ \t]*#[ \t]*(?:precache|using_animtree)[ \t]*\('
|
922
988
|
json: '\A\s*[{\[]'
|
923
989
|
key_equals_value: '^[^#!;][^=]*='
|
@@ -941,6 +1007,24 @@ named_patterns:
|
|
941
1007
|
- '^\s*(?:\*|(?:our\s*)?@)EXPORT\s*='
|
942
1008
|
- '^\s*package\s+[^\W\d]\w*(?:::\w+)*\s*(?:[;{]|\sv?\d)'
|
943
1009
|
- '[\s$][^\W\d]\w*(?::\w+)*->[a-zA-Z_\[({]'
|
1010
|
+
quickbasic:
|
1011
|
+
# Uppercase keywords are a good indicator of QuickBASIC (if no FreeBASIC syntax is detected)
|
1012
|
+
- '^[ ]*(CONST|DIM|REDIM|DEFINT|PRINT|DECLARE (SUB|FUNCTION)|FUNCTION|SUB) '
|
1013
|
+
# Preprocessor statement to set the compiler dialect in QuickBASIC ($lang) and FreeBASIC (#lang)
|
1014
|
+
- '(#|$)lang:?\s*"?qb"?'
|
1015
|
+
# Other QuickBASIC-specific patterns
|
1016
|
+
- '(?i)''\$INCLUDE:'
|
1017
|
+
- '(?i)^[ ]*CLS[ ]*(''|:|\r|\n)'
|
1018
|
+
- '(?i)^[ ]*OPTION _EXPLICIT'
|
1019
|
+
- '(?i)^[ ]*DIM SHARED '
|
1020
|
+
- '(?i)^[ ]*PRINT "'
|
1021
|
+
- '(?i) As _(Byte|Offset|MEM)'
|
1022
|
+
- '(?i)^[ ]*_(DISPLAY|DEST|CONSOLE|SOURCE|FREEIMAGE|PALETTECOLOR|PRINTSTRING|LOADFONT|PUTIMAGE)'
|
1023
|
+
- '(?i)^[ ]*_(TITLE|PLAYMOD) "'
|
1024
|
+
- '(?i)^[ ]*_(LIMIT|SCREEN|DELAY) \.?\d+'
|
1025
|
+
- '(?i)\b_(MOUSEBUTTON|NEWIMAGE|KEYDOWN|WIDTH|HEIGHT)\('
|
1026
|
+
- '(?i)^[ ]*\$(CONSOLE|CHECKING):'
|
1027
|
+
- '(?i)^[ ]*\$(FULLSCREEN|RESIZE|STATIC|DYNAMIC|NOPREFIX|SCREENSHOW|SCREENHIDE|EXEICON)\b'
|
944
1028
|
raku: '^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)'
|
945
1029
|
vb-class: '^[ ]*VERSION [0-9]\.[0-9] CLASS'
|
946
1030
|
vb-form: '^[ ]*VERSION [0-9]\.[0-9]{2}'
|
@@ -952,12 +1036,12 @@ named_patterns:
|
|
952
1036
|
- '^[ ]*#If Win64\b'
|
953
1037
|
- '^[ ]*(?:Dim|Const) [0-9a-zA-Z_]*[ ]*As Long(?:Ptr|Long)\b'
|
954
1038
|
# Top module declarations unique to VBA
|
955
|
-
- '^[ ]*Option (?:Private Module|Compare
|
1039
|
+
- '^[ ]*Option (?:Private Module|Compare Database)\b'
|
956
1040
|
# General VBA libraries and objects
|
957
1041
|
- '(?: |\()(?:Access|Excel|Outlook|PowerPoint|Visio|Word|VBIDE)\.\w'
|
958
1042
|
- '\b(?:(?:Active)?VBProjects?|VBComponents?|Application\.(?:VBE|ScreenUpdating))\b'
|
959
1043
|
# AutoCAD, Outlook, PowerPoint and Word objects
|
960
|
-
- '\b(?:ThisDrawing|AcadObject|Active(?:Explorer|Inspector|Window\.Presentation|Presentation|Document)|Selection\.(?:Find|Paragraphs))\b'
|
1044
|
+
- '\b(?:ThisDrawing|AcadObject|Active(?:Explorer|Inspector|Window\.Presentation|Presentation|Document)|Selection\.(?:Document|Find|Paragraphs|Range))\b'
|
961
1045
|
# Excel objects
|
962
1046
|
- '\b(?:(?:This|Active)?Workbooks?|Worksheets?|Active(?:Sheet|Chart|Cell)|WorksheetFunction)\b'
|
963
1047
|
- '\b(?:Range\(".*|Cells\([0-9a-zA-Z_]*, (?:[0-9a-zA-Z_]*|"[a-zA-Z]{1,3}"))\)'
|