From 1b16f80b761874c4204012b76cc1593bf533cc99 Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Fri, 14 Oct 2022 01:03:23 +0900 Subject: [PATCH] Update error.rs --- compiler/erg_compiler/error.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/erg_compiler/error.rs b/compiler/erg_compiler/error.rs index f8844450..b26267d5 100644 --- a/compiler/erg_compiler/error.rs +++ b/compiler/erg_compiler/error.rs @@ -32,8 +32,9 @@ pub fn binop_to_dname(op: &str) -> &str { "<.." => "__lorng__", "..<" => "__rorng__", "<..<" => "__orng__", - "and" => "__and__", - "or" => "__or__", + "&&" | "and" => "__and__", + "||" | "or" => "__or__", + "^^" => "__xor__", "in" => "__in__", "contains" => "__contains__", "subof" => "__subof__", @@ -46,7 +47,7 @@ pub fn binop_to_dname(op: &str) -> &str { "<=" => "__le__", ">" => "__gt__", ">=" => "__ge__", - _ => todo!(), + other => todo!("no such binary operator: {other}"), } } @@ -57,7 +58,7 @@ pub fn unaryop_to_dname(op: &str) -> &str { "~" => "__invert__", "!" => "__mutate__", "..." => "__spread__", - _ => todo!(), + other => todo!("no such unary operator: {other}"), } }