lazy functions with set parameter sizes will report an error if no properly specced. Fixes #1064

This commit is contained in:
gnembon committed 2021-09-06 23:05:13 -03:00
1 parent 229d0b037b
commit 36df542072
6 files changed
+45 -12

No files matched your search

@@ -104,7 +104,7 @@ public class DataStructures {
});
// needs lazy cause sort function is reused
expression.addLazyFunction("sort_key", -1, (c, t, lv) -> //get working with iterators
expression.addLazyFunction("sort_key", (c, t, lv) -> //get working with iterators
{
if (lv.size() == 0)
throw new InternalExpressionException("First argument for 'sort_key' should be a List");
@@ -207,7 +207,7 @@ public class DataStructures {
});
// lazy cause conditional typing - questionable
expression.addLazyFunction("get", -1, (c, t, lv) ->
expression.addLazyFunction("get", (c, t, lv) ->
{
if (lv.size() == 0)
throw new InternalExpressionException("'get' requires parameters");
@@ -235,7 +235,7 @@ public class DataStructures {
});
// same as `get`
expression.addLazyFunction("has", -1, (c, t, lv) ->
expression.addLazyFunction("has", (c, t, lv) ->
{
if (lv.size() == 0)
throw new InternalExpressionException("'has' requires parameters");
@@ -263,7 +263,7 @@ public class DataStructures {
});
// same as `get`
expression.addLazyFunction("put", -1, (c, t, lv) ->
expression.addLazyFunction("put", (c, t, lv) ->
{
if(lv.size()<2)
{
@@ -302,7 +302,7 @@ public class DataStructures {
});
// same as `get`
expression.addLazyFunction("delete", -1, (c, t, lv) ->
expression.addLazyFunction("delete", (c, t, lv) ->
{
if (lv.size() == 0)
throw new InternalExpressionException("'delete' requires parameters");