Add nix language syntax (#2024)

* Create nix.yaml

Add nix language syntax

* Add nix-linter
This commit is contained in:
vandervoortj
2021-06-15 17:56:31 -04:00
committed by GitHub
parent 4b0db74770
commit 9ceb69921a
2 changed files with 28 additions and 0 deletions

View File

@@ -86,6 +86,7 @@ function preinit()
makeLinter("swiftc", "swift", "xcrun", {"swiftc", "%f"}, "%f:%l:%c:.+: %m", {"darwin"}, true)
makeLinter("swiftc", "swift", "swiftc", {"%f"}, "%f:%l:%c:.+: %m", {"linux"}, true)
makeLinter("yaml", "yaml", "yamllint", {"--format", "parsable", "%f"}, "%f:%l:%c:.+ %m")
makeLinter("nix-linter", "nix", "nix-linter", {"%f"}, "%m at %f:%l:%c", {"linux"}, true)
config.MakeCommand("lint", function(bp, args)
bp:Save()

27
runtime/syntax/nix.yaml Normal file
View File

@@ -0,0 +1,27 @@
filetype: nix
detect:
filename: "\\.nix$"
rules:
- special: "\\b(Ellipsis|null|self|super|true|false|abort)\\b"
- statement: "\\b(let|in|with|import|rec|inherit)\\b"
- symbol.operator: "([~^.:;,+*|=!\\%@]|<|>|/|-|&)"
- symbol.brackets: "([(){}]|\\[|\\])"
- constant.number: "\\b[0-9](_?[0-9])*(\\.([0-9](_?[0-9])*)?)?(e[0-9](_?[0-9])*)?\\b"
- constant.string:
start: "\""
end: "\""
rules: []
- constant.string:
start: "''"
end: "''"
rules: []
- comment:
start: "#"
end: "$"
rules: []