Skip to content

Commit

Permalink
Update tree-sitter-cpp, support injections in tagged rawstrings (#5457)
Browse files Browse the repository at this point in the history
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";
  • Loading branch information
sam-mccall committed Jan 11, 2023
1 parent e65f28d commit a8248c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions runtime/queries/cpp/injections.scm
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
; inherits: c
(raw_string_literal
delimiter: (raw_string_delimiter) @injection.language
(raw_string_content) @injection.content)

0 comments on commit a8248c5

Please sign in to comment.