@graffiticode/basis 1.5.11 → 1.5.12

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/compiler.js +16 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@graffiticode/basis",
3
3
  "type": "module",
4
- "version": "1.5.11",
4
+ "version": "1.5.12",
5
5
  "description": "The basis library for creating Graffiticode languages",
6
6
  "main": "index.js",
7
7
  "scripts": {
package/src/compiler.js CHANGED
@@ -848,6 +848,22 @@ export class Transformer extends Visitor {
848
848
  });
849
849
  });
850
850
  }
851
+ SET(node, options, resume) {
852
+ this.visit(node.elts[0], options, (e0, v0) => {
853
+ this.visit(node.elts[1], options, (e1, v1) => {
854
+ this.visit(node.elts[2], options, (e2, v2) => {
855
+ const err = [...e0, ...e1];
856
+ assert(typeof v0 === "object", "Type Error: expected v0 to be an object.");
857
+ assert(typeof v1 === "string", "Type Error: expected v1 to be a string.");
858
+ const val = {
859
+ ...v0,
860
+ [v1]: v2,
861
+ };
862
+ resume(err, val);
863
+ });
864
+ });
865
+ });
866
+ }
851
867
  NTH(node, options, resume) {
852
868
  this.visit(node.elts[0], options, (e0, v0) => {
853
869
  this.visit(node.elts[1], options, (e1, v1) => {