C# grammar for tree-sitter
Project Links
Meta
Author: Max Brunsfeld, Amaan Qureshi
Requires Python: >=3.9
Classifiers
Intended Audience
- Developers
License
- OSI Approved :: MIT License
Topic
- Software Development :: Compilers
- Text Processing :: Linguistic
Typing
- Typed
tree-sitter-c-sharp
C# grammar for tree-sitter based upon the Roslyn grammar with changes in order to:
- Deal with differences between the parsing technologies
- Work around some bugs in that grammar
- Handle
#if,#else,#elif,#endifblocks - Support syntax highlighting/parsing of fragments
- Simplify the output tree
- Reduce parser state count and complexity
- Be in-line with tree-sitter's convention where applicable
Status
Comprehensive supports C# 1 through 13.0 with the following exception:
-
async,varandawaitcannot be used as identifiers everywhere they are valid
References
- Official C# 6 Language Spec provides chapters that formally define the language grammar.
- Roslyn C# language grammar export
- SharpLab (web-based syntax tree playground based on Roslyn)
0.23.1
Nov 11, 2024
0.23.0
Sep 01, 2024
0.21.3
Jul 08, 2024
0.21.2
May 07, 2024
0.21.1
May 03, 2024
0.21.0
May 03, 2024
Wheel compatibility matrix
Files in release
tree_sitter_c_sharp-0.23.1-cp39-abi3-macosx_10_9_x86_64.whl (363.5KiB)
tree_sitter_c_sharp-0.23.1-cp39-abi3-macosx_11_0_arm64.whl (409.2KiB)
tree_sitter_c_sharp-0.23.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (406.2KiB)
tree_sitter_c_sharp-0.23.1-cp39-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (393.4KiB)
tree_sitter_c_sharp-0.23.1-cp39-abi3-musllinux_1_2_x86_64.whl (388.6KiB)
tree_sitter_c_sharp-0.23.1-cp39-abi3-win_amd64.whl (368.7KiB)
tree_sitter_c_sharp-0.23.1-cp39-abi3-win_arm64.whl (366.4KiB)
tree_sitter_c_sharp-0.23.1.tar.gz (1.3MiB)