diff --git a/case035.json b/case035.json new file mode 100644 index 00000000..d2a1a5c8 --- /dev/null +++ b/case035.json @@ -0,0 +1,9 @@ +{ + "expr": "λ($arg1, $arg2){{\"$arg1\": $arg1, \"$arg2\": $arg2}}(1, 2, 3)", + "dataset": null, + "bindings": {}, + "result": { + "$arg1": 1, + "$arg2": 2 + } +} \ No newline at end of file diff --git a/case036.json b/case036.json new file mode 100644 index 00000000..bcaca8ff --- /dev/null +++ b/case036.json @@ -0,0 +1,6 @@ +{ + "expr": "λ($arg1, $arg2, $arg3)>{[$arg1, $arg2, $arg3]}(1, 2, \"a\")", + "dataset": null, + "bindings": {}, + "result": [1, 2, "a"] +} \ No newline at end of file diff --git a/case037.json b/case037.json new file mode 100644 index 00000000..2ca5fb32 --- /dev/null +++ b/case037.json @@ -0,0 +1,6 @@ +{ + "expr": "λ($arg1, $arg2, $arg3)>{[$arg1, $arg2, $arg3]}(1, 2, \"a\")", + "data": "b", + "bindings": {}, + "result": [1, 2, "a"] +} \ No newline at end of file diff --git a/case038.json b/case038.json new file mode 100644 index 00000000..f7491da5 --- /dev/null +++ b/case038.json @@ -0,0 +1,6 @@ +{ + "expr": "λ($arg1, $arg2, $arg3)>{[$arg1, $arg2, $arg3]}(1, 2)", + "data": "b", + "bindings": {}, + "result": [1, 2, "b"] +} \ No newline at end of file diff --git a/case039.json b/case039.json new file mode 100644 index 00000000..d891867f --- /dev/null +++ b/case039.json @@ -0,0 +1,9 @@ +{ + "expr": "λ($arg1, $arg2)+:o>{{'$arg1': $arg1, '$arg2': $arg2}}([1, 2], [3, 4], [5, 6])", + "data": "b", + "bindings": {}, + "result": { + "$arg1": [1, 2], + "$arg2": [3, 4] + } +} \ No newline at end of file diff --git a/case040.json b/case040.json new file mode 100644 index 00000000..25199bd4 --- /dev/null +++ b/case040.json @@ -0,0 +1,6 @@ +{ + "expr": "λ($arg1, $arg2)>{[$arg1, $arg2]}(1, 2, 3)", + "dataset": null, + "bindings": {}, + "result": [1, 2] +} \ No newline at end of file diff --git a/src/signature.js b/src/signature.js index f0972773..d0eb4e41 100644 --- a/src/signature.js +++ b/src/signature.js @@ -252,15 +252,15 @@ const signature = (() => { argIndex++; } } else { - // may have matched multiple args (if the regex ends with a '+' + // may have matched multiple args (if the regex ends with a '+') // split into single tokens match.split('').forEach(function (single) { + arg = args[argIndex]; if (param.type === 'a') { if (single === 'm') { // missing (undefined) arg = undefined; } else { - arg = args[argIndex]; var arrayOK = true; // is there type information on the contents of the array? if (typeof param.subtype !== 'undefined') {