From bf14d123dddefa1f553b04cbd7d21f58b7dedad2 Mon Sep 17 00:00:00 2001 From: Sam McCall Date: Wed, 11 Jan 2023 02:57:10 +0100 Subject: [PATCH] Update tree-sitter-cpp, support injections in tagged rawstrings (#5457) The grammar now exposes the delimiter of raw-strings. We can now inject the inner grammar in cases like: const char* script = R"js( alert('hello world!'); )js"; --- languages.toml | 2 +- runtime/queries/cpp/injections.scm | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 076e63632166..56e21fb0c862 100644 --- a/languages.toml +++ b/languages.toml @@ -221,7 +221,7 @@ args = { console = "internalConsole", attachCommands = [ "platform select remote [[grammar]] name = "cpp" -source = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "d5e90fba898f320db48d81ddedd78d52c67c1fed" } +source = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "2d2c4aee8672af4c7c8edff68e7dd4c07e88d2b1" } [[language]] name = "crystal" diff --git a/runtime/queries/cpp/injections.scm b/runtime/queries/cpp/injections.scm index a5a5208ca9c7..fb783bb6fa85 100644 --- a/runtime/queries/cpp/injections.scm +++ b/runtime/queries/cpp/injections.scm @@ -1 +1,4 @@ ; inherits: c +(raw_string_literal + delimiter: (raw_string_delimiter) @injection.language + (raw_string_content) @injection.content)