diff --git a/compiler/erg_compiler/context/initialize/mod.rs b/compiler/erg_compiler/context/initialize/mod.rs index d553fb3b..4f9cb507 100644 --- a/compiler/erg_compiler/context/initialize/mod.rs +++ b/compiler/erg_compiler/context/initialize/mod.rs @@ -2173,7 +2173,8 @@ impl Context { let T = mono_q("T", instanceof(Type)); let I = mono_q("I", subtypeof(poly("In", vec![ty_tp(T.clone())]))); let op_t = bin_op(I, T, Bool).quantify(); - self.register_builtin_impl("__in__", op_t, Const, Private); + self.register_builtin_impl("__in__", op_t.clone(), Const, Private); + self.register_builtin_impl("__notin__", op_t, Const, Private); /* unary */ // TODO: Boolの+/-は警告を出したい let M = mono_q("M", subtypeof(mono("Mutizable"))); diff --git a/compiler/erg_compiler/error.rs b/compiler/erg_compiler/error.rs index be1857e4..818d228d 100644 --- a/compiler/erg_compiler/error.rs +++ b/compiler/erg_compiler/error.rs @@ -39,6 +39,7 @@ pub fn binop_to_dname(op: &str) -> &str { "//" => "__floordiv__", "**" => "__pow__", "%" => "__mod__", + "@" => "__matmul__", ".." => "__rng__", "<.." => "__lorng__", "..<" => "__rorng__", @@ -47,6 +48,7 @@ pub fn binop_to_dname(op: &str) -> &str { "||" | "or" => "__or__", "^^" => "__xor__", "in" => "__in__", + "notin" => "__notin__", // NOTE: this doesn't exist in Python "contains" => "__contains__", "subof" => "__subof__", "supof" => "__supof__", @@ -82,6 +84,7 @@ pub fn readable_name(name: &str) -> &str { "__floordiv__" => "`//`", "__pow__" => "`**`", "__mod__" => "`%`", + "__matmul__" => "`@`", "__rng__" => "`..`", "__lorng__" => "`<..`", "__rorng__" => "`..<`", @@ -89,6 +92,7 @@ pub fn readable_name(name: &str) -> &str { "__and__" => "`and`", "__or__" => "`or`", "__in__" => "`in`", + "__notin__" => "`notin`", "__contains__" => "`contains`", "__subof__" => "`subof`", "__supof__" => "`supof`",