Skip to content

Commit 809fe42

Browse files
authored
Merge pull request #3 from mehmetoguzderin/oguz-20240826-tree-sitter
Sync with latest Spec
2 parents 609b973 + 0e6e335 commit 809fe42

23 files changed

+1290
-43737
lines changed

.editorconfig

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
6+
[*.{json,toml,yml,gyp}]
7+
indent_style = space
8+
indent_size = 2
9+
10+
[*.js]
11+
indent_style = space
12+
indent_size = 2
13+
14+
[*.scm]
15+
indent_style = space
16+
indent_size = 2
17+
18+
[*.{c,cc,h}]
19+
indent_style = space
20+
indent_size = 4
21+
22+
[*.rs]
23+
indent_style = space
24+
indent_size = 4
25+
26+
[*.{py,pyi}]
27+
indent_style = space
28+
indent_size = 4
29+
30+
[*.swift]
31+
indent_style = space
32+
indent_size = 4
33+
34+
[*.go]
35+
indent_style = tab
36+
indent_size = 8
37+
38+
[Makefile]
39+
indent_style = tab
40+
indent_size = 8
41+
42+
[parser.c]
43+
indent_size = 2
44+
45+
[{alloc,array,parser}.h]
46+
indent_size = 2

.gitattributes

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
* text=auto eol=lf
2+
3+
# Generated source files
4+
src/*.json linguist-generated
5+
src/parser.c linguist-generated
6+
src/tree_sitter/* linguist-generated
7+
8+
# C bindings
9+
bindings/c/** linguist-generated
10+
CMakeLists.txt linguist-generated
11+
Makefile linguist-generated
12+
13+
# Rust bindings
14+
bindings/rust/* linguist-generated
15+
Cargo.toml linguist-generated
16+
Cargo.lock linguist-generated
17+
18+
# Node.js bindings
19+
bindings/node/* linguist-generated
20+
binding.gyp linguist-generated
21+
package.json linguist-generated
22+
package-lock.json linguist-generated
23+
24+
# Python bindings
25+
bindings/python/** linguist-generated
26+
setup.py linguist-generated
27+
pyproject.toml linguist-generated
28+
29+
# Go bindings
30+
bindings/go/* linguist-generated
31+
go.mod linguist-generated
32+
go.sum linguist-generated
33+
34+
# Swift bindings
35+
bindings/swift/** linguist-generated
36+
Package.swift linguist-generated
37+
Package.resolved linguist-generated
38+
39+
# Zig bindings
40+
bindings/zig/* linguist-generated
41+
build.zig linguist-generated
42+
build.zig.zon linguist-generated

.gitignore

Lines changed: 62 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,67 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# TypeScript v1 declaration files
45-
typings/
46-
47-
# TypeScript cache
48-
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# npm Lock file
54-
package-lock.json
55-
56-
# Optional eslint cache
57-
.eslintcache
58-
59-
# Microbundle cache
60-
.rpt2_cache/
61-
.rts2_cache_cjs/
62-
.rts2_cache_es/
63-
.rts2_cache_umd/
64-
65-
# Optional REPL history
66-
.node_repl_history
67-
68-
# Output of 'npm pack'
69-
*.tgz
70-
71-
# Yarn Integrity file
72-
.yarn-integrity
73-
74-
# Yarn Lock file
75-
yarn.lock
76-
77-
# dotenv environment variables file
78-
.env
79-
.env.test
80-
81-
# parcel-bundler cache (https://parceljs.org/)
82-
.cache
83-
84-
# Next.js build output
85-
.next
86-
87-
# Nuxt.js build / generate output
88-
.nuxt
89-
dist
90-
91-
# Gatsby files
92-
.cache/
93-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
94-
# https://nextjs.org/blog/next-9-1#public-directory-support
95-
# public
96-
97-
# vuepress build output
98-
.vuepress/dist
99-
100-
# Serverless directories
101-
.serverless/
102-
103-
# FuseBox cache
104-
.fusebox/
105-
106-
# DynamoDB Local files
107-
.dynamodb/
108-
109-
# TernJS port file
110-
.tern-port
111-
112-
# Generated by Cargo
113-
# will have compiled files and executables
114-
debug/
115-
target/
116-
117-
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
118-
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
1+
# Rust artifacts
1192
Cargo.lock
3+
target/
1204

121-
# These are backup files generated by rustfmt
122-
**/*.rs.bk
123-
124-
# Builds
5+
# Node artifacts
1256
build/
7+
prebuilds/
8+
node_modules/
9+
*.tgz
12610

127-
# Examples
128-
examples/
129-
130-
# TODO
131-
Cargo.lock
132-
node_modules
133-
.node-version
134-
build
135-
*.log
136-
/test.js
137-
/examples/npm
11+
# Swift artifacts
12+
.build/
13+
Package.resolved
14+
15+
# Go artifacts
16+
go.sum
17+
_obj/
18+
19+
# Python artifacts
20+
__pycache__/
21+
.venv/
22+
dist/
23+
*.egg-info
24+
*.whl
25+
26+
# C artifacts
27+
*.dSYM/
28+
*.a
29+
*.so
30+
*.so.*
31+
*.dylib
32+
*.dll
33+
*.pc
34+
*.exp
35+
*.lib
36+
37+
# Zig artifacts
38+
.zig-cache/
39+
zig-cache/
40+
zig-out/
41+
42+
# Example dirs
43+
/examples/*/
44+
45+
# Grammar volatiles
46+
*.wasm
47+
*.obj
48+
*.o
49+
50+
# Archives
51+
*.tar.gz
52+
*.zip
53+
54+
# Autogenerated files
55+
build.zig
56+
build.zig.zon
57+
Cargo.toml
58+
CMakeLists.txt
59+
go.mod
60+
Makefile
61+
Package.swift
13862
package-lock.json
139-
/target/
63+
pyproject.toml
64+
setup.py
65+
bindings/
66+
src/*
67+
!src/scanner.c

Cargo.toml

Lines changed: 0 additions & 25 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# `tree-sitter-wgsl`
2+
3+
This repository contains a [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammar for the [WebGPU Shading Language (WGSL)](https://gpuweb.github.io/gpuweb/wgsl/).
4+
5+
Since the repository is a minimal mirror of grammar produced by the upstream specification, it does not contain auto-generated build files. To use the grammar, it is necessary to generate the build files using:
6+
7+
```
8+
# npm install -g [email protected]
9+
tree-sitter init --update
10+
tree-sitter generate
11+
# tree-sitter init-config
12+
# tree-sitter build
13+
```

binding.gyp

Lines changed: 18 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/node/binding.cc

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)