Commit graph

2515 commits

Author SHA1 Message Date
Max Brunsfeld
d274e81d0d Overhaul CLI error handling to allow multiple levels of context 2019-05-30 16:52:55 -07:00
Max Brunsfeld
b7bc2d30ae
Merge pull request #345 from tree-sitter/delete_nulls_safely
Make ts_tree_delete and ts_parser_delete NULL-safe.
2019-05-30 13:01:56 -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
5bb06682d5 Allow dynamically loading grammars w/ no package.json file 2019-05-30 12:05:53 -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
da93e55f3a In benchmarks, handle language repos that contain multiple grammars
Refs tree-sitter/tree-sitter-typescript#68
2019-05-30 10:17:27 -07:00
Patrick Thomson
6e2a60629c Make ts_tree_delete and ts_parser_delete NULL-safe.
Historically, `free(3)`-style functions have been NULL-safe, to make
resource handling functions more robust. This doesn't seem to be the
case with tree-sitter's `ts_tree_delete` and `ts_parser_delete` C
functions, which immediately dereference the passed pointer. This
leads to complexity in client libraries that have to ensure that trees
and parsers are cleaned up correctly.

This patch adds NULL checks to `parse_delete` and `tree_delete`. They
should have negligable performance impacts, since null checks are fast.

I didn't change the internal _delete functions, as arguably those
being NULL-unsafe is a feature, not a bug.
2019-05-30 11:47:56 -04:00
Max Brunsfeld
659f2825ba
Merge pull request #342 from georgewfraser/patch-1
Add type definitions
2019-05-28 15:31:23 -07:00
George Fraser
0fe67dc8b4 Dedent 2019-05-28 23:01:41 +01:00
Max Brunsfeld
6055108936 Wasm: 0.15.3 2019-05-28 13:00:17 -07:00
Max Brunsfeld
068f7b1a0c Wasm: Throw an exception if Parser is constructed before init() resolves 2019-05-28 12:59:00 -07:00
George Fraser
d4597e14f4
Reference tree-sitter-web.d.ts in package.json 2019-05-27 15:10:43 +01:00
George Fraser
a0d0ba9709
Add type definitions
This is based on https://github.com/tree-sitter/node-tree-sitter/blob/master/tree-sitter.d.ts with slight modifications because web-tree-sitter has a slightly different interface than node-tree-sitter
2019-05-27 15:08:29 +01:00
Max Brunsfeld
621efeb543
Merge pull request #340 from fdionisi/fix/is-point
Ensure Point has `column` typeof number field
2019-05-24 07:35:00 -07:00
Federico
51345f3ea2 Ensure Point has column typeof number field 2019-05-24 14:34:04 +02:00
Max Brunsfeld
3ec91a8d8a Wasm: When in node, use fs APIs to load language wasm files
Fixes #338
2019-05-23 16:12:32 -07:00
Max Brunsfeld
ae41a78d3c Discard local emsdk changes when fetching emscripten on CI 2019-05-22 10:41:19 -07:00
Max Brunsfeld
2cbcd2b7b0
Merge pull request #336 from ccharles/reorder-doc-objects-for-consistency
Reorder objects in documentation for clarity
2019-05-21 09:03:55 -07:00
Chris Charles
9ce9a53298 Reorder objects in documentation for consistency
The documentation lists four types of objects, the C names for them,
and a summary for each. These are now shown in the same order.
2019-05-21 07:52:23 -04: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
23c6d78674 Fix presentation of missing nodes in parse command 2019-05-15 16:25:53 -07:00
Max Brunsfeld
af168d05ac
Merge pull request #333 from tree-sitter/avoid-redundant-repeat-rules
Avoid introducing certain auxiliary repeat rules in hidden rules
2019-05-15 13:45:14 -07:00
Max Brunsfeld
9674df0c54 Avoid introducing certain auxiliary repeat rules in hidden rules 2019-05-15 12:36:54 -07:00
Max Brunsfeld
ca2033984c
Merge pull request #332 from tree-sitter/web-command
Add a `web-ui` command for interactively debugging parsers in the web browser
2019-05-14 16:43:52 -07:00
Max Brunsfeld
a008ce63e6 Don't include wasm library in the CLI binary on windows 2019-05-14 15:51:12 -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
a1ed12f4f4 Start work on web UI command 2019-05-13 21:51:17 -07:00
Max Brunsfeld
7bc7306afb Add a unit test for local variable tracking in syntax highlighting 2019-05-10 14:38:43 -07:00
Max Brunsfeld
cc50f4357b Add missing enumerator in C header for highlighting 2019-05-10 14:38:19 -07:00
Max Brunsfeld
7a511f82ac
Merge pull request #331 from tree-sitter/track-locals-for-highlighting
In syntax-highlighting library, add support for tracking local variables
2019-05-10 12:28:43 -07:00
Max Brunsfeld
958ab27efb Update JS highlighting unit test 2019-05-10 10:32:31 -07:00
Max Brunsfeld
e648dc8616 Rename TSHighlightScope -> TSHighlightValue 2019-05-10 10:06:05 -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
0d70b485c0 Implement Wasm binding for Tree.getChangedRanges() 2019-05-09 23:52:57 -07:00
Max Brunsfeld
b25af0f05f Fix property state merging bug 2019-05-09 20:34:34 -07:00
Max Brunsfeld
a7d02e7276 Add support for highlight properties that track local variables 2019-05-09 20:34:34 -07:00
Max Brunsfeld
d78ac581f3 Rename scope -> highlight in highlighting property sheets
We need to use the word `scope` for a different purpose: tracking local 
scopes.
2019-05-09 09:42:40 -07:00
Max Brunsfeld
31c2086273 🎨 Refactor TreePropertyCursor 2019-05-09 09:40:15 -07:00
Max Brunsfeld
7de4985a27
Merge pull request #330 from andycraig/update-file-locations-in-docs
Update doc example program file locations
2019-05-08 08:41:39 -07:00
Andrew Craig
bcc823984e Update doc example program file locations
Update doc example program compilation instructions to be consistent
with directory structure.
2019-05-08 21:03:16 +09:00
Max Brunsfeld
9fc058656c In binding_web, use prepublishOnly, not prepublish 2019-05-07 13:24:29 -07:00
Max Brunsfeld
9a82bd9d83 Set up code to publish web bindings to npm 2019-05-07 13:11:04 -07:00
Max Brunsfeld
572f290ec0 Fix highlighting in the presence of node fields 2019-05-07 11:17:34 -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
a3ceb8f3a5
Add link to Strange Loop talk in main docs page 2019-05-07 09:23:52 -07:00
Max Brunsfeld
a0390218a8 Give playground page a more specific title 2019-05-01 14:11:58 -07:00
Max Brunsfeld
a6a50a6320 Avoid some bloat in wasm build 2019-05-01 12:44:58 -07:00
Max Brunsfeld
7d1aa10f73 Update generated binding.cc to use newer NAN APIs 2019-04-30 17:23:36 -07:00
Max Brunsfeld
67fa9bdf4d
Use https README docs site link 2019-04-30 13:00:27 -07:00
Max Brunsfeld
73e4db41b0 Render syntax tree efficiently in docs playground 2019-04-30 11:55:30 -07:00