@guihz/trading-vue-editor-tes 0.0.55 → 0.0.57
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/assets/{parserTccWorker-HvN6ZSID.js → parserTccWorker-DwIXERLL.js} +52 -52
- package/lib/assets/{scriptsRunWorker-DBOrPbdQ.js → scriptsRunWorker-CjCbw7bj.js} +2 -2
- package/lib/components/editor/parseScript/constants.d.ts +8 -0
- package/lib/components/editor/parseScript/enum.d.ts +5 -0
- package/lib/components/editor/parseScript/parseToLibJs.d.ts +48 -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 +936 -931
- package/lib/trading-vue-editor.umd.cjs +13 -13
- package/package.json +1 -1
@@ -46,6 +46,11 @@ export declare const ERRORS_TIPS: {
|
|
46
46
|
buidinVarErr: string;
|
47
47
|
useNaErr: string;
|
48
48
|
libraryTitleErr: string;
|
49
|
+
exportFuncArgErr: string;
|
50
|
+
indiRunErr: string;
|
51
|
+
libraryExportErr: string;
|
52
|
+
strategyRunErr: string;
|
53
|
+
exportUseErr: string;
|
49
54
|
};
|
50
55
|
export declare const WARNING_TIPS: {
|
51
56
|
repeatVar: string;
|
@@ -58,7 +63,10 @@ export declare const QUALIFIERS: VType[];
|
|
58
63
|
export declare const BASE_TYPE: VType[];
|
59
64
|
export declare const PLOT_DISPLAY_TYPES: string[];
|
60
65
|
export declare const ONLY_STATEMENTS: string[];
|
66
|
+
export declare const GLOBAL_DRAW_FUNCS: string[];
|
61
67
|
export declare const GLOBAL_FUNCS: string[];
|
68
|
+
export declare const INDICATOR_NEED_DRAW_FUNCS: string[];
|
69
|
+
export declare const STRATEGY_NEED_FUNCS: string[];
|
62
70
|
export declare const NAMESPACE_CALL_SELF_FUNCS: string[];
|
63
71
|
export declare const SOURCE_TYPE_BUILTIN: string[];
|
64
72
|
export declare const READY_ONLY_OPTIONS: {
|
@@ -0,0 +1,48 @@
|
|
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
|
+
constructor(prefix: string, title: string);
|
14
|
+
parser(values: IKeyObjectValue[]): string | undefined;
|
15
|
+
private _parserStmt;
|
16
|
+
private _parserTypeStatement;
|
17
|
+
private _parserVarBlockStmt;
|
18
|
+
private _parserForToStatement;
|
19
|
+
private _parserForInStatement;
|
20
|
+
private _parserAgainAssign;
|
21
|
+
private _parserSwitchStatement;
|
22
|
+
private _parserCases;
|
23
|
+
private _parserDefaultCase;
|
24
|
+
private _parserCase;
|
25
|
+
private _parserWhileStatement;
|
26
|
+
private _parserIfStatement;
|
27
|
+
private _parserBlockLine;
|
28
|
+
private _parserReturnBlock;
|
29
|
+
private _getMembersCode;
|
30
|
+
private _parserArrowMethod;
|
31
|
+
private _parserArrowFunction;
|
32
|
+
private _parserParameters;
|
33
|
+
private _parserBlock;
|
34
|
+
private _parserDeclareAssign;
|
35
|
+
private _parserDeclareAssignNames;
|
36
|
+
private _parserSingleExpression;
|
37
|
+
private _parserAdditiveExpression;
|
38
|
+
private _parserMemberIndexExpression;
|
39
|
+
private _getUserVarMemberIndexs;
|
40
|
+
private _parseLiteral;
|
41
|
+
private _colorToRgba;
|
42
|
+
private _parserName;
|
43
|
+
private _parserMethodExpression;
|
44
|
+
private _parserMethodElement;
|
45
|
+
private _parserArguments;
|
46
|
+
private _parserBrackethesized;
|
47
|
+
private _functionalProcess;
|
48
|
+
}
|
@@ -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';
|