Permalink
Browse files

-node.value

  • Loading branch information...
uberj committed Oct 30, 2012
1 parent 001c5fb commit 2476a6b80133a84543cbd63950ba9191084a71fc
Showing with 4 additions and 4 deletions.
  1. +1 −1 parser_tests.py
  2. +3 −3 utils.py
View
@@ -9,7 +9,7 @@ def compare(self, ss, expected_stack_str):
parse = build_parser()
root_node = parse(ss)
stack = make_stack(root_node)
- actual = ' '.join(stack)
+ actual = ' '.join([n.value for n in stack])
self.assertEqual(actual, expected_stack_str, msg="Actual: {0} "
"Excpected: {1} Parsing: {2}".format(actual,
expected_stack_str, ss))
View
@@ -10,13 +10,13 @@ def _make_stack(stack, node):
_make_stack(stack, node.l_child)
if hasattr(node, 'r_child'):
_make_stack(stack, node.r_child)
- stack.append(node.value)
+ stack.append(node)
else:
if hasattr(node, 'child'):
_make_stack(stack, node.child)
- stack.append(node.value)
+ stack.append(node)
else:
- stack.append(node.value)
+ stack.append(node)
stack = []
_make_stack(stack, node)
return stack

0 comments on commit 2476a6b

Please sign in to comment.