def visit(self, node): hint = self.process_comments(node) if hint: # maintain hint tree self.curr_hint.children.append(hint) hint.parent = self.curr_hint # get main node from node main_node = treeutil.findCommentedRoot(node) # cross-link hint and node main_node.hint = hint hint.node = main_node # node?! # scope nested hints self.curr_hint = hint for cld in node.children: self.visit(cld)
def visit(self, node): if node.comments: commentsArray = Comment.parseNode(node) if any(commentsArray): hint = Hint() # maintain hint tree self.curr_hint.children.append(hint) hint.parent = self.curr_hint # fill hint from commentAttributes hint = self.commentAttributes_to_hint(commentsArray, hint) # get main node from node main_node = treeutil.findCommentedRoot(node) # cross-link hint and node main_node.hint = hint hint.node = main_node # node?! # scope nested hints self.curr_hint = hint for cld in node.children: self.visit(cld)