circuitscript 0.0.26 → 0.0.27
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/dist/cjs/BaseVisitor.js +7 -1
- package/dist/cjs/antlr/CircuitScriptParser.js +736 -677
- package/dist/cjs/draw_symbols.js +36 -14
- package/dist/cjs/execute.js +67 -0
- package/dist/cjs/geometry.js +45 -26
- package/dist/cjs/helpers.js +1 -0
- package/dist/cjs/layout.js +37 -17
- package/dist/cjs/objects/ClassComponent.js +7 -0
- package/dist/cjs/objects/types.js +8 -1
- package/dist/cjs/visitor.js +49 -10
- package/dist/esm/BaseVisitor.mjs +8 -2
- package/dist/esm/antlr/CircuitScriptParser.mjs +734 -676
- package/dist/esm/antlr/CircuitScriptVisitor.mjs +1 -0
- package/dist/esm/draw_symbols.mjs +37 -15
- package/dist/esm/execute.mjs +67 -0
- package/dist/esm/geometry.mjs +44 -25
- package/dist/esm/helpers.mjs +1 -0
- package/dist/esm/layout.mjs +35 -16
- package/dist/esm/objects/ClassComponent.mjs +7 -0
- package/dist/esm/objects/types.mjs +7 -0
- package/dist/esm/visitor.mjs +50 -11
- package/dist/types/BaseVisitor.d.ts +2 -2
- package/dist/types/antlr/CircuitScriptParser.d.ts +28 -19
- package/dist/types/antlr/CircuitScriptVisitor.d.ts +2 -0
- package/dist/types/draw_symbols.d.ts +8 -3
- package/dist/types/execute.d.ts +4 -0
- package/dist/types/geometry.d.ts +12 -9
- package/dist/types/layout.d.ts +5 -0
- package/dist/types/objects/ClassComponent.d.ts +4 -0
- package/dist/types/objects/Wire.d.ts +2 -1
- package/dist/types/objects/types.d.ts +6 -0
- package/dist/types/visitor.d.ts +3 -2
- package/libs/lib.cst +20 -3
- package/package.json +1 -1
package/dist/cjs/BaseVisitor.js
CHANGED
|
@@ -19,7 +19,8 @@ class BaseVisitor extends CircuitScriptVisitor_1.CircuitScriptVisitor {
|
|
|
19
19
|
this.silent = false;
|
|
20
20
|
this.printStream = [];
|
|
21
21
|
this.printToConsole = true;
|
|
22
|
-
this.acceptedDirections = [
|
|
22
|
+
this.acceptedDirections = [types_1.Direction.Up, types_1.Direction.Down,
|
|
23
|
+
types_1.Direction.Right, types_1.Direction.Left];
|
|
23
24
|
this.acceptedFlip = ['flipX', 'flipY'];
|
|
24
25
|
this.resultData = new Map;
|
|
25
26
|
this.paramData = new Map;
|
|
@@ -416,6 +417,11 @@ class BaseVisitor extends CircuitScriptVisitor_1.CircuitScriptVisitor {
|
|
|
416
417
|
}
|
|
417
418
|
}
|
|
418
419
|
}
|
|
420
|
+
else if (tmpPassedInArgs[0] === 'keyword') {
|
|
421
|
+
const variableName = tmpPassedInArgs[1];
|
|
422
|
+
executor.log('set variable in scope, var name: ', variableName);
|
|
423
|
+
executor.scope.variables.set(variableName, tmpPassedInArgs[2]);
|
|
424
|
+
}
|
|
419
425
|
}
|
|
420
426
|
else if (tmpFuncArg.length === 2) {
|
|
421
427
|
const variableName = tmpFuncArg[0];
|