mirror of
https://github.com/rwinkhart/go-highlite.git
synced 2026-09-03 15:47:14 -04:00
Fix syncat example
This commit is contained in:
+2
-3
@@ -11,15 +11,14 @@ import (
|
|||||||
"github.com/zyedidia/highlight"
|
"github.com/zyedidia/highlight"
|
||||||
)
|
)
|
||||||
|
|
||||||
var defs []*highlight.Def
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
var defs []*highlight.Def
|
||||||
gopath := os.Getenv("GOPATH")
|
gopath := os.Getenv("GOPATH")
|
||||||
files, _ := ioutil.ReadDir(gopath + "/src/github.com/zyedidia/highlight/syntax_files")
|
files, _ := ioutil.ReadDir(gopath + "/src/github.com/zyedidia/highlight/syntax_files")
|
||||||
|
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
if strings.HasSuffix(f.Name(), ".yaml") {
|
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)
|
d, err := highlight.ParseDef(input)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
filetype: go
|
filetype: go
|
||||||
|
|
||||||
detect:
|
detect:
|
||||||
filename: "\\.go$"
|
filename: "\\.go$"
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
- statement: "\\b(break|case|continue|default|else|for|go|goto|if|range|return|switch)\\b"
|
- statement: "\\b(break|case|continue|default|else|for|go|goto|if|range|return|switch)\\b"
|
||||||
|
|||||||
Reference in New Issue
Block a user