2020-03-19 16:31:29 +00:00
|
|
|
// Code generated by github.com/go-enry/go-enry/v2/internal/code-generator DO NOT EDIT.
|
2022-10-06 08:23:21 +00:00
|
|
|
// Extracted from github/linguist commit: bf853f1c663903e3ee35935189760191f1c45e1c
|
2017-06-08 10:28:36 +00:00
|
|
|
|
2018-04-28 13:12:03 +00:00
|
|
|
package data
|
|
|
|
|
2019-02-14 11:47:45 +00:00
|
|
|
import (
|
2020-03-19 16:31:29 +00:00
|
|
|
"github.com/go-enry/go-enry/v2/data/rule"
|
2022-12-25 10:57:54 +00:00
|
|
|
"github.com/go-enry/go-enry/v2/regex"
|
2019-02-14 11:47:45 +00:00
|
|
|
)
|
2017-06-08 10:28:36 +00:00
|
|
|
|
2019-02-14 11:47:45 +00:00
|
|
|
var ContentHeuristics = map[string]*Heuristics{
|
|
|
|
".1": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
2020-11-15 12:32:56 +00:00
|
|
|
rule.Or(
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".1in": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".1m": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".1x": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".2": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
2020-11-15 12:32:56 +00:00
|
|
|
rule.Or(
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".3": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
2020-11-15 12:32:56 +00:00
|
|
|
rule.Or(
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".3in": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".3m": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".3p": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".3pm": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".3qt": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".3x": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
|
|
|
),
|
2017-10-04 14:26:56 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".4": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
2020-11-15 12:32:56 +00:00
|
|
|
rule.Or(
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".5": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
2020-11-15 12:32:56 +00:00
|
|
|
rule.Or(
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".6": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
2020-11-15 12:32:56 +00:00
|
|
|
rule.Or(
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".7": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
2020-11-15 12:32:56 +00:00
|
|
|
rule.Or(
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".8": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
2020-11-15 12:32:56 +00:00
|
|
|
rule.Or(
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".9": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
2020-11-15 12:32:56 +00:00
|
|
|
rule.Or(
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2020-09-17 07:33:08 +00:00
|
|
|
".al": &Heuristics{
|
|
|
|
rule.And(
|
2020-10-12 09:31:27 +00:00
|
|
|
rule.MatchingLanguages("AL"),
|
2020-09-17 07:33:08 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\b(?i:(CODEUNIT|PAGE|PAGEEXTENSION|PAGECUSTOMIZATION|DOTNET|ENUM|ENUMEXTENSION|VALUE|QUERY|REPORT|TABLE|TABLEEXTENSION|XMLPORT|PROFILE|CONTROLADDIN))\b`),
|
2020-09-17 07:33:08 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Perl"),
|
|
|
|
),
|
|
|
|
},
|
2022-12-25 10:57:54 +00:00
|
|
|
".as": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("ActionScript"),
|
|
|
|
regex.MustCompileRuby(`^\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*)*)?\)))`),
|
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".asc": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Public Key"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(----[- ]BEGIN|ssh-(rsa|dss)) `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("AsciiDoc"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[=-]+(\s|\n)|{{[A-Za-z]`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("AGS Script"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(\/\/.+|((import|export)\s+)?(function|int|float|char)\s+((room|repeatedly|on|game)_)?([A-Za-z]+[A-Za-z_0-9]+)\s*[;\(])`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2020-03-21 19:16:52 +00:00
|
|
|
".asm": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Motorola 68K Assembly"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?im)\bmoveq(?:\.l)?\s+#(?:\$-?[0-9a-f]{1,3}|%[0-1]{1,8}|-?[0-9]{1,3}),\s*d[0-7]\b|(?im)^\s*move(?:\.[bwl])?\s+(?:sr|usp),\s*[^\s]+|(?im)^\s*move\.[bwl]\s+.*\b[ad]\d|(?im)^\s*movem\.[bwl]\b|(?im)^\s*move[mp](?:\.[wl])?\b|(?im)^\s*btst\b|(?im)^\s*dbra\b`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".asy": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("LTspice Symbol"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^SymbolType[ \t]`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Asymptote"),
|
|
|
|
),
|
|
|
|
},
|
2021-04-26 16:36:25 +00:00
|
|
|
".bas": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("FreeBasic"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[ \t]*#(?:define|endif|endmacro|ifn?def|if|include|lang|macro)\s`),
|
2021-04-26 16:36:25 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("BASIC"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*\d+`),
|
2021-04-26 16:36:25 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".bb": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("BlitzBasic"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(<^\s*; |End Function)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("BitBake"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(# |include|require)\b`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2022-06-09 20:09:50 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Clojure"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\((def|defn|defmacro|let)\s`),
|
2022-06-09 20:09:50 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
},
|
2022-10-06 08:23:21 +00:00
|
|
|
".bf": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Beef"),
|
|
|
|
regex.MustCompileMultiline(`(?-m)^\s*using\s+(System|Beefy)(\.(.*))?;\s*$`),
|
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("HyPhy"),
|
|
|
|
regex.MustCompileMultiline(`(?-m)^\s*#include\s+".*";\s*$|\sfprintf\s*\(`),
|
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Brainfuck"),
|
|
|
|
regex.MustCompileMultiline(`(>\+>|>\+<)`),
|
|
|
|
),
|
|
|
|
},
|
2021-04-26 16:36:25 +00:00
|
|
|
".bi": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("FreeBasic"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[ \t]*#(?:define|endif|endmacro|ifn?def|if|include|lang|macro)\s`),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".bs": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Bikeshed"),
|
|
|
|
regex.MustCompileRuby(`^(?i:<pre\s+class)\s*=\s*('|\"|\b)metadata\b\1[^>\r\n]*>`),
|
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("BrighterScript"),
|
|
|
|
regex.MustCompileRuby(`(?i:^\s*(?=^sub\s)(?:sub\s*\w+\(.*?\))|(?::\s*sub\(.*?\))$)|(?i:^\s*(end\ssub)$)|(?i:^\s*(?=^function\s)(?:function\s*\w+\(.*?\)\s*as\s*\w*)|(?::\s*function\(.*?\)\s*as\s*\w*)$)|(?i:^\s*(end\sfunction)$)`),
|
2021-04-26 16:36:25 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".builds": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("XML"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(\s*)(?i:<Project|<Import|<Property|<?xml|xmlns)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".ch": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("xBase"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*#\s*(?i:if|ifdef|ifndef|define|command|xcommand|translate|xtranslate|include|pragma|undef)\b`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".cl": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Common Lisp"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*\((?i:defun|in-package|defpackage) `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Cool"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^class`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("OpenCL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\/\* |\/\/ |^\}`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".cls": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("TeX"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*\\(?:NeedsTeXFormat|ProvidesClass){`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2019-08-05 11:57:21 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("ObjectScript"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^Class\s`),
|
2019-08-05 11:57:21 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
},
|
2021-03-07 16:00:13 +00:00
|
|
|
".cmp": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Gerber Image"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[DGMT][0-9]{2}\*\r?\n`),
|
2021-03-07 16:00:13 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".cs": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Smalltalk"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`![\w\s]+methodsFor: `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("C#"),
|
2022-10-06 08:23:21 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(using\s+[A-Z][\s\w.]+;|namespace\s*[\w\.]+\s*({|;)|\/\/)`),
|
2022-12-25 10:57:54 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".csc": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("GSC"),
|
|
|
|
regex.MustCompileRuby(`^\s*#\s*(?:using|insert|include|define|namespace)[ \t]+\w|^\s*(?>(?:autoexec|private)\s+){0,2}function\s+(?>(?:autoexec|private)\s+){0,2}\w+\s*\(|\b(?:level|self)[ \t]+thread[ \t]+(?:\[\[[ \t]*(?>\w+\.)*\w+[ \t]*\]\]|\w+)[ \t]*\([^\r\n\)]*\)[ \t]*;|^[ \t]*#[ \t]*(?:precache|using_animtree)[ \t]*\(`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2021-04-26 16:36:25 +00:00
|
|
|
".csl": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("XML"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:^\s*(\<\?xml|xmlns))`),
|
2021-04-26 16:36:25 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Kusto"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(^\|\s*(where|extend|project|limit|summarize))|(^\.\w+)`),
|
2021-04-26 16:36:25 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".d": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("D"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^module\s+[\w.]*\s*;|import\s+[\w\s,.:]*;|\w+\s+\w+\s*\(.*\)(?:\(.*\))?\s*{[^}]*}|unittest\s*(?:\(.*\))?\s*{[^}]*}`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("DTrace"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(\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)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Makefile"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`([\/\\].*:\s+.*\s\\$|: \\$|^[ %]:|^[\w\s\/\\.]+\w+\.\w+\s*:\s+[\w\s\/\\.]+\w+\.\w+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2020-03-21 19:16:52 +00:00
|
|
|
".dsp": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Microsoft Developer Studio Project"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`# Microsoft Developer Studio Generated Build File`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Faust"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\bprocess\s*[(=]|\b(library|import)\s*\(\s*"|\bdeclare\s+(name|version|author|copyright|license)\s+"`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
},
|
2022-03-03 20:08:49 +00:00
|
|
|
".e": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("E"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(def|var)\s+(.+):=|^\s*(def|to)\s+(\w+)(\(.+\))?\s+{|^\s*(when)\s+(\(.+\))\s+->\s+{`),
|
2022-03-03 20:08:49 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Eiffel"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*\w+\s*(?:,\s*\w+)*[:]\s*\w+\s|^\s*\w+\s*(?:\(\s*\w+[:][^)]+\))?(?:[:]\s*\w+)?(?:--.+\s+)*\s+(?:do|local)\s|^\s*(?:across|deferred|elseif|ensure|feature|from|inherit|inspect|invariant|note|once|require|undefine|variant|when)\s*$`),
|
2022-03-03 20:08:49 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Euphoria"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*namespace\s|^\s*(?:public\s+)?include\s|^\s*(?:(?:public|export|global)\s+)?(?:atom|constant|enum|function|integer|object|procedure|sequence|type)\s`),
|
2022-03-03 20:08:49 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".ecl": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("ECLiPSe"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[^#]+:-`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("ECL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`:=`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".es": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Erlang"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(?:%%|main\s*\(.*?\)\s*->)`),
|
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("JavaScript"),
|
|
|
|
regex.MustCompileRuby(`(?m:\/\/|("|')use strict\1|export\s+default\s|\/\*.*?\*\/)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2022-03-03 20:08:49 +00:00
|
|
|
".ex": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Elixir"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*@moduledoc\s|^\s*(?:cond|import|quote|unless)\s|^\s*def(?:exception|impl|macro|module|protocol)[(\s]`),
|
2022-03-03 20:08:49 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Euphoria"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*namespace\s|^\s*(?:public\s+)?include\s|^\s*(?:(?:public|export|global)\s+)?(?:atom|constant|enum|function|integer|object|procedure|sequence|type)\s`),
|
2022-03-03 20:08:49 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".f": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Forth"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^: `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Filebench WML"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`flowop`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Fortran"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(?i:[c*][^abd-z]| (subroutine|program|end|data)\s|\s*!)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".for": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Forth"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^: `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Fortran"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(?i:[c*][^abd-z]| (subroutine|program|end|data)\s|\s*!)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".fr": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Forth"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(: |also |new-device|previous )`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Frege"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(import|module|package|data|type) `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Text"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".fs": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Forth"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(: |new-device)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("F#"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(#light|import|let|module|namespace|open|type)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("GLSL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(#version|precision|uniform|varying|vec[234])`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Filterscript"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`#include|#pragma\s+(rs|version)|__attribute__`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2021-09-25 16:42:06 +00:00
|
|
|
".ftl": &Heuristics{
|
2022-12-25 10:57:54 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("FreeMarker"),
|
|
|
|
regex.MustCompileRuby(`^(?:<|[a-zA-Z-][a-zA-Z0-9_-]+[ \t]+\w)|\${\w+[^\n]*?}|^[ \t]*(?:<#--.*?-->|<#([a-z]+)(?=\s|>)[^>]*>.*?</#\1>|\[#--.*?--\]|\[#([a-z]+)(?=\s|\])[^\]]*\].*?\[#\2\])`),
|
|
|
|
),
|
2021-09-25 16:42:06 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Fluent"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^-?[a-zA-Z][a-zA-Z0-9_-]* *=|\{\$-?[a-zA-Z][-\w]*(?:\.[a-zA-Z][-\w]*)?\}`),
|
2021-09-25 16:42:06 +00:00
|
|
|
),
|
|
|
|
},
|
2022-10-06 08:23:21 +00:00
|
|
|
".g": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("GAP"),
|
|
|
|
regex.MustCompileMultiline(`\s*(Declare|BindGlobal|KeyDependentOperation|Install(Method|GlobalFunction)|SetPackageInfo)`),
|
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("G-code"),
|
|
|
|
regex.MustCompileMultiline(`^[MG][0-9]+\n`),
|
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".gd": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("GAP"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\s*(Declare|BindGlobal|KeyDependentOperation)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("GDScript"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\s*(extends|var|const|enum|func|class|signal|tool|yield|assert|onready)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".gml": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("XML"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:^\s*(\<\?xml|xmlns))`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Graph Modeling Language"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:^\s*(graph|node)\s+\[$)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2019-08-05 11:57:21 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Gerber Image"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[DGMT][0-9]{2}\*$`),
|
2019-08-05 11:57:21 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Game Maker Language"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".gs": &Heuristics{
|
2020-03-21 19:16:52 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("GLSL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^#version\s+[0-9]+\b`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Gosu"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^uses (java|gw)\.`),
|
2020-11-15 12:32:56 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Genie"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\[indent=[0-9]+\]`),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".gsc": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("GSC"),
|
|
|
|
regex.MustCompileRuby(`^\s*#\s*(?:using|insert|include|define|namespace)[ \t]+\w|^\s*(?>(?:autoexec|private)\s+){0,2}function\s+(?>(?:autoexec|private)\s+){0,2}\w+\s*\(|\b(?:level|self)[ \t]+thread[ \t]+(?:\[\[[ \t]*(?>\w+\.)*\w+[ \t]*\]\]|\w+)[ \t]*\([^\r\n\)]*\)[ \t]*;|^[ \t]*#[ \t]*(?:precache|using_animtree)[ \t]*\(`),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".gsh": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("GSC"),
|
|
|
|
regex.MustCompileRuby(`^\s*#\s*(?:using|insert|include|define|namespace)[ \t]+\w|^\s*(?>(?:autoexec|private)\s+){0,2}function\s+(?>(?:autoexec|private)\s+){0,2}\w+\s*\(|\b(?:level|self)[ \t]+thread[ \t]+(?:\[\[[ \t]*(?>\w+\.)*\w+[ \t]*\]\]|\w+)[ \t]*\([^\r\n\)]*\)[ \t]*;|^[ \t]*#[ \t]*(?:precache|using_animtree)[ \t]*\(`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".h": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Objective-C"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">])`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("C++"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*#\s*include <(cstdint|string|vector|map|list|array|bitset|queue|stack|forward_list|unordered_map|unordered_set|(i|o|io)stream)>|^\s*template\s*<|^[ \t]*(try|constexpr)|^[ \t]*catch\s*\(|^[ \t]*(class|(using[ \t]+)?namespace)\s+\w+|^[ \t]*(private|public|protected):$|std::\w+`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2021-09-25 16:42:06 +00:00
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("C"),
|
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
},
|
|
|
|
".hh": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Hack"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`<\?hh`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2020-03-21 19:16:52 +00:00
|
|
|
".i": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Motorola 68K Assembly"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?im)\bmoveq(?:\.l)?\s+#(?:\$-?[0-9a-f]{1,3}|%[0-1]{1,8}|-?[0-9]{1,3}),\s*d[0-7]\b|(?im)^\s*move(?:\.[bwl])?\s+(?:sr|usp),\s*[^\s]+|(?im)^\s*move\.[bwl]\s+.*\b[ad]\d|(?im)^\s*movem\.[bwl]\b|(?im)^\s*move[mp](?:\.[wl])?\b|(?im)^\s*btst\b|(?im)^\s*dbra\b`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("SWIG"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[ \t]*%[a-z_]+\b|^%[{}]$`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".ice": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("JSON"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\A\s*[{\[]`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Slice"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".inc": &Heuristics{
|
2020-03-21 19:16:52 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Motorola 68K Assembly"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?im)\bmoveq(?:\.l)?\s+#(?:\$-?[0-9a-f]{1,3}|%[0-1]{1,8}|-?[0-9]{1,3}),\s*d[0-7]\b|(?im)^\s*move(?:\.[bwl])?\s+(?:sr|usp),\s*[^\s]+|(?im)^\s*move\.[bwl]\s+.*\b[ad]\d|(?im)^\s*movem\.[bwl]\b|(?im)^\s*move[mp](?:\.[wl])?\b|(?im)^\s*btst\b|(?im)^\s*dbra\b`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("PHP"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^<\?(?:php)?`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2019-08-05 11:57:21 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("SourcePawn"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^public\s+(?:SharedPlugin(?:\s+|:)__pl_\w+\s*=(?:\s*{)?|(?:void\s+)?__pl_\w+_SetNTVOptional\(\)(?:\s*{)?)|^methodmap\s+\w+\s+<\s+\w+|^\s*MarkNativeAsOptional\s*\(`),
|
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("NASL"),
|
|
|
|
regex.MustCompileRuby(`^\s*include\s*\(\s*(?:"|')[\\/\w\-\.:\s]+\.(?:nasl|inc)\s*(?:"|')\s*\)\s*;|^\s*(?:global|local)_var\s+(?:\w+(?:\s*=\s*[\w\-"']+)?\s*)(?:,\s*\w+(?:\s*=\s*[\w\-"']+)?\s*)*+\s*;|^\s*namespace\s+\w+\s*{|^\s*object\s+\w+\s*(?:extends\s+\w+(?:::\w+)?)?\s*{|^\s*(?:public\s+|private\s+|\s*)function\s+\w+\s*\([\w\s,]*\)\s*{`),
|
2019-08-05 11:57:21 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("POV-Ray SDL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*#(declare|local|macro|while)\s`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2021-09-25 16:42:06 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Pascal"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:^\s*{\$(?:mode|ifdef|undef|define)[ ]+[a-z0-9_]+})|^\s*end[.;]\s*$`),
|
2021-09-25 16:42:06 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
},
|
|
|
|
".l": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Common Lisp"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\(def(un|macro)\s`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Lex"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(%[%{}]xs|<.*>)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\.[A-Za-z]{2}(\s|$)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("PicoLisp"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\((de|class|rel|code|data|must)\s`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".lisp": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Common Lisp"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*\((?i:defun|in-package|defpackage) `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("NewLisp"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*\(define `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".ls": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("LoomScript"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*package\s*[\w\.\/\*\s]*\s*{`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("LiveScript"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".lsp": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Common Lisp"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*\((?i:defun|in-package|defpackage) `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("NewLisp"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*\(define `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".m": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Objective-C"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(@(interface|class|protocol|property|end|synchronised|selector|implementation)\b|#import\s+.+\.h[">])`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Mercury"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`:- module`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("MUF"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^: `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("M"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*;`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2019-08-05 11:57:21 +00:00
|
|
|
rule.And(
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.MatchingLanguages("Mathematica"),
|
2019-08-05 11:57:21 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\(\*`),
|
2019-08-05 11:57:21 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\*\)$`),
|
2019-08-05 11:57:21 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("MATLAB"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*%`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Limbo"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\w+\s*:\s*module\s*{`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2021-03-07 16:00:13 +00:00
|
|
|
".m4": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("M4Sugar"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`AC_DEFUN|AC_PREREQ|AC_INIT|^_?m4_`),
|
2021-03-07 16:00:13 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("M4"),
|
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".man": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
|
|
|
),
|
|
|
|
},
|
2020-03-21 19:16:52 +00:00
|
|
|
".mask": &Heuristics{
|
|
|
|
rule.Or(
|
2022-03-03 20:08:49 +00:00
|
|
|
rule.MatchingLanguages("Unity3D Asset"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`tag:unity3d.com`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
},
|
2022-04-05 20:12:53 +00:00
|
|
|
".mc": &Heuristics{
|
2022-12-25 10:57:54 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Win32 Message File"),
|
|
|
|
regex.MustCompileRuby(`(?i)^[ \t]*(?>\/\*\s*)?MessageId=|^\.$`),
|
|
|
|
),
|
2022-04-05 20:12:53 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("M4"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^dnl|^divert\((?:-?\d+)?\)|^\w+\(`+"`"+`[^\n]*?'[),]`),
|
2022-04-05 20:12:53 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Monkey C"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\b(?:using|module|function|class|var)\s+\w`),
|
2022-04-05 20:12:53 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".md": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Markdown"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(^[-A-Za-z0-9=#!\*\[|>])|<\/|\A\z`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("GCC Machine Description"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(;;|\(define_)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Markdown"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".mdoc": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dd +(?:[^"\s]+|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Roff Manpage"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*TH +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".ml": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("OCaml"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(^\s*module)|let rec |match\s+(\S+\s)+with`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Standard ML"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`=> |case\s+(\S+\s)+of`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".mod": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("XML"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`<!ENTITY `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Modula-2"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(?i:MODULE|END) [\w\.]+;`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Linux Kernel Module", "AMPL"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".ms": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.'][A-Za-z]{2}(\s|$)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Unix Assembly"),
|
|
|
|
rule.Not(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`/\*`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*\.(?:include\s|globa?l\s|[A-Za-z][_A-Za-z0-9]*:)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("MAXScript"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".n": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[.']`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Nemerle"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(module|namespace|using)\s`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".ncl": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("XML"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*<\?xml\s+version`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2021-03-07 16:00:13 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Gerber Image"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[DGMT][0-9]{2}\*\r?\n`),
|
2021-03-07 16:00:13 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Text"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`THE_TITLE`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".nl": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("NL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(b|g)[0-9]+ `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("NewLisp"),
|
|
|
|
),
|
|
|
|
},
|
2020-03-21 19:16:52 +00:00
|
|
|
".odin": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Object Data Instance Notation"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?:^|<)\s*[A-Za-z0-9_]+\s*=\s*<`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Odin"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`package\s+\w+|\b(?:im|ex)port\s*"[\w:./]+"|\w+\s*::\s*(?:proc|struct)\s*\(|^\s*//\s`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".p": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Gnuplot"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^s?plot\b|^set\s+(term|terminal|out|output|[xy]tics|[xy]label|[xy]range|style)\b`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("OpenEdge ABL"),
|
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".php": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Hack"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`<\?hh`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("PHP"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`<\?[^h]`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".pl": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Prolog"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[^#]*:-`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Perl"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\buse\s+(?:strict\b|v?5\.)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
2020-03-21 19:16:52 +00:00
|
|
|
rule.MatchingLanguages("Raku"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2020-03-21 19:16:52 +00:00
|
|
|
".plist": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("XML Property List"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`<!DOCTYPE\s+plist`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("OpenStep Property List"),
|
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".pm": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Perl"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\buse\s+(?:strict\b|v?5\.)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
2020-03-21 19:16:52 +00:00
|
|
|
rule.MatchingLanguages("Raku"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
2019-08-05 11:57:21 +00:00
|
|
|
rule.MatchingLanguages("X PixMap"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*\/\* XPM \*\/`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".pod": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Pod 6"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[\s&&[^\n]]*=(comment|begin pod|begin para|item\d+)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Pod"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".pp": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Pascal"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*end[.;]`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Puppet"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s+\w+\s+=>\s`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".pro": &Heuristics{
|
2020-03-21 19:16:52 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Proguard"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^-(include\b.*\.pro$|keep\b|keepclassmembers\b|keepattributes\b)`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Prolog"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[^\[#]+:-`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("INI"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`last_client=`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("QMake"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`HEADERS`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`SOURCES`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("IDL"),
|
2022-10-06 08:23:21 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(?i:function|pro|compile_opt) \w[ \w,:]*$`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".properties": &Heuristics{
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("INI"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[^#!;][^=]*=`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[;\[]`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.And(
|
|
|
|
rule.MatchingLanguages("Java Properties"),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[^#!;][^=]*=`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages(""),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[#!]`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("INI"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[^#!;][^=]*=`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
2021-09-25 16:42:06 +00:00
|
|
|
rule.MatchingLanguages("Java Properties"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[^#!][^:]*:`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".q": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("q"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`((?i:[A-Z.][\w.]*:{)|(^|\n)\\(cd?|d|l|p|ts?) )`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("HiveQL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:SELECT\s+[\w*,]+\s+FROM|(CREATE|ALTER|DROP)\s(DATABASE|SCHEMA|TABLE))`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2020-09-17 07:33:08 +00:00
|
|
|
".qs": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Q#"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^((\/{2,3})?\s*(namespace|operation)\b)`),
|
2020-09-17 07:33:08 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Qt Script"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(\w+\.prototype\.\w+|===|\bvar\b)`),
|
2020-09-17 07:33:08 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".r": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Rebol"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:\bRebol\b)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("R"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`<-|^\s*#`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2020-09-17 07:33:08 +00:00
|
|
|
".re": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Reason"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*module\s+type\s|^\s*(?:include|open)\s+\w+\s*;\s*$|^\s*let\s+(?:module\s\w+\s*=\s*{|\w+:\s+.*=.*;\s*$)`),
|
2020-09-17 07:33:08 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("C++"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*#(?:(?:if|ifdef|define|pragma)\s+\w|\s*include\s+<[^>]+>)|^\s*template\s*<`),
|
2020-09-17 07:33:08 +00:00
|
|
|
),
|
|
|
|
},
|
2020-11-15 12:32:56 +00:00
|
|
|
".res": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("ReScript"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(let|module|type)\s+\w*\s+=\s+|^\s*(?:include|open)\s+\w+\s*$`),
|
2020-11-15 12:32:56 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".rno": &Heuristics{
|
2022-12-25 10:57:54 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("RUNOFF"),
|
|
|
|
regex.MustCompileRuby(`(?i:^\.!|^\f|\f$|^\.end lit(?:eral)?\b|^\.[a-zA-Z].*?;\.[a-zA-Z](?:[; \t])|\^\*[^\s*][^*]*\\\*(?=$|\s)|^\.c;[ \t]*\w+)`),
|
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Roff"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\.\\" `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".rpy": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Python"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?m:^(import|from|class|def)\s)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Ren'Py"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".rs": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Rust"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(use |fn |mod |pub |macro_rules|impl|#!?\[)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("RenderScript"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`#include|#pragma\s+(rs|version)|__attribute__`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2021-03-07 16:00:13 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("XML"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*<\?xml`),
|
2021-03-07 16:00:13 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
},
|
2020-03-21 19:16:52 +00:00
|
|
|
".s": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Motorola 68K Assembly"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?im)\bmoveq(?:\.l)?\s+#(?:\$-?[0-9a-f]{1,3}|%[0-1]{1,8}|-?[0-9]{1,3}),\s*d[0-7]\b|(?im)^\s*move(?:\.[bwl])?\s+(?:sr|usp),\s*[^\s]+|(?im)^\s*move\.[bwl]\s+.*\b[ad]\d|(?im)^\s*movem\.[bwl]\b|(?im)^\s*move[mp](?:\.[wl])?\b|(?im)^\s*btst\b|(?im)^\s*dbra\b`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".sc": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("SuperCollider"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:\^(this|super)\.|^\s*~\w+\s*=\.)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Scala"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(^\s*import (scala|java)\.|^\s*class\b)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2022-10-06 08:23:21 +00:00
|
|
|
".scd": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("SuperCollider"),
|
|
|
|
regex.MustCompileMultiline(`(?i:\^(this|super)\.|^\s*(~\w+\s*=\.|SynthDef\b))`),
|
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Markdown"),
|
|
|
|
regex.MustCompileMultiline(`^#+\s+(NAME|SYNOPSIS|DESCRIPTION)`),
|
|
|
|
),
|
|
|
|
},
|
2020-09-17 07:33:08 +00:00
|
|
|
".sol": &Heuristics{
|
2022-12-25 10:57:54 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Solidity"),
|
|
|
|
regex.MustCompileRuby(`\bpragma\s+solidity\b|\b(?:abstract\s+)?contract\s+(?!\d)[a-zA-Z0-9$_]+(?:\s+is\s+(?:[a-zA-Z0-9$_][^\{]*?)?)?\s*\{`),
|
|
|
|
),
|
2020-09-17 07:33:08 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Gerber Image"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[DGMT][0-9]{2}\*\r?\n`),
|
2020-09-17 07:33:08 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".sql": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("PLpgSQL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:^\\i\b|AS\s+\$\$|LANGUAGE\s+'?plpgsql'?|BEGIN(\s+WORK)?\s*;)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("SQLPL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:ALTER\s+MODULE|MODE\s+DB2SQL|\bSYS(CAT|PROC)\.|ASSOCIATE\s+RESULT\s+SET|\bEND!\s*$)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("PLSQL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:\$\$PLSQL_|XMLTYPE|systimestamp|\.nextval|CONNECT\s+BY|AUTHID\s+(DEFINER|CURRENT_USER)|constructor\W+function)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2020-09-17 07:33:08 +00:00
|
|
|
rule.Or(
|
2019-08-05 11:57:21 +00:00
|
|
|
rule.MatchingLanguages("TSQL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:^\s*GO\b|BEGIN(\s+TRY|\s+CATCH)|OUTPUT\s+INSERTED|DECLARE\s+@|\[dbo\])`),
|
2019-08-05 11:57:21 +00:00
|
|
|
),
|
2020-09-17 07:33:08 +00:00
|
|
|
rule.Always(
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.MatchingLanguages("SQL"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".srt": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("SubRip Text"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^(\d{2}:\d{2}:\d{2},\d{3})\s*(-->)\s*(\d{2}:\d{2}:\d{2},\d{3})$`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
2021-04-26 16:36:25 +00:00
|
|
|
},
|
|
|
|
".st": &Heuristics{
|
2022-12-25 10:57:54 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("StringTemplate"),
|
|
|
|
regex.MustCompileRuby(`\$\w+[($]|(.)!\s*.+?\s*!\1|<!\s*.+?\s*!>|\[!\s*.+?\s*!\]|\{!\s*.+?\s*!\}`),
|
|
|
|
),
|
2021-04-26 16:36:25 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Smalltalk"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\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*\[`),
|
2021-04-26 16:36:25 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
},
|
2022-06-09 20:09:50 +00:00
|
|
|
".star": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("STAR"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^loop_\s*$`),
|
2022-06-09 20:09:50 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Starlark"),
|
|
|
|
),
|
|
|
|
},
|
2022-12-25 10:57:54 +00:00
|
|
|
".stl": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("STL"),
|
|
|
|
regex.MustCompileRuby(`\A\s*solid(?=$|\s)(?m:.*?)\Rendsolid(?:$|\s)`),
|
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".t": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Perl"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\buse\s+(?:strict\b|v?5\.)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
2020-03-21 19:16:52 +00:00
|
|
|
rule.MatchingLanguages("Raku"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(?:use\s+v6\b|\bmodule\b|\bmy\s+class\b)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Turing"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*%[ \t]+|^\s*var\s+\w+(\s*:\s*\w+)?\s*:=\s*\w+`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2022-10-06 08:23:21 +00:00
|
|
|
".tag": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Java Server Pages"),
|
|
|
|
regex.MustCompileMultiline(`<%[@!=\s]?\s*(taglib|tag|include|attribute|variable)\s`),
|
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".toc": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("World of Warcraft Addon Data"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^## |@no-lib-strip@`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("TeX"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\\(contentsline|defcounter|beamer|boolfalse)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".ts": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("XML"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`<TS\b`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("TypeScript"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".tst": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("GAP"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`gap> `),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Scilab"),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
".tsx": &Heuristics{
|
|
|
|
rule.Or(
|
2019-08-05 11:57:21 +00:00
|
|
|
rule.MatchingLanguages("TSX"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\s*(import.+(from\s+|require\()['"]react|\/\/\/\s*<reference\s)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("XML"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?i:^\s*<\?xml\s+version)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2020-09-17 07:33:08 +00:00
|
|
|
".txt": &Heuristics{
|
2022-12-25 10:57:54 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Vim Help File"),
|
|
|
|
regex.MustCompileRuby(`(?:(?:^|[ \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|:)`),
|
|
|
|
),
|
2022-10-06 08:23:21 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Adblock Filter List"),
|
|
|
|
regex.MustCompileRuby(`(?x)\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>
|
|
|
|
)*+
|
|
|
|
\]`),
|
|
|
|
),
|
2020-09-17 07:33:08 +00:00
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Text"),
|
|
|
|
),
|
|
|
|
},
|
2022-12-25 10:57:54 +00:00
|
|
|
".url": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("INI"),
|
|
|
|
regex.MustCompileRuby(`^\[InternetShortcut\]\R(?>[^\s\[][^\n]*\R)*URL=`),
|
|
|
|
),
|
|
|
|
},
|
2020-03-21 19:16:52 +00:00
|
|
|
".v": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Coq"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`(?:^|\s)(?:Proof|Qed)\.(?:$|\s)|(?:^|\s)Require[ \t]+(Import|Export)\s`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Verilog"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^[ \t]*module\s+[^\s()]+\s+\#?\(|^[ \t]*`+"`"+`(?:define|ifdef|ifndef|include|timescale)|^[ \t]*always[ \t]+@|^[ \t]*initial[ \t]+(begin|@)`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("V"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\$(?:if|else)[ \t]|^[ \t]*fn\s+[^\s()]+\(.*?\).*?\{|^[ \t]*for\s*\{`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
|
|
|
},
|
2019-08-05 11:57:21 +00:00
|
|
|
".vba": &Heuristics{
|
|
|
|
rule.Or(
|
2021-11-14 16:36:04 +00:00
|
|
|
rule.MatchingLanguages("Vim Script"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^UseVimball`),
|
2019-08-05 11:57:21 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
2020-03-21 19:16:52 +00:00
|
|
|
rule.MatchingLanguages("VBA"),
|
2019-08-05 11:57:21 +00:00
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".w": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("OpenEdge ABL"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("CWeb"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^@(<|\w+\.)`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
|
|
|
".x": &Heuristics{
|
2020-03-21 19:16:52 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("DirectX 3D File"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^xof 030(2|3)(?:txt|bin|tzip|bzip)\b`),
|
2020-03-21 19:16:52 +00:00
|
|
|
),
|
2019-02-14 11:47:45 +00:00
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("RPC"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\b(program|version)\s+\w+\s*{|\bunion\s+\w+\s+switch\s*\(`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("Logos"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^%(end|ctor|hook|group)\b`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Or(
|
2019-08-05 11:57:21 +00:00
|
|
|
rule.MatchingLanguages("Linker Script"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`OUTPUT_ARCH\(|OUTPUT_FORMAT\(|SECTIONS`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
},
|
2022-03-03 20:08:49 +00:00
|
|
|
".yaml": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("MiniYAML"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`^\t+.*?[^\s:].*?:`),
|
2022-03-03 20:08:49 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("YAML"),
|
|
|
|
),
|
|
|
|
},
|
2019-02-14 11:47:45 +00:00
|
|
|
".yy": &Heuristics{
|
|
|
|
rule.Or(
|
|
|
|
rule.MatchingLanguages("JSON"),
|
2022-12-25 10:57:54 +00:00
|
|
|
regex.MustCompileMultiline(`\"modelName\"\:\s*\"GM`),
|
2019-02-14 11:47:45 +00:00
|
|
|
),
|
|
|
|
rule.Always(
|
|
|
|
rule.MatchingLanguages("Yacc"),
|
|
|
|
),
|
2017-06-08 10:28:36 +00:00
|
|
|
},
|
|
|
|
}
|