From b203887ecb557a02f4df7c47c2f46ee5dedb140e Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Wed, 1 Apr 2015 16:19:02 +0200 Subject: Use Node class from monkey.util in parser Also simplify rules for list expressions. --- monkey/graph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'monkey') diff --git a/monkey/graph.py b/monkey/graph.py index 5bf78ec..3e1d3a2 100644 --- a/monkey/graph.py +++ b/monkey/graph.py @@ -1,10 +1,10 @@ #!/usr/bin/python3 class Node(object): - def __init__(self, data): + def __init__(self, data, eout=None): self.data = data self.ein = [] - self.eout = [] + self.eout = eout if eout else [] # (Re-)insert a child node [target] to [self] at index [idx] (or as the # rightmost child if index is not given). Also append [self] to the list of -- cgit v1.2.1