Merge pull request #22 from mcarmonaa/shebang

Added language detection by shebang functionality
This commit is contained in:
Santiago M. Mola
2017-05-04 15:58:31 +02:00
committed by GitHub
43 changed files with 974 additions and 969 deletions

View File

@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
@ -12,18 +13,20 @@ import (
)
func main() {
flag.Usage = usage
flag.Parse()
root, err := filepath.Abs(flag.Arg(0))
ifError(err)
if root == "" {
usage()
if err != nil {
log.Fatal(err)
}
errors := false
o := make(map[string][]string, 0)
err = filepath.Walk(root, func(path string, f os.FileInfo, err error) error {
if err != nil {
return err
errors = true
log.Println(err)
return filepath.SkipDir
}
if slinguist.IsVendor(f.Name()) || slinguist.IsDotFile(f.Name()) {
@ -38,22 +41,36 @@ func main() {
return nil
}
l, safe := slinguist.GetLanguageByExtension(path)
if !safe {
content, _ := ioutil.ReadFile(path)
l, safe = slinguist.GetLanguageByContent(path, content)
content, err := ioutil.ReadFile(path)
if err != nil {
errors = true
log.Println(err)
return nil
}
l := slinguist.GetLanguage(path, content)
r, err := filepath.Rel(root, path)
if err != nil {
errors = true
log.Println(err)
return nil
}
r, _ := filepath.Rel(root, path)
o[l] = append(o[l], r)
return nil
})
ifError(err)
if err != nil {
log.Fatal(err)
}
js, _ := json.MarshalIndent(o, "", " ")
fmt.Printf("%s\n", js)
if errors {
os.Exit(2)
}
}
func usage() {
@ -63,12 +80,4 @@ func usage() {
)
flag.PrintDefaults()
os.Exit(2)
}
func ifError(err error) {
if err != nil {
fmt.Fprintf(os.Stderr, err.Error())
os.Exit(2)
}
}

View File

@ -36,6 +36,10 @@ func GetLanguageExtensions(language string) []string {
// GetLanguage return the Language for a given filename and file content.
func GetLanguage(filename string, content []byte) string {
if lang, safe := GetLanguageByShebang(content); safe {
return lang
}
if lang, safe := GetLanguageByExtension(filename); safe {
return lang
}

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: dae33dc2b20cddc85d1300435c3be7118a7115a9

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: dae33dc2b20cddc85d1300435c3be7118a7115a9

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}

View File

@ -0,0 +1,11 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}
var languagesByInterpreter = map[string][]string{
{{range $interpreter, $languages := . -}}
"{{ $interpreter }}": { {{- $languages | formatStringSlice -}} },
{{end -}}
}

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}

View File

@ -1,19 +1,21 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}
type Type int
const (
TypeUnknown Type = iota
TypeData
TypeProgramming
TypeMarkup
TypeProse
// Language's type. Either data, programming, markup, prose, or unknown.
Unknown Type = iota
Data
Programming
Markup
Prose
)
// GetLanguageType returns the given language's type.
func GetLanguageType(language string) (langType Type) {
langType, _ = languagesType[language]
return langType

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}

View File

@ -12,18 +12,11 @@ import (
const (
commitTest = "fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7"
// FromFile test
formatedLangGold = "test_files/formated_languages.gold"
formatedContentGold = "test_files/formated_content.gold"
formatedVendorGold = "test_files/formated_vendor.gold"
formatedDocumentationGold = "test_files/formated_documentation.gold"
formatedTypesGold = "test_files/formated_type.gold"
// Languages test
ymlTestFile = "test_files/languages.test.yml"
langGold = "test_files/languages.gold"
languagesTestTmplPath = "test_files/languages.test.tmpl"
languagesTestTmplName = "languages.test.tmpl"
languagesTestTmplPath = "test_files/languages.test.go.tmpl"
languagesTestTmplName = "languages.test.go.tmpl"
// Heuristics test
heuristicsTestFile = "test_files/heuristics.test.rb"
@ -48,22 +41,31 @@ const (
typesGold = "test_files/type.gold"
typesTestTmplPath = "test_files/type.test.go.tmpl"
typesTestTmplName = "type.test.go.tmpl"
// Interpreters test
interpretersTestFile = "test_files/interpreters.test.yml"
interpretersGold = "test_files/interpreters.gold"
interpretersTestTmplPath = "test_files/interpreters.test.go.tmpl"
interpretersTestTmplName = "interpreters.test.go.tmpl"
)
func TestFromFile(t *testing.T) {
goldLang, err := ioutil.ReadFile(formatedLangGold)
goldLang, err := ioutil.ReadFile(langGold)
assert.NoError(t, err)
goldContent, err := ioutil.ReadFile(formatedContentGold)
goldContent, err := ioutil.ReadFile(contentGold)
assert.NoError(t, err)
goldVendor, err := ioutil.ReadFile(formatedVendorGold)
goldVendor, err := ioutil.ReadFile(vendorGold)
assert.NoError(t, err)
goldDocumentation, err := ioutil.ReadFile(formatedDocumentationGold)
goldDocumentation, err := ioutil.ReadFile(documentationGold)
assert.NoError(t, err)
goldTypes, err := ioutil.ReadFile(formatedTypesGold)
goldTypes, err := ioutil.ReadFile(typesGold)
assert.NoError(t, err)
goldInterpreters, err := ioutil.ReadFile(interpretersGold)
assert.NoError(t, err)
outPathLang, err := ioutil.TempFile("/tmp", "generator-test-")
@ -86,6 +88,10 @@ func TestFromFile(t *testing.T) {
assert.NoError(t, err)
defer os.Remove(outPathTypes.Name())
outPathInterpreters, err := ioutil.TempFile("/tmp", "generator-test-")
assert.NoError(t, err)
defer os.Remove(outPathInterpreters.Name())
tests := []struct {
name string
fileToParse string
@ -137,7 +143,7 @@ func TestFromFile(t *testing.T) {
wantOut: goldDocumentation,
},
{
name: "tyTestFromFile_Types",
name: "TestFromFile_Types",
fileToParse: typesTestFile,
outPath: outPathTypes.Name(),
tmplPath: typesTestTmplPath,
@ -146,6 +152,16 @@ func TestFromFile(t *testing.T) {
generate: Types,
wantOut: goldTypes,
},
{
name: "TestFromFile_Interpreters",
fileToParse: interpretersTestFile,
outPath: outPathInterpreters.Name(),
tmplPath: interpretersTestTmplPath,
tmplName: interpretersTestTmplName,
commit: commitTest,
generate: Interpreters,
wantOut: goldInterpreters,
},
}
for _, tt := range tests {
@ -158,173 +174,3 @@ func TestFromFile(t *testing.T) {
})
}
}
func TestLanguages(t *testing.T) {
gold, err := ioutil.ReadFile(langGold)
assert.NoError(t, err)
input, err := ioutil.ReadFile(ymlTestFile)
assert.NoError(t, err)
tests := []struct {
name string
input []byte
tmplPath string
tmplName string
commit string
wantOut []byte
}{
{
name: "TestLanguages",
input: input,
tmplPath: languagesTestTmplPath,
tmplName: languagesTestTmplName,
commit: commitTest,
wantOut: gold,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
out, err := Languages(tt.input, tt.tmplPath, tt.tmplName, tt.commit)
assert.NoError(t, err)
assert.EqualValues(t, tt.wantOut, out, fmt.Sprintf("Languages() = %v, want %v", string(out), string(tt.wantOut)))
})
}
}
func TestHeuristics(t *testing.T) {
gold, err := ioutil.ReadFile(contentGold)
assert.NoError(t, err)
input, err := ioutil.ReadFile(heuristicsTestFile)
assert.NoError(t, err)
tests := []struct {
name string
input []byte
tmplPath string
tmplName string
commit string
wantOut []byte
}{
{
name: "TestHeuristics",
input: input,
tmplPath: contentTestTmplPath,
tmplName: contentTestTmplName,
commit: commitTest,
wantOut: gold,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
out, err := Heuristics(tt.input, tt.tmplPath, tt.tmplName, tt.commit)
assert.NoError(t, err)
assert.EqualValues(t, tt.wantOut, out, fmt.Sprintf("Heuristics() = %v, want %v", string(out), string(tt.wantOut)))
})
}
}
func TestVendor(t *testing.T) {
gold, err := ioutil.ReadFile(vendorGold)
assert.NoError(t, err)
input, err := ioutil.ReadFile(vendorTestFile)
assert.NoError(t, err)
tests := []struct {
name string
input []byte
tmplPath string
tmplName string
commit string
wantOut []byte
}{
{
name: "TestVendor",
input: input,
tmplPath: vendorTestTmplPath,
tmplName: vendorTestTmplName,
commit: commitTest,
wantOut: gold,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
out, err := Vendor(tt.input, tt.tmplPath, tt.tmplName, tt.commit)
assert.NoError(t, err)
assert.EqualValues(t, tt.wantOut, out, fmt.Sprintf("Vendor() = %v, want %v", string(out), string(tt.wantOut)))
})
}
}
func TestDocumentation(t *testing.T) {
gold, err := ioutil.ReadFile(documentationGold)
assert.NoError(t, err)
input, err := ioutil.ReadFile(documentationTestFile)
assert.NoError(t, err)
tests := []struct {
name string
input []byte
tmplPath string
tmplName string
commit string
wantOut []byte
}{
{
name: "TestDocumentation",
input: input,
tmplPath: documentationTestTmplPath,
tmplName: documentationTestTmplName,
commit: commitTest,
wantOut: gold,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
out, err := Documentation(tt.input, tt.tmplPath, tt.tmplName, tt.commit)
assert.NoError(t, err)
assert.EqualValues(t, tt.wantOut, out, fmt.Sprintf("Documentation() = %v, want %v", string(out), string(tt.wantOut)))
})
}
}
func TestTypes(t *testing.T) {
gold, err := ioutil.ReadFile(typesGold)
assert.NoError(t, err)
input, err := ioutil.ReadFile(typesTestFile)
assert.NoError(t, err)
tests := []struct {
name string
input []byte
tmplPath string
tmplName string
commit string
wantOut []byte
}{
{
name: "TestTypes",
input: input,
tmplPath: typesTestTmplPath,
tmplName: typesTestTmplName,
commit: commitTest,
wantOut: gold,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
out, err := Types(tt.input, tt.tmplPath, tt.tmplName, tt.commit)
assert.NoError(t, err)
assert.EqualValues(t, tt.wantOut, out, fmt.Sprintf("Types() = %v, want %v", string(out), string(tt.wantOut)))
})
}
}

