mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
feat: add as
operator
This commit is contained in:
parent
1c6a6b2ec8
commit
daf01f3cf2
14 changed files with 119 additions and 12 deletions
|
@ -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`",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue