소스 검색

replaced simple bit operations with functions, as the compiler does not support them

Marvin Löschenkohl 7 달 전
부모
커밋
19dcd8d0b6
1개의 변경된 파일8개의 추가작업 그리고 6개의 파일을 삭제
  1. 8 6
      src/me/hammerle/snuviscript/code/FunctionRegistry.java

+ 8 - 6
src/me/hammerle/snuviscript/code/FunctionRegistry.java

@@ -169,12 +169,14 @@ public class FunctionRegistry {
             other.term();
             sc.getScriptManager().removeScript(other);
         });
-        registerFunction(">>", (sc, in) -> (double) (in[0].getInt(sc) >> in[1].getInt(sc)));
-        registerFunction("<<", (sc, in) -> (double) (in[0].getInt(sc) << in[1].getInt(sc)));
-        registerFunction("&", (sc, in) -> (double) (in[0].getInt(sc) & in[1].getInt(sc)));
-        registerFunction("|", (sc, in) -> (double) (in[0].getInt(sc) | in[1].getInt(sc)));
-        registerFunction("^", (sc, in) -> (double) (in[0].getInt(sc) ^ in[1].getInt(sc)));
-        registerFunction("~", (sc, in) -> (double) (~in[0].getInt(sc)));
+        registerFunction("bit.rightshift",
+                (sc, in) -> (double) (in[0].getInt(sc) >> in[1].getInt(sc)));
+        registerFunction("bit.leftshift",
+                (sc, in) -> (double) (in[0].getInt(sc) << in[1].getInt(sc)));
+        registerFunction("bit.and", (sc, in) -> (double) (in[0].getInt(sc) & in[1].getInt(sc)));
+        registerFunction("bit.or", (sc, in) -> (double) (in[0].getInt(sc) | in[1].getInt(sc)));
+        registerFunction("bit.xor", (sc, in) -> (double) (in[0].getInt(sc) ^ in[1].getInt(sc)));
+        registerFunction("bit.invert", (sc, in) -> (double) (~in[0].getInt(sc)));
         registerFunction("bit.set",
                 (sc, in) -> (double) (in[0].getInt(sc) | (1 << (in[1].getInt(sc)))));
         registerFunction("bit.unset",