Julian / tree-sitter-lean

Experimental tree-sitter parser for the Lean (4) Theorem Prover
MIT License
28 stars 5 forks source link

Rewrite external scanner in C #6

Closed pzread closed 2 weeks ago

pzread commented 2 weeks ago

Tree-sitter has deprecated C++ scanner (https://tree-sitter.github.io/tree-sitter/creating-parsers#external-scanners) and recommends writing scanner in C

pzread commented 2 weeks ago

Zed also assumes the scanner file name is scanner.c when compiling tree-sitter by itself (https://github.com/zed-industries/zed/blob/b386b6c2375dc623d123ea4acbf701af907d8856/crates/extension/src/extension_builder.rs#L235).

I'm not sure if Zed's way is the best practice, but rewriting scanner in C also makes it possible to directly be used in Zed extension

Julian commented 2 weeks ago

Thanks!