nadesiko3 3.7.2 → 3.7.4
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/batch/command.txt +472 -469
- package/batch/pickup_command.nako3 +1 -1
- package/core/.eslintrc.cjs +10 -3
- package/core/package-lock.json +1184 -645
- package/core/package.json +4 -5
- package/core/src/nako3.mjs +8 -6
- package/core/src/nako3.mts +19 -16
- package/core/src/nako_ast.mts +2 -3
- package/core/src/nako_core_version.mjs +2 -2
- package/core/src/nako_core_version.mts +2 -2
- package/core/src/nako_csv.mjs +1 -0
- package/core/src/nako_csv.mts +3 -2
- package/core/src/nako_from_dncl.mjs +1 -1
- package/core/src/nako_from_dncl.mts +1 -1
- package/core/src/nako_from_dncl2.mjs +1 -1
- package/core/src/nako_from_dncl2.mts +2 -2
- package/core/src/nako_gen.mjs +37 -35
- package/core/src/nako_gen.mts +70 -67
- package/core/src/nako_global.mjs +3 -2
- package/core/src/nako_global.mts +3 -2
- package/core/src/nako_lexer.mjs +3 -3
- package/core/src/nako_lexer.mts +3 -3
- package/core/src/nako_logger.mjs +1 -1
- package/core/src/nako_logger.mts +2 -2
- package/core/src/nako_parser3.mjs +67 -59
- package/core/src/nako_parser3.mts +96 -90
- package/core/src/nako_parser_base.mts +3 -3
- package/core/src/nako_prepare.mjs +1 -1
- package/core/src/nako_prepare.mts +1 -1
- package/core/src/nako_source_mapping.mts +0 -1
- package/core/src/nako_token.mts +8 -8
- package/core/src/nako_types.mts +1 -1
- package/core/src/plugin_api.mts +1 -1
- package/core/src/plugin_csv.mjs +1 -0
- package/core/src/plugin_csv.mts +2 -1
- package/core/src/plugin_math.mjs +2 -2
- package/core/src/plugin_math.mts +3 -3
- package/core/src/plugin_promise.mjs +1 -1
- package/core/src/plugin_promise.mts +1 -1
- package/core/src/plugin_system.mjs +117 -40
- package/core/src/plugin_system.mts +132 -58
- package/core/src/plugin_test.mjs +3 -1
- package/core/src/plugin_test.mts +3 -1
- package/core/test/basic_test.mjs +16 -0
- package/core/test/calc_test.mjs +7 -0
- package/core/test/plugin_system_test.mjs +33 -0
- package/doc/files.md +4 -4
- package/doc/plugins.md +1 -1
- package/package.json +9 -9
- package/release/_hash.txt +36 -121
- package/release/_script-tags.txt +16 -33
- package/release/command.json +1 -1
- package/release/command.json.js +1 -1
- package/release/command_cnako3.json +1 -1
- package/release/command_list.json +1 -1
- package/release/edit_main.js +3 -3
- package/release/edit_main.js.map +2 -2
- package/release/editor.js +3 -3
- package/release/plugin_markup.js +53 -53
- package/release/plugin_markup.js.map +3 -3
- package/release/plugin_weykturtle3d.js +1 -1
- package/release/plugin_weykturtle3d.js.map +4 -4
- package/release/version.js +3 -3
- package/release/version_main.js +3 -3
- package/release/version_main.js.map +2 -2
- package/release/wnako3.js +66 -66
- package/release/wnako3.js.map +3 -3
- package/release/wnako3webworker.js +58 -58
- package/release/wnako3webworker.js.map +3 -3
- package/src/browsers.txt +30 -20
- package/src/cnako3mod.mjs +19 -18
- package/src/cnako3mod.mts +17 -16
- package/src/deno_wrapper.mjs +6 -6
- package/src/deno_wrapper.mts +11 -11
- package/src/nako_version.mjs +2 -2
- package/src/nako_version.mts +2 -2
- package/src/plugin_browser.mjs +2 -2
- package/src/plugin_browser.mts +5 -5
- package/src/plugin_browser_ajax.mjs +2 -2
- package/src/plugin_browser_ajax.mts +2 -2
- package/src/plugin_browser_api.mts +0 -1
- package/src/plugin_browser_crypto.mjs +8 -8
- package/src/plugin_browser_crypto.mts +13 -13
- package/src/plugin_browser_dom_basic.mjs +3 -3
- package/src/plugin_browser_dom_basic.mts +5 -7
- package/src/plugin_browser_dom_event.mjs +1 -1
- package/src/plugin_browser_dom_event.mts +2 -1
- package/src/plugin_browser_dom_parts.mjs +33 -18
- package/src/plugin_browser_dom_parts.mts +60 -59
- package/src/plugin_browser_speech.mjs +1 -1
- package/src/plugin_browser_speech.mts +1 -1
- package/src/plugin_node.mjs +5 -3
- package/src/plugin_node.mts +6 -4
- package/src/plugin_weykturtle3d.mjs +38 -15
- package/src/plugin_weykturtle3d.mts +279 -240
- package/src/plugin_weykturtle3d_three.mjs +3 -0
- package/src/plugin_weykturtle3d_three.mts +214 -0
- package/src/plugin_weykturtle3d_threeutil.mjs +28 -0
- package/src/plugin_weykturtle3d_threeutil.mts +31 -0
- package/src/wnako3.mjs +1 -0
- package/src/wnako3.mts +1 -0
- package/src/wnako3mod.mjs +5 -2
- package/src/wnako3mod.mts +6 -3
- package/batch/command_nakopad.txt +0 -1177
- package/core/__report.txt +0 -617
- package/core/command/plugin_snako.mjs +0 -112
- package/core/command/snako.mjs +0 -108
- package/release/core_src_nako_josi_list_mjs.js +0 -3
- package/release/core_src_nako_josi_list_mjs.js.LICENSE.txt +0 -3
- package/release/core_src_nako_josi_list_mjs.js.map +0 -1
- package/release/core_src_nako_reserved_words_mjs.js +0 -3
- package/release/core_src_nako_reserved_words_mjs.js.LICENSE.txt +0 -3
- package/release/core_src_nako_reserved_words_mjs.js.map +0 -1
- package/release/editor/edit_main.js +0 -48
- package/release/editor/edit_main.js.map +0 -7
- package/release/editor/version_main.js +0 -44
- package/release/editor/version_main.js.map +0 -7
- package/release/editor.js.LICENSE.txt +0 -91
- package/release/editor.js.map +0 -1
- package/release/nako_gen_async.js +0 -2
- package/release/nako_gen_async.js.LICENSE.txt +0 -21
- package/release/nako_gen_async.js.map +0 -1
- package/release/plugin_caniuse.js.LICENSE.txt +0 -15
- package/release/plugin_datetime.js.LICENSE.txt +0 -21
- package/release/plugin_kansuji.js.LICENSE.txt +0 -3
- package/release/plugin_markup.js.LICENSE.txt +0 -15
- package/release/plugin_toml.js +0 -295
- package/release/plugin_toml.js.map +0 -7
- package/release/plugin_turtle.js.LICENSE.txt +0 -9
- package/release/plugin_webworker.js.LICENSE.txt +0 -3
- package/release/plugin_weykturtle3d.js.LICENSE.txt +0 -3
- package/release/src/plugin_caniuse.js +0 -2
- package/release/src/plugin_caniuse.js.map +0 -7
- package/release/src/plugin_datetime.js +0 -2
- package/release/src/plugin_datetime.js.map +0 -7
- package/release/src/plugin_kansuji.js +0 -2
- package/release/src/plugin_kansuji.js.map +0 -7
- package/release/src/plugin_keigo.js +0 -2
- package/release/src/plugin_keigo.js.map +0 -7
- package/release/src/plugin_markup.js +0 -64
- package/release/src/plugin_markup.js.map +0 -7
- package/release/src/plugin_three.js +0 -2
- package/release/src/plugin_three.js.map +0 -7
- package/release/src/plugin_turtle.js +0 -2
- package/release/src/plugin_turtle.js.map +0 -7
- package/release/src/plugin_webworker.js +0 -4
- package/release/src/plugin_webworker.js.map +0 -7
- package/release/src/plugin_weykturtle3d.js +0 -2
- package/release/src/plugin_weykturtle3d.js.map +0 -7
- package/release/src/wnako3.js +0 -482
- package/release/src/wnako3.js.map +0 -7
- package/release/src/wnako3webworker.js +0 -428
- package/release/src/wnako3webworker.js.map +0 -7
- package/release/stats.json +0 -1
- package/release/version.js.LICENSE.txt +0 -65
- package/release/version.js.map +0 -1
- package/release/wnako3.js.LICENSE.txt +0 -341
- package/release/wnako3webworker.js.LICENSE.txt +0 -209
- package/src/plugin_three.mts +0 -240
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";(()=>{var T={and:1,or:1,eq:2,noteq:2,"===":2,"!==":2,gt:2,gteq:2,lt:2,lteq:2,"&":3,"+":4,"-":4,shift_l:4,shift_r:4,shift_r0:4,"*":5,"/":5,"\xF7":5,"\xF7\xF7":5,"%":5,"^":6,"**":6},G=["\u3044\u3066","\u3048\u3066","\u304D\u3066","\u3051\u3066","\u3057\u3066","\u3063\u3066","\u306B\u3066","\u307F\u3066","\u3081\u3066","\u306D\u3066","\u306B\u306F","\u3093\u3067"],Q=[];for(let n in T)Q.push(n);function j(n="?",e="",t=-1,r=0,s="main.nako3"){return{type:n,value:e,indent:t,line:r,column:0,file:s,josi:""}}var ee=class{constructor(e){this.logger=e,this.stackList=[],this.tokens=[],this.usedFuncs=new Set,this.stack=[],this.index=0,this.y=[],this.modName="inline",this.namespaceStack=[],this.modList=[],this.funclist=new Map,this.funcLevel=0,this.usedAsyncFn=!1,this.localvars=new Map([["\u305D\u308C",{type:"var",value:""}]]),this.genMode="sync",this.arrayIndexFrom=0,this.flagReverseArrayIndex=!1,this.flagCheckArrayInit=!1,this.recentlyCalledFunc=[],this.isReadingCalc=!1,this.isExportDefault=!0,this.isExportStack=[],this.moduleExport=new Map,this.isModifiedNodes=!1,this.init()}init(){this.funclist=new Map,this.moduleExport=new Map,this.reset()}reset(){this.tokens=[],this.index=0,this.stack=[],this.y=[],this.genMode="sync"}setFuncList(e){this.funclist=e}setModuleExport(e){this.moduleExport=e}popStack(e=void 0){if(!e){let t=this.stack.pop();return t||null}for(let t=this.stack.length-1;t>=0;t--){let r=this.stack[t];if(e.length===0||e.indexOf(r.josi)>=0)return this.stack.splice(t,1),this.logger.trace("POP :"+JSON.stringify(r)),r}return null}saveStack(){this.stackList.push(this.stack),this.stack=[]}loadStack(){this.stack=this.stackList.pop()}findVar(e){if(this.localvars.get(e))return{name:e,scope:"local",info:this.localvars.get(e)};if(e.indexOf("__")>=0)return this.funclist.get(e)?{name:e,scope:"global",info:this.funclist.get(e)}:void 0;let t=`${this.modName}__${e}`;if(this.funclist.get(t))return{name:t,scope:"global",info:this.funclist.get(t)};for(let r of this.modList){let s=`${r}__${e}`,i=this.moduleExport.get(r),o=this.funclist.get(s);if(o&&(o.isExport===!0||o.isExport!==!1&&i!==!1))return{name:s,scope:"global",info:this.funclist.get(s)}}if(this.funclist.get(e))return{name:e,scope:"system",info:this.funclist.get(e)}}pushStack(e){this.logger.trace("PUSH:"+JSON.stringify(e)),this.stack.push(e)}isEOF(){return this.index>=this.tokens.length}getIndex(){return this.index}check(e){return this.tokens[this.index].type===e}check2(e){for(let t=0;t<e.length;t++){let r=t+this.index;if(this.tokens.length<=r)return!1;if(e[t]==="*")continue;let s=this.tokens[r];if(e[t]instanceof Array){if(e[t].indexOf(s.type)<0)return!1;continue}if(s.type!==e[t])return!1}return!0}checkTypes(e){let t=this.tokens[this.index].type;return e.indexOf(t)>=0}accept(e){let t=[],r=this.index,s=()=>(this.index=r,!1);for(let i=0;i<e.length;i++){if(this.isEOF())return s();let o=e[i];if(o==null)return s();if(typeof o=="string"){let u=this.get();if(u&&u.type!==o)return s();t[i]=u;continue}if(typeof o=="function"){let c=o.bind(this)(t);if(c===null)return s();t[i]=c;continue}if(o instanceof Array){if(!this.checkTypes(o))return s();t[i]=this.get();continue}throw new Error("System Error : accept broken : "+typeof o)}return this.y=t,!0}get(){return this.isEOF()?null:this.tokens[this.index++]}getCur(){if(this.isEOF())throw new Error("\u30C8\u30FC\u30AF\u30F3\u304C\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002");let e=this.tokens[this.index++];if(!e)throw new Error("\u30C8\u30FC\u30AF\u30F3\u304C\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002");return e}unget(){this.index>0&&this.index--}peek(e=0){return this.isEOF()?null:this.tokens[this.index+e]}peekDef(e=null){return this.isEOF()?(e||(e=j()),e):this.tokens[this.index]}peekSourceMap(e=void 0){let t=e===void 0?this.peek():e;return t===null?{startOffset:void 0,endOffset:void 0,file:void 0,line:0,column:0}:{startOffset:t.startOffset,endOffset:t.endOffset,file:t.file,line:t.line,column:t.column}}nodeToStr(e,t,r){let s=t.depth-1,i=u=>t.typeName!==void 0?t.typeName:u,o=r?" debug: "+JSON.stringify(e,null,2):"";if(!e)return"(NULL)";switch(e.type){case"not":if(s>=0){let u=e.blocks[0];return`${i("")}\u300E${this.nodeToStr(u,{depth:s},r)}\u306B\u6F14\u7B97\u5B50\u300Enot\u300F\u3092\u9069\u7528\u3057\u305F\u5F0F${o}\u300F`}else return`${i("\u6F14\u7B97\u5B50")}\u300Enot\u300F`;case"op":{let u=e,c=u.operator||"",a={eq:"\uFF1D",not:"!",gt:">",lt:"<",and:"\u304B\u3064",or:"\u307E\u305F\u306F"};if(c in a&&(c=a[c]),s>=0){let f=this.nodeToStr(u.blocks[0],{depth:s},r),l=this.nodeToStr(u.blocks[1],{depth:s},r);return u.operator==="eq"?`${i("")}\u300E${f}\u3068${l}\u304C\u7B49\u3057\u3044\u304B\u3069\u3046\u304B\u306E\u6BD4\u8F03${o}\u300F`:`${i("")}\u300E${f}\u3068${l}\u306B\u6F14\u7B97\u5B50\u300E${c}\u300F\u3092\u9069\u7528\u3057\u305F\u5F0F${o}\u300F`}else return`${i("\u6F14\u7B97\u5B50")}\u300E${c}${o}\u300F`}case"number":return`${i("\u6570\u5024")}${e.value}`;case"bigint":return`${i("\u5DE8\u5927\u6574\u6570")}${e.value}`;case"string":return`${i("\u6587\u5B57\u5217")}\u300E${e.value}${o}\u300F`;case"word":return`${i("\u5358\u8A9E")}\u300E${e.value}${o}\u300F`;case"func":return`${i("\u95A2\u6570")}\u300E${e.name||e.value}${o}\u300F`;case"eol":return"\u884C\u306E\u672B\u5C3E";case"eof":return"\u30D5\u30A1\u30A4\u30EB\u306E\u672B\u5C3E";default:{let u=e.name;return u&&(u=e.value),typeof u!="string"&&(u=e.type),`${i("")}\u300E${u}${o}\u300F`}}}};var C=class extends Error{constructor(e,t,r=void 0,s=void 0){let i=`${r||""}${s===void 0?"":`(${s+1}\u884C\u76EE): `}`;t=t.replace(/『main__(.+?)』/g,"\u300E$1\u300F"),super(`[${e}]${i}${t}`),this.name="NakoError",this.type="NakoError",this.tag="["+e+"]",this.positionJa=i,this.msg=t}},te=class extends C{constructor(e,t,r){super("\u30A4\u30F3\u30C7\u30F3\u30C8\u30A8\u30E9\u30FC",e,r,t),this.type="NakoIndentError",this.line=t,this.file=r}},V=class extends C{constructor(e,t,r,s,i){super("\u5B57\u53E5\u89E3\u6790\u30A8\u30E9\u30FC\uFF08\u5185\u90E8\u30A8\u30E9\u30FC\uFF09",e,i,s),this.type="InternalLexerError",this.preprocessedCodeStartOffset=t,this.preprocessedCodeEndOffset=r,this.line=s,this.file=i}},D=class extends C{constructor(e,t,r,s,i){super("\u5B57\u53E5\u89E3\u6790\u30A8\u30E9\u30FC",e,i,s),this.type="NakoLexerError",this.startOffset=t,this.endOffset=r,this.line=s,this.file=i}},p=class n extends C{static fromNode(e,t,r=void 0){if(!t)return new n(e,void 0,void 0,void 0,void 0);let s=typeof t.startOffset=="number"?t.startOffset:void 0,i=r&&typeof r.endOffset=="number"?r.endOffset:typeof t.endOffset=="number"?t.endOffset:void 0;return new n(e,t.line,s,i,t.file)}constructor(e,t,r,s,i){super("\u6587\u6CD5\u30A8\u30E9\u30FC",e,i,t),this.type="NakoSyntaxError",this.file=i,this.line=t,this.startOffset=r,this.endOffset=s}},J=class n extends C{constructor(e,t){let r="unknown";typeof e=="string"?r=e:e instanceof n||e instanceof C?r=e.msg:e instanceof Error&&(e.name==="Error"?r=e.message:r=`${e.name}: ${e.message}`);let s,i,o;t===void 0?(s=void 0,i=void 0):(o=/^l(-?\d+):(.*)$/.exec(t))?(s=parseInt(o[1]),i=o[2]):(o=/^l(-?\d+)$/.exec(t))?(s=parseInt(o[1]),i="main.nako3"):(s=0,i=t),super("\u5B9F\u884C\u6642\u30A8\u30E9\u30FC",r,i,s),this.type="NakoRuntimeError",this.lineNo=t,this.line=s,this.file=i}},X=class extends C{constructor(e,t,r){super("\u53D6\u308A\u8FBC\u307F\u30A8\u30E9\u30FC",e,t,r),this.file=t,this.line=r}};var rt=new Map([["\u3082\u3057","\u3082\u3057"],["\u56DE","\u56DE"],["\u56DE\u7E70\u8FD4","\u56DE"],["\u9593","\u9593"],["\u9593\u7E70\u8FD4","\u9593"],["\u7E70\u8FD4","\u7E70\u8FD4"],["\u5897\u7E70\u8FD4","\u5897\u7E70\u8FD4"],["\u6E1B\u7E70\u8FD4","\u6E1B\u7E70\u8FD4"],["\u5F8C\u5224\u5B9A","\u5F8C\u5224\u5B9A"],["\u53CD\u5FA9","\u53CD\u5FA9"],["\u629C","\u629C\u3051\u308B"],["\u7D9A","\u7D9A\u3051\u308B"],["\u623B","\u623B\u308B"],["\u5148","\u5148\u306B"],["\u6B21","\u6B21\u306B"],["\u4EE3\u5165","\u4EE3\u5165"],["\u5B9F\u884C\u901F\u5EA6\u512A\u5148","\u5B9F\u884C\u901F\u5EA6\u512A\u5148"],["\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30E2\u30CB\u30BF\u9069\u7528","\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30E2\u30CB\u30BF\u9069\u7528"],["\u5B9A","\u5B9A\u3081\u308B"],["\u9010\u6B21\u5B9F\u884C","\u9010\u6B21\u5B9F\u884C"],["\u6761\u4EF6\u5206\u5C90","\u6761\u4EF6\u5206\u5C90"],["\u5897","\u5897"],["\u6E1B","\u6E1B"],["\u5909\u6570","\u5909\u6570"],["\u5B9A\u6570","\u5B9A\u6570"],["\u30A8\u30E9\u30FC\u76E3\u8996","\u30A8\u30E9\u30FC\u76E3\u8996"],["\u30A8\u30E9\u30FC","\u30A8\u30E9\u30FC"],["\u305D\u308C","word"],["\u305D\u3046","word"],["\u95A2\u6570","def_func"],["\u30A4\u30F3\u30C7\u30F3\u30C8\u69CB\u6587","\u30A4\u30F3\u30C7\u30F3\u30C8\u69CB\u6587"],["\u975E\u540C\u671F\u30E2\u30FC\u30C9","\u975E\u540C\u671F\u30E2\u30FC\u30C9"],["DNCL\u30E2\u30FC\u30C9","DNCL\u30E2\u30FC\u30C9"],["DNCL2\u30E2\u30FC\u30C9","DNCL2\u30E2\u30FC\u30C9"],["\u30E2\u30FC\u30C9\u8A2D\u5B9A","\u30E2\u30FC\u30C9\u8A2D\u5B9A"],["\u53D6\u8FBC","\u53D6\u8FBC"],["\u30E2\u30B8\u30E5\u30FC\u30EB\u516C\u958B\u65E2\u5B9A\u5024","\u30E2\u30B8\u30E5\u30FC\u30EB\u516C\u958B\u65E2\u5B9A\u5024"],["\u53B3\u30C1\u30A7\u30C3\u30AF","\u53B3\u30C1\u30A7\u30C3\u30AF"]]),pe=rt;function Ae(n){let e=n.charCodeAt(0);return n===" "?4:n===" "||n==="|"?1:n==="\u30FB"||n==="\u3000"||n==="\u23CB"||n==="\u23CC"||e>=9472&&e<=9599||e>=9120&&e<=9135||e>=9144&&e<=9151?2:0}var re=["\u306B\u3064\u3044\u3066","\u304F\u3089\u3044","\u306A\u306E\u304B","\u307E\u3067\u3092","\u307E\u3067\u306E","\u306B\u3088\u308B","\u3068\u306F","\u304B\u3089","\u307E\u3067","\u3060\u3051","\u3088\u308A","\u307B\u3069","\u306A\u3069","\u3044\u3066","\u3048\u3066","\u304D\u3066","\u3051\u3066","\u3057\u3066","\u3063\u3066","\u306B\u3066","\u307F\u3066","\u3081\u3066","\u306D\u3066","\u3067\u306F","\u306B\u306F","\u3093\u3067","\u305A\u3064","\u306F","\u3092","\u306B","\u3078","\u3067","\u3068","\u304C","\u306E"],st=["\u3067\u306A\u3051\u308C\u3070","\u306A\u3051\u308C\u3070","\u306A\u3089\u3070","\u306A\u3089","\u305F\u3089","\u308C\u3070"],it=["\u3053\u3068","\u3067\u3042\u308B","\u3067\u3059","\u3057\u307E\u3059","\u3067\u3057\u305F"],de={};st.forEach(n=>{re.push(n),de[n]=!0});var B={};it.forEach(n=>{re.push(n),B[n]=!0});var ne=[];for(let n of re)ne.push("\u3082\u306E"+n),ne.push(n);ne.sort((n,e)=>e.length-n.length);var ot="^[\\t ]*("+ne.join("|")+")",U=new RegExp(ot),Ne=re;var ut=/^[\u3005\u4E00-\u9FCF_a-zA-Z0-9ァ-ヶー\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]+/,Oe=/^[ぁ-ん]/,ct=/^[ぁ-ん]+$/,at=/^.+(以上|以下|超|未満)$/,ft=/^(かつ|または)/,Fe=n=>function(){throw new Error("\u7A81\u7136\u306E\u300E"+n+"\u300F\u304C\u3042\u308A\u307E\u3059\u3002")},Ee=/^(円|ドル|元|歩|㎡|坪|度|℃|°|個|つ|本|冊|才|歳|匹|枚|皿|セット|羽|人|件|行|列|機|品|m|mm|cm|km|g|kg|t|b|mb|kb|gb)/,Ce=/^(px|em|ex|rem|vw|vh|vmin|vmax)/,Me=[{name:"\u3053\u3053\u307E\u3067",pattern:/^;;;/},{name:"eol",pattern:/^\n/},{name:"eol",pattern:/^;/},{name:"space",pattern:/^(\x20|\x09|・|⎿ |└||)+/},{name:"comma",pattern:/^,/},{name:"line_comment",pattern:/^#[^\n]*/},{name:"line_comment",pattern:/^\/\/[^\n]*/},{name:"range_comment",pattern:/^\/\*/,cbParser:ht},{name:"def_test",pattern:/^●テスト:/},{name:"def_func",pattern:/^●/},{name:"\u2026",pattern:/^…/},{name:"\u2026",pattern:/^\.{2,3}/},{name:"bigint",pattern:/^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*n/,readJosi:!0},{name:"bigint",pattern:/^0[oO][0-7]+(_[0-7]+)*n/,readJosi:!0},{name:"bigint",pattern:/^0[bB][0-1]+(_[0-1]+)*n/,readJosi:!0},{name:"bigint",pattern:/^\d+(_\d+)*?n/,readJosi:!0},{name:"number",pattern:/^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*/,readJosi:!0,cb:W},{name:"number",pattern:/^0[oO][0-7]+(_[0-7]+)*/,readJosi:!0,cb:W},{name:"number",pattern:/^0[bB][0-1]+(_[0-1]+)*/,readJosi:!0,cb:W},{name:"number",pattern:/^\d+(_\d+)*\.(\d+(_\d+)*)?([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:W},{name:"number",pattern:/^\.\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:W},{name:"number",pattern:/^\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:W},{name:"\u3053\u3053\u304B\u3089",pattern:/^(ここから),?/},{name:"\u3053\u3053\u307E\u3067",pattern:/^(ここまで|💧)/},{name:"\u3082\u3057",pattern:/^もしも?/},{name:"\u9055\u3048\u3070",pattern:/^違(えば)?/},{name:"shift_r0",pattern:/^>>>/},{name:"shift_r",pattern:/^>>/},{name:"shift_l",pattern:/^<</},{name:"===",pattern:/^===/},{name:"!==",pattern:/^!==/},{name:"gteq",pattern:/^(≧|>=|=>)/},{name:"lteq",pattern:/^(≦|<=|=<)/},{name:"noteq",pattern:/^(≠|<>|!=)/},{name:"\u2190",pattern:/^(←|<--)/},{name:"eq",pattern:/^(==|🟰🟰)/},{name:"eq",pattern:/^(=|🟰)/},{name:"line_comment",pattern:/^(!|💡)(インデント構文|ここまでだるい|DNCLモード|DNCL2モード|DNCL2)[^\n]*/},{name:"not",pattern:/^(!|💡)/},{name:"gt",pattern:/^>/},{name:"lt",pattern:/^</},{name:"and",pattern:/^(かつ|&&|and\s)/},{name:"or",pattern:/^(または|或いは|あるいは|or\s|\|\|)/},{name:"@",pattern:/^@/},{name:"+",pattern:/^\+/},{name:"-",pattern:/^-/},{name:"**",pattern:/^(××|\*\*)/},{name:"*",pattern:/^(×|\*)/},{name:"\xF7\xF7",pattern:/^÷÷/},{name:"\xF7",pattern:/^(÷|\/)/},{name:"%",pattern:/^%/},{name:"^",pattern:/^\^/},{name:"&",pattern:/^&/},{name:"[",pattern:/^\[/},{name:"]",pattern:/^]/,readJosi:!0},{name:"(",pattern:/^\(/},{name:")",pattern:/^\)/,readJosi:!0},{name:"|",pattern:/^\|/},{name:"??",pattern:/^\?\?/},{name:"word",pattern:/^\$\{.+?\}/,cbParser:n=>dt(n)},{name:"$",pattern:/^(\$|\.)/},{name:"string",pattern:/^🌿/,cbParser:n=>R("\u{1F33F}","\u{1F33F}",n)},{name:"string_ex",pattern:/^🌴/,cbParser:n=>R("\u{1F334}","\u{1F334}",n)},{name:"string_ex",pattern:/^「/,cbParser:n=>R("\u300C","\u300D",n)},{name:"string",pattern:/^『/,cbParser:n=>R("\u300E","\u300F",n)},{name:"string_ex",pattern:/^“/,cbParser:n=>R("\u201C","\u201D",n)},{name:"string_ex",pattern:/^"/,cbParser:n=>R('"','"',n)},{name:"string",pattern:/^'/,cbParser:n=>R("'","'",n)},{name:"\u300D",pattern:/^」/,cbParser:Fe("\u300D")},{name:"\u300F",pattern:/^』/,cbParser:Fe("\u300F")},{name:"func",pattern:/^\{関数\},?/},{name:"{",pattern:/^\{/},{name:"}",pattern:/^\}/,readJosi:!0},{name:":",pattern:/^:/},{name:"_eol",pattern:/^_\s*\n/},{name:"dec_lineno",pattern:/^‰/},{name:"word",pattern:/^[\uD800-\uDBFF][\uDC00-\uDFFF][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^[\u1F60-\u1F6F][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^《.+?》/,readJosi:!0},{name:"word",pattern:/^[_a-zA-Z\u3005\u4E00-\u9FCFぁ-んァ-ヶ\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]/,cbParser:pt}];function lt(n){return Oe.test(n)?ct.test(n)?n:n.replace(/[ぁ-ん]+$/g,""):n.replace(/[ぁ-ん]+/g,"")}function ht(n){let e="",t="",r=0;n=n.substring(2);let s=n.indexOf("*/");s<0?(e=n,n=""):(e=n.substring(0,s),n=n.substring(s+2));for(let i=0;i<e.length;i++)e.charAt(i)===`
|
|
1
|
+
"use strict";(()=>{var T={and:1,or:1,eq:2,noteq:2,"===":2,"!==":2,gt:2,gteq:2,lt:2,lteq:2,"&":3,"+":4,"-":4,shift_l:4,shift_r:4,shift_r0:4,"*":5,"/":5,"\xF7":5,"\xF7\xF7":5,"%":5,"^":6,"**":6},G=["\u3044\u3066","\u3048\u3066","\u304D\u3066","\u3051\u3066","\u3057\u3066","\u3063\u3066","\u306B\u3066","\u307F\u3066","\u3081\u3066","\u306D\u3066","\u306B\u306F","\u3093\u3067"],Q=[];for(let n in T)Q.push(n);function j(n="?",e="",t=-1,r=0,s="main.nako3"){return{type:n,value:e,indent:t,line:r,column:0,file:s,josi:""}}var ee=class{constructor(e){this.logger=e,this.stackList=[],this.tokens=[],this.usedFuncs=new Set,this.stack=[],this.index=0,this.y=[],this.modName="inline",this.namespaceStack=[],this.modList=[],this.funclist=new Map,this.funcLevel=0,this.usedAsyncFn=!1,this.localvars=new Map([["\u305D\u308C",{type:"var",value:""}]]),this.genMode="sync",this.arrayIndexFrom=0,this.flagReverseArrayIndex=!1,this.flagCheckArrayInit=!1,this.recentlyCalledFunc=[],this.isReadingCalc=!1,this.isExportDefault=!0,this.isExportStack=[],this.moduleExport=new Map,this.isModifiedNodes=!1,this.init()}init(){this.funclist=new Map,this.moduleExport=new Map,this.reset()}reset(){this.tokens=[],this.index=0,this.stack=[],this.y=[],this.genMode="sync"}setFuncList(e){this.funclist=e}setModuleExport(e){this.moduleExport=e}popStack(e=void 0){if(!e){let t=this.stack.pop();return t||null}for(let t=this.stack.length-1;t>=0;t--){let r=this.stack[t];if(e.length===0||e.indexOf(r.josi)>=0)return this.stack.splice(t,1),this.logger.trace("POP :"+JSON.stringify(r)),r}return null}saveStack(){this.stackList.push(this.stack),this.stack=[]}loadStack(){this.stack=this.stackList.pop()}findVar(e){if(this.localvars.get(e))return{name:e,scope:"local",info:this.localvars.get(e)};if(e.indexOf("__")>=0)return this.funclist.get(e)?{name:e,scope:"global",info:this.funclist.get(e)}:void 0;let t=`${this.modName}__${e}`;if(this.funclist.get(t))return{name:t,scope:"global",info:this.funclist.get(t)};for(let r of this.modList){let s=`${r}__${e}`,i=this.moduleExport.get(r),o=this.funclist.get(s);if(o&&(o.isExport===!0||o.isExport!==!1&&i!==!1))return{name:s,scope:"global",info:this.funclist.get(s)}}if(this.funclist.get(e))return{name:e,scope:"system",info:this.funclist.get(e)}}pushStack(e){this.logger.trace("PUSH:"+JSON.stringify(e)),this.stack.push(e)}isEOF(){return this.index>=this.tokens.length}getIndex(){return this.index}check(e){return this.tokens[this.index].type===e}check2(e){for(let t=0;t<e.length;t++){let r=t+this.index;if(this.tokens.length<=r)return!1;if(e[t]==="*")continue;let s=this.tokens[r];if(e[t]instanceof Array){if(e[t].indexOf(s.type)<0)return!1;continue}if(s.type!==e[t])return!1}return!0}checkTypes(e){let t=this.tokens[this.index].type;return e.indexOf(t)>=0}accept(e){let t=[],r=this.index,s=()=>(this.index=r,!1);for(let i=0;i<e.length;i++){if(this.isEOF())return s();let o=e[i];if(o==null)return s();if(typeof o=="string"){let u=this.get();if(u&&u.type!==o)return s();t[i]=u;continue}if(typeof o=="function"){let c=o.bind(this)(t);if(c===null)return s();t[i]=c;continue}if(o instanceof Array){if(!this.checkTypes(o))return s();t[i]=this.get();continue}throw new Error("System Error : accept broken : "+typeof o)}return this.y=t,!0}get(){return this.isEOF()?null:this.tokens[this.index++]}getCur(){if(this.isEOF())throw new Error("\u30C8\u30FC\u30AF\u30F3\u304C\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002");let e=this.tokens[this.index++];if(!e)throw new Error("\u30C8\u30FC\u30AF\u30F3\u304C\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3002");return e}unget(){this.index>0&&this.index--}peek(e=0){return this.isEOF()?null:this.tokens[this.index+e]}peekDef(e=null){return this.isEOF()?(e||(e=j()),e):this.tokens[this.index]}peekSourceMap(e=void 0){let t=e===void 0?this.peek():e;return t===null?{startOffset:void 0,endOffset:void 0,file:void 0,line:0,column:0}:{startOffset:t.startOffset,endOffset:t.endOffset,file:t.file,line:t.line,column:t.column}}nodeToStr(e,t,r){let s=t.depth-1,i=u=>t.typeName!==void 0?t.typeName:u,o=r?" debug: "+JSON.stringify(e,null,2):"";if(!e)return"(NULL)";switch(e.type){case"not":if(s>=0){let u=e.blocks[0];return`${i("")}\u300E${this.nodeToStr(u,{depth:s},r)}\u306B\u6F14\u7B97\u5B50\u300Enot\u300F\u3092\u9069\u7528\u3057\u305F\u5F0F${o}\u300F`}else return`${i("\u6F14\u7B97\u5B50")}\u300Enot\u300F`;case"op":{let u=e,c=u.operator||"",a={eq:"\uFF1D",not:"!",gt:">",lt:"<",and:"\u304B\u3064",or:"\u307E\u305F\u306F"};if(c in a&&(c=a[c]),s>=0){let f=this.nodeToStr(u.blocks[0],{depth:s},r),l=this.nodeToStr(u.blocks[1],{depth:s},r);return u.operator==="eq"?`${i("")}\u300E${f}\u3068${l}\u304C\u7B49\u3057\u3044\u304B\u3069\u3046\u304B\u306E\u6BD4\u8F03${o}\u300F`:`${i("")}\u300E${f}\u3068${l}\u306B\u6F14\u7B97\u5B50\u300E${c}\u300F\u3092\u9069\u7528\u3057\u305F\u5F0F${o}\u300F`}else return`${i("\u6F14\u7B97\u5B50")}\u300E${c}${o}\u300F`}case"number":return`${i("\u6570\u5024")}${e.value}`;case"bigint":return`${i("\u5DE8\u5927\u6574\u6570")}${e.value}`;case"string":return`${i("\u6587\u5B57\u5217")}\u300E${e.value}${o}\u300F`;case"word":return`${i("\u5358\u8A9E")}\u300E${e.value}${o}\u300F`;case"func":return`${i("\u95A2\u6570")}\u300E${e.name||e.value}${o}\u300F`;case"eol":return"\u884C\u306E\u672B\u5C3E";case"eof":return"\u30D5\u30A1\u30A4\u30EB\u306E\u672B\u5C3E";default:{let u=e.name;return u&&(u=e.value),typeof u!="string"&&(u=e.type),`${i("")}\u300E${u}${o}\u300F`}}}};var C=class extends Error{constructor(e,t,r=void 0,s=void 0){let i=`${r||""}${s===void 0?"":`(${s+1}\u884C\u76EE): `}`;t=t.replace(/『main__(.+?)』/g,"\u300E$1\u300F"),super(`[${e}]${i}${t}`),this.name="NakoError",this.type="NakoError",this.tag="["+e+"]",this.positionJa=i,this.msg=t}},te=class extends C{constructor(e,t,r){super("\u30A4\u30F3\u30C7\u30F3\u30C8\u30A8\u30E9\u30FC",e,r,t),this.type="NakoIndentError",this.line=t,this.file=r}},V=class extends C{constructor(e,t,r,s,i){super("\u5B57\u53E5\u89E3\u6790\u30A8\u30E9\u30FC\uFF08\u5185\u90E8\u30A8\u30E9\u30FC\uFF09",e,i,s),this.type="InternalLexerError",this.preprocessedCodeStartOffset=t,this.preprocessedCodeEndOffset=r,this.line=s,this.file=i}},D=class extends C{constructor(e,t,r,s,i){super("\u5B57\u53E5\u89E3\u6790\u30A8\u30E9\u30FC",e,i,s),this.type="NakoLexerError",this.startOffset=t,this.endOffset=r,this.line=s,this.file=i}},d=class n extends C{static fromNode(e,t,r=void 0){if(!t)return new n(e,void 0,void 0,void 0,void 0);let s=typeof t.startOffset=="number"?t.startOffset:void 0,i=r&&typeof r.endOffset=="number"?r.endOffset:typeof t.endOffset=="number"?t.endOffset:void 0;return new n(e,t.line,s,i,t.file)}constructor(e,t,r,s,i){super("\u6587\u6CD5\u30A8\u30E9\u30FC",e,i,t),this.type="NakoSyntaxError",this.file=i,this.line=t,this.startOffset=r,this.endOffset=s}},J=class n extends C{constructor(e,t){let r="unknown";typeof e=="string"?r=e:e instanceof n||e instanceof C?r=e.msg:e instanceof Error&&(e.name==="Error"?r=e.message:r=`${e.name}: ${e.message}`);let s,i,o;t===void 0?(s=void 0,i=void 0):(o=/^l(-?\d+):(.*)$/.exec(t))?(s=parseInt(o[1]),i=o[2]):(o=/^l(-?\d+)$/.exec(t))?(s=parseInt(o[1]),i="main.nako3"):(s=0,i=t),super("\u5B9F\u884C\u6642\u30A8\u30E9\u30FC",r,i,s),this.type="NakoRuntimeError",this.lineNo=t,this.line=s,this.file=i}},X=class extends C{constructor(e,t,r){super("\u53D6\u308A\u8FBC\u307F\u30A8\u30E9\u30FC",e,t,r),this.file=t,this.line=r}};var rt=new Map([["\u3082\u3057","\u3082\u3057"],["\u56DE","\u56DE"],["\u56DE\u7E70\u8FD4","\u56DE"],["\u9593","\u9593"],["\u9593\u7E70\u8FD4","\u9593"],["\u7E70\u8FD4","\u7E70\u8FD4"],["\u5897\u7E70\u8FD4","\u5897\u7E70\u8FD4"],["\u6E1B\u7E70\u8FD4","\u6E1B\u7E70\u8FD4"],["\u5F8C\u5224\u5B9A","\u5F8C\u5224\u5B9A"],["\u53CD\u5FA9","\u53CD\u5FA9"],["\u629C","\u629C\u3051\u308B"],["\u7D9A","\u7D9A\u3051\u308B"],["\u623B","\u623B\u308B"],["\u5148","\u5148\u306B"],["\u6B21","\u6B21\u306B"],["\u4EE3\u5165","\u4EE3\u5165"],["\u5B9F\u884C\u901F\u5EA6\u512A\u5148","\u5B9F\u884C\u901F\u5EA6\u512A\u5148"],["\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30E2\u30CB\u30BF\u9069\u7528","\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30E2\u30CB\u30BF\u9069\u7528"],["\u5B9A","\u5B9A\u3081\u308B"],["\u9010\u6B21\u5B9F\u884C","\u9010\u6B21\u5B9F\u884C"],["\u6761\u4EF6\u5206\u5C90","\u6761\u4EF6\u5206\u5C90"],["\u5897","\u5897"],["\u6E1B","\u6E1B"],["\u5909\u6570","\u5909\u6570"],["\u5B9A\u6570","\u5B9A\u6570"],["\u30A8\u30E9\u30FC\u76E3\u8996","\u30A8\u30E9\u30FC\u76E3\u8996"],["\u30A8\u30E9\u30FC","\u30A8\u30E9\u30FC"],["\u305D\u308C","word"],["\u305D\u3046","word"],["\u95A2\u6570","def_func"],["\u30A4\u30F3\u30C7\u30F3\u30C8\u69CB\u6587","\u30A4\u30F3\u30C7\u30F3\u30C8\u69CB\u6587"],["\u975E\u540C\u671F\u30E2\u30FC\u30C9","\u975E\u540C\u671F\u30E2\u30FC\u30C9"],["DNCL\u30E2\u30FC\u30C9","DNCL\u30E2\u30FC\u30C9"],["DNCL2\u30E2\u30FC\u30C9","DNCL2\u30E2\u30FC\u30C9"],["\u30E2\u30FC\u30C9\u8A2D\u5B9A","\u30E2\u30FC\u30C9\u8A2D\u5B9A"],["\u53D6\u8FBC","\u53D6\u8FBC"],["\u30E2\u30B8\u30E5\u30FC\u30EB\u516C\u958B\u65E2\u5B9A\u5024","\u30E2\u30B8\u30E5\u30FC\u30EB\u516C\u958B\u65E2\u5B9A\u5024"],["\u53B3\u30C1\u30A7\u30C3\u30AF","\u53B3\u30C1\u30A7\u30C3\u30AF"]]),pe=rt;function Ae(n){let e=n.charCodeAt(0);return n===" "?4:n===" "||n==="|"?1:n==="\u30FB"||n==="\u3000"||n==="\u23CB"||n==="\u23CC"||e>=9472&&e<=9599||e>=9120&&e<=9135||e>=9144&&e<=9151?2:0}var re=["\u306B\u3064\u3044\u3066","\u304F\u3089\u3044","\u306A\u306E\u304B","\u307E\u3067\u3092","\u307E\u3067\u306E","\u306B\u3088\u308B","\u3068\u306F","\u304B\u3089","\u307E\u3067","\u3060\u3051","\u3088\u308A","\u307B\u3069","\u306A\u3069","\u3044\u3066","\u3048\u3066","\u304D\u3066","\u3051\u3066","\u3057\u3066","\u3063\u3066","\u306B\u3066","\u307F\u3066","\u3081\u3066","\u306D\u3066","\u3067\u306F","\u306B\u306F","\u3093\u3067","\u305A\u3064","\u306F","\u3092","\u306B","\u3078","\u3067","\u3068","\u304C","\u306E"],st=["\u3067\u306A\u3051\u308C\u3070","\u306A\u3051\u308C\u3070","\u306A\u3089\u3070","\u306A\u3089","\u305F\u3089","\u308C\u3070"],it=["\u3053\u3068","\u3067\u3042\u308B","\u3067\u3059","\u3057\u307E\u3059","\u3067\u3057\u305F"],de={};st.forEach(n=>{re.push(n),de[n]=!0});var B={};it.forEach(n=>{re.push(n),B[n]=!0});var ne=[];for(let n of re)ne.push("\u3082\u306E"+n),ne.push(n);ne.sort((n,e)=>e.length-n.length);var ot="^[\\t ]*("+ne.join("|")+")",U=new RegExp(ot),Ne=re;var ut=/^[\u3005\u4E00-\u9FCF_a-zA-Z0-9ァ-ヶー\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]+/,Oe=/^[ぁ-ん]/,ct=/^[ぁ-ん]+$/,at=/^.+(以上|以下|超|未満)$/,ft=/^(かつ|または)/,Fe=n=>function(){throw new Error("\u7A81\u7136\u306E\u300E"+n+"\u300F\u304C\u3042\u308A\u307E\u3059\u3002")},Ee=/^(円|ドル|元|歩|㎡|坪|度|℃|°|個|つ|本|冊|才|歳|匹|枚|皿|セット|羽|人|件|行|列|機|品|m|mm|cm|km|g|kg|t|b|mb|kb|gb)/,Ce=/^(px|em|ex|rem|vw|vh|vmin|vmax)/,Me=[{name:"\u3053\u3053\u307E\u3067",pattern:/^;;;/},{name:"eol",pattern:/^\n/},{name:"eol",pattern:/^;/},{name:"space",pattern:/^(\x20|\x09|・|⎿ |└||)+/},{name:"comma",pattern:/^,/},{name:"line_comment",pattern:/^#[^\n]*/},{name:"line_comment",pattern:/^\/\/[^\n]*/},{name:"range_comment",pattern:/^\/\*/,cbParser:ht},{name:"def_test",pattern:/^●テスト:/},{name:"def_func",pattern:/^●/},{name:"\u2026",pattern:/^…/},{name:"\u2026",pattern:/^\.{2,3}/},{name:"bigint",pattern:/^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*n/,readJosi:!0},{name:"bigint",pattern:/^0[oO][0-7]+(_[0-7]+)*n/,readJosi:!0},{name:"bigint",pattern:/^0[bB][0-1]+(_[0-1]+)*n/,readJosi:!0},{name:"bigint",pattern:/^\d+(_\d+)*?n/,readJosi:!0},{name:"number",pattern:/^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*/,readJosi:!0,cb:W},{name:"number",pattern:/^0[oO][0-7]+(_[0-7]+)*/,readJosi:!0,cb:W},{name:"number",pattern:/^0[bB][0-1]+(_[0-1]+)*/,readJosi:!0,cb:W},{name:"number",pattern:/^\d+(_\d+)*\.(\d+(_\d+)*)?([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:W},{name:"number",pattern:/^\.\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:W},{name:"number",pattern:/^\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:W},{name:"\u3053\u3053\u304B\u3089",pattern:/^(ここから),?/},{name:"\u3053\u3053\u307E\u3067",pattern:/^(ここまで|💧)/},{name:"\u3082\u3057",pattern:/^もしも?/},{name:"\u9055\u3048\u3070",pattern:/^違(えば)?/},{name:"shift_r0",pattern:/^>>>/},{name:"shift_r",pattern:/^>>/},{name:"shift_l",pattern:/^<</},{name:"===",pattern:/^===/},{name:"!==",pattern:/^!==/},{name:"gteq",pattern:/^(≧|>=|=>)/},{name:"lteq",pattern:/^(≦|<=|=<)/},{name:"noteq",pattern:/^(≠|<>|!=)/},{name:"\u2190",pattern:/^(←|<--)/},{name:"eq",pattern:/^(==|🟰🟰)/},{name:"eq",pattern:/^(=|🟰)/},{name:"line_comment",pattern:/^(!|💡)(インデント構文|ここまでだるい|DNCLモード|DNCL2モード|DNCL2)[^\n]*/},{name:"not",pattern:/^(!|💡)/},{name:"gt",pattern:/^>/},{name:"lt",pattern:/^</},{name:"and",pattern:/^(かつ|&&|and\s)/},{name:"or",pattern:/^(または|或いは|あるいは|or\s|\|\|)/},{name:"@",pattern:/^@/},{name:"+",pattern:/^\+/},{name:"-",pattern:/^-/},{name:"**",pattern:/^(××|\*\*)/},{name:"*",pattern:/^(×|\*)/},{name:"\xF7\xF7",pattern:/^÷÷/},{name:"\xF7",pattern:/^(÷|\/)/},{name:"%",pattern:/^%/},{name:"^",pattern:/^\^/},{name:"&",pattern:/^&/},{name:"[",pattern:/^\[/},{name:"]",pattern:/^]/,readJosi:!0},{name:"(",pattern:/^\(/},{name:")",pattern:/^\)/,readJosi:!0},{name:"|",pattern:/^\|/},{name:"??",pattern:/^\?\?/},{name:"word",pattern:/^\$\{.+?\}/,cbParser:n=>dt(n)},{name:"$",pattern:/^(\$|\.)/},{name:"string",pattern:/^🌿/,cbParser:n=>R("\u{1F33F}","\u{1F33F}",n)},{name:"string_ex",pattern:/^🌴/,cbParser:n=>R("\u{1F334}","\u{1F334}",n)},{name:"string_ex",pattern:/^「/,cbParser:n=>R("\u300C","\u300D",n)},{name:"string",pattern:/^『/,cbParser:n=>R("\u300E","\u300F",n)},{name:"string_ex",pattern:/^“/,cbParser:n=>R("\u201C","\u201D",n)},{name:"string_ex",pattern:/^"/,cbParser:n=>R('"','"',n)},{name:"string",pattern:/^'/,cbParser:n=>R("'","'",n)},{name:"\u300D",pattern:/^」/,cbParser:Fe("\u300D")},{name:"\u300F",pattern:/^』/,cbParser:Fe("\u300F")},{name:"func",pattern:/^\{関数\},?/},{name:"{",pattern:/^\{/},{name:"}",pattern:/^\}/,readJosi:!0},{name:":",pattern:/^:/},{name:"_eol",pattern:/^_\s*\n/},{name:"dec_lineno",pattern:/^‰/},{name:"word",pattern:/^[\uD800-\uDBFF][\uDC00-\uDFFF][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^[\u1F60-\u1F6F][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^《.+?》/,readJosi:!0},{name:"word",pattern:/^[_a-zA-Z\u3005\u4E00-\u9FCFぁ-んァ-ヶ\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]/,cbParser:pt}];function lt(n){return Oe.test(n)?ct.test(n)?n:n.replace(/[ぁ-ん]+$/g,""):n.replace(/[ぁ-ん]+/g,"")}function ht(n){let e="",t="",r=0;n=n.substring(2);let s=n.indexOf("*/");s<0?(e=n,n=""):(e=n.substring(0,s),n=n.substring(s+2));for(let i=0;i<e.length;i++)e.charAt(i)===`
|
|
2
2
|
`&&r++;return e=e.replace(/(^\s+|\s+$)/,""),{src:n,res:e,josi:t,numEOL:r}}function pt(n,e=!0){let t="",r="";for(;n!=="";){if(t.length>0){if(ft.exec(n))break;let c=U.exec(n);if(c){r=c[0].replace(/^\s+/,""),n=n.substring(c[0].length),n.charAt(0)===","&&(n=n.substring(1));break}}let i=ut.exec(n);if(i){t+=i[0],n=n.substring(i[0].length);continue}if(Oe.test(n)){t+=n.charAt(0),n=n.substring(1);continue}break}/[ぁ-ん]間$/.test(t)&&(n=t.charAt(t.length-1)+n,t=t.slice(0,-1));let s=at.exec(t);return s&&(n=s[1]+r+n,r="",t=t.substring(0,t.length-s[1].length)),r.substring(0,2)==="\u3082\u306E"&&(r=r.substring(2)),B[r]&&(r=""),e&&(t=lt(t)),t===""&&r!==""&&(t=r,r=""),{src:n,res:t,josi:r,numEOL:0}}function R(n,e,t){let r="",s="",i=0;t=t.substring(n.length);let o=t.indexOf(e);if(o<0)throw r=t,t="",new Error(`\u300E${n}\u300F\u3067\u59CB\u3081\u305F\u6587\u5B57\u5217\u306E\u7D42\u7AEF\u8A18\u53F7\u300E${e}\u300F\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002`);if(r=t.substring(0,o),t=t.substring(o+e.length),r.indexOf(n)>=0)throw n==="\u300E"?new Error("\u300C\u300E\u300D\u3067\u59CB\u3081\u305F\u6587\u5B57\u5217\u306E\u4E2D\u306B\u300C\u300E\u300D\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002"):new Error(`\u300E${n}\u300F\u3067\u59CB\u3081\u305F\u6587\u5B57\u5217\u306E\u4E2D\u306B\u300E${n}\u300F\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002`);let u=U.exec(t);u&&(s=u[0].replace(/^\s+/,""),t=t.substring(u[0].length),t.charAt(0)===","&&(t=t.substring(1))),B[s]&&(s=""),s.substring(0,2)==="\u3082\u306E"&&(s=s.substring(2));for(let c=0;c<r.length;c++)r.charAt(c)===`
|
|
3
3
|
`&&i++;return{src:t,res:r,josi:s,numEOL:i}}function dt(n){let e="",t="",r=0;n=n.substring(2);let s=n.indexOf("}");if(s<0)throw new Error("\u5909\u6570\u540D\u306E\u7D42\u308F\u308A\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002");e=n.substring(0,s),n=n.substring(s+1);let i=U.exec(n);i&&(t=i[0].replace(/^\s+/,""),n=n.substring(i[0].length),n.charAt(0)===","&&(n=n.substring(1)));for(let o=0;o<e.length;o++)e.charAt(o)===`
|
|
4
|
-
`&&r++;if(r>0)throw new Error("\u5909\u6570\u540D\u306B\u6539\u884C\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002");return{src:n,res:e,josi:t,numEOL:r}}function W(n){return Number(n.replace(/_/g,""))}var O=class n{constructor(e){this.logger=e,this.funclist=new Map,this.modList=[],this.result=[],this.modName="main.nako3",this.moduleExport=new Map,this.reservedWords=Array.from(pe.keys()),this.josiList=Ne}setFuncList(e){this.funclist=e}setModuleExport(e){this.moduleExport=e}replaceTokens(e,t,r){if(this.result=e,this.modName=n.filenameToModName(r),n.preDefineFunc(e,this.logger,this.funclist,this.moduleExport),this._replaceWord(this.result),t)if(this.result.length>0){let s=this.result[this.result.length-1];this.result.push({type:"eol",line:s.line,column:0,indent:-1,file:s.file,josi:"",value:"---",startOffset:s.startOffset,endOffset:s.endOffset,rawJosi:""}),this.result.push({type:"eof",line:s.line,indent:-1,column:0,file:s.file,josi:"",value:"",startOffset:s.startOffset,endOffset:s.endOffset,rawJosi:""})}else this.result.push({type:"eol",line:0,column:0,indent:-1,file:"",josi:"",value:"---",startOffset:0,endOffset:0,rawJosi:""}),this.result.push({type:"eof",line:0,column:0,indent:-1,file:"",josi:"",value:"",startOffset:0,endOffset:0,rawJosi:""});return this.result}static preDefineFunc(e,t,r,s){let i=0,o=!1,u=()=>{let c=[],a={};if(e[i].type!=="(")return[];for(i++;e[i];){let _=e[i];if(i++,_.type===")")break;_.type==="func"?o=!0:_.type!=="|"&&_.type!=="comma"&&(o&&(_.funcPointer=!0,o=!1),c.push(_),a[_.value]||(a[_.value]=[]),a[_.value].push(_.josi))}let f=[],l=[],h=[],
|
|
5
|
-
`||
|
|
4
|
+
`&&r++;if(r>0)throw new Error("\u5909\u6570\u540D\u306B\u6539\u884C\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002");return{src:n,res:e,josi:t,numEOL:r}}function W(n){return Number(n.replace(/_/g,""))}var O=class n{constructor(e){this.logger=e,this.funclist=new Map,this.modList=[],this.result=[],this.modName="main.nako3",this.moduleExport=new Map,this.reservedWords=Array.from(pe.keys()),this.josiList=Ne}setFuncList(e){this.funclist=e}setModuleExport(e){this.moduleExport=e}replaceTokens(e,t,r){if(this.result=e,this.modName=n.filenameToModName(r),n.preDefineFunc(e,this.logger,this.funclist,this.moduleExport),this._replaceWord(this.result),t)if(this.result.length>0){let s=this.result[this.result.length-1];this.result.push({type:"eol",line:s.line,column:0,indent:-1,file:s.file,josi:"",value:"---",startOffset:s.startOffset,endOffset:s.endOffset,rawJosi:""}),this.result.push({type:"eof",line:s.line,indent:-1,column:0,file:s.file,josi:"",value:"",startOffset:s.startOffset,endOffset:s.endOffset,rawJosi:""})}else this.result.push({type:"eol",line:0,column:0,indent:-1,file:"",josi:"",value:"---",startOffset:0,endOffset:0,rawJosi:""}),this.result.push({type:"eof",line:0,column:0,indent:-1,file:"",josi:"",value:"",startOffset:0,endOffset:0,rawJosi:""});return this.result}static preDefineFunc(e,t,r,s){let i=0,o=!1,u=()=>{let c=[],a={};if(e[i].type!=="(")return[];for(i++;e[i];){let _=e[i];if(i++,_.type===")")break;_.type==="func"?o=!0:_.type!=="|"&&_.type!=="comma"&&(o&&(_.funcPointer=!0,o=!1),c.push(_),a[_.value]||(a[_.value]=[]),a[_.value].push(_.josi))}let f=[],l=[],h=[],p={};for(let _ of c)if(!p[_.value]){let y=a[_.value];h.push(y),f.push(_.value),_.funcPointer?l.push(_.value):l.push(null),p[_.value]=!0}return[h,f,l]};for(;i<e.length;){let c=e[i];if(c.type==="not"&&e.length-i>3){let m={type:"eol"};if(i>=1&&(m=e[i-1]),m.type==="eol"){let v=e[i+1];if(v.type==="word"&&v.value==="\u30E2\u30B8\u30E5\u30FC\u30EB\u516C\u958B\u65E2\u5B9A\u5024"){if(v.type="\u30E2\u30B8\u30E5\u30FC\u30EB\u516C\u958B\u65E2\u5B9A\u5024",v=e[i+2],v.type==="string"&&v.value==="\u975E\u516C\u958B"){let $=n.filenameToModName(c.file);s.set($,!1),i+=3;continue}else if(v.type==="string"&&v.value==="\u516C\u958B"){let $=n.filenameToModName(c.file);s.set($,!0),i+=3;continue}}}}if(c.type==="word"&&c.josi==="\u306B\u306F"){c.josi="\u306B\u306F",e.splice(i+1,0,{type:"def_func",value:"\u95A2\u6570",indent:c.indent,line:c.line,column:c.column,file:c.file,josi:"",startOffset:c.endOffset,endOffset:c.endOffset,rawJosi:"",tag:"\u7121\u540D\u95A2\u6570"}),i++;continue}if(c.type==="word"&&c.value==="\u6C38\u9060"&&c.josi==="\u306B"){let m=e[i+1];m.value==="\u7E70\u8FD4"&&(m.value="\u9593",m.josi="\u306E"),i++;continue}if(c.type==="word"&&c.josi===""&&c.value.length>=2&&c.value.match(/回$/)){c.value=c.value.substring(0,c.value.length-1),c.endOffset||(c.endOffset=1);let m={type:"\u56DE",value:"\u56DE",indent:c.indent,line:c.line,column:c.column,file:c.file,josi:"",startOffset:c.endOffset-1,endOffset:c.endOffset,rawJosi:""};e.splice(i+1,0,m),c.endOffset--,i++}if(c.type==="word"){let m=pe.get(c.value);m&&(c.type=m),c.value==="\u305D\u3046"&&(c.value="\u305D\u308C")}if(c.type!=="def_test"&&c.type!=="def_func"){i++;continue}let a=!0,f={type:"eol"};i>=1&&(f=e[i-1]),f.type==="eol"&&(a=!1);let l=c;i++;let h=[],p=[],_=[],y="",b=null,k=null;if(e[i]&&e[i].type==="{"){i++;let m=e[i]&&e[i].type==="word"?e[i].value:"";m==="\u516C\u958B"?k=!0:m==="\u975E\u516C\u958B"?k=!1:m==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"?k=!0:t.warn(`\u4E0D\u660E\u306A\u95A2\u6570\u5C5E\u6027\u300E${String(m)}\u300F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002`),i++,e[i]&&e[i].type==="}"&&i++}if(e[i]&&e[i].type==="("&&([h,p,_]=u()),!a&&e[i]&&e[i].type==="word"&&(b=e[i++],y=b.value),h.length===0&&e[i]&&e[i].type==="("&&([h,p,_]=u()),y!==""&&b){if(y=n.filenameToModName(c.file)+"__"+y,r.has(y)){let v=y.replace(/^main__/,"");t.warn(`\u95A2\u6570\u300E${v}\u300F\u306F\u65E2\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059\u3002`,l)}b.value=y,r.set(y,{type:"func",josi:h,fn:null,asyncFn:!1,isExport:k,varnames:p,funcPointers:_})}let g={type:"func",josi:h,varnames:p,funcPointers:_};l.meta=g}}splitStringEx(e){let t=[],r=e.split(/[{{]/);t.push(r[0]);for(let s of r.slice(1)){let i=s.replace("\uFF5D","}").indexOf("}");if(i===-1)return null;t.push(s.slice(0,i),s.slice(i+1))}return t}_replaceWord(e){let t=[],r=0,s=!1,i=[],o=()=>r<=0?"eol":e[r-1].type,u=e.length>0?n.filenameToModName(e[0].file):"main";for(;r<e.length;){let c=e[r];if((c.type==="word"||c.type==="func")&&c.value==="\u540D\u524D\u7A7A\u9593\u8A2D\u5B9A"){if(s)throw new V("\u540D\u524D\u7A7A\u9593\u8A2D\u5B9A\u306E\u95A2\u6570\u53C2\u7167\u3092\u53D6\u5F97\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002",c.startOffset===void 0?0:c.startOffset,c.endOffset===void 0?0:c.endOffset,c.line,c.file);i.push(u),u=e[r-1].value}if((c.type==="word"||c.type==="func")&&c.value==="\u540D\u524D\u7A7A\u9593\u30DD\u30C3\u30D7"){if(s)throw new V("\u540D\u524D\u7A7A\u9593\u30DD\u30C3\u30D7\u306E\u95A2\u6570\u53C2\u7167\u3092\u53D6\u5F97\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002",c.startOffset===void 0?0:c.startOffset,c.endOffset===void 0?0:c.endOffset,c.line,c.file);let a=i.pop();a&&(u=a)}if(c.type==="word"&&c.value!=="\u305D\u308C"){let a=String(c.value);if(a.indexOf("__")<0){let l=`${u}__${a}`,h=this.funclist.get(l);if(h&&h.type==="func"){let p=c;p.type=s?"func_pointer":"func",p.meta=h,p.value=l,s&&(s=!1,e.splice(r-1,1));continue}for(let p of this.modList){let _=`${p}__${a}`,y=this.funclist.get(_),b=this.moduleExport.get(p);if(y&&y.type==="func"&&(y.isExport===!0||y.isExport!==!1&&b!==!1)){let k=c;k.type=s?"func_pointer":"func",k.meta=y,k.value=_,s&&(s=!1,e.splice(r-1,1));break}}}let f=this.funclist.get(a);if(f&&f.type==="func"){let l=c;if(l.type=s?"func_pointer":"func",l.meta=f,s){s=!1,e.splice(r-1,1);continue}}}if(s=!1,c.type==="func"&&c.value==="{\u95A2\u6570}"){r++,s=!0;continue}if(c.type==="-"&&e[r+1]){let a=e[r+1].type;if(a==="number"||a==="bigint"){let f=o();(f==="eol"||T[f]||e[r-1].josi!=="")&&(e.splice(r,1),a==="number"?e[r].value*=-1:e[r].value="-"+String(e[r].value))}}if(c.josi===void 0&&(c.josi=""),c.josi==="\u306F"){c.rawJosi||(c.rawJosi=c.josi);let a=c.endOffset===void 0?void 0:c.endOffset-c.rawJosi.length;e.splice(r+1,0,{type:"eq",indent:c.indent,line:c.line,column:c.column,file:c.file,startOffset:a,endOffset:c.endOffset,josi:"",rawJosi:"",value:void 0}),r+=2,c.josi=c.rawJosi="",c.endOffset=a;continue}if(c.josi==="\u3068\u306F"){c.rawJosi||(c.rawJosi=c.josi);let a=c.endOffset===void 0?void 0:c.endOffset-c.rawJosi.length;e.splice(r+1,0,{type:"\u3068\u306F",indent:c.indent,line:c.line,column:c.column,file:c.file,startOffset:a,endOffset:c.endOffset,josi:"",rawJosi:"",value:void 0}),c.josi=c.rawJosi="",c.endOffset=a,r+=2;continue}if(de[c.josi]){let a=c.josi==="\u3067\u306A\u3051\u308C\u3070"||c.josi==="\u306A\u3051\u308C\u3070"?"\u3067\u306A\u3051\u308C\u3070":"\u306A\u3089\u3070";c.rawJosi||(c.rawJosi=a);let f=c.endOffset===void 0?void 0:c.endOffset-c.rawJosi.length;e.splice(r+1,0,{type:"\u306A\u3089\u3070",value:a,indent:c.indent,line:c.line,column:c.column,file:c.file,startOffset:f,endOffset:c.endOffset,josi:"",rawJosi:""}),c.josi=c.rawJosi="",c.endOffset=f,r+=2;continue}if(c.type==="_eol"){e.splice(r,1);continue}if(c.type==="line_comment"||c.type==="range_comment"){t.push(c.value),e.splice(r,1);continue}c.type==="eol"&&(c.value=t.join("/"),t=[]),r++}}countIndent(e){let t=0;for(let r=0;r<e.length;r++){let s=e.charAt(r),i=Ae(s);if(i===0)return[t,r];t+=i}return[t,e.length]}tokenize(e,t,r){let s=e.length,i=[],o,u,c=1,a=!1,f=0,l=this.countIndent(e);for(f=l[0],e=e.substring(l[1]),c+=l[1];e!=="";){let h=!1;for(let p of Me){let _=p.pattern.exec(e);if(!_)continue;let y=p.name;if(h=!0,p.name==="space"){c+=_[0].length,e=e.substring(_[0].length);continue}if(p.cbParser){let m;if(a&&p.name==="word")m=p.cbParser(e,!1);else try{m=p.cbParser(e)}catch(v){throw new D(v.message,s-e.length,s-e.length+1,t,r)}if(p.name==="string_ex"){let v=this.splitStringEx(m.res);if(v===null)throw new V("\u5C55\u958B\u3042\u308A\u6587\u5B57\u5217\u3067\u5024\u306E\u57CB\u3081\u8FBC\u307F{...}\u304C\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002",s-e.length,s-m.src.length,t,r);let $=0;for(let N=0;N<v.length;N++){let Z=N===v.length-1?m.josi:"";N%2===0?(i.push({type:"string",value:v[N],file:r,josi:Z,indent:f,line:t,column:c,preprocessedCodeOffset:s-e.length+$,preprocessedCodeLength:v[N].length+2+Z.length}),$+=v[N].length+2):(i.push({type:"&",value:"&",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+$,preprocessedCodeLength:0}),i.push({type:"(",value:"(",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+$,preprocessedCodeLength:0}),i.push({type:"code",value:v[N],josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+$,preprocessedCodeLength:v[N].length}),i.push({type:")",value:")",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+$+v[N].length,preprocessedCodeLength:0}),i.push({type:"&",value:"&",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+$+v[N].length,preprocessedCodeLength:0}),$+=v[N].length)}t+=m.numEOL,c+=e.length-m.src.length,e=m.src,m.numEOL>0&&(c=1);break}o=c,c+=e.length-m.src.length,i.push({type:p.name,value:m.res,josi:m.josi,indent:f,line:t,column:o,file:r,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:e.length-m.src.length}),e=m.src,t+=m.numEOL,m.numEOL>0&&(c=1);break}let b=s-e.length,k=_[0];if(p.cb&&(k=p.cb(k)),o=c,u=t,c+=_[0].length,e=e.substring(_[0].length),(p.name==="eol"&&k===`
|
|
5
|
+
`||p.name==="_eol")&&(k=t++,c=1),p.name==="number"){let m=Ee.exec(e);m&&(e=e.substring(m[0].length),c+=_[0].length);let v=Ce.exec(e);v&&(y="string",e=e.substring(v[0].length),c+=_[0].length,k+=v[0])}let g="";if(p.readJosi){let m=U.exec(e);m&&(c+=m[0].length,g=m[0].replace(/^\s+/,""),e=e.substring(m[0].length),e.charAt(0)===","&&(e=e.substring(1)),B[g]&&(g=""),g.substring(0,2)==="\u3082\u306E"&&(g=g.substring(2)))}switch(y){case"def_test":{a=!0;break}case"eol":{a=!1;break}default:break}if(y==="dec_lineno"){t--;continue}if(i.push({type:y,value:k,indent:f,line:u,column:o,file:r,josi:g,preprocessedCodeOffset:b,preprocessedCodeLength:s-e.length-b}),y==="eol"&&c===1){let m=this.countIndent(e);f=m[0],c+=m[1],e=e.substring(m[1])}break}if(!h)throw new V("\u672A\u77E5\u306E\u8A9E\u53E5: "+e.substring(0,3)+"...",s-e.length,s-s+3,t,r)}return i}static tokensToTypeStr(e,t){return e.map(s=>s.type).join(t)}static filenameToModName(e){if(!e)return"main";if(e=e.replace(/[\\:]/g,"/"),e.indexOf("/")>=0){let t=e.split("/");e=t[t.length-1]}return e=e.replace(/\.nako3?$/,""),e}};var se=class extends ee{parse(e,t){this.reset(),this.tokens=e,this.modName=O.filenameToModName(t),this.modList.push(this.modName);let r=this.startParser();for(this.isModifiedNodes=!1,this._checkAsyncFn(r);this.isModifiedNodes;)this.isModifiedNodes=!1,this._checkAsyncFn(r);return r}startParser(){let e=this.ySentenceList(),t=this.get();if(t&&t.type!=="eof")throw this.logger.debug(`\u69CB\u6587\u89E3\u6790\u3067\u30A8\u30E9\u30FC\u3002${this.nodeToStr(t,{depth:1},!0)}\u306E\u4F7F\u3044\u65B9\u304C\u9593\u9055\u3063\u3066\u3044\u307E\u3059\u3002`,t),d.fromNode(`\u69CB\u6587\u89E3\u6790\u3067\u30A8\u30E9\u30FC\u3002${this.nodeToStr(t,{depth:1},!1)}\u306E\u4F7F\u3044\u65B9\u304C\u9593\u9055\u3063\u3066\u3044\u307E\u3059\u3002`,t);return e}yNop(){return{type:"nop",josi:"",...this.peekSourceMap(),end:this.peekSourceMap()}}ySentenceList(){let e=[],t=-1,r=this.peekSourceMap();for(;!this.isEOF();){let s=this.ySentence();if(!s)break;e.push(s),t<0&&(t=s.line)}if(e.length===0){let s=this.peek()||this.tokens[0];throw this.logger.debug("\u69CB\u6587\u89E3\u6790\u306B\u5931\u6557:"+this.nodeToStr(this.peek(),{depth:1},!0),s),d.fromNode("\u69CB\u6587\u89E3\u6790\u306B\u5931\u6557:"+this.nodeToStr(this.peek(),{depth:1},!1),s)}return{type:"block",blocks:e,josi:"",...r,end:this.peekSourceMap()}}makeStackBalanceReport(){let e=[];this.stack.forEach(i=>{let o=this.nodeToStr(i,{depth:1},!1);i.josi&&(o+=i.josi),e.push(o)});let t=e.join(","),r="",s=65;for(let i of this.recentlyCalledFunc){r+=" - ";let o=0,u=i.josi;if(u)for(let c of u){let a=String.fromCharCode(s+o);r+=a,c.length===1?r+=c[0]:r+=`(${c.join("|")})`,o++}r+=String(i.name)+`
|
|
6
6
|
`}return this.recentlyCalledFunc=[],`\u672A\u89E3\u6C7A\u306E\u5358\u8A9E\u304C\u3042\u308A\u307E\u3059: [${t}]
|
|
7
7
|
\u6B21\u306E\u547D\u4EE4\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059:
|
|
8
|
-
${r}`}yEOL(){let e=this.get();if(!e)return null;if(this.stack.length>0){let t=this.makeStackBalanceReport();throw
|
|
9
|
-
`+h.message,s),
|
|
10
|
-
`+h.message,s)}let l=this.funclist.get(u.value);return l&&!l.asyncFn&&f&&(l.asyncFn=f),{type:e,name:u.value,args:o,blocks:[c],asyncFn:f,isExport:i,josi:"",meta:s.meta,...t,end:this.peekSourceMap()}}yIFCond(){let e=this.peekSourceMap(),t=this.yGetArg();if(!t)throw
|
|
11
|
-
`+s.message,t)}return this.yIfThen(r,e)}yIfThen(e,t){let r=this.yNop(),s=this.yNop(),i=!1;if(this.check("eol"))r=this.yBlock();else{let o=this.ySentence();o&&(r=o),i=!0}for(;this.check("eol");)this.get();if(this.check("\u9055\u3048\u3070")){for(this.get();this.check("comma");)this.get();if(this.check("eol"))s=this.yBlock();else{let o=this.ySentence();o&&(s=o),i=!0}}if(i===!1)if(this.check("\u3053\u3053\u307E\u3067"))this.get();else throw
|
|
12
|
-
`+JSON.stringify(s)),p.fromNode("\u8A08\u7B97\u5F0F\u3067\u30A8\u30E9\u30FC",r);let f={type:"op",operator:u.type,blocks:[a,c],josi:t,startOffset:a.startOffset,endOffset:a.endOffset,line:a.line,column:a.column,file:a.file};i.push(f)}let o=i.pop();return o||null}yGetArgParen(e){let t=!1,r=this.stack.length;for(;!this.isEOF();){if(this.check(")")){t=!0;break}let i=this.yGetArg();if(i){this.pushStack(i),this.check("comma")&&this.get();continue}break}if(!t)throw p.fromNode(`C\u98A8\u95A2\u6570\u300E${e[0].value}\u300F\u3067\u30AB\u30C3\u30B3\u304C\u9589\u3058\u3066\u3044\u307E\u305B\u3093`,e[0]);let s=[];for(;r<this.stack.length;){let i=this.popStack();i&&s.unshift(i)}return s}yRepeatTime(){let e=this.peekSourceMap();if(!this.check("\u56DE"))return null;this.get(),this.check("comma")&&this.get(),this.check("\u7E70\u8FD4")&&this.get();let t=this.popStack([])||{type:"word",value:"\u305D\u308C",josi:"",...e,end:this.peekSourceMap()},r=!1,s=this.yNop();if(this.check("comma")&&this.get(),this.check("\u3053\u3053\u304B\u3089")?(this.get(),r=!0):this.check("eol")&&(r=!0),r)if(s=this.yBlock(),this.check("\u3053\u3053\u307E\u3067"))this.get();else throw p.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u56DE\u300F...\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u5FDC\u3055\u305B\u3066\u304F\u3060\u3055\u3044\u3002",e);else{let i=this.ySentence();i&&(s=i)}return{type:"repeat_times",blocks:[t,s],josi:"",...e,end:this.peekSourceMap()}}yWhile(){let e=this.peekSourceMap();if(!this.check("\u9593"))return null;for(this.get();this.check("comma");)this.get();this.check("\u7E70\u8FD4")&&this.get();let t=this.popStack();if(t===null)throw p.fromNode("\u300E\u9593\u300F\u3067\u6761\u4EF6\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);if(this.check("comma")&&this.get(),!this.checkTypes(["\u3053\u3053\u304B\u3089","eol"]))throw p.fromNode("\u300E\u9593\u300F\u306E\u76F4\u5F8C\u306F\u6539\u884C\u304C\u5FC5\u8981\u3067\u3059",e);let r=this.yBlock();if(this.check("\u3053\u3053\u307E\u3067"))this.get();else throw p.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u9593\u300F...\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u5FDC\u3055\u305B\u3066\u304F\u3060\u3055\u3044\u3002",e);return{type:"while",blocks:[t,r],josi:"",...e,end:this.peekSourceMap()}}yAtohantei(){let e=this.peekSourceMap();this.check("\u5F8C\u5224\u5B9A")&&this.get(),this.check("\u7E70\u8FD4")&&this.get(),this.check("\u3053\u3053\u304B\u3089")&&this.get();let t=this.yBlock();this.check("\u3053\u3053\u307E\u3067")&&this.get(),this.check("comma")&&this.get();let r=this.yGetArg(),s=!1,i=this.peek();return i&&i.value==="\u306A\u308B"&&(i.josi==="\u307E\u3067"||i.josi==="\u307E\u3067\u306E")&&(this.get(),s=!0),this.check("\u9593")&&this.get(),s&&(r={type:"not",operator:"not",blocks:[r],josi:"",...e,end:this.peekSourceMap()}),r||(r={type:"number",value:1,josi:"",...e,end:this.peekSourceMap()}),{type:"atohantei",blocks:[r,t],josi:"",...e,end:this.peekSourceMap()}}yFor(){let e="\u300E\u7E70\u308A\u8FD4\u3059\u300F\u6587\u3067A\u304B\u3089B\u307E\u3067\u306E\u6307\u5B9A\u304C\u3042\u308A\u307E\u305B\u3093\u3002",t=!0,r=!0,s=null,i=this.peekSourceMap();if(!(this.check("\u7E70\u8FD4")||this.check("\u5897\u7E70\u8FD4")||this.check("\u6E1B\u7E70\u8FD4")))return null;let o=this.getCur(),u=this.stack.pop();if(u)if(u.type==="word"&&(u.value==="\u5897"||u.value==="\u6E1B")){u.value==="\u5897"?t=!1:r=!1;let y=u.value+o.type;if(y=="\u5897\u7E70\u8FD4")o.type="\u5897\u7E70\u8FD4";else if(y=="\u6E1B\u7E70\u8FD4")o.type="\u6E1B\u7E70\u8FD4";else throw Error("[System Error] \u5897\u7E70\u308A\u8FD4\u3057 | \u6E1B\u7E70\u308A\u8FD4\u3057\u306E\u30A8\u30E9\u30FC\u3002")}else this.stack.push(u);let c=this.yNop();(o.type==="\u5897\u7E70\u8FD4"||o.type==="\u6E1B\u7E70\u8FD4")&&(c=this.popStack(["\u305A\u3064"])||this.yNop(),o.type==="\u5897\u7E70\u8FD4"?t=!1:r=!1,s=o.type==="\u5897\u7E70\u8FD4"?"up":"down");let a=this.popStack(["\u307E\u3067","\u3092"]),f=this.popStack(["\u304B\u3089"])||this.yNop(),l=this.popStack(["\u3092","\u3067"]),h="";if(l!==null){if(l.type!=="word")throw p.fromNode("\u300E(\u5909\u6570\u540D)\u3092A\u304B\u3089B\u307E\u3067\u7E70\u308A\u8FD4\u3059\u300F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",l);h=l.value}if((f===null||a===null)&&!(f==null&&a&&a.type==="func"&&a.name==="\u7BC4\u56F2"))throw p.fromNode(e,o);this.check("comma")&&this.get();let d=!1;this.check("\u3053\u3053\u304B\u3089")?(d=!0,this.get()):this.check("eol")&&(d=!0,this.get());let _=this.yNop();if(d)if(_=this.yBlock(),this.check("\u3053\u3053\u307E\u3067"))this.get();else throw p.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u7E70\u308A\u8FD4\u3059\u300F...\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u5FDC\u3055\u305B\u3066\u304F\u3060\u3055\u3044\u3002",i);else{let y=this.ySentence();y&&(_=y)}return _||(_=this.yNop()),{type:"for",blocks:[f,a,c,_],flagDown:t,flagUp:r,loopDirection:s,word:h,josi:"",...i,end:this.peekSourceMap()}}yReturn(){let e=this.peekSourceMap();if(!this.check("\u623B\u308B"))return null;this.get();let t=this.popStack(["\u3067","\u3092"])||this.yNop();if(this.stack.length>0)throw p.fromNode("\u300E\u623B\u300F\u6587\u306E\u76F4\u524D\u306B\u672A\u89E3\u6C7A\u306E\u5F15\u6570\u304C\u3042\u308A\u307E\u3059\u3002\u300E(\u5F0F)\u3092\u623B\u3059\u300F\u306E\u3088\u3046\u306B\u5F0F\u3092\u30AB\u30C3\u30B3\u3067\u62EC\u3063\u3066\u304F\u3060\u3055\u3044\u3002",e);return{type:"return",blocks:[t],josi:"",...e,end:this.peekSourceMap()}}yForEach(){let e=this.peekSourceMap();if(!this.check("\u53CD\u5FA9"))return null;for(this.get();this.check("comma");)this.get();let t=this.popStack(["\u3092"])||this.yNop(),r=this.popStack(["\u3067"]),s="";if(r!==null){if(r.type!=="word")throw p.fromNode("\u300E(\u5909\u6570\u540D)\u3067(\u914D\u5217)\u3092\u53CD\u5FA9\u300F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e);s=r.value}let i=this.yNop(),o=!1;if(this.check("\u3053\u3053\u304B\u3089")?(o=!0,this.get()):this.check("eol")&&(o=!0),o)if(i=this.yBlock(),this.check("\u3053\u3053\u307E\u3067"))this.get();else throw p.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u53CD\u5FA9\u300F...\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u5FDC\u3055\u305B\u3066\u304F\u3060\u3055\u3044\u3002",e);else{let u=this.ySentence();u&&(i=u)}return{type:"foreach",word:s,blocks:[t,i],josi:"",...e,end:this.peekSourceMap()}}ySwitch(){let e=this.peekSourceMap();if(!this.check("\u6761\u4EF6\u5206\u5C90"))return null;let t=this.get();if(!t)return null;let r=this.get();if(!r)return null;let s=this.popStack(["\u3067"]);if(!s)throw p.fromNode("\u300E(\u5024)\u3067\u6761\u4EF6\u5206\u5C90\u300F\u306E\u3088\u3046\u306B\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",t);if(r.type!=="eol")throw p.fromNode("\u300E\u6761\u4EF6\u5206\u5C90\u300F\u306E\u76F4\u5F8C\u306F\u6539\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",t);let i=[];for(i[0]=s,i[1]=this.yNop();!this.isEOF();){if(this.check("eol")){this.get();continue}if(this.check("\u3053\u3053\u307E\u3067")){this.get();break}let u=this.peek();if(u&&u.type==="\u9055\u3048\u3070"){this.get(),this.check("comma")&&this.get();let h=this.yBlock();for(this.check("\u3053\u3053\u307E\u3067")&&this.get();this.check("eol");)this.get();this.check("\u3053\u3053\u307E\u3067")&&this.get(),i[1]=h;break}let c=this.yValue();if(!c)throw p.fromNode("\u300E\u6761\u4EF6\u5206\u5C90\u300F\u306F\u300E(\u6761\u4EF6)\u306A\u3089\u3070\u301C\u3053\u3053\u307E\u3067\u300F\u3068\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",t);let a=this.get();if(!a||a.type!=="\u306A\u3089\u3070")throw p.fromNode("\u300E\u6761\u4EF6\u5206\u5C90\u300F\u3067\u6761\u4EF6\u306F\uFF0A\uFF0A\u306A\u3089\u3070\u3068\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",t);this.check("comma")&&this.get();let f=this.yBlock(),l=this.peek();l&&l.type==="\u3053\u3053\u307E\u3067"&&this.get(),i.push(c),i.push(f)}return{type:"switch",blocks:i,case_count:i.length/2-1,josi:"",...e,end:this.peekSourceMap()}}yMumeiFunc(){let e=this.peekSourceMap();if(!this.check("def_func"))return null;let t=this.get();if(!t)return null;let r=t,s=[];this.check("comma")&&this.get(),this.check("(")&&(s=this.yDefFuncReadArgs()||[]),this.check("comma")&&this.get(),this.funcLevel++,this.saveStack();let i=this.usedAsyncFn;this.usedAsyncFn=!1;let o=this.yBlock(),u=this.usedAsyncFn;if(!this.check("\u3053\u3053\u307E\u3067"))throw p.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u306B\u306F\u300F\u69CB\u6587\u304B\u7121\u540D\u95A2\u6570\u306E\u672B\u5C3E\u306B\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u5FC5\u8981\u3067\u3059\u3002",e);return this.get(),this.loadStack(),this.usedAsyncFn=i,this.funcLevel--,{type:"func_obj",name:"",args:s,blocks:[o],meta:r.meta,josi:"",isExport:!1,asyncFn:u,...e,end:this.peekSourceMap()}}yDainyu(){let e=this.peekSourceMap(),t=this.get();if(t===null)return null;let r=this.popStack(["\u3092"])||{type:"word",value:"\u305D\u308C",josi:"\u3092",...e},s=this.popStack(["\u3078","\u306B"]);if(!s||s.type!=="word"&&s.type!=="func"&&s.type!=="ref_array")throw p.fromNode("\u4EE3\u5165\u6587\u3067\u4EE3\u5165\u5148\u306E\u5909\u6570\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002\u300E(\u5909\u6570\u540D)\u306B(\u5024)\u3092\u4EE3\u5165\u300F\u306E\u3088\u3046\u306B\u4F7F\u3044\u307E\u3059\u3002",t);if(s.type==="ref_array"){let o=s.index||[],u=[r,...o];return{type:"let_array",name:s.name.value,indexes:s.index,blocks:u,josi:"",checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}return{type:"let",name:this.getVarName(s).value,blocks:[r],josi:"",...e,end:this.peekSourceMap()}}ySadameru(){let e=this.peekSourceMap(),t=this.get();if(t===null)return null;let r=this.popStack(["\u3092"])||{type:"word",value:"\u305D\u308C",josi:"\u3092",...e,end:this.peekSourceMap()};if(!r||r.type!=="word"&&r.type!=="func"&&r.type!=="ref_array")throw p.fromNode("\u300E\u5B9A\u3081\u308B\u300F\u6587\u3067\u5B9A\u6570\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002\u300E(\u5B9A\u6570\u540D)\u3092(\u5024)\u306B\u5B9A\u3081\u308B\u300F\u306E\u3088\u3046\u306B\u4F7F\u3044\u307E\u3059\u3002",t);let s=this.popStack(["\u3078","\u306B","\u3068"])||this.yNop(),i=this.isExportDefault;if(this.check2(["{","word","}"])){this.get();let u=this.get();if(u===null)throw p.fromNode("\u5B9A\u3081\u308B\u300E"+r.value+"\u300F\u306E\u5B9A\u7FA9\u30A8\u30E9\u30FC",r);let c=u.value;c==="\u516C\u958B"?i=!0:c==="\u975E\u516C\u958B"?i=!1:c==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"?i=!0:this.logger.warn(`\u4E0D\u660E\u306A\u5909\u6570\u5C5E\u6027\u300E${c}\u300F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002`),this.get()}return{type:"def_local_var",name:this.createVar(r,!0,i).value,vartype:"\u5B9A\u6570",isExport:i,blocks:[s],josi:"",...e,end:this.peekSourceMap()}}yIncDec(){let e=this.peekSourceMap(),t=this.get();if(t===null)return null;if(this.check("\u7E70\u8FD4"))return this.pushStack({type:"word",value:t.value,josi:t.josi,...e,end:this.peekSourceMap()}),this.yFor();let r=this.popStack(["\u3060\u3051",""]);r||(r={type:"number",value:1,josi:"\u3060\u3051",...e,end:this.peekSourceMap()});let s=this.popStack(["\u3092"]);if(!s||s.type!=="word"&&s.type!=="ref_array")throw p.fromNode(`\u300E${t.type}\u300F\u6587\u3067\u5B9A\u6570\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002\u300E(\u5909\u6570\u540D)\u3092(\u5024)\u3060\u3051${t.type}\u300F\u306E\u3088\u3046\u306B\u4F7F\u3044\u307E\u3059\u3002`,t);if(t.value==="\u6E1B"){let i={type:"number",value:-1,line:t.line};r={type:"op",operator:"*",blocks:[r,i],josi:"",...e}}return{type:"inc",name:s,blocks:[r],josi:t.josi,...e,end:this.peekSourceMap()}}yCall(){if(this.isEOF())return null;for(;!this.isEOF();){if(this.check("\u3053\u3053\u304B\u3089")&&this.get(),this.check("\u4EE3\u5165"))return this.yDainyu();if(this.check("\u5B9A\u3081\u308B"))return this.ySadameru();if(this.check("\u56DE"))return this.yRepeatTime();if(this.check("\u9593"))return this.yWhile();if(this.check("\u7E70\u8FD4")||this.check("\u5897\u7E70\u8FD4")||this.check("\u6E1B\u7E70\u8FD4"))return this.yFor();if(this.check("\u53CD\u5FA9"))return this.yForEach();if(this.check("\u6761\u4EF6\u5206\u5C90"))return this.ySwitch();if(this.check("\u623B\u308B"))return this.yReturn();if(this.check("\u5897")||this.check("\u6E1B"))return this.yIncDec();if(this.check2([["func","word"],"("])){let t=this.peek();if(t&&t.josi===""){let r=this.yValue();if(r){let s=r.josi||"";if(r.type==="func"&&(r.josi===""||G.indexOf(s)>=0))return r.josi="",r;this.pushStack(r)}this.check("comma")&&this.get();continue}}if(this.check("func")){let t=this.yCallFunc();if(t===null)continue;if(this.check("\u9593")){this.pushStack(t);continue}if(!this.checkTypes(Q))return t;let r=this.yGetArgOperator(t);this.pushStack(r);continue}let e=this.yGetArg();if(e){this.pushStack(e);continue}break}if(this.stack.length>0){if(this.isReadingCalc)return this.popStack();this.logger.debug(`--- stack dump ---
|
|
8
|
+
${r}`}yEOL(){let e=this.get();if(!e)return null;if(this.stack.length>0){let t=this.makeStackBalanceReport();throw d.fromNode(t,e)}return this.recentlyCalledFunc=[],{type:"eol",comment:e.value,line:e.line,column:e.column,file:e.file}}ySentence(){let e=this.peekSourceMap();if(this.check("eol"))return this.yEOL();if(this.check("\u3082\u3057"))return this.yIF();if(this.check("\u5F8C\u5224\u5B9A"))return this.yAtohantei();if(this.check("\u30A8\u30E9\u30FC\u76E3\u8996"))return this.yTryExcept();if(this.accept(["\u629C\u3051\u308B"]))return{type:"break",josi:"",...e,end:this.peekSourceMap()};if(this.accept(["\u7D9A\u3051\u308B"]))return{type:"continue",josi:"",...e,end:this.peekSourceMap()};if(this.check("??"))return this.yDebugPrint();if(this.accept(["DNCL\u30E2\u30FC\u30C9"]))return this.yDNCLMode(1);if(this.accept(["DNCL2\u30E2\u30FC\u30C9"]))return this.yDNCLMode(2);if(this.accept(["not","string","\u30E2\u30FC\u30C9\u8A2D\u5B9A"]))return this.ySetGenMode(this.y[1].value);if(this.accept(["not","\u30E2\u30B8\u30E5\u30FC\u30EB\u516C\u958B\u65E2\u5B9A\u5024","eq","string"]))return this.yExportDefault(this.y[3].value);if(this.accept(["not","\u53B3\u30C1\u30A7\u30C3\u30AF"]))return this.ySetMode("\u53B3\u3057\u304F\u30C1\u30A7\u30C3\u30AF");if(this.check("\u9010\u6B21\u5B9F\u884C"))return this.yTikuji();if(this.accept(["not","\u975E\u540C\u671F\u30E2\u30FC\u30C9"]))return this.yASyncMode();if(this.check2(["func","eq"])){let t=this.get()||j();throw d.fromNode(`\u95A2\u6570\u300E${t.value}\u300F\u306B\u4EE3\u5165\u3067\u304D\u307E\u305B\u3093\u3002`,t)}if(this.accept([this.ySpeedMode]))return this.y[0];if(this.accept([this.yPerformanceMonitor]))return this.y[0];if(this.accept([this.yLet]))return this.y[0];if(this.accept([this.yDefTest]))return this.y[0];if(this.accept([this.yDefFunc]))return this.y[0];if(this.accept([this.yCall])){let t=this.y[0],r=this.peek();if(r&&r.type==="\u306A\u3089\u3070"){let s=this.peekSourceMap(),i=t;return this.get(),this.yIfThen(i,s)}else if(G.indexOf(t.josi||"")>=0){if(this.stack.length>=1){let i=this.makeStackBalanceReport();throw d.fromNode(i,t)}let s=this.ySentence();if(s!==null)return{type:"block",blocks:[t,s],josi:s.josi,...e,end:this.peekSourceMap()}}return t}return null}yASyncMode(){return this.logger.error("\u300E\u975E\u540C\u671F\u30E2\u30FC\u30C9\u300F\u69CB\u6587\u306F\u5EC3\u6B62\u3055\u308C\u307E\u3057\u305F(https://nadesi.com/v3/doc/go.php?1028)\u3002",this.peek()),{type:"eol",...this.peekSourceMap(),end:this.peekSourceMap()}}yDNCLMode(e){let t=this.peekSourceMap();return e===1&&(this.arrayIndexFrom=1,this.flagReverseArrayIndex=!0),this.flagCheckArrayInit=!0,{type:"eol",...t,end:this.peekSourceMap()}}ySetGenMode(e){let t=this.peekSourceMap();return this.genMode=e,{type:"eol",...t,end:this.peekSourceMap()}}yExportDefault(e){let t=this.peekSourceMap();return this.isExportDefault=e==="\u516C\u958B",this.moduleExport.set(this.modName,this.isExportDefault),{type:"eol",...t,end:this.peekSourceMap()}}ySetMode(e){let t=this.peekSourceMap();return{type:"run_mode",value:e,...t,end:this.peekSourceMap()}}yBlock(){let e=this.peekSourceMap(),t=[];for(this.check("\u3053\u3053\u304B\u3089")&&this.get();!this.isEOF()&&!(this.checkTypes(["\u9055\u3048\u3070","\u3053\u3053\u307E\u3067","\u30A8\u30E9\u30FC"])||!this.accept([this.ySentence]));)t.push(this.y[0]);return{type:"block",blocks:t,josi:"",...e,end:this.peekSourceMap()}}yDefFuncReadArgs(){if(!this.check("("))return null;let e=[];for(this.get();!this.isEOF();){if(this.check(")")){this.get();break}let t=this.get();t&&e.push(t),this.check("comma")&&this.get()}return e}yDefTest(){return this.yDefFuncCommon("def_test")}yDefFunc(){return this.yDefFuncCommon("def_func")}yDefFuncCommon(e){if(!this.check(e))return null;let t=this.peekSourceMap(),r=this.get();if(!r)return null;let s=r,i=this.isExportDefault;if(this.check("{")){this.get();let h=this.get();if(this.check("}"))this.get();else throw d.fromNode("\u95A2\u6570\u306E\u5C5E\u6027\u306E\u6307\u5B9A\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002\u300E{\u300F\u3068\u300E}\u300F\u3067\u56F2\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002",s);h!=null&&(h.value==="\u516C\u958B"&&(i=!0),h.value==="\u975E\u516C\u958B"&&(i=!1),h.value==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"&&(i=!0))}let o=[];this.check("(")&&(o=this.yDefFuncReadArgs()||[]);let u=this.get();if(!u||u.type!=="func")throw this.logger.debug(this.nodeToStr(u,{depth:0,typeName:"\u95A2\u6570"},!0)+"\u306E\u5BA3\u8A00\u3067\u30A8\u30E9\u30FC\u3002",u),d.fromNode(this.nodeToStr(u,{depth:0,typeName:"\u95A2\u6570"},!1)+"\u306E\u5BA3\u8A00\u3067\u30A8\u30E9\u30FC\u3002",s);if(this.check("(")){if(o.length>0)throw this.logger.debug(this.nodeToStr(u,{depth:0,typeName:"\u95A2\u6570"},!0)+"\u306E\u5BA3\u8A00\u3067\u3001\u5F15\u6570\u5B9A\u7FA9\u306F\u540D\u524D\u306E\u524D\u304B\u5F8C\u306B\u4E00\u5EA6\u3060\u3051\u53EF\u80FD\u3067\u3059\u3002",u),d.fromNode(this.nodeToStr(u,{depth:0,typeName:"\u95A2\u6570"},!1)+"\u306E\u5BA3\u8A00\u3067\u3001\u5F15\u6570\u5B9A\u7FA9\u306F\u540D\u524D\u306E\u524D\u304B\u5F8C\u306B\u4E00\u5EA6\u3060\u3051\u53EF\u80FD\u3067\u3059\u3002",u);o=this.yDefFuncReadArgs()||[]}this.check("\u3068\u306F")&&this.get();let c=this.yNop(),a=!1,f=!1;this.check("\u3053\u3053\u304B\u3089")&&(a=!0),this.check("eol")&&(a=!0);try{this.funcLevel++,this.usedAsyncFn=!1;let h=this.localvars;if(this.localvars=new Map([["\u305D\u308C",{type:"var",value:""}]]),a){this.saveStack();for(let p of o){if(!p||!p.value)continue;let _=p.value;this.localvars.set(_,{type:"var",value:""})}if(c=this.yBlock(),this.check("\u3053\u3053\u307E\u3067"))this.get();else{let p=this.peek(),_=JSON.stringify(p);throw p&&p.type&&p.value&&(_=p.value),d.fromNode(`\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u95A2\u6570\u5B9A\u7FA9\u306E\u672B\u5C3E\u306B\u5FC5\u8981\u3067\u3059\u3002\u300E${_}\u300F\u306E\u524D\u306B\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,s)}this.loadStack()}else this.saveStack(),c=this.ySentence()||this.yNop(),this.loadStack();this.funcLevel--,f=this.usedAsyncFn,this.localvars=h}catch(h){throw this.logger.debug(this.nodeToStr(u,{depth:0,typeName:"\u95A2\u6570"},!0)+`\u306E\u5B9A\u7FA9\u3067\u4EE5\u4E0B\u306E\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3057\u305F\u3002
|
|
9
|
+
`+String(h.message),s),d.fromNode(this.nodeToStr(u,{depth:0,typeName:"\u95A2\u6570"},!1)+`\u306E\u5B9A\u7FA9\u3067\u4EE5\u4E0B\u306E\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3057\u305F\u3002
|
|
10
|
+
`+String(h.message),s)}let l=this.funclist.get(u.value);return l&&!l.asyncFn&&f&&(l.asyncFn=f),{type:e,name:u.value,args:o,blocks:[c],asyncFn:f,isExport:i,josi:"",meta:s.meta,...t,end:this.peekSourceMap()}}yIFCond(){let e=this.peekSourceMap(),t=this.yGetArg();if(!t)throw d.fromNode("\u300C\u3082\u3057\u300D\u6587\u306E\u6761\u4EF6\u5F0F\u306B\u9593\u9055\u3044\u304C\u3042\u308A\u307E\u3059\u3002"+this.nodeToStr(this.peek(),{depth:1},!1),e);if(t.josi==="\u306A\u3089\u3070")return t;if(t.josi==="\u3067\u306A\u3051\u308C\u3070")return t={type:"not",operator:"not",blocks:[t],josi:"",...e,end:this.peekSourceMap()},t;if(t.josi!==""&&this.check("func"))this.stack.push(t),t=this.yCall();else if(t.josi==="\u304C"){let s=this.index,i=this.yGetArg();if(!i)throw d.fromNode("\u3082\u3057\u6587\u306E\u6761\u4EF6\u300CA\u304CB\u306A\u3089\u3070\u300D\u3067B\u304C\u306A\u3044\u304B\u6761\u4EF6\u304C\u8907\u96D1\u904E\u304E\u307E\u3059\u3002"+this.nodeToStr(this.peek(),{depth:1},!1),e);if(this.check("\u306A\u3089\u3070")){let o=this.get()||{value:"\u306A\u3089\u3070"};i.josi=o.value}if(i&&(i.josi==="\u306A\u3089\u3070"||i.josi==="\u3067\u306A\u3051\u308C\u3070"))return{type:"op",operator:i.josi==="\u3067\u306A\u3051\u308C\u3070"?"noteq":"eq",blocks:[t,i],josi:"",...e,end:this.peekSourceMap()};this.index=s}if(this.check("\u306A\u3089\u3070")||(this.stack.push(t),t=this.yCall()),!this.check("\u306A\u3089\u3070")){let s=t||this.yNop();throw this.logger.debug("\u3082\u3057\u6587\u3067\u300E\u306A\u3089\u3070\u300F\u304C\u306A\u3044\u304B\u3001\u6761\u4EF6\u304C\u8907\u96D1\u904E\u304E\u307E\u3059\u3002"+this.nodeToStr(this.peek(),{depth:1},!1)+"\u306E\u76F4\u524D\u306B\u300E\u306A\u3089\u3070\u300F\u3092\u66F8\u3044\u3066\u304F\u3060\u3055\u3044\u3002",s),d.fromNode("\u3082\u3057\u6587\u3067\u300E\u306A\u3089\u3070\u300F\u304C\u306A\u3044\u304B\u3001\u6761\u4EF6\u304C\u8907\u96D1\u904E\u304E\u307E\u3059\u3002"+this.nodeToStr(this.peek(),{depth:1},!1)+"\u306E\u76F4\u524D\u306B\u300E\u306A\u3089\u3070\u300F\u3092\u66F8\u3044\u3066\u304F\u3060\u3055\u3044\u3002",s)}let r=this.get();if(r&&r.value==="\u3067\u306A\u3051\u308C\u3070"&&(t={type:"not",operator:"not",blocks:[t],josi:"",...e,end:this.peekSourceMap()}),!t)throw d.fromNode("\u300C\u3082\u3057\u300D\u6587\u306E\u6761\u4EF6\u5F0F\u306B\u9593\u9055\u3044\u304C\u3042\u308A\u307E\u3059\u3002"+this.nodeToStr(this.peek(),{depth:1},!1),e);return t}yIF(){let e=this.peekSourceMap();if(!this.check("\u3082\u3057"))return null;let t=this.get();if(t==null)return null;for(;this.check("comma");)this.get();let r=null;try{r=this.yIFCond()}catch(s){throw d.fromNode(`\u300E\u3082\u3057\u300F\u6587\u306E\u6761\u4EF6\u3067\u6B21\u306E\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3059\u3002
|
|
11
|
+
`+String(s.message),t)}return this.yIfThen(r,e)}yIfThen(e,t){let r=this.yNop(),s=this.yNop(),i=!1;if(this.check("eol"))r=this.yBlock();else{let o=this.ySentence();o&&(r=o),i=!0}for(;this.check("eol");)this.get();if(this.check("\u9055\u3048\u3070")){for(this.get();this.check("comma");)this.get();if(this.check("eol"))s=this.yBlock();else{let o=this.ySentence();o&&(s=o),i=!0}}if(i===!1)if(this.check("\u3053\u3053\u307E\u3067"))this.get();else throw d.fromNode("\u300E\u3082\u3057\u300F\u6587\u3067\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002",t);return{type:"if",blocks:[e,r,s],josi:"",...t,end:this.peekSourceMap()}}ySpeedMode(){let e=this.peekSourceMap();if(!this.check2(["string","\u5B9F\u884C\u901F\u5EA6\u512A\u5148"]))return null;let t=this.get();this.get();let r="";if(t&&t.value)r=t.value;else return null;let s={\u884C\u756A\u53F7\u7121\u3057:!1,\u6697\u9ED9\u306E\u578B\u5909\u63DB\u7121\u3057:!1,\u5F37\u5236\u30D4\u30E5\u30A2:!1,\u305D\u308C\u7121\u52B9:!1};for(let u of r.split("/")){if(u==="\u5168\u3066"){for(let c of Object.keys(s))s[c]=!0;break}Object.keys(s).includes(u)?s[u]=!0:this.logger.warn(`\u5B9F\u884C\u901F\u5EA6\u512A\u5148\u6587\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u300E${u}\u300F\u306F\u5B58\u5728\u3057\u307E\u305B\u3093\u3002`,t)}let i=!1;this.check("\u3053\u3053\u304B\u3089")?(this.get(),i=!0):this.check("eol")&&(i=!0);let o=this.yNop();return i?(o=this.yBlock(),this.check("\u3053\u3053\u307E\u3067")&&this.get()):o=this.ySentence()||o,{type:"speed_mode",options:s,blocks:[o],josi:"",...e}}yPerformanceMonitor(){let e=this.peekSourceMap();if(!this.check2(["string","\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30E2\u30CB\u30BF\u9069\u7528"]))return null;let t=this.get();if(!t)return null;this.get();let r={\u30E6\u30FC\u30B6\u95A2\u6570:!1,\u30B7\u30B9\u30C6\u30E0\u95A2\u6570\u672C\u4F53:!1,\u30B7\u30B9\u30C6\u30E0\u95A2\u6570:!1};for(let o of t.value.split("/")){if(o==="\u5168\u3066"){for(let u of Object.keys(r))r[u]=!0;break}Object.keys(r).includes(o)?r[o]=!0:this.logger.warn(`\u30D1\u30D5\u30A9\u30FC\u30DE\u30F3\u30B9\u30E2\u30CB\u30BF\u9069\u7528\u6587\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u300E${o}\u300F\u306F\u5B58\u5728\u3057\u307E\u305B\u3093\u3002`,t)}let s=!1;this.check("\u3053\u3053\u304B\u3089")?(this.get(),s=!0):this.check("eol")&&(s=!0);let i=this.yNop();return s?(i=this.yBlock(),this.check("\u3053\u3053\u307E\u3067")&&this.get()):i=this.ySentence()||i,{type:"performance_monitor",options:r,blocks:[i],josi:"",...e}}yTikuji(){if(!this.check("\u9010\u6B21\u5B9F\u884C"))return null;let e=this.getCur();return this.logger.error("\u300E\u9010\u6B21\u5B9F\u884C\u300F\u69CB\u6587\u306F\u5EC3\u6B62\u3055\u308C\u307E\u3057\u305F(https://nadesi.com/v3/doc/go.php?944)\u3002",e),{type:"eol",...this.peekSourceMap(),end:this.peekSourceMap()}}yGetArgOperator(e){let t=[e];for(;!this.isEOF();){let r=this.peek();if(r&&T[r.type]){r=this.getCur(),t.push(r);let s=this.yValue();if(s===null)throw d.fromNode(`\u8A08\u7B97\u5F0F\u3067\u6F14\u7B97\u5B50\u300E${r.value}\u300F\u5F8C\u306B\u5024\u304C\u3042\u308A\u307E\u305B\u3093`,e);t.push(s);continue}break}return t.length===0?null:t.length===1?t[0]:this.infixToAST(t)}yRange(e){if(!this.check("\u2026"))return null;let t=this.peekSourceMap();this.get();let r=this.yValue();if(!e||!r)throw d.fromNode("\u7BC4\u56F2\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u6307\u5B9A\u30A8\u30E9\u30FC\u3002\u300EA\u2026B\u300F\u306E\u66F8\u5F0F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",t);let s=this.funclist.get("\u7BC4\u56F2");if(!s)throw new Error("\u95A2\u6570\u300E\u7BC4\u56F2\u300F\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002plugin_system\u3092\u30B7\u30B9\u30C6\u30E0\u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002");return{type:"func",name:"\u7BC4\u56F2",blocks:[e,r],josi:r.josi,meta:s,asyncFn:!1,...t,end:this.peekSourceMap()}}yDebugPrint(){let e=this.peekSourceMap(),t=this.get();if(!t||t.value!=="??")throw d.fromNode("\u300E??\u300F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e);let r=this.yGetArg();if(!r)throw d.fromNode("\u300E??(\u8A08\u7B97\u5F0F)\u300F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e);let s=this.funclist.get("\u30CF\u30C6\u30CA\u95A2\u6570\u5B9F\u884C");if(!s)throw new Error("\u95A2\u6570\u300E\u30CF\u30C6\u30CA\u95A2\u6570\u5B9F\u884C\u300F\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002plugin_system\u3092\u30B7\u30B9\u30C6\u30E0\u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002");return{type:"func",name:"\u30CF\u30C6\u30CA\u95A2\u6570\u5B9F\u884C",blocks:[r],josi:"",meta:s,asyncFn:!1,...e,end:this.peekSourceMap()}}yGetArg(){let e=this.yValue();return e===null?null:this.check("\u2026")?this.yRange(e):this.yGetArgOperator(e)}infixToPolish(e){let t=i=>T[i.type]?T[i.type]:10,r=[],s=[];for(;e.length>0;){let i=e.shift();if(!i)break;for(;r.length>0;){let o=r[r.length-1];if(t(i)>t(o))break;let u=r.pop();if(!u){this.logger.error("\u8A08\u7B97\u5F0F\u306B\u9593\u9055\u3044\u304C\u3042\u308A\u307E\u3059\u3002",i);break}s.push(u)}r.push(i)}for(;r.length>0;){let i=r.pop();i&&s.push(i)}return s}infixToAST(e){if(e.length===0)return null;let t=e[e.length-1].josi,r=e[e.length-1],s=this.infixToPolish(e),i=[];for(let u of s){if(!T[u.type]){i.push(u);continue}let c=i.pop(),a=i.pop();if(a===void 0||c===void 0)throw this.logger.debug(`--- \u8A08\u7B97\u5F0F(\u9006\u30DD\u30FC\u30E9\u30F3\u30C9) ---
|
|
12
|
+
`+JSON.stringify(s)),d.fromNode("\u8A08\u7B97\u5F0F\u3067\u30A8\u30E9\u30FC",r);let f={type:"op",operator:u.type,blocks:[a,c],josi:t,startOffset:a.startOffset,endOffset:a.endOffset,line:a.line,column:a.column,file:a.file};i.push(f)}let o=i.pop();return o||null}yGetArgParen(e){let t=!1,r=this.stack.length;for(;!this.isEOF();){if(this.check(")")){t=!0;break}let i=this.yGetArg();if(i){this.pushStack(i),this.check("comma")&&this.get();continue}break}if(!t)throw d.fromNode(`C\u98A8\u95A2\u6570\u300E${e[0].value}\u300F\u3067\u30AB\u30C3\u30B3\u304C\u9589\u3058\u3066\u3044\u307E\u305B\u3093`,e[0]);let s=[];for(;r<this.stack.length;){let i=this.popStack();i&&s.unshift(i)}return s}yRepeatTime(){let e=this.peekSourceMap();if(!this.check("\u56DE"))return null;this.get(),this.check("comma")&&this.get(),this.check("\u7E70\u8FD4")&&this.get();let t=this.popStack([])||{type:"word",value:"\u305D\u308C",josi:"",...e,end:this.peekSourceMap()},r=!1,s=this.yNop();if(this.check("comma")&&this.get(),this.check("\u3053\u3053\u304B\u3089")?(this.get(),r=!0):this.check("eol")&&(r=!0),r)if(s=this.yBlock(),this.check("\u3053\u3053\u307E\u3067"))this.get();else throw d.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u56DE\u300F...\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u5FDC\u3055\u305B\u3066\u304F\u3060\u3055\u3044\u3002",e);else{let i=this.ySentence();i&&(s=i)}return{type:"repeat_times",blocks:[t,s],josi:"",...e,end:this.peekSourceMap()}}yWhile(){let e=this.peekSourceMap();if(!this.check("\u9593"))return null;for(this.get();this.check("comma");)this.get();this.check("\u7E70\u8FD4")&&this.get();let t=this.popStack();if(t===null)throw d.fromNode("\u300E\u9593\u300F\u3067\u6761\u4EF6\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);if(this.check("comma")&&this.get(),!this.checkTypes(["\u3053\u3053\u304B\u3089","eol"]))throw d.fromNode("\u300E\u9593\u300F\u306E\u76F4\u5F8C\u306F\u6539\u884C\u304C\u5FC5\u8981\u3067\u3059",e);let r=this.yBlock();if(this.check("\u3053\u3053\u307E\u3067"))this.get();else throw d.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u9593\u300F...\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u5FDC\u3055\u305B\u3066\u304F\u3060\u3055\u3044\u3002",e);return{type:"while",blocks:[t,r],josi:"",...e,end:this.peekSourceMap()}}yAtohantei(){let e=this.peekSourceMap();this.check("\u5F8C\u5224\u5B9A")&&this.get(),this.check("\u7E70\u8FD4")&&this.get(),this.check("\u3053\u3053\u304B\u3089")&&this.get();let t=this.yBlock();this.check("\u3053\u3053\u307E\u3067")&&this.get(),this.check("comma")&&this.get();let r=this.yGetArg(),s=!1,i=this.peek();return i&&i.value==="\u306A\u308B"&&(i.josi==="\u307E\u3067"||i.josi==="\u307E\u3067\u306E")&&(this.get(),s=!0),this.check("\u9593")&&this.get(),s&&(r={type:"not",operator:"not",blocks:[r],josi:"",...e,end:this.peekSourceMap()}),r||(r={type:"number",value:1,josi:"",...e,end:this.peekSourceMap()}),{type:"atohantei",blocks:[r,t],josi:"",...e,end:this.peekSourceMap()}}yFor(){let e="\u300E\u7E70\u308A\u8FD4\u3059\u300F\u6587\u3067A\u304B\u3089B\u307E\u3067\u306E\u6307\u5B9A\u304C\u3042\u308A\u307E\u305B\u3093\u3002",t=!0,r=!0,s=null,i=this.peekSourceMap();if(!(this.check("\u7E70\u8FD4")||this.check("\u5897\u7E70\u8FD4")||this.check("\u6E1B\u7E70\u8FD4")))return null;let o=this.getCur(),u=this.stack.pop();if(u)if(u.type==="word"&&(u.value==="\u5897"||u.value==="\u6E1B")){u.value==="\u5897"?t=!1:r=!1;let y=String(u.value)+o.type;if(y==="\u5897\u7E70\u8FD4")o.type="\u5897\u7E70\u8FD4";else if(y==="\u6E1B\u7E70\u8FD4")o.type="\u6E1B\u7E70\u8FD4";else throw Error("[System Error] \u5897\u7E70\u308A\u8FD4\u3057 | \u6E1B\u7E70\u308A\u8FD4\u3057\u306E\u30A8\u30E9\u30FC\u3002")}else this.stack.push(u);let c=this.yNop();(o.type==="\u5897\u7E70\u8FD4"||o.type==="\u6E1B\u7E70\u8FD4")&&(c=this.popStack(["\u305A\u3064"])||this.yNop(),o.type==="\u5897\u7E70\u8FD4"?t=!1:r=!1,s=o.type==="\u5897\u7E70\u8FD4"?"up":"down");let a=this.popStack(["\u307E\u3067","\u3092"]),f=this.popStack(["\u304B\u3089"])||this.yNop(),l=this.popStack(["\u3092","\u3067"]),h="";if(l!==null){if(l.type!=="word")throw d.fromNode("\u300E(\u5909\u6570\u540D)\u3092A\u304B\u3089B\u307E\u3067\u7E70\u308A\u8FD4\u3059\u300F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",l);h=l.value}if((f===null||a===null)&&!(f==null&&a&&a.type==="func"&&a.name==="\u7BC4\u56F2"))throw d.fromNode(e,o);this.check("comma")&&this.get();let p=!1;this.check("\u3053\u3053\u304B\u3089")?(p=!0,this.get()):this.check("eol")&&(p=!0,this.get());let _=this.yNop();if(p)if(_=this.yBlock(),this.check("\u3053\u3053\u307E\u3067"))this.get();else throw d.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u7E70\u308A\u8FD4\u3059\u300F...\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u5FDC\u3055\u305B\u3066\u304F\u3060\u3055\u3044\u3002",i);else{let y=this.ySentence();y&&(_=y)}return _||(_=this.yNop()),{type:"for",blocks:[f,a,c,_],flagDown:t,flagUp:r,loopDirection:s,word:h,josi:"",...i,end:this.peekSourceMap()}}yReturn(){let e=this.peekSourceMap();if(!this.check("\u623B\u308B"))return null;this.get();let t=this.popStack(["\u3067","\u3092"])||this.yNop();if(this.stack.length>0)throw d.fromNode("\u300E\u623B\u300F\u6587\u306E\u76F4\u524D\u306B\u672A\u89E3\u6C7A\u306E\u5F15\u6570\u304C\u3042\u308A\u307E\u3059\u3002\u300E(\u5F0F)\u3092\u623B\u3059\u300F\u306E\u3088\u3046\u306B\u5F0F\u3092\u30AB\u30C3\u30B3\u3067\u62EC\u3063\u3066\u304F\u3060\u3055\u3044\u3002",e);return{type:"return",blocks:[t],josi:"",...e,end:this.peekSourceMap()}}yForEach(){let e=this.peekSourceMap();if(!this.check("\u53CD\u5FA9"))return null;for(this.get();this.check("comma");)this.get();let t=this.popStack(["\u3092"])||this.yNop(),r=this.popStack(["\u3067"]),s="";if(r!==null){if(r.type!=="word")throw d.fromNode("\u300E(\u5909\u6570\u540D)\u3067(\u914D\u5217)\u3092\u53CD\u5FA9\u300F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e);s=r.value}let i=this.yNop(),o=!1;if(this.check("\u3053\u3053\u304B\u3089")?(o=!0,this.get()):this.check("eol")&&(o=!0),o)if(i=this.yBlock(),this.check("\u3053\u3053\u307E\u3067"))this.get();else throw d.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u53CD\u5FA9\u300F...\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u5FDC\u3055\u305B\u3066\u304F\u3060\u3055\u3044\u3002",e);else{let u=this.ySentence();u&&(i=u)}return{type:"foreach",word:s,blocks:[t,i],josi:"",...e,end:this.peekSourceMap()}}ySwitch(){let e=this.peekSourceMap();if(!this.check("\u6761\u4EF6\u5206\u5C90"))return null;let t=this.get();if(!t)return null;let r=this.get();if(!r)return null;let s=this.popStack(["\u3067"]);if(!s)throw d.fromNode("\u300E(\u5024)\u3067\u6761\u4EF6\u5206\u5C90\u300F\u306E\u3088\u3046\u306B\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",t);if(r.type!=="eol")throw d.fromNode("\u300E\u6761\u4EF6\u5206\u5C90\u300F\u306E\u76F4\u5F8C\u306F\u6539\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002",t);let i=[];for(i[0]=s,i[1]=this.yNop();!this.isEOF();){if(this.check("eol")){this.get();continue}if(this.check("\u3053\u3053\u307E\u3067")){this.get();break}let u=this.peek();if(u&&u.type==="\u9055\u3048\u3070"){this.get(),this.check("comma")&&this.get();let h=this.yBlock();for(this.check("\u3053\u3053\u307E\u3067")&&this.get();this.check("eol");)this.get();this.check("\u3053\u3053\u307E\u3067")&&this.get(),i[1]=h;break}let c=this.yValue();if(!c)throw d.fromNode("\u300E\u6761\u4EF6\u5206\u5C90\u300F\u306F\u300E(\u6761\u4EF6)\u306A\u3089\u3070\u301C\u3053\u3053\u307E\u3067\u300F\u3068\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",t);let a=this.get();if(!a||a.type!=="\u306A\u3089\u3070")throw d.fromNode("\u300E\u6761\u4EF6\u5206\u5C90\u300F\u3067\u6761\u4EF6\u306F\uFF0A\uFF0A\u306A\u3089\u3070\u3068\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",t);this.check("comma")&&this.get();let f=this.yBlock(),l=this.peek();l&&l.type==="\u3053\u3053\u307E\u3067"&&this.get(),i.push(c),i.push(f)}return{type:"switch",blocks:i,case_count:i.length/2-1,josi:"",...e,end:this.peekSourceMap()}}yMumeiFunc(){let e=this.peekSourceMap();if(!this.check("def_func"))return null;let t=this.get();if(!t)return null;let r=t,s=[];this.check("comma")&&this.get(),this.check("(")&&(s=this.yDefFuncReadArgs()||[]),this.check("comma")&&this.get(),this.funcLevel++,this.saveStack();let i=this.usedAsyncFn;this.usedAsyncFn=!1;let o=this.yBlock(),u=this.usedAsyncFn;if(!this.check("\u3053\u3053\u307E\u3067"))throw d.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u306B\u306F\u300F\u69CB\u6587\u304B\u7121\u540D\u95A2\u6570\u306E\u672B\u5C3E\u306B\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u5FC5\u8981\u3067\u3059\u3002",e);return this.get(),this.loadStack(),this.usedAsyncFn=i,this.funcLevel--,{type:"func_obj",name:"",args:s,blocks:[o],meta:r.meta,josi:"",isExport:!1,asyncFn:u,...e,end:this.peekSourceMap()}}yDainyu(){let e=this.peekSourceMap(),t=this.get();if(t===null)return null;let r=this.popStack(["\u3092"])||{type:"word",value:"\u305D\u308C",josi:"\u3092",...e},s=this.popStack(["\u3078","\u306B"]);if(!s||s.type!=="word"&&s.type!=="func"&&s.type!=="ref_array")throw d.fromNode("\u4EE3\u5165\u6587\u3067\u4EE3\u5165\u5148\u306E\u5909\u6570\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002\u300E(\u5909\u6570\u540D)\u306B(\u5024)\u3092\u4EE3\u5165\u300F\u306E\u3088\u3046\u306B\u4F7F\u3044\u307E\u3059\u3002",t);if(s.type==="func")throw d.fromNode("\u95A2\u6570\u300E"+String(s.name)+"\u300F\u306B\u4EE3\u5165\u3067\u304D\u307E\u305B\u3093\u3002\u300E(\u5909\u6570\u540D)\u306B(\u5024)\u3092\u4EE3\u5165\u300F\u306E\u3088\u3046\u306B\u4F7F\u3044\u307E\u3059\u3002",t);if(s.type==="ref_array"){let o=s.index||[],u=[r,...o];return{type:"let_array",name:s.name.value,indexes:s.index,blocks:u,josi:"",checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}return{type:"let",name:this.getVarName(s).value,blocks:[r],josi:"",...e,end:this.peekSourceMap()}}ySadameru(){let e=this.peekSourceMap(),t=this.get();if(t===null)return null;let r=this.popStack(["\u3092"])||{type:"word",value:"\u305D\u308C",josi:"\u3092",...e,end:this.peekSourceMap()};if(!r||r.type!=="word"&&r.type!=="func"&&r.type!=="ref_array")throw d.fromNode("\u300E\u5B9A\u3081\u308B\u300F\u6587\u3067\u5B9A\u6570\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002\u300E(\u5B9A\u6570\u540D)\u3092(\u5024)\u306B\u5B9A\u3081\u308B\u300F\u306E\u3088\u3046\u306B\u4F7F\u3044\u307E\u3059\u3002",t);let s=this.popStack(["\u3078","\u306B","\u3068"])||this.yNop(),i=this.isExportDefault;if(this.check2(["{","word","}"])){this.get();let u=this.get();if(u===null)throw d.fromNode("\u5B9A\u3081\u308B\u300E"+r.value+"\u300F\u306E\u5B9A\u7FA9\u30A8\u30E9\u30FC",r);let c=u.value;c==="\u516C\u958B"?i=!0:c==="\u975E\u516C\u958B"?i=!1:c==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"?i=!0:this.logger.warn(`\u4E0D\u660E\u306A\u5909\u6570\u5C5E\u6027\u300E${c}\u300F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002`),this.get()}return{type:"def_local_var",name:this.createVar(r,!0,i).value,vartype:"\u5B9A\u6570",isExport:i,blocks:[s],josi:"",...e,end:this.peekSourceMap()}}yIncDec(){let e=this.peekSourceMap(),t=this.get();if(t===null)return null;if(this.check("\u7E70\u8FD4"))return this.pushStack({type:"word",value:t.value,josi:t.josi,...e,end:this.peekSourceMap()}),this.yFor();let r=this.popStack(["\u3060\u3051",""]);r||(r={type:"number",value:1,josi:"\u3060\u3051",...e,end:this.peekSourceMap()});let s=this.popStack(["\u3092"]);if(!s||s.type!=="word"&&s.type!=="ref_array")throw d.fromNode(`\u300E${t.type}\u300F\u6587\u3067\u5B9A\u6570\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002\u300E(\u5909\u6570\u540D)\u3092(\u5024)\u3060\u3051${t.type}\u300F\u306E\u3088\u3046\u306B\u4F7F\u3044\u307E\u3059\u3002`,t);if(t.value==="\u6E1B"){let i={type:"number",value:-1,line:t.line};r={type:"op",operator:"*",blocks:[r,i],josi:"",...e}}return{type:"inc",name:s,blocks:[r],josi:t.josi,...e,end:this.peekSourceMap()}}yCall(){if(this.isEOF())return null;for(;!this.isEOF();){if(this.check("\u3053\u3053\u304B\u3089")&&this.get(),this.check("\u4EE3\u5165"))return this.yDainyu();if(this.check("\u5B9A\u3081\u308B"))return this.ySadameru();if(this.check("\u56DE"))return this.yRepeatTime();if(this.check("\u9593"))return this.yWhile();if(this.check("\u7E70\u8FD4")||this.check("\u5897\u7E70\u8FD4")||this.check("\u6E1B\u7E70\u8FD4"))return this.yFor();if(this.check("\u53CD\u5FA9"))return this.yForEach();if(this.check("\u6761\u4EF6\u5206\u5C90"))return this.ySwitch();if(this.check("\u623B\u308B"))return this.yReturn();if(this.check("\u5897")||this.check("\u6E1B"))return this.yIncDec();if(this.check2([["func","word"],"("])){let t=this.peek();if(t&&t.josi===""){let r=this.yValue();if(r){let s=r.josi||"";if(r.type==="func"&&(r.josi===""||G.indexOf(s)>=0))return r.josi="",r;this.pushStack(r)}this.check("comma")&&this.get();continue}}if(this.check("func")){let t=this.yCallFunc();if(t===null)continue;if(this.check("\u9593")){this.pushStack(t);continue}if(!this.checkTypes(Q))return t;let r=this.yGetArgOperator(t);this.pushStack(r);continue}let e=this.yGetArg();if(e){this.pushStack(e);continue}break}if(this.stack.length>0){if(this.isReadingCalc)return this.popStack();this.logger.debug(`--- stack dump ---
|
|
13
13
|
`+JSON.stringify(this.stack,null,2)+`
|
|
14
|
-
peek: `+JSON.stringify(this.peek(),null,2));let e=`\u4E0D\u5B8C\u5168\u306A\u6587\u3067\u3059\u3002${this.stack.map(i=>this.nodeToStr(i,{depth:0},!0)).join("\u3001")}\u304C\u89E3\u6C7A\u3057\u3066\u3044\u307E\u305B\u3093\u3002`,t=`\u4E0D\u5B8C\u5168\u306A\u6587\u3067\u3059\u3002${this.stack.map(i=>this.nodeToStr(i,{depth:0},!1)).join("\u3001")}\u304C\u89E3\u6C7A\u3057\u3066\u3044\u307E\u305B\u3093\u3002`;for(let i of this.stack){let o=this.nodeToStr(i,{depth:0},!1),u=this.nodeToStr(i,{depth:1},!1);o!==u&&(e+=`${this.nodeToStr(i,{depth:0},!0)}\u306F${this.nodeToStr(i,{depth:1},!0)}\u3068\u3057\u3066\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059\u3002`,t+=`${o}\u306F${u}\u3068\u3057\u3066\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059\u3002`)}let r=this.stack[0],s=this.stack[this.stack.length-1];throw this.logger.debug(e,r),
|
|
15
|
-
${l.message}`,r)}if(o===null)throw
|
|
16
|
-
${s.message}`,t),
|
|
17
|
-
${s.message}`,e))}}if(this.check2(["word","$","*","$","*","$","*","$","*","eq"])||this.check2(["word","$","*","$","*","$","*","eq"])||this.check2(["word","$","*","$","*","eq"])||this.check2(["word","$","*","eq"])){let t=[],r=this.getVarName(this.get());for(;;){let i=this.peek();if(i===null||i.type!=="$")break;this.get(),t.push(this.get())}this.get();let s=this.yCalc();if(s===null)throw p.fromNode(`${this.nodeToStr(r,{depth:1},!1)}\u3078\u306E\u4EE3\u5165\u6587\u306E\u8A08\u7B97\u5F0F\u306B\u66F8\u304D\u9593\u9055\u3044\u304C\u3042\u308A\u307E\u3059\u3002`,e);return{type:"let_prop",name:r.value,index:t,blocks:[s],josi:"",...e,end:this.peekSourceMap()}}if(this.check2(["word","@"])){let t=this.yLetArrayAt(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.check2(["word","["])){let t=this.yLetArrayBracket(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.accept(["word","\u3068\u306F"])){let t=this.y[0];if(!this.checkTypes(["\u5909\u6570","\u5B9A\u6570"]))throw p.fromNode("\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u300E"+t.value+"\u300F\u306E\u5B9A\u7FA9\u30A8\u30E9\u30FC",t);let r=this.getCur(),s=this.isExportDefault;if(this.check2(["{","word","}"])){this.get();let u=this.get();if(u===null)throw p.fromNode("\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u300E"+t.value+"\u300F\u306E\u5B9A\u7FA9\u30A8\u30E9\u30FC",t);let c=u.value;c==="\u516C\u958B"?s=!0:c==="\u975E\u516C\u958B"?s=!1:c==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"?s=!0:this.logger.warn(`\u4E0D\u660E\u306A\u5909\u6570\u5C5E\u6027\u300E${c}\u300F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002`),this.get()}let i=this.createVar(t,r.type==="\u5B9A\u6570",s),o=this.yNop();return this.check("eq")&&(this.get(),o=this.yCalc()||o),this.check("comma")&&this.get(),{type:"def_local_var",name:i.value,vartype:r.type,isExport:s,blocks:[o],...e,end:this.peekSourceMap()}}if(this.accept(["\u5909\u6570","word"])){let t=this.y[1];if(this.index-=2,this.accept(["\u5909\u6570","word","eq",this.yCalc])){let r=this.createVar(this.y[1],!1,this.isExportDefault),s=this.y[3]||this.yNop();return{type:"def_local_var",name:r.value,vartype:"\u5909\u6570",blocks:[s],...e,end:this.peekSourceMap()}}if(this.accept(["\u5909\u6570","word","{","word","}","eq",this.yCalc])){let r=this.isExportDefault,s=this.y[3].value;s==="\u516C\u958B"?r=!0:s==="\u975E\u516C\u958B"?r=!1:s==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"?r=!0:this.logger.warn(`\u4E0D\u660E\u306A\u5909\u6570\u5C5E\u6027\u300E${s}\u300F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002`);let i=this.createVar(this.y[1],!1,r),o=this.y[6]||this.yNop();return{type:"def_local_var",name:i.value,vartype:"\u5909\u6570",isExport:r,blocks:[o],...e,end:this.peekSourceMap()}}return this.index+=2,{type:"def_local_var",name:this.createVar(t,!1,this.isExportDefault).value,vartype:"\u5909\u6570",blocks:[this.yNop()],...e,end:this.peekSourceMap()}}if(this.accept(["\u5B9A\u6570","word","eq",this.yCalc])){let t=this.createVar(this.y[1],!0,this.isExportDefault),r=this.y[3]||this.yNop();return{type:"def_local_var",name:t.value,vartype:"\u5B9A\u6570",blocks:[r],...e,end:this.peekSourceMap()}}if(this.accept(["\u5B9A\u6570","word","{","word","}","eq",this.yCalc])){let t=this.isExportDefault,r=this.y[3].value;r==="\u516C\u958B"?t=!0:r==="\u975E\u516C\u958B"?t=!1:r==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"?t=!0:this.logger.warn(`\u4E0D\u660E\u306A\u5B9A\u6570\u5C5E\u6027\u300E${r}\u300F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002`);let s=this.createVar(this.y[1],!0,t),i=this.y[6]||this.yNop();return{type:"def_local_var",name:s.value,vartype:"\u5B9A\u6570",isExport:t,blocks:[i],...e,end:this.peekSourceMap()}}if(this.accept(["\u5B9A\u6570",this.yJSONArray,"eq",this.yCalc])){let t=this.y[1];if(t&&t.blocks instanceof Array){for(let i in t.blocks)if(t.blocks[i].type!=="word")throw p.fromNode(`\u8907\u6570\u5B9A\u6570\u306E\u4EE3\u5165\u6587${i+1}\u756A\u76EE\u3067\u30A8\u30E9\u30FC\u3002\u300E\u5B9A\u6570[A,B,C]=[1,2,3]\u300F\u306E\u66F8\u5F0F\u3067\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,this.y[0])}else throw p.fromNode("\u8907\u6570\u5B9A\u6570\u306E\u4EE3\u5165\u6587\u3067\u30A8\u30E9\u30FC\u3002\u300E\u5B9A\u6570[A,B,C]=[1,2,3]\u300F\u306E\u66F8\u5F0F\u3067\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",this.y[0]);let r=this._tokensToNodes(this.createVarList(t.blocks,!0,this.isExportDefault)),s=this.y[3]||this.yNop();return{type:"def_local_varlist",names:r,vartype:"\u5B9A\u6570",blocks:[s],...e,end:this.peekSourceMap()}}if(this.accept(["\u5909\u6570",this.yJSONArray,"eq",this.yCalc])){let t=this.y[1];if(t&&t.blocks instanceof Array){for(let i in t.blocks)if(t.blocks[i].type!=="word")throw p.fromNode(`\u8907\u6570\u5909\u6570\u306E\u4EE3\u5165\u6587${i+1}\u756A\u76EE\u3067\u30A8\u30E9\u30FC\u3002\u300E\u5909\u6570[A,B,C]=[1,2,3]\u300F\u306E\u66F8\u5F0F\u3067\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,this.y[0])}else throw p.fromNode("\u8907\u6570\u5909\u6570\u306E\u4EE3\u5165\u6587\u3067\u30A8\u30E9\u30FC\u3002\u300E\u5909\u6570[A,B,C]=[1,2,3]\u300F\u306E\u66F8\u5F0F\u3067\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",this.y[0]);let r=this._tokensToNodes(this.createVarList(t.blocks,!1,this.isExportDefault)),s=this.y[3]||this.yNop();return{type:"def_local_varlist",names:r,vartype:"\u5909\u6570",blocks:[s],...e,end:this.peekSourceMap()}}if(this.check2(["word","comma","word"])){if(this.accept(["word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2]];t=this.createVarList(t,!1,this.isExportDefault);let r=this.y[4]||this.yNop();return{type:"def_local_varlist",names:t,vartype:"\u5909\u6570",blocks:[r],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4]];t=this.createVarList(t,!1,this.isExportDefault);let r=this.y[6]||this.yNop();return{type:"def_local_varlist",names:t,vartype:"\u5909\u6570",blocks:[r],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4],this.y[6]];t=this.createVarList(t,!1,this.isExportDefault);let r=this.y[8]||this.yNop();return{type:"def_local_varlist",names:t,vartype:"\u5909\u6570",blocks:[r],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4],this.y[6],this.y[8]];t=this.createVarList(t,!1,this.isExportDefault);let r=this.y[10]||this.yNop();return{type:"def_local_varlist",names:t,vartype:"\u5909\u6570",blocks:[r],...e,end:this.peekSourceMap()}}}return null}checkArrayIndex(e){if(this.arrayIndexFrom===0)return e;let t={...e,type:"number",value:this.arrayIndexFrom};return{...e,type:"op",operator:"-",blocks:[e,t]}}checkArrayReverse(e){return e?!this.flagReverseArrayIndex||e.length<=1?e:e.reverse():[]}yLetArrayAt(e){if(this.accept(["word","@",this.yValue,"eq",this.yCalc])){let t=this.y[4];return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,this.checkArrayIndex(this.y[2])],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","@",this.yValue,"@",this.yValue,"eq",this.yCalc])){let t=this.y[6],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","@",this.yValue,"@",this.yValue,"@",this.yValue,"eq",this.yCalc])){let t=this.y[8],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","@",this.yValue,"comma",this.yValue,"eq",this.yCalc])){let t=this.y[6],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","@",this.yValue,"comma",this.yValue,"comma",this.yValue,"eq",this.yCalc])){let t=this.y[8],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}return null}yLetArrayBracket(e){if(this.accept(["word","[",this.yCalc,"]","eq",this.yCalc])){let t=this.y[5],r=[this.checkArrayIndex(this.y[2])];return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])){let t=this.y[8],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],tag:"2",checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])){let t=this.y[7],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,tag:"2",...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])){let t=this.y[11],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5]),this.checkArrayIndex(this.y[8])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])){let t=this.y[9],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}return null}yCalc(){let e=this.peekSourceMap();if(this.check("eol"))return null;let t=this.yGetArg();if(!t)return null;if(t.josi==="")return t;let r=this.isReadingCalc;this.isReadingCalc=!0,this.pushStack(t);let s=this.yCall();if(this.isReadingCalc=r,!s)return this.popStack();let i=s;if(G.indexOf(s.josi||"")>=0){let u=this.yCalc();u&&(i={type:"renbun",operator:"renbun",blocks:[s,u],josi:u.josi,...e,end:this.peekSourceMap()})}let o=this.peek();return o&&T[o.type]?this.yGetArgOperator(i):i}yValueKakko(){if(!this.check("("))return null;let e=this.get();if(!e)throw new Error("[System Error] check \u3057\u305F\u306E\u306B get \u3067\u304D\u306A\u3044");this.saveStack();let t=this.yCalc()||this.ySentence();if(t===null){let s=this.get();throw this.logger.debug("(...)\u306E\u89E3\u6790\u30A8\u30E9\u30FC\u3002"+this.nodeToStr(s,{depth:1},!0)+"\u306E\u8FD1\u304F",e),p.fromNode("(...)\u306E\u89E3\u6790\u30A8\u30E9\u30FC\u3002"+this.nodeToStr(s,{depth:1},!1)+"\u306E\u8FD1\u304F",e)}if(!this.check(")"))throw this.logger.debug("(...)\u306E\u89E3\u6790\u30A8\u30E9\u30FC\u3002"+this.nodeToStr(t,{depth:1},!0)+"\u306E\u8FD1\u304F",e),p.fromNode("(...)\u306E\u89E3\u6790\u30A8\u30E9\u30FC\u3002"+this.nodeToStr(t,{depth:1},!1)+"\u306E\u8FD1\u304F",e);let r=this.get();return this.loadStack(),r&&(t.josi=r.josi),t}yConst(e,t){return{type:e.type,value:e.value,josi:e.josi,...t}}yValue(){let e=this.peekSourceMap();if(this.check("comma")&&this.get(),this.checkTypes(["number","bigint","string"]))return this.yConst(this.getCur(),e);if(this.check("("))return this.yValueKakko();if(this.check2(["-","number"])||this.check2(["-","word"])||this.check2(["-","func"])){let u=this.get(),c=this.yValue(),a=c&&c.josi?c.josi:"",l={type:"number",value:-1,line:u&&u.line?u.line:0},h=c||this.yNop();return{type:"op",operator:"*",blocks:[l,h],josi:a,...e,end:this.peekSourceMap()}}if(this.check("not")){this.get();let u=this.yValue(),c=u&&u.josi?u.josi:"";return{type:"not",operator:"not",blocks:[u],josi:c,...e,end:this.peekSourceMap()}}let t=this.yJSONArray();if(t)return t;let r=this.yJSONObject();if(r)return r;let s=Q.concat(["eol",")","]","\u306A\u3089\u3070","\u56DE","\u9593","\u53CD\u5FA9","\u6761\u4EF6\u5206\u5C90"]);if(this.check2(["func",s])){let u=this.get();if(!u)throw new Error("[System Error] \u6B63\u3057\u304F\u5024\u304C\u53D6\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002");let c=u,a=this.getVarNameRef(c);this.usedFuncs.add(a.value);let f=c.meta,l=[];if(!f)throw p.fromNode(`\u4E00\u8A9E\u95A2\u6570\u300E${a.value}\u300F\u306F\u5B58\u5728\u3057\u307E\u305B\u3093\u3002`,c);if(f.josi&&f.josi.length===1)l.push({type:"word",value:"\u305D\u308C"});else if(f.josi&&f.josi.length>=2)throw p.fromNode(`\u95A2\u6570\u300E${a.value}\u300F\u3067\u5F15\u6570\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${f.josi.length}\u500B\u306E\u5F15\u6570\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,c);return{type:"func",name:a.value,blocks:l,josi:a.josi,meta:f,asyncFn:!!f.asyncFn,...e,end:this.peekSourceMap()}}if(this.check2([["func","word"],"("])&&this.peekDef().josi===""){let u=this.peek();if(this.accept([["func","word"],"(",this.yGetArgParen,")"])){let c=this.getVarNameRef(this.y[0]),a=c.meta,f=this.y[2],l=c.value,h=!1;if(this.usedFuncs.add(l),a&&a.josi){if(a.josi.length!==f.length){if(!a.isVariableJosi)throw p.fromNode(`\u95A2\u6570\u300E${c.value}\u300F\u3067\u5F15\u6570${f.length}\u500B\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a.josi.length}\u500B\u306E\u5F15\u6570\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,c)}h=!!a.asyncFn}return{type:"func",name:l,blocks:f,josi:this.y[3].josi,meta:a,asyncFn:h,...e,end:this.peekSourceMap()}}throw p.fromNode("C\u98A8\u95A2\u6570\u547C\u3073\u51FA\u3057\u306E\u30A8\u30E9\u30FC",u||j())}if(this.check("def_func"))return this.yMumeiFunc();let i=this.yValueWord();if(i)return i;let o=this.yValueFuncPointer();return o||null}yValueWordGetIndex(e){if(e.index||(e.index=[]),this.check("@")){if(this.accept(["@",this.yValue,"comma",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index.push(this.checkArrayIndex(this.y[5])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[5].josi,!0;if(this.accept(["@",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[3].josi,!0;if(this.accept(["@",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[1].josi,!0;throw p.fromNode("\u5909\u6570\u306E\u5F8C\u308D\u306E\u300E@\u8981\u7D20\u300F\u306E\u6307\u5B9A\u304C\u4E0D\u6B63\u3067\u3059\u3002",e)}if(this.check("[")&&this.accept(["[",this.yCalc,"]"]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[2].josi,this.y[2].josi==="";if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"]"])){let t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3])],r=e.index.pop();return e.index=this.checkArrayReverse(t),r&&e.index.unshift(r),e.josi=this.y[4].josi,this.y[4].josi===""}if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]"])){let t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3]),this.checkArrayIndex(this.y[5])],r=e.index.pop();return e.index=this.checkArrayReverse(t),r&&e.index.unshift(r),e.josi=this.y[6].josi,this.y[6].josi===""}return!1}yValueFuncPointer(){let e=this.peekSourceMap();if(this.check("func_pointer")){let t=this.getCur();return{type:"func_pointer",name:t.value,josi:t.josi,...e,end:this.peekSourceMap()}}return null}yValueWord(){let e=this.peekSourceMap();if(this.check("word")){let t=this.getCur(),r=this.getVarNameRef(t);if(r.josi===""&&this.checkTypes(["[","@"])){let s={type:"ref_array",name:r,index:[],josi:"",...e,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetIndex(s););if(s.index&&s.index.length===0)throw p.fromNode(`\u914D\u5217\u300E${r.value}\u300F\u30A2\u30AF\u30BB\u30B9\u3067\u6307\u5B9A\u30DF\u30B9`,r);return s}if(r.josi===""&&(this.check2(["$","word"])||this.check2(["$","string"]))){let s=[],i="";for(;this.check("$");){this.get();let o=this.get();s.push(o),i=o.josi}return{type:"ref_prop",name:r,index:s,josi:i,...e,end:this.peekSourceMap()}}return r}return null}createVar(e,t,r){let s=e.value,i=t?"const":"var";if(this.funcLevel===0){s.indexOf("__")<0&&(s=this.modName+"__"+s);let o={type:i,value:"",isExport:r};this.funclist.set(s,o);let u=e;return u.value=s,e}else return this.localvars.set(s,{type:i,value:""}),e}getVarName(e){let t=this.findVar(e.value);return t?(t&&t.scope==="global"&&(e.value=t.name),e):(this.createVar(e,!1,this.isExportDefault),e)}getVarNameRef(e){let t=this.findVar(e.value);return t?t&&t.scope==="global"&&(e.value=t.name):this.funcLevel===0&&e.value.indexOf("__")<0&&(e.value=this.modName+"__"+e.value),e}createVarList(e,t,r){for(let s=0;s<e.length;s++)e[s]=this.createVar(e[s],t,r);return e}yJSONObjectValue(){let e=[],t=this.peek();if(!t)return[];for(;!this.isEOF();){for(;this.check("eol");)this.get();if(this.check("}"))break;if(this.accept(["word",":",this.yCalc]))this.y[0].type="string",e.push(this.y[0]),e.push(this.y[2]);else if(this.accept(["string",":",this.yCalc]))e.push(this.y[0]),e.push(this.y[2]);else if(this.accept(["word"])){let r=this.y[0],s=JSON.parse(JSON.stringify(r));r.type="string",e.push(r),e.push(s)}else if(this.checkTypes(["string","number"])){let r=this.getCur();e.push(r),e.push(r)}else throw p.fromNode("\u8F9E\u66F8\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u5BA3\u8A00\u3067\u672B\u5C3E\u306E\u300E}\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002",t);this.check("comma")&&this.get()}return e}yJSONObject(){let e=this.yJSONObjectRaw();if(!e)return null;if(e.josi===""&&this.checkTypes(["@","["])){let t={type:"ref_array",name:"__ARRAY__",index:[e],josi:"",line:e.line,end:this.peekSourceMap()};return this.yValueWordGetIndex(t),t}return e}yJSONObjectRaw(){let e=this.peekSourceMap();if(this.accept(["{","}"]))return{type:"json_obj",blocks:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue,"}"]))return{type:"json_obj",blocks:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue]))throw p.fromNode("\u8F9E\u66F8\u578B\u5909\u6570\u306E\u521D\u671F\u5316\u304C\u300E}\u300F\u3067\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093\u3002",this.y[1]);return null}yJSONArrayValue(){this.check("eol")&&this.get();let e=this.yCalc();if(e===null)return[];this.check("comma")&&this.get();let t=[e];for(;!this.isEOF()&&(this.check("eol")&&this.get(),!this.check("]"));){let r=this.yCalc();if(r===null)break;this.check("comma")&&this.get(),t.push(r)}return t}yJSONArray(){let e=this.yJSONArrayRaw();if(!e)return null;if(e.josi===""&&this.checkTypes(["@","["])){let t={type:"ref_array",name:"__ARRAY__",index:[e],josi:"",line:e.line,end:this.peekSourceMap()};return this.yValueWordGetIndex(t),t}return e}yJSONArrayRaw(){let e=this.peekSourceMap();if(this.accept(["[","]"]))return{type:"json_array",blocks:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue,"]"]))return{type:"json_array",blocks:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue]))throw p.fromNode("\u914D\u5217\u5909\u6570\u306E\u521D\u671F\u5316\u304C\u300E]\u300F\u3067\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093\u3002",this.y[1]);return null}yTryExcept(){let e=this.peekSourceMap();if(!this.check("\u30A8\u30E9\u30FC\u76E3\u8996"))return null;let t=this.getCur(),r=this.yBlock();if(!this.check2(["\u30A8\u30E9\u30FC","\u306A\u3089\u3070"]))throw p.fromNode("\u30A8\u30E9\u30FC\u69CB\u6587\u3067\u300E\u30A8\u30E9\u30FC\u306A\u3089\u3070\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u30A8\u30E9\u30FC\u76E3\u8996..\u30A8\u30E9\u30FC\u306A\u3089\u3070..\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u3067\u8A18\u8FF0\u3057\u307E\u3059\u3002",t);this.get(),this.get();let s=this.yBlock();if(this.check("\u3053\u3053\u307E\u3067"))this.get();else throw p.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u30A8\u30E9\u30FC\u76E3\u8996\u300F...\u300E\u30A8\u30E9\u30FC\u306A\u3089\u3070\u300F...\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u5FDC\u3055\u305B\u3066\u304F\u3060\u3055\u3044\u3002",e);return{type:"try_except",blocks:[r,s],josi:"",...e,end:this.peekSourceMap()}}_checkAsyncFn(e){if(!e)return!1;if(e.type=="def_func"||e.type=="def_test"||e.type=="func_obj"){let t=e;if(t.asyncFn)return!0;let r=!1;for(let s of t.blocks)if(this._checkAsyncFn(s))return r=!0,t.asyncFn=r,t.meta.asyncFn=r,this.isModifiedNodes=!0,!0}if(e.type=="func"){let t=e;if(t.asyncFn)return!0;if(t.blocks){for(let s of t.blocks)if(this._checkAsyncFn(s))return t.asyncFn=!0,this.isModifiedNodes=!0,!0}let r=this.funclist.get(t.name);return r&&r.asyncFn?(t.asyncFn=!0,this.isModifiedNodes=!0,!0):!1}if(e.type=="renbun")return!0;if(e.blocks){for(let t of e.blocks)if(this._checkAsyncFn(t))return!0}return!1}_tokensToNodes(e){let t=[];for(let r of e)t.push(this._tokenToNode(r));return t}_tokenToNode(e){let t=this.peekSourceMap(e);if(e.type==="string"||e.type=="number"||e.type=="bigint")return this.yConst(e,t);if(e.type==="word")return{type:"word",value:e.value,josi:e.josi,...t};if(e.type==="eol"||e.type==="_eol")return{type:"eol",...t};throw new Error("[System Error] \u672A\u77E5\u306E\u30C8\u30FC\u30AF\u30F3\u304CAst\u306B\u5909\u63DB\u3055\u308C\u307E\u3057\u305F\u3002")}};var _e=class{constructor(e,t,r){this.from=e,this.to=t,this.index=r}},A=class{constructor(e,t){this.text=e,this.sourcePosition=t}},ye=class{constructor(e){this.history=[],this.code=e}getText(){return this.code}replaceAll(e,t){for(;;){let r=this.getText().indexOf(e);if(r===-1)break;e.length!==t.length&&this.history.unshift(new _e(e.length,t.length,r)),this.code=this.code.replace(e,t)}}getSourcePosition(e){for(let t of this.history)e>=t.index+t.to?e+=t.from-t.to:t.index<=e&&e<t.index+t.to&&(t.to>=2&&e===t.index+t.to-1?e=t.index+t.from-1:e=t.index);return e}},ie=class n{static getInstance(){return n._instance||(n._instance=new n),n._instance}constructor(){this.convertTable=new Map([[8208,"-"],[8209,"-"],[8211,"-"],[8212,"-"],[8213,"-"],[8722,"-"],[732,"~"],[759,"~"],[8275,"~"],[8764,"~"],[12316,"~"],[65374,"~"],[8192," "],[8194," "],[8195," "],[8196," "],[8197," "],[8198," "],[8199," "],[8201," "],[8202," "],[8203," "],[8239," "],[8287," "],[12288," "],[12644," "],[8251,"#"],[12290,";"],[12304,"["],[12305,"]"],[12289,","],[65292,","],[10005,"*"],[10006,"*"],[10007,"*"],[10008,"*"],[10060,"*"],[10133,"+"],[10134,"-"],[10135,"\xF7"],[129008,"="]])}convert1ch(e){if(!e)return"";let t=e.codePointAt(0)||0,r=this.convertTable.get(t)||"";if(r)return r;if(t<127)return e;if(t>=65281&&t<=65374){let s=t-65248;return String.fromCodePoint(s)}return e}convert(e){if(!e)return[];let t=new ye(e);t.replaceAll(`\r
|
|
14
|
+
peek: `+JSON.stringify(this.peek(),null,2));let e=`\u4E0D\u5B8C\u5168\u306A\u6587\u3067\u3059\u3002${this.stack.map(i=>this.nodeToStr(i,{depth:0},!0)).join("\u3001")}\u304C\u89E3\u6C7A\u3057\u3066\u3044\u307E\u305B\u3093\u3002`,t=`\u4E0D\u5B8C\u5168\u306A\u6587\u3067\u3059\u3002${this.stack.map(i=>this.nodeToStr(i,{depth:0},!1)).join("\u3001")}\u304C\u89E3\u6C7A\u3057\u3066\u3044\u307E\u305B\u3093\u3002`;for(let i of this.stack){let o=this.nodeToStr(i,{depth:0},!1),u=this.nodeToStr(i,{depth:1},!1);o!==u&&(e+=`${this.nodeToStr(i,{depth:0},!0)}\u306F${this.nodeToStr(i,{depth:1},!0)}\u3068\u3057\u3066\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059\u3002`,t+=`${o}\u306F${u}\u3068\u3057\u3066\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059\u3002`)}let r=this.stack[0],s=this.stack[this.stack.length-1];throw this.logger.debug(e,r),d.fromNode(t,r,s)}return this.popStack([])}yCallFunc(){let e=this.peekSourceMap(),t=this.get();if(!t)return null;let r=t,s=r.meta,i=r.value,o=null;if(r.josi==="\u306B\u306F"){try{o=this.yMumeiFunc()}catch(l){throw d.fromNode(`\u300E${r.value}\u306B\u306F...\u300F\u3067\u7121\u540D\u95A2\u6570\u306E\u5B9A\u7FA9\u3067\u4EE5\u4E0B\u306E\u9593\u9055\u3044\u304C\u3042\u308A\u307E\u3059\u3002
|
|
15
|
+
${l.message}`,r)}if(o===null)throw d.fromNode("\u300EF\u306B\u306F\u300F\u69CB\u6587\u304C\u3042\u308A\u307E\u3057\u305F\u304C\u3001\u95A2\u6570\u5B9A\u7FA9\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002",r)}if(!s||typeof s.josi>"u")throw d.fromNode("\u95A2\u6570\u306E\u5B9A\u7FA9\u3067\u30A8\u30E9\u30FC\u3002",r);this.recentlyCalledFunc.push({name:i,...s}),s&&s.asyncFn&&(this.usedAsyncFn=!0);let u=[],c=0,a=0;for(let l=s.josi.length-1;l>=0;l--)for(;;){let h=this.popStack(s.josi[l]);if(h!==null)a++;else if(l<s.josi.length-1||!s.isVariableJosi)c++,h=o;else break;if(h!==null&&s.funcPointers!==void 0&&s.funcPointers[l]!==null)if(h.type==="func")h.type="func_pointer";else{let p=s.varnames?s.varnames[l]:`${l+1}\u756A\u76EE\u306E\u5F15\u6570`;throw d.fromNode(`\u95A2\u6570\u300E${r.value}\u300F\u306E\u5F15\u6570\u300E${p}\u300F\u306B\u306F\u95A2\u6570\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u5FC5\u8981\u3067\u3059\u3002`,r)}if(h===null&&(h={type:"word",value:"\u305D\u308C",josi:"",...e,end:e}),u.unshift(h),l<s.josi.length-1||!s.isVariableJosi)break}if(c>=2&&(a>0||r.josi===""||G.indexOf(r.josi)>=0))throw d.fromNode(`\u95A2\u6570\u300E${r.value}\u300F\u306E\u5F15\u6570\u304C\u4E0D\u8DB3\u3057\u3066\u3044\u307E\u3059\u3002`,r);this.usedFuncs.add(r.value);let f={type:"func",name:r.value,blocks:u,meta:s,josi:r.josi,asyncFn:!!s.asyncFn,...e,end:this.peekSourceMap()};if(f.name==="\u30D7\u30E9\u30B0\u30A4\u30F3\u540D\u8A2D\u5B9A"){if(u.length>0&&u[0]){let l=String(u[0].value);l==="\u30E1\u30A4\u30F3"&&(l=String(u[0].file)),this.namespaceStack.push(this.modName),this.isExportStack.push(this.isExportDefault),this.modName=O.filenameToModName(l),this.modList.push(this.modName)}}else if(f.name==="\u540D\u524D\u7A7A\u9593\u30DD\u30C3\u30D7"){let l=this.namespaceStack.pop();l&&(this.modName=l);let h=this.isExportStack.pop();h!=null&&(this.isExportDefault=h)}return r.josi===""?f:G.indexOf(r.josi)>=0?(f.josi="\u3057\u3066",f):(f.meta=s,this.pushStack(f),null)}yLet(){let e=this.peekSourceMap();if(this.check2(["word","eq"])){let t=this.peek(),r=!1;try{if(this.accept(["word","eq",this.yCalc])||this.accept(["word","eq",this.ySentence])){if(this.y[2].type==="eol")throw new Error("\u5024\u304C\u7A7A\u3067\u3059\u3002");this.check("comma")&&this.get();let s=this.getVarName(this.y[0]),i=this.y[2];return{type:"let",name:s.value,blocks:[i],josi:"",...e,end:this.peekSourceMap()}}else throw r=!0,this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}\u3078\u306E\u4EE3\u5165\u6587\u3067\u8A08\u7B97\u5F0F\u306B\u66F8\u304D\u9593\u9055\u3044\u304C\u3042\u308A\u307E\u3059\u3002`,t),d.fromNode(`${this.nodeToStr(t,{depth:1},!1)}\u3078\u306E\u4EE3\u5165\u6587\u3067\u8A08\u7B97\u5F0F\u306B\u66F8\u304D\u9593\u9055\u3044\u304C\u3042\u308A\u307E\u3059\u3002`,e)}catch(s){throw r?s:(this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}\u3078\u306E\u4EE3\u5165\u6587\u3067\u8A08\u7B97\u5F0F\u306B\u4EE5\u4E0B\u306E\u66F8\u304D\u9593\u9055\u3044\u304C\u3042\u308A\u307E\u3059\u3002
|
|
16
|
+
${s.message}`,t),d.fromNode(`${this.nodeToStr(t,{depth:1},!1)}\u3078\u306E\u4EE3\u5165\u6587\u3067\u8A08\u7B97\u5F0F\u306B\u4EE5\u4E0B\u306E\u66F8\u304D\u9593\u9055\u3044\u304C\u3042\u308A\u307E\u3059\u3002
|
|
17
|
+
${s.message}`,e))}}if(this.check2(["word","$","*","$","*","$","*","$","*","eq"])||this.check2(["word","$","*","$","*","$","*","eq"])||this.check2(["word","$","*","$","*","eq"])||this.check2(["word","$","*","eq"])){let t=[],r=this.getVarName(this.get());for(;;){let i=this.peek();if(i===null||i.type!=="$")break;this.get(),t.push(this.get())}this.get();let s=this.yCalc();if(s===null)throw d.fromNode(`${this.nodeToStr(r,{depth:1},!1)}\u3078\u306E\u4EE3\u5165\u6587\u306E\u8A08\u7B97\u5F0F\u306B\u66F8\u304D\u9593\u9055\u3044\u304C\u3042\u308A\u307E\u3059\u3002`,e);return{type:"let_prop",name:r.value,index:t,blocks:[s],josi:"",...e,end:this.peekSourceMap()}}if(this.check2(["word","@"])){let t=this.yLetArrayAt(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.check2(["word","["])){let t=this.yLetArrayBracket(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.accept(["word","\u3068\u306F"])){let t=this.y[0];if(!this.checkTypes(["\u5909\u6570","\u5B9A\u6570"]))throw d.fromNode("\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u300E"+String(t.value)+"\u300F\u306E\u5B9A\u7FA9\u30A8\u30E9\u30FC",t);let r=this.getCur(),s=this.isExportDefault;if(this.check2(["{","word","}"])){this.get();let u=this.get();if(u===null)throw d.fromNode("\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u300E"+String(t.value)+"\u300F\u306E\u5B9A\u7FA9\u30A8\u30E9\u30FC",t);let c=u.value;c==="\u516C\u958B"?s=!0:c==="\u975E\u516C\u958B"?s=!1:c==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"?s=!0:this.logger.warn(`\u4E0D\u660E\u306A\u5909\u6570\u5C5E\u6027\u300E${c}\u300F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002`),this.get()}let i=this.createVar(t,r.type==="\u5B9A\u6570",s),o=this.yNop();return this.check("eq")&&(this.get(),o=this.yCalc()||o),this.check("comma")&&this.get(),{type:"def_local_var",name:i.value,vartype:r.type,isExport:s,blocks:[o],...e,end:this.peekSourceMap()}}if(this.accept(["\u5909\u6570","word"])){let t=this.y[1];if(this.index-=2,this.accept(["\u5909\u6570","word","eq",this.yCalc])){let r=this.createVar(this.y[1],!1,this.isExportDefault),s=this.y[3]||this.yNop();return{type:"def_local_var",name:r.value,vartype:"\u5909\u6570",blocks:[s],...e,end:this.peekSourceMap()}}if(this.accept(["\u5909\u6570","word","{","word","}","eq",this.yCalc])){let r=this.isExportDefault,s=this.y[3].value;s==="\u516C\u958B"?r=!0:s==="\u975E\u516C\u958B"?r=!1:s==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"?r=!0:this.logger.warn(`\u4E0D\u660E\u306A\u5909\u6570\u5C5E\u6027\u300E${s}\u300F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002`);let i=this.createVar(this.y[1],!1,r),o=this.y[6]||this.yNop();return{type:"def_local_var",name:i.value,vartype:"\u5909\u6570",isExport:r,blocks:[o],...e,end:this.peekSourceMap()}}return this.index+=2,{type:"def_local_var",name:this.createVar(t,!1,this.isExportDefault).value,vartype:"\u5909\u6570",blocks:[this.yNop()],...e,end:this.peekSourceMap()}}if(this.accept(["\u5B9A\u6570","word","eq"])){let t=this.y[1],r=this.createVar(t,!0,this.isExportDefault),s=this.yCalc()||this.yNop();return{type:"def_local_var",name:r.value,vartype:"\u5B9A\u6570",blocks:[s],...e,end:this.peekSourceMap()}}if(this.accept(["\u5B9A\u6570","word","{","word","}","eq"])){let t=this.isExportDefault,r=this.y[3].value;r==="\u516C\u958B"?t=!0:r==="\u975E\u516C\u958B"?t=!1:r==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"?t=!0:this.logger.warn(`\u4E0D\u660E\u306A\u5B9A\u6570\u5C5E\u6027\u300E${r}\u300F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002`);let s=this.createVar(this.y[1],!0,t),i=this.yCalc()||this.yNop();return{type:"def_local_var",name:s.value,vartype:"\u5B9A\u6570",isExport:t,blocks:[i],...e,end:this.peekSourceMap()}}if(this.accept(["\u5B9A\u6570",this.yJSONArray,"eq"])){let t=this.y[1];if(t&&t.blocks instanceof Array){for(let i in t.blocks)if(t.blocks[i].type!=="word")throw d.fromNode(`\u8907\u6570\u5B9A\u6570\u306E\u4EE3\u5165\u6587${Number(i)+1}\u756A\u76EE\u3067\u30A8\u30E9\u30FC\u3002\u300E\u5B9A\u6570[A,B,C]=[1,2,3]\u300F\u306E\u66F8\u5F0F\u3067\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,this.y[0])}else throw d.fromNode("\u8907\u6570\u5B9A\u6570\u306E\u4EE3\u5165\u6587\u3067\u30A8\u30E9\u30FC\u3002\u300E\u5B9A\u6570[A,B,C]=[1,2,3]\u300F\u306E\u66F8\u5F0F\u3067\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",this.y[0]);let r=this._tokensToNodes(this.createVarList(t.blocks,!0,this.isExportDefault)),s=this.yCalc()||this.yNop();return{type:"def_local_varlist",names:r,vartype:"\u5B9A\u6570",blocks:[s],...e,end:this.peekSourceMap()}}if(this.accept(["\u5909\u6570",this.yJSONArray,"eq"])){let t=this.y[1];if(t&&t.blocks instanceof Array)t.blocks.forEach((i,o)=>{if(i.type!=="word")throw d.fromNode(`\u8907\u6570\u5909\u6570\u306E\u4EE3\u5165\u6587${String(o+1)}\u756A\u76EE\u3067\u30A8\u30E9\u30FC\u300E\u5909\u6570[A,B,C]=[1,2,3]\u300F\u306E\u66F8\u5F0F\u3067\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,this.y[0])});else throw d.fromNode("\u8907\u6570\u5909\u6570\u306E\u4EE3\u5165\u6587\u3067\u30A8\u30E9\u30FC\u3002\u300E\u5909\u6570[A,B,C]=[1,2,3]\u300F\u306E\u66F8\u5F0F\u3067\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",this.y[0]);let r=this._tokensToNodes(this.createVarList(t.blocks,!1,this.isExportDefault)),s=this.yCalc()||this.yNop();return{type:"def_local_varlist",names:r,vartype:"\u5909\u6570",blocks:[s],...e,end:this.peekSourceMap()}}if(this.check2(["word","comma","word"])){if(this.accept(["word","comma","word","eq"])){let t=[this.y[0],this.y[2]];t=this.createVarList(t,!1,this.isExportDefault);let r=this.yCalc()||this.yNop();return{type:"def_local_varlist",names:t,vartype:"\u5909\u6570",blocks:[r],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","eq"])){let t=[this.y[0],this.y[2],this.y[4]];t=this.createVarList(t,!1,this.isExportDefault);let r=this.yCalc()||this.yNop();return{type:"def_local_varlist",names:t,vartype:"\u5909\u6570",blocks:[r],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","eq"])){let t=[this.y[0],this.y[2],this.y[4],this.y[6]];t=this.createVarList(t,!1,this.isExportDefault);let r=this.yCalc()||this.yNop();return{type:"def_local_varlist",names:t,vartype:"\u5909\u6570",blocks:[r],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","comma","word","eq"])){let t=[this.y[0],this.y[2],this.y[4],this.y[6],this.y[8]];t=this.createVarList(t,!1,this.isExportDefault);let r=this.yCalc()||this.yNop();return{type:"def_local_varlist",names:t,vartype:"\u5909\u6570",blocks:[r],...e,end:this.peekSourceMap()}}}return null}checkArrayIndex(e){if(this.arrayIndexFrom===0)return e;let t={...e,type:"number",value:this.arrayIndexFrom};return{...e,type:"op",operator:"-",blocks:[e,t]}}checkArrayReverse(e){return e?!this.flagReverseArrayIndex||e.length<=1?e:e.reverse():[]}yLetArrayAt(e){if(this.accept(["word","@",this.yValue,"eq",this.yCalc])){let t=this.y[4];return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,this.checkArrayIndex(this.y[2])],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","@",this.yValue,"@",this.yValue,"eq",this.yCalc])){let t=this.y[6],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","@",this.yValue,"@",this.yValue,"@",this.yValue,"eq",this.yCalc])){let t=this.y[8],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","@",this.yValue,"comma",this.yValue,"eq",this.yCalc])){let t=this.y[6],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","@",this.yValue,"comma",this.yValue,"comma",this.yValue,"eq",this.yCalc])){let t=this.y[8],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}return null}yLetArrayBracket(e){if(this.accept(["word","[",this.yCalc,"]","eq",this.yCalc])){let t=this.y[5],r=[this.checkArrayIndex(this.y[2])];return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])){let t=this.y[8],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],tag:"2",checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])){let t=this.y[7],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,tag:"2",...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])){let t=this.y[11],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5]),this.checkArrayIndex(this.y[8])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])){let t=this.y[9],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]);return{type:"let_array",name:this.getVarName(this.y[0]).value,index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),blocks:[t,...r],checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()}}return null}yCalc(){let e=this.peekSourceMap();if(this.check("eol"))return null;let t=this.yGetArg();if(!t)return null;if(t.josi==="")return t;let r=this.isReadingCalc;this.isReadingCalc=!0,this.pushStack(t);let s=this.yCall();if(this.isReadingCalc=r,!s)return this.popStack();let i=s;if(G.indexOf(s.josi||"")>=0){let u=this.yCalc();u&&(i={type:"renbun",operator:"renbun",blocks:[s,u],josi:u.josi,...e,end:this.peekSourceMap()})}let o=this.peek();return o&&T[o.type]?this.yGetArgOperator(i):i}yValueKakko(){if(!this.check("("))return null;let e=this.get();if(!e)throw new Error("[System Error] check \u3057\u305F\u306E\u306B get \u3067\u304D\u306A\u3044");this.saveStack();let t=this.yCalc()||this.ySentence();if(t===null){let s=this.get();throw this.logger.debug("(...)\u306E\u89E3\u6790\u30A8\u30E9\u30FC\u3002"+this.nodeToStr(s,{depth:1},!0)+"\u306E\u8FD1\u304F",e),d.fromNode("(...)\u306E\u89E3\u6790\u30A8\u30E9\u30FC\u3002"+this.nodeToStr(s,{depth:1},!1)+"\u306E\u8FD1\u304F",e)}if(!this.check(")"))throw this.logger.debug("(...)\u306E\u89E3\u6790\u30A8\u30E9\u30FC\u3002"+this.nodeToStr(t,{depth:1},!0)+"\u306E\u8FD1\u304F",e),d.fromNode("(...)\u306E\u89E3\u6790\u30A8\u30E9\u30FC\u3002"+this.nodeToStr(t,{depth:1},!1)+"\u306E\u8FD1\u304F",e);let r=this.get();return this.loadStack(),r&&(t.josi=r.josi),t}yConst(e,t){return{type:e.type,value:e.value,josi:e.josi,...t}}yValue(){let e=this.peekSourceMap();if(this.check("comma")&&this.get(),this.checkTypes(["number","bigint","string"]))return this.yConst(this.getCur(),e);if(this.check("("))return this.yValueKakko();if(this.check2(["-","number"])||this.check2(["-","word"])||this.check2(["-","func"])){let u=this.get(),c=this.yValue(),a=c&&c.josi?c.josi:"",l={type:"number",value:-1,line:u&&u.line?u.line:0},h=c||this.yNop();return{type:"op",operator:"*",blocks:[l,h],josi:a,...e,end:this.peekSourceMap()}}if(this.check("not")){this.get();let u=this.yValue(),c=u&&u.josi?u.josi:"";return{type:"not",operator:"not",blocks:[u],josi:c,...e,end:this.peekSourceMap()}}let t=this.yJSONArray();if(t)return t;let r=this.yJSONObject();if(r)return r;let s=Q.concat(["eol",")","]","\u306A\u3089\u3070","\u56DE","\u9593","\u53CD\u5FA9","\u6761\u4EF6\u5206\u5C90"]);if(this.check2(["func",s])){let u=this.get();if(!u)throw new Error("[System Error] \u6B63\u3057\u304F\u5024\u304C\u53D6\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002");let c=u,a=this.getVarNameRef(c);this.usedFuncs.add(a.value);let f=c.meta,l=[];if(!f)throw d.fromNode(`\u4E00\u8A9E\u95A2\u6570\u300E${a.value}\u300F\u306F\u5B58\u5728\u3057\u307E\u305B\u3093\u3002`,c);if(f.josi&&f.josi.length===1)l.push({type:"word",value:"\u305D\u308C"});else if(f.josi&&f.josi.length>=2)throw d.fromNode(`\u95A2\u6570\u300E${a.value}\u300F\u3067\u5F15\u6570\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002${f.josi.length}\u500B\u306E\u5F15\u6570\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,c);return{type:"func",name:a.value,blocks:l,josi:a.josi,meta:f,asyncFn:!!f.asyncFn,...e,end:this.peekSourceMap()}}if(this.check2([["func","word"],"("])&&this.peekDef().josi===""){let u=this.peek();if(this.accept([["func","word"],"(",this.yGetArgParen,")"])){let c=this.getVarNameRef(this.y[0]),a=c.meta,f=this.y[2],l=c.value,h=!1;if(this.usedFuncs.add(l),a&&a.josi){if(a.josi.length!==f.length){if(!a.isVariableJosi)throw d.fromNode(`\u95A2\u6570\u300E${c.value}\u300F\u3067\u5F15\u6570${f.length}\u500B\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a.josi.length}\u500B\u306E\u5F15\u6570\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,c)}h=!!a.asyncFn}return{type:"func",name:l,blocks:f,josi:this.y[3].josi,meta:a,asyncFn:h,...e,end:this.peekSourceMap()}}throw d.fromNode("C\u98A8\u95A2\u6570\u547C\u3073\u51FA\u3057\u306E\u30A8\u30E9\u30FC",u||j())}if(this.check("def_func"))return this.yMumeiFunc();let i=this.yValueWord();if(i)return i;let o=this.yValueFuncPointer();return o||null}yValueWordGetIndex(e){if(e.index||(e.index=[]),this.check("@")){if(this.accept(["@",this.yValue,"comma",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index.push(this.checkArrayIndex(this.y[5])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[5].josi,!0;if(this.accept(["@",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[3].josi,!0;if(this.accept(["@",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[1].josi,!0;throw d.fromNode("\u5909\u6570\u306E\u5F8C\u308D\u306E\u300E@\u8981\u7D20\u300F\u306E\u6307\u5B9A\u304C\u4E0D\u6B63\u3067\u3059\u3002",e)}if(this.check("[")&&this.accept(["[",this.yCalc,"]"]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[2].josi,this.y[2].josi==="";if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"]"])){let t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3])],r=e.index.pop();return e.index=this.checkArrayReverse(t),r&&e.index.unshift(r),e.josi=this.y[4].josi,this.y[4].josi===""}if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]"])){let t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3]),this.checkArrayIndex(this.y[5])],r=e.index.pop();return e.index=this.checkArrayReverse(t),r&&e.index.unshift(r),e.josi=this.y[6].josi,this.y[6].josi===""}return!1}yValueFuncPointer(){let e=this.peekSourceMap();if(this.check("func_pointer")){let t=this.getCur();return{type:"func_pointer",name:t.value,josi:t.josi,...e,end:this.peekSourceMap()}}return null}yValueWord(){let e=this.peekSourceMap();if(this.check("word")){let t=this.getCur(),r=this.getVarNameRef(t);if(r.josi===""&&this.checkTypes(["[","@"])){let s={type:"ref_array",name:r,index:[],josi:"",...e,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetIndex(s););if(s.index&&s.index.length===0)throw d.fromNode(`\u914D\u5217\u300E${r.value}\u300F\u30A2\u30AF\u30BB\u30B9\u3067\u6307\u5B9A\u30DF\u30B9`,r);return s}if(r.josi===""&&(this.check2(["$","word"])||this.check2(["$","string"]))){let s=[],i="";for(;this.check("$");){this.get();let o=this.get();s.push(o),i=o.josi}return{type:"ref_prop",name:r,index:s,josi:i,...e,end:this.peekSourceMap()}}return r}return null}createVar(e,t,r){let s=e.value,i=t?"const":"var";if(this.funcLevel===0){s.indexOf("__")<0&&(s=this.modName+"__"+s);let o={type:i,value:"",isExport:r};this.funclist.set(s,o);let u=e;return u.value=s,e}else return this.localvars.set(s,{type:i,value:""}),e}getVarName(e){let t=this.findVar(e.value);return t?(t&&t.scope==="global"&&(e.value=t.name),e):(this.createVar(e,!1,this.isExportDefault),e)}getVarNameRef(e){let t=this.findVar(e.value);return t?t&&t.scope==="global"&&(e.value=t.name):this.funcLevel===0&&e.value.indexOf("__")<0&&(e.value=this.modName+"__"+String(e.value)),e}createVarList(e,t,r){for(let s=0;s<e.length;s++)e[s]=this.createVar(e[s],t,r);return e}yJSONObjectValue(){let e=[],t=this.peek();if(!t)return[];for(;!this.isEOF();){for(;this.check("eol");)this.get();if(this.check("}"))break;if(this.accept(["word",":",this.yCalc]))this.y[0].type="string",e.push(this.y[0]),e.push(this.y[2]);else if(this.accept(["string",":",this.yCalc]))e.push(this.y[0]),e.push(this.y[2]);else if(this.accept(["word"])){let r=this.y[0],s=JSON.parse(JSON.stringify(r));r.type="string",e.push(r),e.push(s)}else if(this.checkTypes(["string","number"])){let r=this.getCur();e.push(r),e.push(r)}else throw d.fromNode("\u8F9E\u66F8\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u5BA3\u8A00\u3067\u672B\u5C3E\u306E\u300E}\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002",t);this.check("comma")&&this.get()}return e}yJSONObject(){let e=this.yJSONObjectRaw();if(!e)return null;if(e.josi===""&&this.checkTypes(["@","["])){let t={type:"ref_array",name:"__ARRAY__",index:[e],josi:"",line:e.line,end:this.peekSourceMap()};return this.yValueWordGetIndex(t),t}return e}yJSONObjectRaw(){let e=this.peekSourceMap();if(this.accept(["{","}"]))return{type:"json_obj",blocks:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue,"}"]))return{type:"json_obj",blocks:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue]))throw d.fromNode("\u8F9E\u66F8\u578B\u5909\u6570\u306E\u521D\u671F\u5316\u304C\u300E}\u300F\u3067\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093\u3002",this.y[1]);return null}yJSONArrayValue(){this.check("eol")&&this.get();let e=this.yCalc();if(e===null)return[];this.check("comma")&&this.get();let t=[e];for(;!this.isEOF()&&(this.check("eol")&&this.get(),!this.check("]"));){let r=this.yCalc();if(r===null)break;this.check("comma")&&this.get(),t.push(r)}return t}yJSONArray(){let e=this.yJSONArrayRaw();if(!e)return null;if(e.josi===""&&this.checkTypes(["@","["])){let t={type:"ref_array",name:"__ARRAY__",index:[e],josi:"",line:e.line,end:this.peekSourceMap()};return this.yValueWordGetIndex(t),t}return e}yJSONArrayRaw(){let e=this.peekSourceMap();if(this.accept(["[","]"]))return{type:"json_array",blocks:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue,"]"]))return{type:"json_array",blocks:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue]))throw d.fromNode("\u914D\u5217\u5909\u6570\u306E\u521D\u671F\u5316\u304C\u300E]\u300F\u3067\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093\u3002",this.y[1]);return null}yTryExcept(){let e=this.peekSourceMap();if(!this.check("\u30A8\u30E9\u30FC\u76E3\u8996"))return null;let t=this.getCur(),r=this.yBlock();if(!this.check2(["\u30A8\u30E9\u30FC","\u306A\u3089\u3070"]))throw d.fromNode("\u30A8\u30E9\u30FC\u69CB\u6587\u3067\u300E\u30A8\u30E9\u30FC\u306A\u3089\u3070\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u30A8\u30E9\u30FC\u76E3\u8996..\u30A8\u30E9\u30FC\u306A\u3089\u3070..\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u3067\u8A18\u8FF0\u3057\u307E\u3059\u3002",t);this.get(),this.get();let s=this.yBlock();if(this.check("\u3053\u3053\u307E\u3067"))this.get();else throw d.fromNode("\u300E\u3053\u3053\u307E\u3067\u300F\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u300E\u30A8\u30E9\u30FC\u76E3\u8996\u300F...\u300E\u30A8\u30E9\u30FC\u306A\u3089\u3070\u300F...\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u5BFE\u5FDC\u3055\u305B\u3066\u304F\u3060\u3055\u3044\u3002",e);return{type:"try_except",blocks:[r,s],josi:"",...e,end:this.peekSourceMap()}}_checkAsyncFn(e){if(!e)return!1;if(e.type==="def_func"||e.type==="def_test"||e.type==="func_obj"){let t=e;if(t.asyncFn)return!0;let r=!1;for(let s of t.blocks)if(this._checkAsyncFn(s))return r=!0,t.asyncFn=r,t.meta.asyncFn=r,this.isModifiedNodes=!0,!0}if(e.type==="func"){let t=e;if(t.asyncFn)return!0;if(t.blocks){for(let s of t.blocks)if(this._checkAsyncFn(s))return t.asyncFn=!0,this.isModifiedNodes=!0,!0}let r=this.funclist.get(t.name);return r&&r.asyncFn?(t.asyncFn=!0,this.isModifiedNodes=!0,!0):!1}if(e.type==="renbun")return!0;if(e.blocks){for(let t of e.blocks)if(this._checkAsyncFn(t))return!0}return!1}_tokensToNodes(e){let t=[];for(let r of e)t.push(this._tokenToNode(r));return t}_tokenToNode(e){let t=this.peekSourceMap(e);if(e.type==="string"||e.type==="number"||e.type==="bigint")return this.yConst(e,t);if(e.type==="word")return{type:"word",value:e.value,josi:e.josi,...t};if(e.type==="eol"||e.type==="_eol")return{type:"eol",...t};throw new Error("[System Error] \u672A\u77E5\u306E\u30C8\u30FC\u30AF\u30F3\u304CAst\u306B\u5909\u63DB\u3055\u308C\u307E\u3057\u305F\u3002")}};var _e=class{constructor(e,t,r){this.from=e,this.to=t,this.index=r}},A=class{constructor(e,t){this.text=e,this.sourcePosition=t}},ye=class{constructor(e){this.history=[],this.code=e}getText(){return this.code}replaceAll(e,t){for(;;){let r=this.getText().indexOf(e);if(r===-1)break;e.length!==t.length&&this.history.unshift(new _e(e.length,t.length,r)),this.code=this.code.replace(e,t)}}getSourcePosition(e){for(let t of this.history)e>=t.index+t.to?e+=t.from-t.to:t.index<=e&&e<t.index+t.to&&(t.to>=2&&e===t.index+t.to-1?e=t.index+t.from-1:e=t.index);return e}},ie=class n{static getInstance(){return n._instance||(n._instance=new n),n._instance}constructor(){this.convertTable=new Map([[8208,"-"],[8209,"-"],[8211,"-"],[8212,"-"],[8213,"-"],[8722,"-"],[732,"~"],[759,"~"],[8275,"~"],[8764,"~"],[12316,"~"],[65374,"~"],[8192," "],[8194," "],[8195," "],[8196," "],[8197," "],[8198," "],[8199," "],[8201," "],[8202," "],[8203," "],[8239," "],[8287," "],[12288," "],[12644," "],[8251,"#"],[12290,";"],[12304,"["],[12305,"]"],[12289,","],[65292,","],[10005,"*"],[10006,"*"],[10007,"*"],[10008,"*"],[10060,"*"],[10133,"+"],[10134,"-"],[10135,"\xF7"],[129008,"="]])}convert1ch(e){if(!e)return"";let t=e.codePointAt(0)||0,r=this.convertTable.get(t)||"";if(r)return r;if(t<127)return e;if(t>=65281&&t<=65374){let s=t-65248;return String.fromCodePoint(s)}return e}convert(e){if(!e)return[];let t=new ye(e);t.replaceAll(`\r
|
|
18
18
|
`,`
|
|
19
19
|
`),t.replaceAll("\r",`
|
|
20
20
|
`);let r=!1,s=!1,i="",o=[],u=0,c="",a=0;for(;a<t.getText().length;){let f=t.getText().charAt(a),l=t.getText().substring(a,a+2);if(r){if(f===i){r=!1,o.push(new A(c+i,t.getSourcePosition(u))),a++,u=a;continue}c+=f,a++;continue}if(s){if(l===i){s=!1,i==="\uFF0A\uFF0F"&&(i="*/"),o.push(new A(c+i,t.getSourcePosition(u))),a+=2,u=a;continue}c+=f,a++;continue}if(f==="\u300C"){o.push(new A(f,t.getSourcePosition(u))),a++,u=a,r=!0,i="\u300D",c="";continue}if(f==="\u300E"){o.push(new A(f,t.getSourcePosition(u))),a++,u=a,r=!0,i="\u300F",c="";continue}if(f==="\u201C"){o.push(new A(f,t.getSourcePosition(u))),a++,u=a,r=!0,i="\u201D",c="";continue}if(l==="\u{1F334}"||l==="\u{1F33F}"){o.push(new A(l,t.getSourcePosition(u))),a+=2,u=a,s=!0,i=l,c="";continue}let h=this.convert1ch(f);if(h==='"'||h==="'"){o.push(new A(h,t.getSourcePosition(u))),a++,u=a,r=!0,i=f,c="";continue}if(h==="#"){o.push(new A(h,t.getSourcePosition(u))),a++,u=a,r=!0,i=`
|
|
@@ -34,21 +34,21 @@ ${s.message}`,e))}}if(this.check2(["word","$","*","$","*","$","*","$","*","eq"])
|
|
|
34
34
|
`,r+=`const __line = (lineno) => { __self.__v0.set('__line', lineno); }
|
|
35
35
|
`,r+=`__v0.set('__line', 'l0:__getDefFuncCode');
|
|
36
36
|
`,r+=`__v0.set('__forceClose', false);
|
|
37
|
-
`,r+=`__v0.set('__useDebug', ${this.debugOption.useDebug});
|
|
37
|
+
`,r+=`__v0.set('__useDebug', ${String(this.debugOption.useDebug)});
|
|
38
38
|
`,r+="__self.constPools = "+JSON.stringify(this.constPools)+`;
|
|
39
39
|
`,r+="__self.constPoolsTemplate = "+JSON.stringify(this.constPoolsTemplate)+`;
|
|
40
40
|
`,r+=`__self.__propAccessor = [];
|
|
41
|
-
`;let s="";if(this.nakoFuncList.forEach((i,o)=>{let u=I(
|
|
41
|
+
`;let s="";if(this.nakoFuncList.forEach((i,o)=>{let u=I(P(String(i.fn),1)),c=i.asyncFn?"true":"false";s+=`//[DEF_FUNC name='${o}' asyncFn=${c}]
|
|
42
42
|
__self.__varslist[1].set("${o}", ${u});
|
|
43
43
|
//[/DEF_FUNC name='${o}']
|
|
44
44
|
`}),s!==""&&(r+=`__v0.set('__line', '\u95A2\u6570\u306E\u5B9A\u7FA9');
|
|
45
45
|
`+s),t.isTest){let i=`const __tests = [];
|
|
46
|
-
`;this.nakoTestFuncs.forEach(o=>{let u=o.fn;i+=`${u};
|
|
46
|
+
`;this.nakoTestFuncs.forEach(o=>{let u=o.fn;i+=`${String(u)};
|
|
47
47
|
`}),i!==""&&(r+=`__v0.set('__line', '\u30C6\u30B9\u30C8\u306E\u5B9A\u7FA9');
|
|
48
48
|
`,r+=i+`
|
|
49
|
-
`)}return r}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,r){this.__self.addPluginFile(e,t,r)}addFunc(e,t,r){this.__self.addFunc(e,t,r)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if(e.type!=="block")throw
|
|
49
|
+
`)}return r}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,r){this.__self.addPluginFile(e,t,r)}addFunc(e,t,r){this.__self.addFunc(e,t,r)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if(e.type!=="block")throw d.fromNode("\u69CB\u6587\u89E3\u6790\u306B\u5931\u6557\u3057\u3066\u3044\u307E\u3059\u3002\u69CB\u6587\u306F\u5FC5\u305Ablock\u304C\u5148\u982D\u306B\u306A\u308A\u307E\u3059",e);let t=[],r=o=>{if(!o.name)throw new Error("[System Error] \u95A2\u6570\u306E\u5B9A\u7FA9\u3067\u95A2\u6570\u540D\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093");let u=o.name;this.usedFuncSet.add(u),this.__self.__varslist[1].set(u,()=>{}),this.varslistSet[1].names.add(u);let c=o.meta;if(!c)throw new Error("[System Error] \u95A2\u6570\u306E\u5B9A\u7FA9\u3067\u95A2\u6570\u540D\u306E\u30E1\u30BF\u60C5\u5831\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093");this.nakoFuncList.set(u,{josi:c.josi,fn:()=>{},type:"func",asyncFn:!!o.asyncFn,isExport:o.isExport}),t.push({name:u,node:o})},s=o=>{if(o.blocks)for(let u of o.blocks)u.type==="def_func"?r(u):s(u)};s(e);let i=new Set;this.speedMode.invalidSore===0&&i.add("\u305D\u308C"),this.varsSet={isFunction:!1,names:i,readonly:new Set},this.varslistSet=this.setVarslistSet(this.__self.__varslist),this.varslistSet[2]=this.varsSet}convGen(e,t){let r=this.convLineno(e,!1)+this._convGen(e,!0);return t.isTest?"":r}_convGen(e,t){if(!e)return"";let r="";if(e instanceof Array){for(let s=0;s<e.length;s++){let i=e[s];r+=this._convGen(i,t)}return r}if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e!="object")return""+String(e);switch(e.type){case"nop":break;case"block":r+=this.convBlock(e);break;case"comment":case"eol":r+=this.convComment(e);break;case"run_mode":r+=this.convRunMode(e);break;case"break":r+=this.convCheckLoop(e,"break");break;case"continue":r+=this.convCheckLoop(e,"continue");break;case"end":r+="__v0.get('\u7D42')(__self);";break;case"number":r+=e.value;break;case"bigint":r+=e.value;break;case"string":r+=this.convString(e);break;case"def_local_var":r+=this.convDefLocalVar(e);break;case"def_local_varlist":r+=this.convDefLocalVarlist(e);break;case"let":r+=this.convLet(e);break;case"let_prop":r+=this.convLetProp(e);break;case"ref_prop":r+=this.convRefProp(e);break;case"inc":r+=this.convInc(e);break;case"word":case"variable":r+=this.convGetVar(e);break;case"op":case"calc":r+=this.convOp(e);break;case"renbun":r+=this.convRenbun(e);break;case"not":r+="(("+this._convGen(e.blocks[0],!0)+")?false:true)";break;case"func":case"func_pointer":case"calc_func":r+=this.convCallFunc(e,t);break;case"if":r+=this.convIf(e);break;case"for":r+=this.convFor(e);break;case"foreach":r+=this.convForeach(e);break;case"repeat_times":r+=this.convRepeatTimes(e);break;case"speed_mode":r+=this.convSpeedMode(e,t);break;case"performance_monitor":r+=this.convPerformanceMonitor(e,t);break;case"while":r+=this.convWhile(e);break;case"atohantei":r+=this.convAtohantei(e);break;case"switch":r+=this.convSwitch(e);break;case"let_array":r+=this.convLetArray(e);break;case"ref_array":r+=this.convRefArray(e);break;case"json_array":r+=this.convJsonArray(e);break;case"json_obj":r+=this.convJsonObj(e);break;case"bool":r+=e.value?"true":"false";break;case"null":r+="null";break;case"def_test":r+=this.convDefTest(e);break;case"def_func":r+=this.convDefFunc(e);break;case"func_obj":r+=this.convFuncObj(e);break;case"return":r+=this.convReturn(e);break;case"try_except":r+=this.convTryExcept(e);break;case"require":r+=this.convRequire(e);break;default:throw new Error("System Error: unknown_type="+e.type)}return r}findVar(e,t=null){if(this.varslistSet.length>3&&this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:this.varname_get(e),js_set:this.varname_set(e,String(t))};for(let r=2;r>=0;r--)if(this.varslistSet[r].names.has(e))return{i:r,name:e,isTop:!1,js:`__self.__varslist[${r}].get(${JSON.stringify(e)})`,js_set:`__self.__varslist[${r}].set(${JSON.stringify(e)}, ${t??"undefined"})`};return null}genVar(e,t){let r=this.findVar(e),s=t.line;if(r===null){if(!(e==="\u5F15\u6570"||e==="\u305D\u308C"||e==="\u5BFE\u8C61"||e==="\u5BFE\u8C61\u30AD\u30FC")){if(this.warnUndefinedVar){let o=e.replace(/^main__(.+)$/,"$1");this.__self.getLogger().warn(`\u5909\u6570\u300E${o}\u300F\u306F\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`,t)}}return this.varsSet.names.add(e),this.varname_get(e)}if(r.i===0){let o=this.__self.getNakoFunc(e);if(!o)return`${r.js}/*[link_error]l${s}:${t.file??"unknown"}*/`;if(o.type==="const"||o.type==="var")return r.js;if(o.type==="func"){if(!o.josi||o.josi.length===0)return`(${r.js}())`;throw d.fromNode(`\u300E${e}\u300F\u304C\u8907\u6587\u3067\u4F7F\u308F\u308C\u307E\u3057\u305F\u3002\u5358\u6587\u3067\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002(v1\u975E\u4E92\u63DB)`,t)}throw d.fromNode(`\u300E${e}\u300F\u306F\u95A2\u6570\u3067\u3042\u308A\u53C2\u7167\u3067\u304D\u307E\u305B\u3093\u3002`,t)}return r.js}convGetVar(e){let t=e.value;return this.genVar(t,e)}convBlock(e){let t="";for(let r of e.blocks)t+=this._convGen(r,!1);return t}convComment(e){let t=String(e.comment);t=t.replace(/\n/g,"\xB6");let r=this.convLineno(e,!1);return t===""&&r===""?";":t===""?";"+r+`
|
|
50
50
|
`:";"+r+"//"+t+`
|
|
51
|
-
`}convRunMode(e){let t=e.value,r=!1;return t==="\u53B3\u3057\u304F\u30C1\u30A7\u30C3\u30AF"&&(r=!0),this.warnUndefinedVar=r,this.warnUndefinedReturnUserFunc=r,this.warnUndefinedCallingUserFunc=r,this.warnUndefinedCallingSystemFunc=r,this.warnUndefinedCalledUserFuncArgs=r,`/* \u5B9F\u884C\u30E2\u30FC\u30C9: ${t} */`}convReturn(e){if(this.varsSet.names.has("!\u95A2\u6570"))throw
|
|
51
|
+
`}convRunMode(e){let t=e.value,r=!1;return t==="\u53B3\u3057\u304F\u30C1\u30A7\u30C3\u30AF"&&(r=!0),this.warnUndefinedVar=r,this.warnUndefinedReturnUserFunc=r,this.warnUndefinedCallingUserFunc=r,this.warnUndefinedCallingSystemFunc=r,this.warnUndefinedCalledUserFuncArgs=r,`/* \u5B9F\u884C\u30E2\u30FC\u30C9: ${t} */`}convReturn(e){if(this.varsSet.names.has("!\u95A2\u6570"))throw d.fromNode("\u300E\u623B\u308B\u300F\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u95A2\u6570\u5B9A\u7FA9\u5185\u306E\u307F\u3067\u4F7F\u7528\u53EF\u80FD\u3067\u3059\u3002",e);let t=e.blocks[0],r=this.convLineno(e,!1),s="";if(t.type!=="nop"?s=this._convGen(t,!0):this.speedMode.invalidSore===0&&(s=this.varname_get("\u305D\u308C")),s==="")return r+"return;";if(this.warnUndefinedReturnUserFunc){let i=this.defFuncName?this.defFuncName:"\u7121\u540D\u95A2\u6570",o=this.addConstPool(`\u30E6\u30FC\u30B6\u95A2\u6570\u300E${i}\u300F\u304B\u3089undefined\u304C\u8FD4\u3055\u308C\u3066\u3044\u307E\u3059`,[],e.file,e.line);return r+`return (__self.chk(${s}, ${o}));`}else return r+`return ${s};`}getConstPoolsTemplateId(e){let t=this.constPoolsTemplate.indexOf(e);return t<0&&(t=this.constPoolsTemplate.length,this.constPoolsTemplate[t]=e),t}addConstPool(e,t,r,s){r=String(r);let i=this.getConstPoolsTemplateId(r),o=this.getConstPoolsTemplateId(e),u=[];for(let a of t){let f=""+String(a),l=this.getConstPoolsTemplateId(f);u.push(l)}let c=this.constPools.length;return this.constPools.push([o,u,i,s]),c}convCheckLoop(e,t){if(!this.flagLoop){let r=t==="continue"?"\u7D9A\u3051\u308B":"\u629C\u3051\u308B";throw d.fromNode(`\u300E${r}\u300F\u6587\u304C\u3042\u308A\u307E\u3059\u304C\u3001\u305D\u308C\u306F\u7E70\u308A\u8FD4\u3057\u306E\u4E2D\u3067\u5229\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,e)}return this.convLineno(e)+t+";"}convDefFuncCommon(e,t){this.defFuncName=t;let r=!1,s="",i="";if(this.performanceMonitor.userFunction!==0){let g=t;g||(typeof this.performanceMonitor.mumeiId>"u"&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,g=`anous_${this.performanceMonitor.mumeiId}`),s=`const performanceMonitorEnd = (function (key, type) {
|
|
52
52
|
const uf_start = performance.now() * 1000;
|
|
53
53
|
return function () {
|
|
54
54
|
const el_time = performance.now() * 1000 - uf_start;
|
|
@@ -75,7 +75,7 @@ if(__self.__performance_monitor[key].max_usec<el_time){__self.__performance_moni
|
|
|
75
75
|
`,a+=u+`// POP STACK
|
|
76
76
|
`,a+=u+`self.__vars = __localvars;
|
|
77
77
|
`,a+=`}
|
|
78
|
-
`;let l=Array.from(this.varsSet.names.values()),h="",
|
|
78
|
+
`;let l=Array.from(this.varsSet.names.values()),h="",p=e.meta;if(!p)throw new Error("[System Error] \u95A2\u6570\u306E\u5B9A\u7FA9\u3067\u30E1\u30BF\u60C5\u5831\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093");p.varnames||(p.varnames=[]);for(let g=0;g<p.varnames.length;g++){let m=p.varnames[g];if(m!=="\u5F15\u6570"){if(!this.warnUndefinedCalledUserFuncArgs)h+=u+this.varname_set(m,`arguments[${g}]`)+`;
|
|
79
79
|
`;else{let v=`\u533F\u540D\u95A2\u6570\u306E\u5F15\u6570\u300E${m}\u300F\u306Bundefined\u304C\u6E21\u3055\u308C\u307E\u3057\u305F`;t&&(v=`\u30E6\u30FC\u30B6\u95A2\u6570\u300E${t}\u300F\u306E\u5F15\u6570\u300E${m}\u300F\u306Bundefined\u304C\u6E21\u3055\u308C\u307E\u3057\u305F`);let Z=`${`((a) => { if (a === undefined) { ${`__self.logger.warn('${v}', {line: ${e.line}, file: ${JSON.stringify(e.file)}});`} }; return a; })`}(arguments[${g}])`;h+=u+this.varname_set(m,Z)+`;
|
|
80
80
|
`}this.varsSet.names.add(m)}}if(t&&(this.usedFuncSet.add(t),this.varslistSet[1].names.add(t),this.nakoFuncList.get(t)===void 0)){if(!e.meta)throw new Error("[System Error] \u95A2\u6570\u306E\u5B9A\u7FA9\u3067\u30E1\u30BF\u60C5\u5831\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093");this.nakoFuncList.set(t,{josi:e.meta.josi,fn:()=>{},type:"func",asyncFn:!1,isExport:null}),this.__self.getLogger().warn(`generate\u3067\u672A\u5B9A\u7FA9\u306E\u72B6\u614B\u306E\u95A2\u6570\u300E${t}\u300F\u304C\u52D5\u7684\u306B\u767B\u9332\u3055\u308C\u3066\u3044\u307E\u3059\u3002`)}let _=this.usedAsyncFn;this.usedAsyncFn=!1,this.debugOption.useDebug&&(this.usedAsyncFn=!0);let y=this._convGen(e.blocks[0],!1);if(h+=y.split(`
|
|
81
81
|
`).map(g=>" "+g).join(`
|
|
@@ -84,21 +84,21 @@ if(__self.__performance_monitor[key].max_usec<el_time){__self.__performance_moni
|
|
|
84
84
|
`),h+=i,t&&this.usedAsyncFn){let g=this.nakoFuncList.get(t);g&&(g.asyncFn=!0)}if(r){for(let g of Array.from(this.varsSet.names.values()))l.includes(g)||n.isValidIdentifier(g)&&(o+=` var ${g};
|
|
85
85
|
`);this.speedMode.invalidSore===0&&(n.isValidIdentifier("\u305D\u308C")?o+=` var \u305D\u308C = '';
|
|
86
86
|
`:o+=` ${this.varname_get("\u305D\u308C")} = '';`)}let b=this.usedAsyncFn?mt:_t,k=" "+this.convLineno(e,!0,1)+`
|
|
87
|
-
`;if(h=b+s+c+o+k+h+a,h+=yt,t){let g=this.nakoFuncList.get(t);g&&(g.fn=h,g.asyncFn=this.usedAsyncFn,
|
|
87
|
+
`;if(h=b+s+c+o+k+h+a,h+=yt,t){let g=this.nakoFuncList.get(t);g&&(g.fn=h,g.asyncFn=this.usedAsyncFn,p.asyncFn=this.usedAsyncFn)}return this.usedAsyncFn=_,this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],t&&this.__self.__varslist[1].set(t,h),this.defFuncName="",h}convDefTest(e){let t=e.name,r=`__tests.push({ name: '${t}', f: () => {
|
|
88
88
|
`,s=this._convGen(e.blocks[0],!1);if(r+=` ${s}
|
|
89
|
-
}});`,!e.meta)throw new Error("[System Error] \u30C6\u30B9\u30C8\u306E\u30E1\u30BF\u60C5\u5831\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093");return this.nakoTestFuncs.set(t,{josi:e.meta.josi,fn:r,type:"test_func"}),""}convDefFunc(e){if(!e.name)return"";let t=n.getFuncName(e.name);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return"/*convFuncObj*/"+this.convDefFuncCommon(e,"")}convJsonObj(e){let t=[],r=e.blocks;for(let s=0;s<r.length/2;s++){let i=s*2,o=r[i+0],u=r[i+1],c=this._convGen(o,!0),a=this._convGen(u,!0);t.push(`${c}: ${a}`)}return"{"+t.join(", ")+"}"}convJsonArray(e){return"["+e.blocks.map(s=>this._convGen(s,!0)).join(",")+"]"}convRefArray(e){let t="";if(e.name==="__ARRAY__"){let s=e.index?.shift();s?t=this._convGen(s,!0):t="[]"}else t=this._convGen(e.name,!0);let r=e.index;if(!r)return t;for(let s=0;s<r.length;s++){let i=this._convGen(r[s],!0);t+="["+i+"]"}return t}convLetArray(e){let t=this.loopId++,r=e.blocks[0],s=e.blocks.slice(1),i=this.genVar(e.name,e),o="",u=i,c="";if(e.checkInit){let l="[0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0]";if(e.name){let h=e.name,
|
|
89
|
+
}});`,!e.meta)throw new Error("[System Error] \u30C6\u30B9\u30C8\u306E\u30E1\u30BF\u60C5\u5831\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093");return this.nakoTestFuncs.set(t,{josi:e.meta.josi,fn:r,type:"test_func"}),""}convDefFunc(e){if(!e.name)return"";let t=n.getFuncName(e.name);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return"/*convFuncObj*/"+this.convDefFuncCommon(e,"")}convJsonObj(e){let t=[],r=e.blocks;for(let s=0;s<r.length/2;s++){let i=s*2,o=r[i+0],u=r[i+1],c=this._convGen(o,!0),a=this._convGen(u,!0);t.push(`${c}: ${a}`)}return"{"+t.join(", ")+"}"}convJsonArray(e){return"["+e.blocks.map(s=>this._convGen(s,!0)).join(",")+"]"}convRefArray(e){let t="";if(e.name==="__ARRAY__"){let s=e.index?.shift();s?t=this._convGen(s,!0):t="[]"}else t=this._convGen(e.name,!0);let r=e.index;if(!r)return t;for(let s=0;s<r.length;s++){let i=this._convGen(r[s],!0);t+="["+i+"]"}return t}convLetArray(e){let t=this.loopId++,r=e.blocks[0],s=e.blocks.slice(1),i=this.genVar(e.name,e),o="",u=i,c="";if(e.checkInit){let l="[0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0]";if(e.name){let h=e.name,p=`$nako_tmp_a${t}`,_=this.varname_set(h,l);o+=`
|
|
90
90
|
/*\u914D\u5217\u521D\u671F\u5316*/if (!(${i} instanceof Array)) { ${_} };
|
|
91
|
-
`,o+=`${
|
|
91
|
+
`,o+=`${p} = ${i};
|
|
92
92
|
`;for(let y=0;y<s.length-1;y++){let b=this._convGen(s[y],!0);c+=`[${b}]`,o+=`
|
|
93
|
-
/*\u914D\u5217\u521D\u671F\u5316${y}*/if (!(${
|
|
94
|
-
`}}for(let l=0;l<s.length;l++){let h=this._convGen(s[l],!0);u+="["+h+"]"}let a=null;if(this.speedMode.invalidSore===0&&(a=this.varname_get("\u305D\u308C")),r.type!=="nop"&&(a=this._convGen(r,!0)),a==null)throw
|
|
95
|
-
`,this.convLineno(e,!1)+o+u}convGenLoop(e){let t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t=e.blocks[0],r=e.blocks[1],s=e.blocks[2],i=e.blocks[3],o=this.loopId++,u=`$nako_i${o}`,c="";if(e.word!==""){let $=e.word;this.varsSet.names.add($),c=this.varname_set($,u)}let a=`$nako_from${o}`,f=`$nako_to${o}`,l=`$nako_temp${o}`,h="";this.speedMode.invalidSore===0&&(h=this.varname_set("\u305D\u308C",u));let
|
|
93
|
+
/*\u914D\u5217\u521D\u671F\u5316${y}*/if (!(${p}${c} instanceof Array)) { ${p}${c} = ${l}; };`}o+=`
|
|
94
|
+
`}}for(let l=0;l<s.length;l++){let h=this._convGen(s[l],!0);u+="["+h+"]"}let a=null;if(this.speedMode.invalidSore===0&&(a=this.varname_get("\u305D\u308C")),r.type!=="nop"&&(a=this._convGen(r,!0)),a==null)throw d.fromNode("\u4EE3\u5165\u3059\u308B\u5148\u306E\u5909\u6570\u540D\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);return u+=" = "+a+`;
|
|
95
|
+
`,this.convLineno(e,!1)+o+u}convGenLoop(e){let t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t=e.blocks[0],r=e.blocks[1],s=e.blocks[2],i=e.blocks[3],o=this.loopId++,u=`$nako_i${o}`,c="";if(e.word!==""){let $=e.word;this.varsSet.names.add($),c=this.varname_set($,u)}let a=`$nako_from${o}`,f=`$nako_to${o}`,l=`$nako_temp${o}`,h="";this.speedMode.invalidSore===0&&(h=this.varname_set("\u305D\u308C",u));let p="0",_="0",y="0";r&&r.type==="func"&&r.name==="\u7BC4\u56F2"?(y=this._convGen(r,!0),p=`${l}['\u5148\u982D'] || 0`,_=`${l}['\u672B\u5C3E'] || 0`):(p=this._convGen(t,!0),_=this._convGen(r,!0));let b=e.flagDown,k=e.flagUp,g="1";s.type!=="nop"&&(g=this._convGen(s,!0));let m=this.convGenLoop(i);return this.convLineno(e,!1)+`
|
|
96
96
|
/*[convFor id=${o}]*/
|
|
97
97
|
const ${l} = ${y};
|
|
98
|
-
const ${a} = ${
|
|
98
|
+
const ${a} = ${p};
|
|
99
99
|
const ${f} = ${_};
|
|
100
100
|
if (${a} <= ${f}) { // up
|
|
101
|
-
if (${k}) { for (let ${u} = ${a}; ${u} <= ${f}; ${u}+= ${g}) {
|
|
101
|
+
if (${String(k)}) { for (let ${u} = ${a}; ${u} <= ${f}; ${u}+= ${g}) {
|
|
102
102
|
${h};${c}
|
|
103
103
|
// for block begin
|
|
104
104
|
${m}
|
|
@@ -106,7 +106,7 @@ if (${a} <= ${f}) { // up
|
|
|
106
106
|
};
|
|
107
107
|
};
|
|
108
108
|
} else { // down
|
|
109
|
-
if (${b}) { for (let ${u} = ${a}; ${u} >= ${f}; ${u}-= ${g}) {
|
|
109
|
+
if (${String(b)}) { for (let ${u} = ${a}; ${u} >= ${f}; ${u}-= ${g}) {
|
|
110
110
|
${h};${c}
|
|
111
111
|
// for block begin
|
|
112
112
|
${m}
|
|
@@ -115,7 +115,7 @@ if (${a} <= ${f}) { // up
|
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
117
|
//[/convFor id=${o}]
|
|
118
|
-
`}convForeach(e){let t=e.blocks[0],r=e.blocks[1],s=this.loopId++,i=`$nako_i${s}`,o=`$nako_foreach_value${s}`,u=`$nako_foreach_data${s}`,c=`$nako_taisyou_temp${s}`,a=`$nako_taisyou_key_temp${s}`,f=`$nako_foreach_sore_temp${s}`,l=this.varname_set_sys("\u5BFE\u8C61",o);if(e.word!==""){let v=e.word;this.varsSet.names.add(v),l=this.varname_set(v,o)}let
|
|
118
|
+
`}convForeach(e){let t=e.blocks[0],r=e.blocks[1],s=this.loopId++,i=`$nako_i${s}`,o=`$nako_foreach_value${s}`,u=`$nako_foreach_data${s}`,c=`$nako_taisyou_temp${s}`,a=`$nako_taisyou_key_temp${s}`,f=`$nako_foreach_sore_temp${s}`,l=this.varname_set_sys("\u5BFE\u8C61",o);if(e.word!==""){let v=e.word;this.varsSet.names.add(v),l=this.varname_set(v,o)}let p=this.varname_set_sys("\u5BFE\u8C61\u30AD\u30FC",i),_="",y="",b="";this.speedMode.invalidSore===0&&(_=this.varname_set("\u305D\u308C",o),y=this.varname_set("\u305D\u308C",f),b=`let ${f} = `+this.varname_get("\u305D\u308C")+";");let k="";if(t.type==="nop")if(this.speedMode.invalidSore===0)k=this.varname_get("\u305D\u308C");else throw d.fromNode("\u300E\u53CD\u5FA9\u300F\u306E\u5BFE\u8C61\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);else k=this._convGen(t,!0);let g=I(P(this.convGenLoop(r),1));return this.convLineno(e,!1)+`
|
|
119
119
|
// [convForeach id=${s}]
|
|
120
120
|
const ${c} = __self.__getSysVar('\u5BFE\u8C61'); ${b}; const ${a} = __self.__getSysVar('\u5BFE\u8C61\u30AD\u30FC');
|
|
121
121
|
let ${u} = ${k};
|
|
@@ -127,7 +127,7 @@ if (${u} instanceof Map) { // Object\u306B\u5F37\u5236\u5909\u63DB
|
|
|
127
127
|
for (let ${i} in ${u}) {
|
|
128
128
|
if (!${u}.hasOwnProperty(${i})) { continue }
|
|
129
129
|
// \u5BFE\u8C61\u30AD\u30FC\u306E\u8A2D\u5B9A
|
|
130
|
-
${
|
|
130
|
+
${p}
|
|
131
131
|
// \u5BFE\u8C61\u306E\u8A2D\u5B9A
|
|
132
132
|
let ${o} = $nako_foreach_data${s}[${i}]
|
|
133
133
|
${_};
|
|
@@ -137,7 +137,7 @@ for (let ${i} in ${u}) {
|
|
|
137
137
|
// [/convForeach::block]
|
|
138
138
|
}
|
|
139
139
|
__self.__setSysVar('\u5BFE\u8C61', ${c});${y};__self.__setSysVar('\u5BFE\u8C61\u30AD\u30FC', ${a});// [/convForeach id=${s}]
|
|
140
|
-
`}convRepeatTimes(e){let t=this.loopId++,r=`$nako_i${t}`,s=`$nako_times_data${t}`,i=`$nako_kaisu_temp${t}`,o=this._convGen(e.blocks[0],!0),u=I(
|
|
140
|
+
`}convRepeatTimes(e){let t=this.loopId++,r=`$nako_i${t}`,s=`$nako_times_data${t}`,i=`$nako_kaisu_temp${t}`,o=this._convGen(e.blocks[0],!0),u=I(P(this.convGenLoop(e.blocks[1]),1)),c="",a="";return this.speedMode.invalidSore===0&&(c=this.varname_set("\u305D\u308C",r),a=this.varname_set("\u305D\u308C",i)),c+=`;__self.__setSysVar('\u56DE\u6570', ${r});`,a+=`;__self.__setSysVar('\u56DE\u6570', ${i});`,this.convLineno(e,!1)+`
|
|
141
141
|
// [convRepeatTimes id=${t}] // \u300En\u56DE\u300F\u69CB\u6587
|
|
142
142
|
let ${i} = __self.__getSysVar('\u56DE\u6570')
|
|
143
143
|
let ${s} = ${o};
|
|
@@ -147,7 +147,7 @@ for (let ${r} = 1; ${r} <= ${s}; ${r}++) {
|
|
|
147
147
|
}
|
|
148
148
|
${a}
|
|
149
149
|
// [/convRepeatTimes id=${t}]
|
|
150
|
-
`}convSpeedMode(e,t){if(!e.options)return"";let r={...this.speedMode};e.options.\u884C\u756A\u53F7\u7121\u3057&&this.speedMode.lineNumbers++,e.options.\u6697\u9ED9\u306E\u578B\u5909\u63DB\u7121\u3057&&this.speedMode.implicitTypeCasting++,e.options.\u5F37\u5236\u30D4\u30E5\u30A2&&this.speedMode.forcePure++,e.options.\u305D\u308C\u7121\u52B9&&this.speedMode.invalidSore++;try{return this._convGen(e.blocks[0],t)}finally{this.speedMode=r}}convPerformanceMonitor(e,t){let r={...this.performanceMonitor};if(!e.options)return"";e.options.\u30E6\u30FC\u30B6\u95A2\u6570&&this.performanceMonitor.userFunction++,e.options.\u30B7\u30B9\u30C6\u30E0\u95A2\u6570\u672C\u4F53&&this.performanceMonitor.systemFunctionBody++,e.options.\u30B7\u30B9\u30C6\u30E0\u95A2\u6570&&this.performanceMonitor.systemFunction++;try{return this._convGen(e.blocks[0],t)}finally{this.performanceMonitor=r}}convWhile(e){let t=e.blocks[0],r=e.blocks[1],s=this._convGen(t,!0),i=I(
|
|
150
|
+
`}convSpeedMode(e,t){if(!e.options)return"";let r={...this.speedMode};e.options.\u884C\u756A\u53F7\u7121\u3057&&this.speedMode.lineNumbers++,e.options.\u6697\u9ED9\u306E\u578B\u5909\u63DB\u7121\u3057&&this.speedMode.implicitTypeCasting++,e.options.\u5F37\u5236\u30D4\u30E5\u30A2&&this.speedMode.forcePure++,e.options.\u305D\u308C\u7121\u52B9&&this.speedMode.invalidSore++;try{return this._convGen(e.blocks[0],t)}finally{this.speedMode=r}}convPerformanceMonitor(e,t){let r={...this.performanceMonitor};if(!e.options)return"";e.options.\u30E6\u30FC\u30B6\u95A2\u6570&&this.performanceMonitor.userFunction++,e.options.\u30B7\u30B9\u30C6\u30E0\u95A2\u6570\u672C\u4F53&&this.performanceMonitor.systemFunctionBody++,e.options.\u30B7\u30B9\u30C6\u30E0\u95A2\u6570&&this.performanceMonitor.systemFunction++;try{return this._convGen(e.blocks[0],t)}finally{this.performanceMonitor=r}}convWhile(e){let t=e.blocks[0],r=e.blocks[1],s=this._convGen(t,!0),i=I(P(this.convGenLoop(r),1));return`// [convWhile]
|
|
151
151
|
`+this.convLineno(e,!1)+`
|
|
152
152
|
while (${s}){
|
|
153
153
|
${i}
|
|
@@ -169,7 +169,7 @@ ${s}
|
|
|
169
169
|
${r}
|
|
170
170
|
}
|
|
171
171
|
// [/switch]
|
|
172
|
-
`;return this.convLineno(e,!1)+i}convIf(e){let t=e.blocks[0],r=e.blocks[1],s=e.blocks[2],i=this._convGen(t,!0),o=I(
|
|
172
|
+
`;return this.convLineno(e,!1)+i}convIf(e){let t=e.blocks[0],r=e.blocks[1],s=e.blocks[2],i=this._convGen(t,!0),o=I(P(this._convGen(r,!1),1)),u=I(P(this._convGen(s,!1),1)),c=`// [convIf]
|
|
173
173
|
`+this.convLineno(e,!1)+`
|
|
174
174
|
if (${i}) {
|
|
175
175
|
${o}
|
|
@@ -178,7 +178,7 @@ if (${i}) {
|
|
|
178
178
|
}
|
|
179
179
|
`),c+=`
|
|
180
180
|
// [/convIf]
|
|
181
|
-
`,c}convFuncGetArgsCalcType(e,t,r){let s=[],i={},o=r.blocks?r.blocks:[];for(let u=0;u<o.length;u++){let c=o[u];if(u===0&&c===null&&this.speedMode.invalidSore===0)s.push(this.varname_get("\u305D\u308C")),i.sore=!0;else{let a=this._convGen(c,!0);a===""&&(a="undefined"),typeof a!="string"&&(a="undefined"),s.push(`/*arg${u}*/${a}`)}}return[s,i]}getPluginList(){let e=[];for(let t in this.__self.__module)e.push(t);return e}convCallFunc(e,t){let r=n.getFuncName(e.name),s=this.findVar(r);if(s===null)throw
|
|
181
|
+
`,c}convFuncGetArgsCalcType(e,t,r){let s=[],i={},o=r.blocks?r.blocks:[];for(let u=0;u<o.length;u++){let c=o[u];if(u===0&&c===null&&this.speedMode.invalidSore===0)s.push(this.varname_get("\u305D\u308C")),i.sore=!0;else{let a=this._convGen(c,!0);a===""&&(a="undefined"),typeof a!="string"&&(a="undefined"),s.push(`/*arg${u}*/${a}`)}}return[s,i]}getPluginList(){let e=[];for(let t in this.__self.__module)e.push(t);return e}convCallFunc(e,t){let r=n.getFuncName(e.name),s=this.findVar(r);if(s===null)throw d.fromNode(`\u95A2\u6570\u300E${r}\u300F\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002\u6709\u52B9\u30D7\u30E9\u30B0\u30A4\u30F3=[`+this.getPluginList().join(", ")+"]",e);let i;if(s.i===0){if(i=this.__self.getFunc(r),!i)throw new Error(`[System Error] \u95A2\u6570\u300C${r}\u300DNakoCompiler.nakoFuncList \u306E\u4E0D\u6574\u5408\u304C\u3042\u308A\u307E\u3059\u3002`);if(i.type!=="func")throw d.fromNode(`\u300E${r}\u300F\u306F\u95A2\u6570\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002`,e)}else i=this.nakoFuncList.get(r),i===void 0&&(i={return_none:!1,asyncFn:!!e.asyncFn});if(e.type==="func_pointer")return s.js;let o=this.convFuncGetArgsCalcType(r,i,e),u=o[0],c=o[1];if(this.usedFuncSet.add(r),r==="\u540D\u524D\u7A7A\u9593\u8A2D\u5B9A")return`
|
|
182
182
|
// --- \u540D\u524D\u7A7A\u9593(${u[0]}) ---
|
|
183
183
|
__self.__varslist[0].get('\u540D\u524D\u7A7A\u9593\u8A2D\u5B9A')(${u[0]}, __self);__self.__modName=${u[0]};
|
|
184
184
|
`;if(r==="\u30D7\u30E9\u30B0\u30A4\u30F3\u540D\u8A2D\u5B9A")return`
|
|
@@ -192,7 +192,7 @@ __self.__varslist[0].get('\u30D7\u30E9\u30B0\u30A4\u30F3\u540D\u8A2D\u5B9A')(${u
|
|
|
192
192
|
`;for(let g of k)g.js!=="\u305D\u308C"&&(l+=`__self.__varslist[2].set(${g.str}, __self.__locals[${g.str}]);
|
|
193
193
|
`)}}c.sore&&(f+="/*[sore]*/");let h=(k,g)=>{let m="";for(let v of k.split(`
|
|
194
194
|
`))v!==""&&(m+=" ".repeat(g)+v+`
|
|
195
|
-
`);return m},
|
|
195
|
+
`);return m},p={TYPEOF:!0,\u5909\u6570\u578B\u78BA\u8A8D:!0},_;if(!this.warnUndefinedCallingUserFunc&&s.i!==0||!this.warnUndefinedCallingSystemFunc&&s.i===0)_=u.join(",");else{let k=[];u.forEach(g=>{if(g==="__self"||p[r]===!0)k.push(`${g}`);else{let m=s.i===0?"\u547D\u4EE4\u300E$0\u300F\u306E\u5F15\u6570\u306Bundefined\u3092\u6E21\u3057\u3066\u3044\u307E\u3059\u3002":"\u30E6\u30FC\u30B6\u547D\u4EE4\u300E$0\u300F\u306E\u5F15\u6570\u306Bundefined\u3092\u6E21\u3057\u3066\u3044\u307E\u3059\u3002",v=this.addConstPool(m,[r],e.file,e.line),$=g===""?'""':g;k.push(`(__self.chk(${$}, ${v}))`)}}),_=k.join(", ")}let y=`${s.js}(${_})`;if(i.asyncFn){a=`async ${a}`,y=`await ${y}`,this.numAsyncFn++,this.usedAsyncFn=!0;let k=`$nako_i${this.loopId}`;this.loopId++,f+=`const __local_async${k} = __self.__vars;
|
|
196
196
|
`,l+=`__self.__vars = __local_async${k};
|
|
197
197
|
`}if(s.i===0&&this.performanceMonitor.systemFunctionBody!==0){let k=r;k||(typeof this.performanceMonitor.mumeiId>"u"&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,k=`anous_${this.performanceMonitor.mumeiId}`),y=`(${a} (key, type) {
|
|
198
198
|
const sbf_start = performance.now() * 1000;
|
|
@@ -250,21 +250,21 @@ if(__self.__performance_monitor[key].max_usec<sl_time){__self.__performance_moni
|
|
|
250
250
|
`,o+=`${r} = Number(${u}) + Number(${s});
|
|
251
251
|
`,o+=`${c}
|
|
252
252
|
`,o+=`/*[/convInc]*/
|
|
253
|
-
`,o}convLet(e){let t=e.blocks[0],r=null;if(this.speedMode.invalidSore===0&&(r=this.varname_get("\u305D\u308C")),t){if(t.type==="func"&&t.name!==void 0){let u=t,c=this.__self.getFunc(u.name);if(c&&c.return_none)throw
|
|
254
|
-
`}convLetProp(e){if(!e.index||e.index.length
|
|
255
|
-
`}convRefProp(e){let t=this._convGen(e.name,!0),r=e.index;if(!r||r.length<=0)throw
|
|
253
|
+
`,o}convLet(e){let t=e.blocks[0],r=null;if(this.speedMode.invalidSore===0&&(r=this.varname_get("\u305D\u308C")),t){if(t.type==="func"&&t.name!==void 0){let u=t,c=this.__self.getFunc(u.name);if(c&&c.return_none)throw d.fromNode(`\u95A2\u6570\u300E${t.name}\u300F\u306F\u623B\u308A\u5024\u304C\u306A\u3044\u306E\u3067\u7D50\u679C\u3092\u4EE3\u5165\u3067\u304D\u307E\u305B\u3093\u3002`,e)}r=this._convGen(t,!0)}if(r==null)throw d.fromNode("\u4EE3\u5165\u3059\u308B\u5148\u306E\u5909\u6570\u540D\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);let s=e.name,i=this.findVar(s,r),o="/*[convLet]*/";if(i===null)this.varsSet.names.add(s),o=`${this.varname_set(s,r)};`;else{if(this.varslistSet[i.i].readonly.has(s))throw d.fromNode(`\u5B9A\u6570\u300E${s}\u300F\u306F\u65E2\u306B\u5B9A\u7FA9\u6E08\u307F\u306A\u306E\u3067\u3001\u5024\u3092\u4EE3\u5165\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002`,e);o=`${i.js_set};`}return";"+this.convLineno(e,!1)+o+`
|
|
254
|
+
`}convLetProp(e){if(!e.index||e.index.length===0)throw d.fromNode("\u4EE3\u5165\u3059\u308B\u5148\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u540D\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);if(!e.blocks||e.blocks.length===0)throw d.fromNode("\u4EE3\u5165\u3059\u308B\u5024\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);let t=e.index,r=t.pop();if(r===void 0)throw d.fromNode("\u4EE3\u5165\u3059\u308B\u5148\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u540D\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);let s=typeof r.value=="string"?r.value:"",i=e.blocks[0],o=null;if(i)o=this._convGen(i,!0);else throw d.fromNode("\u4EE3\u5165\u3059\u308B\u5024\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);let u=e.name,c=this.findVar(u,o),a="/*[convLetProp]*/";if(c===null)throw d.fromNode(`\u5909\u6570\u300E${u}\u300F\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002`,e);let f=c.js;if(t.length>0)for(let l of t)if(typeof l.value=="string")f+=`['${l.value}']`;else throw d.fromNode(`\u5909\u6570\u300E${f}\u300F\u4EE5\u4E0B\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\u3002`,e);return a+=`if (typeof ${f}.__setProp === 'function') { ${f}.__setProp('${s}', ${o}, __self); } else {`,a+=`__self.__checkPropAccessor('set', ${f});`,a+=`if (typeof ${f}.__setProp === 'function') { ${f}.__setProp('${s}', ${o}, __self); } else {`,a+=`${f}['${s}'] = ${o} }};`,";"+this.convLineno(e,!1)+a+`
|
|
255
|
+
`}convRefProp(e){let t=this._convGen(e.name,!0),r=e.index;if(!r||r.length<=0)throw d.fromNode("\u30D7\u30ED\u30D1\u30C6\u30A3\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);let s,i=r;if(i.length<=1){let o=i[0].value,u=`${t}.__getProp('${o}', __self)`,c=`${t}['${o}']`,a=`__self.__checkPropAccessor('get', ${t});
|
|
256
256
|
if (typeof ${t}.__getProp === 'function') { return ${u} }
|
|
257
257
|
return ${c}
|
|
258
258
|
`;s=`( (()=>{ ${`if (${t}.__getProp) { return ${u} } else { ${a} }`} })() )`}else{let o=[],u=[];for(let _=0;_<i.length;_++){let y=i[_].value;u.push(`['${y}']`),o.push(`'${y}'`)}let c=u.join(""),a="["+o.join(",")+"]",f=`${t}.__getProp(${a}, __self)`,l=`${t}${c}`,h=`__self.__checkPropAccessor('get', ${t});
|
|
259
259
|
if (${t}.__getProp) { return ${f} }
|
|
260
260
|
return ${l}
|
|
261
|
-
`;s=`( (()=>{ ${`if (${t}.__getProp) { return ${f} } else { ${h} }`} })() )`}return s}convDefLocalVar(e){let t=e.blocks[0],r="0";t.type!=="nop"&&(r=this._convGen(t,!0));let s=e.name,i=e.vartype;if(this.varsSet.names.has(s))throw
|
|
261
|
+
`;s=`( (()=>{ ${`if (${t}.__getProp) { return ${f} } else { ${h} }`} })() )`}return s}convDefLocalVar(e){let t=e.blocks[0],r="0";t.type!=="nop"&&(r=this._convGen(t,!0));let s=e.name,i=e.vartype;if(this.varsSet.names.has(s))throw d.fromNode(`${i}\u300E${s}\u300F\u306E\u4E8C\u91CD\u5B9A\u7FA9\u306F\u3067\u304D\u307E\u305B\u3093\u3002`,e);this.varsSet.names.add(s),i==="\u5B9A\u6570"&&this.varsSet.readonly.add(s);let o=`/*${i}*/${this.varname_set(s,r)};
|
|
262
262
|
`;return this.convLineno(e,!1)+o}convDefLocalVarlist(e){let t="",r=e.vartype,s="0";if(e.blocks.length>0){let c=e.blocks[0];c.type!=="nop"&&(s=this._convGen(c,!0))}let o=`$nako_i${this.loopId++}`;t+=`let ${o} = ${s}
|
|
263
263
|
`,t+=`if (!(${o} instanceof Array)) { ${o}=[${o}] }
|
|
264
264
|
`;let u=e.names?e.names:[];for(let c=0;c<u.length;c++){let f=u[c].value;this.varsSet.names.has(f),this.varsSet.names.add(f),r==="\u5B9A\u6570"&&this.varsSet.readonly.add(f),t+=this.varname_set(f,`${o}[${c}]`)+`;
|
|
265
265
|
`}return this.convLineno(e,!1)+`/*[convDefLocalVarlist]*/
|
|
266
266
|
`+t+`/*[/convDefLocalVarlist]*/
|
|
267
|
-
`}convString(e){let t=
|
|
267
|
+
`}convString(e){let t=String(e.value);return t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),'"'+t+'"'}convTryExcept(e){let t=this._convGen(e.blocks[0],!1),r=this._convGen(e.blocks[1],!1);return this.convLineno(e,!1)+`try {
|
|
268
268
|
${t}
|
|
269
269
|
} catch (e) {
|
|
270
270
|
__self.__setSysVar("\u30A8\u30E9\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8", e.message);
|
|
@@ -357,7 +357,7 @@ __codeJS__
|
|
|
357
357
|
// -----------------------------------------------------------------
|
|
358
358
|
// </nadesiko3standalone>
|
|
359
359
|
// -----------------------------------------------------------------
|
|
360
|
-
`;function Te(n,e,t){let r=new me(n);r.registerFunction(e);let s=I(
|
|
360
|
+
`;function Te(n,e,t){let r=new me(n);r.registerFunction(e);let s=I(P(r.convGen(e,t),1)),i=r.getDefFuncCode(n,t),o=String(new Date().getTime())+"_"+Math.floor(4294967295*Math.random()).toString();if(s&&t.isTest&&(s+=`
|
|
361
361
|
__self._runTests(__tests);
|
|
362
362
|
`),r.numAsyncFn>0||r.debugOption.useDebug){let l="__eval_nako3async_"+o+"__";s=`
|
|
363
363
|
// ------------------------------------------------------------------
|
|
@@ -407,7 +407,7 @@ ${l}(__self)
|
|
|
407
407
|
// ------------------------------------------------------------------
|
|
408
408
|
// </nadesiko3::gen::syncMode>
|
|
409
409
|
// ------------------------------------------------------------------
|
|
410
|
-
`}s=
|
|
410
|
+
`}s=P(s);let u="",c=[];for(let l of t.importFiles){if(l==="nako_errors.mjs")continue;let h="nako3runtime_"+l.replace(/\.(js|mjs)$/,"").replace(/[^a-zA-Z0-9_]/g,"_");c.push(h),u+=`import ${h} from './nako3runtime/${l}'
|
|
411
411
|
`}let a=r.getPluginInitCode(),f=`
|
|
412
412
|
// <runtimeEnvCode>
|
|
413
413
|
const self = this
|
|
@@ -418,37 +418,37 @@ ${s}
|
|
|
418
418
|
// </runtimeEnvCode>
|
|
419
419
|
`;return n.getLogger().trace(`--- generate::jsInit ---
|
|
420
420
|
`+i),n.getLogger().trace(`--- generate::js ---
|
|
421
|
-
`+s),{runtimeEnv:f,standalone:bt(gt,{codeImportFiles:u,coreVersion:n.coreVersion,version:n.version,importNames:"["+c.join(", ")+"]",codeStandalone:t.codeStandalone,codeJS:s,jsInit:i}),gen:r}}function bt(n,e){for(let t in e){let r=`__${t}__`,s=e[t];n=n.split(r).join(s)}return n}function
|
|
421
|
+
`+s),{runtimeEnv:f,standalone:bt(gt,{codeImportFiles:u,coreVersion:n.coreVersion,version:n.version,importNames:"["+c.join(", ")+"]",codeStandalone:t.codeStandalone,codeJS:s,jsInit:i}),gen:r}}function bt(n,e){for(let t in e){let r=`__${t}__`,s=e[t];n=n.split(r).join(s)}return n}function P(n,e=0){n=n.replace(/;{2,}/g,";"),n=n.replace(/\n{2,}/g,`
|
|
422
422
|
`);let t="";for(let i=0;i<e;i++)t+=" ";let r=[],s=n.split(`
|
|
423
423
|
`);for(let i=0;i<s.length;i++){let o=s[i];o=o.replace(/^(\s*);/,"$1"),I(o)!==""&&r.push(t+o)}return n=r.join(`
|
|
424
424
|
`),n}function I(n){return n=String(n),n.replace(/^\s+|\s+$/g,"")}function ue(n){let e=[];for(let t=0;t<n.length;t++){let r=n[t],s=r.type,i=r.value,o=`[${s}:${i}]`;s===i&&(o=s),s==="comma"&&(o=","),s==="string"&&(o=`"${i}"`),s==="number"&&(o=`(${i})`),s==="word"&&(o=`[word:${i}]`),e[r.line]||(e[r.line]=kt(r.indent)),e[r.line]+=o+r.josi+"|"}return e.join(`
|
|
425
|
-
`)}function kt(n){let e="";for(let t=0;t<n;t++)e+=" ";return e}var oe=j();function w(n,e,t=void 0){return t&&(oe=t),j(n,e,oe.indent,oe.line,oe.file)}var vt=!1;function Ve(n){return n.type==="\u9055\u3048\u3070"||n.type==="word"&&n.value==="\u30A8\u30E9\u30FC"&&n.josi==="\u306A\u3089\u3070"}function Ie(n){let e=z(n,"eol"),t=[],r=-1,s=0,i=0,o=c=>{c.forEach(a=>{a.type==="{"&&s++,a.type==="}"&&s--,a.type==="["&&i++,a.type==="]"&&i--})};for(let c=0;c<e.length;c++){let a=e[c];if(
|
|
426
|
-
`,
|
|
427
|
-
`,c))}let u=q(e);return vt&&console.log("###",ue(u)),u}function q(n){let e=[];for(let t of n)for(let r of t)e.push(r);return e}function wt(n){let e=n.length;if(e===0)return j("?");let t=n[e-1];return t.type==="eol"&&e>=2&&(t=n[e-2]),t}function z(n,e){let t=[],r=[],s=0;for(let i of n)r.push(i),i.type==="{"?s++:i.type==="}"?s--:s===0&&i.type===e&&(t.push(r),r=[]);return r.length>0&&t.push(r),t}function
|
|
428
|
-
`,
|
|
429
|
-
`,a))}return q(i)}function jt(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&St.indexOf(t.value)>=0)return!0}return!1}var xt=["!DNCL\u30E2\u30FC\u30C9","\u{1F4A1}DNCL\u30E2\u30FC\u30C9"],$t={"\u2190:\u2190":["eq","="],"\xF7:\xF7":["\xF7\xF7","\xF7\xF7"],"{:{":["[","["],"}:}":["]","]"],"word:\u3092\u5B9F\u884C":["\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067"],"word:\u4E71\u6570":["word","\u4E71\u6570\u7BC4\u56F2"],"word:\u8868\u793A":["word","\u9023\u7D9A\u8868\u793A"]};function Ge(n){if(!At(n))return n;let e=z(n,"eol");for(let t=0;t<e.length;t++){let r=e[t];if(r.length<=1)continue;for(let a=0;a<r.length;a++){if(r[a].type==="|"){r[a].type="range_comment";continue}break}let s=r[0];s.type==="word"&&s.value==="\u7E70\u8FD4"&&r.splice(0,r.length,j("word","\u5F8C\u5224\u5B9A",s.indent,s.line,s.file),j("word","\u7E70\u8FD4",s.indent,s.line,s.file));let i=F(r,["word:\u306A\u308B","word:\u7E70\u8FD4"]);i>0&&Re(r,i);let o=F(r,["word:\u306A\u308B","word:\u5B9F\u884C"]);o>0&&Re(r,o);let u=F(r,["word:\u306A\u3044"]);for(u>=1&&r[u].josi==="\u306A\u3089\u3070"&&(r[u-1].josi="\u3067\u306A\u3051\u308C\u3070",r.splice(u,1));;){let a=F(r,["word:\u4E8C\u9032","word:\u8868\u793A"]);if(a<0)break;r[a].value="\u4E8C\u9032\u8868\u793A",r[a].josi="",r.splice(a+1,1)}for(;;){let a=F(r,["word:\u6539\u884C","word:\u8868\u793A"]);if(a<0)break;let f=r[a];f.value="\u9023\u7D9A\u7121\u6539\u884C\u8868\u793A",f.josi="",r.splice(a+1,1)}for(;;){let a=F(r,["word:\u3092\u5B9F\u884C","comma:,","word:\u305D\u3046"]);if(a<0)break;let f=r[a+2];if(f.josi==="\u3067\u306A\u3051\u308C\u3070"){f.type="\u9055\u3048\u3070",f.value="\u9055\u3048\u3070",f.josi="",r.splice(a,3,f);continue}else if(f.josi==="\u3067"){let l=r[a+3];if(l.value.substring(0,4)==="\u306A\u304F\u3082\u3057"){if(f.type="\u9055\u3048\u3070",f.value="\u9055\u3048\u3070",f.josi="",r.splice(a,3,f),l.value.length>4){let h=l.value.substring(4),d=j("word",h,l.indent,l.line,l.file);h.match(/^\d/)&&(d.type="number"),r.splice(a+2,0,d),l.value=l.value.substring(0,4)}l.type="\u3082\u3057",l.value="\u3082\u3057",l.josi="";continue}}break}for(;;){let a=F(r,["word:\u5897","word:\u3089"]);if(a<0)break;let f=r[a];f.type="word",f.value="\u5897\u7E70\u8FD4",f.josi="",r.splice(a,2,f)}for(;;){let a=F(r,["word:\u6E1B","word:\u3089"]);if(a<0)break;let f=r[a];f.type="word",f.value="\u6E1B\u7E70\u8FD4",f.josi="",r.splice(a,2,f)}for(;;){let a=F(r,["word:\u3092\u7E70\u308A\u8FD4"]);if(a<0)break;let f=r[a];f.type="\u3053\u3053\u307E\u3067",f.value="\u3053\u3053\u307E\u3067",f.josi=""}for(;;){let a=F(r,["word:\u3059\u3079\u3066","word:\u8981\u7D20"]);if(a>=1)Je(r,a);else break}for(;;){let a=F(r,["word:\u3059\u3079\u3066","word:\u5024"]);if(a>=1)Je(r,a);else break}let c=0;for(;c<r.length;){let a=r[c];if(a.type==="word"&&a.value.length>=2){let f=a.value.charAt(a.value.length-1);(f==="\u6E1B"||f==="\u5897")&&(a.value=a.value.substring(0,a.value.length-1),a.josi="\u3060\u3051",r.splice(c+1,0,j("word",f,a.indent,a.line,a.file))),c++;continue}c++}}for(let t=0;t<n.length;t++){let r=n[t],s=$t[r.type+":"+r.value];s!==void 0&&(r.type=s[0],r.value=s[1])}return n=q(e),n}function Je(n,e){let t=n[e];n[e-1].josi="";let r=j("eq","=",t.indent,t.line,t.file),s=j("[","[",t.indent,t.line,t.file),i=j("]","]",t.indent,t.line,t.file);i.josi="\u306B";let o=n[e+2];o.josi="";let u=j("number",100,t.indent,t.line,t.file);u.josi="\u3092";let c=j("word","\u639B",t.indent,t.line,t.file);n.splice(e,4,r,s,o,i,u,c)}function Re(n,e){let t=F(n,["word:\u3092"]);t>=0&&(n[t].type="\u3053\u3053\u307E\u3067",n[t].value="\u3053\u3053\u307E\u3067");let r=F(n,["word:\u304C"]);r>=0&&(n[r].type="\u3053\u3053\u307E\u3067",n[r].value="\u3053\u3053\u307E\u3067"),n[e+1].value="\u9593"}function F(n,e){let t=e.map(r=>r.split(":"));for(let r=0;r<n.length;r++){let s=!0;for(let i=0;i<t.length;i++){let o=t[i],u=r+i;if(u>=n.length)return-1;if(!(n[u].type===o[0]&&n[u].value===o[1])){s=!1;break}}if(s)return r}return-1}function At(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&xt.indexOf(t.value)>=0)return t.type="DNCL\u30E2\u30FC\u30C9",!0}return!1}var Nt=!1,ge=30,Ft=["!DNCL2\u30E2\u30FC\u30C9","\u{1F4A1}DNCL2\u30E2\u30FC\u30C9","!DNCL2","\u{1F4A1}DNCL2"],Ot={"\u2190:\u2190":["eq","="],"\xF7:\xF7":["\xF7\xF7","\xF7\xF7"],"{:{":["[","["],"}:}":["]","]"],"word:not":["not","!"],"word:\u4E71\u6570":["word","\u4E71\u6570\u7BC4\u56F2"],"word:\u8868\u793A":["word","\u9023\u7D9A\u8868\u793A"],"word:\u3068\u5B9A\u7FA9":["\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067"]};function Be(n){if(!Et(n))return n;let e=z(n,"eol");for(let t=0;t<e.length;t++){let r=e[t];if(r.length<=1)continue;let s=M(r,["word:\u306A\u3044"]);s>=1&&r[s].josi==="\u306A\u3089\u3070"&&(r[s-1].josi="\u3067\u306A\u3051\u308C\u3070",r.splice(s,1));for(let o=0;o<r.length;o++){let u=r[o];(u.value==="\u305D\u3046"||u.value==="\u305D\u308C")&&(u.josi==="\u3067\u306A\u3051\u308C\u3070"||u.josi==="\u3067\u306A\u304F")&&(u.type="\u9055\u3048\u3070",u.value="\u9055\u3048\u3070",u.josi="")}for(;;){let o=M(r,["word:\u3092\u5B9F\u884C","comma:,","word:\u305D\u3046"]);if(o<0)break;let u=r[o+2];if(u.josi==="\u3067\u306A\u3051\u308C\u3070"){u.type="\u9055\u3048\u3070",u.value="\u9055\u3048\u3070",u.josi="",r.splice(o,3,u);continue}else if(u.josi==="\u3067"){let c=r[o+3];if(c.value.substring(0,4)==="\u306A\u304F\u3082\u3057"){if(u.type="\u9055\u3048\u3070",u.value="\u9055\u3048\u3070",u.josi="",r.splice(o,3,u),c.value.length>4){let a=c.value.substring(4),f=j("word",a,c.indent,c.line,c.file);a.match(/^\d/)&&(f.type="number"),r.splice(o+2,0,f),c.value=c.value.substring(0,4)}c.type="\u3082\u3057",c.value="\u3082\u3057",c.josi="";continue}}break}for(;;){let o=M(r,["word:\u305D\u3046","word:\u306A\u304F"]);if(o<0)break;let u=r[o];if(u.josi==="\u3067"){u.type="\u9055\u3048\u3070",u.value="\u9055\u3048\u3070",u.josi="",r.splice(o+1,1);continue}break}for(;;){let o=M(r,["word:\u305D\u3046","word:\u306A\u304F\u3082\u3057"]);if(o<0)break;let u=r[o],c=r[o+1];u.type="\u9055\u3048\u3070",u.value="\u9055\u3048\u3070",u.josi="",c.type="\u3082\u3057",c.value="\u3082\u3057",c.josi=""}for(;;){let o=M(r,["word:\u5897","word:\u3089"]);if(o<0)break;let u=r[o];u.type="word",u.value="\u5897\u7E70\u8FD4",u.josi="",r.splice(o,2,u)}for(;;){let o=M(r,["word:\u6E1B","word:\u3089"]);if(o<0)break;let u=r[o];u.type="word",u.value="\u6E1B\u7E70\u8FD4",u.josi="",r.splice(o,2,u)}for(;;){let o=M(r,["word:\u5897","word:\u3089\u7E70\u308A\u8FD4"]);if(o<0)break;let u=r[o];u.type="word",u.value="\u5897\u7E70\u8FD4",u.josi="",r.splice(o,2,u)}for(;;){let o=M(r,["word:\u6E1B","word:\u3089\u7E70\u308A\u8FD4"]);if(o<0)break;let u=r[o];u.type="word",u.value="\u6E1B\u7E70\u8FD4",u.josi="",r.splice(o,2,u)}for(let o=0;o<r.length;o++){if(be([["word:\u914D\u5217","word:\u914D\u5217\u5909\u6570"],"word","word:\u3059\u3079\u3066",["word:\u8981\u7D20","word:\u5024"],"*","word:\u4EE3\u5165"],r,o)){let u=r[o+1];u.josi="";let c=r[o+4];c.josi="",r.splice(o,6,u,w("eq","=",u),w("word","\u639B"),w("(","("),w("[","["),c,w("]","]"),w("comma",","),w("number",ge),w(")",")")),o+=6}if(be(["word","word:\u3059\u3079\u3066",["word:\u8981\u7D20","word:\u5024"],["number","string","word"],"word:\u3059\u308B"],r,o)){let u=r[o];u.josi="";let c=r[o+3];c.josi="",r.splice(o,5,u,w("eq","=",u),w("word","\u639B"),w("(","("),w("[","["),c,w("]","]"),w("comma",","),w("number",ge),w(")",")"))}if(be([["word:\u914D\u5217\u5909\u6570","word:\u914D\u5217"],"word","word:\u521D\u671F\u5316"],r,o)){let u=r[o+1];u.josi="",r.splice(o,3,u,w("eq","=",u),w("word","\u639B"),w("(","("),w("[","["),w("number",0),w("]","]"),w("comma",","),w("number",ge),w(")",")"))}}for(;;){let o=M(r,["word:\u4E8C\u9032","word:\u8868\u793A"]);if(o<0)break;r[o].value="\u4E8C\u9032\u8868\u793A",r[o].josi="",r.splice(o+1,1)}for(;;){let o=M(r,["word:\u6539\u884C","word:\u8868\u793A"]);if(o<0)break;let u=r[o];u.value="\u9023\u7D9A\u7121\u6539\u884C\u8868\u793A",u.josi="",r.splice(o+1,1)}let i=0;for(;i<r.length;){let o=r[i];if(o.type==="word"&&o.value.length>=2){let u=o.value.charAt(o.value.length-1);(u==="\u6E1B"||u==="\u5897")&&(o.value=o.value.substring(0,o.value.length-1),o.josi="\u3060\u3051",r.splice(i+1,0,j("word",u,o.indent,o.line,o.file))),i++;continue}i++}}for(let t=0;t<n.length;t++){let r=n[t],s=Ot[r.type+":"+r.value];s!==void 0&&(r.type=s[0],r.value=s[1])}return n=q(e),Nt&&(console.log("// DEBUG---DNCL:tokens---BEGIN"),console.log(ue(n)),console.log("// DEBUG---DNCL:tokens---END")),n}function be(n,e,t){let r=(s,i)=>{if(s instanceof Array){for(let u=0;u<s.length;u++)if(r(s[u],i))return!0;return!1}if(s==="*")return!0;if(s.indexOf(":")<0)return s===i.type;let o=`${i.type}:${i.value}`;return s===o};for(let s=0;s<n.length;s++){let i=s+t;if(i>=e.length)return!1;let o=n[s],u=e[i];if(!r(o,u))return!1}return!0}function M(n,e){let t=e.map(r=>r.split(":"));for(let r=0;r<n.length;r++){let s=!0;for(let i=0;i<t.length;i++){let o=t[i],u=r+i;if(u>=n.length)return-1;if(!(n[u].type===o[0]&&n[u].value===o[1])){s=!1;break}}if(s)return r}return-1}function Et(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&Ft.indexOf(t.value)>=0)return t.type="DNCL2\u30E2\u30FC\u30C9",!0}return!1}var ce=class{constructor(e,t){this.sourceCodeLength=e,this.preprocessed=t;let r=0;this.cumulativeSum=[];for(let s of t)this.cumulativeSum.push(r),r+=s.text.length;this.lastIndex=0,this.lastPreprocessedCodePosition=0}map(e){let t=this.findIndex(e);return Math.min(this.preprocessed[t].sourcePosition+(e-this.cumulativeSum[t]),t===this.preprocessed.length-1?this.sourceCodeLength:this.preprocessed[t+1].sourcePosition-1)}findIndex(e){e<this.lastPreprocessedCodePosition&&(this.lastIndex=0),this.lastPreprocessedCodePosition=e;for(let t=this.lastIndex;t<this.preprocessed.length-1;t++)if(e<this.cumulativeSum[t+1])return this.lastIndex=t,t;return this.lastIndex=this.preprocessed.length-1,this.preprocessed.length-1}},ae=class{constructor(e,t,r){this.lines=[],this.linesInsertedByIndentationSyntax=t,this.linesDeletedByIndentationSyntax=r;let s=0;for(let i of e.split(`
|
|
425
|
+
`)}function kt(n){let e="";for(let t=0;t<n;t++)e+=" ";return e}var oe=j();function w(n,e,t=void 0){return t&&(oe=t),j(n,e,oe.indent,oe.line,oe.file)}var vt=!1;function Ve(n){return n.type==="\u9055\u3048\u3070"||n.type==="word"&&n.value==="\u30A8\u30E9\u30FC"&&n.josi==="\u306A\u3089\u3070"}function Ie(n){let e=z(n,"eol"),t=[],r=-1,s=0,i=0,o=c=>{c.forEach(a=>{a.type==="{"&&s++,a.type==="}"&&s--,a.type==="["&&i++,a.type==="]"&&i--})};for(let c=0;c<e.length;c++){let a=e[c];if(Pe(a))continue;let f=Le(a);if(s>0||i>0){o(a);continue}if(r>=0){let h=f.indent;for(;r>=h;){let p=f;if(Ve(p)&&r===h||(e[c-1].push(w("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",p)),e[c-1].push(w("eol",`
|
|
426
|
+
`,p))),t.pop(),t.length>0)r=t[t.length-1];else{r=-1;break}}}if(o(a),s>0||i>0)continue;let l=wt(a);l.type===":"&&(e[c]=e[c].filter(h=>h!==l),r=l.indent,t.push(r))}if(e.length>0&&t.length>0){let c=n[0];for(let a=e.length-1;a>=0;a--){let f=e[a];if(f.length>0){c=f[f.length-1];break}}for(let a=0;a<t.length;a++)e[e.length-1].push(w("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",c)),e[e.length-1].push(w("eol",`
|
|
427
|
+
`,c))}let u=q(e);return vt&&console.log("###",ue(u)),u}function q(n){let e=[];for(let t of n)for(let r of t)e.push(r);return e}function wt(n){let e=n.length;if(e===0)return j("?");let t=n[e-1];return t.type==="eol"&&e>=2&&(t=n[e-2]),t}function z(n,e){let t=[],r=[],s=0;for(let i of n)r.push(i),i.type==="{"?s++:i.type==="}"?s--:s===0&&i.type===e&&(t.push(r),r=[]);return r.length>0&&t.push(r),t}function Pe(n){if(n.length===0)return!0;for(let e=0;e<n.length;e++){let t=n[e].type;if(!(t==="eol"||t==="line_comment"||t==="range_comment"))return!1}return!0}function Le(n){for(let e=0;e<n.length;e++){let t=n[e].type;if(!(t==="eol"||t==="line_comment"||t==="range_comment"))return n[e]}return n[0]}var St=["!\u30A4\u30F3\u30C7\u30F3\u30C8\u69CB\u6587","!\u3053\u3053\u307E\u3067\u3060\u308B\u3044","\u{1F4A1}\u30A4\u30F3\u30C7\u30F3\u30C8\u69CB\u6587","\u{1F4A1}\u3053\u3053\u307E\u3067\u3060\u308B\u3044"];function De(n){if(!jt(n))return n;for(let c of n)if(c.type==="\u3053\u3053\u307E\u3067")throw new te("\u30A4\u30F3\u30C7\u30F3\u30C8\u69CB\u6587\u304C\u6709\u52B9\u5316\u3055\u308C\u3066\u3044\u308B\u3068\u304D\u306B\u300E\u3053\u3053\u307E\u3067\u300F\u3092\u4F7F\u3046\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002",c.line,c.file);let e=0,t=0,r=c=>{c.forEach(a=>{a.type==="{"&&e++,a.type==="}"&&e--,a.type==="["&&t++,a.type==="]"&&t--})},s=[],i=z(n,"eol"),o=0;for(let c=0;c<i.length;c++){let a=i[c];if(Pe(a))continue;if(t>0||e>0){r(a);continue}let f=Le(a),l=f.indent;if(l!==o){if(o>=0)for(;o>l;){let h=s[s.length-1][1];if(!(Ve(f)&&h===l)){let p=i[c-1][0];i[c-1].push(w("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",p)),i[c-1].push(w("eol",`
|
|
428
|
+
`,p))}if(s.pop(),s.length>0)o=s[s.length-1][0];else{o=0;break}}if(!(t>0||e>0)&&(r(a),l>o)){s.push([l,o]),o=l;continue}}}for(let c=0;c<s.length;c++){let a=n[0];for(let f=i.length-1;f>=0;f--){let l=i[f];if(l.length>0){a=l[l.length-1];break}}i[i.length-1].push(w("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",a)),i[i.length-1].push(w("eol",`
|
|
429
|
+
`,a))}return q(i)}function jt(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&St.indexOf(t.value)>=0)return!0}return!1}var xt=["!DNCL\u30E2\u30FC\u30C9","\u{1F4A1}DNCL\u30E2\u30FC\u30C9"],$t={"\u2190:\u2190":["eq","="],"\xF7:\xF7":["\xF7\xF7","\xF7\xF7"],"{:{":["[","["],"}:}":["]","]"],"word:\u3092\u5B9F\u884C":["\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067"],"word:\u4E71\u6570":["word","\u4E71\u6570\u7BC4\u56F2"],"word:\u8868\u793A":["word","\u9023\u7D9A\u8868\u793A"]};function Ge(n){if(!At(n))return n;let e=z(n,"eol");for(let t=0;t<e.length;t++){let r=e[t];if(r.length<=1)continue;for(let a=0;a<r.length;a++){if(r[a].type==="|"){r[a].type="range_comment";continue}break}let s=r[0];s.type==="word"&&s.value==="\u7E70\u8FD4"&&r.splice(0,r.length,j("word","\u5F8C\u5224\u5B9A",s.indent,s.line,s.file),j("word","\u7E70\u8FD4",s.indent,s.line,s.file));let i=F(r,["word:\u306A\u308B","word:\u7E70\u8FD4"]);i>0&&Re(r,i);let o=F(r,["word:\u306A\u308B","word:\u5B9F\u884C"]);o>0&&Re(r,o);let u=F(r,["word:\u306A\u3044"]);for(u>=1&&r[u].josi==="\u306A\u3089\u3070"&&(r[u-1].josi="\u3067\u306A\u3051\u308C\u3070",r.splice(u,1));;){let a=F(r,["word:\u4E8C\u9032","word:\u8868\u793A"]);if(a<0)break;r[a].value="\u4E8C\u9032\u8868\u793A",r[a].josi="",r.splice(a+1,1)}for(;;){let a=F(r,["word:\u6539\u884C","word:\u8868\u793A"]);if(a<0)break;let f=r[a];f.value="\u9023\u7D9A\u7121\u6539\u884C\u8868\u793A",f.josi="",r.splice(a+1,1)}for(;;){let a=F(r,["word:\u3092\u5B9F\u884C","comma:,","word:\u305D\u3046"]);if(a<0)break;let f=r[a+2];if(f.josi==="\u3067\u306A\u3051\u308C\u3070"){f.type="\u9055\u3048\u3070",f.value="\u9055\u3048\u3070",f.josi="",r.splice(a,3,f);continue}else if(f.josi==="\u3067"){let l=r[a+3];if(l.value.substring(0,4)==="\u306A\u304F\u3082\u3057"){if(f.type="\u9055\u3048\u3070",f.value="\u9055\u3048\u3070",f.josi="",r.splice(a,3,f),l.value.length>4){let h=l.value.substring(4),p=j("word",h,l.indent,l.line,l.file);h.match(/^\d/)&&(p.type="number"),r.splice(a+2,0,p),l.value=l.value.substring(0,4)}l.type="\u3082\u3057",l.value="\u3082\u3057",l.josi="";continue}}break}for(;;){let a=F(r,["word:\u5897","word:\u3089"]);if(a<0)break;let f=r[a];f.type="word",f.value="\u5897\u7E70\u8FD4",f.josi="",r.splice(a,2,f)}for(;;){let a=F(r,["word:\u6E1B","word:\u3089"]);if(a<0)break;let f=r[a];f.type="word",f.value="\u6E1B\u7E70\u8FD4",f.josi="",r.splice(a,2,f)}for(;;){let a=F(r,["word:\u3092\u7E70\u308A\u8FD4"]);if(a<0)break;let f=r[a];f.type="\u3053\u3053\u307E\u3067",f.value="\u3053\u3053\u307E\u3067",f.josi=""}for(;;){let a=F(r,["word:\u3059\u3079\u3066","word:\u8981\u7D20"]);if(a>=1)Je(r,a);else break}for(;;){let a=F(r,["word:\u3059\u3079\u3066","word:\u5024"]);if(a>=1)Je(r,a);else break}let c=0;for(;c<r.length;){let a=r[c];if(a.type==="word"&&a.value.length>=2){let f=a.value.charAt(a.value.length-1);(f==="\u6E1B"||f==="\u5897")&&(a.value=a.value.substring(0,a.value.length-1),a.josi="\u3060\u3051",r.splice(c+1,0,j("word",f,a.indent,a.line,a.file))),c++;continue}c++}}for(let t=0;t<n.length;t++){let r=n[t],s=$t[String(r.type)+":"+String(r.value)];s!==void 0&&(r.type=s[0],r.value=s[1])}return n=q(e),n}function Je(n,e){let t=n[e];n[e-1].josi="";let r=j("eq","=",t.indent,t.line,t.file),s=j("[","[",t.indent,t.line,t.file),i=j("]","]",t.indent,t.line,t.file);i.josi="\u306B";let o=n[e+2];o.josi="";let u=j("number",100,t.indent,t.line,t.file);u.josi="\u3092";let c=j("word","\u639B",t.indent,t.line,t.file);n.splice(e,4,r,s,o,i,u,c)}function Re(n,e){let t=F(n,["word:\u3092"]);t>=0&&(n[t].type="\u3053\u3053\u307E\u3067",n[t].value="\u3053\u3053\u307E\u3067");let r=F(n,["word:\u304C"]);r>=0&&(n[r].type="\u3053\u3053\u307E\u3067",n[r].value="\u3053\u3053\u307E\u3067"),n[e+1].value="\u9593"}function F(n,e){let t=e.map(r=>r.split(":"));for(let r=0;r<n.length;r++){let s=!0;for(let i=0;i<t.length;i++){let o=t[i],u=r+i;if(u>=n.length)return-1;if(!(n[u].type===o[0]&&n[u].value===o[1])){s=!1;break}}if(s)return r}return-1}function At(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&xt.indexOf(t.value)>=0)return t.type="DNCL\u30E2\u30FC\u30C9",!0}return!1}var Nt=!1,ge=30,Ft=["!DNCL2\u30E2\u30FC\u30C9","\u{1F4A1}DNCL2\u30E2\u30FC\u30C9","!DNCL2","\u{1F4A1}DNCL2"],Ot={"\u2190:\u2190":["eq","="],"\xF7:\xF7":["\xF7\xF7","\xF7\xF7"],"{:{":["[","["],"}:}":["]","]"],"word:not":["not","!"],"word:\u4E71\u6570":["word","\u4E71\u6570\u7BC4\u56F2"],"word:\u8868\u793A":["word","\u9023\u7D9A\u8868\u793A"],"word:\u3068\u5B9A\u7FA9":["\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067"]};function Be(n){if(!Et(n))return n;let e=z(n,"eol");for(let t=0;t<e.length;t++){let r=e[t];if(r.length<=1)continue;let s=M(r,["word:\u306A\u3044"]);s>=1&&r[s].josi==="\u306A\u3089\u3070"&&(r[s-1].josi="\u3067\u306A\u3051\u308C\u3070",r.splice(s,1));for(let o=0;o<r.length;o++){let u=r[o];(u.value==="\u305D\u3046"||u.value==="\u305D\u308C")&&(u.josi==="\u3067\u306A\u3051\u308C\u3070"||u.josi==="\u3067\u306A\u304F")&&(u.type="\u9055\u3048\u3070",u.value="\u9055\u3048\u3070",u.josi="")}for(;;){let o=M(r,["word:\u3092\u5B9F\u884C","comma:,","word:\u305D\u3046"]);if(o<0)break;let u=r[o+2];if(u.josi==="\u3067\u306A\u3051\u308C\u3070"){u.type="\u9055\u3048\u3070",u.value="\u9055\u3048\u3070",u.josi="",r.splice(o,3,u);continue}else if(u.josi==="\u3067"){let c=r[o+3];if(c.value.substring(0,4)==="\u306A\u304F\u3082\u3057"){if(u.type="\u9055\u3048\u3070",u.value="\u9055\u3048\u3070",u.josi="",r.splice(o,3,u),c.value.length>4){let a=c.value.substring(4),f=j("word",a,c.indent,c.line,c.file);a.match(/^\d/)&&(f.type="number"),r.splice(o+2,0,f),c.value=c.value.substring(0,4)}c.type="\u3082\u3057",c.value="\u3082\u3057",c.josi="";continue}}break}for(;;){let o=M(r,["word:\u305D\u3046","word:\u306A\u304F"]);if(o<0)break;let u=r[o];if(u.josi==="\u3067"){u.type="\u9055\u3048\u3070",u.value="\u9055\u3048\u3070",u.josi="",r.splice(o+1,1);continue}break}for(;;){let o=M(r,["word:\u305D\u3046","word:\u306A\u304F\u3082\u3057"]);if(o<0)break;let u=r[o],c=r[o+1];u.type="\u9055\u3048\u3070",u.value="\u9055\u3048\u3070",u.josi="",c.type="\u3082\u3057",c.value="\u3082\u3057",c.josi=""}for(;;){let o=M(r,["word:\u5897","word:\u3089"]);if(o<0)break;let u=r[o];u.type="word",u.value="\u5897\u7E70\u8FD4",u.josi="",r.splice(o,2,u)}for(;;){let o=M(r,["word:\u6E1B","word:\u3089"]);if(o<0)break;let u=r[o];u.type="word",u.value="\u6E1B\u7E70\u8FD4",u.josi="",r.splice(o,2,u)}for(;;){let o=M(r,["word:\u5897","word:\u3089\u7E70\u308A\u8FD4"]);if(o<0)break;let u=r[o];u.type="word",u.value="\u5897\u7E70\u8FD4",u.josi="",r.splice(o,2,u)}for(;;){let o=M(r,["word:\u6E1B","word:\u3089\u7E70\u308A\u8FD4"]);if(o<0)break;let u=r[o];u.type="word",u.value="\u6E1B\u7E70\u8FD4",u.josi="",r.splice(o,2,u)}for(let o=0;o<r.length;o++){if(be([["word:\u914D\u5217","word:\u914D\u5217\u5909\u6570"],"word","word:\u3059\u3079\u3066",["word:\u8981\u7D20","word:\u5024"],"*","word:\u4EE3\u5165"],r,o)){let u=r[o+1];u.josi="";let c=r[o+4];c.josi="",r.splice(o,6,u,w("eq","=",u),w("word","\u639B"),w("(","("),w("[","["),c,w("]","]"),w("comma",","),w("number",ge),w(")",")")),o+=6}if(be(["word","word:\u3059\u3079\u3066",["word:\u8981\u7D20","word:\u5024"],["number","string","word"],"word:\u3059\u308B"],r,o)){let u=r[o];u.josi="";let c=r[o+3];c.josi="",r.splice(o,5,u,w("eq","=",u),w("word","\u639B"),w("(","("),w("[","["),c,w("]","]"),w("comma",","),w("number",ge),w(")",")"))}if(be([["word:\u914D\u5217\u5909\u6570","word:\u914D\u5217"],"word","word:\u521D\u671F\u5316"],r,o)){let u=r[o+1];u.josi="",r.splice(o,3,u,w("eq","=",u),w("word","\u639B"),w("(","("),w("[","["),w("number",0),w("]","]"),w("comma",","),w("number",ge),w(")",")"))}}for(;;){let o=M(r,["word:\u4E8C\u9032","word:\u8868\u793A"]);if(o<0)break;r[o].value="\u4E8C\u9032\u8868\u793A",r[o].josi="",r.splice(o+1,1)}for(;;){let o=M(r,["word:\u6539\u884C","word:\u8868\u793A"]);if(o<0)break;let u=r[o];u.value="\u9023\u7D9A\u7121\u6539\u884C\u8868\u793A",u.josi="",r.splice(o+1,1)}let i=0;for(;i<r.length;){let o=r[i];if(o.type==="word"&&o.value.length>=2){let u=o.value.charAt(o.value.length-1);(u==="\u6E1B"||u==="\u5897")&&(o.value=o.value.substring(0,o.value.length-1),o.josi="\u3060\u3051",r.splice(i+1,0,j("word",u,o.indent,o.line,o.file))),i++;continue}i++}}for(let t=0;t<n.length;t++){let r=n[t],s=Ot[String(r.type)+":"+String(r.value)];s!==void 0&&(r.type=s[0],r.value=s[1])}return n=q(e),Nt&&(console.log("// DEBUG---DNCL:tokens---BEGIN"),console.log(ue(n)),console.log("// DEBUG---DNCL:tokens---END")),n}function be(n,e,t){let r=(s,i)=>{if(s instanceof Array){for(let u=0;u<s.length;u++)if(r(s[u],i))return!0;return!1}if(s==="*")return!0;if(s.indexOf(":")<0)return s===i.type;let o=`${i.type}:${i.value}`;return s===o};for(let s=0;s<n.length;s++){let i=s+t;if(i>=e.length)return!1;let o=n[s],u=e[i];if(!r(o,u))return!1}return!0}function M(n,e){let t=e.map(r=>r.split(":"));for(let r=0;r<n.length;r++){let s=!0;for(let i=0;i<t.length;i++){let o=t[i],u=r+i;if(u>=n.length)return-1;if(!(n[u].type===o[0]&&n[u].value===o[1])){s=!1;break}}if(s)return r}return-1}function Et(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&Ft.indexOf(t.value)>=0)return t.type="DNCL2\u30E2\u30FC\u30C9",!0}return!1}var ce=class{constructor(e,t){this.sourceCodeLength=e,this.preprocessed=t;let r=0;this.cumulativeSum=[];for(let s of t)this.cumulativeSum.push(r),r+=s.text.length;this.lastIndex=0,this.lastPreprocessedCodePosition=0}map(e){let t=this.findIndex(e);return Math.min(this.preprocessed[t].sourcePosition+(e-this.cumulativeSum[t]),t===this.preprocessed.length-1?this.sourceCodeLength:this.preprocessed[t+1].sourcePosition-1)}findIndex(e){e<this.lastPreprocessedCodePosition&&(this.lastIndex=0),this.lastPreprocessedCodePosition=e;for(let t=this.lastIndex;t<this.preprocessed.length-1;t++)if(e<this.cumulativeSum[t+1])return this.lastIndex=t,t;return this.lastIndex=this.preprocessed.length-1,this.preprocessed.length-1}},ae=class{constructor(e,t,r){this.lines=[],this.linesInsertedByIndentationSyntax=t,this.linesDeletedByIndentationSyntax=r;let s=0;for(let i of e.split(`
|
|
430
430
|
`))this.lines.push({offset:s,len:i.length}),s+=i.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){if(e===null)return{startOffset:e,endOffset:t};let r=this.getLineNumber(e);for(let s of this.linesInsertedByIndentationSyntax){if(r===s){e=null,t=null;break}r>s&&(e-=this.lines[s].len+1,t!==null&&(t-=this.lines[s].len+1))}for(let s of this.linesDeletedByIndentationSyntax)r>=s.lineNumber&&(e!==null&&(e+=s.len+1),t!==null&&(t+=s.len+1));return{startOffset:e,endOffset:t}}getLineNumber(e){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let t=this.lastLineNumber;t<this.lines.length-1;t++)if(e<this.lines[t+1].offset)return this.lastLineNumber=t,t;return this.lastLineNumber=this.lines.length-1,this.lines.length-1}},fe=class{constructor(e){this.lineOffsets=[];let t=0;for(let r of e.split(`
|
|
431
431
|
`))this.lineOffsets.push(t),t+=r.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let r=this.lastLineNumber;r<this.lineOffsets.length-1;r++)if(e<this.lineOffsets[r+1])return this.lastLineNumber=r,{line:r+(t?1:0),column:e-this.lineOffsets[r]};return this.lastLineNumber=this.lineOffsets.length-1,{line:this.lineOffsets.length-1+(t?1:0),column:e-this.lineOffsets[this.lineOffsets.length-1]}}};function ke(n,e){if(typeof n.startOffset=="number"&&(n.startOffset-=e.length),typeof n.endOffset=="number"&&(n.endOffset-=e.length),e!==""){let t=e.split(`
|
|
432
432
|
`);typeof n.line=="number"&&(n.line-=t.length-1),n.line===0&&typeof n.column=="number"&&(n.column-=t[t.length-1].length)}return n}var Ct={reset:"\x1B[0m",bold:"\x1B[1m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"},ve=["black","red","green","yellow","blue","magenta","cyan","white"],Mt=n=>n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),Tt=n=>{let e=n.replace(/\x1b\[\d+m/g,""),t=[],r="inherit",s="inherit",i=n===e?e:n.replace(/\x1b\[(\d+)m/g,(a,f)=>{let l=+f;return l===0&&(r="inherit",s="inherit"),l===1&&(s="bold"),l>=30&&l<=37&&(r=ve[l-30]),t.push(`color: ${r}; font-weight: ${s};`),"%c"}),o="inherit",u="inherit",c=n===e?e:"<span>"+Mt(n).replace(/\x1b\[(\d+)m/g,(a,f)=>{let l=+f;return l===0&&(o="inherit",u="inherit"),l===1&&(u="bold"),l>=30&&l<=37&&(o=ve[l-30]),`</span><span style="color: ${o}; font-weight: ${u};">`})+"</span>";return{noColor:e,nodeConsole:n===e?e:n+"\x1B[0m",html:c,browserConsole:[i,...t]}},S={convertColorTextFormat:Tt,colorNames:ve,color:Ct};var x=class n{static fromS(e){let t=n.trace;switch(e){case"all":t=n.all;break;case"trace":t=n.trace;break;case"debug":t=n.debug;break;case"info":t=n.info;break;case"warn":t=n.warn;break;case"error":t=n.error;break;case"stdout":t=n.stdout;break;default:throw new Error("[NakoLogger] unknown logger level:"+e)}return t}static toString(e){return["all","trace","debug","info","warn","error","stdout"][e]}};x.all=0;x.trace=1;x.debug=2;x.info=3;x.warn=4;x.error=5;x.stdout=6;function H(n){return n?`${n.file||""}${n.line===void 0?"":`(${n.line+1}\u884C\u76EE): `}`:""}var K=class{constructor(){this.listeners=[],this.logs="",this.position=""}getErrorLogs(){return[this.logs.replace(/\s+$/,""),this.position]}clear(){this.logs="",this.position=""}addListener(e,t){let r=x.fromS(e);this.listeners.push({level:r,callback:t})}removeListener(e){this.listeners=this.listeners.filter(t=>t.callback!==e)}trace(e,t=null){this.sendI(x.trace,`${S.color.bold}[\u30C7\u30D0\u30C3\u30B0\u60C5\u5831\uFF08\u8A73\u7D30\uFF09]${S.color.reset}${H(t)}${e}`,t)}debug(e,t=null){this.sendI(x.debug,`${S.color.bold}[\u30C7\u30D0\u30C3\u30B0\u60C5\u5831]${S.color.reset}${H(t)}${e}`,t)}info(e,t=null){this.sendI(x.info,`${S.color.bold}${S.color.blue}[\u60C5\u5831]${S.color.reset}${H(t)}${e}`,t)}warn(e,t=null){this.sendI(x.warn,`${S.color.bold}${S.color.green}[\u8B66\u544A]${S.color.reset}${H(t)}${e}`,t)}error(e,t=null){if(e instanceof Error&&typeof e.type=="string")switch(e.type){case"NakoRuntimeError":case"NakoError":if(e instanceof C){let s=e,i=t;i==null&&(i={file:s.file,line:s.line||0,startOffset:0,endOffset:0}),this.sendI(x.error,s.message,i);return}}e instanceof Error&&(e=e.message),this.sendI(x.error,`${S.color.bold}${S.color.red}[\u30A8\u30E9\u30FC]${S.color.reset}${H(t)}${e}`,t)}runtimeError(e,t){return new J(e,t)}stdout(e,t=null){this.sendI(x.stdout,`${e}`,t)}send(e,t,r,s=null,i=null){let o=x.fromS(e);this.sendI(o,t,r,s,i)}sendI(e,t,r,s=null,i=null){let o=()=>{let u=S.convertColorTextFormat(t),c="";return t.includes(`
|
|
433
433
|
`)&&(c+="border-top: 1px solid #8080806b; border-bottom: 1px solid #8080806b;"),{noColor:u.noColor,nodeConsole:u.nodeConsole,browserConsole:i||u.browserConsole,html:`<div style="${c}">`+(s||u.html)+"</div>",level:x.toString(e),position:r}};if(e===x.error){let u=o();this.logs+=u.noColor+`
|
|
434
|
-
`,r&&this.position!==null&&(this.position=`l${r.line}:${r.file}`)}for(let u of this.listeners)if(u.level<=e){let c=o();u.callback(c)}}};var le=class{constructor(e,t,r=0){this.guid=r,this.lastJSCode="",this.__locals=new Map,this.__varslist=[e.newVaiables(e.__varslist[0]),e.newVaiables(e.__varslist[1]),e.newVaiables(e.__varslist[2])],this.numFailures=0,this.index=0,this.nextIndex=-1,this.__code=[],this.__callstack=[],this.__stack=[],this.__labels=[],this.__genMode=t.genMode,this.version=e.version,this.coreVersion=e.coreVersion,this.__module={...e.__module},this.pluginfiles={...e.getPluginfiles()},this.gen=t,this.logger=e.getLogger(),this.compiler=e,this.josiList=e.josiList,this.reservedWords=e.reservedWords}clearLog(){this.__varslist[0].set("\u8868\u793A\u30ED\u30B0","")}get log(){let e=this.__varslist[0].get("\u8868\u793A\u30ED\u30B0");return e=e.replace(/\s+$/,""),e}__setSysVar(e,t){this.__varslist[0].set(e,t)}__getSysVar(e){return this.__varslist[0].get(e)}runEx(e,t,r,s=""){return r.preCode=s,r.nakoGlobal=this,this.compiler.runSync(e,t,r)}async runAsync(e,t,r,s=""){return r.preCode=s,r.nakoGlobal=this,await this.compiler.runAsync(e,t,r)}_runTests(e){let t=`${S.color.bold}\u30C6\u30B9\u30C8\u306E\u5B9F\u884C\u7D50\u679C${S.color.reset}
|
|
434
|
+
`,r&&this.position!==null&&(this.position=`l${r.line}:${r.file||"unknown"}`)}for(let u of this.listeners)if(u.level<=e){let c=o();u.callback(c)}}};var le=class{constructor(e,t,r=0){this.guid=r,this.lastJSCode="",this.__locals=new Map,this.__varslist=[e.newVaiables(e.__varslist[0]),e.newVaiables(e.__varslist[1]),e.newVaiables(e.__varslist[2])],this.numFailures=0,this.index=0,this.nextIndex=-1,this.__code=[],this.__callstack=[],this.__stack=[],this.__labels=[],this.__genMode=t.genMode,this.version=e.version,this.coreVersion=e.coreVersion,this.__module={...e.__module},this.pluginfiles={...e.getPluginfiles()},this.gen=t,this.logger=e.getLogger(),this.compiler=e,this.josiList=e.josiList,this.reservedWords=e.reservedWords}clearLog(){this.__varslist[0].set("\u8868\u793A\u30ED\u30B0","")}get log(){let e=this.__varslist[0].get("\u8868\u793A\u30ED\u30B0");return e=e.replace(/\s+$/,""),e}__setSysVar(e,t){this.__varslist[0].set(e,t)}__getSysVar(e){return this.__varslist[0].get(e)}runEx(e,t,r,s=""){return r.preCode=s,r.nakoGlobal=this,this.compiler.runSync(e,t,r)}async runAsync(e,t,r,s=""){return r.preCode=s,r.nakoGlobal=this,await this.compiler.runAsync(e,t,r)}_runTests(e){let t=`${S.color.bold}\u30C6\u30B9\u30C8\u306E\u5B9F\u884C\u7D50\u679C${S.color.reset}
|
|
435
435
|
`,r=0,s=0;for(let i of e)try{i.f(),t+=`${S.color.green}\u2714${S.color.reset} ${i.name}
|
|
436
|
-
`,r++}catch(o){t+=`${S.color.red}\u2613${S.color.reset} ${i.name}: ${
|
|
437
|
-
`,s++}s>0?t+=`${S.color.green}\u6210\u529F ${r}\u4EF6 ${S.color.red}\u5931\u6557 ${s}\u4EF6`:t+=`${S.color.green}\u6210\u529F ${r}\u4EF6`,this.numFailures=s,this.logger.stdout(t)}clearPlugins(){let e="!\u30AF\u30EA\u30A2";for(let t in this.pluginfiles){let r=this.__module[t];if(r[e]&&r[e].fn)try{r[e].fn(this)}catch(s){this.logger.error(`\u30D7\u30E9\u30B0\u30A4\u30F3\u300E${t}\u300F\u306E\u30AF\u30EA\u30A2\u95A2\u6570\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:`+s.message)}}}reset(){this.clearPlugins()}destroy(){this.reset()}};var Vt={version:"3.7.
|
|
436
|
+
`,r++}catch(o){let u=o instanceof Error?o.message:String(o);t+=`${S.color.red}\u2613${S.color.reset} ${i.name}: ${u}
|
|
437
|
+
`,s++}s>0?t+=`${S.color.green}\u6210\u529F ${r}\u4EF6 ${S.color.red}\u5931\u6557 ${s}\u4EF6`:t+=`${S.color.green}\u6210\u529F ${r}\u4EF6`,this.numFailures=s,this.logger.stdout(t)}clearPlugins(){let e="!\u30AF\u30EA\u30A2";for(let t in this.pluginfiles){let r=this.__module[t];if(r[e]&&r[e].fn)try{r[e].fn(this)}catch(s){this.logger.error(`\u30D7\u30E9\u30B0\u30A4\u30F3\u300E${t}\u300F\u306E\u30AF\u30EA\u30A2\u95A2\u6570\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F:`+String(s.message))}}}reset(){this.clearPlugins()}destroy(){this.reset()}};var Vt={version:"3.7.4",major:3,minor:7,patch:4},we=Vt;var Ue={meta:{type:"const",value:{pluginName:"plugin_system",description:"\u30B7\u30B9\u30C6\u30E0\u95A2\u9023\u306E\u547D\u4EE4\u3092\u63D0\u4F9B\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.6.0",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"3.6.0"}},\u521D\u671F\u5316:{type:"func",josi:[],pure:!1,fn:function(sys){let system=sys;sys.isDebug=!1,sys.__setSysVar=(n,e)=>system.__v0.set(n,e),sys.__getSysVar=(n,e=void 0)=>{let t=system.__v0.get(n);return t===void 0?e:t},sys.__setSore=n=>(sys.__vars.set("\u305D\u308C",n),n),sys.__getSore=()=>sys.__vars.get("\u305D\u308C"),sys.tags={},sys.__setSysVar("\u30CA\u30C7\u30B7\u30B3\u30D0\u30FC\u30B8\u30E7\u30F3",sys.version),sys.__setSysVar("\u30CA\u30C7\u30B7\u30B3\u8A00\u8A9E\u30D0\u30FC\u30B8\u30E7\u30F3",sys.coreVersion),system.__namespaceList||(system.__namespaceList=[]),sys.__findVar=function(n,e){if(typeof n=="function")return n;let t=system.__locals.get(n);if(t)return t;if(n.indexOf("__")>=0){for(let s=2;s>=0;s--){let o=system.__varslist[s].get(n);if(o)return o}return e}let r=system.__modList?system.__modList:[system.__modName];for(let s of r){let i=`${s}__${n}`;for(let o=2;o>=0;o--){let c=system.__varslist[o].get(i);if(c)return c}}return e},sys.__findFunc=function(n,e){let t=sys.__findVar(n);if(typeof t=="function")return t;throw new Error(`\u300E${e}\u300F\u306B\u5B9F\u884C\u3067\u304D\u306A\u3044\u95A2\u6570\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002`)},sys.__exec=function(n,e){let t=sys.__getSysVar(n);if(t)return t.apply(this,e);let r=sys.__findVar(n);if(!r)throw new Error("\u30B7\u30B9\u30C6\u30E0\u95A2\u6570\u3067\u30A8\u30A4\u30EA\u30A2\u30B9\u306E\u6307\u5B9A\u30DF\u30B9:"+n);return r.apply(this,e)},sys.__timeout=[],sys.__interval=[];let z2=sys.__zero2=n=>(n="00"+String(n),n.substring(n.length-2));sys.__zero=(n,e)=>{let t="";for(let r=0;r<e;r++)t+="0";return n=t+n,n.substring(n.length-e)},sys.__formatDate=n=>String(n.getFullYear())+"/"+z2(n.getMonth()+1)+"/"+z2(n.getDate()),sys.__formatTime=n=>z2(n.getHours())+":"+z2(n.getSeconds())+":"+z2(n.getMinutes()),sys.__formatDateTime=(n,e)=>{let t=String(n.getFullYear())+"/"+z2(n.getMonth()+1)+"/"+z2(n.getDate()),r=z2(n.getHours())+":"+z2(n.getMinutes())+":"+z2(n.getSeconds());return e.match(/^\d+\/\d+\/\d+\s+\d+:\d+:\d+$/)?t+" "+r:e.match(/^\d+\/\d+\/\d+$/)?t:e.match(/^\d+:\d+:\d+$/)?r:t+" "+r},sys.__str2date=n=>{if(n=(""+n).replace(/(^\s+|\s+$)/,""),n.match(/^(\d+|\d+\.\d+)$/))return new Date(parseFloat(n)*1e3);if(n.match(/^\d+:\d+(:\d+)?$/)){let t=new Date,r=(n+":0").split(":");return new Date(t.getFullYear(),t.getMonth(),t.getDate(),parseInt(r[0]),parseInt(r[1]),parseInt(r[2]))}n=n.replace(/[\s:\-T]/g,"/"),n+="/0/0/0";let e=n.split("/");return new Date(parseInt(e[0]),parseInt(e[1])-1,parseInt(e[2]),parseInt(e[3]),parseInt(e[4]),parseInt(e[5]))},sys.__printPool="",sys.__parseFloatOrBigint=n=>typeof n=="bigint"?n:parseFloat(n),system.chk=(n,e)=>{if(typeof n>"u"){let t=system.constPools[e],[r,s,i,o]=t,u=system.constPoolsTemplate[r];for(let a in s){let f=system.constPoolsTemplate[s[a]];u=u.split(`$${a}`).join(f)}let c=system.constPoolsTemplate[i];sys.logger.warn(u,{file:c,line:o})}return n},sys.__evalSafe=n=>{let e=eval;try{return e(n)}catch(t){return console.warn("[eval]",t),null}},sys.__evalJS=(src,sys)=>{try{return eval(src)}catch(n){return console.warn("[eval]",n),null}},sys.__registPropAccessor=(n,e,t)=>{system.__propAccessor.push({target:n,getProp:e,setProp:t})},sys.__checkPropAccessor=(n,e)=>{if(n==="get"&&e.__getProp===void 0||n==="set"&&e.__setProp===void 0){for(let t=0;t<system.__propAccessor.length;t++){let r=system.__propAccessor[t];if(r.target[Symbol.hasInstance](e)){r.getProp?e.__getProp=r.getProp:e.__getProp=null,r.setProp?e.__setProp=r.setProp:e.__setProp=null;return}}e.__getProp=e.__setProp=null}},sys.__hatena=sys.__getSysVar("\u30C7\u30D0\u30C3\u30B0\u8868\u793A")}},"!\u30AF\u30EA\u30A2":{type:"func",josi:[],fn:function(n){n.__exec&&n.__exec("\u5168\u30BF\u30A4\u30DE\u30FC\u505C\u6B62",[n]),n.__setSysVar("\u8868\u793A\u30ED\u30B0","")}},\u30CA\u30C7\u30B7\u30B3\u30D0\u30FC\u30B8\u30E7\u30F3:{type:"const",value:"?"},\u30CA\u30C7\u30B7\u30B3\u8A00\u8A9E\u30D0\u30FC\u30B8\u30E7\u30F3:{type:"const",value:"?"},\u30CA\u30C7\u30B7\u30B3\u30A8\u30F3\u30B8\u30F3:{type:"const",value:"nadesi.com/v3"},\u30CA\u30C7\u30B7\u30B3\u7A2E\u985E:{type:"const",value:"?"},\u306F\u3044:{type:"const",value:!0},\u3044\u3044\u3048:{type:"const",value:!1},\u771F:{type:"const",value:!0},\u507D:{type:"const",value:!1},\u6C38\u9060:{type:"const",value:!0},\u30AA\u30F3:{type:"const",value:!0},\u30AA\u30D5:{type:"const",value:!1},\u6539\u884C:{type:"const",value:`
|
|
438
438
|
`},\u30BF\u30D6:{type:"const",value:" "},\u30AB\u30C3\u30B3:{type:"const",value:"\u300C"},\u30AB\u30C3\u30B3\u9589:{type:"const",value:"\u300D"},\u6CE2\u30AB\u30C3\u30B3:{type:"const",value:"{"},\u6CE2\u30AB\u30C3\u30B3\u9589:{type:"const",value:"}"},OK:{type:"const",value:!0},NG:{type:"const",value:!1},\u30AD\u30E3\u30F3\u30BB\u30EB:{type:"const",value:0},TRUE:{type:"const",value:!0},FALSE:{type:"const",value:!1},true:{type:"const",value:!0},false:{type:"const",value:!1},PI:{type:"const",value:Math.PI},\u7A7A:{type:"const",value:""},NULL:{type:"const",value:null},undefined:{type:"const",value:void 0},\u672A\u5B9A\u7FA9:{type:"const",value:void 0},\u30A8\u30E9\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8:{type:"const",value:""},\u5BFE\u8C61:{type:"const",value:""},\u5BFE\u8C61\u30AD\u30FC:{type:"const",value:""},\u56DE\u6570:{type:"const",value:""},CR:{type:"const",value:"\r"},LF:{type:"const",value:`
|
|
439
|
-
`},\u975E\u6570:{type:"const",value:NaN},\u7121\u9650\u5927:{type:"const",value:1/0},\u623B\u5024\u7121:{type:"const",value:0},\u623B\u5024\u6709:{type:"const",value:1},\u7A7A\u914D\u5217:{type:"func",josi:[],pure:!0,fn:function(){return[]}},\u7A7A\u8F9E\u66F8:{type:"func",josi:[],pure:!0,fn:function(){return{}}},\u7A7A\u30CF\u30C3\u30B7\u30E5:{type:"func",josi:[],pure:!0,fn:function(){return{}}},\u7A7A\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8:{type:"func",josi:[],pure:!1,fn:function(n){return n.__exec("\u7A7A\u30CF\u30C3\u30B7\u30E5",[n])}},\u771F\u507D\u5224\u5B9A:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return n?"\u771F":"\u507D"}},\u8868\u793A:{type:"func",josi:[["\u3092","\u3068"]],pure:!0,fn:function(n,e){n=e.__printPool+n,e.__printPool="",e.__setSysVar("\u8868\u793A\u30ED\u30B0",e.__getSysVar("\u8868\u793A\u30ED\u30B0")+n+`
|
|
440
|
-
`),e.logger.send("stdout",n+"")},return_none:!0},\u7D99\u7D9A\u8868\u793A:{type:"func",josi:[["\u3092","\u3068"]],pure:!0,fn:function(n,e){e.__printPool+=n},return_none:!0},\u9023\u7D9A\u8868\u793A:{type:"func",josi:[["\u3068","\u3092"]],isVariableJosi:!0,pure:!0,fn:function(...n){let e=n.pop(),t=n.join("");e.__exec("\u8868\u793A",[t,e])},return_none:!0},\u9023\u7D9A\u7121\u6539\u884C\u8868\u793A:{type:"func",josi:[["\u3068","\u3092"]],isVariableJosi:!0,pure:!0,fn:function(...n){let e=n.pop(),t=n.join("");e.__exec("\u7D99\u7D9A\u8868\u793A",[t,e])},return_none:!0},\u8868\u793A\u30ED\u30B0:{type:"const",value:""},\u8868\u793A\u30ED\u30B0\u30AF\u30EA\u30A2:{type:"func",josi:[],pure:!0,fn:function(n){n.__setSysVar("\u8868\u793A\u30ED\u30B0","")},return_none:!0},\u8A00:{type:"func",josi:[["\u3092","\u3068"]],pure:!0,fn:function(n,e){e.logger.send("stdout",n+"")},return_none:!0},\u30B3\u30F3\u30BD\u30FC\u30EB\u8868\u793A:{type:"func",josi:[["\u3092","\u3068"]],pure:!0,fn:function(n){console.log(n)},return_none:!0},\u8DB3:{type:"func",josi:[["\u306B","\u3068"],["\u3092"]],isVariableJosi:!1,pure:!0,fn:function(n,e){return n+e}},\u5F15:{type:"func",josi:[["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e){return n-e}},\u639B:{type:"func",josi:[["\u306B","\u3068"],["\u3092"]],pure:!0,fn:function(n,e){if(typeof n=="number")return n*e;if(typeof n=="string"){let t="";for(let r=0;r<parseInt(e);r++)t+=n;return t}if(n instanceof Array){let t=[];for(let r=0;r<parseInt(e);r++)t.push(...n);return t}return n*e}},\u500D:{type:"func",josi:[["\u306E","\u3092"],[""]],pure:!0,fn:function(n,e){return n*e}},\u5272:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n/e}},\u5272\u4F59:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n%e}},\u5076\u6570:{type:"func",josi:[["\u304C"]],pure:!0,fn:function(n){return parseInt(n)%2===0}},\u5947\u6570:{type:"func",josi:[["\u304C"]],pure:!0,fn:function(n){return parseInt(n)%2===1}},\u4E8C\u4E57:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return n*n}},\u3079\u304D\u4E57:{type:"func",josi:[["\u306E"],["\u306E"]],pure:!0,fn:function(n,e){return Math.pow(n,e)}},\u4EE5\u4E0A:{type:"func",josi:[["\u304C"],[""]],pure:!0,fn:function(n,e){return n>=e}},\u4EE5\u4E0B:{type:"func",josi:[["\u304C"],[""]],pure:!0,fn:function(n,e){return n<=e}},\u672A\u6E80:{type:"func",josi:[["\u304C"],[""]],pure:!0,fn:function(n,e){return n<e}},\u8D85:{type:"func",josi:[["\u304C"],[""]],pure:!0,fn:function(n,e){return n>e}},\u7B49:{type:"func",josi:[["\u304C"],["\u3068"]],pure:!0,fn:function(n,e){return n===e}},\u7B49\u7121:{type:"func",josi:[["\u304C"],["\u3068"]],pure:!0,fn:function(n,e){return n!==e}},\u4E00\u81F4:{type:"func",josi:[["\u304C"],["\u3068"]],pure:!0,fn:function(n,e){if(typeof n=="object"){let t=JSON.stringify(n),r=JSON.stringify(e);return t===r}return n===e}},\u4E0D\u4E00\u81F4:{type:"func",josi:[["\u304C"],["\u3068"]],pure:!0,fn:function(n,e){if(typeof n=="object"){let t=JSON.stringify(n),r=JSON.stringify(e);return t!==r}return n!==e}},\u7BC4\u56F2\u5185:{type:"func",josi:[["\u304C"],["\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){return e<=n&&n<=t}},\u7BC4\u56F2:{type:"func",josi:[["\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e){return{\u5148\u982D:n,\u672B\u5C3E:e}}},\u9023\u7D9A\u52A0\u7B97:{type:"func",josi:[["\u3092"],["\u306B","\u3068"]],isVariableJosi:!0,pure:!0,fn:function(n,...e){return e.pop(),e.push(n),e.reduce((t,r)=>t+r)}},MAX:{type:"func",josi:[["\u306E"],["\u3068"]],isVariableJosi:!0,pure:!0,fn:function(n,...e){let t=e.pop();return t.__exec("\u6700\u5927\u5024",[n,...e,t])}},\u6700\u5927\u5024:{type:"func",josi:[["\u306E"],["\u3068"]],isVariableJosi:!0,pure:!0,fn:function(n,...e){return e.pop(),e.push(n),e.reduce((t,r)=>Math.max(t,r))}},MIN:{type:"func",josi:[["\u306E"],["\u3068"]],isVariableJosi:!0,pure:!0,fn:function(n,...e){let t=e.pop();return t.__exec("\u6700\u5C0F\u5024",[n,...e,t])}},\u6700\u5C0F\u5024:{type:"func",josi:[["\u306E"],["\u3068"]],isVariableJosi:!0,pure:!0,fn:function(n,...e){return e.pop(),e.push(n),e.reduce((t,r)=>Math.min(t,r))}},CLAMP:{type:"func",josi:[["\u306E","\u3092"],["\u304B\u3089"],["\u307E\u3067\u306E","\u3067"]],pure:!0,fn:function(n,e,t){return Math.min(Math.max(n,e),t)}},\u304F\u3060\u3055\u3044:{type:"func",josi:[],pure:!0,fn:function(n){n.__reisetu||(n.__reisetu=0),n.__reisetu++},return_none:!0},\u304A\u9858:{type:"func",josi:[],pure:!0,fn:function(n){n.__reisetu||(n.__reisetu=0),n.__reisetu++},return_none:!0},\u3067\u3059:{type:"func",josi:[],pure:!0,fn:function(n){n.__reisetu||(n.__reisetu=0),n.__reisetu++},return_none:!0},\u62DD\u5553:{type:"func",josi:[],pure:!0,fn:function(n){n.__reisetu=0},return_none:!0},\u656C\u5177:{type:"func",josi:[],pure:!0,fn:function(n){n.__reisetu+=100},return_none:!0},\u793C\u7BC0\u30EC\u30D9\u30EB\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(n){return n.__reisetu||(n.__reisetu=0),n.__reisetu}},JS\u5B9F\u884C:{type:"func",josi:[["\u3092","\u3067"]],pure:!0,fn:function(n,e){return e.__evalJS(n,e)}},JS\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u53D6\u5F97:{type:"func",josi:[["\u306E"]],pure:!1,fn:function(n,e){return e.__findVar(n,null)}},JS\u95A2\u6570\u5B9F\u884C:{type:"func",josi:[["\u3092"],["\u3067"]],fn:function(n,e,t){if(typeof n=="string"&&(n=t.__evalJS(n,t)),typeof n!="function")throw new Error("JS\u95A2\u6570\u53D6\u5F97\u3067\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093\u3002");return e instanceof Array||(e=[e]),n.apply(null,e)}},ASYNC:{type:"func",josi:[],asyncFn:!0,pure:!0,fn:async function(){},return_none:!0},AWAIT\u5B9F\u884C:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,asyncFn:!0,fn:async function(n,e,t){if(typeof n=="string"&&(n=t.__findFunc(n,"AWAIT\u5B9F\u884C")),!(n instanceof Function))throw new Error("\u300EAWAIT\u5B9F\u884C\u300F\u306E\u7B2C\u4E00\u5F15\u6570\u306F\u306A\u3067\u3057\u3053\u95A2\u6570\u540D\u304BFunction\u578B\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");return await n(...e)}},JS\u30E1\u30BD\u30C3\u30C9\u5B9F\u884C:{type:"func",josi:[["\u306E"],["\u3092"],["\u3067"]],fn:function(n,e,t,r){if(typeof n=="string"&&(n=r.__evalJS(n,r)),typeof n!="object")throw new Error("JS\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002");return typeof e!="function"&&(e=n[e]),t instanceof Array||(t=[t]),e.apply(n,t)}},\u30CA\u30C7\u30B7\u30B3:{type:"func",josi:[["\u3092","\u3067"]],pure:!1,fn:function(n,e){e.__setSysVar("\u8868\u793A\u30ED\u30B0",""),e.__self.runEx(n,e.__modName,{resetEnv:!1,resetLog:!0});let t=e.__getSysVar("\u8868\u793A\u30ED\u30B0")+"";return t&&e.logger.trace(t),t}},\u30CA\u30C7\u30B7\u30B3\u7D9A:{type:"func",josi:[["\u3092","\u3067"]],fn:function(n,e){e.__self.runEx(n,e.__modName,{resetEnv:!1,resetAll:!1});let t=e.__getSysVar("\u8868\u793A\u30ED\u30B0")+"";return t&&e.logger.trace(t),t}},\u5B9F\u884C:{type:"func",josi:[["\u3092","\u306B","\u3067"]],pure:!1,fn:function(n,e){if(typeof n=="function")return n(e);if(typeof n=="string"){let t=e.__findFunc(n,"\u5B9F\u884C");if(typeof t=="function")return t(e)}return n}},\u5B9F\u884C\u6642\u9593\u8A08\u6E2C:{type:"func",josi:[["\u306E"]],pure:!1,fn:function(n,e){if(typeof n=="string"&&(n=e.__findFunc(n,"\u5B9F\u884C\u6642\u9593\u8A08\u6E2C")),performance&&performance.now){let t=performance.now();return n(e),performance.now()-t}else{let t=Date.now();return n(e),Date.now()-t}}},\u7D42:{type:"func",josi:[],pure:!0,fn:function(n){if(n.__setSysVar("__forceClose",!0),!n.__getSysVar("__useDebug"))throw new Error("__\u7D42\u308F\u308B__")}},\u5909\u6570\u578B\u78BA\u8A8D:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return typeof n}},TYPEOF:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return typeof n}},\u6587\u5B57\u5217\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return String(n)}},TOSTR:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return String(n)}},\u6574\u6570\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return parseInt(n)}},TOINT:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return parseInt(n)}},\u5B9F\u6570\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return parseFloat(n)}},TOFLOAT:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return parseFloat(n)}},INT:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return parseInt(n)}},FLOAT:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return parseFloat(n)}},NAN\u5224\u5B9A:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return isNaN(n)}},\u975E\u6570\u5224\u5B9A:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Number.isNaN(n)}},HEX:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return parseInt(n).toString(16)}},\u9032\u6570\u5909\u63DB:{type:"func",josi:[["\u3092","\u306E"],[""]],pure:!0,fn:function(n,e){return parseInt(n).toString(e)}},\u4E8C\u9032:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n){return parseInt(n).toString(2)}},\u4E8C\u9032\u8868\u793A:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){let t=parseInt(n).toString(2);e.__exec("\u8868\u793A",[t,e])}},RGB:{type:"func",josi:[["\u3068"],["\u306E"],["\u3067"]],pure:!0,fn:function(n,e,t){let r=s=>{let i="00"+parseInt(""+s).toString(16);return i.substring(i.length-2,i.length)};return"#"+r(n)+r(e)+r(t)}},\u8AD6\u7406OR:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return n||e}},\u8AD6\u7406AND:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return n&&e}},\u8AD6\u7406NOT:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return!n}},OR:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return n|e}},AND:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return n&e}},XOR:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return n^e}},NOT:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return~n}},SHIFT_L:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n<<e}},SHIFT_R:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n>>e}},SHIFT_UR:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n>>>e}},\u6587\u5B57\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Array.from?Array.from(n).length:String(n).length}},\u4F55\u6587\u5B57\u76EE:{type:"func",josi:[["\u3067","\u306E"],["\u304C"]],pure:!0,fn:function(n,e){let t=Array.from(n),r=Array.from(e);for(let s=0;s<t.length;s++)if(t.slice(s,s+r.length).join("")===r.join(""))return s+1;return 0}},CHR:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(typeof n=="number")return String.fromCodePoint?String.fromCodePoint(n):String.fromCharCode(n);let e=[];for(let t of n)String.fromCodePoint||e.push(String.fromCharCode(t)),e.push(String.fromCodePoint(t));return e}},ASC:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(typeof n=="string")return String.prototype.codePointAt?String(n).codePointAt(0)||0:String(n).charCodeAt(0);let e=[];for(let t of n)String.prototype.codePointAt||e.push(String(t).charCodeAt(0)),e.push(String(t).codePointAt(0)||0);return e}},\u6587\u5B57\u633F\u5165:{type:"func",josi:[["\u3067","\u306E"],["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e,t){e<=0&&(e=1);let r=Array.from(n);return r.splice(e-1,0,t),r.join("")}},\u6587\u5B57\u691C\u7D22:{type:"func",josi:[["\u3067","\u306E"],["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t){e<=0&&(e=1);let r=Array.from(n),s=Array.from(t);for(let i=e-1;i<r.length;i++)if(r.slice(i,i+s.length).join("")===s.join(""))return i+1;return 0}},\u8FFD\u52A0:{type:"func",josi:[["\u3067","\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e){return n instanceof Array?(n.push(e),n):String(n)+String(e)}},\u4E00\u884C\u8FFD\u52A0:{type:"func",josi:[["\u3067","\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e){return n instanceof Array?(n.push(e),n):String(n)+String(e)+`
|
|
441
|
-
`}},\u9023\u7D50:{type:"func",josi:[["\u3068","\u3092"]],pure:!0,isVariableJosi:!0,fn:function(...n){return n.pop(),n.join("")}},\u6587\u5B57\u5217\u5206\u89E3:{type:"func",josi:[["\u3092","\u306E","\u3067"]],pure:!0,fn:function(n){return Array.from?Array.from(n):String(n).split("")}},\u30EA\u30D5\u30EC\u30A4\u30F3:{type:"func",josi:[["\u3092","\u306E"],["\u3067"]],pure:!0,fn:function(n,e){let t="";for(let r=0;r<e;r++)t+=String(n);return t}},\u51FA\u73FE\u56DE\u6570:{type:"func",josi:[["\u3067"],["\u306E"]],pure:!0,fn:function(n,e){return n=""+n,e=""+e,n.split(e).length-1}},MID:{type:"func",josi:[["\u3067","\u306E"],["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t,r){return r.__exec("\u6587\u5B57\u629C\u51FA",[n,e,t])}},\u6587\u5B57\u629C\u51FA:{type:"func",josi:[["\u3067","\u306E"],["\u304B\u3089"],["\u3092",""]],pure:!0,fn:function(n,e,t){return t=t||1,Array.from(n).slice(e-1,e+t-1).join("")}},LEFT:{type:"func",josi:[["\u306E","\u3067"],["\u3060\u3051"]],pure:!0,fn:function(n,e,t){return t.__exec("\u6587\u5B57\u5DE6\u90E8\u5206",[n,e])}},\u6587\u5B57\u5DE6\u90E8\u5206:{type:"func",josi:[["\u306E","\u3067"],["\u3060\u3051",""]],pure:!0,fn:function(n,e){return Array.from(n).slice(0,e).join("")}},RIGHT:{type:"func",josi:[["\u306E","\u3067"],["\u3060\u3051"]],pure:!0,fn:function(n,e,t){return t.__exec("\u6587\u5B57\u53F3\u90E8\u5206",[n,e])}},\u6587\u5B57\u53F3\u90E8\u5206:{type:"func",josi:[["\u306E","\u3067"],["\u3060\u3051",""]],pure:!0,fn:function(n,e){let t=Array.from(n);return t.slice(t.length-e,t.length).join("")}},\u533A\u5207:{type:"func",josi:[["\u306E","\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return(""+n).split(""+e)}},\u6587\u5B57\u5217\u5206\u5272:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){n=""+n,e=""+e;let t=n.indexOf(e);return t<0?[n]:[n.substring(0,t),n.substring(t+e.length)]}},\u5207\u53D6:{type:"func",josi:[["\u304B\u3089","\u306E"],["\u307E\u3067","\u3092"]],pure:!0,fn:function(n,e,t){n=String(n);let r=n.indexOf(e);return r<0?(t.__setSysVar("\u5BFE\u8C61",""),n):(t.__setSysVar("\u5BFE\u8C61",n.substring(r+e.length)),n.substring(0,r))}},\u7BC4\u56F2\u5207\u53D6:{type:"func",josi:[["\u3067","\u306E"],["\u304B\u3089"],["\u307E\u3067","\u3092"]],pure:!0,fn:function(n,e,t,r){n=String(n);let s="",i="",o=n.indexOf(e);if(o<0)return r.__setSysVar("\u5BFE\u8C61",n),"";s=n.substring(0,o);let u=n.substring(o+e.length),c=u.indexOf(t);if(c<0)return r.__setSysVar("\u5BFE\u8C61",s),u;let a=u.substring(0,c);return i=u.substring(c+t.length),r.__setSysVar("\u5BFE\u8C61",s+i),a}},\u6587\u5B57\u524A\u9664:{type:"func",josi:[["\u306E"],["\u304B\u3089"],["\u3060\u3051","\u3092",""]],pure:!0,fn:function(n,e,t){let r=Array.from(n);return r.splice(e-1,t),r.join("")}},\u7F6E\u63DB:{type:"func",josi:[["\u306E","\u3067"],["\u3092","\u304B\u3089"],["\u306B","\u3078"]],pure:!0,fn:function(n,e,t){return String(n).split(e).join(t)}},\u5358\u7F6E\u63DB:{type:"func",josi:[["\u306E","\u3067"],["\u3092"],["\u306B","\u3078"]],pure:!0,fn:function(n,e,t){return String(n).replace(e,t)}},\u30C8\u30EA\u30E0:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/^\s+/,"").replace(/\s+$/,"")}},\u7A7A\u767D\u9664\u53BB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/^\s+/,"").replace(/\s+$/,"")}},\u53F3\u30C8\u30EA\u30E0:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/\s+$/,"")}},\u5DE6\u30C8\u30EA\u30E0:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/^\s+/,"")}},\u672B\u5C3E\u7A7A\u767D\u9664\u53BB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/\s+$/,"")}},\u5927\u6587\u5B57\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).toUpperCase()}},\u5C0F\u6587\u5B57\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).toLowerCase()}},\u5E73\u4EEE\u540D\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return(t=>String(t).replace(/[\u30a1-\u30f6]/g,function(r){let s=r.charCodeAt(0)-96;return String.fromCharCode(s)}))(""+n)}},\u30AB\u30BF\u30AB\u30CA\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return(t=>String(t).replace(/[\u3041-\u3096]/g,function(r){let s=r.charCodeAt(0)+96;return String.fromCharCode(s)}))(""+n)}},\u82F1\u6570\u5168\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/[A-Za-z0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)+65248)})}},\u82F1\u6570\u534A\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/[A-Za-z0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-65248)})}},\u82F1\u6570\u8A18\u53F7\u5168\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/[\x20-\x7F]/g,function(e){return String.fromCharCode(e.charCodeAt(0)+65248)})}},\u82F1\u6570\u8A18\u53F7\u534A\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/[\uFF00-\uFF5F]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-65248)})}},\u30AB\u30BF\u30AB\u30CA\u5168\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n,e){let t=e.__getSysVar("\u5168\u89D2\u30AB\u30CA\u4E00\u89A7"),r=e.__getSysVar("\u534A\u89D2\u30AB\u30CA\u4E00\u89A7"),s=e.__getSysVar("\u5168\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7"),i=e.__getSysVar("\u534A\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7"),o="",u=0;for(;u<n.length;){let c=n.substring(u,u+2),a=i.indexOf(c);if(a>=0){o+=s.charAt(a/2),u+=2;continue}let f=n.charAt(u),l=r.indexOf(f);if(l>=0){o+=t.charAt(l),u++;continue}o+=f,u++}return o}},\u30AB\u30BF\u30AB\u30CA\u534A\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n,e){let t=e.__getSysVar("\u5168\u89D2\u30AB\u30CA\u4E00\u89A7"),r=e.__getSysVar("\u534A\u89D2\u30AB\u30CA\u4E00\u89A7"),s=e.__getSysVar("\u5168\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7"),i=e.__getSysVar("\u534A\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7");return n.split("").map(o=>{let u=t.indexOf(o);if(u>=0)return r.charAt(u);let c=s.indexOf(o);return c>=0?i.substring(c*2,c*2+2):o}).join("")}},\u5168\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!1,fn:function(n,e){let t=n;return t=e.__exec("\u30AB\u30BF\u30AB\u30CA\u5168\u89D2\u5909\u63DB",[t,e]),t=e.__exec("\u82F1\u6570\u8A18\u53F7\u5168\u89D2\u5909\u63DB",[t,e]),t}},\u534A\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!1,fn:function(n,e){let t=n;return t=e.__exec("\u30AB\u30BF\u30AB\u30CA\u534A\u89D2\u5909\u63DB",[t,e]),t=e.__exec("\u82F1\u6570\u8A18\u53F7\u534A\u89D2\u5909\u63DB",[t,e]),t}},\u5168\u89D2\u30AB\u30CA\u4E00\u89A7:{type:"const",value:"\u30A2\u30A4\u30A6\u30A8\u30AA\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D2\u30D5\u30D8\u30DB\u30DE\u30DF\u30E0\u30E1\u30E2\u30E4\u30E6\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EF\u30F2\u30F3\u30A1\u30A3\u30A5\u30A7\u30A9\u30E3\u30E5\u30E7\u30C3\u3001\u3002\u30FC\u300C\u300D"},\u5168\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7:{type:"const",value:"\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0\u30D3\u30D6\u30D9\u30DC\u30D1\u30D4\u30D7\u30DA\u30DD"},\u534A\u89D2\u30AB\u30CA\u4E00\u89A7:{type:"const",value:"\uFF71\uFF72\uFF73\uFF74\uFF75\uFF76\uFF77\uFF78\uFF79\uFF7A\uFF7B\uFF7C\uFF7D\uFF7E\uFF7F\uFF80\uFF81\uFF82\uFF83\uFF84\uFF85\uFF86\uFF87\uFF88\uFF89\uFF8A\uFF8B\uFF8C\uFF8D\uFF8E\uFF8F\uFF90\uFF91\uFF92\uFF93\uFF94\uFF95\uFF96\uFF97\uFF98\uFF99\uFF9A\uFF9B\uFF9C\uFF66\uFF9D\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF64\uFF61\uFF70\uFF62\uFF63\uFF9E\uFF9F"},\u534A\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7:{type:"const",value:"\uFF76\uFF9E\uFF77\uFF9E\uFF78\uFF9E\uFF79\uFF9E\uFF7A\uFF9E\uFF7B\uFF9E\uFF7C\uFF9E\uFF7D\uFF9E\uFF7E\uFF9E\uFF7F\uFF9E\uFF80\uFF9E\uFF81\uFF9E\uFF82\uFF9E\uFF83\uFF9E\uFF84\uFF9E\uFF8A\uFF9E\uFF8B\uFF9E\uFF8C\uFF9E\uFF8D\uFF9E\uFF8E\uFF9E\uFF8A\uFF9F\uFF8B\uFF9F\uFF8C\uFF9F\uFF8D\uFF9F\uFF8E\uFF9F"},JSON\u30A8\u30F3\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return JSON.stringify(n)}},JSON\u30A8\u30F3\u30B3\u30FC\u30C9\u6574\u5F62:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return JSON.stringify(n,null,2)}},JSON\u30C7\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n){return JSON.parse(n)}},JSON_E:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return JSON.stringify(n)}},JSON_ES:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return JSON.stringify(n,null,2)}},JSON_D:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n){return JSON.parse(n)}},\u6B63\u898F\u8868\u73FE\u30DE\u30C3\u30C1:{type:"func",josi:[["\u3092","\u304C"],["\u3067","\u306B"]],pure:!0,fn:function(n,e,t){let r,s=(""+e).match(/^\/(.+)\/([a-zA-Z]*)$/);s===null?r=new RegExp(e,"g"):r=new RegExp(s[1],s[2]);let i=t.__getSysVar("\u62BD\u51FA\u6587\u5B57\u5217");i.splice(0,i.length);let o=String(n).match(r),u=o;if(!r.global){if(o&&o.length>0){u=o[0];for(let c=1;c<o.length;c++)i[c-1]=o[c]}}return u}},\u62BD\u51FA\u6587\u5B57\u5217:{type:"const",value:[]},\u6B63\u898F\u8868\u73FE\u7F6E\u63DB:{type:"func",josi:[["\u306E"],["\u3092","\u304B\u3089"],["\u3067","\u306B","\u3078"]],pure:!0,fn:function(n,e,t){let r,s=e.match(/^\/(.+)\/([a-zA-Z]*)/);return s===null?r=new RegExp(e,"g"):r=new RegExp(s[1],s[2]),String(n).replace(r,t)}},\u6B63\u898F\u8868\u73FE\u533A\u5207:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){let t,r=e.match(/^\/(.+)\/([a-zA-Z]*)/);return r===null?t=new RegExp(e,"g"):t=new RegExp(r[1],r[2]),String(n).split(t)}},\u901A\u8CA8\u5F62\u5F0F:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return String(n).replace(/(?<!\.\d*?)(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}},\u30BC\u30ED\u57CB:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){n=String(n);let t="0";for(let s=0;s<e;s++)t+="0";e=parseInt(e),e<n.length&&(e=n.length);let r=t+String(n);return r.substring(r.length-e,r.length)}},\u7A7A\u767D\u57CB:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){n=String(n);let t=" ";for(let s=0;s<e;s++)t+=" ";e=parseInt(e),e<n.length&&(e=n.length);let r=t+String(n);return r.substring(r.length-e,r.length)}},\u304B\u306A\u304B\u5224\u5B9A:{type:"func",josi:[["\u3092","\u306E","\u304C"]],pure:!0,fn:function(n){let e=String(n).charCodeAt(0);return e>=12353&&e<=12447}},\u30AB\u30BF\u30AB\u30CA\u5224\u5B9A:{type:"func",josi:[["\u3092","\u306E","\u304C"]],pure:!0,fn:function(n){let e=String(n).charCodeAt(0);return e>=12449&&e<=12538}},\u6570\u5B57\u5224\u5B9A:{type:"func",josi:[["\u3092","\u304C"]],pure:!0,fn:function(n){let e=String(n).charAt(0);return e>="0"&&e<="9"||e>="\uFF10"&&e<="\uFF19"}},\u6570\u5217\u5224\u5B9A:{type:"func",josi:[["\u3092","\u304C"]],pure:!0,fn:function(n){let e=/^[+\-+-]?([0-90-9]*)(([..][0-90-9]+)?|([..][0-90-9]+[eEeE][+\-+-]?[0-90-9]+)?)$/;return String(n).match(e)!==null}},\u914D\u5217\u7D50\u5408:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n instanceof Array?n.join(""+e):String(n).split(`
|
|
439
|
+
`},\u975E\u6570:{type:"const",value:NaN},\u7121\u9650\u5927:{type:"const",value:1/0},\u623B\u5024\u7121:{type:"const",value:0},\u623B\u5024\u6709:{type:"const",value:1},\u7A7A\u914D\u5217:{type:"func",josi:[],pure:!0,fn:function(){return[]}},\u7A7A\u8F9E\u66F8:{type:"func",josi:[],pure:!0,fn:function(){return{}}},\u7A7A\u30CF\u30C3\u30B7\u30E5:{type:"func",josi:[],pure:!0,fn:function(){return{}}},\u7A7A\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8:{type:"func",josi:[],pure:!1,fn:function(n){return n.__exec("\u7A7A\u30CF\u30C3\u30B7\u30E5",[n])}},\u771F\u507D\u5224\u5B9A:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return n?"\u771F":"\u507D"}},\u8868\u793A:{type:"func",josi:[["\u3092","\u3068"]],pure:!0,fn:function(n,e){n=String(e.__printPool)+n,e.__printPool="",e.__setSysVar("\u8868\u793A\u30ED\u30B0",String(e.__getSysVar("\u8868\u793A\u30ED\u30B0"))+n+`
|
|
440
|
+
`),e.logger.send("stdout",n+"")},return_none:!0},\u7D99\u7D9A\u8868\u793A:{type:"func",josi:[["\u3092","\u3068"]],pure:!0,fn:function(n,e){e.__printPool+=n},return_none:!0},\u9023\u7D9A\u8868\u793A:{type:"func",josi:[["\u3068","\u3092"]],isVariableJosi:!0,pure:!0,fn:function(...n){let e=n.pop(),t=n.join("");e.__exec("\u8868\u793A",[t,e])},return_none:!0},\u9023\u7D9A\u7121\u6539\u884C\u8868\u793A:{type:"func",josi:[["\u3068","\u3092"]],isVariableJosi:!0,pure:!0,fn:function(...n){let e=n.pop(),t=n.join("");e.__exec("\u7D99\u7D9A\u8868\u793A",[t,e])},return_none:!0},\u8868\u793A\u30ED\u30B0:{type:"const",value:""},\u8868\u793A\u30ED\u30B0\u30AF\u30EA\u30A2:{type:"func",josi:[],pure:!0,fn:function(n){n.__setSysVar("\u8868\u793A\u30ED\u30B0","")},return_none:!0},\u8A00:{type:"func",josi:[["\u3092","\u3068"]],pure:!0,fn:function(n,e){e.logger.send("stdout",n+"")},return_none:!0},\u30B3\u30F3\u30BD\u30FC\u30EB\u8868\u793A:{type:"func",josi:[["\u3092","\u3068"]],pure:!0,fn:function(n){console.log(n)},return_none:!0},\u8DB3:{type:"func",josi:[["\u306B","\u3068"],["\u3092"]],isVariableJosi:!1,pure:!0,fn:function(n,e){return typeof n=="bigint"||typeof e=="bigint"?BigInt(n)+BigInt(e):parseFloat(n)+parseFloat(e)}},\u5408\u8A08:{type:"func",josi:[["\u3068","\u3092","\u306E"]],isVariableJosi:!0,pure:!0,fn:function(...n){let e=n.pop();if(n.length>=1&&n[0]instanceof Array)return e.__exec("\u914D\u5217\u5408\u8A08",[n[0],e]);let t=!1,r=0;for(let s of n){if(typeof s=="bigint"){t=!0;break}r+=parseFloat(s)}if(t){let s=0n;for(let i of n)s+=BigInt(i);return s}return r}},\u5F15:{type:"func",josi:[["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e){return n-e}},\u639B:{type:"func",josi:[["\u306B","\u3068"],["\u3092"]],pure:!0,fn:function(n,e){if(typeof n=="number")return n*e;if(typeof n=="string"){let t="";for(let r=0;r<parseInt(e);r++)t+=n;return t}if(n instanceof Array){let t=[];for(let r=0;r<parseInt(e);r++)t.push(...n);return t}return n*e}},\u500D:{type:"func",josi:[["\u306E","\u3092"],[""]],pure:!0,fn:function(n,e){return n*e}},\u5272:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n/e}},\u5272\u4F59:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n%e}},\u5076\u6570:{type:"func",josi:[["\u304C"]],pure:!0,fn:function(n){return parseInt(n)%2===0}},\u5947\u6570:{type:"func",josi:[["\u304C"]],pure:!0,fn:function(n){return parseInt(n)%2===1}},\u4E8C\u4E57:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return n*n}},\u3079\u304D\u4E57:{type:"func",josi:[["\u306E"],["\u306E"]],pure:!0,fn:function(n,e){return Math.pow(n,e)}},\u4EE5\u4E0A:{type:"func",josi:[["\u304C"],[""]],pure:!0,fn:function(n,e){return n>=e}},\u4EE5\u4E0B:{type:"func",josi:[["\u304C"],[""]],pure:!0,fn:function(n,e){return n<=e}},\u672A\u6E80:{type:"func",josi:[["\u304C"],[""]],pure:!0,fn:function(n,e){return n<e}},\u8D85:{type:"func",josi:[["\u304C"],[""]],pure:!0,fn:function(n,e){return n>e}},\u7B49:{type:"func",josi:[["\u304C"],["\u3068"]],pure:!0,fn:function(n,e){return n===e}},\u7B49\u7121:{type:"func",josi:[["\u304C"],["\u3068"]],pure:!0,fn:function(n,e){return n!==e}},\u4E00\u81F4:{type:"func",josi:[["\u304C"],["\u3068"]],pure:!0,fn:function(n,e){if(typeof n=="object"){let t=JSON.stringify(n),r=JSON.stringify(e);return t===r}return n===e}},\u4E0D\u4E00\u81F4:{type:"func",josi:[["\u304C"],["\u3068"]],pure:!0,fn:function(n,e){if(typeof n=="object"){let t=JSON.stringify(n),r=JSON.stringify(e);return t!==r}return n!==e}},\u7BC4\u56F2\u5185:{type:"func",josi:[["\u304C"],["\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){return e<=n&&n<=t}},\u7BC4\u56F2:{type:"func",josi:[["\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e){return{\u5148\u982D:n,\u672B\u5C3E:e}}},\u9023\u7D9A\u52A0\u7B97:{type:"func",josi:[["\u3092"],["\u306B","\u3068"]],isVariableJosi:!0,pure:!0,fn:function(n,...e){return e.pop(),e.push(n),e.reduce((t,r)=>t+r)}},MAX:{type:"func",josi:[["\u306E"],["\u3068"]],isVariableJosi:!0,pure:!0,fn:function(n,...e){let t=e.pop();return t.__exec("\u6700\u5927\u5024",[n,...e,t])}},\u6700\u5927\u5024:{type:"func",josi:[["\u306E"],["\u3068"]],isVariableJosi:!0,pure:!0,fn:function(n,...e){return e.pop(),e.push(n),e.reduce((t,r)=>Math.max(t,r))}},MIN:{type:"func",josi:[["\u306E"],["\u3068"]],isVariableJosi:!0,pure:!0,fn:function(n,...e){let t=e.pop();return t.__exec("\u6700\u5C0F\u5024",[n,...e,t])}},\u6700\u5C0F\u5024:{type:"func",josi:[["\u306E"],["\u3068"]],isVariableJosi:!0,pure:!0,fn:function(n,...e){return e.pop(),e.push(n),e.reduce((t,r)=>Math.min(t,r))}},CLAMP:{type:"func",josi:[["\u306E","\u3092"],["\u304B\u3089"],["\u307E\u3067\u306E","\u3067"]],pure:!0,fn:function(n,e,t){return Math.min(Math.max(n,e),t)}},\u304F\u3060\u3055\u3044:{type:"func",josi:[],pure:!0,fn:function(n){n.__reisetu||(n.__reisetu=0),n.__reisetu++},return_none:!0},\u304A\u9858:{type:"func",josi:[],pure:!0,fn:function(n){n.__reisetu||(n.__reisetu=0),n.__reisetu++},return_none:!0},\u3067\u3059:{type:"func",josi:[],pure:!0,fn:function(n){n.__reisetu||(n.__reisetu=0),n.__reisetu++},return_none:!0},\u62DD\u5553:{type:"func",josi:[],pure:!0,fn:function(n){n.__reisetu=0},return_none:!0},\u656C\u5177:{type:"func",josi:[],pure:!0,fn:function(n){n.__reisetu+=100},return_none:!0},\u793C\u7BC0\u30EC\u30D9\u30EB\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(n){return n.__reisetu||(n.__reisetu=0),n.__reisetu}},JS\u5B9F\u884C:{type:"func",josi:[["\u3092","\u3067"]],pure:!0,fn:function(n,e){return e.__evalJS(n,e)}},JS\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u53D6\u5F97:{type:"func",josi:[["\u306E"]],pure:!1,fn:function(n,e){return e.__findVar(n,null)}},JS\u95A2\u6570\u5B9F\u884C:{type:"func",josi:[["\u3092"],["\u3067"]],fn:function(n,e,t){if(typeof n=="string"&&(n=t.__evalJS(n,t)),typeof n!="function")throw new Error("JS\u95A2\u6570\u53D6\u5F97\u3067\u5B9F\u884C\u3067\u304D\u307E\u305B\u3093\u3002");return e instanceof Array||(e=[e]),n.apply(null,e)}},ASYNC:{type:"func",josi:[],asyncFn:!0,pure:!0,fn:async function(){},return_none:!0},AWAIT\u5B9F\u884C:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,asyncFn:!0,fn:async function(n,e,t){if(typeof n=="string"&&(n=t.__findFunc(n,"AWAIT\u5B9F\u884C")),!(n instanceof Function))throw new Error("\u300EAWAIT\u5B9F\u884C\u300F\u306E\u7B2C\u4E00\u5F15\u6570\u306F\u306A\u3067\u3057\u3053\u95A2\u6570\u540D\u304BFunction\u578B\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");return await n(...e)}},JS\u30E1\u30BD\u30C3\u30C9\u5B9F\u884C:{type:"func",josi:[["\u306E"],["\u3092"],["\u3067"]],fn:function(n,e,t,r){if(typeof n=="string"&&(n=r.__evalJS(n,r)),typeof n!="object")throw new Error("JS\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002");return typeof e!="function"&&(e=n[e]),t instanceof Array||(t=[t]),e.apply(n,t)}},\u30CA\u30C7\u30B7\u30B3:{type:"func",josi:[["\u3092","\u3067"]],pure:!1,fn:function(n,e){e.__setSysVar("\u8868\u793A\u30ED\u30B0",""),e.__self.runEx(n,e.__modName,{resetEnv:!1,resetLog:!0});let t=String(e.__getSysVar("\u8868\u793A\u30ED\u30B0"));return t&&e.logger.trace(t),t}},\u30CA\u30C7\u30B7\u30B3\u7D9A:{type:"func",josi:[["\u3092","\u3067"]],fn:function(n,e){e.__self.runEx(n,e.__modName,{resetEnv:!1,resetAll:!1});let t=String(e.__getSysVar("\u8868\u793A\u30ED\u30B0"));return t&&e.logger.trace(t),t}},\u5B9F\u884C:{type:"func",josi:[["\u3092","\u306B","\u3067"]],pure:!1,fn:function(n,e){if(typeof n=="function")return n(e);if(typeof n=="string"){let t=e.__findFunc(n,"\u5B9F\u884C");if(typeof t=="function")return t(e)}return n}},\u5B9F\u884C\u6642\u9593\u8A08\u6E2C:{type:"func",josi:[["\u306E"]],pure:!1,fn:function(n,e){if(typeof n=="string"&&(n=e.__findFunc(n,"\u5B9F\u884C\u6642\u9593\u8A08\u6E2C")),performance&&performance.now){let t=performance.now();return n(e),performance.now()-t}else{let t=Date.now();return n(e),Date.now()-t}}},\u7D42:{type:"func",josi:[],pure:!0,fn:function(n){if(n.__setSysVar("__forceClose",!0),!n.__getSysVar("__useDebug"))throw new Error("__\u7D42\u308F\u308B__")}},\u5909\u6570\u578B\u78BA\u8A8D:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return typeof n}},TYPEOF:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return typeof n}},\u6587\u5B57\u5217\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return String(n)}},TOSTR:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return String(n)}},\u6574\u6570\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return parseInt(n)}},TOINT:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return parseInt(n)}},\u5B9F\u6570\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return parseFloat(n)}},TOFLOAT:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return parseFloat(n)}},INT:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return parseInt(n)}},FLOAT:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return parseFloat(n)}},NAN\u5224\u5B9A:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return isNaN(n)}},\u975E\u6570\u5224\u5B9A:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Number.isNaN(n)}},HEX:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return parseInt(n).toString(16)}},\u9032\u6570\u5909\u63DB:{type:"func",josi:[["\u3092","\u306E"],[""]],pure:!0,fn:function(n,e){return parseInt(n).toString(e)}},\u4E8C\u9032:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n){return parseInt(n).toString(2)}},\u4E8C\u9032\u8868\u793A:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){let t=parseInt(n).toString(2);e.__exec("\u8868\u793A",[t,e])}},RGB:{type:"func",josi:[["\u3068"],["\u306E"],["\u3067"]],pure:!0,fn:function(n,e,t){let r=s=>{let i="00"+parseInt(String(s)).toString(16);return i.substring(i.length-2,i.length)};return"#"+r(n)+r(e)+r(t)}},\u8AD6\u7406OR:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return n||e}},\u8AD6\u7406AND:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return n&&e}},\u8AD6\u7406NOT:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return!n}},OR:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return n|e}},AND:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return n&e}},XOR:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return n^e}},NOT:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return~n}},SHIFT_L:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n<<e}},SHIFT_R:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n>>e}},SHIFT_UR:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n>>>e}},\u6587\u5B57\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Array.from?Array.from(n).length:String(n).length}},\u4F55\u6587\u5B57\u76EE:{type:"func",josi:[["\u3067","\u306E"],["\u304C"]],pure:!0,fn:function(n,e){let t=Array.from(n),r=Array.from(e);for(let s=0;s<t.length;s++)if(t.slice(s,s+r.length).join("")===r.join(""))return s+1;return 0}},CHR:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(typeof n=="number")return String.fromCodePoint?String.fromCodePoint(n):String.fromCharCode(n);let e=[];for(let t of n)String.fromCodePoint||e.push(String.fromCharCode(t)),e.push(String.fromCodePoint(t));return e}},ASC:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(typeof n=="string")return String.prototype.codePointAt?String(n).codePointAt(0)||0:String(n).charCodeAt(0);let e=[];for(let t of n)String.prototype.codePointAt||e.push(String(t).charCodeAt(0)),e.push(String(t).codePointAt(0)||0);return e}},\u6587\u5B57\u633F\u5165:{type:"func",josi:[["\u3067","\u306E"],["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e,t){e<=0&&(e=1);let r=Array.from(n);return r.splice(e-1,0,t),r.join("")}},\u6587\u5B57\u691C\u7D22:{type:"func",josi:[["\u3067","\u306E"],["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t){e<=0&&(e=1);let r=Array.from(n),s=Array.from(t);for(let i=e-1;i<r.length;i++)if(r.slice(i,i+s.length).join("")===s.join(""))return i+1;return 0}},\u8FFD\u52A0:{type:"func",josi:[["\u3067","\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e){return n instanceof Array?(n.push(e),n):String(n)+String(e)}},\u4E00\u884C\u8FFD\u52A0:{type:"func",josi:[["\u3067","\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e){return n instanceof Array?(n.push(e),n):String(n)+String(e)+`
|
|
441
|
+
`}},\u9023\u7D50:{type:"func",josi:[["\u3068","\u3092"]],pure:!0,isVariableJosi:!0,fn:function(...n){return n.pop(),n.join("")}},\u6587\u5B57\u5217\u9023\u7D50:{type:"func",josi:[["\u3068","\u3092"]],pure:!0,isVariableJosi:!0,fn:function(...n){return n.pop(),n.join("")}},\u6587\u5B57\u5217\u5206\u89E3:{type:"func",josi:[["\u3092","\u306E","\u3067"]],pure:!0,fn:function(n){return Array.from?Array.from(n):String(n).split("")}},\u30EA\u30D5\u30EC\u30A4\u30F3:{type:"func",josi:[["\u3092","\u306E"],["\u3067"]],pure:!0,fn:function(n,e){let t="";for(let r=0;r<e;r++)t+=String(n);return t}},\u51FA\u73FE\u56DE\u6570:{type:"func",josi:[["\u3067"],["\u306E"]],pure:!0,fn:function(n,e){return n=""+n,e=""+e,n.split(e).length-1}},MID:{type:"func",josi:[["\u3067","\u306E"],["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t,r){return r.__exec("\u6587\u5B57\u629C\u51FA",[n,e,t])}},\u6587\u5B57\u629C\u51FA:{type:"func",josi:[["\u3067","\u306E"],["\u304B\u3089"],["\u3092",""]],pure:!0,fn:function(n,e,t){return t=t||1,Array.from(n).slice(e-1,e+t-1).join("")}},LEFT:{type:"func",josi:[["\u306E","\u3067"],["\u3060\u3051"]],pure:!0,fn:function(n,e,t){return t.__exec("\u6587\u5B57\u5DE6\u90E8\u5206",[n,e])}},\u6587\u5B57\u5DE6\u90E8\u5206:{type:"func",josi:[["\u306E","\u3067"],["\u3060\u3051",""]],pure:!0,fn:function(n,e){return Array.from(n).slice(0,e).join("")}},RIGHT:{type:"func",josi:[["\u306E","\u3067"],["\u3060\u3051"]],pure:!0,fn:function(n,e,t){return t.__exec("\u6587\u5B57\u53F3\u90E8\u5206",[n,e])}},\u6587\u5B57\u53F3\u90E8\u5206:{type:"func",josi:[["\u306E","\u3067"],["\u3060\u3051",""]],pure:!0,fn:function(n,e){let t=Array.from(n),r=t.length-e;return r<0&&(r=0),t.slice(r,t.length).join("")}},\u533A\u5207:{type:"func",josi:[["\u306E","\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return(""+n).split(""+e)}},\u6587\u5B57\u5217\u5206\u5272:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){n=""+n,e=""+e;let t=n.indexOf(e);return t<0?[n]:[n.substring(0,t),n.substring(t+e.length)]}},\u5207\u53D6:{type:"func",josi:[["\u304B\u3089","\u306E"],["\u307E\u3067","\u3092"]],pure:!0,fn:function(n,e,t){n=String(n);let r=n.indexOf(e);return r<0?(t.__setSysVar("\u5BFE\u8C61",""),n):(t.__setSysVar("\u5BFE\u8C61",n.substring(r+e.length)),n.substring(0,r))}},\u7BC4\u56F2\u5207\u53D6:{type:"func",josi:[["\u3067","\u306E"],["\u304B\u3089"],["\u307E\u3067","\u3092"]],pure:!0,fn:function(n,e,t,r){n=String(n);let s="",i="",o=n.indexOf(e);if(o<0)return r.__setSysVar("\u5BFE\u8C61",n),"";s=n.substring(0,o);let u=n.substring(o+e.length),c=u.indexOf(t);if(c<0)return r.__setSysVar("\u5BFE\u8C61",s),u;let a=u.substring(0,c);return i=u.substring(c+t.length),r.__setSysVar("\u5BFE\u8C61",s+i),a}},\u6587\u5B57\u524A\u9664:{type:"func",josi:[["\u306E"],["\u304B\u3089"],["\u3060\u3051","\u3092",""]],pure:!0,fn:function(n,e,t){let r=Array.from(n);return r.splice(e-1,t),r.join("")}},\u7F6E\u63DB:{type:"func",josi:[["\u306E","\u3067"],["\u3092","\u304B\u3089"],["\u306B","\u3078"]],pure:!0,fn:function(n,e,t){return String(n).split(e).join(t)}},\u5358\u7F6E\u63DB:{type:"func",josi:[["\u306E","\u3067"],["\u3092"],["\u306B","\u3078"]],pure:!0,fn:function(n,e,t){return String(n).replace(e,t)}},\u30C8\u30EA\u30E0:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/^\s+/,"").replace(/\s+$/,"")}},\u7A7A\u767D\u9664\u53BB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/^\s+/,"").replace(/\s+$/,"")}},\u53F3\u30C8\u30EA\u30E0:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/\s+$/,"")}},\u5DE6\u30C8\u30EA\u30E0:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/^\s+/,"")}},\u672B\u5C3E\u7A7A\u767D\u9664\u53BB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/\s+$/,"")}},\u5927\u6587\u5B57\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).toUpperCase()}},\u5C0F\u6587\u5B57\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).toLowerCase()}},\u5E73\u4EEE\u540D\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return(t=>String(t).replace(/[\u30a1-\u30f6]/g,function(r){let s=r.charCodeAt(0)-96;return String.fromCharCode(s)}))(""+n)}},\u30AB\u30BF\u30AB\u30CA\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return(t=>String(t).replace(/[\u3041-\u3096]/g,function(r){let s=r.charCodeAt(0)+96;return String.fromCharCode(s)}))(""+n)}},\u82F1\u6570\u5168\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/[A-Za-z0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)+65248)})}},\u82F1\u6570\u534A\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/[A-Za-z0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-65248)})}},\u82F1\u6570\u8A18\u53F7\u5168\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/[\x20-\x7E]/g,function(e){return e===" "?"\u3000":String.fromCharCode(e.charCodeAt(0)+65248)})}},\u82F1\u6570\u8A18\u53F7\u534A\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){return String(n).replace(/[\u3000\uFF00-\uFF5F]/g,function(e){return e==="\u3000"?" ":String.fromCharCode(e.charCodeAt(0)-65248)})}},\u30AB\u30BF\u30AB\u30CA\u5168\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n,e){let t=e.__getSysVar("\u5168\u89D2\u30AB\u30CA\u4E00\u89A7"),r=e.__getSysVar("\u534A\u89D2\u30AB\u30CA\u4E00\u89A7"),s=e.__getSysVar("\u5168\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7"),i=e.__getSysVar("\u534A\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7"),o="",u=0;for(;u<n.length;){let c=n.substring(u,u+2),a=i.indexOf(c);if(a>=0){o+=s.charAt(a/2),u+=2;continue}let f=n.charAt(u),l=r.indexOf(f);if(l>=0){o+=t.charAt(l),u++;continue}o+=f,u++}return o}},\u30AB\u30BF\u30AB\u30CA\u534A\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n,e){let t=e.__getSysVar("\u5168\u89D2\u30AB\u30CA\u4E00\u89A7"),r=e.__getSysVar("\u534A\u89D2\u30AB\u30CA\u4E00\u89A7"),s=e.__getSysVar("\u5168\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7"),i=e.__getSysVar("\u534A\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7");return n.split("").map(o=>{let u=t.indexOf(o);if(u>=0)return r.charAt(u);let c=s.indexOf(o);return c>=0?i.substring(c*2,c*2+2):o}).join("")}},\u5168\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!1,fn:function(n,e){let t=n;return t=e.__exec("\u30AB\u30BF\u30AB\u30CA\u5168\u89D2\u5909\u63DB",[t,e]),t=e.__exec("\u82F1\u6570\u8A18\u53F7\u5168\u89D2\u5909\u63DB",[t,e]),t}},\u534A\u89D2\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!1,fn:function(n,e){let t=n;return t=e.__exec("\u30AB\u30BF\u30AB\u30CA\u534A\u89D2\u5909\u63DB",[t,e]),t=e.__exec("\u82F1\u6570\u8A18\u53F7\u534A\u89D2\u5909\u63DB",[t,e]),t}},\u5168\u89D2\u30AB\u30CA\u4E00\u89A7:{type:"const",value:"\u30A2\u30A4\u30A6\u30A8\u30AA\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D2\u30D5\u30D8\u30DB\u30DE\u30DF\u30E0\u30E1\u30E2\u30E4\u30E6\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EF\u30F2\u30F3\u30A1\u30A3\u30A5\u30A7\u30A9\u30E3\u30E5\u30E7\u30C3\u3001\u3002\u30FC\u300C\u300D"},\u5168\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7:{type:"const",value:"\u30AC\u30AE\u30B0\u30B2\u30B4\u30B6\u30B8\u30BA\u30BC\u30BE\u30C0\u30C2\u30C5\u30C7\u30C9\u30D0\u30D3\u30D6\u30D9\u30DC\u30D1\u30D4\u30D7\u30DA\u30DD"},\u534A\u89D2\u30AB\u30CA\u4E00\u89A7:{type:"const",value:"\uFF71\uFF72\uFF73\uFF74\uFF75\uFF76\uFF77\uFF78\uFF79\uFF7A\uFF7B\uFF7C\uFF7D\uFF7E\uFF7F\uFF80\uFF81\uFF82\uFF83\uFF84\uFF85\uFF86\uFF87\uFF88\uFF89\uFF8A\uFF8B\uFF8C\uFF8D\uFF8E\uFF8F\uFF90\uFF91\uFF92\uFF93\uFF94\uFF95\uFF96\uFF97\uFF98\uFF99\uFF9A\uFF9B\uFF9C\uFF66\uFF9D\uFF67\uFF68\uFF69\uFF6A\uFF6B\uFF6C\uFF6D\uFF6E\uFF6F\uFF64\uFF61\uFF70\uFF62\uFF63\uFF9E\uFF9F"},\u534A\u89D2\u30AB\u30CA\u6FC1\u97F3\u4E00\u89A7:{type:"const",value:"\uFF76\uFF9E\uFF77\uFF9E\uFF78\uFF9E\uFF79\uFF9E\uFF7A\uFF9E\uFF7B\uFF9E\uFF7C\uFF9E\uFF7D\uFF9E\uFF7E\uFF9E\uFF7F\uFF9E\uFF80\uFF9E\uFF81\uFF9E\uFF82\uFF9E\uFF83\uFF9E\uFF84\uFF9E\uFF8A\uFF9E\uFF8B\uFF9E\uFF8C\uFF9E\uFF8D\uFF9E\uFF8E\uFF9E\uFF8A\uFF9F\uFF8B\uFF9F\uFF8C\uFF9F\uFF8D\uFF9F\uFF8E\uFF9F"},JSON\u30A8\u30F3\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return JSON.stringify(n)}},JSON\u30A8\u30F3\u30B3\u30FC\u30C9\u6574\u5F62:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return JSON.stringify(n,null,2)}},JSON\u30C7\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n){return JSON.parse(n)}},JSON_E:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return JSON.stringify(n)}},JSON_ES:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return JSON.stringify(n,null,2)}},JSON_D:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n){return JSON.parse(n)}},\u6B63\u898F\u8868\u73FE\u30DE\u30C3\u30C1:{type:"func",josi:[["\u3092","\u304C"],["\u3067","\u306B"]],pure:!0,fn:function(n,e,t){let r,s=(""+e).match(/^\/(.+)\/([a-zA-Z]*)$/);s===null?r=new RegExp(e,"g"):r=new RegExp(s[1],s[2]);let i=t.__getSysVar("\u62BD\u51FA\u6587\u5B57\u5217");i.splice(0,i.length);let o=String(n).match(r),u=o;if(!r.global){if(o&&o.length>0){u=o[0];for(let c=1;c<o.length;c++)i[c-1]=o[c]}}return u}},\u62BD\u51FA\u6587\u5B57\u5217:{type:"const",value:[]},\u6B63\u898F\u8868\u73FE\u7F6E\u63DB:{type:"func",josi:[["\u306E"],["\u3092","\u304B\u3089"],["\u3067","\u306B","\u3078"]],pure:!0,fn:function(n,e,t){let r,s=e.match(/^\/(.+)\/([a-zA-Z]*)/);return s===null?r=new RegExp(e,"g"):r=new RegExp(s[1],s[2]),String(n).replace(r,t)}},\u6B63\u898F\u8868\u73FE\u533A\u5207:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){let t,r=e.match(/^\/(.+)\/([a-zA-Z]*)/);return r===null?t=new RegExp(e,"g"):t=new RegExp(r[1],r[2]),String(n).split(t)}},\u901A\u8CA8\u5F62\u5F0F:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return String(n).replace(/(?<!\.\d*?)(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}},\u30BC\u30ED\u57CB:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){n=String(n);let t="0";for(let s=0;s<e;s++)t+="0";e=parseInt(e),e<n.length&&(e=n.length);let r=t+String(n);return r.substring(r.length-e,r.length)}},\u7A7A\u767D\u57CB:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){n=String(n);let t=" ";for(let s=0;s<e;s++)t+=" ";e=parseInt(e),e<n.length&&(e=n.length);let r=t+String(n);return r.substring(r.length-e,r.length)}},\u304B\u306A\u304B\u5224\u5B9A:{type:"func",josi:[["\u3092","\u306E","\u304C"]],pure:!0,fn:function(n){let e=String(n).charCodeAt(0);return e>=12353&&e<=12447}},\u30AB\u30BF\u30AB\u30CA\u5224\u5B9A:{type:"func",josi:[["\u3092","\u306E","\u304C"]],pure:!0,fn:function(n){let e=String(n).charCodeAt(0);return e>=12449&&e<=12538}},\u6570\u5B57\u5224\u5B9A:{type:"func",josi:[["\u3092","\u304C"]],pure:!0,fn:function(n){let e=String(n).charAt(0);return e>="0"&&e<="9"||e>="\uFF10"&&e<="\uFF19"}},\u6570\u5217\u5224\u5B9A:{type:"func",josi:[["\u3092","\u304C"]],pure:!0,fn:function(n){let e=/^[+\-+-]?([0-90-9]*)(([..][0-90-9]+)?|([..][0-90-9]+[eEeE][+\-+-]?[0-90-9]+)?)$/;return String(n).match(e)!==null}},\u914D\u5217\u7D50\u5408:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){return n instanceof Array?n.join(""+e):String(n).split(`
|
|
442
442
|
`).join(""+e)}},\u914D\u5217\u53EA\u7D50\u5408:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return n instanceof Array?n.join(""):String(n).split(`
|
|
443
|
-
`).join("")}},\u914D\u5217\u691C\u7D22:{type:"func",josi:[["\u306E","\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e){return n instanceof Array?n.indexOf(e):-1}},\u914D\u5217\u8981\u7D20\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return n instanceof Array?n.length:n instanceof Object?Object.keys(n).length:typeof n=="string"?String(n).length:1}},\u8981\u7D20\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n,e){return e.__exec("\u914D\u5217\u8981\u7D20\u6570",[n])}},LEN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n,e){return e.__exec("\u914D\u5217\u8981\u7D20\u6570",[n])}},\u914D\u5217\u633F\u5165:{type:"func",josi:[["\u306E"],["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e,t){if(n instanceof Array)return n.splice(e,0,t);throw new Error("\u300E\u914D\u5217\u633F\u5165\u300F\u3067\u914D\u5217\u4EE5\u5916\u306E\u8981\u7D20\u3078\u306E\u633F\u5165\u3002")}},\u914D\u5217\u4E00\u62EC\u633F\u5165:{type:"func",josi:[["\u306E"],["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e,t){if(n instanceof Array&&t instanceof Array){for(let r=0;r<t.length;r++)n.splice(e+r,0,t[r]);return n}throw new Error("\u300E\u914D\u5217\u4E00\u62EC\u633F\u5165\u300F\u3067\u914D\u5217\u4EE5\u5916\u306E\u8981\u7D20\u3078\u306E\u633F\u5165\u3002")}},\u914D\u5217\u30BD\u30FC\u30C8:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){if(n instanceof Array)return n.sort();throw new Error("\u300E\u914D\u5217\u30BD\u30FC\u30C8\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u6570\u5024\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){if(n instanceof Array){for(let e=0;e<n.length;e++)n[e]=parseFloat(n[e]);return n}throw new Error("\u300E\u914D\u5217\u6570\u5024\u5909\u63DB\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u6570\u5024\u30BD\u30FC\u30C8:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){if(n instanceof Array)return n.sort((e,t)=>parseFloat(e)-parseFloat(t));throw new Error("\u300E\u914D\u5217\u6570\u5024\u30BD\u30FC\u30C8\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u30AB\u30B9\u30BF\u30E0\u30BD\u30FC\u30C8:{type:"func",josi:[["\u3067"],["\u306E","\u3092"]],pure:!1,fn:function(n,e,t){let r=n;if(typeof n=="string"&&(r=t.__findFunc(n,"\u914D\u5217\u30AB\u30B9\u30BF\u30E0\u30BD\u30FC\u30C8")),e instanceof Array)return e.sort(r);throw new Error("\u300E\u914D\u5217\u30AB\u30B9\u30BF\u30E0\u30BD\u30FC\u30C8\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u9006\u9806:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){if(n instanceof Array)return n.reverse();throw new Error("\u300E\u914D\u5217\u30BD\u30FC\u30C8\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u30B7\u30E3\u30C3\u30D5\u30EB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){if(n instanceof Array){for(let e=n.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1)),r=n[e];n[e]=n[t],n[t]=r}return n}throw new Error("\u300E\u914D\u5217\u30B7\u30E3\u30C3\u30D5\u30EB\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u524A\u9664:{type:"func",josi:[["\u306E","\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t){return t.__exec("\u914D\u5217\u5207\u53D6",[n,e,t])}},\u914D\u5217\u5207\u53D6:{type:"func",josi:[["\u306E","\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e){if(n instanceof Array){if(typeof e=="number"){let t=n.splice(e,1);if(t instanceof Array)return t[0]}if(typeof e=="object"&&typeof e.\u5148\u982D=="number"){let t=e.\u5148\u982D,r=e.\u672B\u5C3E-e.\u5148\u982D+1;return n.splice(t,r)}return null}if(n instanceof Object&&typeof e=="string"){if(n[e]){let t=n[e];return delete n[e],t}return}throw new Error("\u300E\u914D\u5217\u5207\u53D6\u300F\u3067\u914D\u5217\u4EE5\u5916\u3092\u6307\u5B9A\u3002")}},\u914D\u5217\u53D6\u51FA:{type:"func",josi:[["\u306E"],["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t){if(n instanceof Array)return n.splice(e,t);throw new Error("\u300E\u914D\u5217\u53D6\u51FA\u300F\u3067\u914D\u5217\u4EE5\u5916\u3092\u6307\u5B9A\u3002")}},\u914D\u5217\u30DD\u30C3\u30D7:{type:"func",josi:[["\u306E","\u304B\u3089"]],pure:!0,fn:function(n){if(n instanceof Array)return n.pop();throw new Error("\u300E\u914D\u5217\u30DD\u30C3\u30D7\u300F\u3067\u914D\u5217\u4EE5\u5916\u306E\u51E6\u7406\u3002")}},\u914D\u5217\u30D7\u30C3\u30B7\u30E5:{type:"func",josi:[["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e,t){return t.__exec("\u914D\u5217\u8FFD\u52A0",[n,e,t])}},\u914D\u5217\u8FFD\u52A0:{type:"func",josi:[["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e){if(n instanceof Array)return n.push(e),n;throw new Error("\u300E\u914D\u5217\u8FFD\u52A0\u300F\u3067\u914D\u5217\u4EE5\u5916\u306E\u51E6\u7406\u3002")}},\u914D\u5217\u8907\u88FD:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return JSON.parse(JSON.stringify(n))}},\u914D\u5217\u7BC4\u56F2\u30B3\u30D4\u30FC:{type:"func",josi:[["\u306E","\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e){if(!Array.isArray(n))throw new Error("\u300E\u914D\u5217\u7BC4\u56F2\u30B3\u30D4\u30FC\u300F\u3067\u914D\u5217\u4EE5\u5916\u306E\u5024\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002");if(typeof e=="number")return typeof n[e]=="object"?JSON.parse(JSON.stringify(n[e])):n[e];if(typeof e=="object"&&typeof e.\u5148\u982D=="number"){let t=e.\u5148\u982D,r=e.\u672B\u5C3E+1;return JSON.parse(JSON.stringify(n.slice(t,r)))}}},\u53C2\u7167:{type:"func",josi:[["\u304B\u3089","\u306E"],["\u3092"]],pure:!0,fn:function(n,e,t){if(typeof n=="string"){if(typeof e=="number")return n.charAt(e);if(typeof e=="object"&&typeof e.\u5148\u982D=="number"){let r=e.\u5148\u982D,s=e.\u672B\u5C3E+1;return n.substring(r,s)}throw new Error(`\u300E\u53C2\u7167\u300F\u3067\u6587\u5B57\u5217\u578B\u306E\u7BC4\u56F2\u6307\u5B9A(${JSON.stringify(e)})\u304C\u4E0D\u6B63\u3067\u3059\u3002`)}if(Array.isArray(n)){if(typeof e=="number")return n[e];if(typeof e=="object"&&typeof e.\u5148\u982D=="number"){let r=e.\u5148\u982D,s=e.\u672B\u5C3E+1;return n.slice(r,s)}}if(typeof n=="object")return n[e];throw new Error("\u300E\u53C2\u7167\u300F\u3067\u6587\u5B57\u5217/\u914D\u5217/\u8F9E\u66F8\u578B\u4EE5\u5916\u306E\u5024\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u53C2\u7167:{type:"func",josi:[["\u306E","\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t){return t.__exec("\u53C2\u7167",[n,e,t])}},\u914D\u5217\u8DB3:{type:"func",josi:[["\u306B","\u3078","\u3068"],["\u3092"]],pure:!0,fn:function(n,e){return n instanceof Array?n.concat(e):JSON.parse(JSON.stringify(n))}},\u914D\u5217\u6700\u5927\u5024:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return n.reduce((e,t)=>Math.max(e,t))}},\u914D\u5217\u6700\u5C0F\u5024:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return n.reduce((e,t)=>Math.min(e,t))}},\u914D\u5217\u5408\u8A08:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(n instanceof Array){let e=0;return n.forEach(t=>{let r=parseFloat(t);isNaN(r)||(e+=r)}),e}throw new Error("\u300E\u914D\u5217\u5408\u8A08\u300F\u3067\u914D\u5217\u5909\u6570\u4EE5\u5916\u306E\u5024\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u5165\u66FF:{type:"func",josi:[["\u306E"],["\u3068"],["\u3092"]],pure:!0,fn:function(n,e,t){if(!(n instanceof Array))throw new Error("\u300E\u914D\u5217\u5165\u66FF\u300F\u306E\u7B2C1\u5F15\u6570\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");let r=n[e];return n[e]=n[t],n[t]=r,n}},\u914D\u5217\u9023\u756A\u4F5C\u6210:{type:"func",josi:[["\u304B\u3089"],["\u307E\u3067\u306E","\u307E\u3067","\u306E"]],pure:!0,fn:function(n,e){let t=[];for(let r=n;r<=e;r++)t.push(r);return t}},\u914D\u5217\u8981\u7D20\u4F5C\u6210:{type:"func",josi:[["\u3092"],["\u3060\u3051"]],pure:!0,fn:function(n,e){let t=[];for(let r=0;r<e;r++)t.push(n);return t}},\u914D\u5217\u95A2\u6570\u9069\u7528:{type:"func",josi:[["\u3092"],["\u3078","\u306B"]],pure:!0,fn:function(n,e,t){let r=n;typeof n=="string"&&(r=t.__findFunc(n,"\u914D\u5217\u95A2\u6570\u9069\u7528"));let s=[];for(let i of e)s.push(r(i));return s}},\u914D\u5217\u30DE\u30C3\u30D7:{type:"func",josi:[["\u3092"],["\u3078","\u306B"]],pure:!0,fn:function(n,e,t){return t.__exec("\u914D\u5217\u95A2\u6570\u9069\u7528",[n,e,t])}},\u914D\u5217\u30D5\u30A3\u30EB\u30BF:{type:"func",josi:[["\u3067","\u306E"],["\u3092","\u306B\u3064\u3044\u3066"]],pure:!0,fn:function(n,e,t){let r=n;typeof n=="string"&&(r=t.__findFunc(n,"\u914D\u5217\u30D5\u30A3\u30EB\u30BF"));let s=[];for(let i of e)r(i)&&s.push(i);return s}},\u8868\u30BD\u30FC\u30C8:{type:"func",josi:[["\u306E"],["\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u30BD\u30FC\u30C8\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.sort((t,r)=>{let s=t[e],i=r[e];return s===i?0:s<i?-1:1}),n}},\u8868\u6570\u5024\u30BD\u30FC\u30C8:{type:"func",josi:[["\u306E"],["\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u6570\u5024\u30BD\u30FC\u30C8\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.sort((t,r)=>{let s=t[e],i=r[e];return s-i}),n}},\u8868\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7:{type:"func",josi:[["\u306E"],["\u304B\u3089"],["\u3092","\u3067"]],pure:!0,fn:function(n,e,t){if(!(n instanceof Array))throw new Error("\u300E\u8868\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.filter(r=>String(r[e]).indexOf(t)>=0)}},\u8868\u5B8C\u5168\u4E00\u81F4\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7:{type:"func",josi:[["\u306E"],["\u304B\u3089"],["\u3092","\u3067"]],pure:!0,fn:function(n,e,t){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5B8C\u5168\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.filter(r=>r[e]===t)}},\u8868\u691C\u7D22:{type:"func",josi:[["\u306E"],["\u3067","\u306B"],["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t,r){if(!(n instanceof Array))throw new Error("\u300E\u8868\u691C\u7D22\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");for(let s=t;s<n.length;s++)if(n[s][e]===r)return s;return-1}},\u8868\u5217\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5217\u6570\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let e=1;for(let t=0;t<n.length;t++)n[t].length>e&&(e=n[t].length);return e}},\u8868\u884C\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(!(n instanceof Array))throw new Error("\u300E\u8868\u884C\u6570\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.length}},\u8868\u884C\u5217\u4EA4\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u884C\u5217\u4EA4\u63DB\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let t=e.__exec("\u8868\u5217\u6570",[n]),r=n.length,s=[];for(let i=0;i<t;i++){let o=[];s.push(o);for(let u=0;u<r;u++)o[u]=n[u][i]!==void 0?n[u][i]:""}return s}},\u8868\u53F3\u56DE\u8EE2:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u53F3\u56DE\u8EE2\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let t=e.__exec("\u8868\u5217\u6570",[n]),r=n.length,s=[];for(let i=0;i<t;i++){let o=[];s.push(o);for(let u=0;u<r;u++)o[u]=n[r-u-1][i]}return s}},\u8868\u91CD\u8907\u524A\u9664:{type:"func",josi:[["\u306E"],["\u3092","\u3067"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u91CD\u8907\u524A\u9664\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let t=[],r={};for(let s=0;s<n.length;s++){let i=n[s][e];r[i]===void 0&&(r[i]=!0,t.push(n[s]))}return t}},\u8868\u5217\u53D6\u5F97:{type:"func",josi:[["\u306E"],["\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5217\u53D6\u5F97\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.map(r=>r[e])}},\u8868\u5217\u633F\u5165:{type:"func",josi:[["\u306E"],["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e,t){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5217\u633F\u5165\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let r=[];return n.forEach((s,i)=>{let o=[];e>0&&(o=o.concat(s.slice(0,e))),o.push(t[i]),o=o.concat(s.slice(e)),r.push(o)}),r}},\u8868\u5217\u524A\u9664:{type:"func",josi:[["\u306E"],["\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5217\u524A\u9664\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let t=[];return n.forEach(r=>{let s=r.slice(0);s.splice(e,1),t.push(s)}),t}},\u8868\u5217\u5408\u8A08:{type:"func",josi:[["\u306E"],["\u3092","\u3067"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5217\u5408\u8A08\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let t=0;return n.forEach(r=>{t+=r[e]}),t}},\u8868\u66D6\u6627\u691C\u7D22:{type:"func",josi:[["\u306E"],["\u304B\u3089"],["\u3067"],["\u3092"]],pure:!0,fn:function(n,e,t,r){if(!(n instanceof Array))throw new Error("\u300E\u8868\u66D6\u6627\u691C\u7D22\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let s=new RegExp(r);for(let i=e;i<n.length;i++){let o=n[i];if(s.test(o[t]))return i}return-1}},\u8868\u6B63\u898F\u8868\u73FE\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7:{type:"func",josi:[["\u306E","\u3067"],["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t){if(!(n instanceof Array))throw new Error("\u300E\u8868\u6B63\u898F\u8868\u73FE\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let r=new RegExp(t),s=[];for(let i=0;i<n.length;i++){let o=n[i];r.test(o[e])&&s.push(o.slice(0))}return s}},\u8F9E\u66F8\u30AD\u30FC\u5217\u6319:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){let e=[];if(n instanceof Object){for(let t in n)e.push(t);return e}if(n instanceof Array){for(let t=0;t<n.length;t++)e.push(t);return e}throw new Error("\u300E\u8F9E\u66F8\u30AD\u30FC\u5217\u6319\u300F\u3067\u30CF\u30C3\u30B7\u30E5\u4EE5\u5916\u304C\u4E0E\u3048\u3089\u308C\u307E\u3057\u305F\u3002")}},\u8F9E\u66F8\u30AD\u30FC\u524A\u9664:{type:"func",josi:[["\u304B\u3089","\u306E"],["\u3092"]],pure:!0,fn:function(n,e){if(n instanceof Object)return e in n&&delete n[e],n;throw new Error("\u300E\u8F9E\u66F8\u30AD\u30FC\u524A\u9664\u300F\u3067\u30CF\u30C3\u30B7\u30E5\u4EE5\u5916\u304C\u4E0E\u3048\u3089\u308C\u307E\u3057\u305F\u3002")}},\u8F9E\u66F8\u30AD\u30FC\u5B58\u5728:{type:"func",josi:[["\u306E","\u306B"],["\u304C"]],pure:!0,fn:function(n,e){return e in n}},\u30CF\u30C3\u30B7\u30E5\u30AD\u30FC\u5217\u6319:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n,e){return e.__exec("\u8F9E\u66F8\u30AD\u30FC\u5217\u6319",[n,e])}},\u30CF\u30C3\u30B7\u30E5\u5185\u5BB9\u5217\u6319:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){let e=[];if(n instanceof Object){for(let t in n)e.push(n[t]);return e}throw new Error("\u300E\u30CF\u30C3\u30B7\u30E5\u5185\u5BB9\u5217\u6319\u300F\u3067\u30CF\u30C3\u30B7\u30E5\u4EE5\u5916\u304C\u4E0E\u3048\u3089\u308C\u307E\u3057\u305F\u3002")}},\u30CF\u30C3\u30B7\u30E5\u30AD\u30FC\u524A\u9664:{type:"func",josi:[["\u304B\u3089","\u306E"],["\u3092"]],pure:!0,fn:function(n,e,t){return t.__exec("\u8F9E\u66F8\u30AD\u30FC\u524A\u9664",[n,e,t])}},\u30CF\u30C3\u30B7\u30E5\u30AD\u30FC\u5B58\u5728:{type:"func",josi:[["\u306E","\u306B"],["\u304C"]],pure:!0,fn:function(n,e){return e in n}},\u79D2\u5F85:{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:function(n,e){return new Promise((t,r)=>{try{let s=setTimeout(()=>{let i=e.__timeout.indexOf(s);i>=0&&e.__timeout.splice(i,1),t()},parseFloat(n)*1e3);e.__timeout.push(s)}catch(s){r(s)}})},return_none:!0},\u79D2\u5F85\u6A5F:{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:async function(n,e){return await e.__exec("\u79D2\u5F85",[n,e])},return_none:!0},\u79D2\u9010\u6B21\u5F85\u6A5F:{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:async function(n,e){return await e.__exec("\u79D2\u5F85",[n,e])},return_none:!0},\u79D2\u5F8C:{type:"func",josi:[["\u3092"],[""]],pure:!0,fn:function(n,e,t){typeof n=="string"&&(n=t.__findFunc(n,"\u79D2\u5F8C"));let r=setTimeout(()=>{let s=t.__timeout.indexOf(r);s>=0&&t.__timeout.splice(s,1);try{n(r,t)}catch(i){let o=i;i instanceof J||(o=new J(i,t.__getSysVar("__line"))),t.logger.error(o)}},parseFloat(e)*1e3);return t.__timeout.unshift(r),t.__setSysVar("\u5BFE\u8C61",r),r}},\u79D2\u6BCE:{type:"func",josi:[["\u3092"],[""]],pure:!1,fn:function(n,e,t){typeof n=="string"&&(n=t.__findFunc(n,"\u79D2\u6BCE"));let r=setInterval(()=>{n(r,t)},parseFloat(e)*1e3);return t.__interval.unshift(r),t.__setSysVar("\u5BFE\u8C61",r),r}},\u79D2\u30BF\u30A4\u30DE\u30FC\u958B\u59CB\u6642:{type:"func",josi:[["\u3092"],[""]],pure:!1,fn:function(n,e,t){return t.__exec("\u79D2\u6BCE",[n,e,t])}},\u30BF\u30A4\u30DE\u30FC\u505C\u6B62:{type:"func",josi:[["\u306E","\u3067"]],pure:!0,fn:function(n,e){let t=e.__interval.indexOf(n);if(t>=0)return e.__interval.splice(t,1),clearInterval(n),!0;let r=e.__timeout.indexOf(n);return r>=0?(e.__timeout.splice(r,1),clearTimeout(n),!0):!1},return_none:!1},\u5168\u30BF\u30A4\u30DE\u30FC\u505C\u6B62:{type:"func",josi:[],pure:!0,fn:function(n){for(let e=0;e<n.__interval.length;e++){let t=n.__interval[e];clearInterval(t)}n.__interval=[];for(let e=0;e<n.__timeout.length;e++){let t=n.__timeout[e];clearTimeout(t)}n.__timeout=[]},return_none:!0},\u5143\u53F7\u30C7\u30FC\u30BF:{type:"const",value:[{\u5143\u53F7:"\u4EE4\u548C",\u6539\u5143\u65E5:"2019/05/01"},{\u5143\u53F7:"\u5E73\u6210",\u6539\u5143\u65E5:"1989/01/08"},{\u5143\u53F7:"\u662D\u548C",\u6539\u5143\u65E5:"1926/12/25"},{\u5143\u53F7:"\u5927\u6B63",\u6539\u5143\u65E5:"1912/07/30"},{\u5143\u53F7:"\u660E\u6CBB",\u6539\u5143\u65E5:"1868/10/23"}]},\u4ECA:{type:"func",josi:[],pure:!0,fn:function(){let n=t=>(t="00"+t,t.substring(t.length-2,t.length)),e=new Date;return n(e.getHours())+":"+n(e.getMinutes())+":"+n(e.getSeconds())}},\u30B7\u30B9\u30C6\u30E0\u6642\u9593:{type:"func",josi:[],pure:!0,fn:function(){return Math.floor(new Date().getTime()/1e3)}},\u30B7\u30B9\u30C6\u30E0\u6642\u9593\u30DF\u30EA\u79D2:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getTime()}},\u4ECA\u65E5:{type:"func",josi:[],pure:!0,fn:function(n){return n.__formatDate(new Date)}},\u660E\u65E5:{type:"func",josi:[],pure:!0,fn:function(n){let e=Date.now()+864e5;return n.__formatDate(new Date(e))}},\u6628\u65E5:{type:"func",josi:[],pure:!0,fn:function(n){let e=Date.now()-864e5;return n.__formatDate(new Date(e))}},\u4ECA\u5E74:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getFullYear()}},\u6765\u5E74:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getFullYear()+1}},\u53BB\u5E74:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getFullYear()-1}},\u4ECA\u6708:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getMonth()+1}},\u6765\u6708:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getMonth()+2}},\u5148\u6708:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getMonth()}},\u66DC\u65E5:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n,e){let t=e.__str2date(n);return"\u65E5\u6708\u706B\u6C34\u6728\u91D1\u571F".charAt(t.getDay()%7)}},\u66DC\u65E5\u756A\u53F7\u53D6\u5F97:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){let e=n.split("/");return new Date(e[0],e[1]-1,e[2]).getDay()}},UNIXTIME\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092","\u304B\u3089"]],pure:!0,fn:function(n,e){return e.__str2date(n).getTime()/1e3}},UNIX\u6642\u9593\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092","\u304B\u3089"]],pure:!0,fn:function(n,e){return e.__str2date(n).getTime()/1e3}},\u65E5\u6642\u5909\u63DB:{type:"func",josi:[["\u3092","\u304B\u3089"]],pure:!0,fn:function(n,e){let t=n*1e3;return e.__formatDateTime(new Date(t),"2022/01/01 00:00:00")}},\u65E5\u6642\u66F8\u5F0F\u5909\u63DB:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e,t){let r=t.__str2date(n);return e=e.replace(/(YYYY|ccc|WWW|MMM|YY|MM|DD|HH|mm|ss|[MDHmsW])/g,s=>{switch(s){case"YYYY":return r.getFullYear();case"YY":return(""+r.getFullYear()).substring(2);case"MM":return t.__zero2(r.getMonth()+1);case"DD":return t.__zero2(r.getDate());case"M":return r.getMonth()+1;case"D":return r.getDate();case"HH":return t.__zero2(r.getHours());case"mm":return t.__zero2(r.getMinutes());case"ss":return t.__zero2(r.getSeconds());case"ccc":return t.__zero(r.getMilliseconds(),3);case"H":return r.getHours();case"m":return r.getMinutes();case"s":return r.getSeconds();case"W":return"\u65E5\u6708\u706B\u6C34\u6728\u91D1\u571F".charAt(r.getDay()%7);case"WWW":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][r.getDay()%7];case"MMM":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.getMonth()]}return s}),e}},\u548C\u66A6\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){let t=e.__str2date(n),r=t.getTime();for(let s of e.__getSysVar("\u5143\u53F7\u30C7\u30FC\u30BF")){let i=s.\u5143\u53F7,o=e.__str2date(s.\u6539\u5143\u65E5);if(o.getTime()<=r){let c=t.getFullYear()-o.getFullYear()+1;return c===1&&(c="\u5143"),i+c+"\u5E74"+e.__zero2(t.getMonth()+1)+"\u6708"+e.__zero2(t.getDate())+"\u65E5"}}throw new Error("\u300E\u548C\u66A6\u5909\u63DB\u300F\u306F\u660E\u793A\u4EE5\u524D\u306E\u65E5\u4ED8\u306B\u306F\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002")}},\u5E74\u6570\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=t.__str2date(n);return t.__str2date(e).getFullYear()-r.getFullYear()}},\u6708\u6570\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=t.__str2date(n),s=t.__str2date(e);return s.getFullYear()*12+s.getMonth()-(r.getFullYear()*12+r.getMonth())}},\u65E5\u6570\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=Math.ceil(t.__str2date(n).getTime()/1e3),s=Math.ceil(t.__str2date(e).getTime()/1e3);return Math.ceil((s-r)/(60*60*24))}},\u6642\u9593\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=Math.ceil(t.__str2date(n).getTime()/1e3),s=Math.ceil(t.__str2date(e).getTime()/1e3);return Math.ceil((s-r)/(60*60))}},\u5206\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=Math.ceil(t.__str2date(n).getTime()/1e3),s=Math.ceil(t.__str2date(e).getTime()/1e3);return Math.ceil((s-r)/60)}},\u79D2\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=Math.ceil(t.__str2date(n).getTime()/1e3),s=Math.ceil(t.__str2date(e).getTime()/1e3);return Math.ceil(s-r)}},\u65E5\u6642\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"],["\u306B\u3088\u308B"]],pure:!0,fn:function(n,e,t,r){switch(t){case"\u5E74":return r.__exec("\u5E74\u6570\u5DEE",[n,e,r]);case"\u6708":return r.__exec("\u6708\u6570\u5DEE",[n,e,r]);case"\u65E5":return r.__exec("\u65E5\u6570\u5DEE",[n,e,r]);case"\u6642\u9593":return r.__exec("\u6642\u9593\u5DEE",[n,e,r]);case"\u5206":return r.__exec("\u5206\u5DEE",[n,e,r]);case"\u79D2":return r.__exec("\u79D2\u5DEE",[n,e,r])}throw new Error("\u300E\u65E5\u6642\u5DEE\u300F\u3067\u4E0D\u660E\u306A\u5358\u4F4D\u3067\u3059\u3002")}},\u6642\u9593\u52A0\u7B97:{type:"func",josi:[["\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){let r=e.charAt(0);(r==="-"||r==="+")&&(e=e.substring(1));let s=t.__str2date(n),i=(e+":0:0").split(":"),o=parseInt(i[0])*60*60+parseInt(i[1])*60+parseInt(i[2]);r==="-"&&(o*=-1);let u=new Date(s.getTime()+o*1e3);return t.__formatDateTime(u,n)}},\u65E5\u4ED8\u52A0\u7B97:{type:"func",josi:[["\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){let r=1,s=e.charAt(0);(s==="-"||s==="+")&&(e=e.substring(1),s==="-"&&(r*=-1));let i=t.__str2date(n),o=(e+"/0/0").split("/"),u=parseInt(o[0])*r,c=parseInt(o[1])*r,a=parseInt(o[2])*r;return i.setFullYear(i.getFullYear()+u),i.setMonth(i.getMonth()+c),i.setDate(i.getDate()+a),t.__formatDateTime(i,n)}},\u65E5\u6642\u52A0\u7B97:{type:"func",josi:[["\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){let r=(""+e).match(/([+|-]?)(\d+)(年|ヶ月|日|週間|時間|分|秒)$/);if(!r)throw new Error("\u300E\u65E5\u4ED8\u52A0\u7B97\u300F\u306F\u300E(+\uFF5C-)1(\u5E74|\u30F6\u6708|\u65E5|\u6642\u9593|\u5206|\u79D2)\u300F\u306E\u66F8\u5F0F\u3067\u6307\u5B9A\u3057\u307E\u3059\u3002");switch(r[3]){case"\u5E74":return t.__exec("\u65E5\u4ED8\u52A0\u7B97",[n,`${r[1]}${r[2]}/0/0`,t]);case"\u30F6\u6708":return t.__exec("\u65E5\u4ED8\u52A0\u7B97",[n,`${r[1]}0/${r[2]}/0`,t]);case"\u9031\u9593":return t.__exec("\u65E5\u4ED8\u52A0\u7B97",[n,`${r[1]}0/0/${parseInt(r[2])*7}`,t]);case"\u65E5":return t.__exec("\u65E5\u4ED8\u52A0\u7B97",[n,`${r[1]}0/0/${r[2]}`,t]);case"\u6642\u9593":return t.__exec("\u6642\u9593\u52A0\u7B97",[n,`${r[1]}${r[2]}:0:0`,t]);case"\u5206":return t.__exec("\u6642\u9593\u52A0\u7B97",[n,`${r[1]}0:${r[2]}:0`,t]);case"\u79D2":return t.__exec("\u6642\u9593\u52A0\u7B97",[n,`${r[1]}0:0:${r[2]}`,t])}}},\u6642\u9593\u30DF\u30EA\u79D2\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(){return performance&&performance.now?performance.now():Date.now?Date.now():new Date().getTime()}},\u30C7\u30D0\u30C3\u30B0\u8868\u793A:{type:"func",josi:[["\u3068","\u3092","\u306E"]],pure:!0,fn:function(n,e){let r=(e.__getSysVar("__line",0)+"::").split(":",2),s=parseInt(String(r[0]).replace("l",""))+1,i=r[1];typeof n=="object"&&(n=JSON.stringify(n)),n=`${i}(${s}): ${n}`,e.__exec("\u8868\u793A",[n,e])},return_none:!0},\u30CF\u30C6\u30CA\u95A2\u6570\u8A2D\u5B9A:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n,e){if(typeof n=="function"){e.__hatena=n;return}if(typeof n=="string"){e.__hatena=e.__getSysVar(n,"\u30C7\u30D0\u30C3\u30B0\u8868\u793A");return}if(n instanceof Array){let t=n.map(r=>{if(r.substring(0,3)==="JS:"){let s=r.substring(3);return e.__evalJS(s,e)}else return e.__getSysVar(r,"\u30C7\u30D0\u30C3\u30B0\u8868\u793A")});e.__hatena=(r,s)=>{let i=r;for(let o of t)i=o(i,s)};return}e.__hatena=e.__getSysVar("\u30C7\u30D0\u30C3\u30B0\u8868\u793A")},return_none:!0},\u30CF\u30C6\u30CA\u95A2\u6570\u5B9F\u884C:{type:"func",josi:[["\u306E","\u3092","\u3068"]],pure:!0,fn:function(n,e){e.__hatena(n,e)},return_none:!0},\u30A8\u30E9\u30FC\u767A\u751F:{type:"func",josi:[["\u306E","\u3067"]],pure:!0,fn:function(n){throw new Error(n)},return_none:!0},__DEBUG:{type:"func",josi:[],pure:!0,fn:function(n){n.isDebug=!0,console.log(n)}},__DEBUG\u5F37\u5236\u5F85\u6A5F:{type:"const",value:0},__DEBUG\u30D6\u30EC\u30A4\u30AF\u30DD\u30A4\u30F3\u30C8\u4E00\u89A7:{type:"const",value:[]},__DEBUG\u5F85\u6A5F\u30D5\u30E9\u30B0:{type:"const",value:0},__DEBUG_BP_WAIT:{type:"func",josi:[["\u3067"]],pure:!0,asyncFn:!0,fn:function(n,e){return new Promise(t=>{let r=e.__getSysVar("__DEBUG\u30D6\u30EC\u30A4\u30AF\u30DD\u30A4\u30F3\u30C8\u4E00\u89A7"),s=e.__getSysVar("__DEBUG\u5F37\u5236\u5F85\u6A5F");if(e.__setSysVar("__DEBUG\u5F37\u5236\u5F85\u6A5F",0),r.indexOf(n)>=0||s){if(e.__getSysVar("\u30D7\u30E9\u30B0\u30A4\u30F3\u540D")!=="\u30E1\u30A4\u30F3")return;console.log(`@__DEBUG_BP_WAIT(${n})`);let i=setInterval(()=>{e.__getSysVar("__DEBUG\u5F85\u6A5F\u30D5\u30E9\u30B0")===1&&(e.__setSysVar("__DEBUG\u5F85\u6A5F\u30D5\u30E9\u30B0",0),clearInterval(i),t(n))},500)}else t(n)})}},\u30B0\u30ED\u30FC\u30D0\u30EB\u95A2\u6570\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(n){let e=n.__varslist[1],t=[];for(let r of e.keys())t.push(r);return t}},\u30B7\u30B9\u30C6\u30E0\u95A2\u6570\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(n){let e=n.__v0,t=[];for(let r of e.keys())r.startsWith("__")||r.startsWith("!")||r==="meta"||t.push(r);return t}},\u30B7\u30B9\u30C6\u30E0\u95A2\u6570\u5B58\u5728:{type:"func",josi:[["\u304C","\u306E"]],pure:!0,fn:function(n,e){return typeof e.__getSysVar(n)<"u"}},\u30D7\u30E9\u30B0\u30A4\u30F3\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(n){let e=[];for(let t in n.pluginfiles)e.push(t);return e}},\u30E2\u30B8\u30E5\u30FC\u30EB\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(n){let e=[];for(let t in n.__module)e.push(t);return e}},\u52A9\u8A5E\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,asyncFn:!1,fn:function(n){return n.josiList}},\u4E88\u7D04\u8A9E\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,asyncFn:!1,fn:function(n){return n.reservedWords}},\u30D7\u30E9\u30B0\u30A4\u30F3\u540D:{type:"const",value:"\u30E1\u30A4\u30F3"},\u30D7\u30E9\u30B0\u30A4\u30F3\u540D\u8A2D\u5B9A:{type:"func",josi:[["\u306B","\u3078"]],pure:!0,fn:function(n,e){e.__setSysVar("\u30D7\u30E9\u30B0\u30A4\u30F3\u540D",n)},return_none:!0},\u540D\u524D\u7A7A\u9593:{type:"const",value:""},\u540D\u524D\u7A7A\u9593\u8A2D\u5B9A:{type:"func",josi:[["\u306B","\u3078"]],pure:!0,fn:function(n,e){e.__namespaceList.push([e.__getSysVar("\u540D\u524D\u7A7A\u9593"),e.__getSysVar("\u30D7\u30E9\u30B0\u30A4\u30F3\u540D")]),e.__setSysVar("\u540D\u524D\u7A7A\u9593",n)},return_none:!0},\u540D\u524D\u7A7A\u9593\u30DD\u30C3\u30D7:{type:"func",josi:[],pure:!0,fn:function(n){let e=n.__namespaceList.pop();e&&(n.__setSysVar("\u540D\u524D\u7A7A\u9593",e[0]),n.__setSysVar("\u30D7\u30E9\u30B0\u30A4\u30F3\u540D",e[1]))},return_none:!0},URL\u30A8\u30F3\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u304B\u3089"]],pure:!0,fn:function(n){return encodeURIComponent(n)}},URL\u30C7\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u3078","\u306B"]],pure:!0,fn:function(n){return decodeURIComponent(n)}},URL\u30D1\u30E9\u30E1\u30FC\u30BF\u89E3\u6790:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){let t={};if(typeof n!="string")return t;let r=n.split("?");if(r.length<=1)return t;let s=r[1].split("&");for(let i of s){let u=(i+"=").split("="),c=e.__exec("URL\u30C7\u30B3\u30FC\u30C9",[u[0]]);t[c]=e.__exec("URL\u30C7\u30B3\u30FC\u30C9",[u[1]])}return t}},BASE64\u30A8\u30F3\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u304B\u3089"]],pure:!0,fn:function(n){if(typeof window<"u"&&window.btoa){let e=new TextEncoder().encode(n),t=String.fromCharCode.apply(null,e);return btoa(t)}if(typeof Buffer<"u")return Buffer.from(n).toString("base64");throw new Error("\u300EBASE64\u30A8\u30F3\u30B3\u30FC\u30C9\u300F\u306F\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002")}},BASE64\u30C7\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u3078","\u306B"]],pure:!0,fn:function(n){if(typeof window<"u"&&window.atob){let e=atob(n),t=Array.prototype.map.call(e,s=>s.charCodeAt()),r=new Uint8Array(t);return new TextDecoder("UTF-8").decode(r)}if(typeof Buffer<"u")return Buffer.from(n,"base64").toString();throw new Error("\u300EBASE64\u30C7\u30B3\u30FC\u30C9\u300F\u306F\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002")}}};var We={meta:{type:"const",value:{pluginName:"plugin_math",description:"\u6570\u5B66\u95A2\u6570\u3092\u63D0\u4F9B\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.6.0",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"^3.6.0"}},\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(){}},SIN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.sin(n)}},COS:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.cos(n)}},TAN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.tan(n)}},ARCSIN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.asin(n)}},ARCCOS:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.acos(n)}},ARCTAN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.atan(n)}},ATAN2:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return Math.atan2(n,e)}},\u5EA7\u6A19\u89D2\u5EA6\u8A08\u7B97:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.atan2(n[1],n[0])/Math.PI*180}},RAD2DEG:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return n/Math.PI*180}},DEG2RAD:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return n/180*Math.PI}},\u5EA6\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return n/Math.PI*180}},\u30E9\u30B8\u30A2\u30F3\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return n/180*Math.PI}},SIGN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return parseFloat(n)===0?0:n>0?1:-1}},\u7B26\u53F7:{type:"func",josi:[["\u306E"]],pure:!1,fn:function(n,e){return e.__exec("SIGN",[n])}},ABS:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.abs(n)}},\u7D76\u5BFE\u5024:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.abs(n)}},EXP:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.exp(n)}},HYPOT:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return Math.hypot(n,e)}},\u659C\u8FBA:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return Math.hypot(n,e)}},LN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.log(n)}},LOG:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.log(n)}},LOGN:{type:"func",josi:[["\u3067"],["\u306E"]],pure:!0,fn:function(n,e){return n===2?Math.LOG2E*Math.log(e):n===10?Math.LOG10E*Math.log(e):Math.log(e)/Math.log(n)}},FRAC:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return n%1}},\u5C0F\u6570\u90E8\u5206:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return n%1}},\u6574\u6570\u90E8\u5206:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.trunc(n)}},\u4E71\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(typeof n=="number")return Math.floor(Math.random()*n);if(typeof n=="object"&&n.\u5148\u982D!==void 0){let e=n.\u5148\u982D,t=n.\u672B\u5C3E;return Math.floor(Math.random()*(t-e+1))+e}if(Array.isArray(n)){let e=n[0],t=n[1];return Math.floor(Math.random()*(t-e+1))+e}}},\u4E71\u6570\u7BC4\u56F2:{type:"func",josi:[["\u304B\u3089"],["\u307E\u3067\u306E","\u306E"]],pure:!0,fn:function(n,e){return Math.floor(Math.random()*(e-n+1))+n}},SQRT:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.sqrt(n)}},\u5E73\u65B9\u6839:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.sqrt(n)}},ROUND:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Math.round(n)}},\u56DB\u6368\u4E94\u5165:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return Math.round(n)}},\u5C0F\u6570\u70B9\u5207\u4E0A:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){let t=Math.pow(10,e);return Math.ceil(n*t)/t}},\u5C0F\u6570\u70B9\u5207\u4E0B:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){let t=Math.pow(10,e);return Math.floor(n*t)/t}},\u5C0F\u6570\u70B9\u56DB\u6368\u4E94\u5165:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){let t=Math.pow(10,e);return Math.round(n*t)/t}},CEIL:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Math.ceil(n)}},\u5207\u4E0A:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Math.ceil(n)}},FLOOR:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Math.floor(n)}},\u5207\u6368:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Math.floor(n)}}};var E={delimiter:",",eol:`\r
|
|
443
|
+
`).join("")}},\u914D\u5217\u691C\u7D22:{type:"func",josi:[["\u306E","\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e){return n instanceof Array?n.indexOf(e):-1}},\u914D\u5217\u8981\u7D20\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return n instanceof Array?n.length:n instanceof Object?Object.keys(n).length:typeof n=="string"?String(n).length:1}},\u8981\u7D20\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n,e){return e.__exec("\u914D\u5217\u8981\u7D20\u6570",[n])}},LEN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n,e){return e.__exec("\u914D\u5217\u8981\u7D20\u6570",[n])}},\u914D\u5217\u633F\u5165:{type:"func",josi:[["\u306E"],["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e,t){if(n instanceof Array)return n.splice(e,0,t);throw new Error("\u300E\u914D\u5217\u633F\u5165\u300F\u3067\u914D\u5217\u4EE5\u5916\u306E\u8981\u7D20\u3078\u306E\u633F\u5165\u3002")}},\u914D\u5217\u4E00\u62EC\u633F\u5165:{type:"func",josi:[["\u306E"],["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e,t){if(n instanceof Array&&t instanceof Array){for(let r=0;r<t.length;r++)n.splice(e+r,0,t[r]);return n}throw new Error("\u300E\u914D\u5217\u4E00\u62EC\u633F\u5165\u300F\u3067\u914D\u5217\u4EE5\u5916\u306E\u8981\u7D20\u3078\u306E\u633F\u5165\u3002")}},\u914D\u5217\u30BD\u30FC\u30C8:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){if(n instanceof Array)return n.sort();throw new Error("\u300E\u914D\u5217\u30BD\u30FC\u30C8\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u6570\u5024\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){if(n instanceof Array){for(let e=0;e<n.length;e++)n[e]=parseFloat(n[e]);return n}throw new Error("\u300E\u914D\u5217\u6570\u5024\u5909\u63DB\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u6570\u5024\u30BD\u30FC\u30C8:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){if(n instanceof Array)return n.sort((e,t)=>parseFloat(e)-parseFloat(t));throw new Error("\u300E\u914D\u5217\u6570\u5024\u30BD\u30FC\u30C8\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u30AB\u30B9\u30BF\u30E0\u30BD\u30FC\u30C8:{type:"func",josi:[["\u3067"],["\u306E","\u3092"]],pure:!1,fn:function(n,e,t){let r=n;if(typeof n=="string"&&(r=t.__findFunc(n,"\u914D\u5217\u30AB\u30B9\u30BF\u30E0\u30BD\u30FC\u30C8")),e instanceof Array)return e.sort(r);throw new Error("\u300E\u914D\u5217\u30AB\u30B9\u30BF\u30E0\u30BD\u30FC\u30C8\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u9006\u9806:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){if(n instanceof Array)return n.reverse();throw new Error("\u300E\u914D\u5217\u30BD\u30FC\u30C8\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u30B7\u30E3\u30C3\u30D5\u30EB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n){if(n instanceof Array){for(let e=n.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1)),r=n[e];n[e]=n[t],n[t]=r}return n}throw new Error("\u300E\u914D\u5217\u30B7\u30E3\u30C3\u30D5\u30EB\u300F\u3067\u914D\u5217\u4EE5\u5916\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u524A\u9664:{type:"func",josi:[["\u306E","\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t){return t.__exec("\u914D\u5217\u5207\u53D6",[n,e,t])}},\u914D\u5217\u5207\u53D6:{type:"func",josi:[["\u306E","\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e){if(n instanceof Array){if(typeof e=="number"){let t=n.splice(e,1);if(t instanceof Array)return t[0]}if(typeof e=="object"&&typeof e.\u5148\u982D=="number"){let t=e.\u5148\u982D,r=e.\u672B\u5C3E-e.\u5148\u982D+1;return n.splice(t,r)}return null}if(n instanceof Object&&typeof e=="string"){if(n[e]){let t=n[e];return delete n[e],t}return}throw new Error("\u300E\u914D\u5217\u5207\u53D6\u300F\u3067\u914D\u5217\u4EE5\u5916\u3092\u6307\u5B9A\u3002")}},\u914D\u5217\u53D6\u51FA:{type:"func",josi:[["\u306E"],["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t){if(n instanceof Array)return n.splice(e,t);throw new Error("\u300E\u914D\u5217\u53D6\u51FA\u300F\u3067\u914D\u5217\u4EE5\u5916\u3092\u6307\u5B9A\u3002")}},\u914D\u5217\u30DD\u30C3\u30D7:{type:"func",josi:[["\u306E","\u304B\u3089"]],pure:!0,fn:function(n){if(n instanceof Array)return n.pop();throw new Error("\u300E\u914D\u5217\u30DD\u30C3\u30D7\u300F\u3067\u914D\u5217\u4EE5\u5916\u306E\u51E6\u7406\u3002")}},\u914D\u5217\u30D7\u30C3\u30B7\u30E5:{type:"func",josi:[["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e,t){return t.__exec("\u914D\u5217\u8FFD\u52A0",[n,e,t])}},\u914D\u5217\u8FFD\u52A0:{type:"func",josi:[["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e){if(n instanceof Array)return n.push(e),n;throw new Error("\u300E\u914D\u5217\u8FFD\u52A0\u300F\u3067\u914D\u5217\u4EE5\u5916\u306E\u51E6\u7406\u3002")}},\u914D\u5217\u8907\u88FD:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return JSON.parse(JSON.stringify(n))}},\u914D\u5217\u7BC4\u56F2\u30B3\u30D4\u30FC:{type:"func",josi:[["\u306E","\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e){if(!Array.isArray(n))throw new Error("\u300E\u914D\u5217\u7BC4\u56F2\u30B3\u30D4\u30FC\u300F\u3067\u914D\u5217\u4EE5\u5916\u306E\u5024\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002");if(typeof e=="number")return typeof n[e]=="object"?JSON.parse(JSON.stringify(n[e])):n[e];if(typeof e=="object"&&typeof e.\u5148\u982D=="number"){let t=e.\u5148\u982D,r=Number(e.\u672B\u5C3E)+1;return JSON.parse(JSON.stringify(n.slice(t,r)))}}},\u53C2\u7167:{type:"func",josi:[["\u304B\u3089","\u306E"],["\u3092"]],pure:!0,fn:function(n,e,t){if(typeof n=="string"){if(typeof e=="number")return n.charAt(e);if(typeof e=="object"&&typeof e.\u5148\u982D=="number"){let r=e.\u5148\u982D,s=Number(e.\u672B\u5C3E)+1;return n.substring(r,s)}throw new Error(`\u300E\u53C2\u7167\u300F\u3067\u6587\u5B57\u5217\u578B\u306E\u7BC4\u56F2\u6307\u5B9A(${JSON.stringify(e)})\u304C\u4E0D\u6B63\u3067\u3059\u3002`)}if(Array.isArray(n)){if(typeof e=="number")return n[e];if(typeof e=="object"&&typeof e.\u5148\u982D=="number"){let r=e.\u5148\u982D,s=Number(e.\u672B\u5C3E)+1;return n.slice(r,s)}}if(typeof n=="object")return n[e];throw new Error("\u300E\u53C2\u7167\u300F\u3067\u6587\u5B57\u5217/\u914D\u5217/\u8F9E\u66F8\u578B\u4EE5\u5916\u306E\u5024\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u53C2\u7167:{type:"func",josi:[["\u306E","\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t){return t.__exec("\u53C2\u7167",[n,e,t])}},\u914D\u5217\u8DB3:{type:"func",josi:[["\u306B","\u3078","\u3068"],["\u3092"]],pure:!0,fn:function(n,e){return n instanceof Array?n.concat(e):JSON.parse(JSON.stringify(n))}},\u914D\u5217\u6700\u5927\u5024:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return n.reduce((e,t)=>Math.max(e,t))}},\u914D\u5217\u6700\u5C0F\u5024:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return n.reduce((e,t)=>Math.min(e,t))}},\u914D\u5217\u5408\u8A08:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(n instanceof Array){let e=0;return n.forEach(t=>{let r=parseFloat(t);isNaN(r)||(e+=r)}),e}throw new Error("\u300E\u914D\u5217\u5408\u8A08\u300F\u3067\u914D\u5217\u5909\u6570\u4EE5\u5916\u306E\u5024\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u3002")}},\u914D\u5217\u5165\u66FF:{type:"func",josi:[["\u306E"],["\u3068"],["\u3092"]],pure:!0,fn:function(n,e,t){if(!(n instanceof Array))throw new Error("\u300E\u914D\u5217\u5165\u66FF\u300F\u306E\u7B2C1\u5F15\u6570\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002");let r=n[e];return n[e]=n[t],n[t]=r,n}},\u914D\u5217\u9023\u756A\u4F5C\u6210:{type:"func",josi:[["\u304B\u3089"],["\u307E\u3067\u306E","\u307E\u3067","\u306E"]],pure:!0,fn:function(n,e){let t=[];for(let r=n;r<=e;r++)t.push(r);return t}},\u914D\u5217\u8981\u7D20\u4F5C\u6210:{type:"func",josi:[["\u3092"],["\u3060\u3051","\u3067"]],pure:!0,fn:function(n,e){let t=s=>Array.isArray(s)?s.map(i=>t(i)):s instanceof Date?new Date(s.getTime()):typeof s=="object"&&s!==null?JSON.parse(JSON.stringify(s)):s,r=function(s,i){if(!Array.isArray(i))return Array.from({length:i},()=>t(s));if(Array.isArray(i)&&i.length===1)return Array.from({length:i[0]},()=>t(s));let[o,...u]=i;return Array.from({length:o},()=>r(t(s),u))};return r(n,e)}},\u914D\u5217\u95A2\u6570\u9069\u7528:{type:"func",josi:[["\u3092"],["\u3078","\u306B"]],pure:!0,fn:function(n,e,t){let r=n;typeof n=="string"&&(r=t.__findFunc(n,"\u914D\u5217\u95A2\u6570\u9069\u7528"));let s=[];for(let i of e)s.push(r(i));return s}},\u914D\u5217\u30DE\u30C3\u30D7:{type:"func",josi:[["\u3092"],["\u3078","\u306B"]],pure:!0,fn:function(n,e,t){return t.__exec("\u914D\u5217\u95A2\u6570\u9069\u7528",[n,e,t])}},\u914D\u5217\u30D5\u30A3\u30EB\u30BF:{type:"func",josi:[["\u3067","\u306E"],["\u3092","\u306B\u3064\u3044\u3066"]],pure:!0,fn:function(n,e,t){let r=n;typeof n=="string"&&(r=t.__findFunc(n,"\u914D\u5217\u30D5\u30A3\u30EB\u30BF"));let s=[];for(let i of e)r(i)&&s.push(i);return s}},\u8868\u30BD\u30FC\u30C8:{type:"func",josi:[["\u306E"],["\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u30BD\u30FC\u30C8\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.sort((t,r)=>{let s=t[e],i=r[e];return s===i?0:s<i?-1:1}),n}},\u8868\u6570\u5024\u30BD\u30FC\u30C8:{type:"func",josi:[["\u306E"],["\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u6570\u5024\u30BD\u30FC\u30C8\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.sort((t,r)=>{let s=t[e],i=r[e];return s-i}),n}},\u8868\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7:{type:"func",josi:[["\u306E"],["\u304B\u3089"],["\u3092","\u3067"]],pure:!0,fn:function(n,e,t){if(!(n instanceof Array))throw new Error("\u300E\u8868\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.filter(r=>String(r[e]).indexOf(t)>=0)}},\u8868\u5B8C\u5168\u4E00\u81F4\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7:{type:"func",josi:[["\u306E"],["\u304B\u3089"],["\u3092","\u3067"]],pure:!0,fn:function(n,e,t){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5B8C\u5168\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.filter(r=>r[e]===t)}},\u8868\u691C\u7D22:{type:"func",josi:[["\u306E"],["\u3067","\u306B"],["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t,r){if(!(n instanceof Array))throw new Error("\u300E\u8868\u691C\u7D22\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");for(let s=t;s<n.length;s++)if(n[s][e]===r)return s;return-1}},\u8868\u5217\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5217\u6570\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let e=1;for(let t=0;t<n.length;t++)n[t].length>e&&(e=n[t].length);return e}},\u8868\u884C\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(!(n instanceof Array))throw new Error("\u300E\u8868\u884C\u6570\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.length}},\u8868\u884C\u5217\u4EA4\u63DB:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u884C\u5217\u4EA4\u63DB\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let t=e.__exec("\u8868\u5217\u6570",[n]),r=n.length,s=[];for(let i=0;i<t;i++){let o=[];s.push(o);for(let u=0;u<r;u++)o[u]=n[u][i]!==void 0?n[u][i]:""}return s}},\u8868\u53F3\u56DE\u8EE2:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u53F3\u56DE\u8EE2\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let t=e.__exec("\u8868\u5217\u6570",[n]),r=n.length,s=[];for(let i=0;i<t;i++){let o=[];s.push(o);for(let u=0;u<r;u++)o[u]=n[r-u-1][i]}return s}},\u8868\u91CD\u8907\u524A\u9664:{type:"func",josi:[["\u306E"],["\u3092","\u3067"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u91CD\u8907\u524A\u9664\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let t=[],r={};for(let s=0;s<n.length;s++){let i=n[s][e];r[i]===void 0&&(r[i]=!0,t.push(n[s]))}return t}},\u8868\u5217\u53D6\u5F97:{type:"func",josi:[["\u306E"],["\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5217\u53D6\u5F97\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");return n.map(r=>r[e])}},\u8868\u5217\u633F\u5165:{type:"func",josi:[["\u306E"],["\u306B","\u3078"],["\u3092"]],pure:!0,fn:function(n,e,t){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5217\u633F\u5165\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let r=[];return n.forEach((s,i)=>{let o=[];e>0&&(o=o.concat(s.slice(0,e))),o.push(t[i]),o=o.concat(s.slice(e)),r.push(o)}),r}},\u8868\u5217\u524A\u9664:{type:"func",josi:[["\u306E"],["\u3092"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5217\u524A\u9664\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let t=[];return n.forEach(r=>{let s=r.slice(0);s.splice(e,1),t.push(s)}),t}},\u8868\u5217\u5408\u8A08:{type:"func",josi:[["\u306E"],["\u3092","\u3067"]],pure:!0,fn:function(n,e){if(!(n instanceof Array))throw new Error("\u300E\u8868\u5217\u5408\u8A08\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let t=0;return n.forEach(r=>{t+=r[e]}),t}},\u8868\u66D6\u6627\u691C\u7D22:{type:"func",josi:[["\u306E"],["\u304B\u3089"],["\u3067"],["\u3092"]],pure:!0,fn:function(n,e,t,r){if(!(n instanceof Array))throw new Error("\u300E\u8868\u66D6\u6627\u691C\u7D22\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let s=new RegExp(r);for(let i=e;i<n.length;i++){let o=n[i];if(s.test(o[t]))return i}return-1}},\u8868\u6B63\u898F\u8868\u73FE\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7:{type:"func",josi:[["\u306E","\u3067"],["\u304B\u3089"],["\u3092"]],pure:!0,fn:function(n,e,t){if(!(n instanceof Array))throw new Error("\u300E\u8868\u6B63\u898F\u8868\u73FE\u30D4\u30C3\u30AF\u30A2\u30C3\u30D7\u300F\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let r=new RegExp(t),s=[];for(let i=0;i<n.length;i++){let o=n[i];r.test(o[e])&&s.push(o.slice(0))}return s}},\u8F9E\u66F8\u30AD\u30FC\u5217\u6319:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){let e=[];if(n instanceof Object){for(let t in n)e.push(t);return e}if(n instanceof Array){for(let t=0;t<n.length;t++)e.push(t);return e}throw new Error("\u300E\u8F9E\u66F8\u30AD\u30FC\u5217\u6319\u300F\u3067\u30CF\u30C3\u30B7\u30E5\u4EE5\u5916\u304C\u4E0E\u3048\u3089\u308C\u307E\u3057\u305F\u3002")}},\u8F9E\u66F8\u30AD\u30FC\u524A\u9664:{type:"func",josi:[["\u304B\u3089","\u306E"],["\u3092"]],pure:!0,fn:function(n,e){if(n instanceof Object)return e in n&&delete n[e],n;throw new Error("\u300E\u8F9E\u66F8\u30AD\u30FC\u524A\u9664\u300F\u3067\u30CF\u30C3\u30B7\u30E5\u4EE5\u5916\u304C\u4E0E\u3048\u3089\u308C\u307E\u3057\u305F\u3002")}},\u8F9E\u66F8\u30AD\u30FC\u5B58\u5728:{type:"func",josi:[["\u306E","\u306B"],["\u304C"]],pure:!0,fn:function(n,e){return e in n}},\u30CF\u30C3\u30B7\u30E5\u30AD\u30FC\u5217\u6319:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n,e){return e.__exec("\u8F9E\u66F8\u30AD\u30FC\u5217\u6319",[n,e])}},\u30CF\u30C3\u30B7\u30E5\u5185\u5BB9\u5217\u6319:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){let e=[];if(n instanceof Object){for(let t in n)e.push(n[t]);return e}throw new Error("\u300E\u30CF\u30C3\u30B7\u30E5\u5185\u5BB9\u5217\u6319\u300F\u3067\u30CF\u30C3\u30B7\u30E5\u4EE5\u5916\u304C\u4E0E\u3048\u3089\u308C\u307E\u3057\u305F\u3002")}},\u30CF\u30C3\u30B7\u30E5\u30AD\u30FC\u524A\u9664:{type:"func",josi:[["\u304B\u3089","\u306E"],["\u3092"]],pure:!0,fn:function(n,e,t){return t.__exec("\u8F9E\u66F8\u30AD\u30FC\u524A\u9664",[n,e,t])}},\u30CF\u30C3\u30B7\u30E5\u30AD\u30FC\u5B58\u5728:{type:"func",josi:[["\u306E","\u306B"],["\u304C"]],pure:!0,fn:function(n,e){return e in n}},\u79D2\u5F85:{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:function(n,e){return new Promise((t,r)=>{try{let s=setTimeout(()=>{let i=e.__timeout.indexOf(s);i>=0&&e.__timeout.splice(i,1),t()},parseFloat(n)*1e3);e.__timeout.push(s)}catch(s){r(s)}})},return_none:!0},\u79D2\u5F85\u6A5F:{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:async function(n,e){return await e.__exec("\u79D2\u5F85",[n,e])},return_none:!0},\u79D2\u9010\u6B21\u5F85\u6A5F:{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:async function(n,e){return await e.__exec("\u79D2\u5F85",[n,e])},return_none:!0},\u79D2\u5F8C:{type:"func",josi:[["\u3092"],[""]],pure:!0,fn:function(n,e,t){typeof n=="string"&&(n=t.__findFunc(n,"\u79D2\u5F8C"));let r=setTimeout(()=>{let s=t.__timeout.indexOf(r);s>=0&&t.__timeout.splice(s,1);try{n(r,t)}catch(i){let o=i;i instanceof J||(o=new J(i,t.__getSysVar("__line"))),t.logger.error(o)}},parseFloat(e)*1e3);return t.__timeout.unshift(r),t.__setSysVar("\u5BFE\u8C61",r),r}},\u79D2\u6BCE:{type:"func",josi:[["\u3092"],[""]],pure:!1,fn:function(n,e,t){typeof n=="string"&&(n=t.__findFunc(n,"\u79D2\u6BCE"));let r=setInterval(()=>{n(r,t)},parseFloat(e)*1e3);return t.__interval.unshift(r),t.__setSysVar("\u5BFE\u8C61",r),r}},\u79D2\u30BF\u30A4\u30DE\u30FC\u958B\u59CB\u6642:{type:"func",josi:[["\u3092"],[""]],pure:!1,fn:function(n,e,t){return t.__exec("\u79D2\u6BCE",[n,e,t])}},\u30BF\u30A4\u30DE\u30FC\u505C\u6B62:{type:"func",josi:[["\u306E","\u3067"]],pure:!0,fn:function(n,e){let t=e.__interval.indexOf(n);if(t>=0)return e.__interval.splice(t,1),clearInterval(n),!0;let r=e.__timeout.indexOf(n);return r>=0?(e.__timeout.splice(r,1),clearTimeout(n),!0):!1},return_none:!1},\u5168\u30BF\u30A4\u30DE\u30FC\u505C\u6B62:{type:"func",josi:[],pure:!0,fn:function(n){for(let e=0;e<n.__interval.length;e++){let t=n.__interval[e];clearInterval(t)}n.__interval=[];for(let e=0;e<n.__timeout.length;e++){let t=n.__timeout[e];clearTimeout(t)}n.__timeout=[]},return_none:!0},\u5143\u53F7\u30C7\u30FC\u30BF:{type:"const",value:[{\u5143\u53F7:"\u4EE4\u548C",\u6539\u5143\u65E5:"2019/05/01"},{\u5143\u53F7:"\u5E73\u6210",\u6539\u5143\u65E5:"1989/01/08"},{\u5143\u53F7:"\u662D\u548C",\u6539\u5143\u65E5:"1926/12/25"},{\u5143\u53F7:"\u5927\u6B63",\u6539\u5143\u65E5:"1912/07/30"},{\u5143\u53F7:"\u660E\u6CBB",\u6539\u5143\u65E5:"1868/10/23"}]},\u4ECA:{type:"func",josi:[],pure:!0,fn:function(){let n=t=>{let r="00"+String(t);return r.substring(r.length-2,r.length)},e=new Date;return n(e.getHours())+":"+n(e.getMinutes())+":"+n(e.getSeconds())}},\u30B7\u30B9\u30C6\u30E0\u6642\u9593:{type:"func",josi:[],pure:!0,fn:function(){return Math.floor(new Date().getTime()/1e3)}},\u30B7\u30B9\u30C6\u30E0\u6642\u9593\u30DF\u30EA\u79D2:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getTime()}},\u4ECA\u65E5:{type:"func",josi:[],pure:!0,fn:function(n){return n.__formatDate(new Date)}},\u660E\u65E5:{type:"func",josi:[],pure:!0,fn:function(n){let e=Date.now()+864e5;return n.__formatDate(new Date(e))}},\u6628\u65E5:{type:"func",josi:[],pure:!0,fn:function(n){let e=Date.now()-864e5;return n.__formatDate(new Date(e))}},\u4ECA\u5E74:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getFullYear()}},\u6765\u5E74:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getFullYear()+1}},\u53BB\u5E74:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getFullYear()-1}},\u4ECA\u6708:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getMonth()+1}},\u6765\u6708:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getMonth()+2}},\u5148\u6708:{type:"func",josi:[],pure:!0,fn:function(){return new Date().getMonth()}},\u66DC\u65E5:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n,e){let t=e.__str2date(n);return"\u65E5\u6708\u706B\u6C34\u6728\u91D1\u571F".charAt(t.getDay()%7)}},\u66DC\u65E5\u756A\u53F7\u53D6\u5F97:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){let e=n.split("/");return new Date(e[0],e[1]-1,e[2]).getDay()}},UNIXTIME\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092","\u304B\u3089"]],pure:!0,fn:function(n,e){return e.__str2date(n).getTime()/1e3}},UNIX\u6642\u9593\u5909\u63DB:{type:"func",josi:[["\u306E","\u3092","\u304B\u3089"]],pure:!0,fn:function(n,e){return e.__str2date(n).getTime()/1e3}},\u65E5\u6642\u5909\u63DB:{type:"func",josi:[["\u3092","\u304B\u3089"]],pure:!0,fn:function(n,e){let t=n*1e3;return e.__formatDateTime(new Date(t),"2022/01/01 00:00:00")}},\u65E5\u6642\u66F8\u5F0F\u5909\u63DB:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e,t){let r=t.__str2date(n);return e=e.replace(/(YYYY|ccc|WWW|MMM|YY|MM|DD|HH|mm|ss|[MDHmsW])/g,s=>{switch(s){case"YYYY":return r.getFullYear();case"YY":return String(r.getFullYear()).substring(2);case"MM":return t.__zero2(String(r.getMonth()+1));case"DD":return t.__zero2(r.getDate());case"M":return r.getMonth()+1;case"D":return r.getDate();case"HH":return t.__zero2(r.getHours());case"mm":return t.__zero2(r.getMinutes());case"ss":return t.__zero2(r.getSeconds());case"ccc":return t.__zero(r.getMilliseconds(),3);case"H":return r.getHours();case"m":return r.getMinutes();case"s":return r.getSeconds();case"W":return"\u65E5\u6708\u706B\u6C34\u6728\u91D1\u571F".charAt(r.getDay()%7);case"WWW":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][r.getDay()%7];case"MMM":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.getMonth()]}return s}),e}},\u548C\u66A6\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){let t=e.__str2date(n),r=t.getTime();for(let s of e.__getSysVar("\u5143\u53F7\u30C7\u30FC\u30BF")){let i=String(s.\u5143\u53F7),o=e.__str2date(s.\u6539\u5143\u65E5);if(o.getTime()<=r){let c=t.getFullYear()-o.getFullYear()+1;return c===1&&(c="\u5143"),i+String(c)+"\u5E74"+e.__zero2(t.getMonth()+1)+"\u6708"+e.__zero2(t.getDate())+"\u65E5"}}throw new Error("\u300E\u548C\u66A6\u5909\u63DB\u300F\u306F\u660E\u793A\u4EE5\u524D\u306E\u65E5\u4ED8\u306B\u306F\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u305B\u3093\u3002")}},\u5E74\u6570\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=t.__str2date(n);return t.__str2date(e).getFullYear()-r.getFullYear()}},\u6708\u6570\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=t.__str2date(n),s=t.__str2date(e);return s.getFullYear()*12+Number(s.getMonth())-(r.getFullYear()*12+Number(r.getMonth()))}},\u65E5\u6570\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=Math.ceil(t.__str2date(n).getTime()/1e3),s=Math.ceil(t.__str2date(e).getTime()/1e3);return Math.ceil((s-r)/(60*60*24))}},\u6642\u9593\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=Math.ceil(t.__str2date(n).getTime()/1e3),s=Math.ceil(t.__str2date(e).getTime()/1e3);return Math.ceil((s-r)/(60*60))}},\u5206\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=Math.ceil(t.__str2date(n).getTime()/1e3),s=Math.ceil(t.__str2date(e).getTime()/1e3);return Math.ceil((s-r)/60)}},\u79D2\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"]],pure:!0,fn:function(n,e,t){let r=Math.ceil(t.__str2date(n).getTime()/1e3),s=Math.ceil(t.__str2date(e).getTime()/1e3);return Math.ceil(s-r)}},\u65E5\u6642\u5DEE:{type:"func",josi:[["\u3068","\u304B\u3089"],["\u306E","\u307E\u3067\u306E"],["\u306B\u3088\u308B"]],pure:!0,fn:function(n,e,t,r){switch(t){case"\u5E74":return r.__exec("\u5E74\u6570\u5DEE",[n,e,r]);case"\u6708":return r.__exec("\u6708\u6570\u5DEE",[n,e,r]);case"\u65E5":return r.__exec("\u65E5\u6570\u5DEE",[n,e,r]);case"\u6642\u9593":return r.__exec("\u6642\u9593\u5DEE",[n,e,r]);case"\u5206":return r.__exec("\u5206\u5DEE",[n,e,r]);case"\u79D2":return r.__exec("\u79D2\u5DEE",[n,e,r])}throw new Error("\u300E\u65E5\u6642\u5DEE\u300F\u3067\u4E0D\u660E\u306A\u5358\u4F4D\u3067\u3059\u3002")}},\u6642\u9593\u52A0\u7B97:{type:"func",josi:[["\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){let r=e.charAt(0);(r==="-"||r==="+")&&(e=e.substring(1));let s=t.__str2date(n),i=(e+":0:0").split(":"),o=parseInt(i[0])*60*60+parseInt(i[1])*60+parseInt(i[2]);r==="-"&&(o*=-1);let u=new Date(Number(s.getTime())+o*1e3);return t.__formatDateTime(u,n)}},\u65E5\u4ED8\u52A0\u7B97:{type:"func",josi:[["\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){let r=1,s=e.charAt(0);(s==="-"||s==="+")&&(e=e.substring(1),s==="-"&&(r*=-1));let i=t.__str2date(n),o=(e+"/0/0").split("/"),u=parseInt(o[0])*r,c=parseInt(o[1])*r,a=parseInt(o[2])*r;return i.setFullYear(Number(i.getFullYear())+u),i.setMonth(Number(i.getMonth())+c),i.setDate(Number(i.getDate())+a),t.__formatDateTime(i,n)}},\u65E5\u6642\u52A0\u7B97:{type:"func",josi:[["\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){let r=(""+e).match(/([+|-]?)(\d+)(年|ヶ月|日|週間|時間|分|秒)$/);if(!r)throw new Error("\u300E\u65E5\u4ED8\u52A0\u7B97\u300F\u306F\u300E(+\uFF5C-)1(\u5E74|\u30F6\u6708|\u65E5|\u6642\u9593|\u5206|\u79D2)\u300F\u306E\u66F8\u5F0F\u3067\u6307\u5B9A\u3057\u307E\u3059\u3002");switch(r[3]){case"\u5E74":return t.__exec("\u65E5\u4ED8\u52A0\u7B97",[n,`${r[1]}${r[2]}/0/0`,t]);case"\u30F6\u6708":return t.__exec("\u65E5\u4ED8\u52A0\u7B97",[n,`${r[1]}0/${r[2]}/0`,t]);case"\u9031\u9593":return t.__exec("\u65E5\u4ED8\u52A0\u7B97",[n,`${r[1]}0/0/${parseInt(r[2])*7}`,t]);case"\u65E5":return t.__exec("\u65E5\u4ED8\u52A0\u7B97",[n,`${r[1]}0/0/${r[2]}`,t]);case"\u6642\u9593":return t.__exec("\u6642\u9593\u52A0\u7B97",[n,`${r[1]}${r[2]}:0:0`,t]);case"\u5206":return t.__exec("\u6642\u9593\u52A0\u7B97",[n,`${r[1]}0:${r[2]}:0`,t]);case"\u79D2":return t.__exec("\u6642\u9593\u52A0\u7B97",[n,`${r[1]}0:0:${r[2]}`,t])}}},\u6642\u9593\u30DF\u30EA\u79D2\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(){return performance&&performance.now?performance.now():Date.now?Date.now():new Date().getTime()}},\u30C7\u30D0\u30C3\u30B0\u8868\u793A:{type:"func",josi:[["\u3068","\u3092","\u306E"]],pure:!0,fn:function(n,e){let r=(String(e.__getSysVar("__line",0))+"::").split(":",2),s=parseInt(String(r[0]).replace("l",""))+1,i=r[1];typeof n=="object"&&(n=JSON.stringify(n)),n=`${i}(${s}): ${n}`,e.__exec("\u8868\u793A",[n,e])},return_none:!0},\u30CF\u30C6\u30CA\u95A2\u6570\u8A2D\u5B9A:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n,e){if(typeof n=="function"){e.__hatena=n;return}if(typeof n=="string"){e.__hatena=e.__getSysVar(n,"\u30C7\u30D0\u30C3\u30B0\u8868\u793A");return}if(n instanceof Array){let t=n.map(r=>{if(r.substring(0,3)==="JS:"){let s=r.substring(3);return e.__evalJS(s,e)}else return e.__getSysVar(r,"\u30C7\u30D0\u30C3\u30B0\u8868\u793A")});e.__hatena=(r,s)=>{let i=r;for(let o of t)i=o(i,s)};return}e.__hatena=e.__getSysVar("\u30C7\u30D0\u30C3\u30B0\u8868\u793A")},return_none:!0},\u30CF\u30C6\u30CA\u95A2\u6570\u5B9F\u884C:{type:"func",josi:[["\u306E","\u3092","\u3068"]],pure:!0,fn:function(n,e){e.__hatena(n,e)},return_none:!0},\u30A8\u30E9\u30FC\u767A\u751F:{type:"func",josi:[["\u306E","\u3067"]],pure:!0,fn:function(n){throw new Error(n)},return_none:!0},__DEBUG:{type:"func",josi:[],pure:!0,fn:function(n){n.isDebug=!0,console.log(n)}},__DEBUG\u5F37\u5236\u5F85\u6A5F:{type:"const",value:0},__DEBUG\u30D6\u30EC\u30A4\u30AF\u30DD\u30A4\u30F3\u30C8\u4E00\u89A7:{type:"const",value:[]},__DEBUG\u5F85\u6A5F\u30D5\u30E9\u30B0:{type:"const",value:0},__DEBUG_BP_WAIT:{type:"func",josi:[["\u3067"]],pure:!0,asyncFn:!0,fn:function(n,e){return new Promise(t=>{let r=e.__getSysVar("__DEBUG\u30D6\u30EC\u30A4\u30AF\u30DD\u30A4\u30F3\u30C8\u4E00\u89A7"),s=e.__getSysVar("__DEBUG\u5F37\u5236\u5F85\u6A5F");if(e.__setSysVar("__DEBUG\u5F37\u5236\u5F85\u6A5F",0),r.indexOf(n)>=0||s){if(e.__getSysVar("\u30D7\u30E9\u30B0\u30A4\u30F3\u540D")!=="\u30E1\u30A4\u30F3")return;console.log(`@__DEBUG_BP_WAIT(${n})`);let i=setInterval(()=>{e.__getSysVar("__DEBUG\u5F85\u6A5F\u30D5\u30E9\u30B0")===1&&(e.__setSysVar("__DEBUG\u5F85\u6A5F\u30D5\u30E9\u30B0",0),clearInterval(i),t(n))},500)}else t(n)})}},\u30B0\u30ED\u30FC\u30D0\u30EB\u95A2\u6570\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(n){let e=n.__varslist[1],t=[];for(let r of e.keys())t.push(r);return t}},\u30B7\u30B9\u30C6\u30E0\u95A2\u6570\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(n){let e=n.__v0,t=[];for(let r of e.keys())r.startsWith("__")||r.startsWith("!")||r==="meta"||t.push(r);return t}},\u30B7\u30B9\u30C6\u30E0\u95A2\u6570\u5B58\u5728:{type:"func",josi:[["\u304C","\u306E"]],pure:!0,fn:function(n,e){return typeof e.__getSysVar(n)<"u"}},\u30D7\u30E9\u30B0\u30A4\u30F3\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(n){let e=[];for(let t in n.pluginfiles)e.push(t);return e}},\u30E2\u30B8\u30E5\u30FC\u30EB\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,fn:function(n){let e=[];for(let t in n.__module)e.push(t);return e}},\u52A9\u8A5E\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,asyncFn:!1,fn:function(n){return n.josiList}},\u4E88\u7D04\u8A9E\u4E00\u89A7\u53D6\u5F97:{type:"func",josi:[],pure:!0,asyncFn:!1,fn:function(n){return n.reservedWords}},\u30D7\u30E9\u30B0\u30A4\u30F3\u540D:{type:"const",value:"\u30E1\u30A4\u30F3"},\u30D7\u30E9\u30B0\u30A4\u30F3\u540D\u8A2D\u5B9A:{type:"func",josi:[["\u306B","\u3078"]],pure:!0,fn:function(n,e){e.__setSysVar("\u30D7\u30E9\u30B0\u30A4\u30F3\u540D",n)},return_none:!0},\u540D\u524D\u7A7A\u9593:{type:"const",value:""},\u540D\u524D\u7A7A\u9593\u8A2D\u5B9A:{type:"func",josi:[["\u306B","\u3078"]],pure:!0,fn:function(n,e){e.__namespaceList.push([e.__getSysVar("\u540D\u524D\u7A7A\u9593"),e.__getSysVar("\u30D7\u30E9\u30B0\u30A4\u30F3\u540D")]),e.__setSysVar("\u540D\u524D\u7A7A\u9593",n)},return_none:!0},\u540D\u524D\u7A7A\u9593\u30DD\u30C3\u30D7:{type:"func",josi:[],pure:!0,fn:function(n){let e=n.__namespaceList.pop();e&&(n.__setSysVar("\u540D\u524D\u7A7A\u9593",e[0]),n.__setSysVar("\u30D7\u30E9\u30B0\u30A4\u30F3\u540D",e[1]))},return_none:!0},URL\u30A8\u30F3\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u304B\u3089"]],pure:!0,fn:function(n){return encodeURIComponent(n)}},URL\u30C7\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u3078","\u306B"]],pure:!0,fn:function(n){return decodeURIComponent(n)}},URL\u30D1\u30E9\u30E1\u30FC\u30BF\u89E3\u6790:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){let t={};if(typeof n!="string")return t;let r=n.split("?");if(r.length<=1)return t;let s=r[1].split("&");for(let i of s){let u=(i+"=").split("="),c=e.__exec("URL\u30C7\u30B3\u30FC\u30C9",[u[0]]);t[c]=e.__exec("URL\u30C7\u30B3\u30FC\u30C9",[u[1]])}return t}},BASE64\u30A8\u30F3\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u304B\u3089"]],pure:!0,fn:function(n){if(typeof window<"u"&&window.btoa){let e=new TextEncoder().encode(n),t=String.fromCharCode.apply(null,e);return btoa(t)}if(typeof Buffer<"u")return Buffer.from(n).toString("base64");throw new Error("\u300EBASE64\u30A8\u30F3\u30B3\u30FC\u30C9\u300F\u306F\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002")}},BASE64\u30C7\u30B3\u30FC\u30C9:{type:"func",josi:[["\u3092","\u3078","\u306B"]],pure:!0,fn:function(n){if(typeof window<"u"&&window.atob){let e=atob(n),t=Array.prototype.map.call(e,s=>s.charCodeAt()),r=new Uint8Array(t);return new TextDecoder("UTF-8").decode(r)}if(typeof Buffer<"u")return Buffer.from(n,"base64").toString();throw new Error("\u300EBASE64\u30C7\u30B3\u30FC\u30C9\u300F\u306F\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002")}}};var We={meta:{type:"const",value:{pluginName:"plugin_math",description:"\u6570\u5B66\u95A2\u6570\u3092\u63D0\u4F9B\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.6.0",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"^3.6.0"}},\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(){}},SIN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.sin(n)}},COS:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.cos(n)}},TAN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.tan(n)}},ARCSIN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.asin(n)}},ARCCOS:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.acos(n)}},ARCTAN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.atan(n)}},ATAN2:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return Math.atan2(n,e)}},\u5EA7\u6A19\u89D2\u5EA6\u8A08\u7B97:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.atan2(n[1],n[0])/Math.PI*180}},RAD2DEG:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return n/Math.PI*180}},DEG2RAD:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return n/180*Math.PI}},\u5EA6\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return n/Math.PI*180}},\u30E9\u30B8\u30A2\u30F3\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return n/180*Math.PI}},SIGN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return parseFloat(n)===0?0:n>0?1:-1}},\u7B26\u53F7:{type:"func",josi:[["\u306E"]],pure:!1,fn:function(n,e){return e.__exec("SIGN",[n])}},ABS:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.abs(n)}},\u7D76\u5BFE\u5024:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.abs(n)}},EXP:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.exp(n)}},HYPOT:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return Math.hypot(n,e)}},\u659C\u8FBA:{type:"func",josi:[["\u3068"],["\u306E"]],pure:!0,fn:function(n,e){return Math.hypot(n,e)}},LN:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.log(n)}},LOG:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.log(n)}},LOGN:{type:"func",josi:[["\u3067"],["\u306E"]],pure:!0,fn:function(n,e){return n===2?Math.LOG2E*Math.log(e):n===10?Math.LOG10E*Math.log(e):Math.log(e)/Math.log(n)}},FRAC:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return n%1}},\u5C0F\u6570\u90E8\u5206:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return n%1}},\u6574\u6570\u90E8\u5206:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.trunc(n)}},\u4E71\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){if(typeof n=="number")return Math.floor(Math.random()*n);if(typeof n=="object"&&n.\u5148\u982D!==void 0){let e=n.\u5148\u982D,t=n.\u672B\u5C3E;return Math.floor(Math.random()*(t-e+1))+Number(e)}if(Array.isArray(n)){let e=n[0],t=n[1];return Math.floor(Math.random()*(t-e+1))+Number(e)}}},\u4E71\u6570\u7BC4\u56F2:{type:"func",josi:[["\u304B\u3089"],["\u307E\u3067\u306E","\u306E"]],pure:!0,fn:function(n,e){return Math.floor(Math.random()*(e-n+1))+n}},SQRT:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.sqrt(n)}},\u5E73\u65B9\u6839:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Math.sqrt(n)}},ROUND:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Math.round(n)}},\u56DB\u6368\u4E94\u5165:{type:"func",josi:[["\u3092","\u306E"]],pure:!0,fn:function(n){return Math.round(n)}},\u5C0F\u6570\u70B9\u5207\u4E0A:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){let t=Math.pow(10,e);return Math.ceil(n*t)/t}},\u5C0F\u6570\u70B9\u5207\u4E0B:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){let t=Math.pow(10,e);return Math.floor(n*t)/t}},\u5C0F\u6570\u70B9\u56DB\u6368\u4E94\u5165:{type:"func",josi:[["\u3092"],["\u3067"]],pure:!0,fn:function(n,e){let t=Math.pow(10,e);return Math.round(n*t)/t}},CEIL:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Math.ceil(n)}},\u5207\u4E0A:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Math.ceil(n)}},FLOOR:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Math.floor(n)}},\u5207\u6368:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return Math.floor(n)}}};var E={delimiter:",",eol:`\r
|
|
444
444
|
`,auto_convert_number:!0};function It(n){return/^-?\d+(\.\d+)?([eE][-+]?\d+)?$/.test(n)}function Se(n,e=void 0){e===void 0&&(e=E.delimiter),n=""+n+`
|
|
445
445
|
`,n=n.replace(/(\r\n|\r)/g,`
|
|
446
446
|
`),n=n.replace(/\s+$/,"")+`
|
|
447
447
|
`;let t="^(.*?)([\\"+e+"\\n])",r=new RegExp(t),s=function(c){let a=c;return typeof c=="string"&&E.auto_convert_number&&It(c)&&(a=parseFloat(c)),a},i=[],o=[],u="";for(;n!=="";){if(u=n.charAt(0),u===e){n=n.substring(1),o.push("");continue}if(u===`
|
|
448
448
|
`){o.push(""),i.push(o),o=[],n=n.substring(1);continue}if(n=n.replace(/^\s+/,""),u=n.charAt(0),u===e){console.log("delimiter"),o.push(""),n=n.substring(e.length);continue}if(u==="="&&n.charAt(1)==='"'){n=n.substring(1);continue}if(u!=='"'){let f=r.exec(n);if(!f){o.push(s(n)),i.push(o),o=[];break}f[2]===`
|
|
449
449
|
`?(o.push(s(f[1])),i.push(o),o=[]):f[2]===e&&o.push(s(f[1])),n=n.substring(f[0].length);continue}if(n.substring(0,2)==='""'){o.push(""),n=n.substring(2);continue}let c=1,a="";for(;c<n.length;){let f=n.charAt(c),l=n.charAt(c+1);if(f==='"'&&l==='"'){c+=2,a+='"';continue}if(f==='"'){if(c++,l===e){c++,o.push(s(a)),a="";break}if(l===`
|
|
450
|
-
`){c++,o.push(s(a)),i.push(o),o=[];break}c++;continue}a+=f,c++}n=n.substr(c)}return o.length>0&&i.push(o),i}function je(n,e=void 0,t=void 0){e===void 0&&(e=E.delimiter),t===void 0&&(t=E.eol);let r=
|
|
451
|
-
`)>=0||e.indexOf("\r")>=0)&&(t=!0),e.indexOf(n)>=0&&(t=!0),e.indexOf('"')>=0&&(t=!0,e=e.replace(/"/g,'""')),t&&(e='"'+e+'"'),e}}var Pt={meta:{type:"const",value:{pluginName:"plugin_csv",description:"CSV\u95A2\u9023\u306E\u547D\u4EE4\u3092\u63D0\u4F9B\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.6.0",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"3.6.0"}},\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(){}},CSV\u53D6\u5F97:{type:"func",josi:[["\u3092","\u306E","\u3067"]],pure:!0,fn:function(n){return E.delimiter=",",Se(n)}},TSV\u53D6\u5F97:{type:"func",josi:[["\u3092","\u306E","\u3067"]],pure:!0,fn:function(n){return E.delimiter=" ",Se(n)}},\u8868CSV\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return E.delimiter=",",je(n)}},\u8868TSV\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return E.delimiter=" ",je(n)}},CSV\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A:{type:"func",josi:[["\u3092","\u3067"]],pure:!0,fn:function(n){for(let e in n){let t=n[e];e==="delimiter"||e==="\u533A\u5207\u6587\u5B57"?E.delimiter=t:e==="eol"?E.eol=t:e==="auto_convert_number"&&(E.auto_convert_number=t)}},return_none:!0}},qe=Pt;var ze={meta:{type:"const",value:{pluginName:"plugin_promise",description:"promise\u95A2\u9023\u306E\u547D\u4EE4\u3092\u63D0\u4F9B\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.6.0",nakoRuntime:["wnako","cnako"],nakoVersion:"^3.6.0"}},\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(n){n.__promise==null&&(n.__promise={setLastPromise:function(e){return n.__setSysVar("\u305D",e),e}})}},\u305D:{type:"const",value:""},\u52D5\u6642:{type:"func",josi:[["\u3092","\u3067"]],pure:!0,fn:function(n,e){return e.__promise.setLastPromise(new Promise((t,r)=>n(t,r)))},return_none:!1},\u6210\u529F\u6642:{type:"func",josi:[["\u3092"],["\u306E","\u304C","\u306B"]],pure:!0,fn:function(n,e,t){return t.__promise.setLastPromise(e.then(r=>(t.__setSysVar("\u5BFE\u8C61",r),n(r))))},return_none:!1},\u51E6\u7406\u6642:{type:"func",josi:[["\u3092"],["\u306E","\u304C","\u306B"]],pure:!0,fn:function(n,e,t){return t.__promise.setLastPromise(e.then(r=>(t.__setSysVar("\u5BFE\u8C61",r),n(!0,r,t)),r=>(t.__setSysVar("\u5BFE\u8C61",r),n(!1,r,t))))},return_none:!1},\u5931\u6557\u6642:{type:"func",josi:[["\u3092"],["\u306E","\u304C","\u306B"]],pure:!0,fn:function(n,e,t){return t.__promise.setLastPromise(e.catch(r=>(t.__setSysVar("\u5BFE\u8C61",r),n(r))))},return_none:!1},\u7D42\u4E86\u6642:{type:"func",josi:[["\u3092"],["\u306E","\u304C","\u306B"]],pure:!0,fn:function(n,e,t){return t.__promise.setLastPromise(e.finally(()=>n()))},return_none:!1},\u675F:{type:"func",josi:[["\u3068","\u3092"]],isVariableJosi:!0,pure:!0,fn:function(...n){return n.pop().__promise.setLastPromise(Promise.all(n))},return_none:!1}};var Xe={meta:{type:"const",value:{pluginName:"plugin_test",description:"\u30C6\u30B9\u30C8\u3092\u63D0\u4F9B\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.6.0",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"^3.6.0"}},\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(){}},ASSERT\u7B49:{type:"func",josi:[["\u3068"],["\u304C"]],pure:!0,fn:function(n,e){if(n!==e)throw new Error(`\u4E0D\u4E00\u81F4 [\u5B9F\u969B]${n} [\u671F\u5F85]${e}`);return!0}},\u30C6\u30B9\u30C8\u5B9F\u884C:{type:"func",josi:[["\u3068"],["\u3067"]],pure:!1,fn:function(n,e,t){t.__exec("ASSERT\u7B49",[n,e,t])}},\u30C6\u30B9\u30C8\u7B49:{type:"func",josi:[["\u3068"],["\u304C"]],pure:!1,fn:function(n,e,t){t.__exec("ASSERT\u7B49",[n,e,t])}}};var xe=n=>JSON.parse(JSON.stringify(n)),Ye=600;function P(n={}){return typeof n!="object"&&(n={}),n.testOnly=n.testOnly||!1,n.resetEnv=n.resetEnv||!1,n.resetAll=n.resetAll||!1,n.preCode=n.preCode||"",n.nakoGlobal=n.nakoGlobal||null,n}var he=class n{constructor(e=void 0){e===void 0&&(e={useBasicPlugin:!0}),this.__varslist=[this.newVaiables(),this.newVaiables(),this.newVaiables()],this.__locals=this.newVaiables(),this.__self=this,this.__vars=this.__varslist[2],this.__v1=this.__varslist[1],this.__v0=this.__varslist[0],this.version=we.version,this.coreVersion=we.version,this.__globals=[],this.__globalObj=null,this.__module={},this.pluginFunclist={},this.funclist=this.newVaiables(),this.moduleExport=this.newVaiables(),this.pluginfiles={},this.commandlist=new Set,this.nakoFuncList=this.newVaiables(),this.eventList=[],this.codeGenerateor={},this.debugOption={useDebug:!1,waitTime:0},this.logger=new K,this.filename="main.nako3",this.dependencies={},this.usedFuncs=new Set,this.numFailures=0,e.useBasicPlugin&&this.addBasicPlugins(),this.prepare=ie.getInstance(),this.parser=new se(this.logger),this.lexer=new O(this.logger),this.lexer.setFuncList(this.funclist),this.lexer.setModuleExport(this.moduleExport),this.reservedWords=JSON.parse(JSON.stringify(this.lexer.reservedWords)),this.josiList=JSON.parse(JSON.stringify(this.lexer.josiList))}getModList(){return this.lexer.modList}getLogger(){return this.logger}getNakoFuncList(){return this.nakoFuncList}getNakoFunc(e){return this.nakoFuncList.get(e)}getPluginfiles(){return this.pluginfiles}addBasicPlugins(){this.addPlugin(Ue),this.addPlugin(We),this.addPlugin(ze),this.addPlugin(Xe),this.addPlugin(qe)}replaceLogger(){return this.lexer.logger=this.parser.logger=this.logger=new K}static listRequireStatements(e){let t=[];for(let r=0;r+2<e.length;r++){if(!(e[r].type==="not"&&(e[r+1].type==="string"||e[r+1].type==="string_ex")&&e[r+2].value==="\u53D6\u8FBC"))continue;let s=e[r+1].value+"";if(s.startsWith("\u8CAF\u8535\u5EAB:")&&(s=`https://n3s.nadesi.com/plain/${s.substring(4)}`),s.startsWith("\u62E1\u5F35\u30D7\u30E9\u30B0\u30A4\u30F3:")){let o=s.split(":")[1].match(/^([a-zA-Z0-9_-]+)\.(js|mjs|nako3)(@[0-9.]+)?$/);if(o){let u=o[1],c=o[2],a=o[3]||"@latest";c==="js"||c==="mjs"?(u.startsWith("nadesiko3-")||(u=`nadesiko3-${u}`),s=`https://cdn.jsdelivr.net/npm/${u}${a}/${u}.${c}`):s=`https://n3s.nadesi.com/plain/${u}.${c}`}else throw new X("\u300E\u53D6\u8FBC\u300F\u306E\u6307\u5B9A\u30A8\u30E9\u30FC\u3002\u300E\u62E1\u5F35\u30D7\u30E9\u30B0\u30A4\u30F3:(\u30D5\u30A1\u30A4\u30EB\u540D).(js|nako3)(@ver)\u300F\u306E\u66F8\u5F0F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e[r].file,e[r].line)}t.push({...e[r],start:r,end:r+3,value:s,firstToken:e[r],lastToken:e[r+2]}),r+=2}return t}_loadDependencies(e,t,r,s){let i={},o=new n({useBasicPlugin:!0}),u=(f,l)=>{let h=s.readJs(f.filePath,f.firstToken);l.push(h.task.then(d=>{let _=d();this.addPluginFromFile(f.filePath,_),i[f.filePath].funclist=_,i[f.filePath].moduleExport={},i[f.filePath].addPluginFile=()=>{this.addPluginFromFile(f.filePath,_)}}))},c=(f,l)=>{let h=s.readNako3(f.filePath,f.firstToken),d=_=>{let y=O.filenameToModName(f.filePath);_=`\u300E${y}\u300F\u306B\u540D\u524D\u7A7A\u9593\u8A2D\u5B9A;\u300E${y}\u300F\u306B\u30D7\u30E9\u30B0\u30A4\u30F3\u540D\u8A2D\u5B9A;`+_+";\u540D\u524D\u7A7A\u9593\u30DD\u30C3\u30D7;";let b=this.rawtokenize(_,0,f.filePath);i[f.filePath].tokens=b;let k=new Map,g=new Map;return O.preDefineFunc(xe(b),this.logger,k,g),i[f.filePath].funclist=k,i[f.filePath].moduleExport=g,a(_,f.filePath,"")};l.push(h.task.then(_=>d(_)))},a=(f,l,h)=>{let d=[],y=n.listRequireStatements(o.rawtokenize(f,0,l,h)).map(b=>({...b,...s.resolvePath(b.value,b.firstToken,l)}));for(let b of y){if(i.hasOwnProperty(b.filePath)){i[b.filePath].alias.add(b.value);continue}if(i[b.filePath]={tokens:[],alias:new Set([b.value]),addPluginFile:()=>{},funclist:{},moduleExport:{}},b.type==="js"||b.type==="mjs")u(b,d);else if(b.type==="nako3")c(b,d);else throw new X(`\u30D5\u30A1\u30A4\u30EB\u300E${b.value}\u300F\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3002\u30D5\u30A1\u30A4\u30EB\u304C\u5B58\u5728\u3057\u306A\u3044\u304B\u672A\u5BFE\u5FDC\u306E\u62E1\u5F35\u5B50\u3067\u3059\u3002`,b.firstToken.file,b.firstToken.line)}if(d.length>0)return Promise.all(d)};try{let f=a(e,t,r);return f!==void 0&&f.catch(l=>{this.logger.error(l.msg),this.numFailures++}),this.dependencies=i,f}catch(f){throw this.logger.error(""+f),f}}rawtokenize(e,t,r,s=""){if(!e.startsWith(s))throw new Error("code\u306E\u5148\u982D\u306B\u306FpreCode\u3092\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let i=O.filenameToModName(r),o=this.getModList();o.indexOf(i)<0&&o.unshift(i);let u=this.prepare.convert(e),c=new ce(e.length,u),a=new ae(e,[],[]),f=new fe(e),l;try{l=this.lexer.tokenize(u.map(h=>h.text).join(""),t,r)}catch(h){if(!(h instanceof V))throw h;let d=a.map(c.map(h.preprocessedCodeStartOffset),c.map(h.preprocessedCodeEndOffset)),_=d.startOffset===null?h.line:f.map(d.startOffset,!1).line,y=ke({...d,line:_},s);throw new D(h.msg,y.startOffset,y.endOffset,y.line,r)}return l=Be(l),l=Ge(l),l=De(l),l=Ie(l),l=l.map(h=>{let d=a.map(c.map(h.preprocessedCodeOffset||0),c.map((h.preprocessedCodeOffset||0)+(h.preprocessedCodeLength||0))),_=h.line,y=0;if(h.type==="eol"&&d.endOffset!==null){let b=f.map(d.endOffset,!1);_=b.line,y=b.column}else if(d.startOffset!==null){let b=f.map(d.startOffset,!1);_=b.line,y=b.column}return{...h,...ke({line:_,column:y,startOffset:d.startOffset,endOffset:d.endOffset},s),rawJosi:h.josi}}),l}converttoken(e,t,r){return this.lexer.replaceTokens(e,t,r)}reset(e=void 0){if(!e||e.needToClearPlugin)try{this.clearPlugins()}catch{}this.__varslist=[this.__varslist[0],this.newVaiables(),this.newVaiables()],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.__vars=this.__varslist[2],this.__locals=this.newVaiables(),this.funclist=new Map;for(let t of this.__v0.keys()){let r=this.pluginFunclist[t];r&&this.funclist.set(t,JSON.parse(JSON.stringify(r)))}this.lexer.setFuncList(this.funclist),this.moduleExport=new Map,this.lexer.setModuleExport(this.moduleExport),this.logger.clear()}lexCodeToken(e,t,r,s){let i=this.rawtokenize(e,t,r,"");if(s===null)for(let u of i)u.startOffset=void 0,u.endOffset=void 0;else for(let u of i)u.startOffset!==void 0&&(u.startOffset+=s),u.endOffset!==void 0&&(u.endOffset+=s);let o=i.filter(u=>u.type==="line_comment"||u.type==="range_comment").map(u=>({...u}));return i=this.converttoken(i,!1,r),{tokens:i,commentTokens:o}}replaceRequireStatements(e,t=new Set){let r=[];for(let s of n.listRequireStatements(e).reverse()){if(t.has(s.value)){r.push(...e.splice(s.start||0,(s.end||0)-(s.start||0)));continue}let i=Object.keys(this.dependencies).find(u=>this.dependencies[u].alias.has(s.value));if(i===void 0)throw s.firstToken?new D(`\u30D5\u30A1\u30A4\u30EB\u300E${s.value}\u300F\u304C\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002`,s.firstToken.startOffset||0,s.firstToken.endOffset||0,s.firstToken.line,s.firstToken.file):new Error(`\u30D5\u30A1\u30A4\u30EB\u300E${s.value}\u300F\u304C\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002`);this.dependencies[i].addPluginFile();let o=xe(this.dependencies[i].tokens);t.add(s.value),r.push(...this.replaceRequireStatements(o,t)),r.push(...e.splice(s.start||0,(s.end||0)-(s.start||0),...o))}return r}removeRequireStatements(e){let t=[];for(let r of n.listRequireStatements(e).reverse()){let s=Object.keys(this.dependencies).find(i=>this.dependencies[i].alias.has(r.value));s!==void 0&&this.dependencies[s].addPluginFile(),t.push(...e.splice(r.start||0,(r.end||0)-(r.start||0)))}return t}lex(e,t="main.nako3",r="",s=!1){let i=this.rawtokenize(e,0,t,r),o=s?this.removeRequireStatements(i):this.replaceRequireStatements(i,void 0);for(let c of o)(c.type==="word"||c.type==="not")&&(c.type="require");if(o.length>=3)for(let c=0;c<o.length;c+=3){let a=o[c+1].value;a=O.filenameToModName(a),this.lexer.modList.indexOf(a)<0&&this.lexer.modList.push(a)}let u=i.filter(c=>c.type==="line_comment"||c.type==="range_comment").map(c=>({...c}));i=this.converttoken(i,!0,t);for(let c=0;c<i.length;c++)if(i[c]&&i[c].type==="code"){let a=this.lexCodeToken(i[c].value,i[c].line,t,i[c].startOffset||0);u.push(...a.commentTokens),i.splice(c,1,...a.tokens),c--}return this.logger.trace(`--- lex ---
|
|
452
|
-
`+JSON.stringify(i,null,2)),{commentTokens:u,tokens:i,requireTokens:o}}parse(e,t,r=""){this.lexer.setFuncList(this.funclist),this.parser.setFuncList(this.funclist),this.lexer.setModuleExport(this.moduleExport),this.parser.setModuleExport(this.moduleExport);let s=this.lex(e,t,r),i;try{this.parser.genMode="sync",i=this.parser.parse(s.tokens,t)}catch(o){throw typeof o.startOffset!="number"?
|
|
453
|
-
`+JSON.stringify(i,null,2)),i}getUsedFuncs(e){return this.usedFuncs=new Set,this._getUsedFuncs(e),this.deleteUnNakoFuncs()}_getUsedFuncs(e){if(e){if((e.type==="func"||e.type==="func_pointer")&&e.name)this.usedFuncs.add(e.name);else if(e.blocks)for(let t of e.blocks)this._getUsedFuncs(t)}}deleteUnNakoFuncs(){for(let e of this.usedFuncs)this.commandlist.has(e)||this.usedFuncs.delete(e);return this.usedFuncs}compile(e,t,r=!1,s=""){let i=P();return i.testOnly=r,i.preCode=s,this.compileFromCode(e,t,i).runtimeEnv}compileFromCode(e,t,r=void 0){t===""&&(t="main.nako3"),r===void 0&&(r=P());try{r.resetEnv&&this.reset(),r.resetAll&&this.clearPlugins(),this.eventList.filter(o=>o.eventName==="beforeParse").map(o=>o.callback(e));let s=this.parse(e,t,r.preCode);this.eventList.filter(o=>o.eventName==="beforeGenerate").map(o=>o.callback(s));let i=this.generateCode(s,new Y(r.testOnly));return this.eventList.filter(o=>o.eventName==="afterGenerate").map(o=>o.callback(i)),i}catch(s){throw this.logger.error(s),s}}generateCode(e,t,r="sync"){if(r==="sync")return Te(this,e,t);r==="\u975E\u540C\u671F\u30E2\u30FC\u30C9"&&this.logger.error("\u300E!\u975E\u540C\u671F\u30E2\u30FC\u30C9\u300F\u306F\u5EC3\u6B62\u3055\u308C\u307E\u3057\u305F\u3002[\u8A73\u7D30](https://github.com/kujirahand/nadesiko3/issues/1164)");let s=this.codeGenerateor[r];if(!s)throw new Error(`\u30B3\u30FC\u30C9\u30B8\u30A7\u30CD\u30EC\u30FC\u30BF\u306E\u300C${r}\u300D\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`);return s.generate(this,e,t.isTest)}addCodeGenerator(e,t){this.codeGenerateor[e]=t}async _run(e,t,r,s,i=""){let o=P({resetEnv:r,resetAll:r,testOnly:s,preCode:i});return this._runEx(e,t,o)}clearPlugins(){this.__globals.forEach(e=>{e&&(e.__setSysVar("__forceClose",!0),e.reset())}),this.__globals=[]}evalJS(e,t){this.__globalObj=t,this.__globalObj.lastJSCode=e,this.eventList.filter(r=>r.eventName==="beforeRun").map(r=>r.callback(t));try{new Function(t.lastJSCode).apply(t)}catch(r){throw t.numFailures++,this.getLogger().error(r),r}this.eventList.filter(r=>r.eventName==="finish").map(r=>r.callback(t))}runSync(e,t,r=void 0){r=P(r);let s=this.compileFromCode(e,t,r),i=this.getNakoGlobal(r,s.gen,t);return this.evalJS(s.runtimeEnv,i),i}async runAsync(e,t,r=void 0){r=P(r);let s=this.compileFromCode(e,t,r),i=this.getNakoGlobal(r,s.gen,t);return this.evalJS(s.runtimeEnv,i),i}getNakoGlobal(e,t,r){let s=e.nakoGlobal;return s||(this.__globals.length>0&&e.resetAll===!1&&e.resetEnv===!1?s=this.__globals[this.__globals.length-1]:s=new le(this,t,this.__globals.length+1),s.__varslist[0].set("\u540D\u524D\u7A7A\u9593",O.filenameToModName(r))),this.__globals.indexOf(s)<0&&this.__globals.push(s),s}addListener(e,t){this.eventList.push({eventName:e,callback:t})}test(e,t,r="",s=!1){let i=P();return i.preCode=r,i.testOnly=s,this.runSync(e,t,i)}run(e,t="main.nako3",r=""){let s=P();return s.preCode=r,this.runSync(e,t,s)}compileStandalone(e,t,r){r===void 0&&(r=new Y);let s=this.parse(e,t);return this.generateCode(s,r).standalone}addPlugin(e,t=!0,r=""){let s=this.__varslist[0],i=s.get("__pluginInfo");i||(i={},s.set("__pluginInfo",i));let o=0,u="unknown",c={pluginName:"unknown",nakoVersionResult:!0,nakoVersion:"0.0.0",path:""};if(e.meta&&e.meta.value&&typeof e.meta=="object"){c=e.meta.value||{pluginName:"unknown",nakoVersion:"0.0.0"},u=c.pluginName||"unknown";let h=((c.nakoVersion||"0.0.0")+".0.0").split(".").map(d=>parseInt(d));o=h[1]*100+h[2],c.path=r}if(u==="unknown"&&(u=Object.keys(e).join("-")),i[u]!==void 0)return;if(u=(f=>f.replace(/[^a-zA-z0-9\-_\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF\u3400-\u4DBF\uF900-\uFAFF]/g,"_"))(u),i[u]=c,Ye>o){let f=Object.keys(e).join(",");if(u==="unknown"&&(u=f.substring(0,30)+"..."),u!==""){let l=`\u306A\u3067\u3057\u3053\u30D7\u30E9\u30B0\u30A4\u30F3\u300E${u}\u300F\u306F\u53E4\u3044\u5F62\u5F0F\u306A\u306E\u3067\u6B63\u3057\u304F\u52D5\u4F5C\u3057\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002(\u30E9\u30F3\u30BF\u30A4\u30E0\u306E\u8981\u6C42: ${Ye}/\u30D7\u30E9\u30B0\u30A4\u30F3: ${o})`;console.warn(l,"see","https://github.com/kujirahand/nadesiko3/issues/1647"),this.logger.warn(l),c.nakoVersionResult=!1}}if(this.__module[u]=e,this.pluginfiles[u]="*",typeof e.\u521D\u671F\u5316=="object"){let f=e.\u521D\u671F\u5316;delete e.\u521D\u671F\u5316;let l=`!${u}:\u521D\u671F\u5316`;e[l]=f}for(let f in e){let l=e[f];if(this.funclist.set(f,l),t&&(this.pluginFunclist[f]=JSON.parse(JSON.stringify(l))),l.type==="func")s.set(f,l.fn),l.asyncFn&&(l.pure=!0);else if(l.type==="const"||l.type==="var")s.set(f,l.value);else throw console.error("[\u30D7\u30E9\u30B0\u30A4\u30F3\u8FFD\u52A0\u30A8\u30E9\u30FC]",l),new Error("\u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u8FFD\u52A0\u3067\u30A8\u30E9\u30FC\u3002");f==="\u521D\u671F\u5316"||f.substring(0,1)==="!"||this.commandlist.add(f)}}addPluginObject(e,t,r=!0){t.meta===void 0&&(t.meta={type:"const",value:{pluginName:e,nakoVersion:"0.0.0"}}),this.addPlugin(t,r)}addPluginFile(e,t,r,s=!0){this.addPluginFromFile(t,r,s)}addPluginFromFile(e,t,r=!0){this.addPlugin(t,r,e)}addFunc(e,t,r,s=!0,i=!1){let o={josi:t,fn:r,type:"func",return_none:s,asyncFn:i,pure:!0};this.funclist.set(e,o),this.pluginFunclist[e]=xe(o),this.__varslist[0].set(e,r)}setFunc(e,t,r,s=!0,i=!1){this.addFunc(e,t,r,s,i)}getFunc(e){return this.funclist.get(e)}_runEx(e,t,r,s="",i=void 0){return r.preCode=s,i&&(r.nakoGlobal=i),this.runSync(e,t,r)}runEx(e,t,r,s=""){return this._runEx(e,t,r,s)}async runReset(e,t="main.nako3",r=""){let s=P({resetAll:!0,resetEnv:!0,preCode:r});return this.runAsync(e,t,s)}newVaiables(e){return new Map(e)}};var He={\u6C34\u8272:{type:"const",value:"aqua"},\u7D2B\u8272:{type:"const",value:"fuchsia"},\u7DD1\u8272:{type:"const",value:"lime"},\u9752\u8272:{type:"const",value:"blue"},\u8D64\u8272:{type:"const",value:"red"},\u9EC4\u8272:{type:"const",value:"yellow"},\u9ED2\u8272:{type:"const",value:"black"},\u767D\u8272:{type:"const",value:"white"},\u8336\u8272:{type:"const",value:"maroon"},\u7070\u8272:{type:"const",value:"gray"},\u91D1\u8272:{type:"const",value:"gold"},\u9EC4\u91D1\u8272:{type:"const",value:"gold"},\u9280\u8272:{type:"const",value:"silver"},\u767D\u91D1\u8272:{type:"const",value:"silver"},\u30AA\u30EA\u30FC\u30D6\u8272:{type:"const",value:"olive"},\u30D9\u30FC\u30B8\u30E5\u8272:{type:"const",value:"beige"},\u30A2\u30EA\u30B9\u30D6\u30EB\u30FC\u8272:{type:"const",value:"aliceblue"},RGB:{type:"func",josi:[["\u3068"],["\u3068"],["\u3067","\u306E"]],pure:!0,fn:function(n,e,t){let r=s=>{let i="00"+s.toString(16);return i.substr(i.length-2,2)};return"#"+r(n)+r(e)+r(t)},return_none:!1},\u8272\u6DF7:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){let e=t=>{let r="00"+t.toString(16);return r.substr(r.length-2,2)};if(!n)throw new Error("\u300E\u8272\u6DF7\u305C\u308B\u300F\u306E\u5F15\u6570\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3057\u307E\u3059");if(n.length<3)throw new Error("\u300E\u8272\u6DF7\u305C\u308B\u300F\u306E\u5F15\u6570\u306B\u306F[RR,GG,BB]\u5F62\u5F0F\u306E\u914D\u5217\u3092\u6307\u5B9A\u3057\u307E\u3059");return"#"+e(n[0])+e(n[1])+e(n[2])},return_none:!1}};var Ke={HTTP\u53D6\u5F97:{type:"func",josi:[["\u306E","\u304B\u3089","\u3092"]],pure:!0,asyncFn:!0,fn:async function(n,e){return e.__exec("AJAX\u30C6\u30AD\u30B9\u30C8\u53D6\u5F97",[n,e])}},AJAX\u53D7\u4FE1:{type:"func",josi:[["\u304B\u3089","\u3092"]],pure:!0,asyncFn:!0,fn:async function(n,e){return e.__exec("AJAX\u30C6\u30AD\u30B9\u30C8\u53D6\u5F97",[n,e])}},AJAX\u53D7\u4FE1\u6642:{type:"func",josi:[["\u3067"],["\u304B\u3089","\u3092"]],pure:!0,fn:function(n,e,t){t.__exec("AJAX\u9001\u4FE1\u6642",[n,e,t])},return_none:!0},AJAX\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"]],pure:!0,asyncFn:!0,fn:async function(n,e){return e.__exec("AJAX\u30C6\u30AD\u30B9\u30C8\u53D6\u5F97",[n,e])}},AJAX\u9001\u4FE1\u6642:{type:"func",josi:[["\u306E"],["\u307E\u3067","\u3078","\u306B"]],pure:!0,fn:function(n,e,t){let r=t.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");r===""&&(r={method:"GET"}),fetch(e,r).then(s=>s.status!==200?t.__getSysVar("AJAX:ONERROR")(s.status):s.text()).then(s=>{t.__setSysVar("\u5BFE\u8C61",s),n(s,t)}).catch(s=>{t.__getSysVar("AJAX:ONERROR")(s)})},return_none:!0},AJAX\u30AA\u30D7\u30B7\u30E7\u30F3:{type:"const",value:""},AJAX\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A:{type:"func",josi:[["\u306B","\u3078","\u3068"]],pure:!0,fn:function(n,e){e.__setSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3",n)},return_none:!0},AJAX\u30AA\u30D7\u30B7\u30E7\u30F3POST\u8A2D\u5B9A:{type:"func",josi:[["\u3092","\u3067"]],pure:!0,fn:function(n,e){let t=e.__exec("POST\u30C7\u30FC\u30BF\u751F\u6210",[n,e]),r={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t};e.__setSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3",r)},return_none:!0},AJAX\u5931\u6557\u6642:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n,e){e.__setSysVar("AJAX:ONERROR",n)}},AJAX\u30C6\u30AD\u30B9\u30C8\u53D6\u5F97:{type:"func",josi:[["\u304B\u3089","\u3092"]],pure:!0,asyncFn:!0,fn:async function(n,e){let t=e.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");return t===""&&(t={method:"GET"}),await(await fetch(n,t)).text()},return_none:!1},AJAX_JSON\u53D6\u5F97:{type:"func",josi:[["\u304B\u3089"]],pure:!0,asyncFn:!0,fn:async function(n,e){let t=e.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");return t===""&&(t={method:"GET"}),await(await fetch(n,t)).json()},return_none:!1},AJAX\u30D0\u30A4\u30CA\u30EA\u53D6\u5F97:{type:"func",josi:[["\u304B\u3089"]],pure:!0,asyncFn:!0,fn:async function(n,e){let t=e.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");return t===""&&(t={method:"GET"}),await(await fetch(n,t)).blob()},return_none:!1},GET\u9001\u4FE1\u6642:{type:"func",josi:[["\u306E"],["\u307E\u3067","\u3078","\u306B"]],pure:!0,fn:function(n,e,t){t.__exec("AJAX\u9001\u4FE1\u6642",[n,e,t])},return_none:!0},POST\u9001\u4FE1\u6642:{type:"func",josi:[["\u306E"],["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t,r){let s=r.__exec("POST\u30C7\u30FC\u30BF\u751F\u6210",[t,r]);fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s}).then(o=>o.text()).then(o=>{r.__setSysVar("\u5BFE\u8C61",o),n(o)}).catch(o=>{r.__getSysVar("AJAX:ONERROR")(o)})}},POST\u30D5\u30A9\u30FC\u30E0\u9001\u4FE1\u6642:{type:"func",josi:[["\u306E"],["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t,r){let s=new FormData;for(let o in t)s.set(o,t[o]);fetch(e,{method:"POST",body:s}).then(o=>o.text()).then(o=>{r.__setSysVar("\u5BFE\u8C61",o),n(o)}).catch(o=>{r.__getSysVar("AJAX:ONERROR")(o)})}},POST\u30C7\u30FC\u30BF\u751F\u6210:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n,e){let t=[];for(let r in n){let s=n[r],i=encodeURIComponent(r)+"="+encodeURIComponent(s);t.push(i)}return t.join("&")}},POST\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,asyncFn:!0,fn:function(n,e,t){return new Promise((r,s)=>{let i=t.__exec("POST\u30C7\u30FC\u30BF\u751F\u6210",[e,t]);fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i}).then(u=>u.text()).then(u=>{r(u)}).catch(u=>{s(u.message)})})}},POST\u30D5\u30A9\u30FC\u30E0\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,asyncFn:!0,fn:function(n,e,t){return new Promise((r,s)=>{let i=new FormData;for(let u in e)i.set(u,e[u]);fetch(n,{method:"POST",body:i}).then(u=>u.text()).then(u=>{r(u)}).catch(u=>{s(u.message)})})}},AJAX\u4FDD\u969C\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"]],pure:!0,fn:function(n,e){let t=e.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");return t===""&&(t={method:"GET"}),fetch(n,t)},return_none:!1},HTTP\u4FDD\u969C\u53D6\u5F97:{type:"func",josi:[["\u306E","\u304B\u3089","\u3092"]],pure:!0,fn:function(n,e){return e.__exec("AJAX\u4FDD\u969C\u9001\u4FE1",[n,e])},return_none:!1},POST\u4FDD\u969C\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){let r=t.__exec("POST\u30C7\u30FC\u30BF\u751F\u6210",[e,t]);return fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r})},return_none:!1},POST\u30D5\u30A9\u30FC\u30E0\u4FDD\u969C\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){let r=new FormData;for(let i in e)r.set(i,e[i]);return fetch(n,{method:"POST",body:r})},return_none:!1},AJAX\u5185\u5BB9\u53D6\u5F97:{type:"func",josi:[["\u304B\u3089"],["\u3067"]],pure:!0,fn:function(n,e,t){return e=e.toString().toUpperCase(),e==="TEXT"||e==="\u30C6\u30AD\u30B9\u30C8"?n.text():e==="JSON"?n.json():e==="BLOB"?n.blob():e==="ARRAY"||e==="\u914D\u5217"?n.arrayBuffer():e==="BODY"||e==="\u672C\u4F53"?n.body:n.body()},return_none:!1},BLOB\u4F5C\u6210:{type:"func",josi:[["\u3092","\u304B\u3089"],["\u3067"]],pure:!0,fn:function(n,e){return n instanceof Array||(n=[n]),new Blob(n,e)}},AJAX\u9010\u6B21\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"]],pure:!0,fn:function(n,e){if(!e.resolve)throw new Error("\u300EAJAX\u9010\u6B21\u9001\u4FE1\u300F\u306F\u300E\u9010\u6B21\u5B9F\u884C\u300F\u69CB\u6587\u5185\u3067\u5229\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");e.resolveCount++;let t=e.resolve,r=e.reject,s=e.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");s===""&&(s={method:"GET"}),fetch(n,s).then(i=>i.text()).then(i=>{e.__setSysVar("\u5BFE\u8C61",i),t()}).catch(i=>{r(i.message)})},return_none:!0},HTTP\u9010\u6B21\u53D6\u5F97:{type:"func",josi:[["\u306E","\u304B\u3089","\u3092"]],pure:!0,fn:function(n,e){if(!e.resolve)throw new Error("\u300EHTTP\u9010\u6B21\u53D6\u5F97\u300F\u306F\u300E\u9010\u6B21\u5B9F\u884C\u300F\u69CB\u6587\u5185\u3067\u5229\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");e.__exec("AJAX\u9010\u6B21\u9001\u4FE1",[n,e])},return_none:!0},POST\u9010\u6B21\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){if(!t.resolve)throw new Error("\u300EPOST\u9001\u4FE1\u300F\u306F\u300E\u9010\u6B21\u5B9F\u884C\u300F\u69CB\u6587\u5185\u3067\u5229\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");t.resolveCount++;let r=t.resolve,s=t.reject,i=t.__exec("POST\u30C7\u30FC\u30BF\u751F\u6210",[e,t]);fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i}).then(u=>u.text()).then(u=>{t.__setSysVar("\u5BFE\u8C61",u),r(u)}).catch(u=>{s(u.message)})},return_none:!0},POST\u30D5\u30A9\u30FC\u30E0\u9010\u6B21\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){if(!t.resolve)throw new Error("\u300EPOST\u30D5\u30A9\u30FC\u30E0\u9010\u6B21\u9001\u4FE1\u300F\u306F\u300E\u9010\u6B21\u5B9F\u884C\u300F\u69CB\u6587\u5185\u3067\u5229\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");t.resolveCount++;let r=t.resolve,s=t.reject,i=new FormData;for(let u in e)i.set(u,e[u]);fetch(n,{method:"POST",body:i}).then(u=>u.text()).then(u=>{t.__setSysVar("\u5BFE\u8C61",u),r(u)}).catch(u=>{s(u.message)})},return_none:!0}};var Ze={HTML\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return String(n).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")}},\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u8A2D\u5B9A:{type:"func",josi:[["\u3092"]],pure:!0,asyncFn:!0,fn:async function(n){if(navigator.clipboard){await navigator.clipboard.writeText(n);return}let e=document.createElement("div"),t=document.createElement("pre");t.style.webkitUserSelect="auto",t.style.userSelect="auto",e.appendChild(t).textContent=n,e.style.position="fixed",e.right="200%",document.body.appendChild(e),document.getSelection().selectAllChildren(e),document.execCommand("copy"),document.body.removeChild(e)},return_none:!0},\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u53D6\u5F97\u6642:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){if(navigator.clipboard)typeof n=="string"&&(n=e.__findFunc(n,"\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u53D6\u5F97\u6642")),navigator.clipboard.readText().then(r=>{e.__setSysVar("\u5BFE\u8C61",r),n(e)});else throw new Error("Clipbard API\u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002")}},\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u53D6\u5F97:{type:"func",josi:[],pure:!0,asyncFn:!0,fn:async function(n){if(navigator.clipboard)return await navigator.clipboard.readText();throw new Error("Clipbard API\u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002")}}};var Qe={WS\u63A5\u7D9A\u5B8C\u4E86\u6642:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){e.__setSysVar("WS:ONOPEN",n)},return_none:!0},WS\u53D7\u4FE1\u6642:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){e.__setSysVar("WS:ONMESSAGE",n)},return_none:!0},WS\u30A8\u30E9\u30FC\u767A\u751F\u6642:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){e.__setSysVar("WS:ONERROR",n)},return_none:!0},WS\u63A5\u7D9A:{type:"func",josi:[["\u306B","\u3078","\u306E"]],pure:!0,fn:function(n,e){let t=new WebSocket(n);return t.onopen=()=>{let r=e.__getSysVar("WS:ONOPEN");r&&r(e)},t.onerror=r=>{let s=e.__getSysVar("WS:ONERROR");s&&s(r,e),console.log("WS\u30A8\u30E9\u30FC",r)},t.onmessage=r=>{e.__setSysVar("\u5BFE\u8C61",r.data);let s=e.__getSysVar("WS:ONMESSAGE");s&&s(e)},e.__setSysVar("WS:SOCKET",t),t}},WS\u9001\u4FE1:{type:"func",josi:[["\u3092","\u3068"]],pure:!0,fn:function(n,e){e.__getSysVar("WS:SOCKET").send(n)}},WS\u5207\u65AD:{type:"func",josi:[],pure:!0,fn:function(n){n.__getSysVar("WS:SOCKET").close()}}};var Dt=[He,Ke,Ze,Qe],et={\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(n){typeof self>"u"&&(self={}),typeof navigator>"u"&&(navigator={}),n.__setSysVar("AJAX:ONERROR",e=>{console.log(e)}),n.__v0.SELF=self,n.__v0.NAVIGATOR=navigator}}};Dt.forEach(n=>{let e={};Object.assign(e,n),typeof e.\u521D\u671F\u5316<"u"&&delete e.\u521D\u671F\u5316,Object.assign(et,e)});var tt=et;var Jt={\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(n){n.__v0.SELF=self||{},n.__v0.\u4F9D\u983C\u4E3B=self||{}}},\u5BFE\u8C61\u30A4\u30D9\u30F3\u30C8:{type:"const",value:""},\u53D7\u4FE1\u30C7\u30FC\u30BF:{type:"const",value:""},SELF:{type:"const",value:""},\u4F9D\u983C\u4E3B:{type:"const",value:""},NAKO\u30EF\u30FC\u30AB\u30FC\u30C7\u30FC\u30BF\u53D7\u4FE1\u6642:{type:"func",josi:[["\u3067"]],pure:!1,fn:function(n,e){n=e.__findVar(n,null),e.__setSysVar("PluginWorker:ondata",(t,r)=>(e.__v0.\u53D7\u4FE1\u30C7\u30FC\u30BF=t,e.__v0.\u5BFE\u8C61\u30A4\u30D9\u30F3\u30C8=r,n(r,e)))},return_none:!0},\u30EF\u30FC\u30AB\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8\u53D7\u4FE1\u6642:{type:"func",josi:[["\u3067"]],pure:!1,fn:function(n,e){n=e.__findVar(n,null),self.onmessage=t=>(e.__v0.\u53D7\u4FE1\u30C7\u30FC\u30BF=t.data,e.__v0.\u5BFE\u8C61\u30A4\u30D9\u30F3\u30C8=t,n(t,e))},return_none:!0},NAKO\u30EF\u30FC\u30AB\u30FC\u30C7\u30FC\u30BF\u9001\u4FE1:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){postMessage({type:"data",data:n})},return_none:!0},\u30EF\u30FC\u30AB\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8\u9001\u4FE1:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){postMessage(n)},return_none:!0},\u8868\u793A:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){postMessage({type:"output",data:n})},return_none:!0},\u7D42\u4E86:{type:"func",josi:[],pure:!0,fn:function(n){close()},return_none:!0}},nt=Jt;var $e=class extends he{constructor(){super(),this.__setSysVar("\u30CA\u30C7\u30B7\u30B3\u7A2E\u985E","wwnako3"),this.__setSysVar("PluginWorker:ondata",(e,t)=>{throw new Error("\u300ENAKO\u30EF\u30FC\u30AB\u30FC\u30C7\u30FC\u30BF\u53D7\u4FE1\u6642\u300F\u304C\u547C\u3070\u308C\u3066\u3044\u307E\u305B\u3093\u3002")})}};if(typeof navigator=="object"&&self&&self instanceof WorkerGlobalScope){let n=navigator.nako3=new $e,e=n;n.addPluginObject("PluginBrowserInWorker",tt),n.addPluginObject("PluginWorker",nt),n.getLogger().addListener("error",function(t){self.postMessage({type:"error",data:t})},!1),self.onmessage=t=>{let r=t.data||{type:"",data:""},s=r.type||"",i=r.data||"";switch(s){case"reset":n.reset();break;case"close":self.close();break;case"run":e=e.runEx(i,"_webworker.nako3",{resetEnv:!1,resetLog:!1});break;case"trans":i.forEach(o=>{if(o.type==="func")n.nakoFuncList[o.name]=o.content.meta,n.funclist[o.name]=o.content.func,n.__varslist[1].set(o.name,()=>{});else if(o.type==="val")n.__varslist[2].set(o.name,o.content);else if(o.type==="env")if(o.name==="modlist")for(let u of o.content)n.lexer.modList.indexOf(u.name)<0&&n.lexer.modList.push(u.name),u.export!=null&&!n.moduleExport.hasOwnProperty(u.name)&&(n.moduleExport[u.name]=u.export);else o.name==="constPools"?n.constPools=o.content:o.name==="constPoolsTemplate"?n.constPoolsTemplate=o.content:o.name==="chk"&&(n.chk=o.content)});break;case"data":e.__getSysVar("PluginWorker:ondata")&&e.__getSysVar("PluginWorker:ondata").apply(e,[i,t]);break}}}})();
|
|
450
|
+
`){c++,o.push(s(a)),i.push(o),o=[];break}c++;continue}a+=f,c++}n=n.substr(c)}return o.length>0&&i.push(o),i}function je(n,e=void 0,t=void 0){e===void 0&&(e=E.delimiter),t===void 0&&(t=E.eol);let r=Pt(e);if(n===void 0)return"";let s="";for(let i=0;i<n.length;i++){let o=n[i];if(o===void 0){s+=t;continue}for(let u=0;u<o.length;u++)o[u]=r(o[u]);s+=o.join(e)+t}return s=s.replace(/(\r\n|\r|\n)/g,t),s}function Pt(n){return function(e){e=""+e;let t=!1;return(e.indexOf(`
|
|
451
|
+
`)>=0||e.indexOf("\r")>=0)&&(t=!0),e.indexOf(n)>=0&&(t=!0),e.indexOf('"')>=0&&(t=!0,e=e.replace(/"/g,'""')),t&&(e='"'+e+'"'),e}}var Lt={meta:{type:"const",value:{pluginName:"plugin_csv",description:"CSV\u95A2\u9023\u306E\u547D\u4EE4\u3092\u63D0\u4F9B\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.6.0",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"3.6.0"}},\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(){}},CSV\u53D6\u5F97:{type:"func",josi:[["\u3092","\u306E","\u3067"]],pure:!0,fn:function(n){return E.delimiter=",",Se(n)}},TSV\u53D6\u5F97:{type:"func",josi:[["\u3092","\u306E","\u3067"]],pure:!0,fn:function(n){return E.delimiter=" ",Se(n)}},\u8868CSV\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return E.delimiter=",",je(n)}},\u8868TSV\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return E.delimiter=" ",je(n)}},CSV\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A:{type:"func",josi:[["\u3092","\u3067"]],pure:!0,fn:function(n){for(let e in n){let t=n[e];e==="delimiter"||e==="\u533A\u5207\u6587\u5B57"?E.delimiter=t:e==="eol"?E.eol=t:e==="auto_convert_number"&&(E.auto_convert_number=t)}},return_none:!0}},qe=Lt;var ze={meta:{type:"const",value:{pluginName:"plugin_promise",description:"promise\u95A2\u9023\u306E\u547D\u4EE4\u3092\u63D0\u4F9B\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.6.0",nakoRuntime:["wnako","cnako"],nakoVersion:"^3.6.0"}},\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(n){n.__promise==null&&(n.__promise={setLastPromise:function(e){return n.__setSysVar("\u305D",e),e}})}},\u305D:{type:"const",value:""},\u52D5\u6642:{type:"func",josi:[["\u3092","\u3067"]],pure:!0,fn:function(n,e){return e.__promise.setLastPromise(new Promise((t,r)=>n(t,r)))},return_none:!1},\u6210\u529F\u6642:{type:"func",josi:[["\u3092"],["\u306E","\u304C","\u306B"]],pure:!0,fn:function(n,e,t){return t.__promise.setLastPromise(e.then(r=>(t.__setSysVar("\u5BFE\u8C61",r),n(r))))},return_none:!1},\u51E6\u7406\u6642:{type:"func",josi:[["\u3092"],["\u306E","\u304C","\u306B"]],pure:!0,fn:function(n,e,t){return t.__promise.setLastPromise(e.then(r=>(t.__setSysVar("\u5BFE\u8C61",r),n(!0,r,t)),r=>(t.__setSysVar("\u5BFE\u8C61",r),n(!1,r,t))))},return_none:!1},\u5931\u6557\u6642:{type:"func",josi:[["\u3092"],["\u306E","\u304C","\u306B"]],pure:!0,fn:function(n,e,t){return t.__promise.setLastPromise(e.catch(r=>(t.__setSysVar("\u5BFE\u8C61",r),n(r))))},return_none:!1},\u7D42\u4E86\u6642:{type:"func",josi:[["\u3092"],["\u306E","\u304C","\u306B"]],pure:!0,fn:function(n,e,t){return t.__promise.setLastPromise(e.finally(()=>n()))},return_none:!1},\u675F:{type:"func",josi:[["\u3068","\u3092"]],isVariableJosi:!0,pure:!0,fn:function(...n){return n.pop().__promise.setLastPromise(Promise.all(n))},return_none:!1}};var Xe={meta:{type:"const",value:{pluginName:"plugin_test",description:"\u30C6\u30B9\u30C8\u3092\u63D0\u4F9B\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.6.0",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"^3.6.0"}},\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(){}},ASSERT\u7B49:{type:"func",josi:[["\u3068"],["\u304C"]],pure:!0,fn:function(n,e){if(n!==e)throw new Error(`\u4E0D\u4E00\u81F4 [\u5B9F\u969B]${JSON.stringify(n)} [\u671F\u5F85]${JSON.stringify(e)}`);return!0}},\u30C6\u30B9\u30C8\u5B9F\u884C:{type:"func",josi:[["\u3068"],["\u3067"]],pure:!1,fn:function(n,e,t){t.__exec("ASSERT\u7B49",[n,e,t])}},\u30C6\u30B9\u30C8\u7B49:{type:"func",josi:[["\u3068"],["\u304C"]],pure:!1,fn:function(n,e,t){t.__exec("ASSERT\u7B49",[n,e,t])}}};var xe=n=>JSON.parse(JSON.stringify(n)),Ye=600;function L(n={}){return typeof n!="object"&&(n={}),n.testOnly=n.testOnly||!1,n.resetEnv=n.resetEnv||!1,n.resetAll=n.resetAll||!1,n.preCode=n.preCode||"",n.nakoGlobal=n.nakoGlobal||null,n}var he=class n{constructor(e=void 0){e===void 0&&(e={useBasicPlugin:!0}),this.__varslist=[this.newVaiables(),this.newVaiables(),this.newVaiables()],this.__locals=this.newVaiables(),this.__self=this,this.__vars=this.__varslist[2],this.__v1=this.__varslist[1],this.__v0=this.__varslist[0],this.version=we.version,this.coreVersion=we.version,this.__globals=[],this.__globalObj=null,this.__module={},this.pluginFunclist={},this.funclist=this.newVaiables(),this.moduleExport=this.newVaiables(),this.pluginfiles={},this.commandlist=new Set,this.nakoFuncList=this.newVaiables(),this.eventList=[],this.codeGenerateor={},this.debugOption={useDebug:!1,waitTime:0},this.logger=new K,this.filename="main.nako3",this.dependencies={},this.usedFuncs=new Set,this.numFailures=0,e.useBasicPlugin&&this.addBasicPlugins(),this.prepare=ie.getInstance(),this.parser=new se(this.logger),this.lexer=new O(this.logger),this.lexer.setFuncList(this.funclist),this.lexer.setModuleExport(this.moduleExport),this.reservedWords=JSON.parse(JSON.stringify(this.lexer.reservedWords)),this.josiList=JSON.parse(JSON.stringify(this.lexer.josiList))}getModList(){return this.lexer.modList}getLogger(){return this.logger}getNakoFuncList(){return this.nakoFuncList}getNakoFunc(e){return this.nakoFuncList.get(e)}getPluginfiles(){return this.pluginfiles}addBasicPlugins(){this.addPlugin(Ue),this.addPlugin(We),this.addPlugin(ze),this.addPlugin(Xe),this.addPlugin(qe)}replaceLogger(){return this.lexer.logger=this.parser.logger=this.logger=new K}static listRequireStatements(e){let t=[];for(let r=0;r+2<e.length;r++){if(!(e[r].type==="not"&&(e[r+1].type==="string"||e[r+1].type==="string_ex")&&e[r+2].value==="\u53D6\u8FBC"))continue;let s=String(e[r+1].value)+"";if(s.startsWith("\u8CAF\u8535\u5EAB:")&&(s=`https://n3s.nadesi.com/plain/${s.substring(4)}`),s.startsWith("\u62E1\u5F35\u30D7\u30E9\u30B0\u30A4\u30F3:")){let o=s.split(":")[1].match(/^([a-zA-Z0-9_-]+)\.(js|mjs|nako3)(@[0-9.]+)?$/);if(o){let u=o[1],c=o[2],a=o[3]||"@latest";c==="js"||c==="mjs"?(u.startsWith("nadesiko3-")||(u=`nadesiko3-${u}`),s=`https://cdn.jsdelivr.net/npm/${u}${a}/${u}.${c}`):s=`https://n3s.nadesi.com/plain/${u}.${c}`}else throw new X("\u300E\u53D6\u8FBC\u300F\u306E\u6307\u5B9A\u30A8\u30E9\u30FC\u3002\u300E\u62E1\u5F35\u30D7\u30E9\u30B0\u30A4\u30F3:(\u30D5\u30A1\u30A4\u30EB\u540D).(js|nako3)(@ver)\u300F\u306E\u66F8\u5F0F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e[r].file,e[r].line)}t.push({...e[r],start:r,end:r+3,value:s,firstToken:e[r],lastToken:e[r+2]}),r+=2}return t}_loadDependencies(e,t,r,s){let i={},o=new n({useBasicPlugin:!0}),u=(f,l)=>{let h=s.readJs(f.filePath,f.firstToken);l.push(h.task.then(p=>{let _=p();this.addPluginFromFile(f.filePath,_),i[f.filePath].funclist=_,i[f.filePath].moduleExport={},i[f.filePath].addPluginFile=()=>{this.addPluginFromFile(f.filePath,_)}}))},c=(f,l)=>{let h=s.readNako3(f.filePath,f.firstToken),p=_=>{let y=O.filenameToModName(f.filePath);_=`\u300E${y}\u300F\u306B\u540D\u524D\u7A7A\u9593\u8A2D\u5B9A;\u300E${y}\u300F\u306B\u30D7\u30E9\u30B0\u30A4\u30F3\u540D\u8A2D\u5B9A;`+_+";\u540D\u524D\u7A7A\u9593\u30DD\u30C3\u30D7;";let b=this.rawtokenize(_,0,f.filePath);i[f.filePath].tokens=b;let k=new Map,g=new Map;return O.preDefineFunc(xe(b),this.logger,k,g),i[f.filePath].funclist=k,i[f.filePath].moduleExport=g,a(_,f.filePath,"")};l.push(h.task.then(_=>p(_)))},a=(f,l,h)=>{let p=[],y=n.listRequireStatements(o.rawtokenize(f,0,l,h)).map(b=>({...b,...s.resolvePath(b.value,b.firstToken,l)}));for(let b of y){if(i.hasOwnProperty(b.filePath)){i[b.filePath].alias.add(b.value);continue}if(i[b.filePath]={tokens:[],alias:new Set([b.value]),addPluginFile:()=>{},funclist:{},moduleExport:{}},b.type==="js"||b.type==="mjs")u(b,p);else if(b.type==="nako3")c(b,p);else throw new X(`\u30D5\u30A1\u30A4\u30EB\u300E${String(b.value)}\u300F\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3002\u30D5\u30A1\u30A4\u30EB\u304C\u5B58\u5728\u3057\u306A\u3044\u304B\u672A\u5BFE\u5FDC\u306E\u62E1\u5F35\u5B50\u3067\u3059\u3002`,b.firstToken.file,b.firstToken.line)}if(p.length>0)return Promise.all(p)};try{let f=a(e,t,r);return f!==void 0&&f.catch(l=>{this.logger.error(l.msg),this.numFailures++}),this.dependencies=i,f}catch(f){throw this.logger.error(String(f)),f}}rawtokenize(e,t,r,s=""){if(!e.startsWith(s))throw new Error("code\u306E\u5148\u982D\u306B\u306FpreCode\u3092\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");let i=O.filenameToModName(r),o=this.getModList();o.indexOf(i)<0&&o.unshift(i);let u=this.prepare.convert(e),c=new ce(e.length,u),a=new ae(e,[],[]),f=new fe(e),l;try{l=this.lexer.tokenize(u.map(h=>h.text).join(""),t,r)}catch(h){if(!(h instanceof V))throw h;let p=a.map(c.map(h.preprocessedCodeStartOffset),c.map(h.preprocessedCodeEndOffset)),_=p.startOffset===null?h.line:f.map(p.startOffset,!1).line,y=ke({...p,line:_},s);throw new D(h.msg,y.startOffset,y.endOffset,y.line,r)}return l=Be(l),l=Ge(l),l=De(l),l=Ie(l),l=l.map(h=>{let p=a.map(c.map(h.preprocessedCodeOffset||0),c.map((h.preprocessedCodeOffset||0)+(h.preprocessedCodeLength||0))),_=h.line,y=0;if(h.type==="eol"&&p.endOffset!==null){let b=f.map(p.endOffset,!1);_=b.line,y=b.column}else if(p.startOffset!==null){let b=f.map(p.startOffset,!1);_=b.line,y=b.column}return{...h,...ke({line:_,column:y,startOffset:p.startOffset,endOffset:p.endOffset},s),rawJosi:h.josi}}),l}converttoken(e,t,r){return this.lexer.replaceTokens(e,t,r)}reset(e=void 0){if(!e||e.needToClearPlugin)try{this.clearPlugins()}catch{}this.__varslist=[this.__varslist[0],this.newVaiables(),this.newVaiables()],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.__vars=this.__varslist[2],this.__locals=this.newVaiables(),this.funclist=new Map;for(let t of this.__v0.keys()){let r=this.pluginFunclist[t];r&&this.funclist.set(t,JSON.parse(JSON.stringify(r)))}this.lexer.setFuncList(this.funclist),this.moduleExport=new Map,this.lexer.setModuleExport(this.moduleExport),this.logger.clear()}lexCodeToken(e,t,r,s){let i=this.rawtokenize(e,t,r,"");if(s===null)for(let u of i)u.startOffset=void 0,u.endOffset=void 0;else for(let u of i)u.startOffset!==void 0&&(u.startOffset+=s),u.endOffset!==void 0&&(u.endOffset+=s);let o=i.filter(u=>u.type==="line_comment"||u.type==="range_comment").map(u=>({...u}));return i=this.converttoken(i,!1,r),{tokens:i,commentTokens:o}}replaceRequireStatements(e,t=new Set){let r=[];for(let s of n.listRequireStatements(e).reverse()){if(t.has(s.value)){r.push(...e.splice(s.start||0,(s.end||0)-(s.start||0)));continue}let i=Object.keys(this.dependencies).find(u=>this.dependencies[u].alias.has(s.value));if(i===void 0)throw s.firstToken?new D(`\u30D5\u30A1\u30A4\u30EB\u300E${String(s.value)}\u300F\u304C\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002`,s.firstToken.startOffset||0,s.firstToken.endOffset||0,s.firstToken.line,s.firstToken.file):new Error(`\u30D5\u30A1\u30A4\u30EB\u300E${String(s.value)}\u300F\u304C\u8AAD\u307F\u8FBC\u307E\u308C\u3066\u3044\u307E\u305B\u3093\u3002`);this.dependencies[i].addPluginFile();let o=xe(this.dependencies[i].tokens);t.add(s.value),r.push(...this.replaceRequireStatements(o,t)),r.push(...e.splice(s.start||0,(s.end||0)-(s.start||0),...o))}return r}removeRequireStatements(e){let t=[];for(let r of n.listRequireStatements(e).reverse()){let s=Object.keys(this.dependencies).find(i=>this.dependencies[i].alias.has(r.value));s!==void 0&&this.dependencies[s].addPluginFile(),t.push(...e.splice(r.start||0,(r.end||0)-(r.start||0)))}return t}lex(e,t="main.nako3",r="",s=!1){let i=this.rawtokenize(e,0,t,r),o=s?this.removeRequireStatements(i):this.replaceRequireStatements(i,void 0);for(let c of o)(c.type==="word"||c.type==="not")&&(c.type="require");if(o.length>=3)for(let c=0;c<o.length;c+=3){let a=o[c+1].value;a=O.filenameToModName(a),this.lexer.modList.indexOf(a)<0&&this.lexer.modList.push(a)}let u=i.filter(c=>c.type==="line_comment"||c.type==="range_comment").map(c=>({...c}));i=this.converttoken(i,!0,t);for(let c=0;c<i.length;c++)if(i[c]&&i[c].type==="code"){let a=this.lexCodeToken(i[c].value,i[c].line,t,i[c].startOffset||0);u.push(...a.commentTokens),i.splice(c,1,...a.tokens),c--}return this.logger.trace(`--- lex ---
|
|
452
|
+
`+JSON.stringify(i,null,2)),{commentTokens:u,tokens:i,requireTokens:o}}parse(e,t,r=""){this.lexer.setFuncList(this.funclist),this.parser.setFuncList(this.funclist),this.lexer.setModuleExport(this.moduleExport),this.parser.setModuleExport(this.moduleExport);let s=this.lex(e,t,r),i;try{this.parser.genMode="sync",i=this.parser.parse(s.tokens,t)}catch(o){throw typeof o.startOffset!="number"?d.fromNode(o.message,s.tokens[this.parser.getIndex()]):o}return this.usedFuncs=this.parser.usedFuncs,this.deleteUnNakoFuncs(),this.logger.trace(`--- ast ---
|
|
453
|
+
`+JSON.stringify(i,null,2)),i}getUsedFuncs(e){return this.usedFuncs=new Set,this._getUsedFuncs(e),this.deleteUnNakoFuncs()}_getUsedFuncs(e){if(e){if((e.type==="func"||e.type==="func_pointer")&&e.name)this.usedFuncs.add(e.name);else if(e.blocks)for(let t of e.blocks)this._getUsedFuncs(t)}}deleteUnNakoFuncs(){for(let e of this.usedFuncs)this.commandlist.has(e)||this.usedFuncs.delete(e);return this.usedFuncs}compile(e,t,r=!1,s=""){let i=L();return i.testOnly=r,i.preCode=s,this.compileFromCode(e,t,i).runtimeEnv}compileFromCode(e,t,r=void 0){t===""&&(t="main.nako3"),r===void 0&&(r=L());try{r.resetEnv&&this.reset(),r.resetAll&&this.clearPlugins(),this.eventList.filter(o=>o.eventName==="beforeParse").map(o=>o.callback(e));let s=this.parse(e,t,r.preCode);this.eventList.filter(o=>o.eventName==="beforeGenerate").map(o=>o.callback(s));let i=this.generateCode(s,new Y(r.testOnly));return this.eventList.filter(o=>o.eventName==="afterGenerate").map(o=>o.callback(i)),i}catch(s){throw this.logger.error(s),s}}generateCode(e,t,r="sync"){if(r==="sync")return Te(this,e,t);r==="\u975E\u540C\u671F\u30E2\u30FC\u30C9"&&this.logger.error("\u300E!\u975E\u540C\u671F\u30E2\u30FC\u30C9\u300F\u306F\u5EC3\u6B62\u3055\u308C\u307E\u3057\u305F\u3002[\u8A73\u7D30](https://github.com/kujirahand/nadesiko3/issues/1164)");let s=this.codeGenerateor[r];if(!s)throw new Error(`\u30B3\u30FC\u30C9\u30B8\u30A7\u30CD\u30EC\u30FC\u30BF\u306E\u300C${r}\u300D\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002`);return s.generate(this,e,t.isTest)}addCodeGenerator(e,t){this.codeGenerateor[e]=t}async _run(e,t,r,s,i=""){let o=L({resetEnv:r,resetAll:r,testOnly:s,preCode:i});return this._runEx(e,t,o)}clearPlugins(){this.__globals.forEach(e=>{e&&(e.__setSysVar("__forceClose",!0),e.reset())}),this.__globals=[]}evalJS(e,t){this.__globalObj=t,this.__globalObj.lastJSCode=e,this.eventList.filter(r=>r.eventName==="beforeRun").map(r=>r.callback(t));try{new Function(t.lastJSCode).apply(t)}catch(r){throw t.numFailures++,this.getLogger().error(r),r}this.eventList.filter(r=>r.eventName==="finish").map(r=>r.callback(t))}runSync(e,t,r=void 0){r=L(r);let s=this.compileFromCode(e,t,r),i=this.getNakoGlobal(r,s.gen,t);return this.evalJS(s.runtimeEnv,i),i}async runAsync(e,t,r=void 0){r=L(r);let s=this.compileFromCode(e,t,r),i=this.getNakoGlobal(r,s.gen,t);return this.evalJS(s.runtimeEnv,i),i}getNakoGlobal(e,t,r){let s=e.nakoGlobal;return s||(this.__globals.length>0&&e.resetAll===!1&&e.resetEnv===!1?s=this.__globals[this.__globals.length-1]:s=new le(this,t,this.__globals.length+1),s.__varslist[0].set("\u540D\u524D\u7A7A\u9593",O.filenameToModName(r))),this.__globals.indexOf(s)<0&&this.__globals.push(s),s}addListener(e,t){this.eventList.push({eventName:e,callback:t})}test(e,t,r="",s=!1){let i=L();return i.preCode=r,i.testOnly=s,this.runSync(e,t,i)}run(e,t="main.nako3",r=""){let s=L();return s.preCode=r,this.runSync(e,t,s)}compileStandalone(e,t,r){r===void 0&&(r=new Y);let s=this.parse(e,t);return this.generateCode(s,r).standalone}addPlugin(e,t=!0,r=""){let s=this.__varslist[0],i=s.get("__pluginInfo");i||(i={},s.set("__pluginInfo",i));let o=0,u="unknown",c={pluginName:"unknown",nakoVersionResult:!0,nakoVersion:"0.0.0",path:""};if(e.meta&&e.meta.value&&typeof e.meta=="object"){c=e.meta.value||{pluginName:"unknown",nakoVersion:"0.0.0"},u=c.pluginName||"unknown";let h=((c.nakoVersion||"0.0.0")+".0.0").split(".").map(p=>parseInt(p));o=h[1]*100+h[2],c.path=r}if(u==="unknown"&&(u=Object.keys(e).join("-")),i[u]!==void 0)return;if(u=(f=>f.replace(/[^a-zA-z0-9\-_\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF\u3400-\u4DBF\uF900-\uFAFF]/g,"_"))(u),i[u]=c,Ye>o){let f=Object.keys(e).join(",");if(u==="unknown"&&(u=f.substring(0,30)+"..."),u!==""){let l=`\u306A\u3067\u3057\u3053\u30D7\u30E9\u30B0\u30A4\u30F3\u300E${u}\u300F\u306F\u53E4\u3044\u5F62\u5F0F\u306A\u306E\u3067\u6B63\u3057\u304F\u52D5\u4F5C\u3057\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002(\u30E9\u30F3\u30BF\u30A4\u30E0\u306E\u8981\u6C42: ${Ye}/\u30D7\u30E9\u30B0\u30A4\u30F3: ${o})`;console.warn(l,"see","https://github.com/kujirahand/nadesiko3/issues/1647"),this.logger.warn(l),c.nakoVersionResult=!1}}if(this.__module[u]=e,this.pluginfiles[u]="*",typeof e.\u521D\u671F\u5316=="object"){let f=e.\u521D\u671F\u5316;delete e.\u521D\u671F\u5316;let l=`!${u}:\u521D\u671F\u5316`;e[l]=f}for(let f in e){let l=e[f];if(this.funclist.set(f,l),t&&(this.pluginFunclist[f]=JSON.parse(JSON.stringify(l))),l.type==="func")s.set(f,l.fn),l.asyncFn&&(l.pure=!0);else if(l.type==="const"||l.type==="var")s.set(f,l.value);else throw console.error("[\u30D7\u30E9\u30B0\u30A4\u30F3\u8FFD\u52A0\u30A8\u30E9\u30FC]",l),new Error("\u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u8FFD\u52A0\u3067\u30A8\u30E9\u30FC\u3002");f==="\u521D\u671F\u5316"||f.substring(0,1)==="!"||this.commandlist.add(f)}}addPluginObject(e,t,r=!0){t.meta===void 0&&(t.meta={type:"const",value:{pluginName:e,nakoVersion:"0.0.0"}}),this.addPlugin(t,r)}addPluginFile(e,t,r,s=!0){this.addPluginFromFile(t,r,s)}addPluginFromFile(e,t,r=!0){this.addPlugin(t,r,e)}addFunc(e,t,r,s=!0,i=!1){let o={josi:t,fn:r,type:"func",return_none:s,asyncFn:i,pure:!0};this.funclist.set(e,o),this.pluginFunclist[e]=xe(o),this.__varslist[0].set(e,r)}setFunc(e,t,r,s=!0,i=!1){this.addFunc(e,t,r,s,i)}getFunc(e){return this.funclist.get(e)}_runEx(e,t,r,s="",i=void 0){return r.preCode=s,i&&(r.nakoGlobal=i),this.runSync(e,t,r)}runEx(e,t,r,s=""){return this._runEx(e,t,r,s)}async runReset(e,t="main.nako3",r=""){let s=L({resetAll:!0,resetEnv:!0,preCode:r});return this.runAsync(e,t,s)}newVaiables(e){return new Map(e)}};var He={\u6C34\u8272:{type:"const",value:"aqua"},\u7D2B\u8272:{type:"const",value:"fuchsia"},\u7DD1\u8272:{type:"const",value:"lime"},\u9752\u8272:{type:"const",value:"blue"},\u8D64\u8272:{type:"const",value:"red"},\u9EC4\u8272:{type:"const",value:"yellow"},\u9ED2\u8272:{type:"const",value:"black"},\u767D\u8272:{type:"const",value:"white"},\u8336\u8272:{type:"const",value:"maroon"},\u7070\u8272:{type:"const",value:"gray"},\u91D1\u8272:{type:"const",value:"gold"},\u9EC4\u91D1\u8272:{type:"const",value:"gold"},\u9280\u8272:{type:"const",value:"silver"},\u767D\u91D1\u8272:{type:"const",value:"silver"},\u30AA\u30EA\u30FC\u30D6\u8272:{type:"const",value:"olive"},\u30D9\u30FC\u30B8\u30E5\u8272:{type:"const",value:"beige"},\u30A2\u30EA\u30B9\u30D6\u30EB\u30FC\u8272:{type:"const",value:"aliceblue"},RGB:{type:"func",josi:[["\u3068"],["\u3068"],["\u3067","\u306E"]],pure:!0,fn:function(n,e,t){let r=s=>{let i="00"+s.toString(16);return i.substr(i.length-2,2)};return"#"+r(n)+r(e)+r(t)},return_none:!1},\u8272\u6DF7:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){let e=t=>{let r="00"+t.toString(16);return r.substr(r.length-2,2)};if(!n)throw new Error("\u300E\u8272\u6DF7\u305C\u308B\u300F\u306E\u5F15\u6570\u306B\u306F\u914D\u5217\u3092\u6307\u5B9A\u3057\u307E\u3059");if(n.length<3)throw new Error("\u300E\u8272\u6DF7\u305C\u308B\u300F\u306E\u5F15\u6570\u306B\u306F[RR,GG,BB]\u5F62\u5F0F\u306E\u914D\u5217\u3092\u6307\u5B9A\u3057\u307E\u3059");return"#"+e(n[0])+e(n[1])+e(n[2])},return_none:!1}};var Ke={HTTP\u53D6\u5F97:{type:"func",josi:[["\u306E","\u304B\u3089","\u3092"]],pure:!0,asyncFn:!0,fn:async function(n,e){return e.__exec("AJAX\u30C6\u30AD\u30B9\u30C8\u53D6\u5F97",[n,e])}},AJAX\u53D7\u4FE1:{type:"func",josi:[["\u304B\u3089","\u3092"]],pure:!0,asyncFn:!0,fn:async function(n,e){return e.__exec("AJAX\u30C6\u30AD\u30B9\u30C8\u53D6\u5F97",[n,e])}},AJAX\u53D7\u4FE1\u6642:{type:"func",josi:[["\u3067"],["\u304B\u3089","\u3092"]],pure:!0,fn:function(n,e,t){t.__exec("AJAX\u9001\u4FE1\u6642",[n,e,t])},return_none:!0},AJAX\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"]],pure:!0,asyncFn:!0,fn:async function(n,e){return e.__exec("AJAX\u30C6\u30AD\u30B9\u30C8\u53D6\u5F97",[n,e])}},AJAX\u9001\u4FE1\u6642:{type:"func",josi:[["\u306E"],["\u307E\u3067","\u3078","\u306B"]],pure:!0,fn:function(n,e,t){let r=t.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");r===""&&(r={method:"GET"}),fetch(e,r).then(s=>s.status!==200?t.__getSysVar("AJAX:ONERROR")(s.status):s.text()).then(s=>{t.__setSysVar("\u5BFE\u8C61",s),n(s,t)}).catch(s=>{t.__getSysVar("AJAX:ONERROR")(s)})},return_none:!0},AJAX\u30AA\u30D7\u30B7\u30E7\u30F3:{type:"const",value:""},AJAX\u30AA\u30D7\u30B7\u30E7\u30F3\u8A2D\u5B9A:{type:"func",josi:[["\u306B","\u3078","\u3068"]],pure:!0,fn:function(n,e){e.__setSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3",n)},return_none:!0},AJAX\u30AA\u30D7\u30B7\u30E7\u30F3POST\u8A2D\u5B9A:{type:"func",josi:[["\u3092","\u3067"]],pure:!0,fn:function(n,e){let t=e.__exec("POST\u30C7\u30FC\u30BF\u751F\u6210",[n,e]),r={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t};e.__setSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3",r)},return_none:!0},AJAX\u5931\u6557\u6642:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n,e){e.__setSysVar("AJAX:ONERROR",n)}},AJAX\u30C6\u30AD\u30B9\u30C8\u53D6\u5F97:{type:"func",josi:[["\u304B\u3089","\u3092"]],pure:!0,asyncFn:!0,fn:async function(n,e){let t=e.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");return t===""&&(t={method:"GET"}),await(await fetch(n,t)).text()},return_none:!1},AJAX_JSON\u53D6\u5F97:{type:"func",josi:[["\u304B\u3089"]],pure:!0,asyncFn:!0,fn:async function(n,e){let t=e.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");return t===""&&(t={method:"GET"}),await(await fetch(n,t)).json()},return_none:!1},AJAX\u30D0\u30A4\u30CA\u30EA\u53D6\u5F97:{type:"func",josi:[["\u304B\u3089"]],pure:!0,asyncFn:!0,fn:async function(n,e){let t=e.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");return t===""&&(t={method:"GET"}),await(await fetch(n,t)).blob()},return_none:!1},GET\u9001\u4FE1\u6642:{type:"func",josi:[["\u306E"],["\u307E\u3067","\u3078","\u306B"]],pure:!0,fn:function(n,e,t){t.__exec("AJAX\u9001\u4FE1\u6642",[n,e,t])},return_none:!0},POST\u9001\u4FE1\u6642:{type:"func",josi:[["\u306E"],["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t,r){let s=r.__exec("POST\u30C7\u30FC\u30BF\u751F\u6210",[t,r]);fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s}).then(o=>o.text()).then(o=>{r.__setSysVar("\u5BFE\u8C61",o),n(o)}).catch(o=>{r.__getSysVar("AJAX:ONERROR")(o)})}},POST\u30D5\u30A9\u30FC\u30E0\u9001\u4FE1\u6642:{type:"func",josi:[["\u306E"],["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t,r){let s=new FormData;for(let o in t)s.set(o,t[o]);fetch(e,{method:"POST",body:s}).then(o=>o.text()).then(o=>{r.__setSysVar("\u5BFE\u8C61",o),n(o)}).catch(o=>{r.__getSysVar("AJAX:ONERROR")(o)})}},POST\u30C7\u30FC\u30BF\u751F\u6210:{type:"func",josi:[["\u306E","\u3092"]],pure:!0,fn:function(n,e){let t=[];for(let r in n){let s=n[r],i=encodeURIComponent(r)+"="+encodeURIComponent(s);t.push(i)}return t.join("&")}},POST\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,asyncFn:!0,fn:function(n,e,t){return new Promise((r,s)=>{let i=t.__exec("POST\u30C7\u30FC\u30BF\u751F\u6210",[e,t]);fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i}).then(u=>u.text()).then(u=>{r(u)}).catch(u=>{s(new Error(u.message))})})}},POST\u30D5\u30A9\u30FC\u30E0\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,asyncFn:!0,fn:function(n,e,t){return new Promise((r,s)=>{let i=new FormData;for(let u in e)i.set(u,e[u]);fetch(n,{method:"POST",body:i}).then(u=>u.text()).then(u=>{r(u)}).catch(u=>{s(new Error(u.message))})})}},AJAX\u4FDD\u969C\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"]],pure:!0,fn:function(n,e){let t=e.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");return t===""&&(t={method:"GET"}),fetch(n,t)},return_none:!1},HTTP\u4FDD\u969C\u53D6\u5F97:{type:"func",josi:[["\u306E","\u304B\u3089","\u3092"]],pure:!0,fn:function(n,e){return e.__exec("AJAX\u4FDD\u969C\u9001\u4FE1",[n,e])},return_none:!1},POST\u4FDD\u969C\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){let r=t.__exec("POST\u30C7\u30FC\u30BF\u751F\u6210",[e,t]);return fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r})},return_none:!1},POST\u30D5\u30A9\u30FC\u30E0\u4FDD\u969C\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){let r=new FormData;for(let i in e)r.set(i,e[i]);return fetch(n,{method:"POST",body:r})},return_none:!1},AJAX\u5185\u5BB9\u53D6\u5F97:{type:"func",josi:[["\u304B\u3089"],["\u3067"]],pure:!0,fn:function(n,e,t){return e=e.toString().toUpperCase(),e==="TEXT"||e==="\u30C6\u30AD\u30B9\u30C8"?n.text():e==="JSON"?n.json():e==="BLOB"?n.blob():e==="ARRAY"||e==="\u914D\u5217"?n.arrayBuffer():e==="BODY"||e==="\u672C\u4F53"?n.body:n.body()},return_none:!1},BLOB\u4F5C\u6210:{type:"func",josi:[["\u3092","\u304B\u3089"],["\u3067"]],pure:!0,fn:function(n,e){return n instanceof Array||(n=[n]),new Blob(n,e)}},AJAX\u9010\u6B21\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"]],pure:!0,fn:function(n,e){if(!e.resolve)throw new Error("\u300EAJAX\u9010\u6B21\u9001\u4FE1\u300F\u306F\u300E\u9010\u6B21\u5B9F\u884C\u300F\u69CB\u6587\u5185\u3067\u5229\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");e.resolveCount++;let t=e.resolve,r=e.reject,s=e.__getSysVar("AJAX\u30AA\u30D7\u30B7\u30E7\u30F3");s===""&&(s={method:"GET"}),fetch(n,s).then(i=>i.text()).then(i=>{e.__setSysVar("\u5BFE\u8C61",i),t()}).catch(i=>{r(i.message)})},return_none:!0},HTTP\u9010\u6B21\u53D6\u5F97:{type:"func",josi:[["\u306E","\u304B\u3089","\u3092"]],pure:!0,fn:function(n,e){if(!e.resolve)throw new Error("\u300EHTTP\u9010\u6B21\u53D6\u5F97\u300F\u306F\u300E\u9010\u6B21\u5B9F\u884C\u300F\u69CB\u6587\u5185\u3067\u5229\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");e.__exec("AJAX\u9010\u6B21\u9001\u4FE1",[n,e])},return_none:!0},POST\u9010\u6B21\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){if(!t.resolve)throw new Error("\u300EPOST\u9001\u4FE1\u300F\u306F\u300E\u9010\u6B21\u5B9F\u884C\u300F\u69CB\u6587\u5185\u3067\u5229\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");t.resolveCount++;let r=t.resolve,s=t.reject,i=t.__exec("POST\u30C7\u30FC\u30BF\u751F\u6210",[e,t]);fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i}).then(u=>u.text()).then(u=>{t.__setSysVar("\u5BFE\u8C61",u),r(u)}).catch(u=>{s(u.message)})},return_none:!0},POST\u30D5\u30A9\u30FC\u30E0\u9010\u6B21\u9001\u4FE1:{type:"func",josi:[["\u307E\u3067","\u3078","\u306B"],["\u3092"]],pure:!0,fn:function(n,e,t){if(!t.resolve)throw new Error("\u300EPOST\u30D5\u30A9\u30FC\u30E0\u9010\u6B21\u9001\u4FE1\u300F\u306F\u300E\u9010\u6B21\u5B9F\u884C\u300F\u69CB\u6587\u5185\u3067\u5229\u7528\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002");t.resolveCount++;let r=t.resolve,s=t.reject,i=new FormData;for(let u in e)i.set(u,e[u]);fetch(n,{method:"POST",body:i}).then(u=>u.text()).then(u=>{t.__setSysVar("\u5BFE\u8C61",u),r(u)}).catch(u=>{s(u.message)})},return_none:!0}};var Ze={HTML\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return String(n).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")}},\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u8A2D\u5B9A:{type:"func",josi:[["\u3092"]],pure:!0,asyncFn:!0,fn:async function(n){if(navigator.clipboard){await navigator.clipboard.writeText(n);return}let e=document.createElement("div"),t=document.createElement("pre");t.style.webkitUserSelect="auto",t.style.userSelect="auto",e.appendChild(t).textContent=n,e.style.position="fixed",e.right="200%",document.body.appendChild(e),document.getSelection().selectAllChildren(e),document.execCommand("copy"),document.body.removeChild(e)},return_none:!0},\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u53D6\u5F97\u6642:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){if(navigator.clipboard)typeof n=="string"&&(n=e.__findFunc(n,"\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u53D6\u5F97\u6642")),navigator.clipboard.readText().then(r=>{e.__setSysVar("\u5BFE\u8C61",r),n(e)});else throw new Error("Clipbard API\u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002")}},\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u53D6\u5F97:{type:"func",josi:[],pure:!0,asyncFn:!0,fn:async function(n){if(navigator.clipboard)return await navigator.clipboard.readText();throw new Error("Clipbard API\u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002")}}};var Qe={WS\u63A5\u7D9A\u5B8C\u4E86\u6642:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){e.__setSysVar("WS:ONOPEN",n)},return_none:!0},WS\u53D7\u4FE1\u6642:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){e.__setSysVar("WS:ONMESSAGE",n)},return_none:!0},WS\u30A8\u30E9\u30FC\u767A\u751F\u6642:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){e.__setSysVar("WS:ONERROR",n)},return_none:!0},WS\u63A5\u7D9A:{type:"func",josi:[["\u306B","\u3078","\u306E"]],pure:!0,fn:function(n,e){let t=new WebSocket(n);return t.onopen=()=>{let r=e.__getSysVar("WS:ONOPEN");r&&r(e)},t.onerror=r=>{let s=e.__getSysVar("WS:ONERROR");s&&s(r,e),console.log("WS\u30A8\u30E9\u30FC",r)},t.onmessage=r=>{e.__setSysVar("\u5BFE\u8C61",r.data);let s=e.__getSysVar("WS:ONMESSAGE");s&&s(e)},e.__setSysVar("WS:SOCKET",t),t}},WS\u9001\u4FE1:{type:"func",josi:[["\u3092","\u3068"]],pure:!0,fn:function(n,e){e.__getSysVar("WS:SOCKET").send(n)}},WS\u5207\u65AD:{type:"func",josi:[],pure:!0,fn:function(n){n.__getSysVar("WS:SOCKET").close()}}};var Dt=[He,Ke,Ze,Qe],et={\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(n){typeof self>"u"&&(self={}),typeof navigator>"u"&&(navigator={}),n.__setSysVar("AJAX:ONERROR",e=>{console.log(e)}),n.__v0.SELF=self,n.__v0.NAVIGATOR=navigator}}};Dt.forEach(n=>{let e={};Object.assign(e,n),typeof e.\u521D\u671F\u5316<"u"&&delete e.\u521D\u671F\u5316,Object.assign(et,e)});var tt=et;var Jt={\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(n){n.__v0.SELF=self||{},n.__v0.\u4F9D\u983C\u4E3B=self||{}}},\u5BFE\u8C61\u30A4\u30D9\u30F3\u30C8:{type:"const",value:""},\u53D7\u4FE1\u30C7\u30FC\u30BF:{type:"const",value:""},SELF:{type:"const",value:""},\u4F9D\u983C\u4E3B:{type:"const",value:""},NAKO\u30EF\u30FC\u30AB\u30FC\u30C7\u30FC\u30BF\u53D7\u4FE1\u6642:{type:"func",josi:[["\u3067"]],pure:!1,fn:function(n,e){n=e.__findVar(n,null),e.__setSysVar("PluginWorker:ondata",(t,r)=>(e.__v0.\u53D7\u4FE1\u30C7\u30FC\u30BF=t,e.__v0.\u5BFE\u8C61\u30A4\u30D9\u30F3\u30C8=r,n(r,e)))},return_none:!0},\u30EF\u30FC\u30AB\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8\u53D7\u4FE1\u6642:{type:"func",josi:[["\u3067"]],pure:!1,fn:function(n,e){n=e.__findVar(n,null),self.onmessage=t=>(e.__v0.\u53D7\u4FE1\u30C7\u30FC\u30BF=t.data,e.__v0.\u5BFE\u8C61\u30A4\u30D9\u30F3\u30C8=t,n(t,e))},return_none:!0},NAKO\u30EF\u30FC\u30AB\u30FC\u30C7\u30FC\u30BF\u9001\u4FE1:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){postMessage({type:"data",data:n})},return_none:!0},\u30EF\u30FC\u30AB\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8\u9001\u4FE1:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){postMessage(n)},return_none:!0},\u8868\u793A:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n,e){postMessage({type:"output",data:n})},return_none:!0},\u7D42\u4E86:{type:"func",josi:[],pure:!0,fn:function(n){close()},return_none:!0}},nt=Jt;var $e=class extends he{constructor(){super(),this.__setSysVar("\u30CA\u30C7\u30B7\u30B3\u7A2E\u985E","wwnako3"),this.__setSysVar("PluginWorker:ondata",(e,t)=>{throw new Error("\u300ENAKO\u30EF\u30FC\u30AB\u30FC\u30C7\u30FC\u30BF\u53D7\u4FE1\u6642\u300F\u304C\u547C\u3070\u308C\u3066\u3044\u307E\u305B\u3093\u3002")})}};if(typeof navigator=="object"&&self&&self instanceof WorkerGlobalScope){let n=navigator.nako3=new $e,e=n;n.addPluginObject("PluginBrowserInWorker",tt),n.addPluginObject("PluginWorker",nt),n.getLogger().addListener("error",function(t){self.postMessage({type:"error",data:t})},!1),self.onmessage=t=>{let r=t.data||{type:"",data:""},s=r.type||"",i=r.data||"";switch(s){case"reset":n.reset();break;case"close":self.close();break;case"run":e=e.runEx(i,"_webworker.nako3",{resetEnv:!1,resetLog:!1});break;case"trans":i.forEach(o=>{if(o.type==="func")n.nakoFuncList[o.name]=o.content.meta,n.funclist[o.name]=o.content.func,n.__varslist[1].set(o.name,()=>{});else if(o.type==="val")n.__varslist[2].set(o.name,o.content);else if(o.type==="env")if(o.name==="modlist")for(let u of o.content)n.lexer.modList.indexOf(u.name)<0&&n.lexer.modList.push(u.name),u.export!=null&&!n.moduleExport.hasOwnProperty(u.name)&&(n.moduleExport[u.name]=u.export);else o.name==="constPools"?n.constPools=o.content:o.name==="constPoolsTemplate"?n.constPoolsTemplate=o.content:o.name==="chk"&&(n.chk=o.content)});break;case"data":e.__getSysVar("PluginWorker:ondata")&&e.__getSysVar("PluginWorker:ondata").apply(e,[i,t]);break}}}})();
|
|
454
454
|
//# sourceMappingURL=wnako3webworker.js.map
|