Spaces:
Sleeping
Sleeping
ayushnoori
commited on
Commit
•
4dbf6ae
1
Parent(s):
6b5a85b
Amend weight description
Browse files- abstract_syntax_tree.py +1 -1
abstract_syntax_tree.py
CHANGED
@@ -28,7 +28,7 @@ class OperatorNode:
|
|
28 |
def __init__(self, operator, children):
|
29 |
self.operator = operator # operator object (e.g., Add, Subtract, etc.)
|
30 |
self.children = children # list of children nodes (operands)
|
31 |
-
self.weight = operator.weight + sum([child.weight for child in children]) # weight of the
|
32 |
self.type = operator.return_type # return type of the operator object
|
33 |
|
34 |
def evaluate(self, input = None):
|
|
|
28 |
def __init__(self, operator, children):
|
29 |
self.operator = operator # operator object (e.g., Add, Subtract, etc.)
|
30 |
self.children = children # list of children nodes (operands)
|
31 |
+
self.weight = operator.weight + sum([child.weight for child in children]) # weight of the program
|
32 |
self.type = operator.return_type # return type of the operator object
|
33 |
|
34 |
def evaluate(self, input = None):
|