tree-sitter-csproj
v0.1.1
Published
tree sitter grammer for csharp project files
Downloads
100
Readme
tree-sitter-csproj
This is a grammar for csharp project files leveraging tree-sitter. Why? Simply for fun and getting to see tree-sitter in action.
Installing Tree Sitter
- Ensure you have node installed.
- Ensure you have a c compiler installed.
- Install
tree-sitter-cli
using- using cargo
cargo install tree-sitter-cli --locked
- using npm
npm install tree-sitter-cli -g
- download binaries from github
- using cargo
Generating the parser
The grammar for the language is defined in grammar.json. Running tree-sitter
generate
will generate c code for the parser. You will essentially run this after updating the
grammar.
Testing
You can test the parser by running tree-sitter parse example/console.txt
. This should print out
an AST in the form of an S-Expression. i.e
(project [0, 0] - [16, 0]
(project_open [0, 0] - [0, 33]
...more))
Running tree-sitter test
will run the tests set up under test/corpus
folder.
Publishing
The node binding for the parser is currently published to npm.