View File

@ -0,0 +1,54 @@
package generator
import (
"bytes"
"io"
"strings"
"text/template"
"gopkg.in/yaml.v2"
)
// Interpreters reads from buf and builds interpreters_map.go file from interpretersTmplPath.
func Interpreters(data []byte, interpretersTmplPath, interpretersTmplName, commit string) ([]byte, error) {
languages := make(map[string]*languageInfo)
if err := yaml.Unmarshal(data, &languages); err != nil {
return nil, err
}
orderedKeys := getAlphabeticalOrderedKeys(languages)
languagesByInterpreter := buildInterpreterLanguagesMap(languages, orderedKeys)
buf := &bytes.Buffer{}
if err := executeInterpretersTemplate(buf, languagesByInterpreter, interpretersTmplPath, interpretersTmplName, commit); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
func buildInterpreterLanguagesMap(languages map[string]*languageInfo, orderedKeys []string) map[string][]string {
interpreterLangsMap := make(map[string][]string)
for _, lang := range orderedKeys {
langInfo := languages[lang]
for _, interpreter := range langInfo.Interpreters {
interpreterLangsMap[interpreter] = append(interpreterLangsMap[interpreter], lang)
}
}
return interpreterLangsMap
}
func executeInterpretersTemplate(out io.Writer, languagesByInterpreter map[string][]string, interpretersTmplPath, interpretersTmpl, commit string) error {
fmap := template.FuncMap{
"getCommit": func() string { return commit },
"formatStringSlice": func(slice []string) string { return `"` + strings.Join(slice, `","`) + `"` },
}
t := template.Must(template.New(interpretersTmpl).Funcs(fmap).ParseFiles(interpretersTmplPath))
if err := t.Execute(out, languagesByInterpreter); err != nil {
return err
}
return nil
}

View File

@ -3,6 +3,7 @@ package generator
import (
"bytes"
"io"
"sort"
"strings"
"text/template"
@ -11,10 +12,8 @@ import (
type languageInfo struct {
Type string `yaml:"type,omitempty"`
Aliases []string `yaml:"aliases,omitempty,flow"`
Extensions []string `yaml:"extensions,omitempty,flow"`
Interpreters []string `yaml:"interpreters,omitempty,flow"`
Group string `yaml:"group,omitempty"`
}
// Languages reads from buf and builds languages.go file from languagesTmplPath.
@ -24,11 +23,7 @@ func Languages(data []byte, languagesTmplPath, languagesTmplName, commit string)
return nil, err
}
orderedKeyList, err := getAlphabeticalOrderedKeys(data)
if err != nil {
return nil, err
}
orderedKeyList := getAlphabeticalOrderedKeys(languages)
languagesByExtension := buildExtensionLanguageMap(languages, orderedKeyList)
buf := &bytes.Buffer{}
@ -39,18 +34,14 @@ func Languages(data []byte, languagesTmplPath, languagesTmplName, commit string)
return buf.Bytes(), nil
}
func getAlphabeticalOrderedKeys(data []byte) ([]string, error) {
var yamlSlice yaml.MapSlice
if err := yaml.Unmarshal(data, &yamlSlice); err != nil {
return nil, err
func getAlphabeticalOrderedKeys(languages map[string]*languageInfo) []string {
keyList := make([]string, 0)
for lang := range languages {
keyList = append(keyList, lang)
}
orderedKeyList := make([]string, 0)
for _, lang := range yamlSlice {
orderedKeyList = append(orderedKeyList, lang.Key.(string))
}
return orderedKeyList, nil
sort.Strings(keyList)
return keyList
}
func buildExtensionLanguageMap(languages map[string]*languageInfo, orderedKeyList []string) map[string][]string {

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
@ -20,7 +20,7 @@ func GetLanguageByContent(filename string, content []byte) (lang string, safe bo
return GetLanguageByExtension(filename)
}
type languageMatcher func ([]byte) (string, bool)
type languageMatcher func([]byte) (string, bool)
var matchers = map[string]languageMatcher{
".asc": func(i []byte) (string, bool) {
@ -63,19 +63,19 @@ var matchers = map[string]languageMatcher{
return OtherLanguage, false
},
}
}
var (
asc_PublicKey_Matcher_0 = regexp.MustCompile(`(?m)^(----[- ]BEGIN|ssh-(rsa|dss)) `)
asc_AsciiDoc_Matcher_0 = regexp.MustCompile(`(?m)^[=-]+(\s|\n)|{{[A-Za-z]`)
asc_AGSScript_Matcher_0 = regexp.MustCompile(`(?m)^(\/\/.+|((import|export)\s+)?(function|int|float|char)\s+((room|repeatedly|on|game)_)?([A-Za-z]+[A-Za-z_0-9]+)\s*[;\(])`)
ms_Groff_Matcher_0 = regexp.MustCompile(`(?mi)^[.'][a-z][a-z](\s|$)`)
mod_XML_Matcher_0 = regexp.MustCompile(`(?m)<!ENTITY `)
mod_ModulaDash2_Matcher_0 = regexp.MustCompile(`(?mi)^\s*MODULE [\w\.]+;`)
mod_ModulaDash2_Matcher_1 = regexp.MustCompile(`(?mi)^\s*END [\w\.]+;`)
pro_Prolog_Matcher_0 = regexp.MustCompile(`(?m)^[^#]+:-`)
pro_INI_Matcher_0 = regexp.MustCompile(`(?m)last_client=`)
pro_QMake_Matcher_0 = regexp.MustCompile(`(?m)HEADERS`)
pro_QMake_Matcher_1 = regexp.MustCompile(`(?m)SOURCES`)
pro_IDL_Matcher_0 = regexp.MustCompile(`(?m)^\s*function[ \w,]+$`)
)
asc_PublicKey_Matcher_0 = regexp.MustCompile(`(?m)^(----[- ]BEGIN|ssh-(rsa|dss)) `)
asc_AsciiDoc_Matcher_0 = regexp.MustCompile(`(?m)^[=-]+(\s|\n)|{{[A-Za-z]`)
asc_AGSScript_Matcher_0 = regexp.MustCompile(`(?m)^(\/\/.+|((import|export)\s+)?(function|int|float|char)\s+((room|repeatedly|on|game)_)?([A-Za-z]+[A-Za-z_0-9]+)\s*[;\(])`)
ms_Groff_Matcher_0 = regexp.MustCompile(`(?mi)^[.'][a-z][a-z](\s|$)`)
mod_XML_Matcher_0 = regexp.MustCompile(`(?m)<!ENTITY `)
mod_ModulaDash2_Matcher_0 = regexp.MustCompile(`(?mi)^\s*MODULE [\w\.]+;`)
mod_ModulaDash2_Matcher_1 = regexp.MustCompile(`(?mi)^\s*END [\w\.]+;`)
pro_Prolog_Matcher_0 = regexp.MustCompile(`(?m)^[^#]+:-`)
pro_INI_Matcher_0 = regexp.MustCompile(`(?m)last_client=`)
pro_QMake_Matcher_0 = regexp.MustCompile(`(?m)HEADERS`)
pro_QMake_Matcher_1 = regexp.MustCompile(`(?m)SOURCES`)
pro_IDL_Matcher_0 = regexp.MustCompile(`(?m)^\s*function[ \w,]+$`)
)

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
@ -22,4 +22,4 @@ var documentationMatchers = substring.Or(
substring.Regexp(`(^|/)README(\.|$)`),
substring.Regexp(`(^|/)[Rr]eadme(\.|$)`),
substring.Regexp(`^[Ss]amples?/`),
)
)

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}

View File

@ -1,81 +0,0 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
import (
"path/filepath"
"regexp"
"strings"
)
func GetLanguageByContent(filename string, content []byte) (lang string, safe bool) {
ext := strings.ToLower(filepath.Ext(filename))
if fnMatcher, ok := matchers[ext]; ok {
lang, safe = fnMatcher(content)
return
}
return GetLanguageByExtension(filename)
}
type languageMatcher func([]byte) (string, bool)
var matchers = map[string]languageMatcher{
".asc": func(i []byte) (string, bool) {
if asc_PublicKey_Matcher_0.Match(i) {
return "Public Key", true
} else if asc_AsciiDoc_Matcher_0.Match(i) {
return "AsciiDoc", true
} else if asc_AGSScript_Matcher_0.Match(i) {
return "AGS Script", true
}
return OtherLanguage, false
},
".ms": func(i []byte) (string, bool) {
if ms_Groff_Matcher_0.Match(i) {
return "Groff", true
}
return "MAXScript", true
},
".mod": func(i []byte) (string, bool) {
if mod_XML_Matcher_0.Match(i) {
return "XML", true
} else if mod_ModulaDash2_Matcher_0.Match(i) || mod_ModulaDash2_Matcher_1.Match(i) {
return "Modula-2", true
}
return "Linux Kernel Module", false
},
".pro": func(i []byte) (string, bool) {
if pro_Prolog_Matcher_0.Match(i) {
return "Prolog", true
} else if pro_INI_Matcher_0.Match(i) {
return "INI", true
} else if pro_QMake_Matcher_0.Match(i) && pro_QMake_Matcher_1.Match(i) {
return "QMake", true
} else if pro_IDL_Matcher_0.Match(i) {
return "IDL", true
}
return OtherLanguage, false
},
}
var (
asc_PublicKey_Matcher_0 = regexp.MustCompile(`(?m)^(----[- ]BEGIN|ssh-(rsa|dss)) `)
asc_AsciiDoc_Matcher_0 = regexp.MustCompile(`(?m)^[=-]+(\s|\n)|{{[A-Za-z]`)
asc_AGSScript_Matcher_0 = regexp.MustCompile(`(?m)^(\/\/.+|((import|export)\s+)?(function|int|float|char)\s+((room|repeatedly|on|game)_)?([A-Za-z]+[A-Za-z_0-9]+)\s*[;\(])`)
ms_Groff_Matcher_0 = regexp.MustCompile(`(?mi)^[.'][a-z][a-z](\s|$)`)
mod_XML_Matcher_0 = regexp.MustCompile(`(?m)<!ENTITY `)
mod_ModulaDash2_Matcher_0 = regexp.MustCompile(`(?mi)^\s*MODULE [\w\.]+;`)
mod_ModulaDash2_Matcher_1 = regexp.MustCompile(`(?mi)^\s*END [\w\.]+;`)
pro_Prolog_Matcher_0 = regexp.MustCompile(`(?m)^[^#]+:-`)
pro_INI_Matcher_0 = regexp.MustCompile(`(?m)last_client=`)
pro_QMake_Matcher_0 = regexp.MustCompile(`(?m)HEADERS`)
pro_QMake_Matcher_1 = regexp.MustCompile(`(?m)SOURCES`)
pro_IDL_Matcher_0 = regexp.MustCompile(`(?m)^\s*function[ \w,]+$`)
)

View File

@ -1,25 +0,0 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
import "gopkg.in/toqueteos/substring.v1"
var documentationMatchers = substring.Or(
substring.Regexp(`^[Dd]ocs?/`),
substring.Regexp(`(^|/)[Dd]ocumentation/`),
substring.Regexp(`(^|/)[Jj]avadoc/`),
substring.Regexp(`^[Mm]an/`),
substring.Regexp(`^[Ee]xamples/`),
substring.Regexp(`^[Dd]emos?/`),
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?/`),
)

View File

@ -1,12 +0,0 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
var languagesByExtension = map[string][]string{
".abap": {"ABAP"},
".abnf": {"ABNF"},
".bsl": {"1C Enterprise"},
".os": {"1C Enterprise"},
}

View File

@ -1,27 +0,0 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
type Type int
const (
TypeUnknown Type = iota
TypeData
TypeProgramming
TypeMarkup
TypeProse
)
func GetLanguageType(language string) (langType Type) {
langType, _ = languagesType[language]
return langType
}
var languagesType = map[string]Type{
"Scaml": TypeMarkup,
"Scheme": TypeProgramming,
"Scilab": TypeProgramming,
"Self": TypeProgramming,
}

View File

@ -1,24 +0,0 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
import "gopkg.in/toqueteos/substring.v1"
var vendorMatchers = substring.Or(
substring.Regexp(`(^|/)cache/`),
substring.Regexp(`^[Dd]ependencies/`),
substring.Regexp(`(^|/)dist/`),
substring.Regexp(`^deps/`),
substring.Regexp(`^tools/`),
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`),
)

