Browse Source

Add meaningful error message on empty blocks in compiled HUTN files

Yentl Van Tendeloo 8 years ago
parent
commit
9ec586c6a6
1 changed files with 2 additions and 0 deletions
  1. 2 0
      interface/HUTN/hutn_compiler/primitives_visitor.py

+ 2 - 0
interface/HUTN/hutn_compiler/primitives_visitor.py

@@ -322,6 +322,8 @@ class PrimitivesVisitor(Visitor):
                     break
         for i in range(len(primitives)-1):
             self.dict(primitives[i], "next", primitives[i+1])
+        if len(primitives) == 0:
+            raise Exception("Block with no body found at %s" % tree.get_reference_line())
         self.set_primitive(tree, primitives[0])
 
     def visit_func_body(self, tree):