This commit is contained in:
robotis
2012-05-05 17:20:03 +00:00
parent 2e36bf89c6
commit 520560926a
4 changed files with 17 additions and 3 deletions

View File

@@ -70,6 +70,10 @@ class Deferred(Node):
return res
def copy(self):
""" Returns self (used when Block objects are copyd)
returns:
self
"""
return self

View File

@@ -108,9 +108,13 @@ class Identifier(Node):
return '%'.join('%'.join(p) for p in self.parsed).strip().strip('%')
def copy(self):
""" Return copy of self
Returns:
Identifier object
"""
"""
tokens = [t for t in self.tokens] if type(self.tokens) is list else self.tokens
tokens = ([t for t in self.tokens]
if type(self.tokens) is list
else self.tokens)
return Identifier(tokens, 0)

View File

@@ -86,7 +86,9 @@ class Property(Node):
return f % fills
def copy(self):
"""
""" Return a full copy of self
Returns:
Property object
"""
return Property([t for t in self.tokens], 0)
new.property = self.property

View File

@@ -27,6 +27,10 @@ class Variable(Node):
scope.add_variable(self)
def copy(self):
""" Return a copy of self
Returns:
Variable object
"""
return Variable([t for t in self.tokens])
def fmt(self, fills):