View File

@ -0,0 +1,16 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
var languagesByInterpreter = map[string][]string{
"bash": {"Shell"},
"nush": {"Nu"},
"python": {"Python"},
"python2": {"Python"},
"python3": {"Python"},
"rc": {"Shell"},
"sh": {"Shell"},
"zsh": {"Shell"},
}

View File

@ -0,0 +1,11 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}
var languagesByInterpreter = map[string][]string{
{{range $interpreter, $languages := . -}}
"{{ $interpreter }}": { {{- $languages | formatStringSlice -}} },
{{end -}}
}

View File

@ -0,0 +1,15 @@
---
Nu:
interpreters:
- nush
Shell:
interpreters:
- bash
- rc
- sh
- zsh
Python:
interpreters:
- python
- python2
- python3

View File

@ -1,12 +1,12 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
var languagesByExtension = map[string][]string{
".abap": {"ABAP"},
".abnf": {"ABNF"},
".bsl": {"1C Enterprise"},
".os": {"1C Enterprise"},
}
".abap": {"ABAP"},
".abnf": {"ABNF"},
".bsl": {"1C Enterprise"},
".os": {"1C Enterprise"},
}

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}

View File

@ -1,24 +1,11 @@
---
1C Enterprise:
type: programming
color: "#814CCC"
extensions:
- ".bsl"
- ".os"
tm_scope: source.bsl
ace_mode: text
language_id: 0
ABAP:
type: programming
color: "#E8274B"
extensions:
- ".abap"
ace_mode: abap
language_id: 1
ABNF:
type: data
ace_mode: text
extensions:
- ".abnf"
tm_scope: source.abnf
language_id: 429

View File

@ -1,27 +1,29 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
type Type int
const (
TypeUnknown Type = iota
TypeData
TypeProgramming
TypeMarkup
TypeProse
// Language's type. Either data, programming, markup, prose, or unknown.
Unknown Type = iota
Data
Programming
Markup
Prose
)
// GetLanguageType returns the given language's type.
func GetLanguageType(language string) (langType Type) {
langType, _ = languagesType[language]
return langType
}
var languagesType = map[string]Type{
"Scaml": TypeMarkup,
"Scheme": TypeProgramming,
"Scilab": TypeProgramming,
"Self": TypeProgramming,
}
"Scaml": Markup,
"Scheme": Programming,
"Scilab": Programming,
"Self": Programming,
}

