-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support c++03 #1
Conversation
This version leaves me with the following error message:
|
Huh, weird. Guess it doesn't like Do you have a branch, and a command I can run to compile this for wasm? |
Yep, it's right here: https://github.com/wenkokke/tree-sitter-haskell/tree/tree-sitter-haskell-wasm-support-c%2B%2B03 I'm running... make -B node_modules/web-tree-sitter && CXX=g++-11 ./script/parse-examples wasm ...to rebuild a patched version of tree-sitter and run the wasm tests. |
I am making progress however by using |
I was wrong, the following patch is enough: --- a/lib/binding_web/exports.json
+++ b/lib/binding_web/exports.json
@@ -3,6 +3,11 @@
"_free",
"_malloc",
+ "__ZTTNSt3__219basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE",
+ "__ZTVNSt3__219basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE",
+ "__ZTVNSt3__29basic_iosIcNS_11char_traitsIcEEEE",
+ "__ZNSt3__25ctypeIcE2idE",
+
"__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm",
"__ZNKSt3__220__vector_base_commonILb1EE20__throw_length_errorEv",
"__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm", Unfortunately, that still means a patch is needed. |
This error was because I was accidentally running a version of web-tree-sitter compiled without |
However, I can report that this runs without any problems on macOS: npx tree-sitter parse [file] # works!
npx tree-sitter test # works!
npx tree-sitter build-wasm # works, but requires patched web-tree-sitter So patch or no patch, it's probably still worth merging to get proper macOS support. |
* Fix tree-sitter#53: updated PR after Faster Scanner merge * Fix usage in script/tree-sitter-parse.js
# Conflicts: # src/scanner.cc
@wenkokke I've removed ostringstream. Maybe |
I'm going to create a PR upstream, because it's quite helpful in terms of portability eg. We can deal with the remaining wasm patch, if there is one, separately. |
see tree-sitter#58 |
I'm making this a separate PR, as I'm not 100% sure I haven't messed up unicode support.
@tek are there tests that include unicode? Specifically on the
symop
codepath?@wenkokke do you want to try compiling this branch to wasm?