created 'type Type int' for type.go generation

This commit is contained in:
Manuel Carmona 2017-04-17 12:08:54 +02:00
parent b277944b2a
commit c08b85120d
5 changed files with 25 additions and 15 deletions

View File

@ -4,20 +4,22 @@ package slinguist
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }} // Extracted from github/linguist commit: {{ getCommit }}
type Type int
const ( const (
TypeUnknown = iota TypeUnknown Type = iota
TypeData TypeData
TypeProgramming TypeProgramming
TypeMarkup TypeMarkup
TypeProse TypeProse
) )
func GetLanguageType(language string) (langType int) { func GetLanguageType(language string) (langType Type) {
langType, _ = languagesType[language] langType, _ = languagesType[language]
return langType return langType
} }
var languagesType = map[string]int{ var languagesType = map[string]Type{
{{range $language, $type := . -}} {{range $language, $type := . -}}
"{{ $language }}": {{ $type -}}, "{{ $language }}": {{ $type -}},
{{end -}} {{end -}}

View File

@ -4,20 +4,22 @@ package slinguist
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7 // Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
type Type int
const ( const (
TypeUnknown = iota TypeUnknown Type = iota
TypeData TypeData
TypeProgramming TypeProgramming
TypeMarkup TypeMarkup
TypeProse TypeProse
) )
func GetLanguageType(language string) (langType int) { func GetLanguageType(language string) (langType Type) {
langType, _ = languagesType[language] langType, _ = languagesType[language]
return langType return langType
} }
var languagesType = map[string]int{ var languagesType = map[string]Type{
"Scaml": TypeMarkup, "Scaml": TypeMarkup,
"Scheme": TypeProgramming, "Scheme": TypeProgramming,
"Scilab": TypeProgramming, "Scilab": TypeProgramming,

View File

@ -4,20 +4,22 @@ package slinguist
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7 // Extracted from github/linguist commit: fe8b44ab8a225b1ffa75b983b916ea22fee5b6f7
type Type int
const ( const (
TypeUnknown = iota TypeUnknown Type = iota
TypeData TypeData
TypeProgramming TypeProgramming
TypeMarkup TypeMarkup
TypeProse TypeProse
) )
func GetLanguageType(language string) (langType int) { func GetLanguageType(language string) (langType Type) {
langType, _ = languagesType[language] langType, _ = languagesType[language]
return langType return langType
} }
var languagesType = map[string]int{ var languagesType = map[string]Type{
"Scaml": TypeMarkup, "Scaml": TypeMarkup,
"Scheme": TypeProgramming, "Scheme": TypeProgramming,
"Scilab": TypeProgramming, "Scilab": TypeProgramming,

View File

@ -4,20 +4,22 @@ package slinguist
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }} // Extracted from github/linguist commit: {{ getCommit }}
type Type int
const ( const (
TypeUnknown = iota TypeUnknown Type = iota
TypeData TypeData
TypeProgramming TypeProgramming
TypeMarkup TypeMarkup
TypeProse TypeProse
) )
func GetLanguageType(language string) (langType int) { func GetLanguageType(language string) (langType Type) {
langType, _ = languagesType[language] langType, _ = languagesType[language]
return langType return langType
} }
var languagesType = map[string]int{ var languagesType = map[string]Type{
{{range $language, $type := . -}} {{range $language, $type := . -}}
"{{ $language }}": {{ $type -}}, "{{ $language }}": {{ $type -}},
{{end -}} {{end -}}

View File

@ -4,20 +4,22 @@ package slinguist
// THIS FILE SHOULD NOT BE EDITED BY HAND // THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: dae33dc2b20cddc85d1300435c3be7118a7115a9 // Extracted from github/linguist commit: dae33dc2b20cddc85d1300435c3be7118a7115a9
type Type int
const ( const (
TypeUnknown = iota TypeUnknown Type = iota
TypeData TypeData
TypeProgramming TypeProgramming
TypeMarkup TypeMarkup
TypeProse TypeProse
) )
func GetLanguageType(language string) (langType int) { func GetLanguageType(language string) (langType Type) {
langType, _ = languagesType[language] langType, _ = languagesType[language]
return langType return langType
} }
var languagesType = map[string]int{ var languagesType = map[string]Type{
"1C Enterprise": TypeProgramming, "1C Enterprise": TypeProgramming,
"ABAP": TypeProgramming, "ABAP": TypeProgramming,
"ABNF": TypeData, "ABNF": TypeData,