本文整理汇总了Python中syntax_visitor.SyntaxVisitor.visit_expr方法的典型用法代码示例。如果您正苦于以下问题:Python SyntaxVisitor.visit_expr方法的具体用法?Python SyntaxVisitor.visit_expr怎么用?Python SyntaxVisitor.visit_expr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类syntax_visitor.SyntaxVisitor
的用法示例。
在下文中一共展示了SyntaxVisitor.visit_expr方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: visit_expr
# 需要导入模块: from syntax_visitor import SyntaxVisitor [as 别名]
# 或者: from syntax_visitor.SyntaxVisitor import visit_expr [as 别名]
def visit_expr(self, expr):
assert expr is not None
assert expr.type is not None, \
"Missing type annotation on %s" % expr
SyntaxVisitor.visit_expr(self, expr)
示例2: visit_expr
# 需要导入模块: from syntax_visitor import SyntaxVisitor [as 别名]
# 或者: from syntax_visitor.SyntaxVisitor import visit_expr [as 别名]
def visit_expr(self, expr):
abstract_shape = SyntaxVisitor.visit_expr(self, expr)
assert abstract_shape is not None, \
"Unsupported expression in shape inference: %s" % expr.node_type()
return abstract_shape
示例3: visit_expr
# 需要导入模块: from syntax_visitor import SyntaxVisitor [as 别名]
# 或者: from syntax_visitor.SyntaxVisitor import visit_expr [as 别名]
def visit_expr(self, expr):
if isinstance(expr, Adverb):
raise self.Yes()
SyntaxVisitor.visit_expr(self, expr)
示例4: visit_expr
# 需要导入模块: from syntax_visitor import SyntaxVisitor [as 别名]
# 或者: from syntax_visitor.SyntaxVisitor import visit_expr [as 别名]
def visit_expr(self, expr):
if isinstance(expr, (UntypedFn, TypedFn, Closure)) or isinstance(expr.type, (FnT, ClosureT)):
raise Yes()
SyntaxVisitor.visit_expr(expr)
示例5: visit_expr
# 需要导入模块: from syntax_visitor import SyntaxVisitor [as 别名]
# 或者: from syntax_visitor.SyntaxVisitor import visit_expr [as 别名]
def visit_expr(self, expr):
assert expr is not None, "Expression missing, must be a compiler bug"
assert expr.type is not None, \
"Missing type annotation on %s" % expr
SyntaxVisitor.visit_expr(self, expr)
示例6: visit_expr
# 需要导入模块: from syntax_visitor import SyntaxVisitor [as 别名]
# 或者: from syntax_visitor.SyntaxVisitor import visit_expr [as 别名]
def visit_expr(self, expr):
assert expr is not None
SyntaxVisitor.visit_expr(self, expr)
示例7: visit_expr
# 需要导入模块: from syntax_visitor import SyntaxVisitor [as 别名]
# 或者: from syntax_visitor.SyntaxVisitor import visit_expr [as 别名]
def visit_expr(self, expr):
result = SyntaxVisitor.visit_expr(self, expr)
if result is None:
return unknown
else:
return result