예제 #1
0
파일: awk_grp.py 프로젝트: cblp/tabkit
def parse_grpexpr(grp_ctx, tree, row_ctx, maker):
    if isinstance(tree, _ast.Call) and tree.func.id in FUNC_MAP:
        if tree.keywords:
            raise Exception('Keyword arguments are not supported in %r' % (tree.func.id,))
        return FUNC_MAP[tree.func.id](
            maker, list(parse_expr(row_ctx, arg) for arg in tree.args)
        )
    else:
        return parse_expr(grp_ctx, tree, partial(parse_grpexpr, maker=maker, row_ctx=row_ctx))
예제 #2
0
파일: awk_grp.py 프로젝트: cblp/tabkit
def parse_assign_grpexpr(grp_ctx, tree, row_ctx, maker):
    return parse_assign_expr(grp_ctx, tree, partial(parse_grpexpr, maker=maker, row_ctx=row_ctx))