diff --git a/source/Wasp.cpp b/source/Wasp.cpp index 3df26699..bea3a690 100644 --- a/source/Wasp.cpp +++ b/source/Wasp.cpp @@ -180,6 +180,8 @@ String &normOperator(String &alias) { // bool is_identifier(char ch) { bool is_identifier(codepoint ch) { +// todo ALL GENERIC OPERATORS +// if(is_operator(ch))return false; if (ch == '#')return false;// size/count/length if (ch == '=')return false; if (ch == ':')return false; @@ -187,6 +189,12 @@ bool is_identifier(codepoint ch) { if (ch == ';')return false; if (ch == '.')return false; if (ch == '-')return false;// todo + if (ch == L'≠')return false; + if (ch == L'‖')return false; + if (ch == L'√')return false; + if (ch == L'²')return false; + if (ch == L'≥')return false; + if (ch == L'≤')return false; if (ch < 0 or ch > 128)return true;// all UTF identifier todo ;) return ('a' <= ch and ch <= 'z') or ('A' <= ch and ch <= 'Z') or ch == '_' or ch == '$' or ch == '@';// ch<0: UNICODE diff --git a/source/tests.cpp b/source/tests.cpp index 925b4086..379ceb39 100644 --- a/source/tests.cpp +++ b/source/tests.cpp @@ -2184,8 +2184,8 @@ void testLogic01() { } void testEqualities() { - assert_is("1≠2", True); assert_is("1==2", False); + assert_is("1≠2", True); // assert_is("1=2", False); assert_is("1!=2", True); assert_is("1≠1", False); @@ -3463,6 +3463,8 @@ void pleaseFix() { // 2022-12-28 : 3 sec WITH runtime_emit, wasmedge on M1 WOW ALL TESTS PASSING // ⚠️ CANNOT USE assert_emit in WASM! ONLY via void testRun(); void testCurrent() { + assert_is("1≠2", True); + test_implicit_multiplication(); // todo in parser how? assert_emit("-42", -42) @@ -3478,7 +3480,11 @@ void testCurrent() { testTypes(); testPolymorphism(); testPolymorphism2(); + skip( testPolymorphism3(); + assert_emit("τ≈6.2831853", true); + ) + // testDom(); assert_emit("global x=7", 7); assert_eval("if 0:3", false); @@ -3495,7 +3501,6 @@ void testCurrent() { // testInclude(); // check_is("τ≈6.2831853",true); - assert_emit("τ≈6.2831853", true); // assert_emit("square := it*it; square 3", 9); // assert_emit("a = [1, 2, 3]; a[1] == a#1", false); // assert_emit("a = [1, 2, 3]; a[1] == a#1", 0);