Support rule precedence just like the old format

This commit is contained in:
Zachary Yedidia
2017-03-21 13:15:46 -04:00
parent 59bf1a2260
commit 8a33c98bc6
5 changed files with 167 additions and 15 deletions

View File

@@ -17,7 +17,7 @@ rules:
- statement: "!"
- statement: ","
- constant.number: "\\b([0-9]+|0x[0-9a-fA-F]*)\\b"
- constant.specialChar: "\\([0-7]{3|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- constant.specialChar: "\\\\([0-7]{3|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
- comment:
start: "//"

View File

@@ -14,7 +14,7 @@ func main() {
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())
input, _ := ioutil.ReadFile(f.Name())
_, err := highlight.ParseDef(input)
if err != nil {
hadErr = true