Fix syncat example

This commit is contained in:
Zachary Yedidia
2017-02-19 21:00:54 -05:00
parent aa571f2f0c
commit a89c9319b3
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -11,15 +11,14 @@ import (
"github.com/zyedidia/highlight"
)
var defs []*highlight.Def
func main() {
var defs []*highlight.Def
gopath := os.Getenv("GOPATH")
files, _ := ioutil.ReadDir(gopath + "/src/github.com/zyedidia/highlight/syntax_files")
for _, f := range files {
if strings.HasSuffix(f.Name(), ".yaml") {
input, _ := ioutil.ReadFile(gopath + "/src/github.com/zyedidia/highlight/syntax_files")
input, _ := ioutil.ReadFile(gopath + "/src/github.com/zyedidia/highlight/syntax_files/" + f.Name())
d, err := highlight.ParseDef(input)
if err != nil {
fmt.Println(err)
+1 -1
View File
@@ -1,7 +1,7 @@
filetype: go
detect:
filename: "\\.go$"
filename: "\\.go$"
rules:
- statement: "\\b(break|case|continue|default|else|for|go|goto|if|range|return|switch)\\b"