Skip to content

Commit

Permalink
gen: build wasm bindings (#16)
Browse files Browse the repository at this point in the history
While WASM bindings are slower than native bindings, its better than
having to re-build a binary for every platform (ie. in the VSCode
extension you also even have to worry about electron versions).
  • Loading branch information
xTVaser authored Jun 1, 2024
1 parent 2e3b71e commit 485faa1
Show file tree
Hide file tree
Showing 7 changed files with 465 additions and 570 deletions.
3 changes: 3 additions & 0 deletions bindings/rust/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ fn main() {
.flag_if_supported("-Wno-unused-parameter")
.flag_if_supported("-Wno-unused-but-set-variable")
.flag_if_supported("-Wno-trigraphs");
#[cfg(target_env = "msvc")]
c_config.flag("-utf-8");

let parser_path = src_dir.join("parser.c");
c_config.file(&parser_path);

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "tree-sitter-opengoal",
"version": "1.0.0",
"version": "1.0.1",
"description": "A tree sitter parser for the OpenGOAL language",
"main": "bindings/node",
"types": "bindings/node",
"scripts": {
"gen": "yarn tree-sitter generate",
"wasm": "yarn tree-sitter build --wasm",
"test": "yarn tree-sitter generate && yarn tree-sitter test",
"parse-sample": "yarn gen && yarn tree-sitter parse test/samples/sample.gc",
"parse-test": "yarn gen && yarn tree-sitter parse test/samples/test.gc",
Expand All @@ -27,7 +28,7 @@
"node-gyp-build": "^4.8.0"
},
"peerDependencies": {
"tree-sitter": "^0.21.0"
"tree-sitter": "^0.21.1"
},
"peerDependenciesMeta": {
"tree_sitter": {
Expand All @@ -36,7 +37,7 @@
},
"devDependencies": {
"prebuildify": "^6.0.0",
"tree-sitter-cli": "^0.22.1"
"tree-sitter-cli": "^0.22.6"
},
"files": [
"grammar.js",
Expand Down
Loading

0 comments on commit 485faa1

Please sign in to comment.