View File

@ -1,19 +1,21 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}
type Type int
const (
TypeUnknown Type = iota
TypeData
TypeProgramming
TypeMarkup
TypeProse
// Language's type. Either data, programming, markup, prose, or unknown.
Unknown Type = iota
Data
Programming
Markup
Prose
)
// GetLanguageType returns the given language's type.
func GetLanguageType(language string) (langType Type) {
langType, _ = languagesType[language]
return langType

View File

@ -1,46 +1,11 @@
---
Scaml:
group: HTML
type: markup
extensions:
- ".scaml"
tm_scope: source.scaml
ace_mode: text
language_id: 342
Scheme:
type: programming
color: "#1e4aec"
extensions:
- ".scm"
- ".sld"
- ".sls"
- ".sps"
- ".ss"
interpreters:
- guile
- bigloo
- chicken
- csi
- gosh
- r6rs
ace_mode: scheme
codemirror_mode: scheme
codemirror_mime_type: text/x-scheme
language_id: 343
Scilab:
type: programming
extensions:
- ".sci"
- ".sce"
- ".tst"
ace_mode: text
language_id: 344
Self:
type: programming
color: "#0579aa"
extensions:
- ".self"
tm_scope: none
ace_mode: text
language_id: 345

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
@ -21,4 +21,4 @@ var vendorMatchers = substring.Or(
substring.Regexp(`(^|/)ltsugar.m4`),
substring.Regexp(`(^|/)ltversion.m4`),
substring.Regexp(`(^|/)lt~obsolete.m4`),
)
)

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}

View File

@ -9,10 +9,10 @@ import (
)
var typeToTypeConst = map[string]string{
"data": "TypeData",
"programming": "TypeProgramming",
"markup": "TypeMarkup",
"prose": "TypeProse",
"data": "Data",
"programming": "Programming",
"markup": "Markup",
"prose": "Prose",
}
// Types reads from buf and builds type.go file from typeTmplPath.

View File

