Commit graph

17 commits

Author SHA1 Message Date
Max Brunsfeld
7ccec8c0e2 Tweak wasm binding to work with new upstream LLVM backend 2019-10-21 16:10:29 -07:00
Matthew Krupcale
ee9a3c0ebb lib: remove utf8proc dependency (#436)
* Remove dependency on utf8proc

This removes the only external dependency on utf8proc for UTF-8 decoding. It does so by implementing its own UTF-8 decoder. This decoder is both faster and has a simpler API.

 * .gitmodules: remove utf8proc submodule
 * docs/section-2-using-parsers.md: remove requirement for utf8proc submodule
 * docs/section-6-contributing.md: likewise
 * lib/Cargo.toml: remove utf8proc subdirectory package include
 * lib/README.md: remove utf8proc subdirectory description
 * lib/binding_rust/build.rs: remove utf8proc compiler include directory
 * lib/src/lexer.c: remove utf8proc dependencies and types
 * lib/src/lib.c: remove utf8proc dependency
 * lib/src/unicode.h: define types for Unicode decoders
 * lib/src/utf16.{c,h}: implement more readable UTF-16 decoder
 * lib/src/utf8.{c,h}: implement fast UTF-8 decoder
 * lib/utf8proc: remove utf8proc submodule directory
 * script/build-lib: remove utf8proc compiler include directory
 * script/build-wasm: likewise

* Optimize ts_lexer__get_lookahead.

Try to favor non-failure code path and assign lookahead values directly to lexer

 * lib/src/lexer.c: optimize for non-failure code path

* Fix some compiler errors

 * lib/src/lexer.c: cast from signed to unsigned for decode_next result
 * lib/src/utf16.c: fix non-constant initializers for older compilers

* Remove some missed remnants of utf8proc

 * docs/section-2-using-parsers.md: only two include paths necessary now
 * lib/src/lib.c: no need to define UTF8PROC_STATIC

* Use ICU's utf8 and utf16 decoding routines

* Remove unnecessary casts when calling icu macros

* Check buffer length before attempting to decode a unicode character

* Use new unicode function when parsing Queries

Co-Authored-By: Matthew Krupcale <mkrupcale@matthewkrupcale.com>

* Mark libicu files as vendored for GitHub's stats
2019-10-14 11:18:39 -07:00
Max Brunsfeld
9323ba52c8 Minify function names in wasm build 2019-09-16 11:38:29 -07:00
Max Brunsfeld
7ad087ce27 Tweak compile flags in build-wasm script 2019-09-04 08:54:13 -07:00
Matthew Krupcale
71d96e813f Use Z option for docker-run volume mount
This is necessary on systems with SELinux to prevent file permission/access errors when building WASM output

 * cli/src/wasm.rs: Use Z volume mount option for docker-run
 * script/build-wasm: Likewise.
2019-06-29 15:49:25 -04:00
Paul Young
15bf75a2f9
Fix ALLOW_MEMORY_GROWTH setting
Fixes ERROR:root:ALLOW_MEMORY_GROWTH: No such file or directory ("ALLOW_MEMORY_GROWTH" was expected to be an input file, based on the commandline arguments provided) according to https://emscripten.org/docs/optimizing/Optimizing-Code.html#memory-growth
2019-06-04 17:17:25 -07:00
Max Brunsfeld
70038bd251 Build wasm lib with -O3
There doesn't seem to be much code size difference, but there's
a big performance difference.
2019-05-17 12:50:00 -07:00
Max Brunsfeld
ad43b211f4 Allow building the wasm libs with native emscripten instead of docker
And build them on the mac CI as well as the linux CI
2019-05-14 14:02:22 -07:00
Max Brunsfeld
9a82bd9d83 Set up code to publish web bindings to npm 2019-05-07 13:11:04 -07:00
Max Brunsfeld
3fc459a84b Reorganize language bindings
* Move rust binding: lib/binding -> lib/binding_rust
* Move wasm bindinig: lib/web -> lib/binding_web
* Add wasm readme
2019-05-07 10:41:49 -07:00
Max Brunsfeld
a6a50a6320 Avoid some bloat in wasm build 2019-05-01 12:44:58 -07:00
Max Brunsfeld
3425b6e1c2 Add wasm binding for TreeCursor 2019-04-29 13:20:09 -07:00
Chris Wendt
cff9c16ccc Increase memory limit for language wasm files (continued) 2019-04-28 14:08:40 -07:00
Max Brunsfeld
f3ecafe13b Fix inclusion of libc++ in wasm build 2019-04-27 18:06:34 -07:00
Max Brunsfeld
b4c4dc48ff Minify JS build with terser 2019-04-26 19:52:01 -07:00
Max Brunsfeld
66e006105c Build and test wasm on CI 2019-04-26 14:38:13 -07:00
Max Brunsfeld
1fc0525940 Start work on a WASM binding 2019-04-25 17:27:39 -07:00