Commits

Ben Firshman committed feb2f31

Added pass

  • Participants
  • Parent commits 4b10383

Comments (0)

Files changed (3)

File kugelblitz/tests/__init__.py

                 pass
             """,
             """
-            if (x) { };
+            if (x) { }
             """
         )
     

File kugelblitz/translator/__init__.py

 def translate_body(body, line_separator='\n'):
     s = []
     for node in body:
-        if isinstance(node, (ast.If,)):
+        if isinstance(node, ast.Pass):
+            continue
+        elif isinstance(node, ast.If):
             s.append(translate(node))
         else:
             s.append('%s;' % translate(node))

File kugelblitz/translator/toplevel.py

     def translate_body(self, body):
         s = []
         for node in body:
-            translator = self.get_translator(node)
             if isinstance(node, ast.Pass):
                 continue
-            elif isinstance(node, ast.If):
+            translator = self.get_translator(node)
+            if isinstance(node, ast.If):
                 s.append(translator.translate())
             else:
                 s.append('%s;' % translator.translate())