|
3 | 3 |
|
4 | 4 | .. autoclass:: tree_sitter.Query |
5 | 5 |
|
| 6 | + .. seealso:: `Query Syntax`_ |
| 7 | + |
| 8 | + .. _Query Syntax: https://tree-sitter.github.io/tree-sitter/using-parsers#query-syntax |
| 9 | + |
| 10 | + .. note:: |
| 11 | + |
| 12 | + The following predicates are supported by default: |
| 13 | + |
| 14 | + * ``#eq?``, ``#not-eq?``, ``#any-eq?``, ``#any-not-eq?`` |
| 15 | + * ``#match?``, ``#not-match?``, ``#any-match?``, ``#any-not-match?`` |
| 16 | + * ``#any-of?``, ``#not-any-of?`` |
| 17 | + * ``#is?``, ``#is-not?`` |
| 18 | + * ``#set!`` |
| 19 | + |
6 | 20 | Methods |
7 | 21 | ------- |
8 | 22 |
|
9 | 23 | .. automethod:: captures |
| 24 | + |
| 25 | + .. important:: |
| 26 | + |
| 27 | + Predicates cannot be used if the tree was parsed from a callback. |
| 28 | + |
| 29 | + .. versionchanged:: 0.23.0 |
| 30 | + |
| 31 | + Range arguments removed, :class:`predicate <QueryPredicate>` argument added, |
| 32 | + return type changed to ``dict[str, list[Node]]``. |
| 33 | + .. automethod:: disable_capture |
| 34 | + |
| 35 | + .. versionadded:: 0.23.0 |
| 36 | + .. automethod:: disable_pattern |
| 37 | + |
| 38 | + .. versionadded:: 0.23.0 |
| 39 | + .. automethod:: end_byte_for_pattern |
| 40 | + |
| 41 | + .. versionadded:: 0.23.0 |
| 42 | + .. automethod:: is_pattern_guaranteed_at_step |
| 43 | + |
| 44 | + .. versionadded:: 0.23.0 |
| 45 | + .. automethod:: is_pattern_non_local |
| 46 | + |
| 47 | + .. versionadded:: 0.23.0 |
| 48 | + .. automethod:: is_pattern_rooted |
| 49 | + |
| 50 | + .. versionadded:: 0.23.0 |
10 | 51 | .. automethod:: matches |
| 52 | + |
| 53 | + .. important:: |
| 54 | + |
| 55 | + Predicates cannot be used if the tree was parsed from a callback. |
| 56 | + |
| 57 | + .. versionchanged:: 0.23.0 |
| 58 | + |
| 59 | + Range arguments removed, :class:`predicate <QueryPredicate>` argument added, |
| 60 | + return type changed to ``list[tuple[int, dict[str, list[Node]]]]``. |
| 61 | + .. automethod:: pattern_assertions |
| 62 | + |
| 63 | + .. versionadded:: 0.23.0 |
| 64 | + .. automethod:: pattern_settings |
| 65 | + |
| 66 | + .. versionadded:: 0.23.0 |
| 67 | + .. automethod:: set_byte_range |
| 68 | + |
| 69 | + .. versionadded:: 0.23.0 |
| 70 | + .. automethod:: set_point_range |
| 71 | + |
| 72 | + .. versionadded:: 0.23.0 |
| 73 | + .. automethod:: start_byte_for_pattern |
| 74 | + |
| 75 | + .. versionadded:: 0.23.0 |
| 76 | + .. automethod:: set_match_limit |
| 77 | + |
| 78 | + .. versionadded:: 0.23.0 |
| 79 | + .. automethod:: set_max_start_depth |
| 80 | + |
| 81 | + .. versionadded:: 0.23.0 |
| 82 | + |
| 83 | + Attributes |
| 84 | + ---------- |
| 85 | + |
| 86 | + .. autoattribute:: capture_count |
| 87 | + |
| 88 | + .. versionadded:: 0.23.0 |
| 89 | + .. autoattribute:: did_exceed_match_limit |
| 90 | + |
| 91 | + .. versionadded:: 0.23.0 |
| 92 | + .. autoattribute:: match_limit |
| 93 | + |
| 94 | + .. versionadded:: 0.23.0 |
| 95 | + .. autoattribute:: pattern_count |
| 96 | + |
| 97 | + .. versionadded:: 0.23.0 |
0 commit comments