Commit graph

6118 commits

Author SHA1 Message Date
Max Brunsfeld
18150a1573
Merge pull request #644 from tree-sitter/query-pattern-is-definite
Analyze queries on construction to identify impossible patterns, and patterns that will definitely match
2020-09-02 10:28:21 -07:00
Max Brunsfeld
31a22fc627 In array.h, add comments and sort functions more logically 2020-09-02 10:02:34 -07:00
Max Brunsfeld
4b9db41584 Remove unnecessary echo in test script 2020-09-02 09:17:48 -07:00
TravonteD
45eab0ab24 add link to Fennel parser 2020-09-01 22:34:45 -04:00
Max Brunsfeld
87df53a99b
Merge pull request #716 from bfredl/fallthrough
avoid warnings for implicit fallthrough in switch statements
2020-08-26 10:02:00 -07:00
Björn Linse
04eacc44ef avoid warnings for implicit fallthrough in switch statements 2020-08-26 10:04:08 +02:00
Max Brunsfeld
55030afd13
Merge pull request #715 from bfredl/ubsan-warnings
Fix a few cases of Clang 10 with UBSAN detecting undefined behavior
2020-08-25 11:16:08 -07:00
Björn Linse
00c470ab2a Fix a few cases of Clang 10 with UBSAN detecting undefined behavior
Clang 10 considers adding any offset, including 0, to the null pointer
to be undefined behavior. `(void *)NULL + 0 = kaboom`.
2020-08-25 19:34:44 +02:00
Max Brunsfeld
4aba684d66 Control recursion depth explicitly during query analysis 2020-08-24 16:55:56 -07:00
Max Brunsfeld
315f87bbff Remove unnecessary parameter from sorted array functions 2020-08-24 12:07:57 -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
d47346abc0 Avoid pushing duplicate start states in query analysis 2020-08-20 10:07:22 -07:00
Max Brunsfeld
aac75e35b1 Optimize iteration over state successors during query analysis 2020-08-19 14:56:57 -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
Santos Gallegos
b2e4d3f54f Document alternations and wildcard nodes
These were added in https://github.com/tree-sitter/tree-sitter/pull/615
and https://github.com/tree-sitter/tree-sitter/pull/630

Closes https://github.com/tree-sitter/tree-sitter/issues/704
2020-08-15 13:08:46 -05:00
Max Brunsfeld
1ea29053e1 Merge branch 'master' into query-pattern-is-definite 2020-08-14 09:31:55 -07:00
Patrick Thomson
d5576e306c
Merge pull request #708 from tree-sitter/add-tagger-error-detection
Add ts_tags_buffer_found_parse_error capabilities for error detection during tagging.
2020-08-05 14:07:31 -04:00
Patrick Thomson
8d58a0d33a Add parameter in the header. 2020-08-05 13:10:02 -04:00
Max Brunsfeld
f91b19c089 tags, highlight: Avoid completely deallocating buffers when shrinking 2020-08-05 09:57:45 -07:00
Patrick Thomson
49be94f069 Merge remote-tracking branch 'origin/master' into add-tagger-error-detection 2020-08-05 12:44:26 -04:00
Patrick Thomson
ec6af791af Bikeshed this name a little bit. 2020-08-05 12:24:39 -04:00
Patrick Thomson
7576b0b448 Add accessor to the C header. 2020-08-05 12:21:42 -04:00
Patrick Thomson
94ab884ee4 Add a test. 2020-08-05 12:16:09 -04:00
Max Brunsfeld
32f69dbe15 tags, highlight: Limit the size of buffers that are retained in memory 2020-08-05 09:06:00 -07: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
Patrick Thomson
1a571ae208 Add errors_present field to tagging context. 2020-08-04 17:53:47 -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
f265e63d48 tags: Allow def or ref node to be a sibling of the name node 2020-07-30 13:35:04 -07:00
Max Brunsfeld
411f69d13b query: Optimize 'longest-match' filtering 2020-07-30 13:34:34 -07:00
Max Brunsfeld
df5510acfc query: Remove limit on number of in-progress states 2020-07-30 12:59:34 -07:00
Max Brunsfeld
e89a19a158 tags: Add @ignore capture 2020-07-29 15:33:48 -07:00
Max Brunsfeld
4ec7d80968 Mention rule order as the fallback criteria in docs
Fixes #702
2020-07-29 10:04:21 -07:00
Max Brunsfeld
6941217c46
Merge pull request #696 from ret2libc/printf-sizet-format
size_t variables need %zu, not %lu
2020-07-29 09:56:07 -07:00
Max Brunsfeld
9a7fdd29c2 Add test for non-terminal extras that share non-extra rules 2020-07-29 09:53:07 -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
253f23c3d4 Fix error when parse error occurs after non-terminal extra 2020-07-28 13:33:13 -07:00
Max Brunsfeld
ed8fdadaee
Merge pull request #698 from stsewd/document-set
Docs: document the `set!` predicate
2020-07-28 10:31:16 -07:00
Santos Gallegos
d22240591c Docs: document the set! predicate
I was looking for something like this,
I searched the documentation,
but I found it in https://github.com/tree-sitter/tree-sitter-javascript/blob/master/queries/injections.scm#L15
2020-07-27 17:38:32 -05: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