From 1cbe712ac390a6a716ff4f36021ed776ae1ce939 Mon Sep 17 00:00:00 2001 From: lukesg08 Date: Thu, 10 Aug 2023 16:13:23 -0400 Subject: [PATCH] Update cait.rst 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. --- docsrc/teachers/tools/cait.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docsrc/teachers/tools/cait.rst b/docsrc/teachers/tools/cait.rst index 87f12986..10e5ec13 100644 --- a/docsrc/teachers/tools/cait.rst +++ b/docsrc/teachers/tools/cait.rst @@ -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 ^^^^^^^^^^^^^^^^^^