Max Brunsfeld
e75ecd1bb1
Rework API completely
2018-05-11 10:46:13 -07:00
Max Brunsfeld
facafcd6e4
Pass row/column position to input seek method
2018-02-14 07:31:49 -08:00
Max Brunsfeld
2625c3a96c
Remove dead code in string_input.c
2017-12-27 10:34:29 -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
c66fddd3aa
Add TSInput option to measure columns in bytes not characters
2017-06-15 16:35:34 -07:00
Rob Rix
638aa87e42
Pass through to ts_string_input_make_with_length.
2017-02-10 09:27:21 -05:00
Rob Rix
eab518e5da
Semicolon shame.
2017-02-10 09:20:58 -05:00
Rob Rix
e6927238e1
Construct TSStringInput with explicit length.
2017-02-10 09:10:06 -05: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
38241d466b
Rename .read_fn, .seek_fn -> .read, .seek
2016-09-06 21:39:10 -07:00
Max Brunsfeld
3d7df851b5
Rename Vector -> Array
2016-02-17 20:41:29 -08:00
Max Brunsfeld
3f08bfb264
Fix build warnings
2016-02-12 14:11:11 -08:00
Max Brunsfeld
c96c4a08e6
Use an object pool for stack nodes, to reduce allocations
...
Also, fix some leaks in the case where memory allocation failed during parsing
2016-02-04 11:19:42 -08:00
Max Brunsfeld
87316f22f3
Wrap all calls to malloc and friends
2016-01-15 15:27:50 -08:00
Max Brunsfeld
8e217f758c
Use individual args instead of TSLength in input seek function
2015-12-03 23:06:01 -08:00
Max Brunsfeld
ebd60213d9
Drop release functions from callback structs
...
The caller can just as easily take care of the cleanup explicitly
2015-09-08 23:24:33 -07:00
Max Brunsfeld
f9b057f3a9
clang-format everything
2015-07-27 18:29:48 -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
03a5a97992
Move StringInput into its own file
2014-08-01 12:43:14 -07:00