Commit graph

520 commits

Author SHA1 Message Date
Max Brunsfeld
36a8821f3e Fix behavior of the last child operator in tree queries 2020-09-02 12:10:04 -07:00
Max Brunsfeld
4aba684d66 Control recursion depth explicitly during query analysis 2020-08-24 16:55:56 -07:00
Max Brunsfeld
2eb04094f8 Handle aliased parent nodes in query analysis 2020-08-21 14:12:04 -07:00
Max Brunsfeld
456b1f6771 Fix handling of alternations and optional nodes in query analysis 2020-08-20 16:28:54 -07:00
Max Brunsfeld
9daec9cb22 Tweak impossible pattern error messages 2020-08-20 13:35:11 -07:00
Max Brunsfeld
4301110c12 query: Indicate specific step that's impossible 2020-08-20 13:06:38 -07:00
Max Brunsfeld
bd42729a41 query: Avoid early-returning captures due to predicates 2020-08-18 13:01:45 -07:00
Max Brunsfeld
604f9e8148 query: Assign is_definite correctly for steps within nested sub-patterns 2020-08-18 10:55:03 -07:00
Max Brunsfeld
91fc9f5399 Use is_definite flag in ts_query_cursor_next_capture 2020-08-17 16:50:59 -07:00
Max Brunsfeld
228a9e28e1 Add tests for impossible queries 2020-08-17 13:27:17 -07:00
Max Brunsfeld
c3f9b2b377 Fix query analysis bugs found in ruby tags query 2020-08-17 09:57:06 -07:00
Max Brunsfeld
1ea29053e1 Merge branch 'master' into query-pattern-is-definite 2020-08-14 09:31:55 -07:00
Patrick Thomson
94ab884ee4 Add a test. 2020-08-05 12:16:09 -04:00
Patrick Thomson
5c86a9c654 Fix the tests 2020-08-05 11:52:07 -04:00
Patrick Thomson
f4108056b0 Remove otiose pattern match. 2020-08-05 11:33:04 -04:00
Patrick Thomson
5a52dc2cd7 Return an iterator-bool tuple instead of just an iterator. 2020-08-05 11:18:59 -04:00
Max Brunsfeld
af655547e5 Fix handling of queries with many patterns with leading repetitions 2020-07-31 12:47:58 -07:00
Max Brunsfeld
e89a19a158 tags: Add @ignore capture 2020-07-29 15:33:48 -07:00
Max Brunsfeld
81bbdf19f4 Fix handling of non-terminal extras that share non-extra rules
Fixes #701
2020-07-29 09:50:13 -07:00
Max Brunsfeld
1ae5cbc851 query: Handle #not-match? in rust, wasm bindings 2020-07-24 12:15:23 -07:00
Max Brunsfeld
32099050d6 node_types: Fix panic when field is associated with a hidden token
Fixes #695
2020-07-24 09:26:56 -07:00
Max Brunsfeld
de2b71d465 Fix query bug when max permutations are exceeded 2020-07-23 16:05:50 -07:00
Tuấn-Anh Nguyễn
740d864e67 Add '.' as a valid start of a predicate, in addition to '#'
See https://github.com/ubolonton/emacs-tree-sitter/issues/38
2020-07-19 15:46:39 +07:00
Max Brunsfeld
82aa1462fd Clean up get_variable_info function 2020-07-17 15:12:13 -07:00
Max Brunsfeld
12341dbbc0 0.16.9 2020-07-17 14:23:54 -07:00
Max Brunsfeld
c4fca5f73e node types: Fix handling of repetitions inside of fields
Fixes #676
2020-07-17 14:19:59 -07:00
Max Brunsfeld
f4adf0269a Propagate dynamic precedence correctly for inlined rules
Fixes #683
2020-07-17 09:53:01 -07:00
Max Brunsfeld
4535efce69 query: Prevent dropping of matches when exceeding range maximum
Fixes #685
2020-07-17 09:39:06 -07:00
Max Brunsfeld
91a715799e Accept a paths file to most CLI subcommands 2020-07-14 15:04:39 -07:00
Tuấn-Anh Nguyễn
c2fb0f5229 cli: Add --byte-range flag to query command 2020-07-12 20:47:23 +07:00
Max Brunsfeld
0c2dc4c1e9
Merge pull request #648 from tree-sitter/tagging-improvements
Tagging improvements
2020-07-10 13:48:23 -07:00
Max Brunsfeld
e4e785b567 Remove unused flags from tags CLI command 2020-07-10 13:47:56 -07:00
Max Brunsfeld
0bfd47e2e5 Improve error message when failing to run graphviz stuff
Fixes #682
2020-07-10 10:13:19 -07:00
Max Brunsfeld
b52f28d6d5 Allow measuring time for tags subcommand 2020-07-09 11:28:07 -07:00
Max Brunsfeld
fef72fb434 Merge branch 'tags-utf16-columns' into tagging-improvements 2020-07-09 10:40:46 -07:00
Max Brunsfeld
255cf0a9cf tags: Add utf16 column ranges to tags
Also, ensure that line ranges contain only valid UTF8.

Co-authored-by: Tim Clem <tclem@github.com>
Co-authored-by: Beka Valentine <bekavalentine@github.com>
2020-07-08 16:13:58 -07:00
Max Brunsfeld
d614c14c2c tags: Make spans refer to name, not entire def/ref
Co-authored-by: Tim Clem <tclem@github.com>
Co-authored-by: Beka Valentine <bekavalentine@github.com>
2020-07-08 12:37:01 -07:00
Jacob Gillespie
86a5dabbcb
Add TypeScript definition for DSL (#658) 2020-07-07 08:45:23 -07:00
Max Brunsfeld
0bf2450b4a Always enforce stack version limit during reductions
Fixes #669
2020-07-06 15:58:33 -07:00
Max Brunsfeld
cc37da7457 Query analysis: fix propagation of uncertainty from later siblings 2020-06-26 16:46:12 -07:00
Max Brunsfeld
a317199215 Add query construction to benchmark 2020-06-26 15:05:27 -07:00
Max Brunsfeld
19baa5fd5e Clean up and document query analysis code 2020-06-25 17:56:43 -07:00
Max Brunsfeld
891de051e2 Fix population of subgraph nodes when analyzing queries 2020-06-25 15:06:27 -07:00
Max Brunsfeld
7f955419a8 Start work on recognizing impossible patterns 2020-06-25 15:06:27 -07:00
Max Brunsfeld
4c2f36a07b Mark steps as definite on query construction
* Add a ts_query_pattern_is_definite API, just for debugging this
* Store state_count on TSLanguage structs, to allow for scanning parse tables
2020-06-25 15:06:27 -07:00
Max Brunsfeld
deeeb67a3b
query: Fix handling of alternations under field names (#661) 2020-06-24 14:20:56 -07:00
Timothy Clem
f166947abb Test updates, definition/reference prefix is now required 2020-06-18 15:05:27 -07:00
Timothy Clem
17d26c0d5a Improved errors 2020-06-18 14:43:27 -07:00
Timothy Clem
b6ae67a610 Fix up CLI, use new syntax_type_name 2020-06-18 14:43:10 -07:00
Timothy Clem
75724698f0 Fix up tests 2020-06-18 14:42:41 -07:00