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.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/grammars/go.mod.json +1 -1
  3. data/grammars/liquid.injection.json +1 -1
  4. data/grammars/markdown.vue.codeblock.json +1 -0
  5. data/grammars/mdx.vue.codeblock.json +1 -0
  6. data/grammars/source.QB64.json +1 -0
  7. data/grammars/source.abap.json +1 -1
  8. data/grammars/source.abl.json +1 -1
  9. data/grammars/source.angelscript.json +1 -1
  10. data/grammars/source.answersetprogramming.json +1 -0
  11. data/grammars/source.apacheconf.json +1 -0
  12. data/grammars/source.assembly.json +1 -1
  13. data/grammars/source.ats.json +1 -1
  14. data/grammars/source.basic.json +1 -1
  15. data/grammars/source.bb.json +1 -1
  16. data/grammars/source.brs.json +1 -1
  17. data/grammars/source.bsl.json +1 -1
  18. data/grammars/source.bst.json +1 -0
  19. data/grammars/source.c.linker.json +1 -0
  20. data/grammars/source.cairo0.json +1 -1
  21. data/grammars/source.cmake.json +1 -1
  22. data/grammars/source.cmakecache.json +1 -0
  23. data/grammars/source.cobol.json +1 -1
  24. data/grammars/source.cs.json +1 -1
  25. data/grammars/source.curry.json +1 -1
  26. data/grammars/source.dart.json +1 -1
  27. data/grammars/source.dds.dspf.json +1 -1
  28. data/grammars/source.erlang.json +1 -1
  29. data/grammars/source.fsharp.json +1 -1
  30. data/grammars/source.gdscript.json +1 -1
  31. data/grammars/source.git-revlist.json +1 -1
  32. data/grammars/source.gleam.json +1 -1
  33. data/grammars/source.graphql.json +1 -1
  34. data/grammars/source.hack.json +1 -1
  35. data/grammars/source.hcl.json +1 -1
  36. data/grammars/source.hcl.terraform.json +1 -1
  37. data/grammars/source.ice.json +1 -1
  38. data/grammars/source.ispc.json +1 -0
  39. data/grammars/source.jai.json +1 -0
  40. data/grammars/source.json.comments.json +1 -0
  41. data/grammars/source.julia.json +1 -1
  42. data/grammars/source.just.json +1 -1
  43. data/grammars/source.kdl.json +1 -0
  44. data/grammars/source.lean.markdown.json +1 -1
  45. data/grammars/source.lean4.markdown.json +1 -1
  46. data/grammars/source.luau.json +1 -1
  47. data/grammars/source.matlab.json +1 -1
  48. data/grammars/source.mdx.astro.json +1 -0
  49. data/grammars/source.mdx.json +1 -1
  50. data/grammars/source.mo.json +1 -1
  51. data/grammars/source.moonbit.json +1 -0
  52. data/grammars/source.msg.json +1 -0
  53. data/grammars/source.mzn.json +1 -0
  54. data/grammars/source.ned.json +1 -0
  55. data/grammars/source.nr.json +1 -1
  56. data/grammars/source.nushell.json +1 -1
  57. data/grammars/source.odin.json +1 -1
  58. data/grammars/source.openesql.json +1 -0
  59. data/grammars/source.overpassql.json +1 -0
  60. data/grammars/source.p4.json +1 -1
  61. data/grammars/source.polar.json +1 -1
  62. data/grammars/source.powerbuilder.json +1 -1
  63. data/grammars/source.prisma.json +1 -1
  64. data/grammars/source.purescript.json +1 -1
  65. data/grammars/source.ql.json +1 -1
  66. data/grammars/source.qsharp.json +1 -1
  67. data/grammars/source.rascal.json +1 -1
  68. data/grammars/source.rescript.json +1 -1
  69. data/grammars/source.rpgle.json +1 -1
  70. data/grammars/source.scala.json +1 -1
  71. data/grammars/source.scm.json +1 -0
  72. data/grammars/source.sdbl.json +1 -1
  73. data/grammars/source.slang.json +1 -0
  74. data/grammars/source.slice.json +1 -1
  75. data/grammars/source.sourcepawn.json +1 -1
  76. data/grammars/source.stan.json +1 -1
  77. data/grammars/source.swift.json +1 -1
  78. data/grammars/source.tact.json +1 -0
  79. data/grammars/source.talon.json +1 -1
  80. data/grammars/source.templ.json +1 -1
  81. data/grammars/source.textgrid.json +1 -1
  82. data/grammars/source.toc.json +1 -1
  83. data/grammars/source.ts.json +1 -1
  84. data/grammars/source.ts.prismaClientRawSQL.json +1 -1
  85. data/grammars/source.tsp.json +1 -0
  86. data/grammars/source.tsx.json +1 -1
  87. data/grammars/source.typst.json +1 -1
  88. data/grammars/source.vba.json +1 -1
  89. data/grammars/source.vue.json +1 -0
  90. data/grammars/source.wdl.json +1 -1
  91. data/grammars/source.xmake.json +1 -0
  92. data/grammars/text.adblock.json +1 -1
  93. data/grammars/text.html.liquid.json +1 -1
  94. data/grammars/text.html.markdown.d2.json +1 -1
  95. data/grammars/text.md.json +1 -1
  96. data/grammars/text.rtf.json +1 -1
  97. data/grammars/version +1 -1
  98. data/grammars/vue.directives.json +1 -0
  99. data/grammars/vue.interpolations.json +1 -0
  100. data/grammars/vue.sfc.style.variable.injection.json +1 -0
  101. data/lib/linguist/VERSION +1 -1
  102. data/lib/linguist/generated.rb +32 -1
  103. data/lib/linguist/generic.yml +1 -0
  104. data/lib/linguist/heuristics.yml +109 -25
  105. data/lib/linguist/languages.json +1 -1
  106. data/lib/linguist/languages.yml +232 -10
  107. data/lib/linguist/lazy_blob.rb +15 -7
  108. data/lib/linguist/repository.rb +18 -13
  109. data/lib/linguist/samples.json +1 -1
  110. data/lib/linguist/shebang.rb +1 -1
  111. data/lib/linguist/source/diff.rb +72 -0
  112. data/lib/linguist/source/repository.rb +64 -0
  113. data/lib/linguist/source/rugged.rb +95 -0
  114. metadata +34 -9
  115. data/grammars/source.apache-config.json +0 -1
  116. data/grammars/source.apache-config.mod_perl.json +0 -1
  117. data/grammars/source.cache.cmake.json +0 -1
  118. data/grammars/text.html.erlang.yaws.json +0 -1
  119. data/grammars/text.html.vue.json +0 -1
  120. data/grammars/text.mdx.astro.codeblock.json +0 -1
