'Analyze a parse tree to find suite introducers which span a number
of lines.'

def get_suite_spots(self, tree, spots):

    for i in range(1, len(tree)):
        if isinstance(tree[i], types.TupleType):
            if (tree[i][0] == symbol.suite):
                lineno_colon = lineno_word = None
                for j in range((i - 1), 0, (-1)):
                    if (tree[j][0] == token.COLON):
                        lineno_colon = self.last_line_of_tree(tree[(j - 1)])
                    elif (tree[j][0] == token.NAME):
                        if (tree[j][1] == 'elif'):
                            t = tree[(j + 1)]
                            while (t and token.ISNONTERMINAL(t[0])):
                                t = t[1]
                            if t:
                                lineno_word = t[2]
                        else:
                            lineno_word = tree[j][2]
                        break
                    elif (tree[j][0] == symbol.except_clause):
                        if (tree[j][1][0] == token.NAME):
                            lineno_word = tree[j][1][2]
                            break
                if (lineno_colon and lineno_word):
                    self.record_multiline(spots, lineno_word, lineno_colon)
                self.find_docstring_pass_pair(tree[i], spots)
            elif (tree[i][0] == symbol.simple_stmt):
                first_line = self.first_line_of_tree(tree[i])
                last_line = self.last_line_of_tree(tree[i])
                if (first_line != last_line):
                    self.record_multiline(spots, first_line, last_line)
            self.get_suite_spots(tree[i], spots)
