Exemple #1
0
 def head(self, ast):
     """
     Flatten lists in head and do not allow normal disjunctions.
     """
     if ast['disjunction']:
         raise SemanticError('Normal disjunctions are not allowed.')
     new_ast = AST()
     for item in ast:
         if ast[item]:
             new_ast[item] = list(flatten(ast[item]))
         else:
             new_ast[item] = None
     return new_ast
Exemple #2
0
 def head(self, ast):
     """
     Flatten lists in head and do not allow normal disjunctions.
     """
     if ast['disjunction']:
         raise SemanticError('Normal disjunctions are not allowed.')
     new_ast = AST()
     for item in ast:
         if ast[item]:
             new_ast[item] = list(flatten(ast[item]))
         else:
             new_ast[item] = None
     return new_ast
Exemple #3
0
 def body(self, ast):
     """
     Flatten lists in body.
     """
     new_ast = list(flatten(ast))
     return new_ast
Exemple #4
0
 def body(self, ast):
     """
     Flatten lists in body.
     """
     new_ast = list(flatten(ast))
     return new_ast