diff options
| -rw-r--r-- | lockfile.json | 2 | ||||
| -rw-r--r-- | queries/jsonnet/highlights.scm | 62 |
2 files changed, 30 insertions, 34 deletions
diff --git a/lockfile.json b/lockfile.json index c557cbeea..596a9052f 100644 --- a/lockfile.json +++ b/lockfile.json @@ -282,7 +282,7 @@ "revision": "02b01653c8a1c198ae7287d566efa86a135b30d5" }, "jsonnet": { - "revision": "26d9699842a429731844c93cbcb485519bb2c526" + "revision": "d34615fa12cc1d1cfc1f1f1a80acc9db80ee4596" }, "julia": { "revision": "ab0f70c0a919d38b41822305a8ca80e527c94e4f" diff --git a/queries/jsonnet/highlights.scm b/queries/jsonnet/highlights.scm index 4267c988f..189f4b9e1 100644 --- a/queries/jsonnet/highlights.scm +++ b/queries/jsonnet/highlights.scm @@ -10,7 +10,11 @@ (number) @number (string) @string -(fieldname (id) @label) +(fieldname (id) @field) +(fieldaccess + last: (id) @field) +(fieldaccess_super + (id) @field) [ "[" @@ -30,28 +34,13 @@ ":::" ] @punctuation.delimiter +; Nested field inheritance +("+" @punctuation.delimiter [":" "::" ":::"]) + +"=" @operator (unaryop) @operator -[ - "+" - "-" - "*" - "/" - "%" - "^" - "==" - "!=" - "<=" - ">=" - "<" - ">" - "=" - "&" - "|" - "<<" - ">>" - "&&" - "||" -] @operator +(binary + operator: (_) @operator) "for" @repeat @@ -61,6 +50,7 @@ [ (local) + (tailstrict) "assert" ] @keyword @@ -70,27 +60,33 @@ "then" ] @conditional +"error" @exception + [ (dollar) (self) + (super) ] @variable.builtin ((id) @variable.builtin (#eq? @variable.builtin "std")) ; Function declaration +(param + identifier: (id) @parameter) +(field + (fieldname (id) @function) + [(anonymous_function) (params)]) (bind - function: (id) @function - params: (params - (param - identifier: (id) @parameter))) + function: (id) @function) ; Function call -(expr - (expr (id) @function.call) - "(" - (args - (named_argument - (id) @parameter))? - ")") +(functioncall (id) @function.call) +(functioncall + (fieldaccess + last: (id) @function.call)) +(functioncall + (fieldaccess_super + (id) @function.call)) +(named_argument (id) @parameter) (ERROR) @error |
