@guihz/trading-vue-editor-tes 0.0.56 → 0.0.58
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/assets/{parserTccWorker-HvN6ZSID.js → parserTccWorker-CHJsIhut.js} +53 -53
- package/lib/assets/{scriptsRunWorker-DBOrPbdQ.js → scriptsRunWorker-CTlk4g3L.js} +15 -15
- package/lib/components/editor/parseScript/buildInFuncNamespace/input.d.ts +1 -1
- package/lib/components/editor/parseScript/constants.d.ts +9 -0
- package/lib/components/editor/parseScript/enum.d.ts +5 -0
- package/lib/components/editor/parseScript/parseToLibJs.d.ts +49 -0
- package/lib/components/editor/parseScript/visitorParser.d.ts +22 -2
- package/lib/components/editor/type/index.d.ts +1 -0
- package/lib/components/editor/utils/parserTccWorker.d.ts +3 -3
- package/lib/packages/index.d.ts +1 -1
- package/lib/trading-vue-editor.js +869 -864
- package/lib/trading-vue-editor.umd.cjs +18 -18
- package/package.json +1 -1
@@ -28,7 +28,7 @@ declare class Input {
|
|
28
28
|
private _count;
|
29
29
|
private _historyInputs;
|
30
30
|
private _name;
|
31
|
-
constructor(variables: BuiltInVariables, errorListener: TccErrorListener);
|
31
|
+
constructor(variables: BuiltInVariables, errorListener: TccErrorListener, id: string);
|
32
32
|
update(vals: IInputArgs[]): void;
|
33
33
|
input(args: IInputArgs, posStr: string): TSimpleType;
|
34
34
|
int(args: IInputArgs, posStr: string): TSimpleType;
|
@@ -6,6 +6,7 @@ export declare const ERRORS_TIPS: {
|
|
6
6
|
notTypeKeyword: string;
|
7
7
|
undeclared: string;
|
8
8
|
repeatVar: string;
|
9
|
+
typeRepeatErr: string;
|
9
10
|
typeMismatch: string;
|
10
11
|
assignTypeMismatch: string;
|
11
12
|
voidNotVar: string;
|
@@ -46,6 +47,11 @@ export declare const ERRORS_TIPS: {
|
|
46
47
|
buidinVarErr: string;
|
47
48
|
useNaErr: string;
|
48
49
|
libraryTitleErr: string;
|
50
|
+
exportFuncArgErr: string;
|
51
|
+
indiRunErr: string;
|
52
|
+
libraryExportErr: string;
|
53
|
+
strategyRunErr: string;
|
54
|
+
exportUseErr: string;
|
49
55
|
};
|
50
56
|
export declare const WARNING_TIPS: {
|
51
57
|
repeatVar: string;
|
@@ -58,7 +64,10 @@ export declare const QUALIFIERS: VType[];
|
|
58
64
|
export declare const BASE_TYPE: VType[];
|
59
65
|
export declare const PLOT_DISPLAY_TYPES: string[];
|
60
66
|
export declare const ONLY_STATEMENTS: string[];
|
67
|
+
export declare const GLOBAL_DRAW_FUNCS: string[];
|
61
68
|
export declare const GLOBAL_FUNCS: string[];
|
69
|
+
export declare const INDICATOR_NEED_DRAW_FUNCS: string[];
|
70
|
+
export declare const STRATEGY_NEED_FUNCS: string[];
|
62
71
|
export declare const NAMESPACE_CALL_SELF_FUNCS: string[];
|
63
72
|
export declare const SOURCE_TYPE_BUILTIN: string[];
|
64
73
|
export declare const READY_ONLY_OPTIONS: {
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { IKeyObjectValue } from "../type";
|
2
|
+
export default class ParseToLibJs {
|
3
|
+
private _nameMap;
|
4
|
+
private _prefixNameVar;
|
5
|
+
private _prefixNameFunc;
|
6
|
+
private _prefixNameConst;
|
7
|
+
private _userTypes;
|
8
|
+
private _isInFunc;
|
9
|
+
private _varlist;
|
10
|
+
private _memberIndexList;
|
11
|
+
private _blockCount;
|
12
|
+
private _libTitle;
|
13
|
+
private _exportEles;
|
14
|
+
constructor(prefix: string, title: string);
|
15
|
+
parser(values: IKeyObjectValue[]): string | undefined;
|
16
|
+
private _parserStmt;
|
17
|
+
private _parserTypeStatement;
|
18
|
+
private _parserVarBlockStmt;
|
19
|
+
private _parserForToStatement;
|
20
|
+
private _parserForInStatement;
|
21
|
+
private _parserAgainAssign;
|
22
|
+
private _parserSwitchStatement;
|
23
|
+
private _parserCases;
|
24
|
+
private _parserDefaultCase;
|
25
|
+
private _parserCase;
|
26
|
+
private _parserWhileStatement;
|
27
|
+
private _parserIfStatement;
|
28
|
+
private _parserBlockLine;
|
29
|
+
private _parserReturnBlock;
|
30
|
+
private _getMembersCode;
|
31
|
+
private _parserArrowMethod;
|
32
|
+
private _parserArrowFunction;
|
33
|
+
private _parserParameters;
|
34
|
+
private _parserBlock;
|
35
|
+
private _parserDeclareAssign;
|
36
|
+
private _parserDeclareAssignNames;
|
37
|
+
private _parserSingleExpression;
|
38
|
+
private _parserAdditiveExpression;
|
39
|
+
private _parserMemberIndexExpression;
|
40
|
+
private _getUserVarMemberIndexs;
|
41
|
+
private _parseLiteral;
|
42
|
+
private _colorToRgba;
|
43
|
+
private _parserName;
|
44
|
+
private _parserMethodExpression;
|
45
|
+
private _parserMethodElement;
|
46
|
+
private _parserArguments;
|
47
|
+
private _parserBrackethesized;
|
48
|
+
private _functionalProcess;
|
49
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { IKeyObjectValue, IDocValue, IKeyValue } from '../type';
|
2
2
|
import { VRuleType } from './enum';
|
3
3
|
import { ParserUtils } from './visitorUtils';
|
4
|
-
import { IError, IPosition } from "./type";
|
4
|
+
import { IError, IRange, IPosition } from "./type";
|
5
5
|
export default class ParserVisitor extends ParserUtils {
|
6
6
|
private _loopCount;
|
7
7
|
private _errors;
|
@@ -21,6 +21,13 @@ export default class ParserVisitor extends ParserUtils {
|
|
21
21
|
private _isInLocalScop;
|
22
22
|
private _comments;
|
23
23
|
private _currentLine;
|
24
|
+
private _hasDrawFunc;
|
25
|
+
private _hasCreateOrderFunc;
|
26
|
+
private _scriptType?;
|
27
|
+
private _exportFunctions;
|
28
|
+
private _exportMethods;
|
29
|
+
private _exportTypes;
|
30
|
+
private _exportPositions;
|
24
31
|
constructor(props: IKeyObjectValue, comments: IKeyObjectValue[]);
|
25
32
|
get overloadsFuncs(): IKeyValue[];
|
26
33
|
get errors(): IError[];
|
@@ -28,6 +35,17 @@ export default class ParserVisitor extends ParserUtils {
|
|
28
35
|
get userFunctions(): Map<string, IDocValue[]>;
|
29
36
|
get userVariables(): Map<string, IDocValue[]>;
|
30
37
|
get userMethods(): Map<string, IDocValue[]>;
|
38
|
+
get hasUseDrawFunc(): boolean;
|
39
|
+
get hasUseCreateOrderFunc(): boolean;
|
40
|
+
get scriptType(): string | undefined;
|
41
|
+
get exportLibs(): {
|
42
|
+
functions: IDocValue[];
|
43
|
+
methods: IDocValue[];
|
44
|
+
types: IDocValue[];
|
45
|
+
};
|
46
|
+
get exportPositions(): (IRange & {
|
47
|
+
type: string;
|
48
|
+
})[];
|
31
49
|
visitProgram: (ctx: IKeyObjectValue) => any[];
|
32
50
|
visitGlobalStmt: (ctx: IKeyObjectValue) => any;
|
33
51
|
visitBlockStmt: (ctx: IKeyObjectValue) => IKeyObjectValue[];
|
@@ -172,7 +190,7 @@ export default class ParserVisitor extends ParserUtils {
|
|
172
190
|
visitDefaultCaluse: (ctx: IKeyObjectValue) => IKeyObjectValue;
|
173
191
|
visitWhileStatement: (ctx: IKeyObjectValue) => IKeyObjectValue;
|
174
192
|
visitImportStmt: (ctx: IKeyObjectValue) => IKeyObjectValue[];
|
175
|
-
visitImportElement: (ctx: IKeyObjectValue) => IKeyObjectValue;
|
193
|
+
visitImportElement: (ctx: IKeyObjectValue) => IKeyObjectValue | undefined;
|
176
194
|
visitLiteral: (ctx: IKeyObjectValue) => {
|
177
195
|
ruleType: VRuleType;
|
178
196
|
ctx: IKeyObjectValue;
|
@@ -191,8 +209,10 @@ export default class ParserVisitor extends ParserUtils {
|
|
191
209
|
visitFormalParameterList: (ctx: IKeyObjectValue) => IKeyObjectValue[];
|
192
210
|
visitFormalParameterArg: (ctx: IKeyObjectValue) => IKeyObjectValue;
|
193
211
|
visitArrowMethod: (ctx: IKeyObjectValue) => IKeyObjectValue;
|
212
|
+
private _exportArgsTypeVerify;
|
194
213
|
visitArrowMethodParameters: (ctx: IKeyObjectValue) => any[];
|
195
214
|
visitTypeStatement: (ctx: IKeyObjectValue) => IKeyObjectValue;
|
215
|
+
private _addExportPos;
|
196
216
|
visitTypeElement: (ctx: IKeyObjectValue) => IKeyObjectValue;
|
197
217
|
visitAssignmentOperator: (ctx: IKeyObjectValue) => any;
|
198
218
|
visitTypeMap: (ctx: IKeyObjectValue) => string;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference path="../../../../src/vite-env.d.ts" />
|
2
|
-
import { ErrorListener } from
|
3
|
-
import { IKeyObjectValue } from
|
2
|
+
import { ErrorListener } from "antlr4";
|
3
|
+
import { IKeyObjectValue } from "../type";
|
4
4
|
export default function parseTcc(program: string, hasTranscoding: boolean, keyObjs: IKeyObjectValue): Promise<{
|
5
5
|
errors: any[];
|
6
6
|
functions: {
|
@@ -17,7 +17,7 @@ export default function parseTcc(program: string, hasTranscoding: boolean, keyOb
|
|
17
17
|
};
|
18
18
|
overloadsFuncs: import("../type").IKeyValue[];
|
19
19
|
codeStr: string;
|
20
|
-
preParserCode: string;
|
20
|
+
preParserCode: string | undefined;
|
21
21
|
}>;
|
22
22
|
export declare class ExprErrorListener extends ErrorListener {
|
23
23
|
errors: any[];
|
package/lib/packages/index.d.ts
CHANGED
@@ -6,4 +6,4 @@ export { parseTcc, scriptsRun, removeScript } from '../components/editor/utils/p
|
|
6
6
|
export type { IError, IPosition } from '../components/editor/parseScript/type';
|
7
7
|
export { VMarkerSeverity } from '../components/editor/parseScript/type';
|
8
8
|
export { default as ReferenceManual } from '../components/referenceManual';
|
9
|
-
export { VAdjustment, VAlert, VBarmergeGaps, VCommission, VDirection, VEarnings, VExtend, VFormatType, VHlineStyle, VInputType, VLabelStyle, VLineStyle, VLocation, VOca, VPlotDisplay, VPlotStyle, VRuleType, VScale, VSession, VShape, VSortOrder, VSize, VStrategy, VText, VType, VXloc, VYloc, VPivotType, VPosition } from '../components/editor/parseScript/enum';
|
9
|
+
export { VAdjustment, VAlert, VBarmergeGaps, VCommission, VDirection, VEarnings, VExtend, VFormatType, VHlineStyle, VInputType, VLabelStyle, VLineStyle, VLocation, VOca, VPlotDisplay, VPlotStyle, VRuleType, VScale, VSession, VShape, VSortOrder, VSize, VStrategy, VText, VType, VXloc, VYloc, VPivotType, VPosition, VScriptType } from '../components/editor/parseScript/enum';
|