|
@@ -1,3 +1,4 @@ |
|
|
|
|
|
from Type import * |
|
|
|
|
|
|
|
|
class Function: |
|
|
class Function: |
|
|
def __init__(self): |
|
|
def __init__(self): |
|
@@ -6,7 +7,7 @@ class Function: |
|
|
self.isSignature = False |
|
|
self.isSignature = False |
|
|
self.name = None |
|
|
self.name = None |
|
|
self.parameters = [] |
|
|
self.parameters = [] |
|
|
self.returnValue = None |
|
|
|
|
|
|
|
|
self.returnType = None |
|
|
self.statements = [] |
|
|
self.statements = [] |
|
|
|
|
|
|
|
|
def parseLine(self, ln): |
|
|
def parseLine(self, ln): |
|
@@ -16,7 +17,7 @@ class Function: |
|
|
|
|
|
|
|
|
# Beginning of signature. |
|
|
# Beginning of signature. |
|
|
if ( |
|
|
if ( |
|
|
self.returnValue is None and |
|
|
|
|
|
|
|
|
self.returnType is None and |
|
|
self.name is None |
|
|
self.name is None |
|
|
and lastPart.endswith("(") |
|
|
and lastPart.endswith("(") |
|
|
): |
|
|
): |
|
@@ -43,7 +44,8 @@ class Function: |
|
|
lastPart.endswith("(") |
|
|
lastPart.endswith("(") |
|
|
): |
|
|
): |
|
|
self.name = lastPart[:-1] |
|
|
self.name = lastPart[:-1] |
|
|
self.returnType = ln[:-len(lastPart) - 1] # -1 for space before function name |
|
|
|
|
|
|
|
|
rawReturnType = ln[:-len(lastPart) - 1] # -1 for space before function name |
|
|
|
|
|
self.returnType = Type(rawReturnType) |
|
|
|
|
|
|
|
|
def __repr__(self): |
|
|
def __repr__(self): |
|
|
return self.__str__() |
|
|
return self.__str__() |
|
|