diff --git a/package-lock.json b/package-lock.json index 3a92124..b9e5569 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,36 +13,42 @@ } }, "@babel/core": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.4.tgz", - "integrity": "sha512-3A0tS0HWpy4XujGc7QtOIHTeNwUgWaZc/WuS5YQrfhU67jnVmsD6OGPc1AKHH0LJHQICGncy3+YUjIhVlfDdcA==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.5.tgz", + "integrity": "sha512-O34LQooYVDXPl7QWCdW9p4NR+QlzOr7xShPPJz8GsuCU3/8ua/wqTr7gmnxXv+WBESiGU/G5s16i6tUvHkNb+w==", "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.10.4", - "@babel/helper-module-transforms": "^7.10.4", + "@babel/generator": "^7.10.5", + "@babel/helper-module-transforms": "^7.10.5", "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.10.4", + "@babel/parser": "^7.10.5", "@babel/template": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4", + "@babel/traverse": "^7.10.5", + "@babel/types": "^7.10.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", "json5": "^2.1.2", - "lodash": "^4.17.13", + "lodash": "^4.17.19", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/parser": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz", + "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ==" + } } }, "@babel/generator": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.4.tgz", - "integrity": "sha512-toLIHUIAgcQygFZRAQcsLQV3CBuX6yOIru1kJk/qqqvcRmZrYe6WavZTSG+bB8MxhnL9YPf+pKQfuiP161q7ng==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.5.tgz", + "integrity": "sha512-3vXxr3FEW7E7lJZiWQ3bM4+v/Vyr9C+hpolQ8BGFr9Y8Ri2tFLWTixmwKBafDujO1WVah4fhZBeU1bieKdghig==", "requires": { - "@babel/types": "^7.10.4", + "@babel/types": "^7.10.5", "jsesc": "^2.5.1", - "lodash": "^4.17.13", "source-map": "^0.5.0" } }, @@ -65,11 +71,11 @@ } }, "@babel/helper-member-expression-to-functions": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.4.tgz", - "integrity": "sha512-m5j85pK/KZhuSdM/8cHUABQTAslV47OjfIB9Cc7P+PvlAoBzdb79BGNfw8RhT5Mq3p+xGd0ZfAKixbrUZx0C7A==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.5.tgz", + "integrity": "sha512-HiqJpYD5+WopCXIAbQDG0zye5XYVvcO9w/DHp5GsaGkRUaamLj2bEtu6i8rnGGprAhHM3qidCMgp71HF4endhA==", "requires": { - "@babel/types": "^7.10.4" + "@babel/types": "^7.10.5" } }, "@babel/helper-module-imports": { @@ -81,17 +87,17 @@ } }, "@babel/helper-module-transforms": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.4.tgz", - "integrity": "sha512-Er2FQX0oa3nV7eM1o0tNCTx7izmQtwAQsIiaLRWtavAAEcskb0XJ5OjJbVrYXWOTr8om921Scabn4/tzlx7j1Q==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.5.tgz", + "integrity": "sha512-4P+CWMJ6/j1W915ITJaUkadLObmCRRSC234uctJfn/vHrsLNxsR8dwlcXv9ZhJWzl77awf+mWXSZEKt5t0OnlA==", "requires": { "@babel/helper-module-imports": "^7.10.4", "@babel/helper-replace-supers": "^7.10.4", "@babel/helper-simple-access": "^7.10.4", "@babel/helper-split-export-declaration": "^7.10.4", "@babel/template": "^7.10.4", - "@babel/types": "^7.10.4", - "lodash": "^4.17.13" + "@babel/types": "^7.10.5", + "lodash": "^4.17.19" } }, "@babel/helper-optimise-call-expression": { @@ -276,28 +282,35 @@ } }, "@babel/traverse": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.4.tgz", - "integrity": "sha512-aSy7p5THgSYm4YyxNGz6jZpXf+Ok40QF3aA2LyIONkDHpAcJzDUqlCKXv6peqYUs2gmic849C/t2HKw2a2K20Q==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.5.tgz", + "integrity": "sha512-yc/fyv2gUjPqzTz0WHeRJH2pv7jA9kA7mBX2tXl/x5iOE81uaVPuGPtaYk7wmkx4b67mQ7NqI8rmT2pF47KYKQ==", "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.10.4", + "@babel/generator": "^7.10.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.10.4", - "@babel/parser": "^7.10.4", - "@babel/types": "^7.10.4", + "@babel/parser": "^7.10.5", + "@babel/types": "^7.10.5", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.13" + "lodash": "^4.17.19" + }, + "dependencies": { + "@babel/parser": { + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.5.tgz", + "integrity": "sha512-wfryxy4bE1UivvQKSQDU4/X6dr+i8bctjUjj8Zyt3DQy7NtPizJXT8M52nqpNKL+nq2PW8lxk4ZqLj0fD4B4hQ==" + } } }, "@babel/types": { - "version": "7.10.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.4.tgz", - "integrity": "sha512-UTCFOxC3FsFHb7lkRMVvgLzaRVamXuAs2Tz4wajva4WxtVY82eZeaUBtC2Zt95FU9TiznuC0Zk35tsim8jeVpg==", + "version": "7.10.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.5.tgz", + "integrity": "sha512-ixV66KWfCI6GKoA/2H9v6bQdbfXEwwpOdQ8cRvb4F+eyvhlaHxWFMQB4+3d9QFJXZsiiiqVrewNV0DFEQpyT4Q==", "requires": { "@babel/helper-validator-identifier": "^7.10.4", - "lodash": "^4.17.13", + "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" } }, @@ -419,116 +432,80 @@ "optional": true }, "@fink/cli": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@fink/cli/-/cli-6.0.0.tgz", - "integrity": "sha512-U8fXwA07HEESma6C6TjMtVUI+xUQLo7Byt8a+JUNA/ozImpdFfe9Ibi4tTD1QSPatSKxpSxtoT0mSnnBKP31IQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@fink/cli/-/cli-6.1.0.tgz", + "integrity": "sha512-P6omfYUBkqkRdtjmweziemjfaZW9/wmH7LEOc4IM4WyLLbR7o/jH+W5+zsAzvN1yTMMQ7o6EP2wQ2RSAUKWZCQ==", "dev": true, "requires": { - "@fink/std-lib": "^2.0.0", + "@fink/std-lib": "^3.0.0", "minimatch": "^3.0.4", "yargs": "^15.3.1" - }, - "dependencies": { - "@fink/std-lib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-2.4.0.tgz", - "integrity": "sha512-sT3eVoUtSoBZOyItQ8Fuo3dRTUPe5TBVmaj93fqO8E7jgE14dIIglMBEX7iXfWOGB5KUwKrHlx7nlNUahB+8Hw==", - "dev": true - } } }, "@fink/jest": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/@fink/jest/-/jest-5.0.3.tgz", - "integrity": "sha512-gVqkHcBLXV+Uwm6345xBjm/FvPHrAhriBl5bUwB2DY9bxvjwqtXsgUzhw6BbYJFcl2iASeQH3oEqEFvtZmzpSQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@fink/jest/-/jest-5.1.0.tgz", + "integrity": "sha512-cTMMx5xJSCrQALhoc2hOLYs28UnRBZ0lI6Lqn6D97kzzKmfnQK7/OzgYkDDaWQdD4HUvc1N2VbwGYZoER6cI4A==", "dev": true, "requires": { - "@babel/core": "^7.9.0", - "@fink/std-lib": "^2.0.0" - }, - "dependencies": { - "@fink/std-lib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-2.4.0.tgz", - "integrity": "sha512-sT3eVoUtSoBZOyItQ8Fuo3dRTUPe5TBVmaj93fqO8E7jgE14dIIglMBEX7iXfWOGB5KUwKrHlx7nlNUahB+8Hw==", - "dev": true - } + "@babel/core": "^7.10.5", + "@fink/js-interop": "^1.1.0", + "@fink/std-lib": "^3.0.0" } }, "@fink/js-interop": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@fink/js-interop/-/js-interop-1.0.0.tgz", - "integrity": "sha512-erKeeOKVNVPXfIK9p0hWW/C2RgNZ/W0HjlCWhWbtx9TLxQKDBebbMhyYbK5oPm5QyIJ8JnAiiOu7EjEAqOKgNA==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@fink/js-interop/-/js-interop-1.1.0.tgz", + "integrity": "sha512-m0HyNLPAnw41F4jmPweYfmm+l8Nhuk5uo8AalSYFFE0HNSXhJ/rQQK9skMD36SmR8j6hpR9RZ0abFVIol1+ZQQ==" }, "@fink/larix": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/@fink/larix/-/larix-12.0.0.tgz", - "integrity": "sha512-qszoAtqJ9D+jpxezcEXXN0vmmJiSfAXjzcIzzRbDqdbnCXuETw6gy3WXGjJZDByF/bhrx3CIL4yPsugweoVsdQ==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/@fink/larix/-/larix-12.1.0.tgz", + "integrity": "sha512-bEGYq6U1YM52mnICvui/ZwK1xYiR+99iEoRgNr0H0IF3KiZuC+K+1HGiR0b3tTzOcEzPVEABvio6fenVavtPYw==", "dev": true, "requires": { "@fink/prattler": "^5.0.0", - "@fink/std-lib": "^2.4.0" - }, - "dependencies": { - "@fink/std-lib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-2.4.0.tgz", - "integrity": "sha512-sT3eVoUtSoBZOyItQ8Fuo3dRTUPe5TBVmaj93fqO8E7jgE14dIIglMBEX7iXfWOGB5KUwKrHlx7nlNUahB+8Hw==", - "dev": true - } + "@fink/std-lib": "^3.1.0" } }, "@fink/loxia": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/@fink/loxia/-/loxia-12.0.1.tgz", - "integrity": "sha512-jgvi6cGVtEjiYg1CMVxjTZEOPgrboMOJ8JRaMvOCcXS4EuHdtfwJ2H3BwnxtsJQSGznmxeNFSPTgLR1xWymNWQ==", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/@fink/loxia/-/loxia-12.0.2.tgz", + "integrity": "sha512-/fT+pws7uMVnfZAb8CMzVLVuyNa0u1X+Bf8ejr87+Sabsv+GlO/CCwcwBapuOmztBY66yFmtvTJAfxhfoDT6Xg==", "dev": true, "requires": { "@babel/core": "^7.10.4", "@babel/traverse": "^7.10.4", "@babel/types": "^7.10.4", "@fink/js-interop": "^1.0.0", - "@fink/std-lib": "^2.4.0" - }, - "dependencies": { - "@fink/std-lib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-2.4.0.tgz", - "integrity": "sha512-sT3eVoUtSoBZOyItQ8Fuo3dRTUPe5TBVmaj93fqO8E7jgE14dIIglMBEX7iXfWOGB5KUwKrHlx7nlNUahB+8Hw==", - "dev": true - } + "@fink/std-lib": "^3.0.0" } }, "@fink/prattler": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@fink/prattler/-/prattler-5.1.0.tgz", - "integrity": "sha512-a2Zb23wGlSVRBzaoVFjqdLRUt5tROMiIMwgBz5Vbzo9YgtN/nIk/E3dv4TIgBY4l8zDCt2E2gg3QR2Mj9HT29Q==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@fink/prattler/-/prattler-5.2.0.tgz", + "integrity": "sha512-oNhP47aEsgF7ynX1JTUQS2cV+h4QAFju0q/DgUlcTnxYZyZkHrWWCceYV2Xbtj+UQ235rvoTcywuJGJpj9HzPg==", "dev": true, "requires": { - "@fink/snippet": "^1.0.1", - "@fink/std-lib": "^2.4.0" - }, - "dependencies": { - "@fink/std-lib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-2.4.0.tgz", - "integrity": "sha512-sT3eVoUtSoBZOyItQ8Fuo3dRTUPe5TBVmaj93fqO8E7jgE14dIIglMBEX7iXfWOGB5KUwKrHlx7nlNUahB+8Hw==", - "dev": true - } + "@fink/snippet": "^1.1.1", + "@fink/std-lib": "^3.1.1" } }, "@fink/snippet": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@fink/snippet/-/snippet-1.0.1.tgz", - "integrity": "sha512-zyE90rjv2HiUSN9Dj2P39qsyUPXhbgKwiX/g2libNKvdcd1kKJJbFR7dnsr0U3XMtvaIoTLwVw6xsR78zNUOtw==", - "dev": true + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@fink/snippet/-/snippet-1.1.1.tgz", + "integrity": "sha512-pv1bC5nB67J2wPjN7L2/uvTo3zgQFp4Ct7gafcE7Oe7NxKqRAcnZOz2892/8CUnGqE9TH7W37pt0ager5EO4pA==", + "dev": true, + "requires": { + "@fink/std-lib": "^3.1.1" + } }, "@fink/std-lib": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-3.0.0.tgz", - "integrity": "sha512-EC2fCkRBeL3kTfpFgNSroYDrQgYrfdH2WkAsFMzuFwbvrTiAiOHZmBkgCcdhAG8bl79tnwjFY/F/K4BmoQimZA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@fink/std-lib/-/std-lib-3.1.1.tgz", + "integrity": "sha512-2iwVR8mjg/7BEV27WMejLpg5QX9d5CYkXpBoQ55cF56SGCxVW41VZ+22U4EiYpsFcnaTXlBMACoLtNOlS3Mung==", "requires": { - "@fink/js-interop": "^1.0.0" + "@fink/js-interop": "^1.1.0" } }, "@istanbuljs/load-nyc-config": { diff --git a/package.json b/package.json index ed4a7dc..5cff77a 100644 --- a/package.json +++ b/package.json @@ -36,10 +36,10 @@ } }, "devDependencies": { - "@fink/cli": "^6.0.0", - "@fink/jest": "^5.0.2", - "@fink/larix": "^12.0.0", - "@fink/loxia": "^12.0.1", + "@fink/cli": "^6.1.0", + "@fink/jest": "^5.1.0", + "@fink/larix": "^12.1.0", + "@fink/loxia": "^12.0.2", "commitizen": "^4.1.2", "cz-conventional-changelog": "^3.1.0", "jest-cli": "^26.1.0", @@ -47,10 +47,10 @@ "semantic-release": "^17.1.1" }, "dependencies": { - "@babel/core": "^7.10.4", - "@babel/traverse": "^7.10.4", - "@babel/types": "^7.10.4", - "@fink/js-interop": "^1.0.0", - "@fink/std-lib": "^3.0.0" + "@babel/core": "^7.10.5", + "@babel/traverse": "^7.10.5", + "@babel/types": "^7.10.5", + "@fink/js-interop": "^1.1.0", + "@fink/std-lib": "^3.1.1" } } diff --git a/src/lang/assignment/index.fnk b/src/lang/assignment/index.fnk index 8c13dd2..c44f54b 100644 --- a/src/lang/assignment/index.fnk +++ b/src/lang/assignment/index.fnk @@ -12,12 +12,13 @@ {add, any} = import '../context' {transform_value} = import '../partial' + # TODO: std-lib find_index = fn iterable, func: iterable.findIndex func -is_spread_not_last = fn {left}: +has_spread_not_last = fn {left}: match left: {type: 'array', exprs: 1 < length ?}: idx = find_index left.exprs, fn expr: @@ -26,7 +27,8 @@ is_spread_not_last = fn {left}: else: false exprs_len = length left.exprs - idx > -1 and idx < exprs_len - 1 + # TODO: add support for -1 < idx < exprs_len - 1 + -1 < idx and idx < exprs_len - 1 else: false @@ -114,7 +116,7 @@ transform_spread_right = fn expr, ctx: transform_assign = fn node, ctx: match node: - is_spread_not_last ?: + has_spread_not_last ?: left = transform_spread_left node, ctx right = transform_spread_right node, ctx assignmentExpression '=', left, right diff --git a/src/lang/comparison/index.fnk b/src/lang/comparison/index.fnk index 88650dd..ce5d5c2 100644 --- a/src/lang/comparison/index.fnk +++ b/src/lang/comparison/index.fnk @@ -1,7 +1,8 @@ -{binaryExpression} = import '@babel/types' +{binaryExpression, logicalExpression} = import '@babel/types' {add, any} = import '../context' + transform_op = dict: '==': '===' '!=': '!==' @@ -11,9 +12,18 @@ transform_comp = fn {op, left, right}, {transform}: {(op): operator=op} = transform_op bin_left = transform left - bin_right = transform right - binaryExpression operator, bin_left, bin_right + match left: + {op: ? in ['<', '>', '<=', '>=', '==', '!=']}: + bin_right = binaryExpression + operator + bin_left.right + transform right + + logicalExpression '&&', bin_left, bin_right + else: + bin_right = transform right + binaryExpression operator, bin_left, bin_right add_comparison = fn ctx: diff --git a/src/lang/comparison/index.test.fnk b/src/lang/comparison/index.test.fnk new file mode 100644 index 0000000..1bf38a7 --- /dev/null +++ b/src/lang/comparison/index.test.fnk @@ -0,0 +1,29 @@ +{fink2js} = import '../../testing' +{describe, it, expect, to_match_snapshot} = import '@fink/jest' + + +describe 'comparison', fn: + it 'compiles simple', fn: + expect + fink2js " + lt = a < b + gt = a > b + eq = a == b + neq = a != b + gteq = a >= b + lteq = a <= b + " + to_match_snapshot + + + it 'compiles combined', fn: + expect + fink2js " + lt = a < b < c + gt = a > b > c + eq = a == b == c + neq = a != b != c + gteq = a >= b >= c + lteq = a <= b <= c + " + to_match_snapshot diff --git a/src/lang/comparison/index.test.fnk.snap b/src/lang/comparison/index.test.fnk.snap new file mode 100644 index 0000000..f87e051 --- /dev/null +++ b/src/lang/comparison/index.test.fnk.snap @@ -0,0 +1,19 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`comparison compiles combined 1`] = ` +"export const lt = a < b && b < c; +export const gt = a > b && b > c; +export const eq = a === b && b === c; +export const neq = a !== b && b !== c; +export const gteq = a >= b && b >= c; +export const lteq = a <= b && b <= c;" +`; + +exports[`comparison compiles simple 1`] = ` +"export const lt = a < b; +export const gt = a > b; +export const eq = a === b; +export const neq = a !== b; +export const gteq = a >= b; +export const lteq = a <= b;" +`; diff --git a/src/lang/iterable/fold.fnk b/src/lang/iterable/fold.fnk index 4ed3ab9..8ca9c8a 100644 --- a/src/lang/iterable/fold.fnk +++ b/src/lang/iterable/fold.fnk @@ -1,8 +1,9 @@ -{assign, for_of, func, lets} = import '../../js/types' +{assign, for_of, func, lets, undef} = import '../../js/types' {block_statement} = import '../block' {transform_init} = import './common' + transform_fold = fn node, ctx: {transform, unique_ident} = ctx @@ -12,16 +13,24 @@ transform_fold = fn node, ctx: item_init = transform_init item_arg, item, ctx acc = unique_ident 'accu' - acc_assign = transform_init acc_arg.left, acc, ctx + + acc_init = match acc_arg: + {}: transform acc_arg.right + else: undef _ + + acc_assign = match acc_arg: + {}: [transform_init acc_arg.left, acc, ctx] + else: [] + items = unique_ident 'items' [...expressions, last_expr] = node.exprs func [items], - lets acc, transform acc_arg.right + lets acc, acc_init for_of [item, items], - acc_assign + ...acc_assign item_init ...pipe expressions: diff --git a/src/lang/iterable/fold.test.fnk b/src/lang/iterable/fold.test.fnk index 7e181bd..6264513 100644 --- a/src/lang/iterable/fold.test.fnk +++ b/src/lang/iterable/fold.test.fnk @@ -13,6 +13,15 @@ describe 'fold', fn: to_match_snapshot + it 'compiles without accu', fn: + expect + fink2js ' + fold item: + item + ' + to_match_snapshot + + it 'destructuring item', fn: expect fink2js ' diff --git a/src/lang/iterable/fold.test.fnk.snap b/src/lang/iterable/fold.test.fnk.snap index a8b99e0..508b8d4 100644 --- a/src/lang/iterable/fold.test.fnk.snap +++ b/src/lang/iterable/fold.test.fnk.snap @@ -30,6 +30,19 @@ exports[`fold compiles 1`] = ` };" `; +exports[`fold compiles without accu 1`] = ` +"ˆitems_3 => { + let ˆaccu_2 = undefined; + + for (const ˆitem_1 of ˆitems_3) { + const item = ˆitem_1; + ˆaccu_2 = item; + } + + return ˆaccu_2; +};" +`; + exports[`fold destructuring accu 1`] = ` "ˆitems_3 => { let ˆaccu_2 = []; diff --git a/src/lang/literals/string.fnk b/src/lang/literals/string.fnk index ac72e1f..0b1be88 100644 --- a/src/lang/literals/string.fnk +++ b/src/lang/literals/string.fnk @@ -23,7 +23,6 @@ transform_string = fn node, {transform}: templ_str = templateLiteral quasies, expressions - # TODO: use simple string if no exprs and not tagged match tag: not_tagged: templ_str