@ -37,6 +37,11 @@ const (
typeTmplPath = "internal/code-generator/assets/type.go.tmpl"
typeTmpl = "type.go.tmpl"
// interpreters_map.go generation
interpretersFile = "interpreters_map.go"
interpretersTmplPath = "internal/code-generator/assets/interpreters.go.tmpl"
interpretersTmpl = "interpreters.go.tmpl"
commitPath = ".git/refs/heads/master"
)
@ -61,6 +66,7 @@ func main() {
&generatorArgs{vendorYAML, vendorFile, vendorTmplPath, vendorTmpl, commit, generator.Vendor},
&generatorArgs{documentationYAML, documentationFile, documentationTmplPath, documentationTmpl, commit, generator.Documentation},
&generatorArgs{languagesYAML, typeFile, typeTmplPath, typeTmpl, commit, generator.Types},
&generatorArgs{languagesYAML, interpretersFile, interpretersTmplPath, interpretersTmpl, commit, generator.Interpreters},
}
for _, args := range argsList {

98
interpreters_map.go Normal file
View File

@ -0,0 +1,98 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: dae33dc2b20cddc85d1300435c3be7118a7115a9
var languagesByInterpreter = map[string][]string{
"Rscript": {"R"},
"apl": {"APL"},
"aplx": {"APL"},
"awk": {"Awk"},
"bash": {"Shell"},
"bigloo": {"Scheme"},
"boolector": {"SMT"},
"ccl": {"Common Lisp"},
"chicken": {"Scheme"},
"clisp": {"Common Lisp"},
"coffee": {"CoffeeScript"},
"crystal": {"Crystal"},
"csi": {"Scheme"},
"cvc4": {"SMT"},
"dart": {"Dart"},
"dtrace": {"DTrace"},
"dyalog": {"APL"},
"ecl": {"Common Lisp"},
"elixir": {"Elixir"},
"escript": {"Erlang"},
"fish": {"fish"},
"gawk": {"Awk"},
"gn": {"GN"},
"gnuplot": {"Gnuplot"},
"gosh": {"Scheme"},
"groovy": {"Groovy"},
"guile": {"Scheme"},
"instantfpc": {"Pascal"},
"io": {"Io"},
"ioke": {"Ioke"},
"jconsole": {"J"},
"jruby": {"Ruby"},
"julia": {"Julia"},
"lisp": {"Common Lisp"},
"lsl": {"LSL"},
"lua": {"Lua", "Terra"},
"macruby": {"Ruby"},
"make": {"Makefile"},
"mathsat5": {"SMT"},
"mawk": {"Awk"},
"mmi": {"Mercury"},
"moon": {"MoonScript"},
"nawk": {"Awk"},
"newlisp": {"NewLisp"},
"node": {"JavaScript"},
"nush": {"Nu"},
"ocaml": {"OCaml", "Reason"},
"ocamlrun": {"OCaml"},
"ocamlscript": {"OCaml"},
"openrc-run": {"OpenRC runscript"},
"opensmt": {"SMT"},
"osascript": {"AppleScript"},
"parrot": {"Parrot Assembly", "Parrot Internal Representation"},
"perl": {"Perl"},
"perl6": {"Perl6"},
"php": {"PHP"},
"picolisp": {"PicoLisp"},
"pike": {"Pike"},
"pil": {"PicoLisp"},
"python": {"Python"},
"python2": {"Python"},
"python3": {"Python"},
"qmake": {"QMake"},
"r6rs": {"Scheme"},
"racket": {"Racket"},
"rake": {"Ruby"},
"rbx": {"Ruby"},
"rc": {"Shell"},
"regina": {"REXX"},
"rexx": {"REXX"},
"ruby": {"Ruby"},
"rune": {"E"},
"runhaskell": {"Haskell"},
"sbcl": {"Common Lisp"},
"scala": {"Scala"},
"sclang": {"SuperCollider"},
"scsynth": {"SuperCollider"},
"sh": {"Shell"},
"smt-rat": {"SMT"},
"smtinterpol": {"SMT"},
"stp": {"SMT"},
"swipl": {"Prolog"},
"tcc": {"C"},
"tclsh": {"Tcl"},
"verit": {"SMT"},
"wish": {"Tcl"},
"yap": {"Prolog"},
"yices2": {"SMT"},
"z3": {"SMT"},
"zsh": {"Shell"},
}

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: dae33dc2b20cddc85d1300435c3be7118a7115a9

93
shebang.go Normal file
View File

@ -0,0 +1,93 @@
package slinguist
import (
"bufio"
"bytes"
"regexp"
"strings"
)
var (
shebangExecHack = regexp.MustCompile(`exec (\w+).+\$0.+\$@`)
pythonVersion = regexp.MustCompile(`python\d\.\d+`)
)
// GetLanguageByShebang returns the language of the given content looking for the shebang line,
// and safe to indicate the sureness of returned language.
func GetLanguageByShebang(content []byte) (lang string, safe bool) {
interpreter := getInterpreter(content)
lang = OtherLanguage
if langs, ok := languagesByInterpreter[interpreter]; ok {
lang = langs[0]
safe = len(langs) == 1
}
return
}
func getInterpreter(data []byte) (interpreter string) {
line := getFirstLine(data)
if !hasShebang(line) {
return ""
}
// skip shebang
line = bytes.TrimSpace(line[2:])
splitted := bytes.Fields(line)
if bytes.Contains(splitted[0], []byte("env")) {
if len(splitted) > 1 {
interpreter = string(splitted[1])
}
} else {
splittedPath := bytes.Split(splitted[0], []byte{'/'})
interpreter = string(splittedPath[len(splittedPath)-1])
}
if interpreter == "sh" {
interpreter = lookForMultilineExec(data)
}
if pythonVersion.MatchString(interpreter) {
interpreter = interpreter[:strings.Index(interpreter, `.`)]
}
return
}
func getFirstLine(data []byte) []byte {
buf := bufio.NewScanner(bytes.NewReader(data))
buf.Scan()
line := buf.Bytes()
if err := buf.Err(); err != nil {
return nil
}
return line
}
func hasShebang(line []byte) bool {
shebang := []byte{'#', '!'}
return bytes.HasPrefix(line, shebang)
}
func lookForMultilineExec(data []byte) string {
const magicNumOfLines = 5
interpreter := "sh"
buf := bufio.NewScanner(bytes.NewReader(data))
for i := 0; i < magicNumOfLines && buf.Scan(); i++ {
line := buf.Bytes()
if shebangExecHack.Match(line) {
interpreter = shebangExecHack.FindStringSubmatch(string(line))[1]
break
}
}
if err := buf.Err(); err != nil {
return interpreter
}
return interpreter
}

60
shebang_test.go Normal file
View File

@ -0,0 +1,60 @@
package slinguist
import . "gopkg.in/check.v1"
const (
multilineExecHack = `#!/bin/sh
# Next line is comment in Tcl, but not in sh... \
exec tclsh "$0" ${1+"$@"}`
multilineNoExecHack = `#!/bin/sh
#<<<#
echo "A shell script in a zkl program ($0)"
echo "Now run zkl <this file> with Hello World as args"
zkl $0 Hello World!
exit
#<<<#
println("The shell script says ",vm.arglist.concat(" "));`
)
func (s *TSuite) TestGetLanguageByShebang(c *C) {
lang, safe := GetLanguageByShebang([]byte(`#!/unknown/interpreter`))
c.Assert(lang, Equals, OtherLanguage)
c.Assert(safe, Equals, false)
lang, safe = GetLanguageByShebang([]byte(`no shebang`))
c.Assert(lang, Equals, OtherLanguage)
c.Assert(safe, Equals, false)
lang, safe = GetLanguageByShebang([]byte(`#!/usr/bin/env`))
c.Assert(lang, Equals, OtherLanguage)
c.Assert(safe, Equals, false)
lang, safe = GetLanguageByShebang([]byte(`#!/usr/bin/python -tt`))
c.Assert(lang, Equals, "Python")
c.Assert(safe, Equals, true)
lang, safe = GetLanguageByShebang([]byte(`#!/usr/bin/env python2.6`))
c.Assert(lang, Equals, "Python")
c.Assert(safe, Equals, true)
lang, safe = GetLanguageByShebang([]byte(`#!/usr/bin/env perl`))
c.Assert(lang, Equals, "Perl")
c.Assert(safe, Equals, true)
lang, safe = GetLanguageByShebang([]byte(`#! /bin/sh`))
c.Assert(lang, Equals, "Shell")
c.Assert(safe, Equals, true)
lang, safe = GetLanguageByShebang([]byte(`#!bash`))
c.Assert(lang, Equals, "Shell")
c.Assert(safe, Equals, true)
lang, safe = GetLanguageByShebang([]byte(multilineExecHack))
c.Assert(lang, Equals, "Tcl")
c.Assert(safe, Equals, true)
lang, safe = GetLanguageByShebang([]byte(multilineNoExecHack))
c.Assert(lang, Equals, "Shell")
c.Assert(safe, Equals, true)
}

902
type.go
View File

@ -1,467 +1,469 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: dae33dc2b20cddc85d1300435c3be7118a7115a9
type Type int
const (
TypeUnknown Type = iota
TypeData
TypeProgramming
TypeMarkup
TypeProse
// Language's type. Either data, programming, markup, prose, or unknown.
Unknown Type = iota
Data
Programming
Markup
Prose
)
// GetLanguageType returns the given language's type.
func GetLanguageType(language string) (langType Type) {
langType, _ = languagesType[language]
return langType
}
var languagesType = map[string]Type{
"1C Enterprise": TypeProgramming,
"ABAP": TypeProgramming,
"ABNF": TypeData,
"AGS Script": TypeProgramming,
"AMPL": TypeProgramming,
"ANTLR": TypeProgramming,
"API Blueprint": TypeMarkup,
"APL": TypeProgramming,
"ASN.1": TypeData,
"ASP": TypeProgramming,
"ATS": TypeProgramming,
"ActionScript": TypeProgramming,
"Ada": TypeProgramming,
"Agda": TypeProgramming,
"Alloy": TypeProgramming,
"Alpine Abuild": TypeProgramming,
"Ant Build System": TypeData,
"ApacheConf": TypeMarkup,
"Apex": TypeProgramming,
"Apollo Guidance Computer": TypeProgramming,
"AppleScript": TypeProgramming,
"Arc": TypeProgramming,
"Arduino": TypeProgramming,
"AsciiDoc": TypeProse,
"AspectJ": TypeProgramming,
"Assembly": TypeProgramming,
"Augeas": TypeProgramming,
"AutoHotkey": TypeProgramming,
"AutoIt": TypeProgramming,
"Awk": TypeProgramming,
"Batchfile": TypeProgramming,
"Befunge": TypeProgramming,
"Bison": TypeProgramming,
"BitBake": TypeProgramming,
"Blade": TypeMarkup,
"BlitzBasic": TypeProgramming,
"BlitzMax": TypeProgramming,
"Bluespec": TypeProgramming,
"Boo": TypeProgramming,
"Brainfuck": TypeProgramming,
"Brightscript": TypeProgramming,
"Bro": TypeProgramming,
"C": TypeProgramming,
"C#": TypeProgramming,
"C++": TypeProgramming,
"C-ObjDump": TypeData,
"C2hs Haskell": TypeProgramming,
"CLIPS": TypeProgramming,
"CMake": TypeProgramming,
"COBOL": TypeProgramming,
"COLLADA": TypeData,
"CSON": TypeData,
"CSS": TypeMarkup,
"CSV": TypeData,
"Cap'n Proto": TypeProgramming,
"CartoCSS": TypeProgramming,
"Ceylon": TypeProgramming,
"Chapel": TypeProgramming,
"Charity": TypeProgramming,
"ChucK": TypeProgramming,
"Cirru": TypeProgramming,
"Clarion": TypeProgramming,
"Clean": TypeProgramming,
"Click": TypeProgramming,
"Clojure": TypeProgramming,
"CoffeeScript": TypeProgramming,
"ColdFusion": TypeProgramming,
"ColdFusion CFC": TypeProgramming,
"Common Lisp": TypeProgramming,
"Component Pascal": TypeProgramming,
"Cool": TypeProgramming,
"Coq": TypeProgramming,
"Cpp-ObjDump": TypeData,
"Creole": TypeProse,
"Crystal": TypeProgramming,
"Csound": TypeProgramming,
"Csound Document": TypeProgramming,
"Csound Score": TypeProgramming,
"Cuda": TypeProgramming,
"Cycript": TypeProgramming,
"Cython": TypeProgramming,
"D": TypeProgramming,
"D-ObjDump": TypeData,
"DIGITAL Command Language": TypeProgramming,
"DM": TypeProgramming,
"DNS Zone": TypeData,
"DTrace": TypeProgramming,
"Darcs Patch": TypeData,
"Dart": TypeProgramming,
"Diff": TypeData,
"Dockerfile": TypeData,
"Dogescript": TypeProgramming,
"Dylan": TypeProgramming,
"E": TypeProgramming,
"EBNF": TypeData,
"ECL": TypeProgramming,
"ECLiPSe": TypeProgramming,
"EJS": TypeMarkup,
"EQ": TypeProgramming,
"Eagle": TypeMarkup,
"Ecere Projects": TypeData,
"Eiffel": TypeProgramming,
"Elixir": TypeProgramming,
"Elm": TypeProgramming,
"Emacs Lisp": TypeProgramming,
"EmberScript": TypeProgramming,
"Erlang": TypeProgramming,
"F#": TypeProgramming,
"FLUX": TypeProgramming,
"Factor": TypeProgramming,
"Fancy": TypeProgramming,
"Fantom": TypeProgramming,
"Filebench WML": TypeProgramming,
"Filterscript": TypeProgramming,
"Formatted": TypeData,
"Forth": TypeProgramming,
"Fortran": TypeProgramming,
"FreeMarker": TypeProgramming,
"Frege": TypeProgramming,
"G-code": TypeData,
"GAMS": TypeProgramming,
"GAP": TypeProgramming,
"GCC Machine Description": TypeProgramming,
"GDB": TypeProgramming,
"GDScript": TypeProgramming,
"GLSL": TypeProgramming,
"GN": TypeData,
"Game Maker Language": TypeProgramming,
"Genie": TypeProgramming,
"Genshi": TypeProgramming,
"Gentoo Ebuild": TypeProgramming,
"Gentoo Eclass": TypeProgramming,
"Gettext Catalog": TypeProse,
"Gherkin": TypeProgramming,
"Glyph": TypeProgramming,
"Gnuplot": TypeProgramming,
"Go": TypeProgramming,
"Golo": TypeProgramming,
"Gosu": TypeProgramming,
"Grace": TypeProgramming,
"Gradle": TypeData,
"Grammatical Framework": TypeProgramming,
"Graph Modeling Language": TypeData,
"GraphQL": TypeData,
"Graphviz (DOT)": TypeData,
"Groovy": TypeProgramming,
"Groovy Server Pages": TypeProgramming,
"HCL": TypeProgramming,
"HLSL": TypeProgramming,
"HTML": TypeMarkup,
"HTML+Django": TypeMarkup,
"HTML+ECR": TypeMarkup,
"HTML+EEX": TypeMarkup,
"HTML+ERB": TypeMarkup,
"HTML+PHP": TypeMarkup,
"HTTP": TypeData,
"Hack": TypeProgramming,
"Haml": TypeMarkup,
"Handlebars": TypeMarkup,
"Harbour": TypeProgramming,
"Haskell": TypeProgramming,
"Haxe": TypeProgramming,
"Hy": TypeProgramming,
"HyPhy": TypeProgramming,
"IDL": TypeProgramming,
"IGOR Pro": TypeProgramming,
"INI": TypeData,
"IRC log": TypeData,
"Idris": TypeProgramming,
"Inform 7": TypeProgramming,
"Inno Setup": TypeProgramming,
"Io": TypeProgramming,
"Ioke": TypeProgramming,
"Isabelle": TypeProgramming,
"Isabelle ROOT": TypeProgramming,
"J": TypeProgramming,
"JFlex": TypeProgramming,
"JSON": TypeData,
"JSON5": TypeData,
"JSONLD": TypeData,
"JSONiq": TypeProgramming,
"JSX": TypeProgramming,
"Jasmin": TypeProgramming,
"Java": TypeProgramming,
"Java Server Pages": TypeProgramming,
"JavaScript": TypeProgramming,
"Jison": TypeProgramming,
"Jison Lex": TypeProgramming,
"Julia": TypeProgramming,
"Jupyter Notebook": TypeMarkup,
"KRL": TypeProgramming,
"KiCad": TypeProgramming,
"Kit": TypeMarkup,
"Kotlin": TypeProgramming,
"LFE": TypeProgramming,
"LLVM": TypeProgramming,
"LOLCODE": TypeProgramming,
"LSL": TypeProgramming,
"LabVIEW": TypeProgramming,
"Lasso": TypeProgramming,
"Latte": TypeMarkup,
"Lean": TypeProgramming,
"Less": TypeMarkup,
"Lex": TypeProgramming,
"LilyPond": TypeProgramming,
"Limbo": TypeProgramming,
"Linker Script": TypeData,
"Linux Kernel Module": TypeData,
"Liquid": TypeMarkup,
"Literate Agda": TypeProgramming,
"Literate CoffeeScript": TypeProgramming,
"Literate Haskell": TypeProgramming,
"LiveScript": TypeProgramming,
"Logos": TypeProgramming,
"Logtalk": TypeProgramming,
"LookML": TypeProgramming,
"LoomScript": TypeProgramming,
"Lua": TypeProgramming,
"M": TypeProgramming,
"M4": TypeProgramming,
"M4Sugar": TypeProgramming,
"MAXScript": TypeProgramming,
"MQL4": TypeProgramming,
"MQL5": TypeProgramming,
"MTML": TypeMarkup,
"MUF": TypeProgramming,
"Makefile": TypeProgramming,
"Mako": TypeProgramming,
"Markdown": TypeProse,
"Marko": TypeMarkup,
"Mask": TypeMarkup,
"Mathematica": TypeProgramming,
"Matlab": TypeProgramming,
"Maven POM": TypeData,
"Max": TypeProgramming,
"MediaWiki": TypeProse,
"Mercury": TypeProgramming,
"Meson": TypeProgramming,
"Metal": TypeProgramming,
"MiniD": TypeProgramming,
"Mirah": TypeProgramming,
"Modelica": TypeProgramming,
"Modula-2": TypeProgramming,
"Module Management System": TypeProgramming,
"Monkey": TypeProgramming,
"Moocode": TypeProgramming,
"MoonScript": TypeProgramming,
"Myghty": TypeProgramming,
"NCL": TypeProgramming,
"NL": TypeData,
"NSIS": TypeProgramming,
"Nemerle": TypeProgramming,
"NetLinx": TypeProgramming,
"NetLinx+ERB": TypeProgramming,
"NetLogo": TypeProgramming,
"NewLisp": TypeProgramming,
"Nginx": TypeMarkup,
"Nim": TypeProgramming,
"Ninja": TypeData,
"Nit": TypeProgramming,
"Nix": TypeProgramming,
"Nu": TypeProgramming,
"NumPy": TypeProgramming,
"OCaml": TypeProgramming,
"ObjDump": TypeData,
"Objective-C": TypeProgramming,
"Objective-C++": TypeProgramming,
"Objective-J": TypeProgramming,
"Omgrofl": TypeProgramming,
"Opa": TypeProgramming,
"Opal": TypeProgramming,
"OpenCL": TypeProgramming,
"OpenEdge ABL": TypeProgramming,
"OpenRC runscript": TypeProgramming,
"OpenSCAD": TypeProgramming,
"OpenType Feature File": TypeData,
"Org": TypeProse,
"Ox": TypeProgramming,
"Oxygene": TypeProgramming,
"Oz": TypeProgramming,
"P4": TypeProgramming,
"PAWN": TypeProgramming,
"PHP": TypeProgramming,
"PLSQL": TypeProgramming,
"PLpgSQL": TypeProgramming,
"POV-Ray SDL": TypeProgramming,
"Pan": TypeProgramming,
"Papyrus": TypeProgramming,
"Parrot": TypeProgramming,
"Parrot Assembly": TypeProgramming,
"Parrot Internal Representation": TypeProgramming,
"Pascal": TypeProgramming,
"Perl": TypeProgramming,
"Perl6": TypeProgramming,
"Pic": TypeMarkup,
"Pickle": TypeData,
"PicoLisp": TypeProgramming,
"PigLatin": TypeProgramming,
"Pike": TypeProgramming,
"Pod": TypeProse,
"PogoScript": TypeProgramming,
"Pony": TypeProgramming,
"PostScript": TypeMarkup,
"PowerBuilder": TypeProgramming,
"PowerShell": TypeProgramming,
"Processing": TypeProgramming,
"Prolog": TypeProgramming,
"Propeller Spin": TypeProgramming,
"Protocol Buffer": TypeMarkup,
"Public Key": TypeData,
"Pug": TypeMarkup,
"Puppet": TypeProgramming,
"Pure Data": TypeProgramming,
"PureBasic": TypeProgramming,
"PureScript": TypeProgramming,
"Python": TypeProgramming,
"Python console": TypeProgramming,
"Python traceback": TypeData,
"QML": TypeProgramming,
"QMake": TypeProgramming,
"R": TypeProgramming,
"RAML": TypeMarkup,
"RDoc": TypeProse,
"REALbasic": TypeProgramming,
"REXX": TypeProgramming,
"RHTML": TypeMarkup,
"RMarkdown": TypeProse,
"RPM Spec": TypeData,
"RUNOFF": TypeMarkup,
"Racket": TypeProgramming,
"Ragel": TypeProgramming,
"Rascal": TypeProgramming,
"Raw token data": TypeData,
"Reason": TypeProgramming,
"Rebol": TypeProgramming,
"Red": TypeProgramming,
"Redcode": TypeProgramming,
"Regular Expression": TypeData,
"Ren'Py": TypeProgramming,
"RenderScript": TypeProgramming,
"RobotFramework": TypeProgramming,
"Roff": TypeMarkup,
"Rouge": TypeProgramming,
"Ruby": TypeProgramming,
"Rust": TypeProgramming,
"SAS": TypeProgramming,
"SCSS": TypeMarkup,
"SMT": TypeProgramming,
"SPARQL": TypeData,
"SQF": TypeProgramming,
"SQL": TypeData,
"SQLPL": TypeProgramming,
"SRecode Template": TypeMarkup,
"STON": TypeData,
"SVG": TypeData,
"Sage": TypeProgramming,
"SaltStack": TypeProgramming,
"Sass": TypeMarkup,
"Scala": TypeProgramming,
"Scaml": TypeMarkup,
"Scheme": TypeProgramming,
"Scilab": TypeProgramming,
"Self": TypeProgramming,
"Shell": TypeProgramming,
"ShellSession": TypeProgramming,
"Shen": TypeProgramming,
"Slash": TypeProgramming,
"Slim": TypeMarkup,
"Smali": TypeProgramming,
"Smalltalk": TypeProgramming,
"Smarty": TypeProgramming,
"SourcePawn": TypeProgramming,
"Spline Font Database": TypeData,
"Squirrel": TypeProgramming,
"Stan": TypeProgramming,
"Standard ML": TypeProgramming,
"Stata": TypeProgramming,
"Stylus": TypeMarkup,
"SubRip Text": TypeData,
"Sublime Text Config": TypeData,
"SuperCollider": TypeProgramming,
"Swift": TypeProgramming,
"SystemVerilog": TypeProgramming,
"TI Program": TypeProgramming,
"TLA": TypeProgramming,
"TOML": TypeData,
"TXL": TypeProgramming,
"Tcl": TypeProgramming,
"Tcsh": TypeProgramming,
"TeX": TypeMarkup,
"Tea": TypeMarkup,
"Terra": TypeProgramming,
"Text": TypeProse,
"Textile": TypeProse,
"Thrift": TypeProgramming,
"Turing": TypeProgramming,
"Turtle": TypeData,
"Twig": TypeMarkup,
"TypeScript": TypeProgramming,
"Unified Parallel C": TypeProgramming,
"Unity3D Asset": TypeData,
"Unix Assembly": TypeProgramming,
"Uno": TypeProgramming,
"UnrealScript": TypeProgramming,
"UrWeb": TypeProgramming,
"VCL": TypeProgramming,
"VHDL": TypeProgramming,
"Vala": TypeProgramming,
"Verilog": TypeProgramming,
"Vim script": TypeProgramming,
"Visual Basic": TypeProgramming,
"Volt": TypeProgramming,
"Vue": TypeMarkup,
"Wavefront Material": TypeData,
"Wavefront Object": TypeData,
"Web Ontology Language": TypeMarkup,
"WebIDL": TypeProgramming,
"World of Warcraft Addon Data": TypeData,
"X10": TypeProgramming,
"XC": TypeProgramming,
"XCompose": TypeData,
"XML": TypeData,
"XPages": TypeProgramming,
"XProc": TypeProgramming,
"XQuery": TypeProgramming,
"XS": TypeProgramming,
"XSLT": TypeProgramming,
"Xojo": TypeProgramming,
"Xtend": TypeProgramming,
"YAML": TypeData,
"YANG": TypeData,
"Yacc": TypeProgramming,
"Zephir": TypeProgramming,
"Zimpl": TypeProgramming,
"desktop": TypeData,
"eC": TypeProgramming,
"edn": TypeData,
"fish": TypeProgramming,
"mupad": TypeProgramming,
"nesC": TypeProgramming,
"ooc": TypeProgramming,
"reStructuredText": TypeProse,
"wisp": TypeProgramming,
"xBase": TypeProgramming,
"1C Enterprise": Programming,
"ABAP": Programming,
"ABNF": Data,
"AGS Script": Programming,
"AMPL": Programming,
"ANTLR": Programming,
"API Blueprint": Markup,
"APL": Programming,
"ASN.1": Data,
"ASP": Programming,
"ATS": Programming,
"ActionScript": Programming,
"Ada": Programming,
"Agda": Programming,
"Alloy": Programming,
"Alpine Abuild": Programming,
"Ant Build System": Data,
"ApacheConf": Markup,
"Apex": Programming,
"Apollo Guidance Computer": Programming,
"AppleScript": Programming,
"Arc": Programming,
"Arduino": Programming,
"AsciiDoc": Prose,
"AspectJ": Programming,
"Assembly": Programming,
"Augeas": Programming,
"AutoHotkey": Programming,
"AutoIt": Programming,
"Awk": Programming,
"Batchfile": Programming,
"Befunge": Programming,
"Bison": Programming,
"BitBake": Programming,
"Blade": Markup,
"BlitzBasic": Programming,
"BlitzMax": Programming,
"Bluespec": Programming,
"Boo": Programming,
"Brainfuck": Programming,
"Brightscript": Programming,
"Bro": Programming,
"C": Programming,
"C#": Programming,
"C++": Programming,
"C-ObjDump": Data,
"C2hs Haskell": Programming,
"CLIPS": Programming,
"CMake": Programming,
"COBOL": Programming,
"COLLADA": Data,
"CSON": Data,
"CSS": Markup,
"CSV": Data,
"Cap'n Proto": Programming,
"CartoCSS": Programming,
"Ceylon": Programming,
"Chapel": Programming,
"Charity": Programming,
"ChucK": Programming,
"Cirru": Programming,
"Clarion": Programming,
"Clean": Programming,
"Click": Programming,
"Clojure": Programming,
"CoffeeScript": Programming,
"ColdFusion": Programming,
"ColdFusion CFC": Programming,
"Common Lisp": Programming,
"Component Pascal": Programming,
"Cool": Programming,
"Coq": Programming,
"Cpp-ObjDump": Data,
"Creole": Prose,
"Crystal": Programming,
"Csound": Programming,
"Csound Document": Programming,
"Csound Score": Programming,
"Cuda": Programming,
"Cycript": Programming,
"Cython": Programming,
"D": Programming,
"D-ObjDump": Data,
"DIGITAL Command Language": Programming,
"DM": Programming,
"DNS Zone": Data,
"DTrace": Programming,
"Darcs Patch": Data,
"Dart": Programming,
"Diff": Data,
"Dockerfile": Data,
"Dogescript": Programming,
"Dylan": Programming,
"E": Programming,
"EBNF": Data,
"ECL": Programming,
"ECLiPSe": Programming,
"EJS": Markup,
"EQ": Programming,
"Eagle": Markup,
"Ecere Projects": Data,
"Eiffel": Programming,
"Elixir": Programming,
"Elm": Programming,
"Emacs Lisp": Programming,
"EmberScript": Programming,
"Erlang": Programming,
"F#": Programming,
"FLUX": Programming,
"Factor": Programming,
"Fancy": Programming,
"Fantom": Programming,
"Filebench WML": Programming,
"Filterscript": Programming,
"Formatted": Data,
"Forth": Programming,
"Fortran": Programming,
"FreeMarker": Programming,
"Frege": Programming,
"G-code": Data,
"GAMS": Programming,
"GAP": Programming,
"GCC Machine Description": Programming,
"GDB": Programming,
"GDScript": Programming,
"GLSL": Programming,
"GN": Data,
"Game Maker Language": Programming,
"Genie": Programming,
"Genshi": Programming,
"Gentoo Ebuild": Programming,
"Gentoo Eclass": Programming,
"Gettext Catalog": Prose,
"Gherkin": Programming,
"Glyph": Programming,
"Gnuplot": Programming,
"Go": Programming,
"Golo": Programming,
"Gosu": Programming,
"Grace": Programming,
"Gradle": Data,
"Grammatical Framework": Programming,
"Graph Modeling Language": Data,
"GraphQL": Data,
"Graphviz (DOT)": Data,
"Groovy": Programming,
"Groovy Server Pages": Programming,
"HCL": Programming,
"HLSL": Programming,
"HTML": Markup,
"HTML+Django": Markup,
"HTML+ECR": Markup,
"HTML+EEX": Markup,
"HTML+ERB": Markup,
"HTML+PHP": Markup,
"HTTP": Data,
"Hack": Programming,
"Haml": Markup,
"Handlebars": Markup,
"Harbour": Programming,
"Haskell": Programming,
"Haxe": Programming,
"Hy": Programming,
"HyPhy": Programming,
"IDL": Programming,
"IGOR Pro": Programming,
"INI": Data,
"IRC log": Data,
"Idris": Programming,
"Inform 7": Programming,
"Inno Setup": Programming,
"Io": Programming,
"Ioke": Programming,
"Isabelle": Programming,
"Isabelle ROOT": Programming,
"J": Programming,
"JFlex": Programming,
"JSON": Data,
"JSON5": Data,
"JSONLD": Data,
"JSONiq": Programming,
"JSX": Programming,
"Jasmin": Programming,
"Java": Programming,
"Java Server Pages": Programming,
"JavaScript": Programming,
"Jison": Programming,
"Jison Lex": Programming,
"Julia": Programming,
"Jupyter Notebook": Markup,
"KRL": Programming,
"KiCad": Programming,
"Kit": Markup,
"Kotlin": Programming,
"LFE": Programming,
"LLVM": Programming,
"LOLCODE": Programming,
"LSL": Programming,
"LabVIEW": Programming,
"Lasso": Programming,
"Latte": Markup,
"Lean": Programming,
"Less": Markup,
"Lex": Programming,
"LilyPond": Programming,
"Limbo": Programming,
"Linker Script": Data,
"Linux Kernel Module": Data,
"Liquid": Markup,
"Literate Agda": Programming,
"Literate CoffeeScript": Programming,
"Literate Haskell": Programming,
"LiveScript": Programming,
"Logos": Programming,
"Logtalk": Programming,
"LookML": Programming,
"LoomScript": Programming,
"Lua": Programming,
"M": Programming,
"M4": Programming,
"M4Sugar": Programming,
"MAXScript": Programming,
"MQL4": Programming,
"MQL5": Programming,
"MTML": Markup,
"MUF": Programming,
"Makefile": Programming,
"Mako": Programming,
"Markdown": Prose,
"Marko": Markup,
"Mask": Markup,
"Mathematica": Programming,
"Matlab": Programming,
"Maven POM": Data,
"Max": Programming,
"MediaWiki": Prose,
"Mercury": Programming,
"Meson": Programming,
"Metal": Programming,
"MiniD": Programming,
"Mirah": Programming,
"Modelica": Programming,
"Modula-2": Programming,
"Module Management System": Programming,
"Monkey": Programming,
"Moocode": Programming,
"MoonScript": Programming,
"Myghty": Programming,
"NCL": Programming,
"NL": Data,
"NSIS": Programming,
"Nemerle": Programming,
"NetLinx": Programming,
"NetLinx+ERB": Programming,
"NetLogo": Programming,
"NewLisp": Programming,
"Nginx": Markup,
"Nim": Programming,
"Ninja": Data,
"Nit": Programming,
"Nix": Programming,
"Nu": Programming,
"NumPy": Programming,
"OCaml": Programming,
"ObjDump": Data,
"Objective-C": Programming,
"Objective-C++": Programming,
"Objective-J": Programming,
"Omgrofl": Programming,
"Opa": Programming,
"Opal": Programming,
"OpenCL": Programming,
"OpenEdge ABL": Programming,
"OpenRC runscript": Programming,
"OpenSCAD": Programming,
"OpenType Feature File": Data,
"Org": Prose,
"Ox": Programming,
"Oxygene": Programming,
"Oz": Programming,
"P4": Programming,
"PAWN": Programming,
"PHP": Programming,
"PLSQL": Programming,
"PLpgSQL": Programming,
"POV-Ray SDL": Programming,
"Pan": Programming,
"Papyrus": Programming,
"Parrot": Programming,
"Parrot Assembly": Programming,
"Parrot Internal Representation": Programming,
"Pascal": Programming,
"Perl": Programming,
"Perl6": Programming,
"Pic": Markup,
"Pickle": Data,
"PicoLisp": Programming,
"PigLatin": Programming,
"Pike": Programming,
"Pod": Prose,
"PogoScript": Programming,
"Pony": Programming,
"PostScript": Markup,
"PowerBuilder": Programming,
"PowerShell": Programming,
"Processing": Programming,
"Prolog": Programming,
"Propeller Spin": Programming,
"Protocol Buffer": Markup,
"Public Key": Data,
"Pug": Markup,
"Puppet": Programming,
"Pure Data": Programming,
"PureBasic": Programming,
"PureScript": Programming,
"Python": Programming,
"Python console": Programming,
"Python traceback": Data,
"QML": Programming,
"QMake": Programming,
"R": Programming,
"RAML": Markup,
"RDoc": Prose,
"REALbasic": Programming,
"REXX": Programming,
"RHTML": Markup,
"RMarkdown": Prose,
"RPM Spec": Data,
"RUNOFF": Markup,
"Racket": Programming,
"Ragel": Programming,
"Rascal": Programming,
"Raw token data": Data,
"Reason": Programming,
"Rebol": Programming,
"Red": Programming,
"Redcode": Programming,
"Regular Expression": Data,
"Ren'Py": Programming,
"RenderScript": Programming,
"RobotFramework": Programming,
"Roff": Markup,
"Rouge": Programming,
"Ruby": Programming,
"Rust": Programming,
"SAS": Programming,
"SCSS": Markup,
"SMT": Programming,
"SPARQL": Data,
"SQF": Programming,
"SQL": Data,
"SQLPL": Programming,
"SRecode Template": Markup,
"STON": Data,
"SVG": Data,
"Sage": Programming,
"SaltStack": Programming,
"Sass": Markup,
"Scala": Programming,
"Scaml": Markup,
"Scheme": Programming,
"Scilab": Programming,
"Self": Programming,
"Shell": Programming,
"ShellSession": Programming,
"Shen": Programming,
"Slash": Programming,
"Slim": Markup,
"Smali": Programming,
"Smalltalk": Programming,
"Smarty": Programming,
"SourcePawn": Programming,
"Spline Font Database": Data,
"Squirrel": Programming,
"Stan": Programming,
"Standard ML": Programming,
"Stata": Programming,
"Stylus": Markup,
"SubRip Text": Data,
"Sublime Text Config": Data,
"SuperCollider": Programming,
"Swift": Programming,
"SystemVerilog": Programming,
"TI Program": Programming,
"TLA": Programming,
"TOML": Data,
"TXL": Programming,
"Tcl": Programming,
"Tcsh": Programming,
"TeX": Markup,
"Tea": Markup,
"Terra": Programming,
"Text": Prose,
"Textile": Prose,
"Thrift": Programming,
"Turing": Programming,
"Turtle": Data,
"Twig": Markup,
"TypeScript": Programming,
"Unified Parallel C": Programming,
"Unity3D Asset": Data,
"Unix Assembly": Programming,
"Uno": Programming,
"UnrealScript": Programming,
"UrWeb": Programming,
"VCL": Programming,
"VHDL": Programming,
"Vala": Programming,
"Verilog": Programming,
"Vim script": Programming,
"Visual Basic": Programming,
"Volt": Programming,
"Vue": Markup,
"Wavefront Material": Data,
"Wavefront Object": Data,
"Web Ontology Language": Markup,
"WebIDL": Programming,
"World of Warcraft Addon Data": Data,
"X10": Programming,
"XC": Programming,
"XCompose": Data,
"XML": Data,
"XPages": Programming,
"XProc": Programming,
"XQuery": Programming,
"XS": Programming,
"XSLT": Programming,
"Xojo": Programming,
"Xtend": Programming,
"YAML": Data,
"YANG": Data,
"Yacc": Programming,
"Zephir": Programming,
"Zimpl": Programming,
"desktop": Data,
"eC": Programming,
"edn": Data,
"fish": Programming,
"mupad": Programming,
"nesC": Programming,
"ooc": Programming,
"reStructuredText": Prose,
"wisp": Programming,
"xBase": Programming,
}

View File

@ -4,29 +4,29 @@ import . "gopkg.in/check.v1"
func (s *TSuite) TestGetLanguageType(c *C) {
langType := GetLanguageType("BestLanguageEver")
c.Assert(langType, Equals, TypeUnknown)
c.Assert(langType, Equals, Unknown)
langType = GetLanguageType("JSON")
c.Assert(langType, Equals, TypeData)
c.Assert(langType, Equals, Data)
langType = GetLanguageType("COLLADA")
c.Assert(langType, Equals, TypeData)
c.Assert(langType, Equals, Data)
langType = GetLanguageType("Go")
c.Assert(langType, Equals, TypeProgramming)
c.Assert(langType, Equals, Programming)
langType = GetLanguageType("Brainfuck")
c.Assert(langType, Equals, TypeProgramming)
c.Assert(langType, Equals, Programming)
langType = GetLanguageType("HTML")
c.Assert(langType, Equals, TypeMarkup)
c.Assert(langType, Equals, Markup)
langType = GetLanguageType("Sass")
c.Assert(langType, Equals, TypeMarkup)
c.Assert(langType, Equals, Markup)
langType = GetLanguageType("AsciiDoc")
c.Assert(langType, Equals, TypeProse)
c.Assert(langType, Equals, Prose)
langType = GetLanguageType("Textile")
c.Assert(langType, Equals, TypeProse)
c.Assert(langType, Equals, Prose)
}

View File

@ -1,6 +1,6 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH github.com/src-d/simple-linguist/cli/slinguist-generate
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: dae33dc2b20cddc85d1300435c3be7118a7115a9