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