Commit graph

205 commits

Author SHA1 Message Date
Max Brunsfeld
e3ba701344 Start work on handling unicode property escapes in regexes 2021-01-29 16:37:45 -08:00
Max Brunsfeld
2699c01ab1 Use latest emscripten on CI 2020-12-01 11:04:06 -08:00
Max Brunsfeld
18980b7b99 wasm: Avoid registering uncaught exception/rejection handlers 2020-12-01 11:04:06 -08:00
Max Brunsfeld
751ffd2ee1 Use new emscripten when building with docker 2020-12-01 11:04:06 -08:00
Max Brunsfeld
b118e7d750 Make binding.js syntactically valid
Put the end of the surrounding closure into a separate file, suffix.js.
2020-11-30 15:28:26 -08:00
Max Brunsfeld
533aaa462b Add heap-profiling script 2020-10-23 13:20:57 -07:00
Max Brunsfeld
297e2bcb28 static query analysis: Fix handling of fields in hidden nodes 2020-09-23 16:55:48 -07:00
Max Brunsfeld
4b9db41584 Remove unnecessary echo in test script 2020-09-02 09:17:48 -07:00
Max Brunsfeld
456b1f6771 Fix handling of alternations and optional nodes in query analysis 2020-08-20 16:28:54 -07:00
Max Brunsfeld
a317199215 Add query construction to benchmark 2020-06-26 15:05:27 -07:00
Max Brunsfeld
7b39420de3 Make it easy to build with address sanitizer in test script 2020-05-18 12:00:57 -07:00
Max Brunsfeld
61814b468d Remove build-lib script, recommend make 2020-05-12 16:28:26 -07:00
Max Brunsfeld
96bdcfcf57 mac CI: Use newer emscripten 2020-05-12 16:18:20 -07:00
Max Brunsfeld
ee46218a73 Fix incremental parsing problem with non-terminal extras
Also add PHP grammar as a fixture to test against.
2020-03-02 14:17:12 -08:00
Max Brunsfeld
96c060fc6d wasm: Fix typo in Node.typeId 2020-02-21 17:06:07 -08:00
Max Brunsfeld
7de36a33eb Remove halt_on_error API 2020-01-27 15:36:09 -08:00
Max Brunsfeld
3f109a3cb5 highlight: Fix logic for handling empty injections with no highlights 2020-01-27 12:32:37 -08:00
Max Brunsfeld
cf5a6c0b9f Test against branches of language repos w/ new injection queries 2020-01-16 12:49:00 -08:00
Patrick Thomson
39bfcdf595 Fix build with MinGW tooling. (#514)
Courtesy of @Eli-Zaretskii, these fixes should unblock people from
building tree-sitter with MinGW.

I don't think this is an unreasonable maintenance burden, especially
given the Emacs project's interest in using tree-sitter, but
@maxbrunsfeld gets the final call.
2020-01-06 09:21:40 -08:00
Phil Turnbull
1a9c68aebf
Run highlighting logic in fuzzer 2019-10-24 10:44:34 -04:00
Max Brunsfeld
ddd3dc2d6d Use emscripten 1.39.0 on mac CI 2019-10-21 16:40:44 -07:00
Max Brunsfeld
7ccec8c0e2 Tweak wasm binding to work with new upstream LLVM backend 2019-10-21 16:10:29 -07:00
Max Brunsfeld
c49afd5536 Return to using master branches of grammar repos for testing 2019-10-17 15:27:03 -07:00
Max Brunsfeld
060e00463d Implement include-children directive in injection queries 2019-10-14 17:38:42 -07:00
Max Brunsfeld
b3809274f0 Load highlight queries correctly in highlight unit tests 2019-10-14 17:24:16 -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
0d913dec65 Fix layout issues in web-ui 2019-09-13 15:19:31 -07:00
Max Brunsfeld
7ad087ce27 Tweak compile flags in build-wasm script 2019-09-04 08:54:13 -07:00
Max Brunsfeld
3ac0ff2a11 Fix error in build-lib script 2019-08-30 22:07:32 -07:00
Max Brunsfeld
c5fc9d7dcb Remove existing static library in build-lib script 2019-08-29 14:30:45 -07:00
Max Brunsfeld
84c3bf1dd9 Make scripts work when repo path contains spaces 2019-08-12 15:13:41 -07:00
Max Brunsfeld
8cdc903d0f Print emcc version after installing emscripten 2019-08-08 10:56:48 -07:00
Max Brunsfeld
85de177524 Pin emscripten to 1.38.40 for macOS CI
See https://github.com/emscripten-core/emscripten/pull/9143
2019-08-08 10:23:17 -07:00
Max Brunsfeld
7005d8b9d9 Avoid printing names of all skipped tests in benchmark script 2019-08-06 12:46:46 -07:00
Max Brunsfeld
8083ae6602 benchmark: Parse each sample a configurable number of times
Refs #343
2019-08-02 12:04:31 -07:00
Max Brunsfeld
d84e6fafdd
Merge pull request #375 from mkrupcale/wasm-docker-selinux
Use Z option for docker-run volume mount
2019-07-16 15:10:42 -07:00
Max Brunsfeld
34de25ce54 Test against latest version of all fixture repos 2019-07-10 15:18:10 -05: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
Max Brunsfeld
177ba49e57 Add script for dumping the sizes of each symbol in a dynamic library 2019-06-16 11:17:53 -07: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
f5163126c8 generate-fixtures-wasm: handle language repos w/ multiple grammars
Refs tree-sitter/tree-sitter-typescript#68
2019-05-30 12:34:03 -07:00
Max Brunsfeld
314f3fa00c generate-fixtures: handle language repos that contain multiple grammars
Refs tree-sitter/tree-sitter-typescript#68
2019-05-30 12:00:12 -07:00
Max Brunsfeld
ae41a78d3c Discard local emsdk changes when fetching emscripten on CI 2019-05-22 10:41:19 -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
b069e75149 Use branches of fixture repos with the new highlight API 2019-05-10 09:18:39 -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