tree-sitter-cpp icon indicating copy to clipboard operation
tree-sitter-cpp copied to clipboard

More flexibility for raw string literals

Open Galicarnax opened this issue 2 years ago • 0 comments

As I was trying to highlight the contents of C++ raw string literals depending on custom delimiters (e.g. R"re(...)re" for regular expressions), I found it is probably impossible without tweaking the code in src/scanner.cc. It would be nice to have externals not just for raw_string_literal, but for raw_string_start, raw_string_content, and raw_string_end (or smth like that). Similar to, e.g., as done for Lua. Then it would be possible to have injection queries and to highlight contents of customized raw string literals with, e.g., regex or SQL syntax.

Galicarnax avatar May 28 '22 10:05 Galicarnax