c3c icon indicating copy to clipboard operation
c3c copied to clipboard

proposal: create TextMate-Compatible Grammar for C3

Open vkuprin opened this issue 1 year ago • 8 comments

I’ve been exploring the process of adding C3 language support to GitHub Linguist for syntax highlighting. As per Linguist’s requirements, it only supports TextMate-compatible grammars for syntax highlighting.

Currently, the C3 repository has an excellent Tree-sitter grammar (tree-sitter-c3), but there doesn’t seem to be a TextMate-compatible grammar available

vkuprin avatar Dec 09 '24 18:12 vkuprin

I think there is a sublime highlighting, is that one TM compatible?

lerno avatar Dec 09 '24 21:12 lerno

There already is a TextMate grammar here, but it's probably important that I remove the distinction between top- and function-level at some point so it becomes a suitable grammar for parsing code snippets.

cbuttner avatar Jan 11 '25 14:01 cbuttner

@cbuttner Is this one up to date with the latest changes to the grammar?

lerno avatar Jan 11 '25 19:01 lerno

The grammar is now up to date.

cbuttner avatar May 16 '25 11:05 cbuttner

Can we get a compiled version somewhere too?

lerno avatar May 23 '25 20:05 lerno

@lerno I'm not sure what you mean, the TextMate grammar is just a json file.

cbuttner avatar May 24 '25 21:05 cbuttner

I am confused, there are two files there and I think traditionally the grammar is just a single file. Is it the same thing in two formats?

lerno avatar May 25 '25 11:05 lerno

The json file is generated from the yml file using the vscode-c3/build_syntax.js script.

cbuttner avatar May 25 '25 12:05 cbuttner

here's my VSCode extension to help with authoring TextMate grammars https://marketplace.visualstudio.com/items?itemName=RedCMD.tmlanguage-syntax-highlighter

RedCMD avatar Aug 09 '25 07:08 RedCMD

This is now completed.

lerno avatar Aug 26 '25 14:08 lerno