diff options
author | Sam McCall | 2023-01-11 01:57:10 +0000 |
---|---|---|
committer | GitHub | 2023-01-11 01:57:10 +0000 |
commit | a8248c50e1017cbba42c602d480d3c4ffa7162a0 (patch) | |
tree | c276158975c2739785a0040904fdc97eb746c461 | |
parent | e65f28d41af0b095eb7ff340f20c7d0d4193e287 (diff) |
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";
-rw-r--r-- | languages.toml | 2 | ||||
-rw-r--r-- | runtime/queries/cpp/injections.scm | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/languages.toml b/languages.toml index 076e6363..56e21fb0 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 a5a5208c..fb783bb6 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) |