Commit graph

71 commits

Author SHA1 Message Date
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
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