feat: add as operator

This commit is contained in:
Shunsuke Shibayama 2023-04-19 15:20:46 +09:00
parent 1c6a6b2ec8
commit daf01f3cf2
14 changed files with 119 additions and 12 deletions

View file

@ -94,6 +94,7 @@ pub fn binop_to_dname(op: &str) -> &str {
"&&" | "&" | "and" => "__and__",
"||" | "|" | "or" => "__or__",
"^^" | "^" => "__xor__",
"as" => "__as__",
"in" => "__in__",
"notin" => "__notin__", // NOTE: this doesn't exist in Python
"contains" => "__contains__",
@ -138,6 +139,7 @@ pub fn readable_name(name: &str) -> &str {
"__lorng__" => "`<..`",
"__rorng__" => "`..<`",
"__orng__" => "`<..<`",
"__as__" => "`as`",
"__and__" => "`and`", // TODO: `&&` if not boolean
"__or__" => "`or`", // TODO: `||` if not boolean
"__in__" => "`in`",