]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/syntax_checker.go
Add more syntax files and include syntax highlighter in the repo
[micro.git] / runtime / syntax / syntax_checker.go
1 package main
2
3 import (
4         "fmt"
5         "io/ioutil"
6         "strings"
7
8         "github.com/zyedidia/micro/cmd/micro/highlight"
9 )
10
11 func main() {
12         files, _ := ioutil.ReadDir(".")
13
14         hadErr := false
15         for _, f := range files {
16                 if strings.HasSuffix(f.Name(), ".yaml") {
17                         input, _ := ioutil.ReadFile("/Users/zachary/gocode/src/github.com/zyedidia/highlight/syntax_files/" + f.Name())
18                         _, err := highlight.ParseDef(input)
19                         if err != nil {
20                                 hadErr = true
21                                 fmt.Printf("%s:\n", f.Name())
22                                 fmt.Println(err)
23                                 continue
24                         }
25                 }
26         }
27         if !hadErr {
28                 fmt.Println("No issues!")
29         }
30 }