Skip to content

Commit

Permalink
Merge pull request #7 from smola/saltstack
Browse files Browse the repository at this point in the history
fix .sls disambiguation (Scheme/SaltStack).
  • Loading branch information
mcuadros authored Sep 15, 2016
2 parents fe1e10e + a4e77fd commit 2f971ef
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions content.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,13 +402,10 @@ var matchers = map[string]languageMatcher{
return OtherLanguage, false
},
".sls": func(i []byte) (string, bool) {
if substring.BytesRegexp("## |@no-lib-strip@").Match(i) {
return "World of Warcraft Addon Data", true
} else if substring.BytesRegexp("(contentsline|defcounter|beamer|boolfalse)").Match(i) {
return "TeX", true
if schemeMatcher.Match(i) {
return "Scheme", true
}

return OtherLanguage, false
return "SaltStack", false
},
".sql": func(i []byte) (string, bool) {
if pgSQLMatcher.Match(i) {
Expand Down Expand Up @@ -484,4 +481,5 @@ var (
substring.BytesRegexp(`(?i)\$\$PLSQL_|XMLTYPE|sysdate|systimestamp|\.nextval|connect by|AUTHID (DEFINER|CURRENT_USER)`),
substring.BytesRegexp(`(?i)constructor\W+function`),
)
schemeMatcher = substring.BytesRegexp(`(?m)\A(^\s*;;.*$)*\s*\(`)
)

0 comments on commit 2f971ef

Please sign in to comment.