From a266dca64d076d91990579102b566c83d3ca2bfa Mon Sep 17 00:00:00 2001 From: Chris Dragan Date: Wed, 31 Dec 2025 19:14:40 +0100 Subject: [PATCH] fix: update to pass all tests --- runtime/queries/kos/highlights.scm | 159 +++++++++++++++-------------- runtime/queries/kos/locals.scm | 2 +- 2 files changed, 81 insertions(+), 80 deletions(-) diff --git a/runtime/queries/kos/highlights.scm b/runtime/queries/kos/highlights.scm index 59a26e146..194f837af 100644 --- a/runtime/queries/kos/highlights.scm +++ b/runtime/queries/kos/highlights.scm @@ -1,132 +1,133 @@ (comment) @comment + (number) @number + (identifier) @variable + (property_identifier) @property + (string_literal) @string + (string_literal_begin) @string + (string_literal_continuation) @string + (string_literal_end) @string [ - "case" - "default" - "else" - "if" - "switch" + "case" + "default" + "else" + "if" + "switch" ] @keyword.conditional -[ - "import" -] @keyword.import +"import" @keyword.import [ - "for" - "loop" - "repeat" - "while" + "for" + "loop" + "repeat" + "while" ] @keyword.repeat (for_statement - "in" @keyword.repeat) + "in" @keyword.repeat) + +"class" @keyword.type [ - "class" -] @keyword.type - -[ - "return" - "yield" + "return" + "yield" ] @keyword.return [ - "catch" - "defer" - "throw" - "try" + "catch" + "defer" + "throw" + "try" ] @keyword.exception [ - "constructor" - "fun" - "=>" + "constructor" + "fun" + "=>" ] @keyword.function [ - "_" - (line) - "assert" - ;"async" - (break_statement) - "const" - (continue_statement) - "do" - "extends" - (fallthrough_statement) - ;"get" - ;"match" - "public" - ;"set" - ;"static" - "var" - "with" + "_" + (line) + "assert" + ;"async" + (break_statement) + "const" + (continue_statement) + "do" + "extends" + (fallthrough_statement) + ;"get" + ;"match" + "public" + ;"set" + ;"static" + "var" + "with" ] @keyword [ - (this) - (super) + (this) + (super) ] @variable.builtin [ - (false) - (true) + (false) + (true) ] @boolean -[ - (void) -] @constant.builtin +(void) @constant.builtin [ - "(" - ")" - "[" - "]" - "{" - "}" + "(" + ")" + "[" + "]" + "{" + "}" ] @punctuation.bracket [ - ";" - ":" - "." - "," + ";" + ":" + "." + "," ] @punctuation.delimiter [ - (arithmetic_assignment_operator) - (comparison_operator) - (bitwise_operator) - (additive_operator) - (multiplicative_operator) - (logical_operator) - (unary_operator) - "->" - "..." - "=" - "?" + (arithmetic_assignment_operator) + (comparison_operator) + (bitwise_operator) + (additive_operator) + (multiplicative_operator) + (logical_operator) + (unary_operator) + "->" + "..." + "=" + "?" ] @operator (conditional_expression - [ - "?" - ":" - ] @keyword.conditional.ternary) + [ + "?" + ":" + ] @keyword.conditional.ternary) (class_member - (function_decl - name: (identifier) @function.method)) + (function_decl + name: (identifier) @function.method)) (function_decl - name: (identifier) @function) + name: (identifier) @function) (class_decl - name: (identifier) @type) + name: (identifier) @type) diff --git a/runtime/queries/kos/locals.scm b/runtime/queries/kos/locals.scm index f060bc84e..37f14f4e6 100644 --- a/runtime/queries/kos/locals.scm +++ b/runtime/queries/kos/locals.scm @@ -33,7 +33,7 @@ (#set! definition.var.scope parent)) (class_decl - name: (identifier) @local.definition.class + name: (identifier) @local.definition.type (#set! definition.var.scope parent)) ; References