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