Hi:
Yesterday I wrote an initial version of the cuda-ts-mode.
Some months ago I was asking for a feature to simplify the
implementation as Cuda tressitter is just the same C++ grammar with very
little extensions (a few keywords and the <<< >>> brakets)
My initial idea was to reuse all the c++-ts-mode and just add a couple
of changes.
This was actually quite hard for 3 reasons:
1. The treesit-language-remap-alist sometimes updated the grammar to
cuda's but sometimes was still using the c++ one.
2. In c++-ts-mode--simple-indent-rules the conditions are limited to c
and C++, so I needed to "hack" a bit to get the rules and set them in a
cuda entry
3. There was no way to reuse the c-ts-mode--font-lock-settings function
because of the :language entries + compilation. I needed to basically
copy-paste the same code and remove the conditions (eq mode 'c++) to
make it work.
Also the function c-ts-mode--test-virtual-named-p hardcodes 'cpp
I have a preliminar functional version that I would like to simplify and
propose for to elpa.
https://github.com/Ergus/cuda-ts-mode