def p_actions_evolution(p): '''actions : block | actions block''' if len(p) == 2: p[0] = AST.Actions(series=[p[1]]) else: p[0] = AST.Actions(series=[p[1], p[2]])
def p_block_evolution(p): '''block : CURL_BRACKET actions CLOSE_CURL_BRACKET | action''' p[0] = AST.Actions(series=[p[1] if len(p) == 2 else p[2]])