Commit graph

26 commits

Author SHA1 Message Date
Max Brunsfeld
5dbd15f5f2 Loosen criteria for when to increment repeat depth
Sometimes, an internal repeat node may have children that are
not themselves repeat nodes, because of unit reduction elimination.
This happened with the embedded template parser.
2018-11-03 23:19:31 -07:00
Max Brunsfeld
2169c45da9 Store subtree's lookahead byte count relative to its end offset
This improves test coverage for incremental parsing by generalizing
the randomized tests in `real_grammars.cc` to make *multiple* edits
before incrementally re-parsing.
2018-11-02 15:23:38 -07:00
Max Brunsfeld
67a9cb3336 Use pointer address as node id in ts_subtree_print_dot_graph 2018-11-02 15:23:38 -07:00
Max Brunsfeld
3dab0066bc Add missing padding bytes check before storing tree inline 2018-09-19 10:52:21 -07:00
Max Brunsfeld
b29d0f622f Cram terminal subtree data into a 64-bit integer when possible 2018-09-17 18:52:34 -07:00
Max Brunsfeld
e00c3bbdb9 Take more parameters in ts_subtree_new_leaf 2018-09-15 00:08:47 -07:00
Max Brunsfeld
c828ca308f Don't store first_leaf field on leaf nodes 2018-09-14 23:08:15 -07:00
Max Brunsfeld
93926fc82e Don't store node_count and dynamic_precedence for leaf nodes 2018-09-14 11:02:11 -07:00
Max Brunsfeld
c7306722dd Use smaller allocations for normal leaf nodes 2018-09-14 00:48:03 -07:00
Max Brunsfeld
508499bab1 Fix bug where missing token was inserted outside of any included range 2018-09-11 17:41:23 -07:00
Max Brunsfeld
234d020957 Fix invalid access of external_scanner_state on non-terminal subtree
Fixes #199
2018-08-31 10:48:46 -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
d54412266e Avoid mutating the root node for out-of-bounds edits 2018-07-13 16:03:01 -07:00
Max Brunsfeld
0f0adfb681 Avoid recursion in ts_subtree_edit
This prevents stack overflows when editing very large trees.

Co-Authored-By: Ashi Krishnan <queerviolet@github.com>
2018-07-12 13:53:31 -07:00
Max Brunsfeld
34de822738 Re-enable subtree object pool after accidentally disabling it 2018-06-19 16:33:33 -07:00
Max Brunsfeld
b29c5dbf15 Rephrase ts_subtree_array_copy to avoid conspicuous null case
This avoids a false positive error from the clang static analyzer, which
doesn't understand the invariants of the Array type.
2018-06-15 17:07:35 -07:00
Max Brunsfeld
75cf95bddc Fix double free when an external token is copied 2018-06-15 16:18:08 -07:00
Max Brunsfeld
52a5e4125e Revert "Fix another const mismatch warning"
This reverts commit 776230782b.
2018-06-15 13:22:37 -07:00
Max Brunsfeld
4b5dab2d18 Convert keywords back to word token at runtime if needed 2018-06-15 13:15:02 -07:00
Max Brunsfeld
776230782b Fix another const mismatch warning 2018-06-14 12:38:52 -07:00
Max Brunsfeld
074c051094 Change the TSInputEdit struct to work with old/new start and end positions 2018-05-17 11:14:51 -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
20c183b7cd Rename ts_subtree_make_* -> ts_subtree_new_* 2018-05-11 13:02:12 -07:00
Max Brunsfeld
bf1bb1604f Rename TSExternalTokenState -> ExternalScannerState 2018-05-11 12:57:41 -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
Renamed from src/runtime/tree.c (Browse further)