circuitscript 0.1.16 → 0.1.18
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 +2 -1
- package/dist/cjs/draw_symbols.js +18 -17
- package/dist/cjs/execute.js +45 -26
- package/dist/cjs/export.js +3 -3
- package/dist/cjs/globals.js +1 -0
- package/dist/cjs/graph.js +101 -27
- package/dist/cjs/helpers.js +55 -22
- package/dist/cjs/layout.js +6 -1
- package/dist/cjs/objects/ClassComponent.js +27 -20
- package/dist/cjs/objects/ExecutionScope.js +9 -4
- package/dist/cjs/objects/Net.js +2 -1
- package/dist/cjs/objects/PinDefinition.js +55 -3
- package/dist/cjs/objects/types.js +17 -1
- package/dist/cjs/visitor.js +78 -20
- package/dist/esm/BaseVisitor.js +2 -1
- package/dist/esm/draw_symbols.js +18 -17
- package/dist/esm/execute.js +46 -27
- package/dist/esm/export.js +1 -1
- package/dist/esm/globals.js +1 -0
- package/dist/esm/graph.js +79 -28
- package/dist/esm/helpers.js +46 -21
- package/dist/esm/layout.js +6 -1
- package/dist/esm/objects/ClassComponent.js +28 -21
- package/dist/esm/objects/ExecutionScope.js +9 -4
- package/dist/esm/objects/Net.js +2 -1
- package/dist/esm/objects/PinDefinition.js +53 -2
- package/dist/esm/objects/types.js +16 -0
- package/dist/esm/visitor.js +80 -22
- package/dist/libs/std.cst +3 -2
- package/dist/types/BaseVisitor.d.ts +2 -1
- package/dist/types/draw_symbols.d.ts +13 -7
- package/dist/types/execute.d.ts +7 -7
- package/dist/types/export.d.ts +2 -2
- package/dist/types/globals.d.ts +1 -0
- package/dist/types/graph.d.ts +2 -1
- package/dist/types/helpers.d.ts +15 -2
- package/dist/types/layout.d.ts +2 -1
- package/dist/types/objects/ClassComponent.d.ts +8 -8
- package/dist/types/objects/ExecutionScope.d.ts +7 -6
- package/dist/types/objects/Net.d.ts +3 -2
- package/dist/types/objects/PinDefinition.d.ts +17 -2
- package/dist/types/objects/types.d.ts +17 -2
- package/dist/types/visitor.d.ts +1 -0
- package/libs/std.cst +3 -2
- package/package.json +2 -1
|
@@ -4,6 +4,7 @@ import { ClassComponent } from './ClassComponent.js';
|
|
|
4
4
|
import { Net } from './Net.js';
|
|
5
5
|
import { NumericValue, PercentageValue } from './ParamDefinition.js';
|
|
6
6
|
import { ReferenceTypes } from '../globals.js';
|
|
7
|
+
import { PinId } from './PinDefinition.js';
|
|
7
8
|
export type CFunction = (args: CallableParameter[], options?: CFunctionOptions) => CFunctionResult;
|
|
8
9
|
export declare class CFunctionEntry {
|
|
9
10
|
name: string;
|
|
@@ -27,7 +28,7 @@ export type ComponentPinNet = [
|
|
|
27
28
|
];
|
|
28
29
|
export type ComponentPinNetPair = [
|
|
29
30
|
component: ClassComponent,
|
|
30
|
-
pin:
|
|
31
|
+
pin: PinId,
|
|
31
32
|
net: Net
|
|
32
33
|
];
|
|
33
34
|
export type ComponentPinWireId = [
|
|
@@ -37,7 +38,7 @@ export type ComponentPinWireId = [
|
|
|
37
38
|
];
|
|
38
39
|
export type ComponentPin = [
|
|
39
40
|
component: ClassComponent,
|
|
40
|
-
pinId:
|
|
41
|
+
pinId: PinId
|
|
41
42
|
];
|
|
42
43
|
export type ComplexType = ValueType | ClassComponent | UndeclaredReference | null;
|
|
43
44
|
export type ValueType = boolean | number | string | NumericValue | PercentageValue;
|
|
@@ -95,3 +96,17 @@ export declare enum Direction {
|
|
|
95
96
|
Down = "down",
|
|
96
97
|
Up = "up"
|
|
97
98
|
}
|
|
99
|
+
export declare enum TypeProps {
|
|
100
|
+
Net = "net",
|
|
101
|
+
Port = "port",
|
|
102
|
+
Graphic = "graphic",
|
|
103
|
+
Module = "module",
|
|
104
|
+
Resistor = "res",
|
|
105
|
+
Capacitor = "cap",
|
|
106
|
+
Inductor = "ind",
|
|
107
|
+
Diode = "diode"
|
|
108
|
+
}
|
|
109
|
+
export declare enum NetTypes {
|
|
110
|
+
Any = "any",
|
|
111
|
+
Source = "source"
|
|
112
|
+
}
|
package/dist/types/visitor.d.ts
CHANGED
package/libs/std.cst
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Circuitscript default lib
|
|
2
2
|
|
|
3
|
-
def net(net_name):
|
|
3
|
+
def net(net_name, net_type = "any"):
|
|
4
4
|
return create component:
|
|
5
5
|
pins: 1
|
|
6
6
|
copy: true
|
|
@@ -13,9 +13,10 @@ def net(net_name):
|
|
|
13
13
|
params:
|
|
14
14
|
net_name: net_name
|
|
15
15
|
priority: 10
|
|
16
|
+
net_type: net_type
|
|
16
17
|
|
|
17
18
|
def supply(net_name):
|
|
18
|
-
net_obj = net(net_name)
|
|
19
|
+
net_obj = net(net_name, "source")
|
|
19
20
|
return net_obj
|
|
20
21
|
|
|
21
22
|
def label(value, anchor="left"):
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "circuitscript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "Interpreter for the circuitscript language",
|
|
5
5
|
"homepage": "https://circuitscript.net",
|
|
6
6
|
"engines": {
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
"express": "^4.18.2",
|
|
89
89
|
"figlet": "^1.7.0",
|
|
90
90
|
"lodash": "^4.17.21",
|
|
91
|
+
"ml-matrix": "^6.12.1",
|
|
91
92
|
"pdfkit": "^0.15.1",
|
|
92
93
|
"svg-to-pdfkit": "^0.1.8",
|
|
93
94
|
"svgdom": "^0.1.22",
|