circuitscript 0.5.7 → 0.6.0
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 +1 -0
- package/dist/cjs/annotate/RefdesAnnotationVisitor.js +1 -3
- package/dist/cjs/antlr/CircuitScriptParser.js +1070 -840
- package/dist/cjs/cache/serializer.js +1 -1
- package/dist/cjs/execute.js +12 -7
- package/dist/cjs/objects/BlockTypes.js +1 -0
- package/dist/cjs/objects/Frame.js +4 -0
- package/dist/cjs/render/draw_symbols.js +18 -12
- package/dist/cjs/render/geometry.js +2 -2
- package/dist/cjs/render/layout.js +26 -2
- package/dist/cjs/sizing.js +3 -2
- package/dist/cjs/visitor.js +85 -18
- package/dist/esm/BaseVisitor.js +1 -0
- package/dist/esm/annotate/RefdesAnnotationVisitor.js +1 -3
- package/dist/esm/antlr/CircuitScriptParser.js +1063 -835
- package/dist/esm/antlr/CircuitScriptParserVisitor.js +2 -0
- package/dist/esm/cache/serializer.js +1 -1
- package/dist/esm/execute.js +12 -7
- package/dist/esm/objects/BlockTypes.js +1 -0
- package/dist/esm/objects/Frame.js +4 -0
- package/dist/esm/render/draw_symbols.js +18 -12
- package/dist/esm/render/geometry.js +2 -2
- package/dist/esm/render/layout.js +26 -2
- package/dist/esm/sizing.js +3 -2
- package/dist/esm/visitor.js +85 -18
- package/dist/libs/std.cst +3 -1
- package/dist/types/BaseVisitor.d.ts +2 -2
- package/dist/types/antlr/CircuitScriptParser.d.ts +83 -63
- package/dist/types/antlr/CircuitScriptParserVisitor.d.ts +4 -0
- package/dist/types/execute.d.ts +1 -0
- package/dist/types/objects/BlockTypes.d.ts +2 -1
- package/dist/types/objects/Frame.d.ts +4 -0
- package/dist/types/render/draw_symbols.d.ts +3 -3
- package/dist/types/render/geometry.d.ts +1 -0
- package/dist/types/render/layout.d.ts +6 -0
- package/dist/types/sizing.d.ts +1 -1
- package/dist/types/visitor.d.ts +2 -1
- package/libs/std.cst +3 -1
- package/package.json +1 -1
|
@@ -73,61 +73,63 @@ export declare class CircuitScriptParser extends antlr.Parser {
|
|
|
73
73
|
static readonly ID = 69;
|
|
74
74
|
static readonly RULE_script = 0;
|
|
75
75
|
static readonly RULE_expression = 1;
|
|
76
|
-
static readonly
|
|
77
|
-
static readonly
|
|
78
|
-
static readonly
|
|
79
|
-
static readonly
|
|
80
|
-
static readonly
|
|
81
|
-
static readonly
|
|
82
|
-
static readonly
|
|
83
|
-
static readonly
|
|
84
|
-
static readonly
|
|
85
|
-
static readonly
|
|
86
|
-
static readonly
|
|
87
|
-
static readonly
|
|
88
|
-
static readonly
|
|
89
|
-
static readonly
|
|
90
|
-
static readonly
|
|
91
|
-
static readonly
|
|
92
|
-
static readonly
|
|
93
|
-
static readonly
|
|
94
|
-
static readonly
|
|
95
|
-
static readonly
|
|
96
|
-
static readonly
|
|
97
|
-
static readonly
|
|
98
|
-
static readonly
|
|
99
|
-
static readonly
|
|
100
|
-
static readonly
|
|
101
|
-
static readonly
|
|
102
|
-
static readonly
|
|
103
|
-
static readonly
|
|
104
|
-
static readonly
|
|
105
|
-
static readonly
|
|
106
|
-
static readonly
|
|
107
|
-
static readonly
|
|
108
|
-
static readonly
|
|
109
|
-
static readonly
|
|
110
|
-
static readonly
|
|
111
|
-
static readonly
|
|
112
|
-
static readonly
|
|
113
|
-
static readonly
|
|
114
|
-
static readonly
|
|
115
|
-
static readonly
|
|
116
|
-
static readonly
|
|
117
|
-
static readonly
|
|
118
|
-
static readonly
|
|
119
|
-
static readonly
|
|
120
|
-
static readonly
|
|
121
|
-
static readonly
|
|
122
|
-
static readonly
|
|
123
|
-
static readonly
|
|
124
|
-
static readonly
|
|
125
|
-
static readonly
|
|
126
|
-
static readonly
|
|
127
|
-
static readonly
|
|
128
|
-
static readonly
|
|
129
|
-
static readonly
|
|
130
|
-
static readonly
|
|
76
|
+
static readonly RULE_non_newline_expression = 2;
|
|
77
|
+
static readonly RULE_flow_expressions = 3;
|
|
78
|
+
static readonly RULE_graph_expressions = 4;
|
|
79
|
+
static readonly RULE_expressions_block = 5;
|
|
80
|
+
static readonly RULE_path_block = 6;
|
|
81
|
+
static readonly RULE_pin_select_expr = 7;
|
|
82
|
+
static readonly RULE_component_modifier_expr = 8;
|
|
83
|
+
static readonly RULE_data_expr_with_assignment = 9;
|
|
84
|
+
static readonly RULE_assignment_expr = 10;
|
|
85
|
+
static readonly RULE_add_component_expr = 11;
|
|
86
|
+
static readonly RULE_component_select_expr = 12;
|
|
87
|
+
static readonly RULE_at_component_expr = 13;
|
|
88
|
+
static readonly RULE_to_component_expr = 14;
|
|
89
|
+
static readonly RULE_at_block_header = 15;
|
|
90
|
+
static readonly RULE_at_block = 16;
|
|
91
|
+
static readonly RULE_at_block_expressions = 17;
|
|
92
|
+
static readonly RULE_at_block_expressions_inner = 18;
|
|
93
|
+
static readonly RULE_at_block_pin_expr = 19;
|
|
94
|
+
static readonly RULE_keyword_assignment_expr = 20;
|
|
95
|
+
static readonly RULE_parameters = 21;
|
|
96
|
+
static readonly RULE_double_dot_property_set_expr = 22;
|
|
97
|
+
static readonly RULE_data_expr = 23;
|
|
98
|
+
static readonly RULE_value_expr = 24;
|
|
99
|
+
static readonly RULE_function_def_expr = 25;
|
|
100
|
+
static readonly RULE_function_expr = 26;
|
|
101
|
+
static readonly RULE_function_args_expr = 27;
|
|
102
|
+
static readonly RULE_function_return_expr = 28;
|
|
103
|
+
static readonly RULE_net_namespace_expr = 29;
|
|
104
|
+
static readonly RULE_callable_expr = 30;
|
|
105
|
+
static readonly RULE_trailer = 31;
|
|
106
|
+
static readonly RULE_property_block_expr = 32;
|
|
107
|
+
static readonly RULE_properties_block = 33;
|
|
108
|
+
static readonly RULE_graphic_expressions_block = 34;
|
|
109
|
+
static readonly RULE_create_expr = 35;
|
|
110
|
+
static readonly RULE_create_component_expr = 36;
|
|
111
|
+
static readonly RULE_create_graphic_expr = 37;
|
|
112
|
+
static readonly RULE_create_module_expr = 38;
|
|
113
|
+
static readonly RULE_graphic_expr = 39;
|
|
114
|
+
static readonly RULE_property_expr = 40;
|
|
115
|
+
static readonly RULE_property_key_expr = 41;
|
|
116
|
+
static readonly RULE_property_value_expr = 42;
|
|
117
|
+
static readonly RULE_wire_expr = 43;
|
|
118
|
+
static readonly RULE_point_expr = 44;
|
|
119
|
+
static readonly RULE_import_expr = 45;
|
|
120
|
+
static readonly RULE_frame_expr = 46;
|
|
121
|
+
static readonly RULE_if_expr = 47;
|
|
122
|
+
static readonly RULE_if_inner_expr = 48;
|
|
123
|
+
static readonly RULE_else_expr = 49;
|
|
124
|
+
static readonly RULE_while_expr = 50;
|
|
125
|
+
static readonly RULE_for_expr = 51;
|
|
126
|
+
static readonly RULE_part_set_expr = 52;
|
|
127
|
+
static readonly RULE_part_set_key = 53;
|
|
128
|
+
static readonly RULE_part_match_block = 54;
|
|
129
|
+
static readonly RULE_part_sub_expr = 55;
|
|
130
|
+
static readonly RULE_part_condition_expr = 56;
|
|
131
|
+
static readonly RULE_part_value_expr = 57;
|
|
132
|
+
static readonly RULE_annotation_comment_expr = 58;
|
|
131
133
|
static readonly literalNames: (string | null)[];
|
|
132
134
|
static readonly symbolicNames: (string | null)[];
|
|
133
135
|
static readonly ruleNames: string[];
|
|
@@ -140,6 +142,7 @@ export declare class CircuitScriptParser extends antlr.Parser {
|
|
|
140
142
|
constructor(input: antlr.TokenStream);
|
|
141
143
|
script(): ScriptContext;
|
|
142
144
|
expression(): ExpressionContext;
|
|
145
|
+
non_newline_expression(): Non_newline_expressionContext;
|
|
143
146
|
flow_expressions(): Flow_expressionsContext;
|
|
144
147
|
graph_expressions(): Graph_expressionsContext;
|
|
145
148
|
expressions_block(): Expressions_blockContext;
|
|
@@ -155,6 +158,7 @@ export declare class CircuitScriptParser extends antlr.Parser {
|
|
|
155
158
|
at_block_header(): At_block_headerContext;
|
|
156
159
|
at_block(): At_blockContext;
|
|
157
160
|
at_block_expressions(): At_block_expressionsContext;
|
|
161
|
+
at_block_expressions_inner(): At_block_expressions_innerContext;
|
|
158
162
|
at_block_pin_expr(): At_block_pin_exprContext;
|
|
159
163
|
keyword_assignment_expr(): Keyword_assignment_exprContext;
|
|
160
164
|
parameters(): ParametersContext;
|
|
@@ -218,6 +222,13 @@ export declare class ScriptContext extends antlr.ParserRuleContext {
|
|
|
218
222
|
accept<Result>(visitor: CircuitScriptParserVisitor<Result>): Result | null;
|
|
219
223
|
}
|
|
220
224
|
export declare class ExpressionContext extends antlr.ParserRuleContext {
|
|
225
|
+
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
226
|
+
non_newline_expression(): Non_newline_expressionContext | null;
|
|
227
|
+
NEWLINE(): antlr.TerminalNode | null;
|
|
228
|
+
get ruleIndex(): number;
|
|
229
|
+
accept<Result>(visitor: CircuitScriptParserVisitor<Result>): Result | null;
|
|
230
|
+
}
|
|
231
|
+
export declare class Non_newline_expressionContext extends antlr.ParserRuleContext {
|
|
221
232
|
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
222
233
|
flow_expressions(): Flow_expressionsContext | null;
|
|
223
234
|
graph_expressions(): Graph_expressionsContext | null;
|
|
@@ -228,7 +239,6 @@ export declare class ExpressionContext extends antlr.ParserRuleContext {
|
|
|
228
239
|
double_dot_property_set_expr(): Double_dot_property_set_exprContext | null;
|
|
229
240
|
assignment_expr(): Assignment_exprContext | null;
|
|
230
241
|
callable_expr(): Callable_exprContext | null;
|
|
231
|
-
NEWLINE(): antlr.TerminalNode | null;
|
|
232
242
|
get ruleIndex(): number;
|
|
233
243
|
accept<Result>(visitor: CircuitScriptParserVisitor<Result>): Result | null;
|
|
234
244
|
}
|
|
@@ -267,11 +277,14 @@ export declare class Expressions_blockContext extends antlr.ParserRuleContext {
|
|
|
267
277
|
export declare class Path_blockContext extends antlr.ParserRuleContext {
|
|
268
278
|
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
269
279
|
Colon(): antlr.TerminalNode;
|
|
270
|
-
expressions_block(): Expressions_blockContext;
|
|
271
280
|
Branch(): antlr.TerminalNode | null;
|
|
272
281
|
Join(): antlr.TerminalNode | null;
|
|
273
282
|
Parallel(): antlr.TerminalNode | null;
|
|
274
283
|
Point(): antlr.TerminalNode | null;
|
|
284
|
+
expressions_block(): Expressions_blockContext | null;
|
|
285
|
+
at_block_expressions(): At_block_expressionsContext | null;
|
|
286
|
+
non_newline_expression(): Non_newline_expressionContext[];
|
|
287
|
+
non_newline_expression(i: number): Non_newline_expressionContext | null;
|
|
275
288
|
get ruleIndex(): number;
|
|
276
289
|
accept<Result>(visitor: CircuitScriptParserVisitor<Result>): Result | null;
|
|
277
290
|
}
|
|
@@ -357,18 +370,24 @@ export declare class At_block_headerContext extends antlr.ParserRuleContext {
|
|
|
357
370
|
export declare class At_blockContext extends antlr.ParserRuleContext {
|
|
358
371
|
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
359
372
|
at_block_header(): At_block_headerContext;
|
|
373
|
+
at_block_expressions(): At_block_expressionsContext;
|
|
374
|
+
get ruleIndex(): number;
|
|
375
|
+
accept<Result>(visitor: CircuitScriptParserVisitor<Result>): Result | null;
|
|
376
|
+
}
|
|
377
|
+
export declare class At_block_expressionsContext extends antlr.ParserRuleContext {
|
|
378
|
+
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
360
379
|
NEWLINE(): antlr.TerminalNode;
|
|
361
380
|
INDENT(): antlr.TerminalNode;
|
|
362
381
|
DEDENT(): antlr.TerminalNode;
|
|
363
|
-
|
|
364
|
-
|
|
382
|
+
at_block_expressions_inner(): At_block_expressions_innerContext[];
|
|
383
|
+
at_block_expressions_inner(i: number): At_block_expressions_innerContext | null;
|
|
365
384
|
get ruleIndex(): number;
|
|
366
385
|
accept<Result>(visitor: CircuitScriptParserVisitor<Result>): Result | null;
|
|
367
386
|
}
|
|
368
|
-
export declare class
|
|
387
|
+
export declare class At_block_expressions_innerContext extends antlr.ParserRuleContext {
|
|
369
388
|
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
370
|
-
expression(): ExpressionContext | null;
|
|
371
389
|
at_block_pin_expr(): At_block_pin_exprContext | null;
|
|
390
|
+
expression(): ExpressionContext | null;
|
|
372
391
|
get ruleIndex(): number;
|
|
373
392
|
accept<Result>(visitor: CircuitScriptParserVisitor<Result>): Result | null;
|
|
374
393
|
}
|
|
@@ -376,9 +395,10 @@ export declare class At_block_pin_exprContext extends antlr.ParserRuleContext {
|
|
|
376
395
|
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
377
396
|
property_key_expr(): Property_key_exprContext;
|
|
378
397
|
Colon(): antlr.TerminalNode;
|
|
379
|
-
expression(): ExpressionContext | null;
|
|
380
398
|
expressions_block(): Expressions_blockContext | null;
|
|
381
399
|
NOT_CONNECTED(): antlr.TerminalNode | null;
|
|
400
|
+
non_newline_expression(): Non_newline_expressionContext[];
|
|
401
|
+
non_newline_expression(i: number): Non_newline_expressionContext | null;
|
|
382
402
|
get ruleIndex(): number;
|
|
383
403
|
accept<Result>(visitor: CircuitScriptParserVisitor<Result>): Result | null;
|
|
384
404
|
}
|
|
@@ -765,9 +785,9 @@ export declare class Import_simpleContext extends Import_exprContext {
|
|
|
765
785
|
export declare class Frame_exprContext extends antlr.ParserRuleContext {
|
|
766
786
|
constructor(parent: antlr.ParserRuleContext | null, invokingState: number);
|
|
767
787
|
Colon(): antlr.TerminalNode;
|
|
768
|
-
expressions_block(): Expressions_blockContext;
|
|
769
788
|
Frame(): antlr.TerminalNode | null;
|
|
770
789
|
Sheet(): antlr.TerminalNode | null;
|
|
790
|
+
expressions_block(): Expressions_blockContext | null;
|
|
771
791
|
get ruleIndex(): number;
|
|
772
792
|
accept<Result>(visitor: CircuitScriptParserVisitor<Result>): Result | null;
|
|
773
793
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AbstractParseTreeVisitor } from "antlr4ng";
|
|
2
2
|
import { ScriptContext } from "./CircuitScriptParser.js";
|
|
3
3
|
import { ExpressionContext } from "./CircuitScriptParser.js";
|
|
4
|
+
import { Non_newline_expressionContext } from "./CircuitScriptParser.js";
|
|
4
5
|
import { Flow_expressionsContext } from "./CircuitScriptParser.js";
|
|
5
6
|
import { Graph_expressionsContext } from "./CircuitScriptParser.js";
|
|
6
7
|
import { Expressions_blockContext } from "./CircuitScriptParser.js";
|
|
@@ -16,6 +17,7 @@ import { To_component_exprContext } from "./CircuitScriptParser.js";
|
|
|
16
17
|
import { At_block_headerContext } from "./CircuitScriptParser.js";
|
|
17
18
|
import { At_blockContext } from "./CircuitScriptParser.js";
|
|
18
19
|
import { At_block_expressionsContext } from "./CircuitScriptParser.js";
|
|
20
|
+
import { At_block_expressions_innerContext } from "./CircuitScriptParser.js";
|
|
19
21
|
import { At_block_pin_exprContext } from "./CircuitScriptParser.js";
|
|
20
22
|
import { Keyword_assignment_exprContext } from "./CircuitScriptParser.js";
|
|
21
23
|
import { ParametersContext } from "./CircuitScriptParser.js";
|
|
@@ -71,6 +73,7 @@ import { Annotation_comment_exprContext } from "./CircuitScriptParser.js";
|
|
|
71
73
|
export declare class CircuitScriptParserVisitor<Result> extends AbstractParseTreeVisitor<Result> {
|
|
72
74
|
visitScript?: (ctx: ScriptContext) => Result;
|
|
73
75
|
visitExpression?: (ctx: ExpressionContext) => Result;
|
|
76
|
+
visitNon_newline_expression?: (ctx: Non_newline_expressionContext) => Result;
|
|
74
77
|
visitFlow_expressions?: (ctx: Flow_expressionsContext) => Result;
|
|
75
78
|
visitGraph_expressions?: (ctx: Graph_expressionsContext) => Result;
|
|
76
79
|
visitExpressions_block?: (ctx: Expressions_blockContext) => Result;
|
|
@@ -86,6 +89,7 @@ export declare class CircuitScriptParserVisitor<Result> extends AbstractParseTre
|
|
|
86
89
|
visitAt_block_header?: (ctx: At_block_headerContext) => Result;
|
|
87
90
|
visitAt_block?: (ctx: At_blockContext) => Result;
|
|
88
91
|
visitAt_block_expressions?: (ctx: At_block_expressionsContext) => Result;
|
|
92
|
+
visitAt_block_expressions_inner?: (ctx: At_block_expressions_innerContext) => Result;
|
|
89
93
|
visitAt_block_pin_expr?: (ctx: At_block_pin_exprContext) => Result;
|
|
90
94
|
visitKeyword_assignment_expr?: (ctx: Keyword_assignment_exprContext) => Result;
|
|
91
95
|
visitParameters?: (ctx: ParametersContext) => Result;
|
package/dist/types/execute.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export declare class ExecutionContext {
|
|
|
75
75
|
closeOpenPathBlocks(): void;
|
|
76
76
|
enterBlock(blockIndex: number): void;
|
|
77
77
|
exitBlock(blockIndex: number): void;
|
|
78
|
+
addPointForBlockType(blockType: BlockTypes): void;
|
|
78
79
|
atPointBlock(): void;
|
|
79
80
|
toPointBlock(): void;
|
|
80
81
|
getPointBlockLocation(): [component: ClassComponent, pin: number, wireId: number];
|
|
@@ -30,6 +30,10 @@ export declare enum FrameParamKeys {
|
|
|
30
30
|
TitleAlign = "title_align",
|
|
31
31
|
HorizontalAlign = "align",
|
|
32
32
|
VerticalAlign = "valign",
|
|
33
|
+
FontSize = "font_size",
|
|
34
|
+
Bold = "bold",
|
|
35
|
+
Italic = "italic",
|
|
36
|
+
Color = "color",
|
|
33
37
|
SheetNumber = "sheet_number",
|
|
34
38
|
SheetTotal = "sheet_total"
|
|
35
39
|
}
|
|
@@ -57,6 +57,8 @@ export declare class SymbolText extends SymbolGraphic {
|
|
|
57
57
|
text: string;
|
|
58
58
|
fontSize: NumericValue;
|
|
59
59
|
fontWeight: string;
|
|
60
|
+
fontStyle: string;
|
|
61
|
+
color: string | undefined;
|
|
60
62
|
constructor(text: string);
|
|
61
63
|
generateDrawing(): void;
|
|
62
64
|
}
|
|
@@ -64,9 +66,7 @@ export declare class SymbolPlaceholder extends SymbolGraphic {
|
|
|
64
66
|
styles: Styles;
|
|
65
67
|
generateDrawing(): void;
|
|
66
68
|
private resolveReference;
|
|
67
|
-
parseLabelStyle(keywordParams: Map<string, any>):
|
|
68
|
-
[key: string]: any;
|
|
69
|
-
};
|
|
69
|
+
parseLabelStyle(keywordParams: Map<string, any>): LabelStyle;
|
|
70
70
|
drawPinParams(drawing: SymbolDrawingCommands, commandName: string, keywordParams: Map<string, any>, positionParams: any[], lineColor: string, pinNameColor: string): void;
|
|
71
71
|
constructor(drawing: SymbolDrawing);
|
|
72
72
|
setStyles(styles: Styles): void;
|
|
@@ -13,6 +13,7 @@ export type LabelStyle = {
|
|
|
13
13
|
font?: string;
|
|
14
14
|
fontSize?: NumericValue;
|
|
15
15
|
fontWeight?: string;
|
|
16
|
+
fontStyle?: string;
|
|
16
17
|
angle?: NumericValue;
|
|
17
18
|
anchor?: HorizontalAlign.Left | HorizontalAlign.Center | HorizontalAlign.Right;
|
|
18
19
|
vanchor?: VerticalAlign.Top | VerticalAlign.Center | VerticalAlign.Bottom;
|
|
@@ -102,10 +102,16 @@ export declare class RenderText extends RenderObject {
|
|
|
102
102
|
symbol: SymbolText;
|
|
103
103
|
_fontSize: NumericValue;
|
|
104
104
|
_fontWeight: string;
|
|
105
|
+
_fontStyle: string;
|
|
106
|
+
_color: string | undefined;
|
|
105
107
|
get fontSize(): NumericValue;
|
|
106
108
|
set fontSize(value: NumericValue);
|
|
107
109
|
get fontWeight(): string;
|
|
108
110
|
set fontWeight(value: string);
|
|
111
|
+
get fontStyle(): string;
|
|
112
|
+
set fontStyle(value: string);
|
|
113
|
+
get color(): string | undefined;
|
|
114
|
+
set color(value: string | undefined);
|
|
109
115
|
constructor(text: string);
|
|
110
116
|
}
|
|
111
117
|
export declare class RenderFrame extends RenderObject {
|
package/dist/types/sizing.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Box, SVGTypeMapping } from '@svgdotjs/svg.js';
|
|
2
2
|
import { HorizontalAlign, VerticalAlign } from './render/geometry.js';
|
|
3
3
|
export declare function applyFontsToSVG(canvas: SVGTypeMapping): void;
|
|
4
|
-
export declare function measureTextSize2(text: string, fontFamily: string, fontSize: number, fontWeight?: string, anchor?: HorizontalAlign, vanchor?: VerticalAlign): {
|
|
4
|
+
export declare function measureTextSize2(text: string, fontFamily: string, fontSize: number, fontWeight?: string, fontStyle?: string, anchor?: HorizontalAlign, vanchor?: VerticalAlign): {
|
|
5
5
|
width: number;
|
|
6
6
|
height: number;
|
|
7
7
|
box: Box;
|
package/dist/types/visitor.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Add_component_exprContext, AdditionExprContext, At_blockContext, At_block_pin_exprContext, At_component_exprContext, BinaryOperatorExprContext, Component_select_exprContext, Create_component_exprContext, Create_graphic_exprContext, Data_expr_with_assignmentContext, Double_dot_property_set_exprContext, Frame_exprContext, Function_def_exprContext, MultiplyExprContext, Nested_propertiesContext, Net_namespace_exprContext, Pin_select_exprContext, Point_exprContext, Property_exprContext, Property_key_exprContext, Single_line_propertyContext, To_component_exprContext, Wire_exprContext, UnaryOperatorExprContext, If_exprContext, If_inner_exprContext, LogicalOperatorExprContext, Expressions_blockContext, Create_module_exprContext, Property_block_exprContext, While_exprContext, For_exprContext, GraphicCommandExprContext, Graphic_expressions_blockContext, GraphicForExprContext, Graph_expressionsContext, Path_blockContext, Annotation_comment_exprContext, At_block_headerContext, Part_set_exprContext, Part_set_keyContext, Part_match_blockContext, Part_sub_exprContext, Part_value_exprContext, Part_condition_exprContext, CreateExprContext, Create_exprContext, Properties_blockContext } from './antlr/CircuitScriptParser.js';
|
|
1
|
+
import { Add_component_exprContext, AdditionExprContext, At_blockContext, At_block_pin_exprContext, At_component_exprContext, BinaryOperatorExprContext, Component_select_exprContext, Create_component_exprContext, Create_graphic_exprContext, Data_expr_with_assignmentContext, Double_dot_property_set_exprContext, Frame_exprContext, Function_def_exprContext, MultiplyExprContext, Nested_propertiesContext, Net_namespace_exprContext, Pin_select_exprContext, Point_exprContext, Property_exprContext, Property_key_exprContext, Single_line_propertyContext, To_component_exprContext, Wire_exprContext, UnaryOperatorExprContext, If_exprContext, If_inner_exprContext, LogicalOperatorExprContext, Expressions_blockContext, Create_module_exprContext, Property_block_exprContext, While_exprContext, For_exprContext, GraphicCommandExprContext, Graphic_expressions_blockContext, GraphicForExprContext, Graph_expressionsContext, Path_blockContext, Annotation_comment_exprContext, At_block_headerContext, Part_set_exprContext, Part_set_keyContext, Part_match_blockContext, Part_sub_exprContext, Part_value_exprContext, Part_condition_exprContext, CreateExprContext, Create_exprContext, Properties_blockContext, At_block_expressionsContext } from './antlr/CircuitScriptParser.js';
|
|
2
2
|
import { ClassComponent } from './objects/ClassComponent.js';
|
|
3
3
|
import { PinTypes } from './objects/PinTypes.js';
|
|
4
4
|
import { ComponentPin, ComponentPinNet, ComponentPinNetPair } from './objects/types.js';
|
|
@@ -48,6 +48,7 @@ export declare class ParserVisitor extends BaseVisitor {
|
|
|
48
48
|
visitAdditionExpr: (ctx: AdditionExprContext) => void;
|
|
49
49
|
visitFunction_def_expr: (ctx: Function_def_exprContext) => void;
|
|
50
50
|
visitAt_block_pin_expr: (ctx: At_block_pin_exprContext) => void;
|
|
51
|
+
visitAt_block_expressions: (ctx: At_block_expressionsContext) => void;
|
|
51
52
|
visitAt_block_header: (ctx: At_block_headerContext) => void;
|
|
52
53
|
visitAt_block: (ctx: At_blockContext) => void;
|
|
53
54
|
visitWire_expr: (ctx: Wire_exprContext) => void;
|
package/libs/std.cst
CHANGED
|
@@ -181,7 +181,7 @@ def dgnd(net_name="GND"):
|
|
|
181
181
|
net_name: net_name
|
|
182
182
|
priority: 100
|
|
183
183
|
|
|
184
|
-
def text(value, offsetX = 0, offsetY = 0, fontSize = 50):
|
|
184
|
+
def text(value, offsetX = 0, offsetY = 0, fontSize = 50, bold = false, italic = false):
|
|
185
185
|
return create component:
|
|
186
186
|
pins: 1
|
|
187
187
|
followWireOrientation: false
|
|
@@ -192,6 +192,8 @@ def text(value, offsetX = 0, offsetY = 0, fontSize = 50):
|
|
|
192
192
|
content: value
|
|
193
193
|
offset: offsetX, offsetY
|
|
194
194
|
fontSize: fontSize
|
|
195
|
+
bold: bold
|
|
196
|
+
italic: italic
|
|
195
197
|
|
|
196
198
|
# Drawing markers
|
|
197
199
|
|