From 204c3707b070c0933366b7366d48744b1426abaa Mon Sep 17 00:00:00 2001 From: 7ombie <80077603+7ombie@users.noreply.github.com> Date: Mon, 12 Feb 2024 01:17:44 +0000 Subject: [PATCH] Updated Swift grammar, adding 'any' and 'await' keywords. (#9586) --- languages.toml | 2 +- runtime/queries/swift/highlights.scm | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/languages.toml b/languages.toml index 084d4932c1c6..c2432c27871b 100644 --- a/languages.toml +++ b/languages.toml @@ -1730,7 +1730,7 @@ language-servers = [ "sourcekit-lsp" ] [[grammar]] name = "swift" -source = { git = "https://github.com/alex-pinkus/tree-sitter-swift", rev = "77c6312c8438f4dbaa0350cec92b3d6dd3d74a66" } +source = { git = "https://github.com/alex-pinkus/tree-sitter-swift", rev = "b1b66955d420d5cf5ff268ae552f0d6e43ff66e1" } [[language]] name = "erb" diff --git a/runtime/queries/swift/highlights.scm b/runtime/queries/swift/highlights.scm index 5560010b07e5..e7610e38dd42 100644 --- a/runtime/queries/swift/highlights.scm +++ b/runtime/queries/swift/highlights.scm @@ -1,10 +1,10 @@ -; Upstream: https://github.com/alex-pinkus/tree-sitter-swift/blob/8d2fd80e3322df51e3f70952e60d57f5d4077eb8/queries/highlights.scm +; Upstream: https://github.com/alex-pinkus/tree-sitter-swift/blob/1c586339fb00014b23d6933f2cc32b588a226f3b/queries/highlights.scm (line_string_literal ["\\(" ")"] @punctuation.special) ["." ";" ":" "," ] @punctuation.delimiter -["(" ")" "[" "]" "{" "}"] @punctuation.bracket ; TODO: "\\(" ")" in interpolations should be @punctuation.special +["(" ")" "[" "]" "{" "}"] @punctuation.bracket ; Identifiers (attribute) @variable @@ -26,6 +26,7 @@ (function_declaration "init" @constructor) (throws) @keyword "async" @keyword +"await" @keyword (where_keyword) @keyword (parameter external_name: (simple_identifier) @variable.parameter) (parameter name: (simple_identifier) @variable.parameter) @@ -48,6 +49,7 @@ "convenience" "required" "some" + "any" ] @keyword [