Skip to content

Commit

Permalink
build: update bindings and manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Apr 30, 2024
1 parent eaf5b45 commit ec16763
Show file tree
Hide file tree
Showing 31 changed files with 2,081 additions and 194 deletions.
39 changes: 39 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{json,toml,yml,gyp}]
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.rs]
indent_style = space
indent_size = 4

[*.{c,cc,h}]
indent_style = space
indent_size = 4

[*.{py,pyi}]
indent_style = space
indent_size = 4

[*.swift]
indent_style = space
indent_size = 4

[*.go]
indent_style = tab
indent_size = 8

[Makefile]
indent_style = tab
indent_size = 8
15 changes: 11 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
/src/** linguist-vendored
/script/** text eol=lf
/src/parser.c -diff
/src/grammar.json -diff
* text eol=lf

src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated

bindings/** linguist-generated
binding.gyp linguist-generated
setup.py linguist-generated
Makefile linguist-generated
Package.swift linguist-generated
49 changes: 37 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
# Rust artifacts
Cargo.lock
node_modules
build
npm-debug.log
package-lock.json
parser.exp
parser.lib
parser.obj
examples
!examples/.gitkeep
scanner.obj
/target/
.build/
target/

# Node artifacts
build/
prebuilds/
node_modules/
*.tgz

# Swift artifacts
.build/

# Go artifacts
go.sum
_obj/

# Python artifacts
.venv/
dist/
*.egg-info
*.whl

# C artifacts
*.a
*.so
*.so.*
*.dylib
*.dll
*.pc

# Example dirs
/examples/*/

# Grammar volatiles
*.wasm
*.obj
*.o
6 changes: 0 additions & 6 deletions .npmignore

This file was deleted.

30 changes: 11 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,36 +1,28 @@
[package]
name = "tree-sitter-c-sharp"
description = "C# grammar for the tree-sitter parsing library"
description = "C# grammar for tree-sitter"
version = "0.20.0"
authors = [
"Damien Guard <damieng@gmail.com>",
"Max Brunsfeld <maxbrunsfeld@gmail.com>",
"Martin Midtgaard <martin.midtgaard@gmail.com>",
"Sjoerd Langkemper <sjoerd-github@linuxonly.nl>",
"Patrick Thomson <patrickt@github.com>",
"Noelle Caldwell <noelle.caldwell@microsoft.com>",
"Douglas Creager <dcreager@dcreager.net>",
"Max Brunsfeld <maxbrunsfeld@gmail.com>",
"Damien Guard <damieng@gmail.com>",
"Amaan Qureshi <amaanq12@gmail.com>",
]
license = "MIT"
readme = "bindings/rust/README.md"
keywords = ["incremental", "parsing", "c-sharp"]
readme = "README.md"
keywords = ["incremental", "parsing", "tree-sitter", "c-sharp"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/tree-sitter/tree-sitter-c-sharp"
edition = "2018"
edition = "2021"
autoexamples = false

build = "bindings/rust/build.rs"
include = [
"bindings/rust/*",
"grammar.js",
"queries/*",
"src/*",
]
include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]

[lib]
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter = ">= 0.19, < 0.21"
tree-sitter = ">=0.21.0"

[build-dependencies]
cc = "1.0"
cc = "1.0.96"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2023 Max Brunsfeld, Damien Guard, and contributors.
Copyright (c) 2014-2023 Max Brunsfeld, Damien Guard, Amaan Qureshi, and contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
112 changes: 112 additions & 0 deletions Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)
[![crates][crates]](https://crates.io/crates/tree-sitter-c-sharp)
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-c-sharp)
[![pypi][pypi]](https://pypi.org/project/tree-sitter-c-sharp)

C# grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter) based upon the Roslyn grammar with changes in order to:

Expand All @@ -13,24 +14,14 @@ C# grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter) based u
- Handle `#if`, `#else`, `#elif`, `#endif` blocks
- 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 11.0 with the following exceptions:
Comprehensive supports C# 1 through 13.0 with the following exception:

- [ ] `async`, `var` and `await` cannot be used as identifiers everywhere they are valid
- [ ] Raw string literals (C# 11)

#### C# 12.0 (under development)

- [ ] Alias any type
- [ ] Collection expressions
- [ ] Default lambda parameters
- [x] Experimental attribute
- [ ] Inline arrays
- [x] Interceptors
- [ ] Primary constructors
- [ ] Ref readonly parameters

### References

Expand All @@ -43,3 +34,4 @@ Comprehensive supports C# 1 through 11.0 with the following exceptions:
[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix
[npm]: https://img.shields.io/npm/v/tree-sitter-c-sharp?logo=npm
[crates]: https://img.shields.io/crates/v/tree-sitter-c-sharp?logo=rust
[pypi]: https://img.shields.io/pypi/v/tree-sitter-c-sharp?logo=pypi&logoColor=ffd242
23 changes: 17 additions & 6 deletions binding.gyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions bindings/c/tree-sitter-c_sharp.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions bindings/c/tree-sitter-c_sharp.pc.in

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ec16763

Please sign in to comment.