diff --git a/src/parser.js b/src/parser.js index 629ff82c..9cffaf3d 100644 --- a/src/parser.js +++ b/src/parser.js @@ -1194,6 +1194,7 @@ const parser = (() => { result = {type: 'apply', value: expr.value, position: expr.position}; result.lhs = processAST(expr.lhs); result.rhs = processAST(expr.rhs); + result.keepArray = result.lhs.keepArray || result.rhs.keepArray; break; default: result = {type: expr.type, value: expr.value, position: expr.position}; diff --git a/test/test-suite/groups/hof-map/case0010.json b/test/test-suite/groups/hof-map/case0010.json new file mode 100644 index 00000000..8f408c52 --- /dev/null +++ b/test/test-suite/groups/hof-map/case0010.json @@ -0,0 +1,6 @@ +{ + "expr": "( $square := function($x){$x*$x}; $map([1], $square)[] )", + "data": null, + "bindings": {}, + "result": [1] +} diff --git a/test/test-suite/groups/hof-map/case0011.json b/test/test-suite/groups/hof-map/case0011.json new file mode 100644 index 00000000..2bd7fa3e --- /dev/null +++ b/test/test-suite/groups/hof-map/case0011.json @@ -0,0 +1,6 @@ +{ + "expr": "( $data := [1]; $square := function($x){$x*$x}; $data ~> $map($square)[] )", + "data": null, + "bindings": {}, + "result": [1] +}