@guihz/trading-vue-editor-tes 0.0.134 → 0.0.136
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/assets/{parserTccWorker-CpxYiTUZ.js → parserTccWorker-cirR5d2e.js} +6 -6
- package/lib/trading-vue-editor.js +248 -254
- package/lib/trading-vue-editor.umd.cjs +24 -24
- package/package.json +1 -1
- package/lib/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/lib/vs/base/common/worker/simpleWorker.nls.de.js +0 -8
- package/lib/vs/base/common/worker/simpleWorker.nls.es.js +0 -8
- package/lib/vs/base/common/worker/simpleWorker.nls.fr.js +0 -8
- package/lib/vs/base/common/worker/simpleWorker.nls.it.js +0 -8
- package/lib/vs/base/common/worker/simpleWorker.nls.ja.js +0 -8
- package/lib/vs/base/common/worker/simpleWorker.nls.js +0 -8
- package/lib/vs/base/common/worker/simpleWorker.nls.ko.js +0 -8
- package/lib/vs/base/common/worker/simpleWorker.nls.ru.js +0 -8
- package/lib/vs/base/common/worker/simpleWorker.nls.zh-cn.js +0 -8
- package/lib/vs/base/common/worker/simpleWorker.nls.zh-tw.js +0 -8
- package/lib/vs/base/worker/workerMain.js +0 -27
- package/lib/vs/basic-languages/abap/abap.js +0 -10
- package/lib/vs/basic-languages/apex/apex.js +0 -10
- package/lib/vs/basic-languages/azcli/azcli.js +0 -10
- package/lib/vs/basic-languages/bat/bat.js +0 -10
- package/lib/vs/basic-languages/bicep/bicep.js +0 -11
- package/lib/vs/basic-languages/cameligo/cameligo.js +0 -10
- package/lib/vs/basic-languages/clojure/clojure.js +0 -10
- package/lib/vs/basic-languages/coffee/coffee.js +0 -10
- package/lib/vs/basic-languages/cpp/cpp.js +0 -10
- package/lib/vs/basic-languages/csharp/csharp.js +0 -10
- package/lib/vs/basic-languages/csp/csp.js +0 -10
- package/lib/vs/basic-languages/css/css.js +0 -12
- package/lib/vs/basic-languages/cypher/cypher.js +0 -10
- package/lib/vs/basic-languages/dart/dart.js +0 -10
- package/lib/vs/basic-languages/dockerfile/dockerfile.js +0 -10
- package/lib/vs/basic-languages/ecl/ecl.js +0 -10
- package/lib/vs/basic-languages/elixir/elixir.js +0 -10
- package/lib/vs/basic-languages/flow9/flow9.js +0 -10
- package/lib/vs/basic-languages/freemarker2/freemarker2.js +0 -12
- package/lib/vs/basic-languages/fsharp/fsharp.js +0 -10
- package/lib/vs/basic-languages/go/go.js +0 -10
- package/lib/vs/basic-languages/graphql/graphql.js +0 -10
- package/lib/vs/basic-languages/handlebars/handlebars.js +0 -10
- package/lib/vs/basic-languages/hcl/hcl.js +0 -10
- package/lib/vs/basic-languages/html/html.js +0 -10
- package/lib/vs/basic-languages/ini/ini.js +0 -10
- package/lib/vs/basic-languages/java/java.js +0 -10
- package/lib/vs/basic-languages/javascript/javascript.js +0 -10
- package/lib/vs/basic-languages/julia/julia.js +0 -10
- package/lib/vs/basic-languages/kotlin/kotlin.js +0 -10
- package/lib/vs/basic-languages/less/less.js +0 -11
- package/lib/vs/basic-languages/lexon/lexon.js +0 -10
- package/lib/vs/basic-languages/liquid/liquid.js +0 -10
- package/lib/vs/basic-languages/lua/lua.js +0 -10
- package/lib/vs/basic-languages/m3/m3.js +0 -10
- package/lib/vs/basic-languages/markdown/markdown.js +0 -10
- package/lib/vs/basic-languages/mdx/mdx.js +0 -10
- package/lib/vs/basic-languages/mips/mips.js +0 -10
- package/lib/vs/basic-languages/msdax/msdax.js +0 -10
- package/lib/vs/basic-languages/mysql/mysql.js +0 -10
- package/lib/vs/basic-languages/objective-c/objective-c.js +0 -10
- package/lib/vs/basic-languages/pascal/pascal.js +0 -10
- package/lib/vs/basic-languages/pascaligo/pascaligo.js +0 -10
- package/lib/vs/basic-languages/perl/perl.js +0 -10
- package/lib/vs/basic-languages/pgsql/pgsql.js +0 -10
- package/lib/vs/basic-languages/php/php.js +0 -10
- package/lib/vs/basic-languages/pla/pla.js +0 -10
- package/lib/vs/basic-languages/postiats/postiats.js +0 -10
- package/lib/vs/basic-languages/powerquery/powerquery.js +0 -10
- package/lib/vs/basic-languages/powershell/powershell.js +0 -10
- package/lib/vs/basic-languages/protobuf/protobuf.js +0 -11
- package/lib/vs/basic-languages/pug/pug.js +0 -10
- package/lib/vs/basic-languages/python/python.js +0 -10
- package/lib/vs/basic-languages/qsharp/qsharp.js +0 -10
- package/lib/vs/basic-languages/r/r.js +0 -10
- package/lib/vs/basic-languages/razor/razor.js +0 -10
- package/lib/vs/basic-languages/redis/redis.js +0 -10
- package/lib/vs/basic-languages/redshift/redshift.js +0 -10
- package/lib/vs/basic-languages/restructuredtext/restructuredtext.js +0 -10
- package/lib/vs/basic-languages/ruby/ruby.js +0 -10
- package/lib/vs/basic-languages/rust/rust.js +0 -10
- package/lib/vs/basic-languages/sb/sb.js +0 -10
- package/lib/vs/basic-languages/scala/scala.js +0 -10
- package/lib/vs/basic-languages/scheme/scheme.js +0 -10
- package/lib/vs/basic-languages/scss/scss.js +0 -12
- package/lib/vs/basic-languages/shell/shell.js +0 -10
- package/lib/vs/basic-languages/solidity/solidity.js +0 -10
- package/lib/vs/basic-languages/sophia/sophia.js +0 -10
- package/lib/vs/basic-languages/sparql/sparql.js +0 -10
- package/lib/vs/basic-languages/sql/sql.js +0 -10
- package/lib/vs/basic-languages/st/st.js +0 -10
- package/lib/vs/basic-languages/swift/swift.js +0 -13
- package/lib/vs/basic-languages/systemverilog/systemverilog.js +0 -10
- package/lib/vs/basic-languages/tcl/tcl.js +0 -10
- package/lib/vs/basic-languages/twig/twig.js +0 -10
- package/lib/vs/basic-languages/typescript/typescript.js +0 -10
- package/lib/vs/basic-languages/vb/vb.js +0 -10
- package/lib/vs/basic-languages/wgsl/wgsl.js +0 -307
- package/lib/vs/basic-languages/xml/xml.js +0 -10
- package/lib/vs/basic-languages/yaml/yaml.js +0 -10
- package/lib/vs/editor/editor.main.css +0 -6
- package/lib/vs/editor/editor.main.js +0 -745
- package/lib/vs/editor/editor.main.nls.de.js +0 -31
- package/lib/vs/editor/editor.main.nls.es.js +0 -31
- package/lib/vs/editor/editor.main.nls.fr.js +0 -29
- package/lib/vs/editor/editor.main.nls.it.js +0 -29
- package/lib/vs/editor/editor.main.nls.ja.js +0 -31
- package/lib/vs/editor/editor.main.nls.js +0 -29
- package/lib/vs/editor/editor.main.nls.ko.js +0 -29
- package/lib/vs/editor/editor.main.nls.ru.js +0 -31
- package/lib/vs/editor/editor.main.nls.zh-cn.js +0 -31
- package/lib/vs/editor/editor.main.nls.zh-tw.js +0 -29
- package/lib/vs/language/css/cssMode.js +0 -13
- package/lib/vs/language/css/cssWorker.js +0 -81
- package/lib/vs/language/html/htmlMode.js +0 -13
- package/lib/vs/language/html/htmlWorker.js +0 -453
- package/lib/vs/language/json/jsonMode.js +0 -15
- package/lib/vs/language/json/jsonWorker.js +0 -36
- package/lib/vs/language/typescript/tsMode.js +0 -20
- package/lib/vs/language/typescript/tsWorker.js +0 -37016
- package/lib/vs/loader.js +0 -11
@@ -31,11 +31,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
31
31
|
`)}`,this._preRunMembers[this._blockCount]=[]),a&&(r=`${a}${n?`
|
32
32
|
/****/
|
33
33
|
`:`;
|
34
|
-
`}${r}`),r}_parserEnumStatement(e){let{name:n,fields:r}=e;const a=[],c=[];for(const d of r){const{name:E,value:b}=d,T=b===void 0?`"${E}"`:b;c.push(T),a.push(`${E}: ${T}`)}Nn.includes(n)&&(n=`$${n}`),this._enums.set(n,c);const h=`const ${n} = {${a.join(", ")}}`;return this._codesCol[this._blockCount].push({code:h,varNames:[n],depends:[]}),h}_parserTypeStatement(e){const n=[],r=[];for(const h of e.fields){const{name:d,value:E}=h;h.isVarip&&r.push(`"${d}"`),n.push(`${d}: ${E?this._parserSingleExpression(E):"undefined"}`)}this._userTypes.push(e.name);let a=e.name;Nn.includes(a)&&(a=`$${a}`);const c=`const ${a} = ${this._prefixNameVar}.getTypeInstance({${n.join(", ")}}, [${r.join()}])`;return this._codesCol[this._blockCount].push({code:c,varNames:[a],depends:[]}),c}_parserVarBlockStmt(e){const{nameList:n,value:r}=e;this._addVarList(n);const a=this._parserDeclareAssignNames(n)
|
34
|
+
`}${r}`),r}_parserEnumStatement(e){let{name:n,fields:r}=e;const a=[],c=[];for(const d of r){const{name:E,value:b}=d,T=b===void 0?`"${E}"`:b;c.push(T),a.push(`${E}: ${T}`)}Nn.includes(n)&&(n=`$${n}`),this._enums.set(n,c);const h=`const ${n} = {${a.join(", ")}}`;return this._codesCol[this._blockCount].push({code:h,varNames:[n],depends:[]}),h}_parserTypeStatement(e){const n=[],r=[];for(const h of e.fields){const{name:d,value:E}=h;h.isVarip&&r.push(`"${d}"`),n.push(`${d}: ${E?this._parserSingleExpression(E):"undefined"}`)}this._userTypes.push(e.name);let a=e.name;Nn.includes(a)&&(a=`$${a}`);const c=`const ${a} = ${this._prefixNameVar}.getTypeInstance({${n.join(", ")}}, [${r.join()}])`;return this._codesCol[this._blockCount].push({code:c,varNames:[a],depends:[]}),c}_parserVarBlockStmt(e){const{nameList:n,value:r}=e;this._addVarList(n);const a=this._parserDeclareAssignNames(n),c=`$${a}_${this._blockCount}`;this._dependsObj[c]=new Map;const h=this._parserStmt(r,!0),d=h.split(`
|
35
35
|
/****/
|
36
|
-
`);let
|
37
|
-
let ${a} = ${
|
38
|
-
`:
|
36
|
+
`);let E="";d.length>1?E=`${d[0]}
|
37
|
+
let ${a} = ${d[1]}
|
38
|
+
`:E=`let ${a} = ${h}`;const b={code:E,varNames:a.replace(/[\[\]]/g,"").split(", "),depends:this._getDepends(c)};return this._codesCol[this._blockCount].push(b),E}_getDepends(e){const n=[];for(const[r,a]of this._dependsObj[e])(a.scope||0)>this._blockCount||n.push(a);return delete this._dependsObj[e],n}_parserForToStatement(e,n=!1){let{numerical:r,block:a,name:c}=e;const[h,d,E]=r,b=this._isInLoop;this._isInLoop=!0;const T=`$start${this._count++}`,x=`$$count${this._count}`,w=`$forTo${this._blockCount}`;n||(this._dependsObj[w]=new Map);const F=this._parserSingleExpression(h),R=this._parserSingleExpression(d),v=E?this._parserSingleExpression(E):"",p=this._parserBlockLine(a,n,!1,!0);Nn.includes(c)&&(c=`$${c}`);const g=`const ${T} = Date.now()`,A=`for (let ${c}=${F}; ${c}>=(${R}); ${c}-=(${v||"1"})){
|
39
39
|
if (Date.now() - ${T} > 500) {
|
40
40
|
throw new Error('${xe.loopRuntimeErr}')
|
41
41
|
}
|
@@ -129,7 +129,7 @@ ${this._prefixNameVar}.againAssignParse(${E}, ${F});
|
|
129
129
|
})
|
130
130
|
`}return this._isInFunc=!1,this._currentFuncName="",this._codesCol[this._blockCount].push({funcName:n,depends:this._getDepends(n),hasRequest:e.hasRequest,code:d}),d}_parserArrowFunction(e){let n=`$_${e.name}`;this._nameMap.set(e.name,n);const r=[...e.params];e.hasMemberIndex&&r.push({name:`${this._prefixNameVar}_position`}),n=`${n}${e.index?`$${e.index}`:""}`,this._currentFuncName=n,this._dependsObj[n]=new Map;const a=e.hasRequest?", $paramsExpr":"",c=`const ${n} = (${this._parserParameters(r)}$posStr${a}) => {
|
131
131
|
${this._parserBlock(e.block,!0,!0)}
|
132
|
-
}`;return this._isInFunc=!1,this._currentFuncName="",this._codesCol[this._blockCount].push({funcName:n,depends:this._getDepends(n),hasRequest:e.hasRequest,code:c}),c}_parserParameters(e){return e.length?`{${e.map(n=>{const{name:r,defaultValue:a}=n;let c=r;if(a){const h=this._parserSingleExpression(a);c=`${c} = ${h}`}return c}).join(", ")}},`:""}_parserBlock(e,n=!1,r=!1){return r&&(this._isInFunc=!0),this._parserBlockLine(Array.isArray(e)?e:[e],n,r)}_addVarList(e){const n=this._varlist[this._blockCount]||{};if(e.names)for(const[r,a]of e.names.entries())n[a]=e.posList[r];else n[e.name]=e.pos;this._varlist[this._blockCount]=n}_parserDeclareAssign(e){var
|
132
|
+
}`;return this._isInFunc=!1,this._currentFuncName="",this._codesCol[this._blockCount].push({funcName:n,depends:this._getDepends(n),hasRequest:e.hasRequest,code:c}),c}_parserParameters(e){return e.length?`{${e.map(n=>{const{name:r,defaultValue:a}=n;let c=r;if(a){const h=this._parserSingleExpression(a);c=`${c} = ${h}`}return c}).join(", ")}},`:""}_parserBlock(e,n=!1,r=!1){return r&&(this._isInFunc=!0),this._parserBlockLine(Array.isArray(e)?e:[e],n,r)}_addVarList(e){const n=this._varlist[this._blockCount]||{};if(e.names)for(const[r,a]of e.names.entries())n[a]=e.posList[r];else n[e.name]=e.pos;this._varlist[this._blockCount]=n}_parserDeclareAssign(e){var b;const{nameList:n,value:r}=e;if(n.name==="_")return"";const a=this._parserDeclareAssignNames(n);this._addVarList(n);const c={code:"",varNames:a.replace(/[\[\]]/g,"").split(", "),depends:[]},h=`$${a}_${this._blockCount}`;this._dependsObj[h]=new Map;const d=this._parserSingleExpression(r);let E=`let ${a} = ${d}`;if(n.declare){const T=`${n.pos.column}_${n.pos.lineNumber}`,x=this._isInFunc?`$posStr + "_${T}"`:`"${T}"`;E=`let ${a} = ${this._prefixNameVar}.getVarValue("${a}", ${x}, "${n.declare}") || ${this._prefixNameVar}.setVarValue("${a}", ${x}, ${d}, "${n.declare}")`}return c.code=E,c.depends=this._getDepends(h),(b=this._codesCol[this._blockCount])==null||b.push(c),E}_parserDeclareAssignNames(e){switch(e==null?void 0:e.ruleType){case"VarMultiple":return`[${e.names.map(n=>Nn.includes(n)?`$${n}`:n).join(", ")}]`;case"VarSingle":return Nn.includes(e.name)?`$${e.name}`:e.name}return""}_parserSingleExpression(e){if(!e)return"";const{exprs:n,operator:r}=e;let a="",c=this._isInConditionalStmt;switch(e.ruleType){case ye.MemberIndexExpression:return this._parserMemberIndexExpression(e);case ye.MethodExpression:return this._parserMethodExpression(e);case ye.UnaryExpression:return`${r}${this._parserSingleExpression(n[0])}`;case ye.NotExpression:return`!${this._parserSingleExpression(n[0])}`;case ye.AdditiveExpression:return this._parserAdditiveExpression(e);case ye.MultiplicativeExpression:case ye.RelationalExpression:case ye.EqualityExpression:return`${this._parserSingleExpression(n[0])} ${r} ${this._parserSingleExpression(n[1])}`;case ye.LogicalAndExpression:return this._isInConditionalStmt=!0,a=`${this._parserSingleExpression(n[0])} && ${this._parserSingleExpression(n[1])}`,this._isInConditionalStmt=c,a;case ye.LogicalOrExpression:return this._isInConditionalStmt=!0,a=`${this._parserSingleExpression(n[0])} || ${this._parserSingleExpression(n[1])}`,this._isInConditionalStmt=c,a;case ye.TernaryExpression:return this._isInConditionalStmt=!0,a=`${this._parserSingleExpression(n[0])} ? ${this._parserSingleExpression(n[1])} : ${this._parserSingleExpression(n[2])}`,this._isInConditionalStmt=c,a;case ye.Name:return this._parserName(e);case ye.Literal:return this._parseLiteral(e);case ye.ParenthesizedExpression:return`(${this._parserSingleExpression(e.exprs)})`;default:return e.name||""}}_parserAdditiveExpression(e){const{exprs:n,operator:r}=e,a=this._parserSingleExpression(n[0]),c=this._parserSingleExpression(n[1]);return r==="-"?`${this._prefixNameVar}.sub(${a}, ${c})`:`${this._prefixNameVar}.add(${a}, ${c})`}_parserMemberIndexExpression(e){const{exprs:n,isInFunc:r,ctx:a}=e,c=n[0],h=this._parserSingleExpression(n[1]);let d=this._parserSingleExpression(c);const E=a.start.tokenIndex,b=r?`${this._prefixNameVar}_position`:E;if(c.ruleType===ye.Name&&!c.hasMethod){let T=this._blockCount;const x=c.name;for(c.isBuiltIn||this._setDepend({name:x,scope:c.varScope});T>=0;){const w=this._varlist[T]||{},F=w[x];if(F)return this._getUserVarMemberIndexs(F,x,T,h,r);if(c.isBuiltIn){const R=this._memberIndexList[0]||{};return R[x]=`${this._prefixNameVar}.setCacheData("${x}", ${d})`,`${this._prefixNameVar}.getCacheData("${x}", ${h}, ${d})`}if(x.includes(".")){const R=x.split(".")[0],v=w[R];if(v)return this._getUserVarMemberIndexs(v,x,T,h,r)}T--}return this._getOtherVarMemberIndexs(`${x}_${c.varScope||c.scope}`,x,c.varScope||c.scope,h,r)}else{const T=this._preRunMembers[this._blockCount]||[],x=`$$m${E}_${b}`;T.push(`const ${x} = ${d};
|
133
133
|
${this._prefixNameVar}.setCacheData("m${E}_" + ${b}, ${x})`),this._preRunMembers[this._blockCount]=T}return`${this._prefixNameVar}.getCacheData("m${E}_" + ${b}, ${h}, ${d})`}_getOtherVarMemberIndexs(e,n,r,a,c){const h=this._memberIndexList[r]||{};return e=c&&r!==0?`"${e}_" + $posStr`:`"${e}"`,h[e]=`${this._prefixNameVar}.setCacheData(${e}, ${n})`,this._memberIndexList[r]=h,`${this._prefixNameVar}.getCacheData(${e}, ${a}, ${n})`}_getUserVarMemberIndexs(e,n,r,a,c){return this._getOtherVarMemberIndexs(`${n}_${e.lineNumber}_${e.column}`,n,r,a,c)}_parseLiteral(e){return e.type.endsWith(z.COLOR)?`"${this._colorToRgba(e.value)}"`:e.value}_colorToRgba(e){if(e.startsWith("#")){let n;const r=parseInt(e.substring(1,3),16),a=parseInt(e.substring(3,5),16),c=parseInt(e.substring(5,7),16),h=e.substring(7);return h?n=parseInt(h,16)/255:n=1,`rgba(${Math.round(r)}, ${Math.round(a)}, ${Math.round(c)}, ${n.toFixed(2)})`}return e}_parserName(e,n=!1){const{exprs:r,varScope:a,hasMethod:c,arg:h}=e,d=r.map(E=>{var w;if(typeof E=="string")return E;const{column:b,line:T}=((w=E==null?void 0:E.ctx)==null?void 0:w.start)||{},x=`${T}_${b}`;return this._parserMethodElement(E,x)});if(e.expr&&d.unshift(`(${this._parserSingleExpression(e.expr)})`),e.isBuiltIn)d.join(".")==="strategy.opentrades"&&d.push("opentrades"),d.unshift(e.isConst?this._prefixNameConst:this._prefixNameVar);else if(Nn.includes(d[0])&&(d[0]=`$${d[0]}`),!c){const E={name:d[0],scope:a||(h==null?void 0:h.varScope)||0,isAgainAssign:n,isArg:h==null?void 0:h.isArg,functionName:this._currentFuncName};this._setDepend(E)}return d.join(".")}_setDepend(e){const n=e.name;for(const r of Object.values(this._dependsObj)){const a=r.get(n),c={...e};a&&a.isAgainAssign&&(c.isAgainAssign=!0),r.set(n,c)}}_parserMethodExpression(e){const{exprs:n,ctx:r}=e,{column:a,line:c}=r.start,h=`${c}_${a}`;let d=this._isInFunc?`$posStr + "__${h}"`:`"${h}"`;d=this._isInLoop?`$$count${this._count} + ${d}`:d;let E=!1;const T=n.map(x=>(x.hasMemberIndex&&(E=!0),this._parserMethodElement(x,d))).join(".");if(this._isInConditionalStmt&&E){const x=`$$result_${this._preRunMemberFuncsCount}`;this._preRunMemberFuncsCount++;const w=this._preRunMembersFuncs[this._blockCount]||[];return w.push(`const ${x} = ${T}`),this._preRunMembersFuncs[this._blockCount]=w,x}return T}_parserMethodElement(e,n){let r="",a="";const c={...e.args};e.hasMemberIndex&&(a=`${this._prefixNameVar}_position: ${e.position}`),e.expr&&(r=`(${this._parserSingleExpression(e.expr)})`),r=r?`${r}.${e.name}`:this._nameMap.get(e.name)||e.name;let h=!1;if(e.isBuiltIn){if(Sp.includes(r))r=`${r}.${r}`;else if(r==="max_bars_back"){const{name:E,varPos:b}=c.var||c.params[0];a=`var_name: "${b?`${E}_${b.lineNumber}_${b.column}`:E}"`}r.startsWith(z.INPUT)?(a=`index: ${this._inputCount}`,this._inputCount++):r.startsWith("request.")&&(h=!0),r=`${this._prefixNameFunc}.${r}`}else{const E=r.split(".");let b=E[0];Nn.includes(b)&&(b=`$${b}`,r=E.join("."))}if(e.selfArg){const E=r.split("."),b=E.length;Object.assign(c,{[e.selfArg.name]:{name:E.slice(0,b-1).join(".")}}),r=E[b-1],r=this._nameMap.get(r)||r,this._setDepend({name:E[0],scope:e.varScope||0})}r=`${r}${e.index?`$${e.index}`:""}`;const d=this._parserArguments(c,a,n,h,e.hasRequest,r);if(!e.isBuiltIn){const E=r.split(".");if(E.length>1?this._setDepend({name:E[0],scope:e.varScope||0}):this._setDepend({name:r,scope:0,hasRequest:e.hasRequest,isFunc:!0}),e.funcName){const b=this._nameMap.get(e.funcName)||e.funcName;this._setDepend({name:b,originName:r,scope:0,hasRequest:e.hasRequest,isFunc:!0})}}return r+d}_parserArguments(e,n,r,a=!1,c=!1,h){const d=e.params||[];delete e.params;const E=[],b=[];let T=[],x;const w=(R,v)=>{c&&(this._dependsObj[r]=new Map),a&&v==="expression"&&(this._dependsObj[`$arg_${v}${r}`]=new Map);let p=R.ruleType===ye.Brackethesized?this._parserBrackethesized(R):this._parserSingleExpression(R);if(v&&!["arg0, arg1, ...","number0, number1, ..."].includes(v)){R.isSourceType?E.push(`sourceTypeName: "${R.name}"`):v==="defval"&&h===`${this._prefixNameFunc}.input.enum`&&(x=this._enums.get(R.enumName));const g=this._requestParamsHandle(a,v,r,c,p,h);p=(g==null?void 0:g.code)||p,g!=null&&g.paramsExpr&&T.push(g==null?void 0:g.paramsExpr),E.push(`${v}: ${p}`)}else b.push(p)};for(const R of d)w(R,R.originName);for(const R of Object.keys(e))w(e[R],R);a&&this._isInFunc&&E.push("paramsExpr: $paramsExpr"),n&&E.push(n),x&&E.unshift(`options: [${x.join(", ")}]`);const F=T.length?`, [${this._isInFunc?"...$paramsExpr, ":""}${T.join(", ")}]`:"";return b.length?`({${E.join(", ")}}, [${b.join(", ")}], ${r}${F})`:E.length?`({${E.join(", ")}}, ${r}${F})`:`(${r}${F})`}_requestParamsHandle(e,n,r,a,c,h){if(e&&n==="expression"){const d=this._getDepends(`$arg_${n}${r}`),E=this._getExpressionContext(d);return E.push({scope:1,depends:d.map(b=>(b.isArg&&(b.functionName=this._currentFuncName),b)),code:c}),{code:`'${ld.AES.encrypt(JSON.stringify(E),"1234").toString()}'`}}else if(a){const d=this._getDepends(r),E=this._getExpressionContext(d);return E.push({scope:2,varNames:n,methodName:h,depends:d,dependSelf:d.some(b=>b.name===n),code:`${n} = ${c}`}),{paramsExpr:`'${ld.AES.encrypt(JSON.stringify(E),"1234").toString()}'`}}}_getExpressionContext(e){const n=[],r=[];return this._getDependsCode(e,n,r),n}_getDependsCode(e,n,r){var a,c;for(const h of e)if(!h.isArg){const d=this._codesCol[h.scope||0],E=d.find(T=>{var x;return((x=T.varNames)==null?void 0:x.includes(h.name))||T.funcName===h.name});E&&(r.includes(E)||(r.push(E),E.depends.length&&this._getDependsCode(E.depends,n,r),n.push({scope:h.scope||0,code:E.code,depends:E.depends,funcName:E.funcName,varNames:(a=E.varNames)==null?void 0:a.join(", ")})));const b=d.filter(T=>T.depends.some(x=>x.name===h.name&&x.scope===h.scope&&x.isAgainAssign));for(const T of b)r.includes(T)||(r.push(T),T.depends.length&&this._getDependsCode(T.depends,n,r),n.push({scope:h.scope||0,code:T.code,depends:T.depends,funcName:T.funcName,varNames:(c=T.varNames)==null?void 0:c.join(", ")}))}}_parserBrackethesized(e){return`[${e.exprs.map(r=>this._parserSingleExpression(r)).join(", ")}]`}_functionalProcess(e){return`(function () {
|
134
134
|
let $$_result=undefined;
|
135
135
|
${e}
|
@@ -239,6 +239,6 @@ Input files:
|
|
239
239
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,`+gv(x)}else e.sourceMap.url&&(E.code+=`
|
240
240
|
//# sourceMappingURL=`+e.sourceMap.url)}return e.nameCache&&e.mangle&&(e.mangle.cache&&(e.nameCache.vars=a_(e.mangle.cache)),e.mangle.properties&&e.mangle.properties.cache&&(e.nameCache.props=a_(e.mangle.properties.cache))),b&&b.source_map&&b.source_map.destroy(),r&&(r.end=Date.now(),E.timings={parse:.001*(r.rename-r.parse),rename:.001*(r.compress-r.rename),compress:.001*(r.scope-r.compress),scope:.001*(r.mangle-r.scope),mangle:.001*(r.properties-r.mangle),properties:.001*(r.format-r.properties),format:.001*(r.end-r.format),total:.001*(r.end-r.start)}),E}async function s_(t,e,n){const r=Ev(t,e,n);let a,c;do c=r.next(await a),a=c.value;while(!c.done);return c.value}function u_(t){const e=new Nm(t),n=new kl(e);n.removeErrorListeners();const r=new wm(n),a=new j(r);a._interp.predictionMode=Um.SLL,a.removeErrorListeners();const c=new Tv;n.addErrorListener(c),a.addErrorListener(c),a.buildParseTrees=!0;const h=a.program(),d=r.tokens.filter(E=>E.channel===2);return{errors:c.errors,ast:h,comments:d}}async function xv(t,e,n,r){const{errors:a,ast:c,comments:h}=u_(t+`
|
241
241
|
|
242
|
-
`),d=new Ap(r,h,n),E=await d.visit(c);let b=a.splice(0,1);b.length||(b=d.errors);let T="";const x=new Ky("$"),w=e?"":x.preParser(E);if(e&&!b.some(F=>F.type===Vn.Error)){const F=x.parser(E)||"";T=(await s_(F,{compress:!0,mangle:!0})).code||"";const v={message:xe.indiRunErr,type:Vn.Error,startColumn:0,startLineNumber:0,endColumn:0,endLineNumber:0};if(d.hasUseDrawFunc){if(d.scriptType===Ui.library)d.exportPositions.length||(v.message=xe.libraryExportErr,b.push(v));else if(d.exportPositions.length){const p=d.exportPositions.map(g=>{const{type:A,...O}=g;return{message:Se(xe.exportUseErr,{type:A}),type:Vn.Error,...O}});b.push(...p)}}else switch(d.scriptType){case Ui.indicator:b.push(v);break;case Ui.strategy:d.hasUseCreateOrderFunc||(v.message=xe.strategyRunErr,b.push(v));break}}return{errors:b,functions:Object.fromEntries(d.userFunctions),variables:Object.fromEntries(d.userVariables),types:Object.fromEntries(d.userTypes),methods:Object.fromEntries(d.userMethods),overloadsFuncs:d.overloadsFuncs,imports:Object.fromEntries(d.imports),enums:Object.fromEntries(d.userEnums),codeStr:T,preParserCode:w}}async function Sv(t,e,n,r){const{ast:a,comments:c}=u_(t+`
|
242
|
+
`),d=new Ap(r,h,n),E=await d.visit(c);let b=a.splice(0,1);b.length||(b=d.errors);let T="";const x=new Ky("$"),w=e?"":x.preParser(E);if(e&&!b.some(F=>F.type===Vn.Error)){const F=x.parser(E)||"";console.log(F),T=(await s_(F,{compress:!0,mangle:!0})).code||"";const v={message:xe.indiRunErr,type:Vn.Error,startColumn:0,startLineNumber:0,endColumn:0,endLineNumber:0};if(d.hasUseDrawFunc){if(d.scriptType===Ui.library)d.exportPositions.length||(v.message=xe.libraryExportErr,b.push(v));else if(d.exportPositions.length){const p=d.exportPositions.map(g=>{const{type:A,...O}=g;return{message:Se(xe.exportUseErr,{type:A}),type:Vn.Error,...O}});b.push(...p)}}else switch(d.scriptType){case Ui.indicator:b.push(v);break;case Ui.strategy:d.hasUseCreateOrderFunc||(v.message=xe.strategyRunErr,b.push(v));break}}return{errors:b,functions:Object.fromEntries(d.userFunctions),variables:Object.fromEntries(d.userVariables),types:Object.fromEntries(d.userTypes),methods:Object.fromEntries(d.userMethods),overloadsFuncs:d.overloadsFuncs,imports:Object.fromEntries(d.imports),enums:Object.fromEntries(d.userEnums),codeStr:T,preParserCode:w}}async function Sv(t,e,n,r){const{ast:a,comments:c}=u_(t+`
|
243
243
|
|
244
244
|
`),h=new Ap(r,c,n),d=await h.visit(a),{name:E,index:b}=h.endExport,T=d.findIndex(v=>v.name===E&&v.index===b),x=d.slice(0,T+1),F=new zy("$",e).parser(x)||"",R=await s_(F,{compress:!0,mangle:!0});return{...h.exportLibs,description:h.description,codeStr:R.code||""}}class Tv extends Rm{constructor(){super(...arguments);I(this,"errors",[])}syntaxError(n,r,a,c,h){this.errors.push({message:`syntax error: ${h.replace(/expecting.+/,"")}`,type:Vn.Error,startColumn:c,startLineNumber:a,endColumn:c,endLineNumber:a})}}yf({parseTcc:xv,parseLibraryCode:Sv})})();
|