Skip to content

Commit

Permalink
Update cait.rst
Browse files Browse the repository at this point in the history
Updated a behavior note to the subtree matching. Since wild card nodes only need to match to a single line, need to remind users that they need to get the parent of a "body" node if they want to search an entire body.
  • Loading branch information
lukesg08 authored Aug 10, 2023
1 parent f1ac4b2 commit 1cbe712
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docsrc/teachers/tools/cait.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ Subtree matching
match = find_match("for _item_ in _list_:\n"
" __exp__")
match['__exp__'].find_match("# whatever submatch")
match['__exp__'].parent.find_match("# whatever submatch")
Normally CAIT will match to direct siblings. By using an expression, you can
instead search everything contained in the body of the for loop, or other ast
child nodes (see tutorial)
child nodes (see tutorial). Note that __exp__ here will match to the first line in the body. To search the ENTIRE body, you will need to get the parent of __exp__ like in the example above

Finding Data types
^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 1cbe712

Please sign in to comment.