Procházet zdrojové kódy

Disable GC for now to prevent bugs; fix some minor bugs

Yentl Van Tendeloo před 7 roky
rodič
revize
504af6abc7

+ 5 - 2
kernel/modelverse_kernel/main.py

@@ -226,8 +226,8 @@ class ModelverseKernel(object):
             node_value, = yield [("RV", [node])]
             node_value, = yield [("RV", [node])]
             if node_value is not None:
             if node_value is not None:
                 # There is a value to the node, so replicate the value
                 # There is a value to the node, so replicate the value
-                if isinstance(node_value, str):
-                    value = '"%s"' % node_value.replace('"', '\\"').replace('\t', '\\t').replace('\n', '\\n')
+                if isinstance(node_value, (str, unicode)):
+                    value = '"%s"' % node_value.replace('"', '\\"').replace("'", "\\'").replace('\t', '\\t').replace('\n', '\\n')
                 else:
                 else:
                     value = str(node_value)
                     value = str(node_value)
                 instruction = "constant_" + str(ModelverseKernel.counter)
                 instruction = "constant_" + str(ModelverseKernel.counter)
@@ -248,6 +248,9 @@ class ModelverseKernel(object):
         elif inst_type["value"] == "declare":
         elif inst_type["value"] == "declare":
             instruction = ""
             instruction = ""
 
 
+        elif inst_type["value"] == "global":
+            instruction = ""
+
         elif inst_type["value"] == "break":
         elif inst_type["value"] == "break":
             instruction = "  " * indent + "break\n"
             instruction = "  " * indent + "break\n"
 
 

+ 2 - 0
state/modelverse_state/main.py

@@ -372,12 +372,14 @@ class ModelverseState(object):
             self.to_delete.add(t)
             self.to_delete.add(t)
 
 
     def garbage_collect(self):  
     def garbage_collect(self):  
+        return
         while self.to_delete:
         while self.to_delete:
             t = self.to_delete.pop()
             t = self.to_delete.pop()
             if t in self.incoming and not self.incoming[t]:
             if t in self.incoming and not self.incoming[t]:
                 self.delete_node(t)
                 self.delete_node(t)
 
 
     def purge(self):
     def purge(self):
+        return
         self.garbage_collect()
         self.garbage_collect()
         values = set(self.edges)
         values = set(self.edges)
         values.update(self.nodes)
         values.update(self.nodes)

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Tue Apr 10 14:43:31 2018
+Date:   Mon Apr 23 10:25:50 2018
 
 
 Model author: Yentl Van Tendeloo
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server