def cmpop_str(op: ast.AST) -> str:
if isinstance(op, ast.Eq):
return '=='
if isinstance(op, ast.NotEq):
return '!='
if isinstance(op, ast.Lt):
return '<'
if isinstance(op, ast.LtE):
return '<='
if isinstance(op, ast.Gt):
return '>'
if isinstance(op, ast.GtE):
return '>='
error(loc(op), "Invalid compare operator encountered: {0}:{1}. Check supported intrisics.".format(op.lineno, op.col_offset))
return 'INVALID_CMPOP'
# Parsers
# ------------------------------------------------------------------------------
评论列表
文章目录