Improve api

This commit is contained in:
Zachary Yedidia
2017-02-18 21:29:17 -05:00
parent 0f7ed208c1
commit 6dfc8e081f
5 changed files with 37 additions and 9 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ import (
// on filename or header (the first line of the file)
// Then it has the rules which define how to highlight the file
type Def struct {
ft string
FileType string
ftdetect []*regexp.Regexp
rules *Rules
}
@@ -68,7 +68,7 @@ func ParseDef(input []byte) (s *Def, err error) {
if k == "filetype" {
filetype := v.(string)
s.ft = filetype
s.FileType = filetype
} else if k == "detect" {
ftdetect := v.(map[interface{}]interface{})
if len(ftdetect) >= 1 {