tartrazine/data/content.go

1750 lines
50 KiB
Go
Raw Normal View History

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
package data
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"
)
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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
2020-11-15 12:32:56 +00:00
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
rule.Always(
rule.MatchingLanguages("Roff"),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
rule.Always(
rule.MatchingLanguages("Roff"),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
rule.Always(
rule.MatchingLanguages("Roff"),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
2020-11-15 12:32:56 +00:00
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
2020-11-15 12:32:56 +00:00
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
rule.Always(
rule.MatchingLanguages("Roff"),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
rule.Always(
rule.MatchingLanguages("Roff"),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
rule.Always(
rule.MatchingLanguages("Roff"),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
rule.Always(
rule.MatchingLanguages("Roff"),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
rule.Always(
rule.MatchingLanguages("Roff"),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
rule.Always(
rule.MatchingLanguages("Roff"),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
2020-11-15 12:32:56 +00:00
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
2020-11-15 12:32:56 +00:00
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
2020-11-15 12:32:56 +00:00
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
2020-11-15 12:32:56 +00:00
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
2020-11-15 12:32:56 +00:00
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
2020-11-15 12:32:56 +00:00
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\.(?:[A-Za-z]{2}(?:\s|$)|\\")`),
),
},
".al": &Heuristics{
rule.And(
rule.MatchingLanguages("AL"),
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`),
),
),
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*)*)?\)))`),
),
},
".asc": &Heuristics{
rule.Or(
rule.MatchingLanguages("Public Key"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^(----[- ]BEGIN|ssh-(rsa|dss)) `),
),
rule.Or(
rule.MatchingLanguages("AsciiDoc"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[=-]+(\s|\n)|{{[A-Za-z]`),
),
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*[;\(])`),
),
},
".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`),
),
},
".asy": &Heuristics{
rule.Or(
rule.MatchingLanguages("LTspice Symbol"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^SymbolType[ \t]`),
),
rule.Always(
rule.MatchingLanguages("Asymptote"),
),
},
".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`),
),
rule.Or(
rule.MatchingLanguages("BASIC"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*\d+`),
),
},
".bb": &Heuristics{
rule.Or(
rule.MatchingLanguages("BlitzBasic"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(<^\s*; |End Function)`),
),
rule.Or(
rule.MatchingLanguages("BitBake"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*(# |include|require)\b`),
),
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
),
},
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(`(>\+>|>\+<)`),
),
},
".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)$)`),
),
},
".builds": &Heuristics{
rule.Or(
rule.MatchingLanguages("XML"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^(\s*)(?i:<Project|<Import|<Property|<?xml|xmlns)`),
),
},
".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`),
),
},
".cl": &Heuristics{
rule.Or(
rule.MatchingLanguages("Common Lisp"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*\((?i:defun|in-package|defpackage) `),
),
rule.Or(
rule.MatchingLanguages("Cool"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^class`),
),
rule.Or(
rule.MatchingLanguages("OpenCL"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`\/\* |\/\/ |^\}`),
),
},
".cls": &Heuristics{
rule.Or(
rule.MatchingLanguages("TeX"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*\\(?:NeedsTeXFormat|ProvidesClass){`),
),
rule.Or(
rule.MatchingLanguages("ObjectScript"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^Class\s`),
),
},
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
),
},
".cs": &Heuristics{
rule.Or(
rule.MatchingLanguages("Smalltalk"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`![\w\s]+methodsFor: `),
),
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]*\(`),
),
},
".csl": &Heuristics{
rule.Or(
rule.MatchingLanguages("XML"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(?i:^\s*(\<\?xml|xmlns))`),
),
rule.Or(
rule.MatchingLanguages("Kusto"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(^\|\s*(where|extend|project|limit|summarize))|(^\.\w+)`),
),
},
".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*{[^}]*}`),
),
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)`),
),
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+)`),
),
},
".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`),
),
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+"`),
),
},
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
),
},
".ecl": &Heuristics{
rule.Or(
rule.MatchingLanguages("ECLiPSe"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[^#]+:-`),
),
rule.Or(
rule.MatchingLanguages("ECL"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`:=`),
),
},
".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|\/\*.*?\*\/)`),
),
},
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
),
},
".f": &Heuristics{
rule.Or(
rule.MatchingLanguages("Forth"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^: `),
),
rule.Or(
rule.MatchingLanguages("Filebench WML"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`flowop`),
),
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*!)`),
),
},
".for": &Heuristics{
rule.Or(
rule.MatchingLanguages("Forth"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^: `),
),
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*!)`),
),
},
".fr": &Heuristics{
rule.Or(
rule.MatchingLanguages("Forth"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^(: |also |new-device|previous )`),
),
rule.Or(
rule.MatchingLanguages("Frege"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*(import|module|package|data|type) `),
),
rule.Always(
rule.MatchingLanguages("Text"),
),
},
".fs": &Heuristics{
rule.Or(
rule.MatchingLanguages("Forth"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^(: |new-device)`),
),
rule.Or(
rule.MatchingLanguages("F#"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*(#light|import|let|module|namespace|open|type)`),
),
rule.Or(
rule.MatchingLanguages("GLSL"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*(#version|precision|uniform|varying|vec[234])`),
),
rule.Or(
rule.MatchingLanguages("Filterscript"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`#include|#pragma\s+(rs|version)|__attribute__`),
),
},
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`),
),
},
".gd": &Heuristics{
rule.Or(
rule.MatchingLanguages("GAP"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`\s*(Declare|BindGlobal|KeyDependentOperation)`),
),
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)`),
),
},
".gml": &Heuristics{
rule.Or(
rule.MatchingLanguages("XML"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(?i:^\s*(\<\?xml|xmlns))`),
),
rule.Or(
rule.MatchingLanguages("Graph Modeling Language"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(?i:^\s*(graph|node)\s+\[$)`),
),
rule.Or(
rule.MatchingLanguages("Gerber Image"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[DGMT][0-9]{2}\*$`),
),
rule.Always(
rule.MatchingLanguages("Game Maker Language"),
),
},
".gs": &Heuristics{
rule.Or(
rule.MatchingLanguages("GLSL"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^#version\s+[0-9]+\b`),
),
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]*\(`),
),
},
".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[">])`),
),
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+`),
),
2021-09-25 16:42:06 +00:00
rule.Always(
rule.MatchingLanguages("C"),
),
},
".hh": &Heuristics{
rule.Or(
rule.MatchingLanguages("Hack"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`<\?hh`),
),
},
".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`),
),
rule.Or(
rule.MatchingLanguages("SWIG"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[ \t]*%[a-z_]+\b|^%[{}]$`),
),
},
".ice": &Heuristics{
rule.Or(
rule.MatchingLanguages("JSON"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`\A\s*[{\[]`),
),
rule.Always(
rule.MatchingLanguages("Slice"),
),
},
".inc": &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`),
),
rule.Or(
rule.MatchingLanguages("PHP"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^<\?(?:php)?`),
),
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*{`),
),
rule.Or(
rule.MatchingLanguages("POV-Ray SDL"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*#(declare|local|macro|while)\s`),
),
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
),
},
".l": &Heuristics{
rule.Or(
rule.MatchingLanguages("Common Lisp"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`\(def(un|macro)\s`),
),
rule.Or(
rule.MatchingLanguages("Lex"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^(%[%{}]xs|<.*>)`),
),
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\.[A-Za-z]{2}(\s|$)`),
),
rule.Or(
rule.MatchingLanguages("PicoLisp"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\((de|class|rel|code|data|must)\s`),
),
},
".lisp": &Heuristics{
rule.Or(
rule.MatchingLanguages("Common Lisp"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*\((?i:defun|in-package|defpackage) `),
),
rule.Or(
rule.MatchingLanguages("NewLisp"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*\(define `),
),
},
".ls": &Heuristics{
rule.Or(
rule.MatchingLanguages("LoomScript"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*package\s*[\w\.\/\*\s]*\s*{`),
),
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) `),
),
rule.Or(
rule.MatchingLanguages("NewLisp"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*\(define `),
),
},
".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[">])`),
),
rule.Or(
rule.MatchingLanguages("Mercury"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`:- module`),
),
rule.Or(
rule.MatchingLanguages("MUF"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^: `),
),
rule.Or(
rule.MatchingLanguages("M"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*;`),
),
rule.And(
rule.MatchingLanguages("Mathematica"),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`\(\*`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`\*\)$`),
),
),
rule.Or(
rule.MatchingLanguages("MATLAB"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*%`),
),
rule.Or(
rule.MatchingLanguages("Limbo"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\w+\s*:\s*module\s*{`),
),
},
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"),
),
},
".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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
rule.Always(
rule.MatchingLanguages("Roff"),
),
},
".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`),
),
},
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
),
},
".md": &Heuristics{
rule.Or(
rule.MatchingLanguages("Markdown"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(^[-A-Za-z0-9=#!\*\[|>])|<\/|\A\z`),
),
rule.Or(
rule.MatchingLanguages("GCC Machine Description"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^(;;|\(define_)`),
),
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]+|"[^"]+")`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Dt +(?:[^"\s]+|"[^"]+") +"?(?:[1-9]|@[^\s@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*Sh +(?:[^"\s]|"[^"]+")`),
),
),
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@]+@)`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.'][ \t]*SH +(?:[^"\s]+|"[^"\s]+)`),
),
),
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`),
),
rule.Or(
rule.MatchingLanguages("Standard ML"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`=> |case\s+(\S+\s)+of`),
),
},
".mod": &Heuristics{
rule.Or(
rule.MatchingLanguages("XML"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`<!ENTITY `),
),
rule.Or(
rule.MatchingLanguages("Modula-2"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*(?i:MODULE|END) [\w\.]+;`),
),
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|$)`),
),
rule.And(
rule.MatchingLanguages("Unix Assembly"),
rule.Not(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`/\*`),
),
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]*:)`),
),
),
rule.Always(
rule.MatchingLanguages("MAXScript"),
),
},
".n": &Heuristics{
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[.']`),
),
rule.Or(
rule.MatchingLanguages("Nemerle"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^(module|namespace|using)\s`),
),
},
".ncl": &Heuristics{
rule.Or(
rule.MatchingLanguages("XML"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*<\?xml\s+version`),
),
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
),
rule.Or(
rule.MatchingLanguages("Text"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`THE_TITLE`),
),
},
".nl": &Heuristics{
rule.Or(
rule.MatchingLanguages("NL"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^(b|g)[0-9]+ `),
),
rule.Always(
rule.MatchingLanguages("NewLisp"),
),
},
".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*<`),
),
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`),
),
},
".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`),
),
rule.Always(
rule.MatchingLanguages("OpenEdge ABL"),
),
},
".php": &Heuristics{
rule.Or(
rule.MatchingLanguages("Hack"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`<\?hh`),
),
rule.Or(
rule.MatchingLanguages("PHP"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`<\?[^h]`),
),
},
".pl": &Heuristics{
rule.Or(
rule.MatchingLanguages("Prolog"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[^#]*:-`),
),
rule.Or(
rule.MatchingLanguages("Perl"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`\buse\s+(?:strict\b|v?5\.)`),
),
rule.Or(
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)`),
),
},
".plist": &Heuristics{
rule.Or(
rule.MatchingLanguages("XML Property List"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`<!DOCTYPE\s+plist`),
),
rule.Always(
rule.MatchingLanguages("OpenStep Property List"),
),
},
".pm": &Heuristics{
rule.Or(
rule.MatchingLanguages("Perl"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`\buse\s+(?:strict\b|v?5\.)`),
),
rule.Or(
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)`),
),
rule.Or(
rule.MatchingLanguages("X PixMap"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*\/\* XPM \*\/`),
),
},
".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+)`),
),
rule.Always(
rule.MatchingLanguages("Pod"),
),
},
".pp": &Heuristics{
rule.Or(
rule.MatchingLanguages("Pascal"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*end[.;]`),
),
rule.Or(
rule.MatchingLanguages("Puppet"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s+\w+\s+=>\s`),
),
},
".pro": &Heuristics{
rule.Or(
rule.MatchingLanguages("Proguard"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^-(include\b.*\.pro$|keep\b|keepclassmembers\b|keepattributes\b)`),
),
rule.Or(
rule.MatchingLanguages("Prolog"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[^\[#]+:-`),
),
rule.Or(
rule.MatchingLanguages("INI"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`last_client=`),
),
rule.And(
rule.MatchingLanguages("QMake"),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`HEADERS`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`SOURCES`),
),
),
rule.Or(
rule.MatchingLanguages("IDL"),
2022-10-06 08:23:21 +00:00
regex.MustCompileMultiline(`^\s*(?i:function|pro|compile_opt) \w[ \w,:]*$`),
),
},
".properties": &Heuristics{
rule.And(
rule.MatchingLanguages("INI"),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[^#!;][^=]*=`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[;\[]`),
),
),
rule.And(
rule.MatchingLanguages("Java Properties"),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[^#!;][^=]*=`),
),
rule.Or(
rule.MatchingLanguages(""),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[#!]`),
),
),
rule.Or(
rule.MatchingLanguages("INI"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[^#!;][^=]*=`),
),
rule.Or(
2021-09-25 16:42:06 +00:00
rule.MatchingLanguages("Java Properties"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[^#!][^:]*:`),
),
},
".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?) )`),
),
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))`),
),
},
".qs": &Heuristics{
rule.Or(
rule.MatchingLanguages("Q#"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^((\/{2,3})?\s*(namespace|operation)\b)`),
),
rule.Or(
rule.MatchingLanguages("Qt Script"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(\w+\.prototype\.\w+|===|\bvar\b)`),
),
},
".r": &Heuristics{
rule.Or(
rule.MatchingLanguages("Rebol"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(?i:\bRebol\b)`),
),
rule.Or(
rule.MatchingLanguages("R"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`<-|^\s*#`),
),
},
".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*$)`),
),
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-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
),
},
".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+)`),
),
rule.Or(
rule.MatchingLanguages("Roff"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\.\\" `),
),
},
".rpy": &Heuristics{
rule.Or(
rule.MatchingLanguages("Python"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(?m:^(import|from|class|def)\s)`),
),
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|#!?\[)`),
),
rule.Or(
rule.MatchingLanguages("RenderScript"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`#include|#pragma\s+(rs|version)|__attribute__`),
),
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
),
},
".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`),
),
},
".sc": &Heuristics{
rule.Or(
rule.MatchingLanguages("SuperCollider"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(?i:\^(this|super)\.|^\s*~\w+\s*=\.)`),
),
rule.Or(
rule.MatchingLanguages("Scala"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(^\s*import (scala|java)\.|^\s*class\b)`),
),
},
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)`),
),
},
".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*\{`),
),
rule.Or(
rule.MatchingLanguages("Gerber Image"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^[DGMT][0-9]{2}\*\r?\n`),
),
},
".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*;)`),
),
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*$)`),
),
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)`),
),
rule.Or(
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\])`),
),
rule.Always(
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})$`),
),
},
".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*!\}`),
),
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*\[`),
),
},
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)`),
),
},
".t": &Heuristics{
rule.Or(
rule.MatchingLanguages("Perl"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`\buse\s+(?:strict\b|v?5\.)`),
),
rule.Or(
rule.MatchingLanguages("Raku"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*(?:use\s+v6\b|\bmodule\b|\bmy\s+class\b)`),
),
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+`),
),
},
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`),
),
},
".toc": &Heuristics{
rule.Or(
rule.MatchingLanguages("World of Warcraft Addon Data"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^## |@no-lib-strip@`),
),
rule.Or(
rule.MatchingLanguages("TeX"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\\(contentsline|defcounter|beamer|boolfalse)`),
),
},
".ts": &Heuristics{
rule.Or(
rule.MatchingLanguages("XML"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`<TS\b`),
),
rule.Always(
rule.MatchingLanguages("TypeScript"),
),
},
".tst": &Heuristics{
rule.Or(
rule.MatchingLanguages("GAP"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`gap> `),
),
rule.Always(
rule.MatchingLanguages("Scilab"),
),
},
".tsx": &Heuristics{
rule.Or(
rule.MatchingLanguages("TSX"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^\s*(import.+(from\s+|require\()['"]react|\/\/\/\s*<reference\s)`),
),
rule.Or(
rule.MatchingLanguages("XML"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`(?i:^\s*<\?xml\s+version)`),
),
},
".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>
)*+
\]`),
),
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=`),
),
},
".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`),
),
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|@)`),
),
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*\{`),
),
},
".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`),
),
rule.Always(
rule.MatchingLanguages("VBA"),
),
},
".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`),
),
rule.Or(
rule.MatchingLanguages("CWeb"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^@(<|\w+\.)`),
),
},
".x": &Heuristics{
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`),
),
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*\(`),
),
rule.Or(
rule.MatchingLanguages("Logos"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`^%(end|ctor|hook|group)\b`),
),
rule.Or(
rule.MatchingLanguages("Linker Script"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`OUTPUT_ARCH\(|OUTPUT_FORMAT\(|SECTIONS`),
),
},
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"),
),
},
".yy": &Heuristics{
rule.Or(
rule.MatchingLanguages("JSON"),
2022-12-25 10:57:54 +00:00
regex.MustCompileMultiline(`\"modelName\"\:\s*\"GM`),
),
rule.Always(
rule.MatchingLanguages("Yacc"),
),
},
}