Browse Source

added remove for iterators

Kajetan Johannes Hammerle 4 years ago
parent
commit
938d56a749
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/me/hammerle/snuviscript/code/FunctionRegistry.java

+ 1 - 0
src/me/hammerle/snuviscript/code/FunctionRegistry.java

@@ -478,6 +478,7 @@ public class FunctionRegistry {
         registerConsumer("clearscriptvars", (sc, in) -> GLOBAL_VARS.clear());
         registerFunction("hasnext", (sc, in) -> ((Iterator) in[0].get(sc)).hasNext());
         registerFunction("next", (sc, in) -> ((Iterator) in[0].get(sc)).next());
+        registerConsumer("remove", (sc, in) -> ((Iterator) in[0].get(sc)).remove());
         registerConsumer("swap", (sc, in) -> {
             Object o = in[0].get(sc);
             in[0].set(sc, in[1].get(sc));