circuitscript 0.5.6 → 0.5.7
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/execute.js
CHANGED
|
@@ -374,6 +374,7 @@ class ExecutionContext {
|
|
|
374
374
|
this.applyComponentAngleFromWire(component, pinId);
|
|
375
375
|
this.scope.setCurrent(component, pinId);
|
|
376
376
|
this.scope.clearActive();
|
|
377
|
+
this.log('clear active wire/frame (to component)');
|
|
377
378
|
if (addSequence) {
|
|
378
379
|
if (this.scope.sequence.length > 0) {
|
|
379
380
|
const [entryType, , segments] = this.scope.sequence[this.scope.sequence.length - 1];
|
|
@@ -410,6 +411,7 @@ class ExecutionContext {
|
|
|
410
411
|
this.scope.setNet(component, usePinId, tmpNet);
|
|
411
412
|
}
|
|
412
413
|
this.scope.clearActive();
|
|
414
|
+
this.log('clear active wire/frame (at component)');
|
|
413
415
|
if (addSequence) {
|
|
414
416
|
this.scope.sequence.push([ExecutionScope_js_1.SequenceAction.At,
|
|
415
417
|
component, usePinId]);
|
|
@@ -448,8 +450,12 @@ class ExecutionContext {
|
|
|
448
450
|
|| blockType === BlockTypes_js_1.BlockTypes.Parallel
|
|
449
451
|
|| blockType === BlockTypes_js_1.BlockTypes.Branch) {
|
|
450
452
|
const key = (0, utils_js_1.getBlockTypeString)(blockType);
|
|
453
|
+
const wireIdBefore = this.scope.currentWireId;
|
|
451
454
|
this.addPoint(`${globals_js_1.Delimiter1}${key}.${this.name}.${this.tmpPointId}`, false);
|
|
452
455
|
this.tmpPointId += 1;
|
|
456
|
+
if (wireIdBefore !== -1) {
|
|
457
|
+
this.scope.currentWireId = wireIdBefore;
|
|
458
|
+
}
|
|
453
459
|
}
|
|
454
460
|
this.scope.blockStack.set(this.scope.scopeLevel, {
|
|
455
461
|
start_point: [
|
|
@@ -9,13 +9,15 @@ const environment_js_1 = require("./environment/environment.js");
|
|
|
9
9
|
const mainDir = './__tests__/testData/renderData/';
|
|
10
10
|
const env = new environment_js_1.NodeScriptEnvironment();
|
|
11
11
|
environment_js_1.NodeScriptEnvironment.setInstance(env);
|
|
12
|
-
async function regenerateTests(extra = "") {
|
|
12
|
+
async function regenerateTests(extra = "", fileList = []) {
|
|
13
13
|
await env.prepareSVGEnvironment();
|
|
14
14
|
const cstFiles = [];
|
|
15
15
|
const files = fs_1.default.readdirSync(mainDir);
|
|
16
16
|
files.forEach(file => {
|
|
17
17
|
if (file.endsWith('.cst') && file.startsWith('script')) {
|
|
18
|
-
|
|
18
|
+
if (fileList.length === 0 || fileList.includes(file)) {
|
|
19
|
+
cstFiles.push(file);
|
|
20
|
+
}
|
|
19
21
|
}
|
|
20
22
|
});
|
|
21
23
|
for (let i = 0; i < cstFiles.length; i++) {
|
|
@@ -38,8 +40,15 @@ async function regenerateTests(extra = "") {
|
|
|
38
40
|
(async () => {
|
|
39
41
|
const generateDiff = (process.argv.indexOf('-diff') !== -1);
|
|
40
42
|
console.log('diff flag: ', generateDiff);
|
|
43
|
+
const listIndex = process.argv.indexOf('--list');
|
|
44
|
+
const fileList = listIndex !== -1 && process.argv[listIndex + 1]
|
|
45
|
+
? process.argv[listIndex + 1].split(',').map(f => f.trim())
|
|
46
|
+
: [];
|
|
47
|
+
if (fileList.length > 0) {
|
|
48
|
+
console.log('filtering to files: ', fileList);
|
|
49
|
+
}
|
|
41
50
|
const nextExtra = generateDiff ? '.next' : '';
|
|
42
|
-
const cstFiles = await regenerateTests(nextExtra);
|
|
51
|
+
const cstFiles = await regenerateTests(nextExtra, fileList);
|
|
43
52
|
const allFiles = [];
|
|
44
53
|
if (generateDiff) {
|
|
45
54
|
cstFiles.forEach(file => {
|
package/dist/esm/execute.js
CHANGED
|
@@ -379,6 +379,7 @@ export class ExecutionContext {
|
|
|
379
379
|
this.applyComponentAngleFromWire(component, pinId);
|
|
380
380
|
this.scope.setCurrent(component, pinId);
|
|
381
381
|
this.scope.clearActive();
|
|
382
|
+
this.log('clear active wire/frame (to component)');
|
|
382
383
|
if (addSequence) {
|
|
383
384
|
if (this.scope.sequence.length > 0) {
|
|
384
385
|
const [entryType, , segments] = this.scope.sequence[this.scope.sequence.length - 1];
|
|
@@ -415,6 +416,7 @@ export class ExecutionContext {
|
|
|
415
416
|
this.scope.setNet(component, usePinId, tmpNet);
|
|
416
417
|
}
|
|
417
418
|
this.scope.clearActive();
|
|
419
|
+
this.log('clear active wire/frame (at component)');
|
|
418
420
|
if (addSequence) {
|
|
419
421
|
this.scope.sequence.push([SequenceAction.At,
|
|
420
422
|
component, usePinId]);
|
|
@@ -453,8 +455,12 @@ export class ExecutionContext {
|
|
|
453
455
|
|| blockType === BlockTypes.Parallel
|
|
454
456
|
|| blockType === BlockTypes.Branch) {
|
|
455
457
|
const key = getBlockTypeString(blockType);
|
|
458
|
+
const wireIdBefore = this.scope.currentWireId;
|
|
456
459
|
this.addPoint(`${Delimiter1}${key}.${this.name}.${this.tmpPointId}`, false);
|
|
457
460
|
this.tmpPointId += 1;
|
|
461
|
+
if (wireIdBefore !== -1) {
|
|
462
|
+
this.scope.currentWireId = wireIdBefore;
|
|
463
|
+
}
|
|
458
464
|
}
|
|
459
465
|
this.scope.blockStack.set(this.scope.scopeLevel, {
|
|
460
466
|
start_point: [
|
|
@@ -4,13 +4,15 @@ import { NodeScriptEnvironment } from "./environment/environment.js";
|
|
|
4
4
|
const mainDir = './__tests__/testData/renderData/';
|
|
5
5
|
const env = new NodeScriptEnvironment();
|
|
6
6
|
NodeScriptEnvironment.setInstance(env);
|
|
7
|
-
async function regenerateTests(extra = "") {
|
|
7
|
+
async function regenerateTests(extra = "", fileList = []) {
|
|
8
8
|
await env.prepareSVGEnvironment();
|
|
9
9
|
const cstFiles = [];
|
|
10
10
|
const files = fs.readdirSync(mainDir);
|
|
11
11
|
files.forEach(file => {
|
|
12
12
|
if (file.endsWith('.cst') && file.startsWith('script')) {
|
|
13
|
-
|
|
13
|
+
if (fileList.length === 0 || fileList.includes(file)) {
|
|
14
|
+
cstFiles.push(file);
|
|
15
|
+
}
|
|
14
16
|
}
|
|
15
17
|
});
|
|
16
18
|
for (let i = 0; i < cstFiles.length; i++) {
|
|
@@ -33,8 +35,15 @@ async function regenerateTests(extra = "") {
|
|
|
33
35
|
(async () => {
|
|
34
36
|
const generateDiff = (process.argv.indexOf('-diff') !== -1);
|
|
35
37
|
console.log('diff flag: ', generateDiff);
|
|
38
|
+
const listIndex = process.argv.indexOf('--list');
|
|
39
|
+
const fileList = listIndex !== -1 && process.argv[listIndex + 1]
|
|
40
|
+
? process.argv[listIndex + 1].split(',').map(f => f.trim())
|
|
41
|
+
: [];
|
|
42
|
+
if (fileList.length > 0) {
|
|
43
|
+
console.log('filtering to files: ', fileList);
|
|
44
|
+
}
|
|
36
45
|
const nextExtra = generateDiff ? '.next' : '';
|
|
37
|
-
const cstFiles = await regenerateTests(nextExtra);
|
|
46
|
+
const cstFiles = await regenerateTests(nextExtra, fileList);
|
|
38
47
|
const allFiles = [];
|
|
39
48
|
if (generateDiff) {
|
|
40
49
|
cstFiles.forEach(file => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "circuitscript",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Interpreter for the circuitscript language",
|
|
5
5
|
"homepage": "https://circuitscript.net",
|
|
6
6
|
"engines": {
|
|
@@ -24,12 +24,14 @@
|
|
|
24
24
|
"libs"
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
+
"@resvg/resvg-js": "^2.6.2",
|
|
27
28
|
"@types/big.js": "^6.2.2",
|
|
28
29
|
"@types/crypto-js": "^4.2.2",
|
|
29
30
|
"@types/figlet": "^1.5.8",
|
|
30
31
|
"@types/jest": "~29.5",
|
|
31
32
|
"@types/node": "~18",
|
|
32
33
|
"@types/pdfkit": "^0.13.6",
|
|
34
|
+
"@types/pngjs": "^6.0.5",
|
|
33
35
|
"@types/svg-to-pdfkit": "^0.1.3",
|
|
34
36
|
"@types/svgdom": "^0.1.2",
|
|
35
37
|
"@typescript-eslint/eslint-plugin": "~5.59",
|
|
@@ -40,6 +42,8 @@
|
|
|
40
42
|
"eslint-plugin-jest": "~27.2",
|
|
41
43
|
"jest": "~29.5",
|
|
42
44
|
"license-check-and-add": "^4.0.5",
|
|
45
|
+
"pixelmatch": "^7.1.0",
|
|
46
|
+
"pngjs": "^7.0.0",
|
|
43
47
|
"prettier": "~2.8",
|
|
44
48
|
"rimraf": "~5.0",
|
|
45
49
|
"source-map-support": "^0.5.21",
|