circuitscript 0.0.26 → 0.0.28
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 +37 -15
- 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 +38 -16
- 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 +19 -4
- package/package.json +1 -1
package/dist/esm/BaseVisitor.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { Logger } from "./logger";
|
|
|
7
7
|
import { ClassComponent } from "./objects/ClassComponent";
|
|
8
8
|
import { NumericValue, PercentageValue, PinBlankValue } from "./objects/ParamDefinition";
|
|
9
9
|
import { PinTypes } from "./objects/PinTypes";
|
|
10
|
-
import { UndeclaredReference } from "./objects/types";
|
|
10
|
+
import { Direction, UndeclaredReference } from "./objects/types";
|
|
11
11
|
import { ReferenceTypes } from './globals';
|
|
12
12
|
export class BaseVisitor extends CircuitScriptVisitor {
|
|
13
13
|
indentLevel = 0;
|
|
@@ -19,7 +19,8 @@ export class BaseVisitor extends CircuitScriptVisitor {
|
|
|
19
19
|
defaultLibsPath;
|
|
20
20
|
printStream = [];
|
|
21
21
|
printToConsole = true;
|
|
22
|
-
acceptedDirections = [
|
|
22
|
+
acceptedDirections = [Direction.Up, Direction.Down,
|
|
23
|
+
Direction.Right, Direction.Left];
|
|
23
24
|
acceptedFlip = ['flipX', 'flipY'];
|
|
24
25
|
resultData = new Map;
|
|
25
26
|
paramData = new Map;
|
|
@@ -418,6 +419,11 @@ export class BaseVisitor extends CircuitScriptVisitor {
|
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
}
|
|
422
|
+
else if (tmpPassedInArgs[0] === 'keyword') {
|
|
423
|
+
const variableName = tmpPassedInArgs[1];
|
|
424
|
+
executor.log('set variable in scope, var name: ', variableName);
|
|
425
|
+
executor.scope.variables.set(variableName, tmpPassedInArgs[2]);
|
|
426
|
+
}
|
|
421
427
|
}
|
|
422
428
|
else if (tmpFuncArg.length === 2) {
|
|
423
429
|
const variableName = tmpFuncArg[0];
|