本文整理汇总了Python中incoq.compiler.incast.L.break_keymask方法的典型用法代码示例。如果您正苦于以下问题:Python L.break_keymask方法的具体用法?Python L.break_keymask怎么用?Python L.break_keymask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类incoq.compiler.incast.L
的用法示例。
在下文中一共展示了L.break_keymask方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: convert_subquery_clause
# 需要导入模块: from incoq.compiler.incast import L [as 别名]
# 或者: from incoq.compiler.incast.L import break_keymask [as 别名]
def convert_subquery_clause(clause):
"""Given a clause, if it is a VarsMember clause for an
incrementalized subquery, return an equivalent RelMember clause.
For any other clause return the clause unchanged.
The two forms recognized are:
- right-hand side is a Name node
- right-hand side is an ImgLookup node on a Name, with a keymask
"""
if not isinstance(clause, L.VarsMember):
return clause
if isinstance(clause.iter, L.Name):
return L.RelMember(clause.vars, clause.iter.id)
elif (isinstance(clause.iter, L.ImgLookup) and
isinstance(clause.iter.set, L.Name) and
L.is_keymask(clause.iter.mask)):
nb, nu = L.break_keymask(clause.iter.mask)
assert nb == len(clause.iter.bounds)
assert nu == len(clause.vars)
return L.RelMember(clause.iter.bounds + clause.vars,
clause.iter.set.id)
return clause