Max Brunsfeld
b29d0f622f
Cram terminal subtree data into a 64-bit integer when possible
2018-09-17 18:52:34 -07:00
Max Brunsfeld
77e4caef4f
Revert "Store trees' children in TreeArrays, not w/ separate pointer and length"
...
This reverts commit 09be0b6ef5 .
2018-08-31 10:41:06 -07:00
Max Brunsfeld
068c9841a1
Fix bug in ts_node_prev_sibling w/ empty nodes
2018-08-30 20:19:26 -07:00
Max Brunsfeld
9e8bec458d
Add ts_node_edit API
2018-07-11 16:17:46 -07:00
Max Brunsfeld
35ed21139c
Declare the tree field of TSNode with a type of TSTree
...
This field doesn't need to be treated as opaque.
Co-Authored-By: Ashi Krishnan <queerviolet@github.com>
2018-06-21 12:53:17 -07:00
Max Brunsfeld
6e72c2943d
Avoid missing field initializer warnings w/o default field syntax
...
The default field syntax aint working on windows
2018-06-14 11:12:04 -07:00
Max Brunsfeld
f3014cb767
Cache parent nodes to speed up ts_node_parent in common cases
2018-05-29 16:00:32 -07:00
Max Brunsfeld
babb8261a3
Extract an iterator from TreeCursor methods
2018-05-22 14:43:21 -07:00
Max Brunsfeld
80630ce504
Store nodes' public-facing positions, not pre-padding positions
2018-05-22 08:50:04 -07:00
Max Brunsfeld
95be6e3bee
Make it clear which field of TSNode can be used as a unique id
2018-05-16 16:20:33 -07:00
Max Brunsfeld
e3670be42f
Avoid one heap allocation when instantiating a TSTreeCursor
2018-05-16 16:05:08 -07:00
Max Brunsfeld
6fc8d9871c
Hide the details of TSNode's fields in the public API
2018-05-16 15:44:04 -07:00
Max Brunsfeld
fe53506175
Declare subtrees as const wherever possible
...
Co-Authored-By: Rick Winfrey <rewinfrey@github.com>
2018-05-11 15:06:13 -07:00
Max Brunsfeld
e75ecd1bb1
Rework API completely
2018-05-11 10:46:13 -07:00
Max Brunsfeld
35510a612d
Rename Tree -> Subtree
2018-05-10 15:11:14 -07:00
Max Brunsfeld
92255bbfdd
Remove document parameter from ts_node_type, ts_node_string
...
Co-Authored-By: Rick Winfrey <rewinfrey@github.com>
2018-05-09 15:28:28 -07:00
Max Brunsfeld
19e3750f13
Make ts_node_next_sibling work more like ts_node_prev_sibling
...
Co-Authored-By: Rick Winfrey <rewinfrey@github.com>
2018-05-09 13:46:46 -07:00
Max Brunsfeld
f857d64d54
Avoid recursion in ts_node__prev_sibling
2018-05-09 13:23:47 -07:00
Max Brunsfeld
973e4a44f0
Start work on removing parent pointers
...
Co-Authored-By: Rick Winfrey <rewinfrey@github.com>
2018-05-09 12:22:19 -07:00
Max Brunsfeld
09be0b6ef5
Store trees' children in TreeArrays, not w/ separate pointer and length
2018-04-06 13:26:18 -07:00
Max Brunsfeld
0810971f3e
🔥 symbol iterator API
...
This idea was never fully baked.
2018-03-08 14:16:37 -08:00
Max Brunsfeld
315dff3285
Add an API for getting a node's child index
2018-01-09 14:01:36 -08:00
Max Brunsfeld
f653f2b3bb
Add ts_node_first_{child,named_child}_for_byte methods
2018-01-09 13:44:59 -08:00
Max Brunsfeld
d3c85f288d
Start work on repairing errors by inserting missing tokens
2017-12-29 15:11:00 -08:00
Max Brunsfeld
eee3db08d2
Avoid repeated calls to {start,end}_point in descendant_for_point_range
2017-12-27 11:55:52 -08:00
Max Brunsfeld
0e69da37a5
Return a character count from the lexer's get_column method
2017-12-20 16:26:38 -08:00
Max Brunsfeld
09f4796f6b
Get tests passing w/ new alias API
2017-08-01 14:35:34 -07:00
Max Brunsfeld
cb5fe80348
Rename RENAME rule to ALIAS, allow it to create anonymous nodes
2017-07-31 16:41:11 -07:00
Max Brunsfeld
f33421c53e
Fix incorrect node renames in the presence of extra tokens
2017-07-18 21:24:34 -07:00
Max Brunsfeld
afb499bf2e
Handle rename symbols in ts_language APIs
2017-07-18 12:01:52 -07:00
Max Brunsfeld
4b40a1ed6c
Support anonymous tokens inside of RENAME rules
2017-07-14 10:19:58 -07:00
Max Brunsfeld
b3a72954ff
Introduce RENAME rule type
2017-07-13 17:17:22 -07:00
Max Brunsfeld
17bc3dfaf7
Add a benchmark command
...
This command measures the speed of parsing each grammar's examples.
It also uses each grammar to parse all of the *other* grammars' examples
in order to measure error recovery performance with fairly large files.
2017-07-05 14:14:38 -07:00
Max Brunsfeld
2b3da512a4
Add serialize, deserialize and reset callbacks to external scanners
...
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-12-20 13:12:01 -08:00
Max Brunsfeld
535879a2bd
Represent byte, char and tree counts as 32 bit numbers
...
The parser spends the majority of its time allocating and freeing trees and stack nodes.
Also, the memory footprint of the AST is a significant concern when using tree-sitter
with large files. This library is already unlikely to work very well with source files
larger than 4GB, so representing rows, columns, byte lengths and child indices as
unsigned 32 bit integers seems like the right choice.
2016-11-14 12:19:13 -08:00
Max Brunsfeld
c9dcb29c6f
Remove the TS prefix from some internal type/function names
2016-11-09 20:59:05 -08:00
Max Brunsfeld
eed54d95e1
Merge branch 'master' into changed-ranges
2016-10-16 21:10:25 -07:00
Max Brunsfeld
e149d94ff5
Remove generated parsers' dependency on runtime.h
2016-10-05 14:02:49 -07:00
Max Brunsfeld
cc62fe0375
Represent Lengths in terms of Points
2016-09-09 21:11:02 -07:00
Max Brunsfeld
a6a08dde31
Rename ts_node_name -> ts_node_type
2016-09-06 21:43:59 -07:00
Max Brunsfeld
f6da44fdbb
Add ts_node_descendant_for_byte_range
2016-09-06 21:33:19 -07:00
Max Brunsfeld
70756034f1
Allow descendant queries by both 1D and 2D coordinates
2016-09-06 21:17:26 -07:00
Max Brunsfeld
1c66d90203
Mark repeat symbols as anonymous
2016-07-17 10:44:08 -07:00
Max Brunsfeld
1fb6065f02
Move tree sexp function back to tree, for easier use in debugger
2016-04-24 00:09:32 -07:00
Max Brunsfeld
5ba40f15ad
Rename stack heads to versions
2016-04-04 12:25:57 -07:00
Max Brunsfeld
eb47edb446
Add static function for stringifying nodes including hidden ones
2016-04-03 23:45:43 -07:00
Max Brunsfeld
e0c24e3be6
Remove old error recovery code
2016-03-02 20:58:39 -08:00
Max Brunsfeld
b36143d7a7
Add flag for logging dot graphs of the stack while parsing
2016-02-23 09:45:27 -08:00
Max Brunsfeld
2b35890bbb
Add ts_node_symbols() function
2016-02-19 15:41:30 -08:00
Max Brunsfeld
df1d9b2416
Move sexp-generation code to node.c
2016-02-19 15:41:09 -08:00