Documentation ¶
Overview ¶
Package data contains only auto-generated data-structures for all the language identification strategies from the Linguist project sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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]+)`), ), ), rule.Always( rule.MatchingLanguages("Roff"), ), }, ".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"), ), }, ".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"), ), }, ".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"), ), }, ".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]+)`), ), ), rule.Always( rule.MatchingLanguages("Roff"), ), }, ".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]+)`), ), ), rule.Always( rule.MatchingLanguages("Roff"), ), }, ".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"), ), }, ".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"), ), }, ".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"), ), }, ".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"), ), }, ".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"), ), }, ".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"), ), }, ".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]+)`), ), ), rule.Always( rule.MatchingLanguages("Roff"), ), }, ".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]+)`), ), ), rule.Always( rule.MatchingLanguages("Roff"), ), }, ".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]+)`), ), ), rule.Always( rule.MatchingLanguages("Roff"), ), }, ".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]+)`), ), ), rule.Always( rule.MatchingLanguages("Roff"), ), }, ".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]+)`), ), ), rule.Always( rule.MatchingLanguages("Roff"), ), }, ".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]+)`), ), ), rule.Always( rule.MatchingLanguages("Roff"), ), }, ".as": &Heuristics{ rule.Or( rule.MatchingLanguages("ActionScript"), regexp.MustCompile(`(?m)^\s*(package\s+[a-z0-9_\.]+|import\s+[a-zA-Z0-9_\.]+;|class\s+[A-Za-z0-9_]+\s+extends\s+[A-Za-z0-9_]+)`), ), rule.Always( rule.MatchingLanguages("AngelScript"), ), }, ".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*[;\(])`), ), }, ".asy": &Heuristics{ rule.Or( rule.MatchingLanguages("LTspice Symbol"), regexp.MustCompile(`(?m)^SymbolType[ \t]`), ), rule.Always( rule.MatchingLanguages("Asymptote"), ), }, ".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`), ), }, ".builds": &Heuristics{ rule.Or( rule.MatchingLanguages("XML"), regexp.MustCompile(`(?m)^(\s*)(?i:<Project|<Import|<Property|<?xml|xmlns)`), ), rule.Always( rule.MatchingLanguages("Text"), ), }, ".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"), regexp.MustCompile(`(?m)\\\w+{`), ), }, ".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*\/\/)`), ), }, ".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"), regexp.MustCompile(`(?m)([\/\\].*:\s+.*\s\\$|: \\$|^ : |^[\w\s\/\\.]+\w+\.\w+\s*:\s+[\w\s\/\\.]+\w+\.\w+)`), ), }, ".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*->)`), ), }, ".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__`), ), }, ".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+\[$)`), ), rule.Always( rule.MatchingLanguages("Game Maker Language"), ), }, ".gs": &Heuristics{ rule.Or( rule.MatchingLanguages("Gosu"), regexp.MustCompile(`(?m)^uses java\.`), ), }, ".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++"), 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|^[ \t]*catch\s*\(|^[ \t]*(class|(using[ \t]+)?namespace)\s+\w+|^[ \t]*(private|public|protected):$|std::\w+`), ), }, ".hh": &Heuristics{ rule.Or( rule.MatchingLanguages("Hack"), regexp.MustCompile(`(?m)<\?hh`), ), }, ".ice": &Heuristics{ rule.Or( rule.MatchingLanguages("JSON"), regexp.MustCompile(`(?m)\A\s*[{\[]`), ), rule.Always( rule.MatchingLanguages("Slice"), ), }, ".inc": &Heuristics{ rule.Or( rule.MatchingLanguages("PHP"), regexp.MustCompile(`(?m)^<\?(?:php)?`), ), rule.Or( rule.MatchingLanguages("POV-Ray SDL"), regexp.MustCompile(`(?m)^\s*#(declare|local|macro|while)\s`), ), }, ".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*;`), ), rule.Or( rule.MatchingLanguages("Mathematica"), regexp.MustCompile(`(?m)\*\)$`), ), rule.Or( rule.MatchingLanguages("MATLAB"), regexp.MustCompile(`(?m)^\s*%`), ), rule.Or( rule.MatchingLanguages("Limbo"), regexp.MustCompile(`(?m)^\w+\s*:\s*module\s*{`), ), }, ".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"), ), }, ".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`), ), 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"), ), }, ".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( rule.MatchingLanguages("Perl 6"), regexp.MustCompile(`(?m)^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)`), ), }, ".pm": &Heuristics{ rule.Or( rule.MatchingLanguages("Perl"), regexp.MustCompile(`(?m)\buse\s+(?:strict\b|v?5\.)`), ), rule.Or( rule.MatchingLanguages("Perl 6"), regexp.MustCompile(`(?m)^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)`), ), rule.Or( rule.MatchingLanguages("XPM"), 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{ 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( rule.MatchingLanguages("Java properties"), regexp.MustCompile(`(?m)^[^#!][^:]*:`), ), }, ".props": &Heuristics{ rule.Or( rule.MatchingLanguages("XML"), regexp.MustCompile(`(?m)^(\s*)(?i:<Project|<Import|<Property|<?xml|xmlns)`), ), rule.Or( rule.MatchingLanguages("INI"), regexp.MustCompile(`(?m)(?i:\w+\s*=\s*)`), ), }, ".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))`), ), }, ".r": &Heuristics{ rule.Or( rule.MatchingLanguages("Rebol"), regexp.MustCompile(`(?m)(?i:\bRebol\b)`), ), rule.Or( rule.MatchingLanguages("R"), regexp.MustCompile(`(?m)<-|^\s*#`), ), }, ".rno": &Heuristics{ rule.Or( rule.MatchingLanguages("RUNOFF"), regexp.MustCompile(`(?m)(?i:^\.!|^\.end lit(?:eral)?\b)`), ), 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__`), ), }, ".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)`), ), }, ".sql": &Heuristics{ rule.Or( rule.MatchingLanguages("PLpgSQL"), regexp.MustCompile(`(?m)(?i:^\\i\b|AS \$\$|LANGUAGE '?plpgsql'?|SECURITY (DEFINER|INVOKER)|BEGIN( WORK| TRANSACTION)?;)`), ), rule.Or( rule.MatchingLanguages("SQLPL"), regexp.MustCompile(`(?m)(?i:(alter module)|(language sql)|(begin( NOT)+ atomic)|signal SQLSTATE '[0-9]+')`), ), rule.Or( rule.MatchingLanguages("PLSQL"), regexp.MustCompile(`(?m)(?i:\$\$PLSQL_|XMLTYPE|sysdate|systimestamp|\.nextval|connect by|AUTHID (DEFINER|CURRENT_USER)|constructor\W+function)`), ), rule.Not( rule.MatchingLanguages("SQL"), regexp.MustCompile(`(?m)(?i:begin|boolean|package|exception)`), ), }, ".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})$`), ), }, ".t": &Heuristics{ rule.Or( rule.MatchingLanguages("Perl"), regexp.MustCompile(`(?m)\buse\s+(?:strict\b|v?5\.)`), ), rule.Or( rule.MatchingLanguages("Perl 6"), regexp.MustCompile(`(?m)^\s*(?:use\s+v6\b|\bmodule\b|\b(?:my\s+)?class\b)`), ), 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( rule.MatchingLanguages("TypeScript"), 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)`), ), }, ".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{ 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( rule.MatchingLanguages("Linked Script"), regexp.MustCompile(`(?m)OUTPUT_ARCH\(|OUTPUT_FORMAT\(|SECTIONS`), ), }, ".yy": &Heuristics{ rule.Or( rule.MatchingLanguages("JSON"), regexp.MustCompile(`(?m)\"modelName\"\:\s*\"GM`), ), rule.Always( rule.MatchingLanguages("Yacc"), ), }, }
var DocumentationMatchers = substring.Or(
substring.Regexp(`^[Dd]ocs?/`),
substring.Regexp(`(^|/)[Dd]ocumentation/`),
substring.Regexp(`(^|/)[Gg]roovydoc/`),
substring.Regexp(`(^|/)[Jj]avadoc/`),
substring.Regexp(`^[Mm]an/`),
substring.Regexp(`^[Ee]xamples/`),
substring.Regexp(`^[Dd]emos?/`),
substring.Regexp(`(^|/)inst/doc/`),
substring.Regexp(`(^|/)CHANGE(S|LOG)?(\.|$)`),
substring.Regexp(`(^|/)CONTRIBUTING(\.|$)`),
substring.Regexp(`(^|/)COPYING(\.|$)`),
substring.Regexp(`(^|/)INSTALL(\.|$)`),
substring.Regexp(`(^|/)LICEN[CS]E(\.|$)`),
substring.Regexp(`(^|/)[Ll]icen[cs]e(\.|$)`),
substring.Regexp(`(^|/)README(\.|$)`),
substring.Regexp(`(^|/)[Rr]eadme(\.|$)`),
substring.Regexp(`^[Ss]amples?/`),
)
var ExtensionsByLanguage = map[string][]string{}/* 486 elements not displayed */
var LanguageByAliasMap = map[string]string{}/* 726 elements not displayed */
LanguageByAliasMap keeps alias for different languages and use the name of the languages as an alias too. All the keys (alias or not) are written in lower case and the whitespaces has been replaced by underscores.
var LanguagesByExtension = map[string][]string{}/* 1087 elements not displayed */
var LanguagesByFilename = map[string][]string{}/* 225 elements not displayed */
var LanguagesByInterpreter = map[string][]string{}/* 109 elements not displayed */
var LanguagesLogProbabilities = map[string]float64{}/* 428 elements not displayed */
var LanguagesMime = map[string]string{}/* 212 elements not displayed */
var LanguagesType = map[string]int{}/* 499 elements not displayed */
var LinguistCommit = "e4560984058b4726010ca4b8f03ed9d0f8f464db"
linguist's commit from which files were generated.
var TokensLogProbabilities = map[string]map[string]float64{}/* 428 elements not displayed */
var TokensTotal = 1851501.000000
var VendorMatchers = substring.Or(
substring.Regexp(`(^|/)cache/`),
substring.Regexp(`^[Dd]ependencies/`),
substring.Regexp(`(^|/)dist/`),
substring.Regexp(`^deps/`),
substring.Regexp(`(^|/)configure$`),
substring.Regexp(`(^|/)config.guess$`),
substring.Regexp(`(^|/)config.sub$`),
substring.Regexp(`(^|/)aclocal.m4`),
substring.Regexp(`(^|/)libtool.m4`),
substring.Regexp(`(^|/)ltoptions.m4`),
substring.Regexp(`(^|/)ltsugar.m4`),
substring.Regexp(`(^|/)ltversion.m4`),
substring.Regexp(`(^|/)lt~obsolete.m4`),
substring.Regexp(`cpplint.py`),
substring.Regexp(`node_modules/`),
substring.Regexp(`bower_components/`),
substring.Regexp(`^rebar$`),
substring.Regexp(`erlang.mk`),
substring.Regexp(`Godeps/_workspace/`),
substring.Regexp(`.indent.pro`),
substring.Regexp(`(\.|-)min\.(js|css)$`),
substring.Regexp(`([^\s]*)import\.(css|less|scss|styl)$`),
substring.Regexp(`(^|/)bootstrap([^.]*)\.(js|css|less|scss|styl)$`),
substring.Regexp(`(^|/)custom\.bootstrap([^\s]*)(js|css|less|scss|styl)$`),
substring.Regexp(`(^|/)font-awesome\.(css|less|scss|styl)$`),
substring.Regexp(`(^|/)font-awesome/.*\.(css|less|scss|styl)$`),
substring.Regexp(`(^|/)foundation\.(css|less|scss|styl)$`),
substring.Regexp(`(^|/)normalize\.(css|less|scss|styl)$`),
substring.Regexp(`(^|/)skeleton\.(css|less|scss|styl)$`),
substring.Regexp(`(^|/)[Bb]ourbon/.*\.(css|less|scss|styl)$`),
substring.Regexp(`(^|/)animate\.(css|less|scss|styl)$`),
substring.Regexp(`(^|/)materialize\.(css|less|scss|styl|js)$`),
substring.Regexp(`(^|/)select2/.*\.(css|scss|js)$`),
substring.Regexp(`(3rd|[Tt]hird)[-_]?[Pp]arty/`),
substring.Regexp(`vendors?/`),
substring.Regexp(`extern(al)?/`),
substring.Regexp(`(^|/)[Vv]+endor/`),
substring.Regexp(`^debian/`),
substring.Regexp(`run.n$`),
substring.Regexp(`bootstrap-datepicker/`),
substring.Regexp(`(^|/)jquery([^.]*)\.js$`),
substring.Regexp(`(^|/)jquery\-\d\.\d+(\.\d+)?\.js$`),
substring.Regexp(`(^|/)jquery\-ui(\-\d\.\d+(\.\d+)?)?(\.\w+)?\.(js|css)$`),
substring.Regexp(`(^|/)jquery\.(ui|effects)\.([^.]*)\.(js|css)$`),
substring.Regexp(`jquery.fn.gantt.js`),
substring.Regexp(`jquery.fancybox.(js|css)`),
substring.Regexp(`fuelux.js`),
substring.Regexp(`(^|/)jquery\.fileupload(-\w+)?\.js$`),
substring.Regexp(`jquery.dataTables.js`),
substring.Regexp(`bootbox.js`),
substring.Regexp(`pdf.worker.js`),
substring.Regexp(`(^|/)slick\.\w+.js$`),
substring.Regexp(`(^|/)Leaflet\.Coordinates-\d+\.\d+\.\d+\.src\.js$`),
substring.Regexp(`leaflet.draw-src.js`),
substring.Regexp(`leaflet.draw.css`),
substring.Regexp(`Control.FullScreen.css`),
substring.Regexp(`Control.FullScreen.js`),
substring.Regexp(`leaflet.spin.js`),
substring.Regexp(`wicket-leaflet.js`),
substring.Regexp(`.sublime-project`),
substring.Regexp(`.sublime-workspace`),
substring.Regexp(`.vscode`),
substring.Regexp(`(^|/)prototype(.*)\.js$`),
substring.Regexp(`(^|/)effects\.js$`),
substring.Regexp(`(^|/)controls\.js$`),
substring.Regexp(`(^|/)dragdrop\.js$`),
substring.Regexp(`(.*?)\.d\.ts$`),
substring.Regexp(`(^|/)mootools([^.]*)\d+\.\d+.\d+([^.]*)\.js$`),
substring.Regexp(`(^|/)dojo\.js$`),
substring.Regexp(`(^|/)MochiKit\.js$`),
substring.Regexp(`(^|/)yahoo-([^.]*)\.js$`),
substring.Regexp(`(^|/)yui([^.]*)\.js$`),
substring.Regexp(`(^|/)ckeditor\.js$`),
substring.Regexp(`(^|/)tiny_mce([^.]*)\.js$`),
substring.Regexp(`(^|/)tiny_mce/(langs|plugins|themes|utils)`),
substring.Regexp(`(^|/)ace-builds/`),
substring.Regexp(`(^|/)fontello(.*?)\.css$`),
substring.Regexp(`(^|/)MathJax/`),
substring.Regexp(`(^|/)Chart\.js$`),
substring.Regexp(`(^|/)[Cc]ode[Mm]irror/(\d+\.\d+/)?(lib|mode|theme|addon|keymap|demo)`),
substring.Regexp(`(^|/)shBrush([^.]*)\.js$`),
substring.Regexp(`(^|/)shCore\.js$`),
substring.Regexp(`(^|/)shLegacy\.js$`),
substring.Regexp(`(^|/)angular([^.]*)\.js$`),
substring.Regexp(`(^|\/)d3(\.v\d+)?([^.]*)\.js$`),
substring.Regexp(`(^|/)react(-[^.]*)?\.js$`),
substring.Regexp(`(^|/)flow-typed/.*\.js$`),
substring.Regexp(`(^|/)modernizr\-\d\.\d+(\.\d+)?\.js$`),
substring.Regexp(`(^|/)modernizr\.custom\.\d+\.js$`),
substring.Regexp(`(^|/)knockout-(\d+\.){3}(debug\.)?js$`),
substring.Regexp(`(^|/)docs?/_?(build|themes?|templates?|static)/`),
substring.Regexp(`(^|/)admin_media/`),
substring.Regexp(`(^|/)env/`),
substring.Regexp(`^fabfile\.py$`),
substring.Regexp(`^waf$`),
substring.Regexp(`^.osx$`),
substring.Regexp(`\.xctemplate/`),
substring.Regexp(`\.imageset/`),
substring.Regexp(`(^|/)Carthage/`),
substring.Regexp(`(^|/)Sparkle/`),
substring.Regexp(`Crashlytics.framework/`),
substring.Regexp(`Fabric.framework/`),
substring.Regexp(`BuddyBuildSDK.framework/`),
substring.Regexp(`Realm.framework`),
substring.Regexp(`RealmSwift.framework`),
substring.Regexp(`gitattributes$`),
substring.Regexp(`gitignore$`),
substring.Regexp(`gitmodules$`),
substring.Regexp(`(^|/)gradlew$`),
substring.Regexp(`(^|/)gradlew\.bat$`),
substring.Regexp(`(^|/)gradle/wrapper/`),
substring.Regexp(`(^|/)mvnw$`),
substring.Regexp(`(^|/)mvnw\.cmd$`),
substring.Regexp(`(^|/)\.mvn/wrapper/`),
substring.Regexp(`-vsdoc\.js$`),
substring.Regexp(`\.intellisense\.js$`),
substring.Regexp(`(^|/)jquery([^.]*)\.validate(\.unobtrusive)?\.js$`),
substring.Regexp(`(^|/)jquery([^.]*)\.unobtrusive\-ajax\.js$`),
substring.Regexp(`(^|/)[Mm]icrosoft([Mm]vc)?([Aa]jax|[Vv]alidation)(\.debug)?\.js$`),
substring.Regexp(`^[Pp]ackages\/.+\.\d+\/`),
substring.Regexp(`(^|/)extjs/.*?\.js$`),
substring.Regexp(`(^|/)extjs/.*?\.xml$`),
substring.Regexp(`(^|/)extjs/.*?\.txt$`),
substring.Regexp(`(^|/)extjs/.*?\.html$`),
substring.Regexp(`(^|/)extjs/.*?\.properties$`),
substring.Regexp(`(^|/)extjs/.sencha/`),
substring.Regexp(`(^|/)extjs/docs/`),
substring.Regexp(`(^|/)extjs/builds/`),
substring.Regexp(`(^|/)extjs/cmd/`),
substring.Regexp(`(^|/)extjs/examples/`),
substring.Regexp(`(^|/)extjs/locale/`),
substring.Regexp(`(^|/)extjs/packages/`),
substring.Regexp(`(^|/)extjs/plugins/`),
substring.Regexp(`(^|/)extjs/resources/`),
substring.Regexp(`(^|/)extjs/src/`),
substring.Regexp(`(^|/)extjs/welcome/`),
substring.Regexp(`(^|/)html5shiv\.js$`),
substring.Regexp(`^[Tt]ests?/fixtures/`),
substring.Regexp(`^[Ss]pecs?/fixtures/`),
substring.Regexp(`(^|/)cordova([^.]*)\.js$`),
substring.Regexp(`(^|/)cordova\-\d\.\d(\.\d)?\.js$`),
substring.Regexp(`foundation(\..*)?\.js$`),
substring.Regexp(`^Vagrantfile$`),
substring.Regexp(`.[Dd][Ss]_[Ss]tore$`),
substring.Regexp(`^vignettes/`),
substring.Regexp(`^inst/extdata/`),
substring.Regexp(`octicons.css`),
substring.Regexp(`sprockets-octicons.scss`),
substring.Regexp(`(^|/)activator$`),
substring.Regexp(`(^|/)activator\.bat$`),
substring.Regexp(`proguard.pro`),
substring.Regexp(`proguard-rules.pro`),
substring.Regexp(`^puphpet/`),
substring.Regexp(`(^|/)\.google_apis/`),
substring.Regexp(`^Jenkinsfile$`),
)
Functions ¶
func LanguageByAlias ¶ added in v1.7.0
LanguageByAlias looks up the language name by it's alias or name. It mirrors the logic of github linguist and is needed e.g for heuristcs.yml that mixes names and aliases in a language field (see XPM example).
Types ¶
type Heuristics ¶ added in v1.7.0
Heuristics is a number of sequntially applied rule.Heuristic where a matching one disambiguages language(s) for a single file extension.
func (Heuristics) Match ¶ added in v1.7.0
func (hs Heuristics) Match(data []byte) []string
Match returns languages identified by the matching rule of the heuristic.