Commit graph

76 commits

Author SHA1 Message Date
Max Brunsfeld
30e73505e1 Fix handling of extra tokens in ts_tree_cursor_current_field_id 2019-09-04 09:04:31 -07:00
Max Brunsfeld
0955c5b3d7 Handle named nodes aliased as anonymous nodes
Fixes #401
2019-08-29 14:28:44 -07:00
Max Brunsfeld
b3ab2e07a2 binding_rust: Generalize the interface to callback-based parse methods
Fixes #386
2019-08-29 10:39:51 -07:00
Tuấn-Anh Nguyễn
d96ba09391 Make Tree::changed_ranges return an Iterator instead of a Vec (#437)
* Make Tree::changed_ranges return an Iterator instead of a Vec

* Remove CBufferIter.free parameter
2019-08-26 19:36:16 -07:00
Max Brunsfeld
8e3ff6376f Upgrade rand, dirs 2019-08-19 17:31:35 -07:00
Max Brunsfeld
0afbc31789 Automatically skip BOM characters at beginnings of files
Refs tree-sitter/tree-sitter-python#48
2019-08-02 12:03:04 -07:00
Max Brunsfeld
a21d355ade Fix handling of potentially overlapping selectors in property sheets 2019-07-22 16:17:10 -07:00
Max Brunsfeld
f4740a1beb Make properties generation aware of which nodes are leaves 2019-07-22 09:30:05 -07:00
Max Brunsfeld
ea515b6967 Fix ts_node_string behavior for anonymous leaf nodes
Refs tree-sitter/py-tree-sitter#8
2019-07-18 12:39:15 -07:00
Max Brunsfeld
f505613af3 Fix bug introduced when optimizing property sheet JSON files 2019-07-17 17:00:25 -07:00
Max Brunsfeld
f64ee1eb75 Fix incorrect handling of field names in property sheets 2019-07-17 14:28:44 -07:00
Max Brunsfeld
7cd1d77c08 Loosen assertion in timeout unit test to avoid spurious CI failures 2019-07-17 14:28:44 -07:00
Max Brunsfeld
bd466febb4 highlight: Fix panic when cancelled before parsing a nested document 2019-07-16 14:34:24 -07:00
Max Brunsfeld
c90a532d8f Update tests to reflect javascript grammar changes 2019-07-10 14:30:43 -05:00
Max Brunsfeld
ead37c29c6 Tighten timeouts in parse timeout tests 2019-06-20 09:57:38 -07:00
Max Brunsfeld
28011b1e60 Add ts_node_is_extra API 2019-06-19 15:58:29 -07:00
Max Brunsfeld
80b785daee Improve behavior of node descendant queries with single positions 2019-06-13 10:53:59 -07:00
Max Brunsfeld
a1682eb81c Handle injection-includes-children in highlighting property sheets 2019-06-11 16:59:33 -07:00
Max Brunsfeld
d274e81d0d Overhaul CLI error handling to allow multiple levels of context 2019-05-30 16:52:55 -07:00
Max Brunsfeld
7bc7306afb Add a unit test for local variable tracking in syntax highlighting 2019-05-10 14:38:43 -07:00
Max Brunsfeld
958ab27efb Update JS highlighting unit test 2019-05-10 10:32:31 -07:00
Max Brunsfeld
d78ac581f3 Rename scope -> highlight in highlighting property sheets
We need to use the word `scope` for a different purpose: tracking local 
scopes.
2019-05-09 09:42:40 -07:00
Max Brunsfeld
572f290ec0 Fix highlighting in the presence of node fields 2019-05-07 11:17:34 -07:00
Max Brunsfeld
58e1a0fee7 In node range queries, treat the end coordinate as exclusive 2019-04-26 13:36:28 -07:00
Max Brunsfeld
701d63dab7 Add --edit flag to parse command 2019-04-08 09:21:03 -07:00
Max Brunsfeld
5035e194ff Merge branch 'master' into node-fields 2019-03-26 11:58:21 -07:00
Max Brunsfeld
0ccb910922 Use a size_t instead of a uint32_t for cancellation flag 2019-03-21 11:26:05 -07:00
Max Brunsfeld
3340168097 Fix backwards logic for cancellation flag 2019-03-20 17:02:07 -07:00
Max Brunsfeld
8941dc1dda Add cancellation flag parameter to highlight API 2019-03-18 09:52:02 -07:00
Max Brunsfeld
0ae304f582 Lib: Rework the API for cancelling a parse
Also, use beta on CI until atomic::AtomicU32 lands in stable.
2019-03-18 09:51:21 -07:00
Jacob Mitchell
15b096d695 Extract graph log validation into a specialized test 2019-03-14 22:21:19 -07:00
Jacob Mitchell
c8d040ca26 Use 1-indexed rows in CLI and log output (resolves #287) 2019-03-14 22:21:19 -07:00
Max Brunsfeld
1aaad66a03
Merge pull request #301 from tree-sitter/clock-based-timeouts
Replace operation limit API with a clock-based timeout API
2019-03-14 16:50:44 -07:00
Max Brunsfeld
9ae594a507 Be more loose with timeout unit test assertions 2019-03-14 15:53:45 -07:00
Max Brunsfeld
006a931ab8 Tests: Prevent array reallocations during ts_stack_print_dot_graph
When debugging a test with 'script/test -D', the DOT-graph generation
code was sometimes causing reallocations that were not captured by the
allocation tracker, because we explicitly disable allocation-tracking
for that method in order to reduce noise when debugging memory leaks.

By growing the relevant array *prior* to turning off allocation
tracking, we can ensure that it is not reallocated within that function,
avoiding false positive memory leak errors.

Fixes #302
2019-03-14 13:59:12 -07:00
Max Brunsfeld
cddb3e416d Replace operation limit API with a clock-based timeout API 2019-03-14 11:13:38 -07:00
Max Brunsfeld
083e813218 Highlight: fix handling of root node injections like in ERB, EJS 2019-03-13 15:51:50 -07:00
Max Brunsfeld
98e4fd22ef Start work on a C API for syntax highlighting 2019-03-08 13:13:02 -08:00
Max Brunsfeld
f52271352b Merge branch 'master' into node-fields 2019-03-05 08:08:05 -08:00
Max Brunsfeld
14b7af3436 highlight: Fix HTML rendering of empty lines 2019-02-22 11:48:29 -08:00
Max Brunsfeld
e239aa8229 highlight: don't include scope in ScopeEnd events
When there are embedded documents, multiple scopes can start or
end at the same position. Previously, there was no guarantee that
the ScopeEnd events would always occur in the reverse order of the
ScopeStart events. The easiest way to avoid exposing inconsistency
is to not surface the scopes being ended.
2019-02-20 16:45:51 -08:00
Max Brunsfeld
a46515b80f Replace LanguageRegistry trait with a simple callback 2019-02-19 17:07:12 -08:00
Max Brunsfeld
e89b6b2402 Add a highlight subcommand 2019-02-19 12:32:03 -08:00
Max Brunsfeld
4f069fbe3b Merge branch 'master' into node-fields 2019-02-14 09:35:47 -08:00
Max Brunsfeld
57c528b6c5 CLI: Determine language symbol from grammar, not package.json
Fixes #272
Fixes #277
2019-02-13 19:31:26 -08:00
Max Brunsfeld
65d1ce8593 lib: Include fields in ts_node_string output
This allows you to assert about fields in tests. But if your test 
s-expression does *not* include fields, the fields will be stripped from 
the regexp before comparison.
2019-02-13 09:47:21 -08:00
Max Brunsfeld
9f608435ee Fix errors in when languages have no fields 2019-02-12 17:20:12 -08:00
Max Brunsfeld
a7206b1b8b Add some assertions to node field test 2019-02-08 16:25:27 -08:00
Max Brunsfeld
1d1674811c Fully implement ts_node_child_by_field_id 2019-02-08 15:16:56 -08:00
Max Brunsfeld
18a13b457d Get basic field API working 2019-02-08 15:16:56 -08:00