- Support df command

- Return warnings array from ParseSyntaxFiles() in addition to potential
  error. Not being able to parse the dir is a fatal error but if a
random file cannot be read, it should be considered a warning.
This commit is contained in:
Jesse Portnoy
2023-07-18 18:46:01 +01:00
parent 57b5bfb135
commit 449702f27b
4 changed files with 48 additions and 12 deletions
+4 -1
View File
@@ -28,11 +28,14 @@ func main() {
}
var defs []*highlight.Def
err := highlight.ParseSyntaxFiles(syn_dir, &defs)
err, warnings := highlight.ParseSyntaxFiles(syn_dir, &defs)
if err != nil {
log.Fatal(err)
}
// it's up to you what to do with the warnings. You can print them or ignore them
fmt.Println(warnings)
highlight.ResolveIncludes(defs)
fileSrc, _ := ioutil.ReadFile(os.Args[1])