Render syntax tree efficiently in docs playground

This commit is contained in:
Max Brunsfeld 2019-04-30 09:52:33 -07:00
parent 3425b6e1c2
commit 73e4db41b0
5 changed files with 284 additions and 185 deletions

View file

@ -461,11 +461,21 @@ class TreeCursor {
return C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0]);
}
get nodeId() {
marshalTreeCursor(this);
return C._ts_tree_cursor_current_node_id_wasm(this.tree[0]);
}
get nodeIsNamed() {
marshalTreeCursor(this);
return C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0]) === 1;
}
get nodeIsMissing() {
marshalTreeCursor(this);
return C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0]) === 1;
}
get startPosition() {
marshalTreeCursor(this);
C._ts_tree_cursor_start_position_wasm(this.tree[0]);