mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 14:22:42 +09:00
Add more syntax files and include syntax highlighter in the repo
This commit is contained in:
30
runtime/syntax/syntax_checker.go
Normal file
30
runtime/syntax/syntax_checker.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
"github.com/zyedidia/micro/cmd/micro/highlight"
|
||||
)
|
||||
|
||||
func main() {
|
||||
files, _ := ioutil.ReadDir(".")
|
||||
|
||||
hadErr := false
|
||||
for _, f := range files {
|
||||
if strings.HasSuffix(f.Name(), ".yaml") {
|
||||
input, _ := ioutil.ReadFile("/Users/zachary/gocode/src/github.com/zyedidia/highlight/syntax_files/" + f.Name())
|
||||
_, err := highlight.ParseDef(input)
|
||||
if err != nil {
|
||||
hadErr = true
|
||||
fmt.Printf("%s:\n", f.Name())
|
||||
fmt.Println(err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
if !hadErr {
|
||||
fmt.Println("No issues!")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user