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
Max Brunsfeld
9d0835edbf
Return non-const string from ts_node_string
...
The caller should free the string.
2016-01-18 10:27:23 -08:00
Max Brunsfeld
da1bc038e5
Remove nested options structs in Tree
2015-12-22 14:20:58 -08:00
Max Brunsfeld
08d50c25ae
clang-format
2015-12-04 20:56:33 -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
22c76fc71b
Remove TSLength from runtime header
...
Refactor node functions now that character offset and byte offset are stored separately
2015-12-04 10:45:30 -08:00
Max Brunsfeld
b3a6de6dad
Replace node pos/size functions with start/end char/byte functions
2015-12-03 22:59:27 -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
4953182707
add row to node equality
2015-12-02 16:45:20 -05:00
joshvera
7ad82cf684
add const
2015-12-02 16:45:12 -05:00
joshvera
3f9c8b76de
Add padding_point.row to ts_node_start_point's row.
2015-12-02 16:41:16 -05:00
joshvera
3d9a44d880
Calculate the column and offset separately in TSNode
2015-11-25 13:36:19 -05:00
joshvera
2669933d06
Implement ts_find_parent_offset_point
2015-11-25 11:08:44 -05:00
joshvera
8446b657f0
Rename position to offset and point to offset_point
2015-11-18 17:53:38 -08:00
joshvera
cf72f2f0ae
ts_node_size_point
2015-11-18 16:47:27 -08:00
joshvera
eb2a18cf16
s/TSLength/TSPoint
2015-11-18 16:46:09 -08:00
joshvera
6485e27d70
add ts_node_end_point
2015-11-18 16:45:10 -08:00
joshvera
b0f6bac3ab
replace start and end with padding and size
2015-11-18 16:34:50 -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
216ce8c80b
Rename receiver parameter to 'self'
2015-10-14 22:14:08 -07:00
Max Brunsfeld
f37f73f92f
Add ability to edit multiple times between parses
2015-09-18 23:20:06 -07:00
Max Brunsfeld
fe3be2aa53
Optimize Node parent() method
2015-09-09 12:43:35 -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
3e17172f6e
Remove unnecessary conditional
2015-08-16 10:54:02 -07:00
Max Brunsfeld
d910a2d0e7
Rename node position to offset
2015-08-16 10:51:34 -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
d70a7227a1
Don't return invisible nodes from ts_node_find_for_range
2015-08-14 20:10:09 -07:00
Max Brunsfeld
507b7aef00
Remove recursion in ts_node_child
2015-08-14 16:34:12 -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
da7eb1496b
Clean up node.c
2015-08-12 13:41:22 -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
e5ea4efb0b
Use stdbool.h
2014-10-03 16:06:08 -07:00
Max Brunsfeld
c1565c1aae
Track AST nodes' sizes in characters as well as bytes
...
The `pos` and `size` functions for Nodes now return TSLength structs,
which contain lengths in both characters and bytes. This is important
for knowing the number of unicode characters in a Node.
2014-09-26 16:15:07 -07:00
Max Brunsfeld
545e575508
Revert "Remove the separator characters construct"
...
This reverts commit 5cd07648fd .
The separators construct is useful as an optimization. It turns out that
constructing a node for every chunk of whitespace in a document causes a
significant performance regression.
Conflicts:
src/compiler/build_tables/build_lex_table.cc
src/compiler/grammar.cc
src/runtime/parser.c
2014-09-02 08:03:51 -07:00
Max Brunsfeld
5cd07648fd
Remove the separator characters construct
...
Now, grammars can handle whitespace by making it another ubiquitous
token, like comments.
For now, this has the side effect of whitespace being included in the
tree that precedes it. This was already an issue for other ubiquitous
tokens though, so it needs to be fixed anyway.
2014-09-01 20:19:43 -07:00
Max Brunsfeld
a72b79f7f3
Tweak formatting in node.c
2014-08-28 13:30:02 -07:00
Max Brunsfeld
3430a5edcc
Clarify distinction btwn tree padding, tree offset, node position
...
- Node position is public. It represents the node's first character
index in the document.
- Tree offset is private. It represents the distance between the tree's
first character index and it's parent's first character index.
- Tree padding is private. It represents the amount of whitespace
(or other separator characters) immediately preceding the tree.
2014-08-28 13:22:06 -07:00
Max Brunsfeld
117869e49a
Fix position calculation in node_find_for_range
2014-08-25 15:52:17 -07:00
Max Brunsfeld
1535ebd21c
Handle null parent in {next,prev}_sibling
2014-08-25 11:28:09 -07:00
Max Brunsfeld
cef6827182
Add find_for_range function for Nodes
2014-08-25 09:31:27 -07:00
Max Brunsfeld
b1a7886225
Rename node_leaf_at_pos -> node_find_pos
...
It doesn't always return a leaf node, just the smallest node
that spans the given position.
2014-08-25 09:06:51 -07:00