Example #1
0
def register_set_in_scope(ir_set: irast.Set,
                          *,
                          path_scope: irast.ScopeTreeNode = None,
                          ctx: context.ContextLevel) -> None:
    if path_scope is None:
        path_scope = ctx.path_scope

    try:
        path_scope.attach_path(ir_set.path_id)
    except irast.InvalidScopeConfiguration as e:
        raise errors.QueryError(e.args[0], context=ir_set.context) from e
Example #2
0
def register_set_in_scope(
        ir_set: irast.Set, *,
        path_scope: irast.ScopeTreeNode=None,
        fence_points: FrozenSet[irast.PathId]=frozenset(),
        ctx: context.ContextLevel) -> List[irast.ScopeTreeNode]:
    if path_scope is None:
        path_scope = ctx.path_scope

    try:
        return path_scope.attach_path(
            ir_set.path_id,
            fence_points=fence_points,
        )
    except irast.InvalidScopeConfiguration as e:
        raise errors.QueryError(
            e.args[0], context=ir_set.context) from e
Example #3
0
def register_set_in_scope(
        ir_set: irast.Set,
        *,
        path_scope: irast.ScopeTreeNode = None,
        optional: bool = False,
        fence_points: FrozenSet[irast.PathId] = frozenset(),
        ctx: context.ContextLevel) -> List[irast.ScopeTreeNode]:
    if path_scope is None:
        path_scope = ctx.path_scope

    if ctx.path_log is not None:
        ctx.path_log.append(ir_set.path_id)

    return path_scope.attach_path(
        ir_set.path_id,
        optional=optional,
        fence_points=fence_points,
        context=ir_set.context,
    )