示例#1
0
文件: jshints.py 项目: 1and1/qooxdoo
    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)
示例#2
0
文件: jshints.py 项目: jlmag/qooxdoo
    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)
示例#3
0
    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)