Skip to content

Commit

Permalink
Update tree-sitter-cpp, support injections in tagged rawstrings (heli…
Browse files Browse the repository at this point in the history
…x-editor#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";
  • Loading branch information
sam-mccall authored and Shafkath Shuhan committed Jan 24, 2023
1 parent 6d68571 commit bf14d12
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 bf14d12

Please sign in to comment.