Textmate parser

Textmate is the syntax highlighting format used in vscode, SublimeText, many others before the advent of tree-sitter.

I created this textmate parser to learn Zig.

It is not yet ready. But can highlight code linearly already and is fast enough. (Still atleast 4x slower than Syntect (rust))

Posting here for much appreciated comments before refactoring for Zig-correctness.

Enjoying Zig too much ended up sprinting 3 weeks on this.

6 Likes

I forked kilo.zig @mg979 to add textmate syntax rendering - for visual testing and for making the library easy to import.

screenshot

kilo.zig + textmate

Do you think textmate.zig might be usable as an alternate highlighting backend to tree-sitter in Flow Control?

It is nowhere near ready yet. The goal was to make it at useable for vim and nvim as a plugin. But after testing it out with kilo.zig, I realize making textmate.zig as module first for other zig projects actually makes better sense than diving back into C and lua.

I’ll definitely be testing integration with Flow.

Thanks for dropping by. I actually have your project Flow as one of my reference projects to help me improve my zig code.

P.S. please bump up vim mode priority for Flow :slight_smile:

1 Like