mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 06:12:35 +09:00
Merge
This commit is contained in:
41
runtime/syntax/julia.yaml
Normal file
41
runtime/syntax/julia.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
filetype: julia
|
||||
|
||||
detect:
|
||||
filename: "\\.jl$"
|
||||
header: "^#!.*/(env +)?julia( |$)"
|
||||
|
||||
rules:
|
||||
|
||||
# built-in objects
|
||||
- constant.bool: "\\b(true|false)\\b"
|
||||
# built-in attributes
|
||||
- constant: "__[A-Za-z0-9_]+__"
|
||||
# definitions
|
||||
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
|
||||
# keywords
|
||||
- statement: "\\b(begin|break|catch|continue|function|elseif|else|end|finally|for|global|local|if|include|using|require|macro|println|return|try|type|while|module)\\b"
|
||||
# decorators
|
||||
- identifier.macro: "@[A-Za-z0-9_]+"
|
||||
# operators
|
||||
- symbol.operator: "[-+*/|=%<>&~^]|\\b(and|not|or|is|in)\\b"
|
||||
# parentheses
|
||||
- symbol.brackets: "([(){}]|\\[|\\])"
|
||||
# numbers
|
||||
- constant.number: "\\b[0-9]+\\b"
|
||||
|
||||
- constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'"
|
||||
|
||||
- constant.string:
|
||||
start: "\"\"\""
|
||||
end: "\"\"\""
|
||||
rules: []
|
||||
|
||||
- constant.string:
|
||||
start: "'''"
|
||||
end: "'''"
|
||||
rules: []
|
||||
|
||||
- comment:
|
||||
start: "#"
|
||||
end: "$"
|
||||
rules: []
|
||||
@@ -1,7 +1,7 @@
|
||||
filetype: ledger
|
||||
|
||||
detect:
|
||||
filename: "(^|\\.|/)ledger|ldgr|beancount|bnct$"
|
||||
filename: "(^|\\.|/)(ledger|ldgr|beancount|bnct)$"
|
||||
|
||||
rules:
|
||||
- special: "^([0-9]{4}(/|-)[0-9]{2}(/|-)[0-9]{2}|[=~]) .*"
|
||||
|
||||
@@ -15,16 +15,24 @@ func main() {
|
||||
for _, f := range files {
|
||||
if strings.HasSuffix(f.Name(), ".yaml") {
|
||||
input, _ := ioutil.ReadFile(f.Name())
|
||||
_, err := highlight.ParseDef(input)
|
||||
//fmt.Println("Checking file -> ", f.Name())
|
||||
file, err := highlight.ParseFile(input)
|
||||
if err != nil {
|
||||
hadErr = true
|
||||
fmt.Printf("%s:\n", f.Name())
|
||||
fmt.Printf("Could not parse file -> %s:\n", f.Name())
|
||||
fmt.Println(err)
|
||||
continue
|
||||
}
|
||||
_, err1 := highlight.ParseDef(file, nil)
|
||||
if err1 != nil {
|
||||
hadErr = true
|
||||
fmt.Printf("Could not parse input file using highlight.ParseDef(%s):\n", f.Name())
|
||||
fmt.Println(err1)
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
if !hadErr {
|
||||
fmt.Println("No issues!")
|
||||
fmt.Println("No issues found!")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,16 +15,16 @@ rules:
|
||||
- special: "(^---|^\\.\\.\\.|^%YAML|^%TAG)"
|
||||
|
||||
- constant.string:
|
||||
start: "\""
|
||||
start: "(^| )\""
|
||||
end: "\""
|
||||
skip: "\\\\."
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- constant.string:
|
||||
start: "'"
|
||||
start: "(^| )'"
|
||||
end: "'"
|
||||
skip: "\\\\."
|
||||
skip: "(\\\\.)|('')"
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user