@guihz/trading-vue-editor-tes 0.0.261 → 0.0.262

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,39 +37,39 @@ x0.version="2.30.1",G3(Re),x0.fn=W0,x0.min=kA,x0.max=wA,x0.now=PA,x0.utc=Xn,x0.u
37
37
  /****/
38
38
  `);let q="";const m=(n==null?void 0:n.ruleType)==="VarMultiple";z.length>1?q=`${z[0]}
39
39
  let ${i} = ${m?`(${z[1]}) || []`:z[1]}
40
- `:q=`let ${i} = ${m?`(${b}) || []`:b}`;const g={code:q,varNames:i.replace(/[\[\]]/g,"").split(", "),depends:this._getDepends(s)};return this._codesCol[this._blockCount].push(g),q}_getDepends(e){const n=[];for(const[r,i]of this._dependsObj[e])(i.scope||0)>this._blockCount||n.push(i);return delete this._dependsObj[e],n}_parserForToStatement(e,n=!1){let{numerical:r,block:i,name:s,type:b}=e;const[z,q,m]=r,g=this._isInLoop;let y=this._count;this._isInLoop=!0;const E=`$start${this._count++}`,k=`$$count${this._count}`,D=`$forTo${this._blockCount}`;n||(this._dependsObj[D]=new Map);const h=this._parserSingleExpression(z),A=this._parserSingleExpression(q),d=m?this._parserSingleExpression(m):"",v=this._parserBlockLine(i,n,!1,!0);We.includes(s)&&(s=`$${s}`);const L=`var ${E} = Date.now()`,S=`for (let ${s}=${h}; ${s}>=(${A}); ${s}-=(${d||"1"})){
41
- if (Date.now() - ${E} > 500) {
40
+ `:q=`let ${i} = ${m?`(${b}) || []`:b}`;const g={code:q,varNames:i.replace(/[\[\]]/g,"").split(", "),depends:this._getDepends(s)};return this._codesCol[this._blockCount].push(g),q}_getDepends(e){const n=[];for(const[r,i]of this._dependsObj[e])(i.scope||0)>this._blockCount||n.push(i);return delete this._dependsObj[e],n}_parserForToStatement(e,n=!1){let{numerical:r,block:i,name:s,type:b}=e;const[z,q,m]=r,g=this._isInLoop;this._isInLoop=!0;const y=`$start${this._count+1}`;g||(this._count+=1);const E=`$$count${this._count}`,k=`$forTo${this._blockCount}`;n||(this._dependsObj[k]=new Map);const D=this._parserSingleExpression(z),h=this._parserSingleExpression(q),A=m?this._parserSingleExpression(m):"",d=this._parserBlockLine(i,n,!1,!0);We.includes(s)&&(s=`$${s}`);const v=`var ${y} = Date.now()`,L=`for (let ${s}=${D}; ${s}>=(${h}); ${s}-=(${A||"1"})){
41
+ if (Date.now() - ${y} > 500) {
42
42
  throw new Error('${O0.loopRuntimeErr}')
43
43
  }
44
- ${k}++
45
- ${v}
46
- }`,I=`for (let ${s}=${h};${s}<=(${A}); ${s}+=(${d||"1"})){
47
- if (Date.now() - ${E} > 500) {
44
+ ${E}++
45
+ ${d}
46
+ }`,S=`for (let ${s}=${D};${s}<=(${h}); ${s}+=(${A||"1"})){
47
+ if (Date.now() - ${y} > 500) {
48
48
  throw new Error('${O0.loopRuntimeErr}')
49
49
  }
50
- ${k}++
51
- ${v}
52
- }`;let K="";return(z==null?void 0:z.ruleType)==="Literal"&&(q==null?void 0:q.ruleType)==="Literal"?K=Number(z.value)>Number(q.value)?S:I:K=`if ((${h})>(${A})) {
53
- ${S}
50
+ ${E}++
51
+ ${d}
52
+ }`;let I="";return(z==null?void 0:z.ruleType)==="Literal"&&(q==null?void 0:q.ruleType)==="Literal"?I=Number(z.value)>Number(q.value)?L:S:I=`if ((${D})>(${h})) {
53
+ ${L}
54
54
  } else {
55
- ${I}
56
- }`,K=`${L};
57
- var ${k} = 0
58
- ${K}`,n||this._codesCol[this._blockCount].push({code:K,depends:this._getDepends(D)}),g&&(this._count=y),this._isInLoop=g,n?this._functionalProcess(K,b):K}_parserForInStatement(e,n=!1){const{names:r,block:i,array:s,type:b}=e,z=this._isInLoop;let q=this._count;this._isInLoop=!0;const m=`$start${this._count++}`,g=`$$count${this._count}`,y=this._parserBlockLine(i,n,!1,!0);let E="",[k,D]=r;We.includes(k)&&(k=`$${k}`);const h=`var ${m} = Date.now()`;return r.length===1?E=`for (const ${k} of ${this._parserSingleExpression(s)}._value) {
59
- if (Date.now() - ${m} > 500) {
55
+ ${S}
56
+ }`,I=`${v};
57
+ ${g?"":`var ${E} = 0`}
58
+ ${I}`,n||this._codesCol[this._blockCount].push({code:I,depends:this._getDepends(k)}),this._isInLoop=g,n?this._functionalProcess(I,b):I}_parserForInStatement(e,n=!1){const{names:r,block:i,array:s,type:b}=e,z=this._isInLoop;this._isInLoop=!0;const q=`$start${this._count+1}`;z||(this._count+=1);const m=`$$count${this._count}`,g=this._parserBlockLine(i,n,!1,!0);let y="",[E,k]=r;We.includes(E)&&(E=`$${E}`);const D=`var ${q} = Date.now()`;return r.length===1?y=`for (const ${E} of ${this._parserSingleExpression(s)}._value) {
59
+ if (Date.now() - ${q} > 500) {
60
60
  throw new Error('${O0.loopRuntimeErr}')
61
61
  }
62
- ${g}++
63
- ${y}
64
- }`:(We.includes(D)&&(D=`$${D}`),E=`for (const [${k},${D}] of (${this._parserSingleExpression(s)})._value.entries()) {
65
- if (Date.now() - ${m} > 500) {
62
+ ${m}++
63
+ ${g}
64
+ }`:(We.includes(k)&&(k=`$${k}`),y=`for (const [${E},${k}] of (${this._parserSingleExpression(s)})._value.entries()) {
65
+ if (Date.now() - ${q} > 500) {
66
66
  throw new Error('${O0.loopRuntimeErr}')
67
67
  }
68
- ${g}++
69
- ${y}
70
- }`),this._isInLoop=z,E=`${h};
71
- var ${g} = 0;
72
- ${E}`,z&&(this._count=q),n?this._functionalProcess(E,b):E}_parserAgainAssign(e){const{operator:n,name:r,value:i}=e,{varPos:s,declare:b}=r,z=`$againAssign${this._blockCount}`;this._dependsObj[z]=new Map;const q=this._parserName(r,!0);let m="",g=this._parserStmt(i,!0);const y=g.split(`
68
+ ${m}++
69
+ ${g}
70
+ }`),this._isInLoop=z,y=`${D};
71
+ ${z?"":`var ${m} = 0`}
72
+ ${y}`,n?this._functionalProcess(y,b):y}_parserAgainAssign(e){const{operator:n,name:r,value:i}=e,{varPos:s,declare:b}=r,z=`$againAssign${this._blockCount}`;this._dependsObj[z]=new Map;const q=this._parserName(r,!0);let m="",g=this._parserStmt(i,!0);const y=g.split(`
73
73
  /****/
74
74
  `);let E="";y.length>1&&(E=y[0],g=y[1]);let k=`${q} ${n===":="?`= ${g}`:`${n} ${g}`}`;const D=`${s==null?void 0:s.column}_${s==null?void 0:s.lineNumber}`;if(b){const A=this._isInFunc?`$posStr + "_${D}"`:`"${D}"`;m=`;
75
75
  ${this._prefixNameVar}.setVarValue("${q}", ${A}, ${q}, "${b}")`}n==="-="?k=`${q} = ${this._prefixNameVar}.sub(${q}, ${g})`:n==="+="?k=`${q} = ${this._prefixNameVar}.add(${q}, ${g})`:n===":="&&(E=`${E};
@@ -81,15 +81,15 @@ ${this._prefixNameVar}.setVarValue("${q}", ${A}, ${q}, "${b}")`}n==="-="?k=`${q}
81
81
  { ${this._parserBlock(e.block,n)} }
82
82
  break;`}_parserCase(e,n=!1){const{condition:r,block:i}=e;return`case ${this._parserSingleExpression(r)}:
83
83
  { ${this._parserBlock(i,n)} }
84
- break;`}_parserWhileStatement(e,n=!1){const{condition:r,block:i,type:s}=e;let b=`$while${this._blockCount}`;n||(this._dependsObj[b]=new Map);const z=this._isInLoop,q=this._count;this._isInLoop=!0;const m=`$start${this._count++}`,g=`var ${m} = Date.now()`,y=`$$count${this._count}`;let E=`while (${this._parserSingleExpression(r)}) {
85
- if (Date.now() - ${m} > 500) {
84
+ break;`}_parserWhileStatement(e,n=!1){const{condition:r,block:i,type:s}=e;let b=`$while${this._blockCount}`;n||(this._dependsObj[b]=new Map);const z=this._isInLoop;this._isInLoop=!0;const q=`$start${this._count+1}`;z||(this._count+=1);const m=`var ${q} = Date.now()`,g=`$$count${this._count}`;let y=`while (${this._parserSingleExpression(r)}) {
85
+ if (Date.now() - ${q} > 500) {
86
86
  throw new Error('${O0.loopRuntimeErr}')
87
87
  }
88
- ${y}++
88
+ ${g}++
89
89
  ${this._parserBlockLine(i,n,!1,!0)}
90
- }`;return E=`${g};
91
- var ${y} = 0;
92
- ${E}`,n||this._codesCol[this._blockCount].push({code:E,depends:this._getDepends(b)}),z&&(this._count=q),this._isInLoop=z,n?this._functionalProcess(E,s):E}_parserIfStatement(e,n=!1){const{condition:r,block:i,type:s}=e;let b="",z=`$if${this._blockCount}`;n||(this._dependsObj[z]=new Map);for(const[q,m]of i.entries()){const g=this._parserBlockLine(m,n),y=r[q]&&this._parserSingleExpression(r[q]);q===0?b=`if (${y}) {
90
+ }`;return y=`${m};
91
+ ${z?"":`var ${g} = 0`}
92
+ ${y}`,n||this._codesCol[this._blockCount].push({code:y,depends:this._getDepends(b)}),this._isInLoop=z,n?this._functionalProcess(y,s):y}_parserIfStatement(e,n=!1){const{condition:r,block:i,type:s}=e;let b="",z=`$if${this._blockCount}`;n||(this._dependsObj[z]=new Map);for(const[q,m]of i.entries()){const g=this._parserBlockLine(m,n),y=r[q]&&this._parserSingleExpression(r[q]);q===0?b=`if (${y}) {
93
93
  ${g}
94
94
  }`:y?b+=`else if (${y}) {
95
95
  ${g}