예제 #1
0
파일: semantics.py 프로젝트: illenseer/lpod
 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
예제 #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
예제 #3
0
파일: semantics.py 프로젝트: illenseer/lpod
 def body(self, ast):
     """
     Flatten lists in body.
     """
     new_ast = list(flatten(ast))
     return new_ast
예제 #4
0
 def body(self, ast):
     """
     Flatten lists in body.
     """
     new_ast = list(flatten(ast))
     return new_ast