mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-19 14:43:05 -03:00
Rearranged code
This commit is contained in:
@ -2,10 +2,10 @@ 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
|
||||
// Extracted from github/linguist commit: 0123456789abcdef0123456789abcdef01234567
|
||||
|
||||
// languagesByAlias keeps alias for different languages and use the name of the languages as a alias too. All the
|
||||
// keys (alias or not) are written in lower case and the whitespaces has been replaced by underscores.
|
||||
// languagesByAlias 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 languagesByAlias = map[string]string{
|
||||
"asp": "ASP",
|
||||
"aspx": "ASP",
|
||||
|
@ -2,28 +2,15 @@ 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
|
||||
// Extracted from github/linguist commit: 0123456789abcdef0123456789abcdef01234567
|
||||
|
||||
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)
|
||||
} else {
|
||||
lang = OtherLanguage
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
type languageMatcher func([]byte) (string, bool)
|
||||
|
||||
var matchers = map[string]languageMatcher{
|
||||
var contentMatchers = map[string]languageMatcher{
|
||||
".asc": func(i []byte) (string, bool) {
|
||||
if asc_PublicKey_Matcher_0.Match(i) {
|
||||
return "Public Key", true
|
||||
|
@ -2,7 +2,7 @@ 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
|
||||
// Extracted from github/linguist commit: 0123456789abcdef0123456789abcdef01234567
|
||||
|
||||
import "gopkg.in/toqueteos/substring.v1"
|
||||
|
||||
|
@ -2,7 +2,7 @@ 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
|
||||
// Extracted from github/linguist commit: 0123456789abcdef0123456789abcdef01234567
|
||||
|
||||
var languagesByExtension = map[string][]string{
|
||||
".abap": {"ABAP"},
|
||||
@ -10,3 +10,9 @@ var languagesByExtension = map[string][]string{
|
||||
".bsl": {"1C Enterprise"},
|
||||
".os": {"1C Enterprise"},
|
||||
}
|
||||
|
||||
var extensionsByLanguage = map[string][]string{
|
||||
"1C Enterprise": {".bsl", ".os"},
|
||||
"ABAP": {".abap"},
|
||||
"ABNF": {".abnf"},
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ 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
|
||||
// Extracted from github/linguist commit: 0123456789abcdef0123456789abcdef01234567
|
||||
|
||||
var languagesByFilename = map[string]string{
|
||||
"APKBUILD": "Alpine Abuild",
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,7 +2,7 @@ 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
|
||||
// Extracted from github/linguist commit: 0123456789abcdef0123456789abcdef01234567
|
||||
|
||||
var languagesByInterpreter = map[string][]string{
|
||||
"bash": {"Shell"},
|
||||
|
@ -2,7 +2,7 @@ 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
|
||||
// Extracted from github/linguist commit: 0123456789abcdef0123456789abcdef01234567
|
||||
|
||||
var languagesType = map[string]Type{
|
||||
"Scaml": Markup,
|
||||
|
@ -2,7 +2,7 @@ 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
|
||||
// Extracted from github/linguist commit: 0123456789abcdef0123456789abcdef01234567
|
||||
|
||||
import "gopkg.in/toqueteos/substring.v1"
|
||||
|
||||
|
Reference in New Issue
Block a user