Explorar o código

Fix duplicated steps in frontend's answer.

Sander Mathijs van Veen %!s(int64=13) %!d(string=hai) anos
pai
achega
4052ad84bf
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/parser.py

+ 3 - 1
src/parser.py

@@ -337,7 +337,9 @@ class Parser(BisonParser):
             print self.root_node
 
         if include_step:
-            return suggestion, self.root_node
+            # Make sure that the node is cloned, otherwise the next rewrite
+            # attempt will modify the root node (since it's mutable).
+            return suggestion, self.root_node.clone()
 
         return self.root_node