circuitscript 0.1.12 → 0.1.14
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 +90 -85
- package/dist/cjs/antlr/CircuitScriptParser.js +761 -854
- package/dist/cjs/builtinMethods.js +5 -3
- package/dist/cjs/execute.js +61 -45
- package/dist/cjs/helpers.js +11 -8
- package/dist/cjs/objects/ExecutionScope.js +1 -1
- package/dist/cjs/parser.js +3 -1
- package/dist/cjs/utils.js +3 -3
- package/dist/cjs/visitor.js +14 -16
- package/dist/esm/BaseVisitor.js +50 -45
- package/dist/esm/antlr/CircuitScriptParser.js +759 -850
- package/dist/esm/antlr/CircuitScriptVisitor.js +0 -2
- package/dist/esm/builtinMethods.js +6 -4
- package/dist/esm/execute.js +62 -46
- package/dist/esm/helpers.js +11 -8
- package/dist/esm/objects/ExecutionScope.js +1 -1
- package/dist/esm/parser.js +3 -1
- package/dist/esm/utils.js +1 -1
- package/dist/esm/visitor.js +15 -17
- package/dist/types/BaseVisitor.d.ts +3 -4
- package/dist/types/antlr/CircuitScriptParser.d.ts +42 -58
- package/dist/types/antlr/CircuitScriptVisitor.d.ts +0 -4
- package/dist/types/execute.d.ts +6 -5
- package/dist/types/objects/ExecutionScope.d.ts +1 -1
- package/dist/types/parser.d.ts +1 -0
- package/dist/types/utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/types/execute.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BlockTypes, FrameType } from './globals.js';
|
|
1
|
+
import { BlockTypes, FrameType, ReferenceTypes } from './globals.js';
|
|
2
2
|
import { ExecutionWarning } from "./utils.js";
|
|
3
3
|
import { ClassComponent } from './objects/ClassComponent.js';
|
|
4
4
|
import { ExecutionScope } from './objects/ExecutionScope.js';
|
|
5
5
|
import { Net } from './objects/Net.js';
|
|
6
6
|
import { NumericValue, ParamDefinition } from './objects/ParamDefinition.js';
|
|
7
7
|
import { PinDefinition } from './objects/PinDefinition.js';
|
|
8
|
-
import { CFunction, CFunctionResult, CallableParameter, ComponentPin, DeclaredReference } from './objects/types.js';
|
|
8
|
+
import { AnyReference, CFunction, CFunctionResult, CallableParameter, ComponentPin, DeclaredReference } from './objects/types.js';
|
|
9
9
|
import { Logger } from './logger.js';
|
|
10
10
|
import { UnitDimension } from './helpers.js';
|
|
11
11
|
import { ParserRuleContext } from 'antlr4ng';
|
|
@@ -30,7 +30,7 @@ export declare class ExecutionContext {
|
|
|
30
30
|
parentContext: ExecutionContext;
|
|
31
31
|
componentAngleFollowsWire: boolean;
|
|
32
32
|
warnings: ExecutionWarning[];
|
|
33
|
-
constructor(name: string, namespace: string, netNamespace: string, executionLevel: number | undefined,
|
|
33
|
+
constructor(name: string, namespace: string, netNamespace: string, executionLevel: number | undefined, scopeLevel: number | undefined, silent: boolean | undefined, logger: Logger, warnings: ExecutionWarning[], parent: ExecutionContext);
|
|
34
34
|
logWarning(message: string, context?: ParserRuleContext, fileName?: string): void;
|
|
35
35
|
log(...params: any[]): void;
|
|
36
36
|
private setupRoot;
|
|
@@ -61,8 +61,8 @@ export declare class ExecutionContext {
|
|
|
61
61
|
}): ComponentPin;
|
|
62
62
|
copyComponent(component: ClassComponent): ClassComponent;
|
|
63
63
|
enterBlocks(blockType: BlockTypes): void;
|
|
64
|
-
exitBlocks(): void;
|
|
65
|
-
|
|
64
|
+
exitBlocks(scopeLevel?: number | null): void;
|
|
65
|
+
closeOpenPathBlocks(): void;
|
|
66
66
|
enterBlock(blockIndex: number): void;
|
|
67
67
|
exitBlock(blockIndex: number): void;
|
|
68
68
|
atPointBlock(): void;
|
|
@@ -75,6 +75,7 @@ export declare class ExecutionContext {
|
|
|
75
75
|
hasFunction(functionName: string): boolean;
|
|
76
76
|
getFunction(functionName: string): CFunction;
|
|
77
77
|
resolveVariable(executionStack: ExecutionContext[], idName: string, trailers?: string[]): DeclaredReference;
|
|
78
|
+
resolveTrailers(type: ReferenceTypes, item: any, trailers?: string[]): AnyReference;
|
|
78
79
|
callFunction(functionName: string, functionParams: CallableParameter[], executionStack: ExecutionContext[], netNamespace: string): CFunctionResult;
|
|
79
80
|
mergeScope(childScope: ExecutionScope, namespace: string): void;
|
|
80
81
|
addWire(segments: [string, (number | UnitDimension)?][]): void;
|
package/dist/types/parser.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare function parseFileWithVisitor(visitor: BaseVisitor, data: string)
|
|
|
8
8
|
hasParseError: boolean;
|
|
9
9
|
parserTimeTaken: number;
|
|
10
10
|
lexerTimeTaken: number;
|
|
11
|
+
throwError: any;
|
|
11
12
|
}>;
|
|
12
13
|
export declare class CircuitscriptParserErrorListener implements ANTLRErrorListener {
|
|
13
14
|
syntaxErrorCounter: number;
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -73,5 +73,5 @@ export type ExecutionWarning = {
|
|
|
73
73
|
ctx?: ParserRuleContext;
|
|
74
74
|
};
|
|
75
75
|
export declare function printWarnings(warnings: ExecutionWarning[]): void;
|
|
76
|
-
export declare function
|
|
76
|
+
export declare function unwrapValue(value: AnyReference | DeclaredReference | any): any;
|
|
77
77
|
export declare function isReference(value: any): boolean;
|