Commit graph

93 commits

Author SHA1 Message Date
Max Brunsfeld
08d50c25ae clang-format 2015-12-04 20:56:33 -08:00
Max Brunsfeld
27bce56ef2 Merge pull request #12 from maxbrunsfeld/api-cleanup
Clean up API a bit after the addition of row/column tracking
2015-12-04 20:41:20 -08:00
Max Brunsfeld
d2bf88d5fe Include rows and columns in TSLength
This way, we don't have to have separate 1D and 2D versions for so many values
2015-12-04 20:20:29 -08:00
Max Brunsfeld
8939bd549d Fix named child count computation
Signed-off-by: Josh Vera <vera@github.com>
2015-12-04 15:51:04 -08:00
Max Brunsfeld
863cabc827 Don't include trailing ubiquitous tokens as children when reducing 2015-12-02 15:31:15 -08:00
Max Brunsfeld
f08554e958 Replace NodeType enum with SymbolMetadata bitfield
This will allow storing other metadata about symbols, like if they
only appear as ubiquitous tokens
2015-12-02 15:10:24 -08:00
joshvera
e52c38a68f Work correctly when node's offset point is zero 2015-12-02 17:12:32 -05:00
joshvera
5e748fdf63 s/ts_tree_offset_point/ts_tree_total_size_point 2015-12-02 16:41:56 -05:00
joshvera
e674094f64 Sum the offset_point like offset in ts_tree_assign_parents 2015-12-02 16:41:40 -05:00
joshvera
88d3432787 Merge remote-tracking branch 'joshvera/line-numbers' into line-numbers 2015-11-30 13:06:54 -05:00
joshvera
7633cbb836 indentation 2015-11-30 12:59:23 -05:00
joshvera
f5fc247c8b Merge remote-tracking branch 'origin/master' into line-numbers 2015-11-30 12:36:11 -05:00
joshvera
3d9a44d880 Calculate the column and offset separately in TSNode 2015-11-25 13:36:19 -05:00
joshvera
4663b9ce89 Add padding and size points to ts_tree_make_leaf in ts_lexer__accept 2015-11-25 11:44:13 -05:00
joshvera
ad58b752e6 Rename ts_tree_total_size_point to ts_tree_offset_point 2015-11-25 11:28:28 -05:00
joshvera
2669933d06 Implement ts_find_parent_offset_point 2015-11-25 11:08:44 -05:00
Max Brunsfeld
5c95d02bd0 Move ts_tree_compare to the right file 2015-11-20 11:53:03 -08:00
joshvera
8446b657f0 Rename position to offset and point to offset_point 2015-11-18 17:53:38 -08:00
joshvera
b0f6bac3ab replace start and end with padding and size 2015-11-18 16:34:50 -08:00
Max Brunsfeld
484721b0c2 Assign tree parent pointers after parse is complete 2015-11-15 12:21:16 -08:00
joshvera
8058500c5b Add source info to TSTree 2015-11-12 15:32:53 -05:00
Max Brunsfeld
36eae5d5e9 Add option to tree_string to include anonymous tokens 2015-10-28 12:09:28 -07:00
Max Brunsfeld
1829b34c6f Fix child count error when documents starts w/ ubiquitous tokens 2015-10-24 13:45:42 -07:00
Max Brunsfeld
216ce8c80b Rename receiver parameter to 'self' 2015-10-14 22:14:08 -07:00
Max Brunsfeld
e7838d520a Remove invalid assertion in ts_tree_edit 2015-09-22 21:02:25 -07:00
Max Brunsfeld
b3d883e128 Store edits in trees, not by splitting stack
This allows for multiple edits per parse, though it is not exposed through
the API yet
2015-09-18 22:02:06 -07:00
Max Brunsfeld
0467d190fe Add ts_tree_edit function 2015-09-18 22:02:06 -07:00
Max Brunsfeld
7ee5eaa16a Rename node accessor methods
Instead of child() vs concrete_child(), next_sibling() vs next_concrete_sibling(), etc,
the default is switched: child() refers to the concrete syntax tree, and named_child()
refers to the AST. Because the AST is abstract through exclusion of some nodes, the
names are clearer if the qualifier goes on the AST operations
2015-09-08 23:16:24 -07:00
Max Brunsfeld
245daffbc4 Add {next,prev}_concrete_sibling Node methods 2015-09-08 21:43:37 -07:00
Max Brunsfeld
c3f3f19ea8 Add concrete_child and concrete_child_count Node methods 2015-09-08 09:53:26 -07:00
Max Brunsfeld
f9316933ad Refactor logic for marking '_'-prefixed rules as hidden 2015-09-06 16:53:13 -07:00
Max Brunsfeld
9591c88f39 In runtime, distinguish between anonymous and hidden nodes 2015-09-06 00:12:37 -07:00
Max Brunsfeld
53926c467e Don't automatically hide singleton nodes 2015-09-02 16:36:29 -07:00
Max Brunsfeld
21258e6a9e Remove 'document' wrapper node 2015-08-22 10:48:34 -07:00
Max Brunsfeld
6933d7b425 🎨 naming conventions 2015-08-16 20:05:47 -07:00
Max Brunsfeld
553ef6674f Rename TreeOptionsWrapper -> TreeOptionsSingleton 2015-08-16 10:32:12 -07:00
Max Brunsfeld
b853e0f2eb 🎨 node.c 2015-08-16 10:27:26 -07:00
Max Brunsfeld
a5d73ed676 Store indices on nodes to speed up traversal methods 2015-08-15 23:35:20 -07:00
Max Brunsfeld
25af9a3adf Don't store visible children on trees 2015-08-14 16:11:37 -07:00
Max Brunsfeld
8a9626bfc5 Simplify storage of position on nodes 2015-08-14 14:48:29 -07:00
Max Brunsfeld
54e40b8146 Rework AST access API: reduce heap allocation 2015-07-31 15:47:48 -07:00
Max Brunsfeld
f9b057f3a9 clang-format everything 2015-07-27 18:29:48 -07:00
Max Brunsfeld
0b1d70db34 Always resolve ambiguities immediately
No more ambiguity nodes.
Also, when merging parse stacks, merge their successors if needed.
2015-07-15 13:15:11 -07:00
Max Brunsfeld
aff8bc3266 Split parse stack when there are multiple parse actions 2015-07-09 23:09:33 -07:00
Max Brunsfeld
aaaa1c8a5d Encapsulate ParseStackNodes 2015-06-18 17:03:17 -07:00
Max Brunsfeld
381f89f8ba Create ambiguity nodes when joining stack heads 2015-06-18 17:03:16 -07:00
Max Brunsfeld
3d0890eecf Preserve tokens within errors 2015-06-15 15:26:06 -07:00
Max Brunsfeld
59fd190695 Don't store lookahead_char field for non-error nodes 2015-05-24 14:43:54 -07:00
Max Brunsfeld
a92067702d Use a more exact test for reusability of error nodes
Based on the concept of node fragility from wagner's incremental
parsing paper
2015-02-21 10:39:58 -08:00
Max Brunsfeld
3bc4971fd5 Don't reuse any nodes that contain an error as a child node 2014-10-23 12:50:37 -07:00