compiler/PEGFsaInterpret.st
changeset 518 a6d8b93441b0
parent 516 3b81c9e53352
--- a/compiler/PEGFsaInterpret.st	Mon Aug 17 13:39:38 2015 +0100
+++ b/compiler/PEGFsaInterpret.st	Mon Aug 17 23:11:56 2015 +0100
@@ -51,8 +51,10 @@
 
 reportStates: states
     debug ifTrue: [ 
-        Transcript show: 'states: '; show: states asString; cr
+        Transcript show: 'states: '; show: states printString; cr
     ]
+
+    "Modified: / 17-08-2015 / 13:37:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !PEGFsaInterpret methodsFor:'initialization'!
@@ -162,12 +164,20 @@
 return: states
     | return |
     return := IdentityDictionary new.
-    retvals keysAndValuesRemove: [ :key :record | record position isNil ].
+    retvals keys do:[:key | 
+        | value |
 
+        value := retvals at: key.
+        (value position isNil) ifTrue:[ 
+            retvals removeKey: key
+        ].
+    ].
     retvals keysAndValuesDo: [ :key :value |
         return at: key put: value position
     ].
     ^ return
+
+    "Modified: / 17-08-2015 / 13:45:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 sortedTransitionsFor: state