def unop_str(op: ast.AST) -> str:
if isinstance(op, ast.UAdd):
return '+'
if isinstance(op, ast.USub):
return '-'
if isinstance(op, ast.Not):
return '!'
if isinstance(op, ast.Invert):
return '~'
error(loc(op), "Invalid unary operator encountered: {0}:{1}. Check supported intrinsics.".format(op.lineno, op.col_offset))
return 'INVALID_UNOP'
评论列表
文章目录