2021-06-10 05:07:24 +04:00
|
|
|
(comment) @comment
|
|
|
|
|
2022-09-05 03:46:31 +04:00
|
|
|
"assert" @keyword.control.exception
|
|
|
|
"or" @keyword.operator
|
|
|
|
"rec" @keyword.control.repeat
|
|
|
|
|
2021-06-10 05:07:24 +04:00
|
|
|
[
|
2022-05-30 22:47:18 +04:00
|
|
|
"if"
|
2021-06-10 05:07:24 +04:00
|
|
|
"then"
|
|
|
|
"else"
|
2022-09-05 03:46:31 +04:00
|
|
|
] @keyword.control.conditional
|
|
|
|
|
|
|
|
[
|
2021-06-10 05:07:24 +04:00
|
|
|
"let"
|
|
|
|
"inherit"
|
|
|
|
"in"
|
2022-05-30 22:47:18 +04:00
|
|
|
"with"
|
2021-06-10 05:07:24 +04:00
|
|
|
] @keyword
|
|
|
|
|
|
|
|
((identifier) @variable.builtin
|
2022-01-06 06:04:55 +04:00
|
|
|
(#match? @variable.builtin "^(__currentSystem|__currentTime|__nixPath|__nixVersion|__storeDir|builtins)$")
|
2021-06-10 05:07:24 +04:00
|
|
|
(#is-not? local))
|
|
|
|
|
|
|
|
((identifier) @function.builtin
|
|
|
|
(#match? @function.builtin "^(__add|__addErrorContext|__all|__any|__appendContext|__attrNames|__attrValues|__bitAnd|__bitOr|__bitXor|__catAttrs|__compareVersions|__concatLists|__concatMap|__concatStringsSep|__deepSeq|__div|__elem|__elemAt|__fetchurl|__filter|__filterSource|__findFile|__foldl'|__fromJSON|__functionArgs|__genList|__genericClosure|__getAttr|__getContext|__getEnv|__hasAttr|__hasContext|__hashFile|__hashString|__head|__intersectAttrs|__isAttrs|__isBool|__isFloat|__isFunction|__isInt|__isList|__isPath|__isString|__langVersion|__length|__lessThan|__listToAttrs|__mapAttrs|__match|__mul|__parseDrvName|__partition|__path|__pathExists|__readDir|__readFile|__replaceStrings|__seq|__sort|__split|__splitVersion|__storePath|__stringLength|__sub|__substring|__tail|__toFile|__toJSON|__toPath|__toXML|__trace|__tryEval|__typeOf|__unsafeDiscardOutputDependency|__unsafeDiscardStringContext|__unsafeGetAttrPos|__valueSize|abort|baseNameOf|derivation|derivationStrict|dirOf|fetchGit|fetchMercurial|fetchTarball|fromTOML|import|isNull|map|placeholder|removeAttrs|scopedImport|throw|toString)$")
|
|
|
|
(#is-not? local))
|
|
|
|
|
|
|
|
[
|
2022-05-30 22:47:18 +04:00
|
|
|
(string_expression)
|
|
|
|
(indented_string_expression)
|
2021-06-10 05:07:24 +04:00
|
|
|
] @string
|
|
|
|
|
|
|
|
[
|
2022-05-30 22:47:18 +04:00
|
|
|
(path_expression)
|
|
|
|
(hpath_expression)
|
|
|
|
(spath_expression)
|
2021-06-10 05:07:24 +04:00
|
|
|
] @string.special.path
|
|
|
|
|
2022-05-30 22:47:18 +04:00
|
|
|
(uri_expression) @string.special.uri
|
2021-06-10 05:07:24 +04:00
|
|
|
|
2022-01-06 06:04:55 +04:00
|
|
|
; boolean
|
|
|
|
((identifier) @constant.builtin.boolean (#match? @constant.builtin.boolean "^(true|false)$")) @constant.builtin.boolean
|
|
|
|
; null
|
|
|
|
((identifier) @constant.builtin (#eq? @constant.builtin "null")) @constant.builtin
|
|
|
|
|
2022-05-30 22:47:18 +04:00
|
|
|
(integer_expression) @constant.numeric.integer
|
|
|
|
(float_expression) @constant.numeric.float
|
2021-06-10 05:07:24 +04:00
|
|
|
|
2021-11-03 07:00:52 +04:00
|
|
|
(escape_sequence) @constant.character.escape
|
2021-06-10 05:07:24 +04:00
|
|
|
|
2022-05-30 22:47:18 +04:00
|
|
|
(function_expression
|
2021-06-10 05:07:24 +04:00
|
|
|
universal: (identifier) @variable.parameter
|
2022-09-05 03:46:31 +04:00
|
|
|
"@"? @punctuation.delimiter
|
2021-06-10 05:07:24 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
(formal
|
|
|
|
name: (identifier) @variable.parameter
|
|
|
|
"?"? @punctuation.delimiter)
|
|
|
|
|
2022-05-30 22:47:18 +04:00
|
|
|
(select_expression
|
2022-09-05 03:46:31 +04:00
|
|
|
attrpath: (attrpath attr: (identifier)) @variable.other.member)
|
|
|
|
|
|
|
|
(interpolation
|
|
|
|
"${" @punctuation.special
|
|
|
|
"}" @punctuation.special) @embedded
|
2022-05-30 22:47:18 +04:00
|
|
|
|
|
|
|
(apply_expression
|
2021-06-10 05:07:24 +04:00
|
|
|
function: [
|
2022-09-05 03:46:31 +04:00
|
|
|
(variable_expression name: (identifier) @function)
|
2022-05-30 22:47:18 +04:00
|
|
|
(select_expression
|
2021-06-10 05:07:24 +04:00
|
|
|
attrpath: (attrpath
|
2022-05-30 22:47:18 +04:00
|
|
|
attr: (identifier) @function .))])
|
2021-06-10 05:07:24 +04:00
|
|
|
|
2022-05-30 22:47:18 +04:00
|
|
|
(unary_expression
|
2021-06-10 05:07:24 +04:00
|
|
|
operator: _ @operator)
|
|
|
|
|
2022-05-30 22:47:18 +04:00
|
|
|
(binary_expression
|
2021-06-10 05:07:24 +04:00
|
|
|
operator: _ @operator)
|
|
|
|
|
2022-09-05 03:46:31 +04:00
|
|
|
(variable_expression name: (identifier) @variable)
|
2022-05-30 22:47:18 +04:00
|
|
|
|
|
|
|
(binding
|
2022-09-05 03:46:31 +04:00
|
|
|
attrpath: (attrpath attr: (identifier)) @variable.other.member)
|
2022-05-30 22:47:18 +04:00
|
|
|
|
2022-09-05 03:46:31 +04:00
|
|
|
(inherit_from attrs: (inherited_attrs attr: (identifier) @variable))
|
2022-05-30 22:47:18 +04:00
|
|
|
|
2022-09-05 03:46:31 +04:00
|
|
|
(has_attr_expression
|
|
|
|
expression: (_)
|
|
|
|
"?" @operator
|
|
|
|
attrpath: (attrpath
|
|
|
|
attr: (identifier) @variable.other.member))
|
2021-06-10 05:07:24 +04:00
|
|
|
|
|
|
|
[
|
|
|
|
";"
|
|
|
|
"."
|
|
|
|
","
|
2022-05-30 22:47:18 +04:00
|
|
|
"="
|
2021-06-10 05:07:24 +04:00
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
|
|
[
|
|
|
|
"("
|
|
|
|
")"
|
|
|
|
"["
|
|
|
|
"]"
|
|
|
|
"{"
|
|
|
|
"}"
|
2022-05-30 22:47:18 +04:00
|
|
|
] @punctuation.bracket
|