コード例 #1
0
    def getEndLine(self):
        if self.endline is None:
            physicallines = self.getMaskedModuleLines()
            lineno = self.linenum
            logicallines = generateLogicalLines(physicallines[lineno - 1:])

            # skip the first line, because it's the declaration
            line = logicallines.next()
            lineno += line.count("\n")

            # scan to the end of the fn
            for line in logicallines:
                #print lineno,":",line,
                match = indentRE.match(line)
                if match and match.end() - 1 <= self.indent:
                    break
                lineno += line.count("\n")
            self.endline = lineno
        return self.endline
コード例 #2
0
ファイル: fastparserast.py プロジェクト: lebauce/artub
    def getEndLine(self):
        if self.endline is None:
            physicallines = self.getMaskedModuleLines()
            lineno = self.linenum
            logicallines = generateLogicalLines(physicallines[lineno-1:])

            # skip the first line, because it's the declaration
            line = logicallines.next()
            lineno+=line.count("\n")

            # scan to the end of the fn
            for line in logicallines:
                #print lineno,":",line,
                match = indentRE.match(line)
                if match and match.end()-1 <= self.indent:
                    break
                lineno+=line.count("\n")
            self.endline = lineno
        return self.endline
コード例 #3
0
 def getLogicalLine(self, physicalLineno):
     return generateLogicalLines(self._srclines[physicalLineno - 1:]).next()
コード例 #4
0
ファイル: fastparserast.py プロジェクト: lebauce/artub
 def getLogicalLine(self,physicalLineno):
     return generateLogicalLines(self._srclines[physicalLineno-1:]).next()