@@ -1 +1 @@
1
- {"name":"RTF","scopeName":"text.rtf","patterns":[{"begin":"\\{\\\\\\*","end":"}","patterns":[{"include":"$self"}],"beginCaptures":{"0":{"name":"keyword.operator.begin-ignorable-destination-group.rtf"}},"endCaptures":{"0":{"name":"keyword.operator.end-ignorable-destination-group.rtf"}}},{"begin":"\\{","end":"}","patterns":[{"include":"$self"}],"beginCaptures":{"0":{"name":"keyword.operator.begin-group.rtf"}},"endCaptures":{"0":{"name":"keyword.operator.end-group.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]"}]}
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
- 8.0.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
- 8.0.1
1
+ 9.1.0
@@ -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(/(?:^|.*\/)\.sqlx\/query-.+\.json$/)
908
+ !!name.match(/(?:^|\/)\.sqlx\/query-[a-f\d]{64}\.json$/)
878
909
  end
879
910
  end
880
911
  end
@@ -16,6 +16,7 @@ extensions:
16
16
  - ".9"
17
17
  - ".app"
18
18
  - ".cmp"
19
+ - ".msg"
19
20
  - ".resource"
20
21
  - ".sol"
21
22
  - ".stl"
@@ -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*;|(?=.*?(?: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\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: FreeBasic
94
- pattern: '^[ \t]*#(?i)(?:define|endif|endmacro|ifn?def|include|lang|macro)(?:$|\s)'
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
- and:
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: FreeBasic
124
- pattern: '^[ \t]*#(?i)(?:define|endif|endmacro|ifn?def|if|include|lang|macro)(?:$|\s)'
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\1[^>\r\n]*>'
138
+ pattern: '^(?i:<pre\s+class)\s*=\s*(''|\"|\b)metadata\b(''|\"|\b)[^>\r\n]*>'
129
139
  - language: BrighterScript
130
140
  pattern:
131
- - (?i:^\s*(?=^sub\s)(?:sub\s*\w+\(.*?\))|(?::\s*sub\(.*?\))$)
141
+ - (?i:^\s*(?:sub\s*\w+\(.*?\))|(?::\s*sub\(.*?\))$)
132
142
  - (?i:^\s*(end\ssub)$)
133
- - (?i:^\s*(?=^function\s)(?:function\s*\w+\(.*?\)\s*as\s*\w*)|(?::\s*function\(.*?\)\s*as\s*\w*)$)
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]+)(?=\s|>)[^>]*>.*?</#\1>|\[#--.*?--\]|\[#([a-z]+)(?=\s|\])[^\]]*\].*?\[#\2\])'
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*)*+\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]*(?>\/\*\s*)?MessageId=|^\.$'
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*][^*]*\\\*(?=$|\s)|^\.c;[ \t]*\w+)'
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+(?!\d)[a-zA-Z0-9$_]+(?:\s+is\s+(?:[a-zA-Z0-9$_][^\{]*?)?)?\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+[($]|(.)!\s*.+?\s*!\1|<!\s*.+?\s*!>|\[!\s*.+?\s*!\]|\{!\s*.+?\s*!\}'
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
- (?=$|\s)
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)(?>[^\s\[][^\r\n]*(?:\r?\n|\r))*URL='
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*(?>(?:autoexec|private)\s+){0,2}function\s+(?>(?:autoexec|private)\s+){0,2}\w+\s*\('
920
- - '\b(?:level|self)[ \t]+thread[ \t]+(?:\[\[[ \t]*(?>\w+\.)*\w+[ \t]*\]\]|\w+)[ \t]*\([^\r\n\)]*\)[ \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 (?:Database|Text|Binary))\b'
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}"))\)'