Merge pull request #1913 from J3RN/browser-fixes
Allow web-tree-sitter to work with Emscripten 3
This commit is contained in:
commit
b31f9e6e90
4 changed files with 8 additions and 1 deletions
|
|
@ -1 +1 @@
|
|||
2.0.24
|
||||
3.1.25
|
||||
|
|
|
|||
|
|
@ -83,6 +83,8 @@ pub fn compile_language_to_wasm(language_dir: &Path, force_docker: bool) -> Resu
|
|||
"-s",
|
||||
"NODEJS_CATCH_EXIT=0",
|
||||
"-s",
|
||||
"NODEJS_CATCH_REJECTION=0",
|
||||
"-s",
|
||||
&format!("EXPORTED_FUNCTIONS=[\"_tree_sitter_{}\"]", grammar_name),
|
||||
"-fno-exceptions",
|
||||
"-I",
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
"__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev",
|
||||
"__ZdlPv",
|
||||
"__Znwm",
|
||||
"___cxa_atexit",
|
||||
"_abort",
|
||||
"_iswalnum",
|
||||
"_iswalpha",
|
||||
|
|
@ -24,6 +25,7 @@
|
|||
"_memcmp",
|
||||
"_memcpy",
|
||||
"_memmove",
|
||||
"_memset",
|
||||
"_strlen",
|
||||
"_towupper",
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,8 @@ fi
|
|||
|
||||
mkdir -p target/scratch
|
||||
|
||||
runtime_methods='stringToUTF16','AsciiToString'
|
||||
|
||||
# Use emscripten to generate `tree-sitter.js` and `tree-sitter.wasm`
|
||||
# in the `target/scratch` directory
|
||||
$emcc \
|
||||
|
|
@ -88,6 +90,7 @@ $emcc \
|
|||
-s NODEJS_CATCH_EXIT=0 \
|
||||
-s NODEJS_CATCH_REJECTION=0 \
|
||||
-s EXPORTED_FUNCTIONS=@${web_dir}/exports.json \
|
||||
-s EXPORTED_RUNTIME_METHODS=$runtime_methods \
|
||||
$emscripten_flags \
|
||||
-fno-exceptions \
|
||||
-std=c99 \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue