@graffiticode/basis 1.5.15 → 1.5.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/compiler.js +16 -2
package/package.json
CHANGED
package/src/compiler.js
CHANGED
|
@@ -97,6 +97,11 @@ export class Checker extends Visitor {
|
|
|
97
97
|
resume(err, data);
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
+
CATCH_ALL(node, options, resume) {
|
|
101
|
+
const err = [];
|
|
102
|
+
const val = node;
|
|
103
|
+
resume(err, val);
|
|
104
|
+
}
|
|
100
105
|
ERROR(node, options, resume) {
|
|
101
106
|
this.visit(node.elts[0], options, (e0, v0) => {
|
|
102
107
|
this.visit(node.elts[1], options, (e1, v1) => {
|
|
@@ -536,7 +541,11 @@ export class Transformer extends Visitor {
|
|
|
536
541
|
// }
|
|
537
542
|
return matches;
|
|
538
543
|
}
|
|
539
|
-
|
|
544
|
+
CATCH_ALL(node, options, resume) {
|
|
545
|
+
const err = [];
|
|
546
|
+
const val = node; // Use the node as the tag value.
|
|
547
|
+
resume(err, val);
|
|
548
|
+
}
|
|
540
549
|
PROG(node, options, resume) {
|
|
541
550
|
if (!options) {
|
|
542
551
|
options = {};
|
|
@@ -842,6 +851,10 @@ export class Transformer extends Visitor {
|
|
|
842
851
|
this.visit(node.elts[1], options, (e1, v1) => {
|
|
843
852
|
let err = [];
|
|
844
853
|
let val = [];
|
|
854
|
+
console.log(
|
|
855
|
+
"MAP()",
|
|
856
|
+
"v1=" + JSON.stringify(v1),
|
|
857
|
+
);
|
|
845
858
|
v1.forEach(args => {
|
|
846
859
|
options.args = args;
|
|
847
860
|
options = JSON.parse(JSON.stringify(options)); // Copy option arg support async.
|
|
@@ -916,7 +929,8 @@ export class Transformer extends Visitor {
|
|
|
916
929
|
const type = typeof v0;
|
|
917
930
|
const val = `${v0}`;
|
|
918
931
|
const expr = (
|
|
919
|
-
|
|
932
|
+
v0 === null && {tag: "NUL", elts: []} ||
|
|
933
|
+
v0.tag !== undefined && v0 || // We've got a tag value.
|
|
920
934
|
type === "boolean" && {tag: "BOOL", elts: [val]} ||
|
|
921
935
|
type === "number" && {tag: "NUM", elts: [val]} ||
|
|
922
936
|
{tag: "STR", elts: [val]}
|