Sfoglia il codice sorgente

Propagate --debug flag in ./compile.sh

Yentl Van Tendeloo 9 anni fa
parent
commit
d3a3dd777d
2 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. 1 1
      compile.sh
  2. 4 1
      kernel/modelverse_kernel/main.py

+ 1 - 1
compile.sh

@@ -8,4 +8,4 @@ curl http://localhost:8001 -d "op=set_input&username=user_manager&element_type=V
 
 f=`realpath $1`
 cd interface/HUTN
-${python} hutn_compiler/compiler.py $f grammars/actionlanguage.g ${4-PO} $2 $3 $f
+${python} hutn_compiler/compiler.py $f grammars/actionlanguage.g ${4-PO} $2 $3 $f $5

+ 4 - 1
kernel/modelverse_kernel/main.py

@@ -56,7 +56,10 @@ class ModelverseKernel(object):
         elif isinstance(phase_v, string_types):
             if phase_v == "init" and inst_v is None:
                 #print("%-30s(%s)" % ("PRIMITIVE " + str(self.primitives[inst]), phase_v))
-                gen = self.execute_primitive(user_root, inst)
+                try:
+                    gen = self.execute_primitive(user_root, inst)
+                except:
+                    raise Exception("%s: error: IP points to undefined element and is not executable as primitive.")
             else:
                 #print("%-30s(%s)" % (inst_v["value"], phase_v))
                 gen = getattr(self, "%s_%s" % (inst_v["value"], phase_v))(user_root)