mirror of
https://github.com/tree-sitter/tree-sitter-c-sharp.git
synced 2026-11-17 03:10:44 +00:00
C# Grammar for tree-sitter
- JavaScript 45.2%
- C# 35.2%
- C 16.8%
- Tree-sitter Query 2.7%
- Shell 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6 to 7. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
| .github | ||
| bindings | ||
| queries | ||
| src | ||
| test | ||
| tools/highlight-test-generator | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| binding.gyp | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CMakeLists.txt | ||
| eslint.config.mjs | ||
| go.mod | ||
| go.sum | ||
| grammar.js | ||
| LICENSE | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| Package.swift | ||
| pyproject.toml | ||
| README.md | ||
| setup.py | ||
| tree-sitter.json | ||
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 14.0 with the following exceptions:
async,varandawaitcannot be used as identifiers everywhere they are valid- File-based apps preprocessor directives (
#:property,#:package,#:sdk,#:project) are not yet recognized
References
- Official C# 8 Draft Language Spec provides chapters that formally define the language grammar.
- Roslyn C# language grammar export
- SharpLab (web-based syntax tree playground based on Roslyn)