nadesiko3 3.7.21 → 3.7.22
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 +370 -334
- package/batch/jsplugin2text.nako3 +1 -1
- package/batch/pickup_command.nako3 +12 -0
- package/core/command/snako.mts +5 -1
- package/core/deno/snako.ts +5 -1
- package/core/package-lock.json +382 -21
- package/core/package.json +4 -4
- package/core/src/nako3.mts +178 -614
- package/core/src/nako_basic_plugins.mts +39 -0
- package/core/src/nako_core_version.mts +2 -2
- package/core/src/nako_csv.mts +0 -1
- package/core/src/nako_event.mts +49 -0
- package/core/src/nako_gen.mts +291 -202
- package/core/src/nako_indent_inline.mts +2 -2
- package/core/src/nako_lex_rules.mts +1 -1
- package/core/src/nako_parser3.mts +106 -165
- package/core/src/nako_parser_async.mts +97 -0
- package/core/src/nako_parser_base.mts +4 -55
- package/core/src/nako_parser_message.mts +105 -0
- package/core/src/nako_parser_operator.mts +93 -0
- package/core/src/nako_plugin_manager.mts +260 -0
- package/core/src/nako_require.mts +292 -0
- package/core/src/nako_runner.mts +191 -0
- package/core/src/nako_tokenizer.mts +221 -0
- package/core/src/plugin_csv.mts +1 -1
- package/core/src/plugin_system.mts +34 -3259
- package/core/src/plugin_system_array.mts +699 -0
- package/core/src/plugin_system_datetime.mts +368 -0
- package/core/src/plugin_system_debug.mts +403 -0
- package/core/src/plugin_system_dict.mts +85 -0
- package/core/src/plugin_system_json.mts +73 -0
- package/core/src/plugin_system_math.mts +383 -0
- package/core/src/plugin_system_regexp.mts +120 -0
- package/core/src/plugin_system_stdio.mts +86 -0
- package/core/src/plugin_system_string.mts +666 -0
- package/core/src/plugin_system_timer.mts +152 -0
- package/core/src/plugin_system_types.mts +151 -0
- package/core/src/plugin_system_url.mts +193 -0
- package/core/src/plugin_toml.mts +3 -3
- package/core/test/fixtures/README.md +39 -0
- package/core/test/fixtures/make_parser_ast_golden.mjs +31 -0
- package/core/test/fixtures/parser_ast_golden.json +8027 -0
- package/core/test/fixtures/parser_corpus.mjs +120 -0
- package/core/test/indent_test.mjs +6 -0
- package/core/test/nako_basic_plugins_test.mjs +44 -0
- package/core/test/nako_event_test.mjs +85 -0
- package/core/test/nako_gen_perf_test.mjs +178 -0
- package/core/test/nako_parser_async_test.mjs +112 -0
- package/core/test/nako_parser_test.mjs +160 -0
- package/core/test/nako_plugin_manager_test.mjs +185 -0
- package/core/test/nako_require_test.mjs +153 -0
- package/core/test/nako_runner_test.mjs +114 -0
- package/core/test/nako_tokenizer_test.mjs +115 -0
- package/core/test/plugin_system_debug_test.mjs +141 -0
- package/core/test/plugin_system_split_test.mjs +179 -0
- package/core/test/plugin_system_test.mjs +6 -0
- package/core/tsconfig.json +0 -1
- package/package.json +17 -21
- package/release/_hash.txt +36 -36
- package/release/_script-tags.txt +16 -16
- 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 +6 -6
- package/release/edit_main.js.map +3 -3
- package/release/editor.js +6 -6
- package/release/plugin_keigo.js.map +3 -3
- package/release/plugin_markup.js +46 -46
- package/release/plugin_markup.js.map +3 -3
- package/release/plugin_weykturtle3d.js +1 -1
- package/release/plugin_weykturtle3d.js.map +3 -3
- package/release/version.js +2 -2
- package/release/version_main.js +2 -2
- package/release/version_main.js.map +1 -1
- package/release/wnako3.js +186 -213
- package/release/wnako3.js.map +4 -4
- package/release/wnako3webworker.js +172 -199
- package/release/wnako3webworker.js.map +4 -4
- package/src/cnako3mod.mjs +7 -2
- package/src/cnako3mod.mts +7 -2
- package/src/nako_version.mjs +2 -2
- package/src/nako_version.mts +2 -2
- package/src/plugin_browser_ajax.mjs +4 -4
- package/src/plugin_browser_ajax.mts +4 -4
- package/src/plugin_browser_audio.mjs +10 -10
- package/src/plugin_browser_audio.mts +10 -10
- package/src/plugin_browser_camera.mjs +4 -4
- package/src/plugin_browser_camera.mts +4 -4
- package/src/plugin_browser_canvas.mjs +2 -2
- package/src/plugin_browser_canvas.mts +2 -2
- package/src/plugin_browser_crypto.mjs +3 -3
- package/src/plugin_browser_crypto.mts +3 -3
- package/src/plugin_browser_dom_event.mjs +1 -1
- package/src/plugin_browser_dom_event.mts +1 -1
- package/src/plugin_browser_geolocation.mjs +1 -1
- package/src/plugin_browser_geolocation.mts +1 -1
- package/src/plugin_browser_hotkey.mjs +1 -1
- package/src/plugin_browser_hotkey.mts +1 -1
- package/src/plugin_browser_html.mjs +1 -1
- package/src/plugin_browser_html.mts +1 -1
- package/src/plugin_browser_location.mjs +1 -1
- package/src/plugin_browser_location.mts +1 -1
- package/src/plugin_browser_speech.mjs +1 -1
- package/src/plugin_browser_speech.mts +1 -1
- package/src/plugin_browser_storage.mjs +2 -2
- package/src/plugin_browser_storage.mts +2 -2
- package/src/plugin_httpserver.mjs +3 -3
- package/src/plugin_httpserver.mts +3 -3
- package/src/plugin_keigo.mjs +2 -2
- package/src/plugin_keigo.mts +2 -2
- package/src/plugin_node.mjs +48 -48
- package/src/plugin_node.mts +53 -53
- package/src/plugin_weykturtle3d.mjs +56 -56
- package/src/plugin_weykturtle3d.mts +56 -56
- package/src/wnako3.mjs +1 -1
- package/src/wnako3.mts +1 -1
- package/src/wnako3_editor.mjs +5 -5
- package/src/wnako3_editor.mts +5 -5
- package/src/wnako3mod.mjs +2 -2
- package/src/wnako3mod.mts +2 -2
- package/core/src/nako3.mjs +0 -1021
- package/core/src/nako_ast.mjs +0 -4
- package/core/src/nako_colors.mjs +0 -77
- package/core/src/nako_core_version.mjs +0 -8
- package/core/src/nako_csv.mjs +0 -193
- package/core/src/nako_errors.mjs +0 -166
- package/core/src/nako_from_dncl.mjs +0 -285
- package/core/src/nako_from_dncl2.mjs +0 -347
- package/core/src/nako_gen.mjs +0 -2500
- package/core/src/nako_global.mjs +0 -138
- package/core/src/nako_indent.mjs +0 -442
- package/core/src/nako_indent_chars.mjs +0 -29
- package/core/src/nako_indent_inline.mjs +0 -361
- package/core/src/nako_josi_list.mjs +0 -47
- package/core/src/nako_lex_rules.mjs +0 -319
- package/core/src/nako_lexer.mjs +0 -794
- package/core/src/nako_logger.mjs +0 -221
- package/core/src/nako_parser3.mjs +0 -3250
- package/core/src/nako_parser_base.mjs +0 -403
- package/core/src/nako_parser_const.mjs +0 -37
- package/core/src/nako_prepare.mjs +0 -329
- package/core/src/nako_reserved_words.mjs +0 -42
- package/core/src/nako_source_mapping.mjs +0 -207
- package/core/src/nako_test.mjs +0 -37
- package/core/src/nako_token.mjs +0 -1
- package/core/src/nako_tools.mjs +0 -53
- package/core/src/nako_types.mjs +0 -14
- package/core/src/plugin_api.mjs +0 -4
- package/core/src/plugin_csv.mjs +0 -97
- package/core/src/plugin_math.mjs +0 -352
- package/core/src/plugin_promise.mjs +0 -102
- package/core/src/plugin_system.mjs +0 -3810
- package/core/src/plugin_test.mjs +0 -52
- package/core/src/plugin_toml.mjs +0 -39
|
@@ -1,27 +1,34 @@
|
|
|
1
|
-
"use strict";(()=>{var I={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},W=["\u3044\u3066","\u3048\u3066","\u304D\u3066","\u3051\u3066","\u3057\u3066","\u3063\u3066","\u306B\u3066","\u307F\u3066","\u3081\u3066","\u306D\u3066","\u306B\u306F","\u3093\u3067"],ie=[];for(let n in I)ie.push(n);function $(n="?",e="",t=-1,r=0,s="main.nako3"){return{type:n,value:e,indent:t,line:r,column:0,file:s,josi:""}}var oe=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",this.localvars=new Map([["\u305D\u308C",{type:"var",value:""}]]),this.usedFuncs=new Set,this.funcLevel=0,this.usedAsyncFn=!1,this.isReadingCalc=!1,this.isExportDefault=!0,this.isExportStack=[],this.namespaceStack=[],this.modList=[],this.stackList=[],this.recentlyCalledFunc=[],this.arrayIndexFrom=0,this.flagReverseArrayIndex=!1,this.flagCheckArrayInit=!1,this.isModifiedNodes=!1}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=$()),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 M=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}},ue=class extends M{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}},P=class extends M{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}},R=class extends M{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}},_=class n extends M{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}},G=class n extends M{constructor(e,t){let r="unknown";typeof e=="string"?r=e:e instanceof n||e instanceof M?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}},Z=class extends M{constructor(e,t,r){super("\u53D6\u308A\u8FBC\u307F\u30A8\u30E9\u30FC",e,t,r),this.file=t,this.line=r}};var At=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"]]),Se=At;function Je(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 ae=["\u306B\u3064\u3044\u3066","\u304F\u3089\u3044","\u306A\u306E\u304B","\u307E\u3067\u3092","\u307E\u3067\u306E","\u306B\u3088\u308B","\u3068\u3057\u3066","\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"],Nt=["\u3067\u306A\u3051\u308C\u3070","\u306A\u3051\u308C\u3070","\u306A\u3089\u3070","\u306A\u3089","\u305F\u3089","\u308C\u3070"],Ot=["\u3053\u3068","\u3067\u3042\u308B","\u3067\u3059","\u3057\u307E\u3059","\u3067\u3057\u305F","\u306B\u3083\u3093"],je={};Nt.forEach(n=>{ae.push(n),je[n]=!0});var U={};Ot.forEach(n=>{ae.push(n),U[n]=!0});var ce=[];for(let n of ae)ce.push("\u3082\u306E"+n),ce.push(n);ce.sort((n,e)=>e.length-n.length);var Ft="^[\\t \u3000]*("+ce.join("|")+")",q=new RegExp(Ft),Re=ae;var Ct=/^[\u3005\u4E00-\u9FCF_a-zA-Z0-9ァ-ヶー\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]+/,Be=/^[ぁ-ん]/,Et=/^[ぁ-ん]+$/,Tt=/^.+(以上|以下|超|未満)$/,Mt=/^(かつ|または)/,Ge=n=>function(){throw new Error("\u7A81\u7136\u306E\u300E"+n+"\u300F\u304C\u3042\u308A\u307E\u3059\u3002")},We=/^(円|ドル|元|歩|㎡|坪|度|℃|°|個|つ|本|冊|才|歳|匹|枚|皿|セット|羽|人|件|行|列|機|品|m|mm|cm|km|g|kg|t|b|mb|kb|gb)/,Ue=/^(px|em|ex|rem|vw|vh|vmin|vmax)/,qe=[{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:It},{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:z},{name:"number",pattern:/^0[oO][0-7]+(_[0-7]+)*/,readJosi:!0,cb:z},{name:"number",pattern:/^0[bB][0-1]+(_[0-1]+)*/,readJosi:!0,cb:z},{name:"number",pattern:/^\d+(_\d+)*\.(\d+(_\d+)*)?([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:z},{name:"number",pattern:/^\.\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:z},{name:"number",pattern:/^\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:z},{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=>Lt(n)},{name:"$",pattern:/^(\$|\.)/},{name:"string",pattern:/^🌿/,cbParser:n=>B("\u{1F33F}","\u{1F33F}",n)},{name:"string_ex",pattern:/^🌴/,cbParser:n=>B("\u{1F334}","\u{1F334}",n)},{name:"string_ex",pattern:/^「/,cbParser:n=>B("\u300C","\u300D",n)},{name:"string",pattern:/^『/,cbParser:n=>B("\u300E","\u300F",n)},{name:"string_ex",pattern:/^“/,cbParser:n=>B("\u201C","\u201D",n)},{name:"string_ex",pattern:/^"/,cbParser:n=>B('"','"',n)},{name:"string",pattern:/^'/,cbParser:n=>B("'","'",n)},{name:"\u300D",pattern:/^」/,cbParser:Ge("\u300D")},{name:"\u300F",pattern:/^』/,cbParser:Ge("\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 Vt(n){return Be.test(n)?Et.test(n)?n:n.replace(/[ぁ-ん]+$/g,""):n.replace(/[ぁ-ん]+/g,"")}function It(n){let e="",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
|
-
|
|
3
|
-
`&&i++;return{src:t,res:r,josi:s,numEOL:i}}function Lt(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=q.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 z(n){return Number(n.replace(/_/g,""))}var T=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(Se.keys()),this.josiList=Re}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 d=e[i];if(i++,d.type===")")break;d.type==="func"?o=!0:d.type!=="|"&&d.type!=="comma"&&(o&&(d.funcPointer=!0,o=!1),c.push(d),a[d.value]||(a[d.value]=[]),a[d.value].push(d.josi))}let f=[],l=[],p=[],h={};for(let d of c)if(!h[d.value]){let m=a[d.value];p.push(m),f.push(d.value),d.funcPointer?l.push(d.value):l.push(null),h[d.value]=!0}return[p,f,l]};for(;i<e.length;){let c=e[i];if(c.type==="not"&&e.length-i>3){let y={type:"eol"};if(i>=1&&(y=e[i-1]),y.type==="eol"){let k=e[i+1];if(k.type==="word"&&k.value==="\u30E2\u30B8\u30E5\u30FC\u30EB\u516C\u958B\u65E2\u5B9A\u5024"){if(k.type="\u30E2\u30B8\u30E5\u30FC\u30EB\u516C\u958B\u65E2\u5B9A\u5024",k=e[i+2],k.type==="string"&&k.value==="\u975E\u516C\u958B"){let x=n.filenameToModName(c.file);s.set(x,!1),i+=3;continue}else if(k.type==="string"&&k.value==="\u516C\u958B"){let x=n.filenameToModName(c.file);s.set(x,!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 y=e[i+1];y.value==="\u7E70\u8FD4"&&(y.value="\u9593",y.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 y={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,y),c.endOffset--,i++}if(c.type==="word"){let y=Se.get(c.value);y&&(c.type=y),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 p=[],h=[],d=[],m="",g=null,b=null;if(e[i]&&e[i].type==="{"){i++;let y=e[i]&&e[i].type==="word"?e[i].value:"";y==="\u516C\u958B"?b=!0:y==="\u975E\u516C\u958B"?b=!1:y==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"?b=!0:t.warn(`\u4E0D\u660E\u306A\u95A2\u6570\u5C5E\u6027\u300E${String(y)}\u300F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002`),i++,e[i]&&e[i].type==="}"&&i++}if(e[i]&&e[i].type==="("&&([p,h,d]=u()),!a&&e[i]&&e[i].type==="word"&&(g=e[i++],m=g.value),p.length===0&&e[i]&&e[i].type==="("&&([p,h,d]=u()),m!==""&&g){if(m=n.filenameToModName(c.file)+"__"+m,r.has(m)){let k=m.replace(/^main__/,"");t.warn(`\u95A2\u6570\u300E${k}\u300F\u306F\u65E2\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059\u3002`,l)}g.value=m,r.set(m,{type:"func",josi:p,fn:null,asyncFn:!1,isExport:b,varnames:h,funcPointers:d})}let v={type:"func",josi:p,varnames:h,funcPointers:d};l.meta=v}}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 P("\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 P("\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}`,p=this.funclist.get(l);if(p&&p.type==="func"){let h=c;h.type=s?"func_pointer":"func",h.meta=p,h.value=l,s&&(s=!1,e.splice(r-1,1));continue}for(let h of this.modList){let d=`${h}__${a}`,m=this.funclist.get(d),g=this.moduleExport.get(h);if(m&&m.type==="func"&&(m.isExport===!0||m.isExport!==!1&&g!==!1)){let b=c;b.type=s?"func_pointer":"func",b.meta=m,b.value=d,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"||I[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(je[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=Je(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 p=!1;for(let h of qe){let d=h.pattern.exec(e);if(!d)continue;let m=h.name;if(p=!0,h.name==="space"){c+=d[0].length,e=e.substring(d[0].length);continue}if(h.cbParser){let y;if(a&&h.name==="word")y=h.cbParser(e,!1);else try{y=h.cbParser(e)}catch(k){throw new R(k.message,s-e.length,s-e.length+1,t,r)}if(h.name==="string_ex"){let k=this.splitStringEx(y.res);if(k===null)throw new P("\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-y.src.length,t,r);if(k.length===1){i.push({type:"string",value:k[0],josi:y.josi,indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:e.length-y.src.length}),t+=y.numEOL,c+=e.length-y.src.length,e=y.src,y.numEOL>0&&(c=1);break}i.push({type:"(",value:"(",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:0});let x=0;for(let E=0;E<k.length;E++)E%2===0?(i.push({type:"string",value:k[E],file:r,josi:"",indent:f,line:t,column:c,preprocessedCodeOffset:s-e.length+x,preprocessedCodeLength:k[E].length+2}),x+=k[E].length+2):(i.push({type:"&",value:"&",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+x,preprocessedCodeLength:0}),i.push({type:"(",value:"(",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+x,preprocessedCodeLength:0}),i.push({type:"code",value:k[E],josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+x,preprocessedCodeLength:k[E].length}),i.push({type:")",value:")",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+x+k[E].length,preprocessedCodeLength:0}),i.push({type:"&",value:"&",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+x+k[E].length,preprocessedCodeLength:0}),x+=k[E].length);t+=y.numEOL,c+=e.length-y.src.length,e=y.src,y.numEOL>0&&(c=1),i.push({type:")",value:")",josi:y.josi,indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:0});break}o=c,c+=e.length-y.src.length,i.push({type:h.name,value:y.res,josi:y.josi,indent:f,line:t,column:o,file:r,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:e.length-y.src.length}),e=y.src,t+=y.numEOL,y.numEOL>0&&(c=1);break}let g=s-e.length,b=d[0];if(h.cb&&(b=h.cb(b)),o=c,u=t,c+=d[0].length,e=e.substring(d[0].length),(h.name==="eol"&&b===`
|
|
5
|
-
`||h.name==="_eol")&&(b=t++,c=1),h.name==="number"){let y=We.exec(e);y&&(e=e.substring(y[0].length),c+=d[0].length);let k=Ue.exec(e);k&&(m="string",e=e.substring(k[0].length),c+=d[0].length,b+=k[0])}let v="";if(h.readJosi){let y=q.exec(e);y&&(c+=y[0].length,v=y[0].replace(/^\s+/,""),e=e.substring(y[0].length),e.charAt(0)===","&&(e=e.substring(1)),U[v]&&(v=""),v.substring(0,2)==="\u3082\u306E"&&(v=v.substring(2)))}switch(m){case"def_test":{a=!0;break}case"eol":{a=!1;break}default:break}if(m==="dec_lineno"){t--;continue}if(i.push({type:m,value:b,indent:f,line:u,column:o,file:r,josi:v,preprocessedCodeOffset:g,preprocessedCodeLength:s-e.length-g}),m==="eol"&&c===1){let y=this.countIndent(e);f=y[0],c+=y[1],e=e.substring(y[1])}break}if(!p)throw new P("\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 fe=class extends oe{parse(e,t){this.reset(),this.tokens=e,this.modName=T.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),_.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),_.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
|
-
`}return this.recentlyCalledFunc=[],`\u672A\u89E3\u6C7A\u306E\u5358\u8A9E\u304C\u3042\u308A\u307E\u3059: [${t}]
|
|
1
|
+
"use strict";(()=>{var V={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},U=["\u3044\u3066","\u3048\u3066","\u304D\u3066","\u3051\u3066","\u3057\u3066","\u3063\u3066","\u306B\u3066","\u307F\u3066","\u3081\u3066","\u306D\u3066","\u306B\u306F","\u3093\u3067"],ae=[];for(let n in V)ae.push(n);function x(n="?",e="",t=-1,r=0,s="main.nako3"){return{type:n,value:e,indent:t,line:r,column:0,file:s,josi:""}}function z(n,e,t){let r=e.depth-1,s=o=>e.typeName!==void 0?e.typeName:o,i=t?" debug: "+JSON.stringify(n,null,2):"";if(!n)return"(NULL)";switch(n.type){case"not":if(r>=0){let o=n.blocks[0];return`${s("")}\u300E${z(o,{depth:r},t)}\u306B\u6F14\u7B97\u5B50\u300Enot\u300F\u3092\u9069\u7528\u3057\u305F\u5F0F${i}\u300F`}else return`${s("\u6F14\u7B97\u5B50")}\u300Enot\u300F`;case"op":{let o=n,u=o.operator||"",c={eq:"\uFF1D",not:"!",gt:">",lt:"<",and:"\u304B\u3064",or:"\u307E\u305F\u306F"};if(u in c&&(u=c[u]),r>=0){let a=z(o.blocks[0],{depth:r},t),f=z(o.blocks[1],{depth:r},t);return o.operator==="eq"?`${s("")}\u300E${a}\u3068${f}\u304C\u7B49\u3057\u3044\u304B\u3069\u3046\u304B\u306E\u6BD4\u8F03${i}\u300F`:`${s("")}\u300E${a}\u3068${f}\u306B\u6F14\u7B97\u5B50\u300E${u}\u300F\u3092\u9069\u7528\u3057\u305F\u5F0F${i}\u300F`}else return`${s("\u6F14\u7B97\u5B50")}\u300E${u}${i}\u300F`}case"number":return`${s("\u6570\u5024")}${n.value}`;case"bigint":return`${s("\u5DE8\u5927\u6574\u6570")}${n.value}`;case"string":return`${s("\u6587\u5B57\u5217")}\u300E${n.value}${i}\u300F`;case"word":return`${s("\u5358\u8A9E")}\u300E${n.value}${i}\u300F`;case"func":return`${s("\u95A2\u6570")}\u300E${n.name||n.value}${i}\u300F`;case"eol":return"\u884C\u306E\u672B\u5C3E";case"eof":return"\u30D5\u30A1\u30A4\u30EB\u306E\u672B\u5C3E";default:{let o=n.name;return o&&typeof o!="string"&&(o=n.value),typeof o!="string"&&(o=n.type),`${s("")}\u300E${o}${i}\u300F`}}}function Ke(n,e){let t=[];n.forEach(o=>{let u=z(o,{depth:1},!1);o.josi&&(u+=o.josi),t.push(u)});let r=t.join(","),s="",i=65;for(let o of e){s+=" - ";let u=0,c=o.josi;if(c)for(let a of c){let f=String.fromCharCode(i+u);s+=f,a.length===1?s+=a[0]:s+=`(${a.join("|")})`,u++}s+=String(o.name)+`
|
|
2
|
+
`}return`\u672A\u89E3\u6C7A\u306E\u5358\u8A9E\u304C\u3042\u308A\u307E\u3059: [${r}]
|
|
7
3
|
\u6B21\u306E\u547D\u4EE4\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059:
|
|
8
|
-
${
|
|
9
|
-
`+
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
`+JSON.stringify(s)),_.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,t){let r=!1,s=this.stack.length;for(;!this.isEOF();){if(this.check(")")){r=!0;break}let o=this.yCalc();if(o){this.pushStack(o),this.check("comma")&&this.get();continue}break}if(!r){let o=t||e[0].value||this.nodeToStr(e[0],{depth:0,typeName:"\u95A2\u6570"},!1);throw _.fromNode(`C\u98A8\u95A2\u6570\u300E${o}\u300F\u3067\u30AB\u30C3\u30B3\u304C\u9589\u3058\u3066\u3044\u307E\u305B\u3093`,e[0])}let i=[];for(;s<this.stack.length;){let o=this.popStack();o&&i.unshift(o)}return i}yApplyCallValue(e){let t=e;for(;this.check("(");){this.get();let r=this.yGetArgParen([t],"\u95A2\u6570\u547C\u3073\u51FA\u3057\u306E\u7D50\u679C");if(!this.check(")"))throw _.fromNode("C\u98A8\u95A2\u6570\u547C\u3073\u51FA\u3057\u306E\u30A8\u30E9\u30FC",t);let s=this.get();t={type:"call_value",blocks:[t,...r],josi:s?.josi||"",startOffset:t.startOffset,endOffset:s?.endOffset,line:t.line,column:t.column,file:t.file,end:this.peekSourceMap()}}return t}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 _.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 _.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 _.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 _.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 m=String(u.value)+o.type;if(m==="\u5897\u7E70\u8FD4")o.type="\u5897\u7E70\u8FD4";else if(m==="\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"]),p="";if(l!==null){if(l.type!=="word")throw _.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);p=l.value}if((f===null||a===null)&&!(f===null&&a&&a.type==="func"&&a.name==="\u7BC4\u56F2"))throw _.fromNode(e,o);this.check("comma")&&this.get();let h=!1;this.check("\u3053\u3053\u304B\u3089")?(h=!0,this.get()):this.check("eol")&&(h=!0,this.get());let d=this.yNop();if(h)if(d=this.yBlock(),this.check("\u3053\u3053\u307E\u3067"))this.get();else throw _.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 m=this.ySentence();m&&(d=m)}return d||(d=this.yNop()),{type:"for",blocks:[f,a,c,d],flagDown:t,flagUp:r,loopDirection:s,word:p,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 _.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 _.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 _.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 _.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 _.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 p=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]=p;break}let c=this.yValue();if(!c)throw _.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 _.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();let i=this.yNop(),o=!1;this.funcLevel++,this.saveStack();let u=this.usedAsyncFn;this.usedAsyncFn=!1;let c=this.localvars;this.localvars=new Map([["\u305D\u308C",{type:"var",value:""}]]);for(let a of s){if(!a||!a.value)continue;let f=a.value;this.localvars.set(f,{type:"var",value:""})}try{if(i=this.yBlock(),o=this.usedAsyncFn,!this.check("\u3053\u3053\u307E\u3067"))throw _.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);this.get()}finally{this.loadStack(),this.usedAsyncFn=u,this.localvars=c,this.funcLevel--}return{type:"func_obj",name:"",args:s,blocks:[i],meta:r.meta,josi:"",isExport:!1,asyncFn:o,...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 _.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 _.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 _.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 _.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(["\u3092"]);if(!r||r.type!=="word"&&r.type!=="ref_array"&&r.type!=="ref_prop")throw _.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);let s=this.popStack(["\u3060\u3051",""]);if(s||(s={type:"number",value:1,josi:"\u3060\u3051",...e,end:this.peekSourceMap()}),t.value==="\u6E1B"){let i={type:"number",value:-1,line:t.line};s={type:"op",operator:"*",blocks:[s,i],josi:"",...e}}return{type:"inc",name:r,blocks:[s],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===""||W.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(ie))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 ---
|
|
4
|
+
${s}`}var fe=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.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",this.localvars=new Map([["\u305D\u308C",{type:"var",value:""}]]),this.usedFuncs=new Set,this.funcLevel=0,this.usedAsyncFn=!1,this.isReadingCalc=!1,this.isExportDefault=!0,this.isExportStack=[],this.namespaceStack=[],this.modList=[],this.stackList=[],this.recentlyCalledFunc=[],this.arrayIndexFrom=0,this.flagReverseArrayIndex=!1,this.flagCheckArrayInit=!1}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=x()),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){return z(e,t,r)}};var M=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}},le=class extends M{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}},D=class extends M{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}},G=class extends M{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}},y=class n extends M{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}},q=class n extends M{constructor(e,t){let r="unknown";typeof e=="string"?r=e:e instanceof n||e instanceof M?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}},te=class extends M{constructor(e,t,r){super("\u53D6\u308A\u8FBC\u307F\u30A8\u30E9\u30FC",e,t,r),this.file=t,this.line=r}};function Zt(n,e){let t=i=>V[i.type]?V[i.type]:10,r=[],s=[];for(;n.length>0;){let i=n.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){e.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}function Ye(n,e){if(n.length===0)return null;let t=n[n.length-1].josi,r=n[n.length-1],s=Zt(n,e),i=[];for(let u of s){if(!V[u.type]){i.push(u);continue}let c=i.pop(),a=i.pop();if(a===void 0||c===void 0)throw e.debug(`--- \u8A08\u7B97\u5F0F(\u9006\u30DD\u30FC\u30E9\u30F3\u30C9) ---
|
|
5
|
+
`+JSON.stringify(s)),y.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}function He(n,e){let t={modified:!1};return he(n,e,t),t.modified}function he(n,e,t){if(!n)return!1;if(n.type==="def_func"||n.type==="def_test"||n.type==="func_obj"){let r=n;if(r.asyncFn)return!0;let s=!1;for(let i of r.blocks)if(he(i,e,t))return s=!0,r.asyncFn=s,r.meta.asyncFn=s,t.modified=!0,!0}if(n.type==="func"){let r=n;if(r.asyncFn)return!0;if(r.blocks){for(let i of r.blocks)if(he(i,e,t))return r.asyncFn=!0,t.modified=!0,!0}let s=e.get(r.name);return s&&s.asyncFn?(r.asyncFn=!0,t.modified=!0,!0):!1}if(n.type==="renbun")return!0;if(n.blocks){for(let r of n.blocks)if(he(r,e,t))return!0}return!1}var Qt=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"]]),Ee=Qt;function Ze(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 de=["\u306B\u3064\u3044\u3066","\u304F\u3089\u3044","\u306A\u306E\u304B","\u307E\u3067\u3092","\u307E\u3067\u306E","\u306B\u3088\u308B","\u3068\u3057\u3066","\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"],en=["\u3067\u306A\u3051\u308C\u3070","\u306A\u3051\u308C\u3070","\u306A\u3089\u3070","\u306A\u3089","\u305F\u3089","\u308C\u3070"],tn=["\u3053\u3068","\u3067\u3042\u308B","\u3067\u3059","\u3057\u307E\u3059","\u3067\u3057\u305F","\u306B\u3083\u3093"],Te={};en.forEach(n=>{de.push(n),Te[n]=!0});var X={};tn.forEach(n=>{de.push(n),X[n]=!0});var pe=[];for(let n of de)pe.push("\u3082\u306E"+n),pe.push(n);pe.sort((n,e)=>e.length-n.length);var nn="^[\\t \u3000]*("+pe.join("|")+")",K=new RegExp(nn),Qe=de;var rn=/^[\u3005\u4E00-\u9FCF_a-zA-Z0-9ァ-ヶー\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]+/,tt=/^[ぁ-ん]/,sn=/^[ぁ-ん]+$/,on=/^.+(以上|以下|超|未満)$/,un=/^(かつ|または)/,et=n=>function(){throw new Error("\u7A81\u7136\u306E\u300E"+n+"\u300F\u304C\u3042\u308A\u307E\u3059\u3002")},nt=/^(円|ドル|元|歩|㎡|坪|度|℃|°|個|つ|本|冊|才|歳|匹|枚|皿|セット|羽|人|件|行|列|機|品|m|mm|cm|km|g|kg|t|b|mb|kb|gb)/,rt=/^(px|em|ex|rem|vw|vh|vmin|vmax)/,st=[{name:"\u3053\u3053\u307E\u3067",pattern:/^;;;/},{name:"eol",pattern:/^\n/},{name:"eol",pattern:/^;/},{name:"space",pattern:/^(\x20|\t| |・|⎿ |└||)+/},{name:"comma",pattern:/^,/},{name:"line_comment",pattern:/^#[^\n]*/},{name:"line_comment",pattern:/^\/\/[^\n]*/},{name:"range_comment",pattern:/^\/\*/,cbParser:an},{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:Y},{name:"number",pattern:/^0[oO][0-7]+(_[0-7]+)*/,readJosi:!0,cb:Y},{name:"number",pattern:/^0[bB][0-1]+(_[0-1]+)*/,readJosi:!0,cb:Y},{name:"number",pattern:/^\d+(_\d+)*\.(\d+(_\d+)*)?([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:Y},{name:"number",pattern:/^\.\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:Y},{name:"number",pattern:/^\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:Y},{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=>ln(n)},{name:"$",pattern:/^(\$|\.)/},{name:"string",pattern:/^🌿/,cbParser:n=>W("\u{1F33F}","\u{1F33F}",n)},{name:"string_ex",pattern:/^🌴/,cbParser:n=>W("\u{1F334}","\u{1F334}",n)},{name:"string_ex",pattern:/^「/,cbParser:n=>W("\u300C","\u300D",n)},{name:"string",pattern:/^『/,cbParser:n=>W("\u300E","\u300F",n)},{name:"string_ex",pattern:/^“/,cbParser:n=>W("\u201C","\u201D",n)},{name:"string_ex",pattern:/^"/,cbParser:n=>W('"','"',n)},{name:"string",pattern:/^'/,cbParser:n=>W("'","'",n)},{name:"\u300D",pattern:/^」/,cbParser:et("\u300D")},{name:"\u300F",pattern:/^』/,cbParser:et("\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:fn}];function cn(n){return tt.test(n)?sn.test(n)?n:n.replace(/[ぁ-ん]+$/g,""):n.replace(/[ぁ-ん]+/g,"")}function an(n){let e="",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)===`
|
|
6
|
+
`&&r++;return e=e.replace(/(^\s+|\s+$)/,""),{src:n,res:e,josi:"",numEOL:r}}function fn(n,e=!0){let t="",r="";for(;n!=="";){if(t.length>0){if(un.exec(n))break;let c=K.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=rn.exec(n);if(i){t+=i[0],n=n.substring(i[0].length);continue}if(tt.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=on.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)),X[r]&&(r=""),e&&(t=cn(t)),t===""&&r!==""&&(t=r,r=""),{src:n,res:t,josi:r,numEOL:0}}function W(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=K.exec(t);u&&(s=u[0].replace(/^\s+/,""),t=t.substring(u[0].length),t.charAt(0)===","&&(t=t.substring(1))),X[s]&&(s=""),s.substring(0,2)==="\u3082\u306E"&&(s=s.substring(2));for(let c=0;c<r.length;c++)r.charAt(c)===`
|
|
7
|
+
`&&i++;return{src:t,res:r,josi:s,numEOL:i}}function ln(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=K.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)===`
|
|
8
|
+
`&&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 Y(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(Ee.keys()),this.josiList=Qe}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 d=e[i];if(i++,d.type===")")break;d.type==="func"?o=!0:d.type!=="|"&&d.type!=="comma"&&(o&&(d.funcPointer=!0,o=!1),c.push(d),a[d.value]||(a[d.value]=[]),a[d.value].push(d.josi))}let f=[],l=[],p=[],h={};for(let d of c)if(!h[d.value]){let _=a[d.value];p.push(_),f.push(d.value),d.funcPointer?l.push(d.value):l.push(null),h[d.value]=!0}return[p,f,l]};for(;i<e.length;){let c=e[i];if(c.type==="not"&&e.length-i>3){let g={type:"eol"};if(i>=1&&(g=e[i-1]),g.type==="eol"){let b=e[i+1];if(b.type==="word"&&b.value==="\u30E2\u30B8\u30E5\u30FC\u30EB\u516C\u958B\u65E2\u5B9A\u5024"){if(b.type="\u30E2\u30B8\u30E5\u30FC\u30EB\u516C\u958B\u65E2\u5B9A\u5024",b=e[i+2],b.type==="string"&&b.value==="\u975E\u516C\u958B"){let $=n.filenameToModName(c.file);s.set($,!1),i+=3;continue}else if(b.type==="string"&&b.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 g=e[i+1];g.value==="\u7E70\u8FD4"&&(g.value="\u9593",g.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 g={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,g),c.endOffset--,i++}if(c.type==="word"){let g=Ee.get(c.value);g&&(c.type=g),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 p=[],h=[],d=[],_="",v=null,m=null;if(e[i]&&e[i].type==="{"){i++;let g=e[i]&&e[i].type==="word"?e[i].value:"";g==="\u516C\u958B"?m=!0:g==="\u975E\u516C\u958B"?m=!1:g==="\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8"?m=!0:t.warn(`\u4E0D\u660E\u306A\u95A2\u6570\u5C5E\u6027\u300E${String(g)}\u300F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\u3002`),i++,e[i]&&e[i].type==="}"&&i++}if(e[i]&&e[i].type==="("&&([p,h,d]=u()),!a&&e[i]&&e[i].type==="word"&&(v=e[i++],_=v.value),p.length===0&&e[i]&&e[i].type==="("&&([p,h,d]=u()),_!==""&&v){if(_=n.filenameToModName(c.file)+"__"+_,r.has(_)){let b=_.replace(/^main__/,"");t.warn(`\u95A2\u6570\u300E${b}\u300F\u306F\u65E2\u306B\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059\u3002`,l)}v.value=_,r.set(_,{type:"func",josi:p,fn:null,asyncFn:!1,isExport:m,varnames:h,funcPointers:d})}let j={type:"func",josi:p,varnames:h,funcPointers:d};l.meta=j}}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 D("\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 D("\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}`,p=this.funclist.get(l);if(p&&p.type==="func"){let h=c;h.type=s?"func_pointer":"func",h.meta=p,h.value=l,s&&(s=!1,e.splice(r-1,1));continue}for(let h of this.modList){let d=`${h}__${a}`,_=this.funclist.get(d),v=this.moduleExport.get(h);if(_&&_.type==="func"&&(_.isExport===!0||_.isExport!==!1&&v!==!1)){let m=c;m.type=s?"func_pointer":"func",m.meta=_,m.value=d,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"||V[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(Te[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=Ze(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 p=!1;for(let h of st){let d=h.pattern.exec(e);if(!d)continue;let _=h.name;if(p=!0,h.name==="space"){c+=d[0].length,e=e.substring(d[0].length);continue}if(h.cbParser){let g;if(a&&h.name==="word")g=h.cbParser(e,!1);else try{g=h.cbParser(e)}catch(b){throw new G(b.message,s-e.length,s-e.length+1,t,r)}if(h.name==="string_ex"){let b=this.splitStringEx(g.res);if(b===null)throw new D("\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-g.src.length,t,r);if(b.length===1){i.push({type:"string",value:b[0],josi:g.josi,indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:e.length-g.src.length}),t+=g.numEOL,c+=e.length-g.src.length,e=g.src,g.numEOL>0&&(c=1);break}i.push({type:"(",value:"(",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:0});let $=0;for(let T=0;T<b.length;T++)T%2===0?(i.push({type:"string",value:b[T],file:r,josi:"",indent:f,line:t,column:c,preprocessedCodeOffset:s-e.length+$,preprocessedCodeLength:b[T].length+2}),$+=b[T].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:b[T],josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+$,preprocessedCodeLength:b[T].length}),i.push({type:")",value:")",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+$+b[T].length,preprocessedCodeLength:0}),i.push({type:"&",value:"&",josi:"",indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length+$+b[T].length,preprocessedCodeLength:0}),$+=b[T].length);t+=g.numEOL,c+=e.length-g.src.length,e=g.src,g.numEOL>0&&(c=1),i.push({type:")",value:")",josi:g.josi,indent:f,file:r,line:t,column:c,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:0});break}o=c,c+=e.length-g.src.length,i.push({type:h.name,value:g.res,josi:g.josi,indent:f,line:t,column:o,file:r,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:e.length-g.src.length}),e=g.src,t+=g.numEOL,g.numEOL>0&&(c=1);break}let v=s-e.length,m=d[0];if(h.cb&&(m=h.cb(m)),o=c,u=t,c+=d[0].length,e=e.substring(d[0].length),(h.name==="eol"&&m===`
|
|
9
|
+
`||h.name==="_eol")&&(m=t++,c=1),h.name==="number"){let g=nt.exec(e);g&&(e=e.substring(g[0].length),c+=d[0].length);let b=rt.exec(e);b&&(_="string",e=e.substring(b[0].length),c+=d[0].length,m+=b[0])}let j="";if(h.readJosi){let g=K.exec(e);g&&(c+=g[0].length,j=g[0].replace(/^\s+/,""),e=e.substring(g[0].length),e.charAt(0)===","&&(e=e.substring(1)),X[j]&&(j=""),j.substring(0,2)==="\u3082\u306E"&&(j=j.substring(2)))}switch(_){case"def_test":{a=!0;break}case"eol":{a=!1;break}default:break}if(_==="dec_lineno"){t--;continue}if(i.push({type:_,value:m,indent:f,line:u,column:o,file:r,josi:j,preprocessedCodeOffset:v,preprocessedCodeLength:s-e.length-v}),_==="eol"&&c===1){let g=this.countIndent(e);f=g[0],c+=g[1],e=e.substring(g[1])}break}if(!p)throw new D("\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 ye=class extends fe{parse(e,t){this.reset(),this.tokens=e,this.modName=O.filenameToModName(t),this.modList.push(this.modName);let r=this.startParser();for(;He(r,this.funclist););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),y.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),y.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=Ke(this.stack,this.recentlyCalledFunc);return this.recentlyCalledFunc=[],e}yEOL(){let e=this.get();if(!e)return null;if(this.stack.length>0){let t=this.makeStackBalanceReport();throw y.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()||x();throw y.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(U.indexOf(t.josi||"")>=0){if(this.stack.length>=1){let i=this.makeStackBalanceReport();throw y.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 p=this.get();if(this.check("}"))this.get();else throw y.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);p!==null&&(p.value==="\u516C\u958B"&&(i=!0),p.value==="\u975E\u516C\u958B"&&(i=!1),p.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),y.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),y.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 p=this.localvars;if(this.localvars=new Map([["\u305D\u308C",{type:"var",value:""}]]),a){this.saveStack();for(let h of o){if(!h||!h.value)continue;let d=h.value;this.localvars.set(d,{type:"var",value:""})}if(c=this.yBlock(),this.check("\u3053\u3053\u307E\u3067"))this.get();else{let h=this.peek(),d=JSON.stringify(h);throw h&&h.type&&h.value&&(d=h.value),y.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${d}\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=p}catch(p){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
|
|
10
|
+
`+String(p.message),s),y.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
|
|
11
|
+
`+String(p.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 y.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 y.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),y.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 y.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 y.fromNode(`\u300E\u3082\u3057\u300F\u6587\u306E\u6761\u4EF6\u3067\u6B21\u306E\u30A8\u30E9\u30FC\u304C\u3042\u308A\u307E\u3059\u3002
|
|
12
|
+
`+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 y.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&&V[r.type]){r=this.getCur(),t.push(r);let s=this.yValue();if(s===null)throw y.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]:Ye(t,this.logger)}yRange(e){if(!this.check("\u2026"))return null;let t=this.peekSourceMap();this.get();let r=this.yValue();if(!e||!r)throw y.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 y.fromNode("\u300E??\u300F\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002",e);let r=this.yCalc();if(!r)throw y.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)}yGetArgParen(e,t){let r=!1,s=this.stack.length;for(;!this.isEOF();){if(this.check(")")){r=!0;break}let o=this.yCalc();if(o){this.pushStack(o),this.check("comma")&&this.get();continue}break}if(!r){let o=t||e[0].value||this.nodeToStr(e[0],{depth:0,typeName:"\u95A2\u6570"},!1);throw y.fromNode(`C\u98A8\u95A2\u6570\u300E${o}\u300F\u3067\u30AB\u30C3\u30B3\u304C\u9589\u3058\u3066\u3044\u307E\u305B\u3093`,e[0])}let i=[];for(;s<this.stack.length;){let o=this.popStack();o&&i.unshift(o)}return i}yApplyCallValue(e){let t=e;for(;this.check("(");){this.get();let r=this.yGetArgParen([t],"\u95A2\u6570\u547C\u3073\u51FA\u3057\u306E\u7D50\u679C");if(!this.check(")"))throw y.fromNode("C\u98A8\u95A2\u6570\u547C\u3073\u51FA\u3057\u306E\u30A8\u30E9\u30FC",t);let s=this.get();t={type:"call_value",blocks:[t,...r],josi:s?.josi||"",startOffset:t.startOffset,endOffset:s?.endOffset,line:t.line,column:t.column,file:t.file,end:this.peekSourceMap()}}return t}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 y.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 y.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 y.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 y.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 _=String(u.value)+o.type;if(_==="\u5897\u7E70\u8FD4")o.type="\u5897\u7E70\u8FD4";else if(_==="\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"]),p="";if(l!==null){if(l.type!=="word")throw y.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);p=l.value}if((f===null||a===null)&&!(f===null&&a&&a.type==="func"&&a.name==="\u7BC4\u56F2"))throw y.fromNode(e,o);this.check("comma")&&this.get();let h=!1;this.check("\u3053\u3053\u304B\u3089")?(h=!0,this.get()):this.check("eol")&&(h=!0,this.get());let d=this.yNop();if(h)if(d=this.yBlock(),this.check("\u3053\u3053\u307E\u3067"))this.get();else throw y.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 _=this.ySentence();_&&(d=_)}return d||(d=this.yNop()),{type:"for",blocks:[f,a,c,d],flagDown:t,flagUp:r,loopDirection:s,word:p,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 y.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 y.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 y.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 y.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 y.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 p=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]=p;break}let c=this.yValue();if(!c)throw y.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 y.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();let i=this.yNop(),o=!1;this.funcLevel++,this.saveStack();let u=this.usedAsyncFn;this.usedAsyncFn=!1;let c=this.localvars;this.localvars=new Map([["\u305D\u308C",{type:"var",value:""}]]);for(let a of s){if(!a||!a.value)continue;let f=a.value;this.localvars.set(f,{type:"var",value:""})}try{if(i=this.yBlock(),o=this.usedAsyncFn,!this.check("\u3053\u3053\u307E\u3067"))throw y.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);this.get()}finally{this.loadStack(),this.usedAsyncFn=u,this.localvars=c,this.funcLevel--}return{type:"func_obj",name:"",args:s,blocks:[i],meta:r.meta,josi:"",isExport:!1,asyncFn:o,...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 y.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 y.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 y.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 y.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(["\u3092"]);if(!r||r.type!=="word"&&r.type!=="ref_array"&&r.type!=="ref_prop")throw y.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);let s=this.popStack(["\u3060\u3051",""]);if(s||(s={type:"number",value:1,josi:"\u3060\u3051",...e,end:this.peekSourceMap()}),t.value==="\u6E1B"){let i={type:"number",value:-1,line:t.line};s={type:"op",operator:"*",blocks:[s,i],josi:"",...e}}return{type:"inc",name:r,blocks:[s],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===""||U.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(ae))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 _.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 _.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 _.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 _.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 _.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 _.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 _.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()}}if(this.accept(["word","[",this.yCalc,"]","$","word","eq",this.yCalc])){let t=this.y[7],r=[this.checkArrayIndex(this.y[2])],s=this.y[5];return s.type="string",{type:"let_prop",name:this.getVarName(this.y[0]).value,blocks:[t,...r],index:[s],...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"]","$","word","$","word","eq",this.yCalc])){let t=this.y[0],r=this.y[2],s=this.y[5],i=this.y[7],o=this.y[9];return s.type="string",i.type="string",{type:"let_prop",name:this.getVarName(t).value,blocks:[o,r],index:[s,i],...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","$","word","eq",this.yCalc])){let t=this.y[10],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5])]),s=this.y[8];return s.type="string",{type:"let_prop",name:this.getVarName(this.y[0]).value,blocks:[t,...r],index:[s],...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,",",this.yCalc,"]","$","word","eq",this.yCalc])){let t=this.y[9],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),s=this.y[7];return s.type="string",{type:"let_prop",name:this.getVarName(this.y[0]).value,blocks:[t,...r],index:[s],...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","$","word","$","word","eq",this.yCalc])){let t=this.y[0],r=this.y[2],s=this.y[5],i=this.y[8],o=this.y[10],u=this.y[12];return i.type="string",o.type="string",{type:"let_prop",name:this.getVarName(t).value,blocks:[u,r,s],index:[i,o],...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===""&&!this.canNextFuncTakeNoJosiArg())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(W.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&&I[o.type]?this.yGetArgOperator(i):i}canNextFuncTakeNoJosiArg(){if(!this.check("func"))return!1;let t=this.peek()?.meta?.josi;return t?t.some(r=>r.indexOf("")>=0):!1}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),_.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),_.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),this.yRefArrayValue(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 o=this.get(),u=this.yValue(),c=u&&u.josi?u.josi:"",f={type:"number",value:-1,line:o&&o.line?o.line:0},l=u||this.yNop();return{type:"op",operator:"*",blocks:[f,l],josi:c,...e,end:this.peekSourceMap()}}if(this.check("not")){this.get();let o=this.yValue(),u=o&&o.josi?o.josi:"";return{type:"not",operator:"not",blocks:[o],josi:u,...e,end:this.peekSourceMap()}}let t=this.yJSONArray();if(t)return t;let r=this.yJSONObject();if(r)return r;if(this.check("func")){let o=this.peek();if(!o)throw new Error("[System Error] \u6B63\u3057\u304F\u5024\u304C\u53D6\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002");let u=ie.concat(["eol",")","]","\u306A\u3089\u3070","\u56DE","\u9593","\u53CD\u5FA9","\u6761\u4EF6\u5206\u5C90"]);if(this.check2(["func",u])||o?.josi&&o.josi!==""){this.get();let c=o,a=this.getVarNameRef(c);this.usedFuncs.add(a.value);let f=c.meta,l=[];if(!f)throw _.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 _.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 o=this.peek();if(this.accept([["func","word"],"(",this.yGetArgParen,")"])){let u=this.getVarNameRef(this.y[0]),c=u.meta,a=this.y[2],f=u.value,l=!1;if(this.usedFuncs.add(f),c&&c.josi){if(c.josi.length!==a.length){if(!c.isVariableJosi)throw _.fromNode(`\u95A2\u6570\u300E${u.value}\u300F\u3067\u5F15\u6570${a.length}\u500B\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c.josi.length}\u500B\u306E\u5F15\u6570\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,u)}l=!!c.asyncFn}let p={type:"func",name:f,blocks:a,josi:this.y[3].josi,meta:c,asyncFn:l,...e,end:this.peekSourceMap()};return this.yApplyCallValue(p)}throw _.fromNode("C\u98A8\u95A2\u6570\u547C\u3073\u51FA\u3057\u306E\u30A8\u30E9\u30FC",o||$())}if(this.check("def_func"))return this.yMumeiFunc();let s=this.yValueWord();if(s)return s;let i=this.yValueFuncPointer();return i||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 _.fromNode("\u5909\u6570\u306E\u5F8C\u308D\u306E\u300E@\u8981\u7D20\u300F\u306E\u6307\u5B9A\u304C\u4E0D\u6B63\u3067\u3059\u3002",e)}if(this.check("[")){if(this.accept(["[",this.yCalc,"]","$","word","$","word","$","word"])){e.index.push(this.checkArrayIndex(this.y[1]));let t=this.y[4],r=this.y[6],s=this.y[8];return t.type="string",r.type="string",s.type="string",e.index.push(t),e.index.push(r),e.index.push(s),e.josi=s.josi,e.josi===""}if(this.accept(["[",this.yCalc,"]","$","word","$","word"])){e.index.push(this.checkArrayIndex(this.y[1]));let t=this.y[4],r=this.y[6];return t.type="string",r.type="string",e.index.push(t),e.index.push(r),e.josi=r.josi,e.josi===""}if(this.accept(["[",this.yCalc,"]","$","word"])){e.index.push(this.checkArrayIndex(this.y[1]));let t=this.y[4];return t.type="string",e.index.push(t),e.josi=this.y[4].josi,this.y[4].josi===""}if(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.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}yValueWordGetProp(e){if(e.index||(e.index=[]),this.accept(["$","word","$","word"])){let t=this.y[1],r=this.y[3];return t.type="string",r.type="string",e.index.push(t),e.index.push(r),e.josi=this.y[3].josi,e.josi===""}return this.check("$")&&this.accept(["$","word"])?(this.y[1].type="string",e.index.push(this.y[1]),e.josi=this.y[1].josi,this.y[1].josi===""):this.accept(["$",this.yValue])?(e.index.push(this.y[1]),e.josi=this.y[1].josi,this.y[1].josi===""):!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(["[","@"])||r.josi!==""&&this.check("@")){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 _.fromNode(`\u914D\u5217\u300E${r.value}\u300F\u30A2\u30AF\u30BB\u30B9\u3067\u6307\u5B9A\u30DF\u30B9`,r);return s}if(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 _.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();return e?this.yRefArrayValue(e):null}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 _.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}yRefArrayValue(e){let t=e;for(;;){if(t.josi===""&&this.checkTypes(["@","["])){let r={type:"ref_array_value",name:"@",index:[t],josi:"",line:t.line,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetIndex(r););t=r;continue}if(this.check("$")){let r={type:"ref_array_value",name:"$",index:[t],josi:"",line:t.line,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetProp(r););t=r;continue}break}return t}yJSONArray(){let e=this.yJSONArrayRaw();return e?this.yRefArrayValue(e):null}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 _.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 _.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 _.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 xe=class{constructor(e,t,r){this.from=e,this.to=t,this.index=r}},N=class{constructor(e,t){this.text=e,this.sourcePosition=t}},$e=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 xe(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}},le=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," "],[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 $e(e);t.replaceAll(`\r
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
`,Q=class{constructor(e=!1,t=[],r="",s=""){this.isTest=e,this.codeStandalone=r,this.codeEnv=s,this.importFiles=["plugin_system.mjs","plugin_math.mjs","plugin_csv.mjs","plugin_promise.mjs","plugin_test.mjs"];for(let i of t)this.importFiles.push(i)}},Ae=class n{constructor(e){this.nakoFuncList=new Map(e.getNakoFuncList()),this.nakoTestFuncs=new Map,this.usedFuncSet=new Set,this.loopId=1,this.numAsyncFn=0,this.usedAsyncFn=!1,this.flagLoop=!1,this.__self=e,this.genMode="sync",this.lastLineNo=null,this.varslistSet=this.setVarslistSet(e.__varslist),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.functionContextStack=[],this.defFuncName="",this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0,mumeiId:0},this.constPools=[],this.constPoolsTemplate=[],this.warnUndefinedVar=!1,this.warnUndefinedReturnUserFunc=!1,this.warnUndefinedCallingUserFunc=!1,this.warnUndefinedCallingSystemFunc=!1,this.warnUndefinedCalledUserFuncArgs=!1,this.debugOption=e.debugOption}static isValidIdentifier(e){return/^(?!(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$)[$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(e)}setVarslistSet(e){let t=[];for(let r=0;r<=1;r++){let s=e[r],i=new Set(s.keys());i.delete("meta"),t[r]={isFunction:!1,names:i,readonly:new Set}}return t}convLineno(e,t=!1,r=0){if(this.speedMode.lineNumbers>0)return"";let s=e.line+r,i;if(typeof e.line!="number"?i="unknown":typeof e.file!="string"?i=`l${s}`:i=`l${s}:${e.file}`,!t){if(i===this.lastLineNo)return"";this.lastLineNo=i}let o=JSON.stringify(i),u="";return this.debugOption.useDebug&&(this.debugOption.messageAction&&(u+=`window.postMessage({action:'${this.debugOption.messageAction}',line: ${o}});`),s>=1&&(this.debugOption.waitTime>0&&(u+=`await __v0.get('\u79D2\u5F85')(${this.debugOption.waitTime},__self);`),this.numAsyncFn+=1,this.usedAsyncFn=!0,u+=`await __v0.get('__DEBUG_BP_WAIT')(${s}, __self);`),u+="if (__v0.get('__forceClose')) { return -1 };"),`__line(${o});`+u}varname_get(e){return this.varslistSet.length===3?`__self.__varslist[2].get(${JSON.stringify(e)})`:`__self.__vars.get(${JSON.stringify(e)})`}varname_set(e,t){return this.varslistSet.length===3?`__self.__varslist[2].set(${JSON.stringify(e)}, (${t}))`:`__self.__vars.set(${JSON.stringify(e)}, (${t}))`}varname_set_sys(e,t){return`__self.__setSysVar(${JSON.stringify(e)}, (${t}))`}static getFuncName(e){if(e.indexOf("__")>=0){let r=e.split("__"),s=r[0],i=n.getFuncName(r[1]);return`${s}__${i}`}let t=e.replace(/[ぁ-ん]+$/,"");return t===""&&(t=e),t}static convPrint(e){return`__print(${e});`}convRequire(e){let t=e.value;return this.convLineno(e,!1)+`__module['${t}'] = require('${t}');
|
|
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),y.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 y.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 y.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 y.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 p=this.popStack(s.josi[l]);if(p!==null)a++;else if(l<s.josi.length-1||!s.isVariableJosi)c++,p=o;else break;if(p!==null&&s.funcPointers!==void 0&&s.funcPointers[l]!==null)if(p.type==="func")p.type="func_pointer";else{let h=s.varnames?s.varnames[l]:`${l+1}\u756A\u76EE\u306E\u5F15\u6570`;throw y.fromNode(`\u95A2\u6570\u300E${r.value}\u300F\u306E\u5F15\u6570\u300E${h}\u300F\u306B\u306F\u95A2\u6570\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u5FC5\u8981\u3067\u3059\u3002`,r)}if(p===null&&(p={type:"word",value:"\u305D\u308C",josi:"",...e,end:e}),u.unshift(p),l<s.josi.length-1||!s.isVariableJosi)break}if(c>=2&&(a>0||r.josi===""||U.indexOf(r.josi)>=0))throw y.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 p=this.isExportStack.pop();p!=null&&(this.isExportDefault=p)}return r.josi===""?f:U.indexOf(r.josi)>=0?(f.josi=this.isReadingCalc&&r.josi==="\u306B\u306F"?"":"\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),y.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),y.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 y.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 y.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 y.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 y.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 y.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 y.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 y.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()}}if(this.accept(["word","[",this.yCalc,"]","$","word","eq",this.yCalc])){let t=this.y[7],r=[this.checkArrayIndex(this.y[2])],s=this.y[5];return s.type="string",{type:"let_prop",name:this.getVarName(this.y[0]).value,blocks:[t,...r],index:[s],...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"]","$","word","$","word","eq",this.yCalc])){let t=this.y[0],r=this.y[2],s=this.y[5],i=this.y[7],o=this.y[9];return s.type="string",i.type="string",{type:"let_prop",name:this.getVarName(t).value,blocks:[o,r],index:[s,i],...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","$","word","eq",this.yCalc])){let t=this.y[10],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5])]),s=this.y[8];return s.type="string",{type:"let_prop",name:this.getVarName(this.y[0]).value,blocks:[t,...r],index:[s],...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,",",this.yCalc,"]","$","word","eq",this.yCalc])){let t=this.y[9],r=this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),s=this.y[7];return s.type="string",{type:"let_prop",name:this.getVarName(this.y[0]).value,blocks:[t,...r],index:[s],...e,end:this.peekSourceMap()}}if(this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","$","word","$","word","eq",this.yCalc])){let t=this.y[0],r=this.y[2],s=this.y[5],i=this.y[8],o=this.y[10],u=this.y[12];return i.type="string",o.type="string",{type:"let_prop",name:this.getVarName(t).value,blocks:[u,r,s],index:[i,o],...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===""&&!this.canNextFuncTakeNoJosiArg())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(U.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&&V[o.type]?this.yGetArgOperator(i):i}canNextFuncTakeNoJosiArg(){if(!this.check("func"))return!1;let t=this.peek()?.meta?.josi;return t?t.some(r=>r.indexOf("")>=0):!1}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),y.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),y.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),this.yRefArrayValue(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 o=this.get(),u=this.yValue(),c=u&&u.josi?u.josi:"",f={type:"number",value:-1,line:o&&o.line?o.line:0},l=u||this.yNop();return{type:"op",operator:"*",blocks:[f,l],josi:c,...e,end:this.peekSourceMap()}}if(this.check("not")){this.get();let o=this.yValue(),u=o&&o.josi?o.josi:"";return{type:"not",operator:"not",blocks:[o],josi:u,...e,end:this.peekSourceMap()}}let t=this.yJSONArray();if(t)return t;let r=this.yJSONObject();if(r)return r;if(this.check("func")){let o=this.peek();if(!o)throw new Error("[System Error] \u6B63\u3057\u304F\u5024\u304C\u53D6\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002");let u=ae.concat(["eol",")","]","\u306A\u3089\u3070","\u56DE","\u9593","\u53CD\u5FA9","\u6761\u4EF6\u5206\u5C90"]);if(this.check2(["func",u])||o?.josi&&o.josi!==""){this.get();let c=o,a=this.getVarNameRef(c);this.usedFuncs.add(a.value);let f=c.meta,l=[];if(!f)throw y.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 y.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 o=this.peek();if(this.accept([["func","word"],"(",this.yGetArgParen,")"])){let u=this.getVarNameRef(this.y[0]),c=u.meta,a=this.y[2],f=u.value,l=!1;if(this.usedFuncs.add(f),c&&c.josi){if(c.josi.length!==a.length){if(!c.isVariableJosi)throw y.fromNode(`\u95A2\u6570\u300E${u.value}\u300F\u3067\u5F15\u6570${a.length}\u500B\u304C\u6307\u5B9A\u3055\u308C\u307E\u3057\u305F\u304C\u3001${c.josi.length}\u500B\u306E\u5F15\u6570\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`,u)}l=!!c.asyncFn}let p={type:"func",name:f,blocks:a,josi:this.y[3].josi,meta:c,asyncFn:l,...e,end:this.peekSourceMap()};return this.yApplyCallValue(p)}throw y.fromNode("C\u98A8\u95A2\u6570\u547C\u3073\u51FA\u3057\u306E\u30A8\u30E9\u30FC",o||x())}if(this.check("def_func"))return this.yMumeiFunc();let s=this.yValueWord();if(s)return s;let i=this.yValueFuncPointer();return i||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 y.fromNode("\u5909\u6570\u306E\u5F8C\u308D\u306E\u300E@\u8981\u7D20\u300F\u306E\u6307\u5B9A\u304C\u4E0D\u6B63\u3067\u3059\u3002",e)}if(this.check("[")){if(this.accept(["[",this.yCalc,"]","$","word","$","word","$","word"])){e.index.push(this.checkArrayIndex(this.y[1]));let t=this.y[4],r=this.y[6],s=this.y[8];return t.type="string",r.type="string",s.type="string",e.index.push(t),e.index.push(r),e.index.push(s),e.josi=s.josi,e.josi===""}if(this.accept(["[",this.yCalc,"]","$","word","$","word"])){e.index.push(this.checkArrayIndex(this.y[1]));let t=this.y[4],r=this.y[6];return t.type="string",r.type="string",e.index.push(t),e.index.push(r),e.josi=r.josi,e.josi===""}if(this.accept(["[",this.yCalc,"]","$","word"])){e.index.push(this.checkArrayIndex(this.y[1]));let t=this.y[4];return t.type="string",e.index.push(t),e.josi=this.y[4].josi,this.y[4].josi===""}if(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.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}yValueWordGetProp(e){if(e.index||(e.index=[]),this.accept(["$","word","$","word"])){let t=this.y[1],r=this.y[3];return t.type="string",r.type="string",e.index.push(t),e.index.push(r),e.josi=this.y[3].josi,e.josi===""}return this.check("$")&&this.accept(["$","word"])?(this.y[1].type="string",e.index.push(this.y[1]),e.josi=this.y[1].josi,this.y[1].josi===""):this.accept(["$",this.yValue])?(e.index.push(this.y[1]),e.josi=this.y[1].josi,this.y[1].josi===""):!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(["[","@"])||r.josi!==""&&this.check("@")){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 y.fromNode(`\u914D\u5217\u300E${r.value}\u300F\u30A2\u30AF\u30BB\u30B9\u3067\u6307\u5B9A\u30DF\u30B9`,r);return s}if(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 y.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();return e?this.yRefArrayValue(e):null}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 y.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}yRefArrayValue(e){let t=e;for(;;){if(t.josi===""&&this.checkTypes(["@","["])){let r={type:"ref_array_value",name:"@",index:[t],josi:"",line:t.line,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetIndex(r););t=r;continue}if(this.check("$")){let r={type:"ref_array_value",name:"$",index:[t],josi:"",line:t.line,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetProp(r););t=r;continue}break}return t}yJSONArray(){let e=this.yJSONArrayRaw();return e?this.yRefArrayValue(e):null}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 y.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 y.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 y.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()}}_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 hn=`(function(){
|
|
18
|
+
`,pn="})",dn=`(async function(){
|
|
19
|
+
`;function J(n,e){let t="";for(let r of n.split(`
|
|
20
|
+
`))r!==""&&(t+=" ".repeat(e)+r+`
|
|
21
|
+
`);return t}function it(n){let e=`{ called:1, totel_usec: ${n}, min_usec: ${n}, max_usec: ${n}, type: type }`;return`if (!__self.__performance_monitor) {
|
|
22
|
+
__self.__performance_monitor={};
|
|
23
|
+
__self.__performance_monitor[key] = ${e};
|
|
24
|
+
} else if (!__self.__performance_monitor[key]) {
|
|
25
|
+
__self.__performance_monitor[key] = ${e};
|
|
26
|
+
} else {
|
|
27
|
+
__self.__performance_monitor[key].called++;
|
|
28
|
+
__self.__performance_monitor[key].totel_usec+=${n};
|
|
29
|
+
if(__self.__performance_monitor[key].min_usec>${n}){__self.__performance_monitor[key].min_usec=${n};}
|
|
30
|
+
if(__self.__performance_monitor[key].max_usec<${n}){__self.__performance_monitor[key].max_usec=${n};}
|
|
31
|
+
}`}var ne=class{constructor(e=!1,t=[],r="",s=""){this.isTest=e,this.codeStandalone=r,this.codeEnv=s,this.importFiles=["plugin_system.mjs","plugin_math.mjs","plugin_csv.mjs","plugin_promise.mjs","plugin_test.mjs"];for(let i of t)this.importFiles.push(i)}},Me=class n{constructor(e){this.nakoFuncList=new Map(e.getNakoFuncList()),this.nakoTestFuncs=new Map,this.usedFuncSet=new Set,this.loopId=1,this.numAsyncFn=0,this.usedAsyncFn=!1,this.flagLoop=!1,this.__self=e,this.genMode="sync",this.lastLineNo=null,this.varslistSet=this.setVarslistSet(e.__varslist),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.functionContextStack=[],this.defFuncName="",this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0,mumeiId:0},this.constPools=[],this.constPoolsTemplate=[],this.warnUndefinedVar=!1,this.warnUndefinedReturnUserFunc=!1,this.warnUndefinedCallingUserFunc=!1,this.warnUndefinedCallingSystemFunc=!1,this.warnUndefinedCalledUserFuncArgs=!1,this.debugOption=e.debugOption}static isValidIdentifier(e){return/^(?!(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$)[$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(e)}setVarslistSet(e){let t=[];for(let r=0;r<=1;r++){let s=e[r],i=new Set(s.keys());i.delete("meta"),t[r]={isFunction:!1,names:i,readonly:new Set}}return t}convLineno(e,t=!1,r=0){if(this.speedMode.lineNumbers>0)return"";let s=e.line+r,i;if(typeof e.line!="number"?i="unknown":typeof e.file!="string"?i=`l${s}`:i=`l${s}:${e.file}`,!t){if(i===this.lastLineNo)return"";this.lastLineNo=i}let o=JSON.stringify(i),u="";return this.debugOption.useDebug&&(this.debugOption.messageAction&&(u+=`window.postMessage({action:'${this.debugOption.messageAction}',line: ${o}});`),s>=1&&(this.debugOption.waitTime>0&&(u+=`await __v0.get('\u79D2\u5F85')(${this.debugOption.waitTime},__self);`),this.numAsyncFn+=1,this.usedAsyncFn=!0,u+=`await __v0.get('__DEBUG_BP_WAIT')(${s}, __self);`),u+="if (__v0.get('__forceClose')) { return -1 };"),`__line(${o});`+u}varname_get(e){return this.varslistSet.length===3?`__self.__varslist[2].get(${JSON.stringify(e)})`:`__self.__vars.get(${JSON.stringify(e)})`}varname_set(e,t){return this.varslistSet.length===3?`__self.__varslist[2].set(${JSON.stringify(e)}, (${t}))`:`__self.__vars.set(${JSON.stringify(e)}, (${t}))`}varname_set_sys(e,t){return`__self.__setSysVar(${JSON.stringify(e)}, (${t}))`}static getFuncName(e){if(e.indexOf("__")>=0){let r=e.split("__"),s=r[0],i=n.getFuncName(r[1]);return`${s}__${i}`}let t=e.replace(/[ぁ-ん]+$/,"");return t===""&&(t=e),t}static convPrint(e){return`__print(${e});`}convRequire(e){let t=e.value;return this.convLineno(e,!1)+`__module['${t}'] = require('${t}');
|
|
25
32
|
`}getDefFuncCode(e,t){let r="";r+=`const nakoVersion = { version: ${JSON.stringify(e.version)} }
|
|
26
33
|
`,r+=`const __self = self;
|
|
27
34
|
`,r+=`__self.__self = __self;
|
|
@@ -43,7 +50,7 @@ ${s.message}`,e))}}if(this.check2(["word","$","*","$","*","$","*","$","*","eq"])
|
|
|
43
50
|
`,r+="__self.constPools = "+JSON.stringify(this.constPools)+`;
|
|
44
51
|
`,r+="__self.constPoolsTemplate = "+JSON.stringify(this.constPoolsTemplate)+`;
|
|
45
52
|
`,r+=`__self.__propAccessor = [];
|
|
46
|
-
`;let s="";if(this.nakoFuncList.forEach((i,o)=>{let u=
|
|
53
|
+
`;let s="";if(this.nakoFuncList.forEach((i,o)=>{let u=R(B(String(i.fn),1)),c=i.asyncFn?"true":"false";s+=`//[DEF_FUNC name='${o}' asyncFn=${c}]
|
|
47
54
|
__self.__varslist[1].set("${o}", ${u});
|
|
48
55
|
//[/DEF_FUNC name='${o}']
|
|
49
56
|
`}),s!==""&&(r+=`__v0.set('__line', '\u95A2\u6570\u306E\u5B9A\u7FA9');
|
|
@@ -51,25 +58,9 @@ __self.__varslist[1].set("${o}", ${u});
|
|
|
51
58
|
`;this.nakoTestFuncs.forEach(o=>{let u=o.fn;i+=`${String(u)};
|
|
52
59
|
`}),i!==""&&(r+=`__v0.set('__line', '\u30C6\u30B9\u30C8\u306E\u5B9A\u7FA9');
|
|
53
60
|
`,r+=i+`
|
|
54
|
-
`)}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
|
|
61
|
+
`)}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 y.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"call_value":r+=this.convCallValue(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"ref_array_value":r+=this.convRefArrayValue(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))};let r=this.functionContextStack[this.functionContextStack.length-1];if(this.varslistSet.length>4&&r?.isAnonymous){let s=this.varslistSet.length-1;for(let i=s-1;i>=3;i--)if(this.varslistSet[i].names.has(e)){for(let u of this.functionContextStack)u.isAnonymous&&u.varsIndex>i&&(u.usesClosure=!0);let o=JSON.stringify(e);return{i,name:e,isTop:!1,js:`__nako_closure.get(${o})`,js_set:`__nako_closure.set(${o}, ${t??"undefined"})`}}}for(let s=2;s>=0;s--)if(this.varslistSet[s].names.has(e))return{i:s,name:e,isTop:!1,js:`__self.__varslist[${s}].get(${JSON.stringify(e)})`,js_set:`__self.__varslist[${s}].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 y.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 y.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"),t=t.replace(/\*\//g,"\uFF0A\uFF0F"),t=t.replace(/(^\s+|\s+$)/g,"");let r=this.convLineno(e,!1);return t===""&&r===""?";":t===""?";"+r+`
|
|
55
62
|
`:";"+r+"//"+t+`
|
|
56
|
-
`}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
|
|
57
|
-
const uf_start = performance.now() * 1000;
|
|
58
|
-
return function () {
|
|
59
|
-
const el_time = performance.now() * 1000 - uf_start;
|
|
60
|
-
if (!__self.__performance_monitor) {
|
|
61
|
-
__self.__performance_monitor={};
|
|
62
|
-
__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };
|
|
63
|
-
} else if (!__self.__performance_monitor[key]) {
|
|
64
|
-
__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };
|
|
65
|
-
} else {
|
|
66
|
-
__self.__performance_monitor[key].called++;
|
|
67
|
-
__self.__performance_monitor[key].totel_usec+=el_time;
|
|
68
|
-
if(__self.__performance_monitor[key].min_usec>el_time){__self.__performance_monitor[key].min_usec=el_time;}
|
|
69
|
-
if(__self.__performance_monitor[key].max_usec<el_time){__self.__performance_monitor[key].max_usec=el_time;}
|
|
70
|
-
}};})('${y}', 'user');try {
|
|
71
|
-
`,i=`} finally { performanceMonitorEnd(); }
|
|
72
|
-
`}let o="",u=" ",c="",a="",f=new Set;this.speedMode.invalidSore===0&&f.add("\u305D\u308C"),this.varsSet={isFunction:!0,names:f,readonly:new Set},this.varslistSet.push(this.varsSet);let l={isAnonymous:t==="",varsIndex:this.varslistSet.length-1,usesClosure:!1};this.functionContextStack.push(l),r?o+=u+`var \u5F15\u6570 = arguments;
|
|
63
|
+
`}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 y.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 y.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=this.genPerfMonitorInject(this.getPerfMonitorKey(t));s=g[0],i=g[1]}let o="",u=" ",c="",a="",f=new Set;this.speedMode.invalidSore===0&&f.add("\u305D\u308C"),this.varsSet={isFunction:!0,names:f,readonly:new Set},this.varslistSet.push(this.varsSet);let l={isAnonymous:t==="",varsIndex:this.varslistSet.length-1,usesClosure:!1};this.functionContextStack.push(l),r?o+=u+`var \u5F15\u6570 = arguments;
|
|
73
64
|
`:o+=u+`__self.__vars.set('\u5F15\u6570', arguments);
|
|
74
65
|
`,c+=`
|
|
75
66
|
// PUSH STACK
|
|
@@ -80,43 +71,43 @@ if(__self.__performance_monitor[key].max_usec<el_time){__self.__performance_moni
|
|
|
80
71
|
`,a+=u+`// POP STACK
|
|
81
72
|
`,a+=u+`self.__vars = __localvars;
|
|
82
73
|
`,a+=`}
|
|
83
|
-
`;let p=Array.from(this.varsSet.names.values()),h="",d=e.meta;if(!d)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");d.varnames||(d.varnames=[]);for(let
|
|
84
|
-
`;else{let
|
|
85
|
-
`}this.varsSet.names.add(
|
|
86
|
-
`).map(
|
|
74
|
+
`;let p=Array.from(this.varsSet.names.values()),h="",d=e.meta;if(!d)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");d.varnames||(d.varnames=[]);for(let g=0;g<d.varnames.length;g++){let b=d.varnames[g];if(b!=="\u5F15\u6570"){if(!this.warnUndefinedCalledUserFuncArgs)h+=u+this.varname_set(b,`arguments[${g}]`)+`;
|
|
75
|
+
`;else{let $=`\u533F\u540D\u95A2\u6570\u306E\u5F15\u6570\u300E${b}\u300F\u306Bundefined\u304C\u6E21\u3055\u308C\u307E\u3057\u305F`;t&&($=`\u30E6\u30FC\u30B6\u95A2\u6570\u300E${t}\u300F\u306E\u5F15\u6570\u300E${b}\u300F\u306Bundefined\u304C\u6E21\u3055\u308C\u307E\u3057\u305F`);let Ht=`${`((a) => { if (a === undefined) { ${`__self.logger.warn('${$}', {line: ${e.line}, file: ${JSON.stringify(e.file)}});`} }; return a; })`}(arguments[${g}])`;h+=u+this.varname_set(b,Ht)+`;
|
|
76
|
+
`}this.varsSet.names.add(b)}}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 v=this._convGen(e.blocks[0],!1);if(h+=v.split(`
|
|
77
|
+
`).map(g=>" "+g).join(`
|
|
87
78
|
`)+`
|
|
88
79
|
`,this.speedMode.invalidSore===0&&(h+=` return (${this.varname_get("\u305D\u308C")});
|
|
89
|
-
`),h+=i,t&&this.usedAsyncFn){let
|
|
80
|
+
`),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()))p.includes(g)||n.isValidIdentifier(g)&&(o+=` var ${g};
|
|
90
81
|
`);this.speedMode.invalidSore===0&&(n.isValidIdentifier("\u305D\u308C")?o+=` var \u305D\u308C = '';
|
|
91
|
-
`:o+=` ${this.varname_get("\u305D\u308C")} = '';`)}let
|
|
92
|
-
`;if(h=
|
|
82
|
+
`:o+=` ${this.varname_get("\u305D\u308C")} = '';`)}let m=this.usedAsyncFn?dn:hn,j=" "+this.convLineno(e,!0,1)+`
|
|
83
|
+
`;if(h=m+c+s+o+j+h+a,h+=pn,l.isAnonymous&&l.usesClosure&&(h=`(function(__nako_closure) {
|
|
93
84
|
return ${h}
|
|
94
|
-
})(__nako_make_closure(__self.__vars, (typeof __nako_closure === 'undefined' ? null : __nako_closure)))`),t){let
|
|
85
|
+
})(__nako_make_closure(__self.__vars, (typeof __nako_closure === 'undefined' ? null : __nako_closure)))`),t){let g=this.nakoFuncList.get(t);g&&(g.fn=h,g.asyncFn=this.usedAsyncFn,d.asyncFn=this.usedAsyncFn)}return this.usedAsyncFn=_,this.varslistSet.pop(),this.functionContextStack.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: () => {
|
|
95
86
|
`,s=this._convGen(e.blocks[0],!1);if(r+=` ${s}
|
|
96
87
|
}});`,!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="";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}convRefArrayValue(e){let t="",r=e.name?String(e.name):"???",s=e.index?e.index.shift():void 0;if(!s)return"/*[WARNING] convRefArrayOperator::InvalidValue */";t=this._convGen(s,!0);let i=e.index;if(!i)return t;if(r==="@"||r==="["){for(let u=0;u<i.length;u++){let c=this._convGen(i[u],!0);t+="["+c+"]"}return t}return r==="$"?this.convRefProp_genCode(t,i):`/* [WARNING] convRefArrayOperator::UnknownOperator [${r.replace("*/","\uFF0A/")}] */`+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 p=e.name,h=`$nako_tmp_a${t}`,d=this.varname_set(p,l);o+=`
|
|
97
88
|
/*\u914D\u5217\u521D\u671F\u5316*/if (!(${i} instanceof Array)) { ${d} };
|
|
98
89
|
`,o+=`${h} = ${i};
|
|
99
|
-
`;for(let
|
|
100
|
-
/*\u914D\u5217\u521D\u671F\u5316${
|
|
101
|
-
`}}for(let l=0;l<s.length;l++){let p=this._convGen(s[l],!0);u+="["+p+"]"}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
|
|
102
|
-
`,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
|
|
90
|
+
`;for(let _=0;_<s.length-1;_++){let v=this._convGen(s[_],!0);c+=`[${v}]`,o+=`
|
|
91
|
+
/*\u914D\u5217\u521D\u671F\u5316${_}*/if (!(${h}${c} instanceof Array)) { ${h}${c} = ${l}; };`}o+=`
|
|
92
|
+
`}}for(let l=0;l<s.length;l++){let p=this._convGen(s[l],!0);u+="["+p+"]"}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 y.fromNode("\u4EE3\u5165\u3059\u308B\u5148\u306E\u5909\u6570\u540D\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);return u+=" = "+a+`;
|
|
93
|
+
`,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}`,p="";this.speedMode.invalidSore===0&&(p=this.varname_set("\u305D\u308C",u));let h="0",d="0",_="0";r&&r.type==="func"&&r.name==="\u7BC4\u56F2"?(_=this._convGen(r,!0),h=`${l}['\u5148\u982D'] || 0`,d=`${l}['\u672B\u5C3E'] || 0`):(h=this._convGen(t,!0),d=this._convGen(r,!0));let v=e.flagDown,m=e.flagUp,j="1";s.type!=="nop"&&(j=this._convGen(s,!0));let g=this.convGenLoop(i);return this.convLineno(e,!1)+`
|
|
103
94
|
/*[convFor id=${o}]*/
|
|
104
|
-
const ${l} = ${
|
|
95
|
+
const ${l} = ${_};
|
|
105
96
|
const ${a} = ${h};
|
|
106
97
|
const ${f} = ${d};
|
|
107
98
|
if (${a} < ${f}) { // up
|
|
108
|
-
if (${String(
|
|
99
|
+
if (${String(m)}) { for (let ${u} = ${a}; ${u} <= ${f}; ${u}+= ${j}) {
|
|
109
100
|
${p};${c}
|
|
110
101
|
// for block begin
|
|
111
|
-
${
|
|
102
|
+
${g}
|
|
112
103
|
// for block end
|
|
113
104
|
};
|
|
114
105
|
};
|
|
115
106
|
} else if (${a} > ${f}) { // down
|
|
116
|
-
if (${String(
|
|
107
|
+
if (${String(v)}) { for (let ${u} = ${a}; ${u} >= ${f}; ${u}-= ${j}) {
|
|
117
108
|
${p};${c}
|
|
118
109
|
// for block begin
|
|
119
|
-
${
|
|
110
|
+
${g}
|
|
120
111
|
// for block end
|
|
121
112
|
}
|
|
122
113
|
};
|
|
@@ -124,15 +115,15 @@ if (${a} < ${f}) { // up
|
|
|
124
115
|
for (let ${u} = ${a}; ${u} <= ${f}; ${u}+= 1) {
|
|
125
116
|
${p};${c}
|
|
126
117
|
// for block begin
|
|
127
|
-
${
|
|
118
|
+
${g}
|
|
128
119
|
// for block end
|
|
129
120
|
};
|
|
130
121
|
};
|
|
131
122
|
//[/convFor id=${o}]
|
|
132
|
-
`}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
|
|
123
|
+
`}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 b=e.word;this.varsSet.names.add(b),l=this.varname_set(b,o)}let h=this.varname_set_sys("\u5BFE\u8C61\u30AD\u30FC",i),d="",_="",v="";this.speedMode.invalidSore===0&&(d=this.varname_set("\u305D\u308C",o),_=this.varname_set("\u305D\u308C",f),v=`let ${f} = `+this.varname_get("\u305D\u308C")+";");let m="";if(t.type==="nop")if(this.speedMode.invalidSore===0)m=this.varname_get("\u305D\u308C");else throw y.fromNode("\u300E\u53CD\u5FA9\u300F\u306E\u5BFE\u8C61\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);else m=this._convGen(t,!0);let j=R(B(this.convGenLoop(r),1));return this.convLineno(e,!1)+`
|
|
133
124
|
// [convForeach id=${s}]
|
|
134
|
-
const ${c} = __self.__getSysVar('\u5BFE\u8C61'); ${
|
|
135
|
-
let ${u} = ${
|
|
125
|
+
const ${c} = __self.__getSysVar('\u5BFE\u8C61'); ${v}; const ${a} = __self.__getSysVar('\u5BFE\u8C61\u30AD\u30FC');
|
|
126
|
+
let ${u} = ${m};
|
|
136
127
|
// foreach Map?
|
|
137
128
|
if (${u} instanceof Map) { // Object\u306B\u5F37\u5236\u5909\u63DB
|
|
138
129
|
let tmp = {}; for (let tmpKey of ${u}.keys()) { tmp[tmpKey] = ${u}.get(tmpKey); };
|
|
@@ -147,11 +138,11 @@ for (let ${i} in ${u}) {
|
|
|
147
138
|
${d};
|
|
148
139
|
${l};
|
|
149
140
|
// [convForeach::block]
|
|
150
|
-
${
|
|
141
|
+
${j}
|
|
151
142
|
// [/convForeach::block]
|
|
152
143
|
}
|
|
153
|
-
__self.__setSysVar('\u5BFE\u8C61', ${c});${
|
|
154
|
-
`}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=
|
|
144
|
+
__self.__setSysVar('\u5BFE\u8C61', ${c});${_};__self.__setSysVar('\u5BFE\u8C61\u30AD\u30FC', ${a});// [/convForeach id=${s}]
|
|
145
|
+
`}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=R(B(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)+`
|
|
155
146
|
// [convRepeatTimes id=${t}] // \u300En\u56DE\u300F\u69CB\u6587
|
|
156
147
|
let ${i} = __self.__getSysVar('\u56DE\u6570')
|
|
157
148
|
let ${s} = ${o};
|
|
@@ -161,7 +152,21 @@ for (let ${r} = 1; ${r} <= ${s}; ${r}++) {
|
|
|
161
152
|
}
|
|
162
153
|
${a}
|
|
163
154
|
// [/convRepeatTimes id=${t}]
|
|
164
|
-
`}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};
|
|
155
|
+
`}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){if(!e.options)return"";let r={...this.performanceMonitor};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}}getPerfMonitorKey(e,t=""){return e?`${e}${t}`:(this.performanceMonitor.mumeiId++,`anous_${this.performanceMonitor.mumeiId}${t}`)}wrapPerfMonitor(e,t,r,s){let i=s.isAsync?"async function":"function",o=s.isExpr?`return ${e};
|
|
156
|
+
`:`${e}
|
|
157
|
+
`,u=`(${i} (key, type) {
|
|
158
|
+
const ${s.startVar} = performance.now() * 1000;
|
|
159
|
+
try {
|
|
160
|
+
`+o+`} finally {
|
|
161
|
+
const ${s.timeVar} = performance.now() * 1000 - ${s.startVar};
|
|
162
|
+
`+it(s.timeVar)+`}})('${t}', '${r}')`;return s.isAsync&&(u=`await ${u}`),s.isExpr?u:u+`;
|
|
163
|
+
`}genPerfMonitorInject(e){return[`const performanceMonitorEnd = (function (key, type) {
|
|
164
|
+
const uf_start = performance.now() * 1000;
|
|
165
|
+
return function () {
|
|
166
|
+
const el_time = performance.now() * 1000 - uf_start;
|
|
167
|
+
`+it("el_time")+`};})('${e}', 'user');try {
|
|
168
|
+
`,`} finally { performanceMonitorEnd(); }
|
|
169
|
+
`]}convWhile(e){let t=e.blocks[0],r=e.blocks[1],s=this._convGen(t,!0),i=R(B(this.convGenLoop(r),1));return`// [convWhile]
|
|
165
170
|
`+this.convLineno(e,!1)+`
|
|
166
171
|
while (${s}){
|
|
167
172
|
${i}
|
|
@@ -183,81 +188,45 @@ ${s}
|
|
|
183
188
|
${r}
|
|
184
189
|
}
|
|
185
190
|
// [/switch]
|
|
186
|
-
`;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=
|
|
191
|
+
`;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=R(B(this._convGen(r,!1),1)),u=R(B(this._convGen(s,!1),1)),c=`// [convIf]
|
|
187
192
|
`+this.convLineno(e,!1)+`
|
|
188
193
|
if (${i}) {
|
|
189
194
|
${o}
|
|
190
|
-
}`;return
|
|
195
|
+
}`;return R(u)!==""&&(c+=` else {
|
|
191
196
|
${u}
|
|
192
197
|
}
|
|
193
198
|
`),c+=`
|
|
194
199
|
// [/convIf]
|
|
195
|
-
`,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}
|
|
200
|
+
`,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}resolveCallTarget(e,t){let r=this.findVar(e);if(r===null)throw y.fromNode(`\u95A2\u6570\u300E${e}\u300F\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002\u6709\u52B9\u30D7\u30E9\u30B0\u30A4\u30F3=[`+this.getPluginList().join(", ")+"]",t);let s;if(r.i===0){if(s=this.__self.getFunc(e),!s)throw new Error(`[System Error] \u95A2\u6570\u300C${e}\u300DNakoCompiler.nakoFuncList \u306E\u4E0D\u6574\u5408\u304C\u3042\u308A\u307E\u3059\u3002`);if(s.type!=="func")throw y.fromNode(`\u300E${e}\u300F\u306F\u95A2\u6570\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002`,t)}else s=this.nakoFuncList.get(e),s===void 0&&(s={return_none:!1,asyncFn:!!t.asyncFn});return{res:r,func:s}}genLocalVarsSyncCode(){let e="",t="",r=[];for(let s of Array.from(this.varsSet.names.values()))n.isValidIdentifier(s)&&r.push({str:JSON.stringify(s),js:this.varname_get(s)});if(e+=`__self.__locals = __vars;
|
|
201
|
+
`,r.length>0){e+=`/* \u5168\u3066\u306E\u5C55\u958B\u3055\u308C\u305F\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u3092 __self.__locals \u306B\u4FDD\u5B58 */
|
|
202
|
+
`;for(let s of r)e+=`__self.__locals.set(${s.str}, ${s.js});
|
|
203
|
+
`}if(r.length>0){t+=`/* \u5168\u3066\u306E\u5C55\u958B\u3055\u308C\u305F\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u3092 __self.__locals \u304B\u3089\u53D7\u3051\u53D6\u308B */
|
|
204
|
+
`;for(let s of r)s.js!=="\u305D\u308C"&&(t+=`__self.__varslist[2].set(${s.str}, __self.__locals.get(${s.str}));
|
|
205
|
+
`)}return{begin:e,end:t}}genCallArgsCode(e,t,r,s){if(!this.warnUndefinedCallingUserFunc&&t.i!==0||!this.warnUndefinedCallingSystemFunc&&t.i===0)return r.join(",");let i={TYPEOF:!0,\u5909\u6570\u578B\u78BA\u8A8D:!0},o=[];return r.forEach(u=>{if(u==="__self"||i[e]===!0)o.push(`${u}`);else{let c=t.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",a=this.addConstPool(c,[e],s.file,s.line),f=u===""?'""':u;o.push(`(__self.chk(${f}, ${a}))`)}}),o.join(", ")}getSoreWrap(){return this.speedMode.invalidSore!==0?["",""]:["__self.__setSore(",")"]}genVoidCallCode(e,t){let{funcCall:r,funcBegin:s,funcEnd:i}=t,o;return i===""?o=`/*VOID\u95A2\u6570\u547C\u51FA*/${s}${r}
|
|
206
|
+
`:o=`/*VOID\u95A2\u6570\u547C\u51FA(\u524D\u5F8C\u51E6\u7406\u4ED8)*/${s}try {
|
|
207
|
+
${J(r,1)};
|
|
208
|
+
} finally {
|
|
209
|
+
${J(i,1)}}
|
|
210
|
+
`,t.sysPerfKey&&(o=this.wrapPerfMonitor(o,t.sysPerfKey,"system",{isExpr:!1,isAsync:t.isAsync,startVar:"sf_start",timeVar:"sl_time"})),this.convLineno(e,!1)+o}genValueCallCode(e,t,r){let{funcDef:s,funcCall:i,funcBegin:o,funcEnd:u,isAsync:c}=r,[a,f]=this.getSoreWrap(),l;if(o===""&&u==="")l=`${a}${i}${f}`;else if(u===""){let p=`${a}${i}${f}`;l=`/* funcCallThis1 */${`(${`${s}(){ return ${p} }`}).call(this)`}`}else{let p=`$nako_i${this.loopId}`;this.loopId++,l=`/* funcCallThis2 */(${s}(){
|
|
211
|
+
`+J(o,1)+`
|
|
212
|
+
`+J("try {",1)+`
|
|
213
|
+
`+J(`let ${p} = ${i};`,2)+`
|
|
214
|
+
`+J(`return ${p};`,2)+`
|
|
215
|
+
`+J("} finally {",2)+`
|
|
216
|
+
`+J(u,1)+`
|
|
217
|
+
`+J("}",1)+`
|
|
218
|
+
}).call(this)`,c&&(l=`await (${l})`),l=`${a}${l}${f}`}return r.sysPerfKey&&(l=this.wrapPerfMonitor(l,r.sysPerfKey,"system",{isExpr:!0,isAsync:c,startVar:"sf_start",timeVar:"sl_time"})),(e.josi==="\u3057\u3066"||e.josi===""&&!t)&&(l=this.convLineno(e,!1)+l,l+=`;
|
|
219
|
+
`),l}convCallFunc(e,t){let r=n.getFuncName(e.name),{res:s,func:i}=this.resolveCallTarget(r,e);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`
|
|
196
220
|
// --- \u540D\u524D\u7A7A\u9593(${u[0]}) ---
|
|
197
221
|
__self.__varslist[0].get('\u540D\u524D\u7A7A\u9593\u8A2D\u5B9A')(${u[0]}, __self);__self.__modName=${u[0]};
|
|
198
222
|
`;if(r==="\u30D7\u30E9\u30B0\u30A4\u30F3\u540D\u8A2D\u5B9A")return`
|
|
199
223
|
__self.__varslist[0].get('\u30D7\u30E9\u30B0\u30A4\u30F3\u540D\u8A2D\u5B9A')(${u[0]}, __self);
|
|
200
224
|
`;u.push("__self");let a="function",f="",l="";if(e.setter&&(f+=`;__self.isSetter = true;
|
|
201
225
|
`,l+=`;__self.isSetter = false;
|
|
202
|
-
`),s.i===0&&this.varslistSet.length>3&&i.pure!==!0&&this.speedMode.forcePure===0){let
|
|
203
|
-
`,
|
|
204
|
-
|
|
205
|
-
`}if(b.length
|
|
206
|
-
`;for(let v of b)v.js!=="\u305D\u308C"&&(l+=`__self.__varslist[2].set(${v.str}, __self.__locals[${v.str}]);
|
|
207
|
-
`)}}c.sore&&(f+="/*[sore]*/");let p=(b,v)=>{let y="";for(let k of b.split(`
|
|
208
|
-
`))k!==""&&(y+=" ".repeat(v)+k+`
|
|
209
|
-
`);return y},h={TYPEOF:!0,\u5909\u6570\u578B\u78BA\u8A8D:!0},d;if(!this.warnUndefinedCallingUserFunc&&s.i!==0||!this.warnUndefinedCallingSystemFunc&&s.i===0)d=u.join(",");else{let b=[];u.forEach(v=>{if(v==="__self"||h[r]===!0)b.push(`${v}`);else{let y=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",k=this.addConstPool(y,[r],e.file,e.line),x=v===""?'""':v;b.push(`(__self.chk(${x}, ${k}))`)}}),d=b.join(", ")}let m=`${s.js}(${d})`;if(i.asyncFn){a=`async ${a}`,m=`await ${m}`,this.numAsyncFn++,this.usedAsyncFn=!0;let b=`$nako_i${this.loopId}`;this.loopId++,f+=`const __local_async${b} = __self.__vars;
|
|
210
|
-
`,l+=`__self.__vars = __local_async${b};
|
|
211
|
-
`}if(s.i===0&&this.performanceMonitor.systemFunctionBody!==0){let b=r;b||(typeof this.performanceMonitor.mumeiId>"u"&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,b=`anous_${this.performanceMonitor.mumeiId}`),m=`(${a} (key, type) {
|
|
212
|
-
const sbf_start = performance.now() * 1000;
|
|
213
|
-
try {
|
|
214
|
-
return `+m+`;
|
|
215
|
-
} finally {
|
|
216
|
-
const sbl_time = performance.now() * 1000 - sbf_start;
|
|
217
|
-
if (!__self.__performance_monitor) {
|
|
218
|
-
__self.__performance_monitor={};
|
|
219
|
-
__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };
|
|
220
|
-
} else if (!__self.__performance_monitor[key]) {
|
|
221
|
-
__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };
|
|
222
|
-
} else {
|
|
223
|
-
__self.__performance_monitor[key].called++;
|
|
224
|
-
__self.__performance_monitor[key].totel_usec+=sbl_time;
|
|
225
|
-
if(__self.__performance_monitor[key].min_usec>sbl_time){__self.__performance_monitor[key].min_usec=sbl_time;}
|
|
226
|
-
if(__self.__performance_monitor[key].max_usec<sbl_time){__self.__performance_monitor[key].max_usec=sbl_time;}
|
|
227
|
-
}}})('${r}_body', 'sysbody')
|
|
228
|
-
`}let g="";if(i.return_none)l===""?g=`/*VOID\u95A2\u6570\u547C\u51FA*/${f}${m}
|
|
229
|
-
`:g=`/*VOID\u95A2\u6570\u547C\u51FA(\u524D\u5F8C\u51E6\u7406\u4ED8)*/${f}try {
|
|
230
|
-
${p(m,1)};
|
|
231
|
-
} finally {
|
|
232
|
-
${p(l,1)}}
|
|
233
|
-
`,g=this.convLineno(e,!1)+g;else{let b="",v="";if(this.speedMode.invalidSore===0&&(b="__self.__setSore(",v=")"),f===""&&l==="")g=`${b}${m}${v}`;else if(l===""){let y=`${b}${m}${v}`;g=`/* funcCallThis1 */${`(${`${a}(){ return ${y} }`}).call(this)`}`}else{let y=`$nako_i${this.loopId}`;this.loopId++,g=`/* funcCallThis2 */(${a}(){
|
|
234
|
-
`+p(f,1)+`
|
|
235
|
-
`+p("try {",1)+`
|
|
236
|
-
`+p(`let ${y} = ${m};`,2)+`
|
|
237
|
-
`+p(`return ${y};`,2)+`
|
|
238
|
-
`+p("} finally {",2)+`
|
|
239
|
-
`+p(l,1)+`
|
|
240
|
-
`+p("}",1)+`
|
|
241
|
-
}).call(this)`,i.asyncFn&&(g=`await (${g})`),g=`${b}${g}${v}`}(e.josi==="\u3057\u3066"||e.josi===""&&!t)&&(g=this.convLineno(e,!1)+g,g+=`;
|
|
242
|
-
`)}return s.i===0&&this.performanceMonitor.systemFunction!==0&&(g=`(function (key, type) {
|
|
243
|
-
const sf_start = performance.now() * 1000;
|
|
244
|
-
try {
|
|
245
|
-
return `+g+`;
|
|
246
|
-
} finally {
|
|
247
|
-
const sl_time = performance.now() * 1000 - sf_start;
|
|
248
|
-
if (!__self.__performance_monitor) {
|
|
249
|
-
__self.__performance_monitor={};
|
|
250
|
-
__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };
|
|
251
|
-
} else if (!__self.__performance_monitor[key]) {
|
|
252
|
-
__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };
|
|
253
|
-
} else {
|
|
254
|
-
__self.__performance_monitor[key].called++;
|
|
255
|
-
__self.__performance_monitor[key].totel_usec+=sl_time;
|
|
256
|
-
if(__self.__performance_monitor[key].min_usec>sl_time){__self.__performance_monitor[key].min_usec=sl_time;}
|
|
257
|
-
if(__self.__performance_monitor[key].max_usec<sl_time){__self.__performance_monitor[key].max_usec=sl_time;}
|
|
258
|
-
}}})('${r}_sys', 'system')
|
|
259
|
-
`),g}convCallValue(e,t){let r=this._convGen(e.blocks[0],!0),s=e.blocks.slice(1).map(c=>this._convGen(c,!0));s.push("__self");let i=`${r}(${s.join(",")})`;if(t)return i;let o=this.speedMode.invalidSore===0?"__self.__setSore(":"",u=this.speedMode.invalidSore===0?")":"";return this.convLineno(e,!1)+`${o}${i}${u};
|
|
260
|
-
`}convRenbun(e){let t=this._convGen(e.blocks[1],!0),r=this._convGen(e.blocks[0],!1);return this.numAsyncFn++,this.usedAsyncFn=!0,`/*[\u9023\u6587]*/await (async function(){ ${r}; return ${t} }).call(this)/*[/\u9023\u6587]*/`}convOp(e){let t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","\xF7":"/"},r=e.operator||"",s=this._convGen(e.blocks[1],!0),i=this._convGen(e.blocks[0],!0);return r==="+"&&this.speedMode.implicitTypeCasting===0&&(e.blocks[0]&&e.blocks[0].type!=="number"&&e.blocks[0].type!=="bigint"&&(i=`self.__parseFloatOrBigint(${i})`),e.blocks[1]&&e.blocks[1].type!=="number"&&e.blocks[1].type!=="bigint"&&(s=`self.__parseFloatOrBigint(${s})`)),r==="^"||r==="**"?`((${i}) ** (${s}))`:r==="\xF7\xF7"?`(Math.floor(${i} / ${s}))`:(t[r]&&(r=t[r]),`(${i} ${r} ${s})`)}convInc(e){let r=`$nako_v${this.loopId++}`,s="1";this.speedMode.invalidSore===0&&(s=this.varname_get("\u305D\u308C"));let i=e.blocks[0];i.type!=="nop"&&(s=this._convGen(i,!0));let o="",u="",c="",a="",f=e.name;if(f.type==="ref_array")u=this.convRefArray(f),c=`${u} = ${r}`,a=`${u} = 0`;else if(f.type==="ref_prop"){let l=this._convGen(f.name,!0),p=f.index,h=(y,k)=>`(()=>{const __nako_obj=${y};return (__nako_obj!=null&&typeof __nako_obj.__getProp==='function')?__nako_obj.__getProp(${k}, __self):__nako_obj[${k}]})()`,d=(y,k,x)=>`(()=>{const __nako_obj=${y};return (__nako_obj!=null&&typeof __nako_obj.__setProp==='function')?__nako_obj.__setProp(${k}, ${x}, __self):(__nako_obj[${k}]=${x})})()`,m=p.map(y=>JSON.stringify(y.value)),g=l;for(let y of m)g=h(g,y);u=g;let b=l;for(let y of m.slice(0,-1))b=h(b,y);let v=m[m.length-1];c=d(b,v,r),a=d(b,v,"0")}else{let l=f.value,p=this.findVar(l,r);if(p===null&&(this.varsSet.names.add(l),p=this.findVar(l,r),!p))throw new Error("\u300E\u5897\u300F\u307E\u305F\u306F\u300E\u6E1B\u300F\u3067\u5909\u6570\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002");u=p.js,c=p.js_set,p=this.findVar(l,"0"),p!==null&&(a=p.js_set)}return o+=`
|
|
226
|
+
`),s.i===0&&this.varslistSet.length>3&&i.pure!==!0&&this.speedMode.forcePure===0){let v=this.genLocalVarsSyncCode();f+=v.begin,l+=v.end}c.sore&&(f+="/*[sore]*/");let p=this.genCallArgsCode(r,s,u,e),h=`${s.js}(${p})`;if(i.asyncFn){a=`async ${a}`,h=`await ${h}`,this.numAsyncFn++,this.usedAsyncFn=!0;let v=`$nako_i${this.loopId}`;this.loopId++,f+=`const __local_async${v} = __self.__vars;
|
|
227
|
+
`,l+=`__self.__vars = __local_async${v};
|
|
228
|
+
`}s.i===0&&this.performanceMonitor.systemFunctionBody!==0&&(h=this.wrapPerfMonitor(h,this.getPerfMonitorKey(r,"_body"),"sysbody",{isExpr:!0,isAsync:!!i.asyncFn,startVar:"sbf_start",timeVar:"sbl_time"}));let d=s.i===0&&this.performanceMonitor.systemFunction!==0?this.getPerfMonitorKey(r,"_sys"):null,_={funcDef:a,funcCall:h,funcBegin:f,funcEnd:l,isAsync:!!i.asyncFn,sysPerfKey:d};return i.return_none?this.genVoidCallCode(e,_):this.genValueCallCode(e,t,_)}convCallValue(e,t){let r=this._convGen(e.blocks[0],!0),s=e.blocks.slice(1).map(c=>this._convGen(c,!0));s.push("__self");let i=`${r}(${s.join(",")})`;if(t)return i;let[o,u]=this.getSoreWrap();return this.convLineno(e,!1)+`${o}${i}${u};
|
|
229
|
+
`}convRenbun(e){let t=this._convGen(e.blocks[1],!0),r=this._convGen(e.blocks[0],!1);return this.numAsyncFn++,this.usedAsyncFn=!0,`/*[\u9023\u6587]*/await (async function(){ ${r}; return ${t} }).call(this)/*[/\u9023\u6587]*/`}convOp(e){let t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","\xF7":"/"},r=e.operator||"",s=this._convGen(e.blocks[1],!0),i=this._convGen(e.blocks[0],!0);return r==="+"&&this.speedMode.implicitTypeCasting===0&&(e.blocks[0]&&e.blocks[0].type!=="number"&&e.blocks[0].type!=="bigint"&&(i=`self.__parseFloatOrBigint(${i})`),e.blocks[1]&&e.blocks[1].type!=="number"&&e.blocks[1].type!=="bigint"&&(s=`self.__parseFloatOrBigint(${s})`)),r==="^"||r==="**"?`((${i}) ** (${s}))`:r==="\xF7\xF7"?`(Math.floor(${i} / ${s}))`:(t[r]&&(r=t[r]),`(${i} ${r} ${s})`)}convInc(e){let r=`$nako_v${this.loopId++}`,s="1";this.speedMode.invalidSore===0&&(s=this.varname_get("\u305D\u308C"));let i=e.blocks[0];i.type!=="nop"&&(s=this._convGen(i,!0));let o="",u="",c="",a="",f=e.name;if(f.type==="ref_array")u=this.convRefArray(f),c=`${u} = ${r}`,a=`${u} = 0`;else if(f.type==="ref_prop"){let l=this._convGen(f.name,!0),p=f.index,h=(g,b)=>`(()=>{const __nako_obj=${g};return (__nako_obj!=null&&typeof __nako_obj.__getProp==='function')?__nako_obj.__getProp(${b}, __self):__nako_obj[${b}]})()`,d=(g,b,$)=>`(()=>{const __nako_obj=${g};return (__nako_obj!=null&&typeof __nako_obj.__setProp==='function')?__nako_obj.__setProp(${b}, ${$}, __self):(__nako_obj[${b}]=${$})})()`,_=p.map(g=>JSON.stringify(g.value)),v=l;for(let g of _)v=h(v,g);u=v;let m=l;for(let g of _.slice(0,-1))m=h(m,g);let j=_[_.length-1];c=d(m,j,r),a=d(m,j,"0")}else{let l=f.value,p=this.findVar(l,r);if(p===null&&(this.varsSet.names.add(l),p=this.findVar(l,r),!p))throw new Error("\u300E\u5897\u300F\u307E\u305F\u306F\u300E\u6E1B\u300F\u3067\u5909\u6570\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002");u=p.js,c=p.js_set,p=this.findVar(l,"0"),p!==null&&(a=p.js_set)}return o+=`
|
|
261
230
|
/*[convInc]*/
|
|
262
231
|
`,o+=this.convLineno(e,!1)+`
|
|
263
232
|
`,o+=`let ${r} = ${u}
|
|
@@ -265,16 +234,16 @@ if(__self.__performance_monitor[key].max_usec<sl_time){__self.__performance_moni
|
|
|
265
234
|
`,o+=`${r} = Number(${u}) + Number(${s});
|
|
266
235
|
`,o+=`${c}
|
|
267
236
|
`,o+=`/*[/convInc]*/
|
|
268
|
-
`,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
|
|
269
|
-
`}convLetProp(e){if(!e.index||e.index.length===0)throw
|
|
270
|
-
`;if(c===null)throw
|
|
271
|
-
`}convRefProp(e){let t=this._convGen(e.name,!0),r=e.index;if(!r||r.length<=0)throw
|
|
237
|
+
`,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 y.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 y.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 y.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+`
|
|
238
|
+
`}convLetProp(e){if(!e.index||e.index.length===0)throw y.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 y.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 y.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 y.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]*/
|
|
239
|
+
`;if(c===null)throw y.fromNode(`\u5909\u6570\u300E${u}\u300F\u304C\u898B\u5F53\u305F\u308A\u307E\u305B\u3093\u3002`,e);let f=c.js;if(e.blocks.length>=2)for(let l=1;l<e.blocks.length;l++){let p=e.blocks[l],h=this._convGen(p,!0);f+=`[${h}]`}if(t.length>0)for(let l of t)if(typeof l.value=="string")f+=`['${l.value}']`;else throw y.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+`
|
|
240
|
+
`}convRefProp(e){let t=this._convGen(e.name,!0),r=e.index;if(!r||r.length<=0)throw y.fromNode("\u30D7\u30ED\u30D1\u30C6\u30A3\u304C\u3042\u308A\u307E\u305B\u3093\u3002",e);return this.convRefProp_genCode(t,r)}convRefProp_genCode(e,t){let r;if(t.length<=1){let s=t[0].value,i=`${e}.__getProp('${s}', __self)`,o=`${e}['${s}']`,u=`__self.__checkPropAccessor('get', ${e});
|
|
272
241
|
if (typeof ${e}.__getProp === 'function') { return ${i} }
|
|
273
242
|
return ${o}
|
|
274
243
|
`;r=`( (()=>{ ${`if (${e}.__getProp) { return ${i} } else { ${u} }`} })() )`}else{let s=[],i=[];for(let p=0;p<t.length;p++){let h=t[p].value;i.push(`['${h}']`),s.push(`'${h}'`)}let o=i.join(""),u="["+s.join(",")+"]",c=`${e}.__getProp(${u}, __self)`,a=`${e}${o}`,f=`__self.__checkPropAccessor('get', ${e});
|
|
275
244
|
if (${e}.__getProp) { return ${c} }
|
|
276
245
|
return ${a}
|
|
277
|
-
`;r=`( (()=>{ ${`if (${e}.__getProp) { return ${c} } else { ${f} }`} })() )`}return r}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
|
|
246
|
+
`;r=`( (()=>{ ${`if (${e}.__getProp) { return ${c} } else { ${f} }`} })() )`}return r}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 y.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)};
|
|
278
247
|
`;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}
|
|
279
248
|
`,t+=`if (!(${o} instanceof Array)) { ${o}=[${o}] }
|
|
280
249
|
`;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}]`)+`;
|
|
@@ -288,7 +257,7 @@ ${t}
|
|
|
288
257
|
${r}}
|
|
289
258
|
`}getUsedFuncSet(){return this.usedFuncSet}getPluginInitCode(){let e="",t="";for(let r in this.__self.__module){let s=`!${r}:\u521D\u671F\u5316`;if(this.varslistSet[0].names.has(s)){let i=`!${r}:\u521D\u671F\u5316\u6E08`;this.usedFuncSet.add(s),t+=`if (!__v0.has('${i}')) { __v0.get('${s}')(__self); __v0.set('${i}', true) }
|
|
290
259
|
`}}return t!==""&&(e+=`__v0.set('__line', 'l0:\u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u521D\u671F\u5316');
|
|
291
|
-
`+t),e}},
|
|
260
|
+
`+t),e}},yn=`
|
|
292
261
|
// === generated by nadesiko3 v__version__(core:__coreVersion__) ===
|
|
293
262
|
// -----------------------------------------------------------------
|
|
294
263
|
// <nadesiko3standalone>
|
|
@@ -373,25 +342,25 @@ __codeJS__
|
|
|
373
342
|
// -----------------------------------------------------------------
|
|
374
343
|
// </nadesiko3standalone>
|
|
375
344
|
// -----------------------------------------------------------------
|
|
376
|
-
`;function
|
|
345
|
+
`;function ot(n,e,t){let r=new Me(n);r.registerFunction(e);let s=R(B(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+=`
|
|
377
346
|
__self._runTests(__tests);
|
|
378
|
-
`),r.numAsyncFn>0||r.debugOption.useDebug){let
|
|
347
|
+
`),r.numAsyncFn>0||r.debugOption.useDebug){let p="__eval_nako3async_"+o+"__";s=`
|
|
379
348
|
// ------------------------------------------------------------------
|
|
380
349
|
// <nadesiko3::gen::async id="${o}" times="${r.numAsyncFn}">
|
|
381
350
|
// ------------------------------------------------------------------
|
|
382
|
-
async function ${
|
|
351
|
+
async function ${p}(__self) {
|
|
383
352
|
// --- code_begin ---
|
|
384
353
|
${s}
|
|
385
354
|
// --- code_end ---
|
|
386
355
|
// __\u51E6\u7406\u672B\u5C3E__ // \u2190 \u30C6\u30B9\u30C8\u306A\u3069\u3067\u5FC5\u8981\u306A\u306E\u3067\u6D88\u3055\u306A\u3044
|
|
387
|
-
} // end of ${
|
|
356
|
+
} // end of ${p}
|
|
388
357
|
// ------------------------------------------------------------------
|
|
389
|
-
// call ${
|
|
358
|
+
// call ${p}
|
|
390
359
|
(async () => {
|
|
391
360
|
if (__self.__v0.get('__standalone')) {
|
|
392
|
-
await ${
|
|
361
|
+
await ${p}(self);
|
|
393
362
|
} else {
|
|
394
|
-
${
|
|
363
|
+
${p}.call(self, self)
|
|
395
364
|
.then(() => { /* __async_ok__ */ })
|
|
396
365
|
.catch(err => {
|
|
397
366
|
if (err.message === '__\u7D42\u308F\u308B__') { return }
|
|
@@ -405,11 +374,11 @@ async function ${l}(__self) {
|
|
|
405
374
|
// ------------------------------------------------------------------
|
|
406
375
|
// </nadesiko3::gen::async id="${o}">
|
|
407
376
|
// ------------------------------------------------------------------
|
|
408
|
-
`}else{let
|
|
377
|
+
`}else{let p="__eval_nako3sync_"+o+"__";s=`
|
|
409
378
|
// ------------------------------------------------------------------
|
|
410
379
|
// <nadesiko3::gen::syncMode>
|
|
411
380
|
// ------------------------------------------------------------------
|
|
412
|
-
function ${
|
|
381
|
+
function ${p}(__self) {
|
|
413
382
|
try {
|
|
414
383
|
${s}
|
|
415
384
|
// __\u51E6\u7406\u672B\u5C3E__ // \u2190 \u30C6\u30B9\u30C8\u306A\u3069\u3067\u5FC5\u8981\u306A\u306E\u3067\u6D88\u3055\u306A\u3044
|
|
@@ -418,95 +387,99 @@ try {
|
|
|
418
387
|
__self.numFailures++
|
|
419
388
|
throw __self.logger.runtimeError(err, __self.__v0.get('__line'))
|
|
420
389
|
}
|
|
421
|
-
} // end of ${
|
|
422
|
-
${
|
|
390
|
+
} // end of ${p}
|
|
391
|
+
${p}(__self)
|
|
423
392
|
// ------------------------------------------------------------------
|
|
424
393
|
// </nadesiko3::gen::syncMode>
|
|
425
394
|
// ------------------------------------------------------------------
|
|
426
|
-
`}s=
|
|
427
|
-
`}let
|
|
395
|
+
`}s=B(s);let u="",c=[],a=["nako_errors.mjs","plugin_system_debug.mjs","plugin_system_math.mjs","plugin_system_string.mjs","plugin_system_array.mjs","plugin_system_datetime.mjs","plugin_system_url.mjs","plugin_system_types.mjs","plugin_system_json.mjs","plugin_system_regexp.mjs","plugin_system_dict.mjs","plugin_system_stdio.mjs","plugin_system_timer.mjs"];for(let p of t.importFiles){if(a.includes(p))continue;let h="nako3runtime_"+p.replace(/\.(js|mjs)$/,"").replace(/[^a-zA-Z0-9_]/g,"_");c.push(h),u+=`import ${h} from './nako3runtime/${p}'
|
|
396
|
+
`}let f=r.getPluginInitCode(),l=`
|
|
428
397
|
// <runtimeEnvCode>
|
|
429
398
|
const self = this
|
|
430
399
|
${t.codeEnv}
|
|
431
400
|
${i}
|
|
432
|
-
${
|
|
401
|
+
${f}
|
|
433
402
|
${s}
|
|
434
403
|
// </runtimeEnvCode>
|
|
435
404
|
`;return n.getLogger().trace(`--- generate::jsInit ---
|
|
436
405
|
`+i),n.getLogger().trace(`--- generate::js ---
|
|
437
|
-
`+s),{runtimeEnv:
|
|
438
|
-
`);for(let i=0;i<s.length;i++){let o=s[i];o=o.replace(/^(\s*);/,"$1"),
|
|
439
|
-
`),n}function
|
|
406
|
+
`+s),{runtimeEnv:l,standalone:gn(yn,{codeImportFiles:u,coreVersion:n.coreVersion,version:n.version,importNames:"["+c.join(", ")+"]",codeStandalone:t.codeStandalone,codeJS:s,jsInit:i}),gen:r}}function gn(n,e){for(let t in e){let r=`__${t}__`,s=e[t];n=n.split(r).join(s)}return n}function B(n,e=0){n=_n(n);let t="";for(let i=0;i<e;i++)t+=" ";let r=[],s=n.split(`
|
|
407
|
+
`);for(let i=0;i<s.length;i++){let o=s[i];o=o.replace(/^(\s*);/,"$1"),R(o)!==""&&r.push(t+o)}return n=r.join(`
|
|
408
|
+
`),n}function _n(n){let e=[],t=0,r=!1,s=!1,i=!1,o=!1,u=!1,c="",a="",f=-2,l=-2,p=h=>{let d=0,_=h-1;for(;_>=0&&n.charAt(_)==="\\";)d++,_--;return d};for(;t<n.length;){let h=n.charAt(t),d=t+1<n.length?n.charAt(t+1):"";if(o){e.push(h),h===`
|
|
440
409
|
`&&(o=!1),a=h,t++;continue}if(u){if(e.push(h),h==="*"&&d==="/"){e.push(d),u=!1,t+=2,a="/";continue}a=h,t++;continue}if(i){e.push(h),h==="`"&&p(t)%2===0&&(i=!1),a=h,t++;continue}if(s){e.push(h),h==="/"&&p(t)%2===0&&(s=!1),a=h,t++;continue}if(r){e.push(h),h===c&&p(t)%2===0&&(r=!1,c=""),a=h,t++;continue}if(h==="/"&&d==="/"){e.push(h),e.push(d),o=!0,t+=2,a="/";continue}if(h==="/"&&d==="*"){e.push(h),e.push(d),u=!0,t+=2,a="*";continue}if(h==='"'||h==="'"){r=!0,c=h,e.push(h),a=h,t++;continue}if(h==="`"){i=!0,e.push(h),a=h,t++;continue}if(h==="/"&&/[=([,;:!&|?+\-*%^~{]|\breturn\b|\bnew\b/.test(a)){s=!0,e.push(h),a=h,t++;continue}if(h===";"&&f===t-1){f=t,t++,a=h;continue}if(h===";"&&(f=t),h===`
|
|
441
410
|
`&&l===t-1){l=t,t++,a=h;continue}h===`
|
|
442
|
-
`&&(l=t),e.push(h),a=h,t++}return e.join("")}function
|
|
443
|
-
`)}function Ut(n){let e="";for(let t=0;t<n;t++)e+=" ";return e}var he=$();function S(n,e,t=void 0){return t&&(he=t),$(n,e,he.indent,he.line,he.file)}var qt=!1;function Xe(n){return n.type==="\u9055\u3048\u3070"||n.type==="word"&&n.value==="\u30A8\u30E9\u30FC"&&n.josi==="\u306A\u3089\u3070"}function zt(n){let e=0,t=0,r=-1,s=!1;for(let i=0;i<n.length;i++){let o=n[i];if(o.type==="{"){e++,r===-1&&(r=o.indent);continue}if(o.type==="["){t++,r===-1&&(r=o.indent);continue}if(o.type==="}"){e--,e===0&&t===0&&(s=!0);continue}if(o.type==="]"){t--,e===0&&t===0&&(s=!0);continue}if(e>0||t>0){o.indent=r,o.type==="eol"&&(o.type="range_comment",o.value="json::eol");continue}s&&(o.indent=r,o.type==="eol"&&(s=!1,r=-1))}}function Ye(n){zt(n);let e=Y(n,"eol"),t=[],r=-1;for(let i=0;i<e.length;i++){let o=e[i];if(He(o))continue;let u=Ke(o);if(r>=0){let a=u.indent;for(;r>=a;){let f=u;if(Xe(f)&&r===a||(e[i-1].push(S("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",f)),e[i-1].push(S("eol",`
|
|
444
|
-
`,f))),t.pop(),t.length>0)r=t[t.length-1];else{r=-1;break}}}let c=Xt(o);c.type===":"&&(e[i]=e[i].filter(a=>a!==c),r=c.indent,t.push(r))}if(e.length>0&&t.length>0){let i=n[0];for(let o=e.length-1;o>=0;o--){let u=e[o];if(u.length>0){i=u[u.length-1];break}}for(let o=0;o<t.length;o++)e[e.length-1].push(S("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",i)),e[e.length-1].push(S("eol",`
|
|
445
|
-
`,i))}let s=X(e);return qt&&console.log("###",pe(s)),s}function X(n){let e=[];for(let t of n)for(let r of t)e.push(r);return e}function Xt(n){let e=n.length,t=$("?");if(e===0)return t;for(let r=0;r<e&&(t=n[e-r-1],!(t.type!=="eol"&&!(t.type==="line_comment"||t.type==="range_comment")));r++);return t}function Y(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 He(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 Ke(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 Yt=["!\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 Ze(n){if(!Ht(n))return n;for(let c of n)if(c.type==="\u3053\u3053\u307E\u3067")throw new ue("\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=Y(n,"eol"),o=0;for(let c=0;c<i.length;c++){let a=i[c];if(He(a))continue;if(t>0||e>0){r(a);continue}let f=Ke(a),l=f.indent;if(l!==o){if(o>=0)for(;o>l;){let p=s[s.length-1][1];if(!(Xe(f)&&p===l)){let h=i[c-1][0];i[c-1].push(S("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",h)),i[c-1].push(S("eol",`
|
|
446
|
-
`,h))}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){for(let p=0;p<l.length;p++){let h=l[l.length-p-1];if(h.line>0){a=h;break}}break}}i[i.length-1].push(S("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",a)),i[i.length-1].push(S("eol",`
|
|
447
|
-
`,a))}return X(i)}function Ht(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&Yt.indexOf(t.value)>=0)return!0}return!1}var Kt=["!DNCL\u30E2\u30FC\u30C9","\u{1F4A1}DNCL\u30E2\u30FC\u30C9"],Zt={"\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 tt(n){if(!Qt(n))return n;let e=Y(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,$("word","\u5F8C\u5224\u5B9A",s.indent,s.line,s.file),$("word","\u7E70\u8FD4",s.indent,s.line,s.file));let i=F(r,["word:\u306A\u308B","word:\u7E70\u8FD4"]);i>0&&et(r,i);let o=F(r,["word:\u306A\u308B","word:\u5B9F\u884C"]);o>0&&et(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 p=l.value.substring(4),h=$("word",p,l.indent,l.line,l.file);p.match(/^\d/)&&(h.type="number"),r.splice(a+2,0,h),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)Qe(r,a);else break}for(;;){let a=F(r,["word:\u3059\u3079\u3066","word:\u5024"]);if(a>=1)Qe(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,$("word",f,a.indent,a.line,a.file))),c++;continue}c++}}for(let t=0;t<n.length;t++){let r=n[t],s=Zt[String(r.type)+":"+String(r.value)];s!==void 0&&(r.type=s[0],r.value=s[1])}return n=X(e),n}function Qe(n,e){let t=n[e];n[e-1].josi="";let r=$("eq","=",t.indent,t.line,t.file),s=$("[","[",t.indent,t.line,t.file),i=$("]","]",t.indent,t.line,t.file);i.josi="\u306B";let o=n[e+2];o.josi="";let u=$("number",100,t.indent,t.line,t.file);u.josi="\u3092";let c=$("word","\u639B",t.indent,t.line,t.file);n.splice(e,4,r,s,o,i,u,c)}function et(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 Qt(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&Kt.indexOf(t.value)>=0)return t.type="DNCL\u30E2\u30FC\u30C9",!0}return!1}var en=!1,Ne=30,tn=["!DNCL2\u30E2\u30FC\u30C9","\u{1F4A1}DNCL2\u30E2\u30FC\u30C9","!DNCL2","\u{1F4A1}DNCL2"],nn={"\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 nt(n){if(!rn(n))return n;let e=Y(n,"eol");for(let t=0;t<e.length;t++){let r=e[t];if(r.length<=1)continue;let s=V(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=V(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=$("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=V(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=V(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=V(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=V(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=V(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=V(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(Oe([["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,S("eq","=",u),S("word","\u639B"),S("(","("),S("[","["),c,S("]","]"),S("comma",","),S("number",Ne),S(")",")")),o+=6}if(Oe(["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,S("eq","=",u),S("word","\u639B"),S("(","("),S("[","["),c,S("]","]"),S("comma",","),S("number",Ne),S(")",")"))}if(Oe([["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,S("eq","=",u),S("word","\u639B"),S("(","("),S("[","["),S("number",0),S("]","]"),S("comma",","),S("number",Ne),S(")",")"))}}for(;;){let o=V(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=V(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,$("word",u,o.indent,o.line,o.file))),i++;continue}i++}}for(let t=0;t<n.length;t++){let r=n[t],s=nn[String(r.type)+":"+String(r.value)];s!==void 0&&(r.type=s[0],r.value=s[1])}return n=X(e),en&&(console.log("// DEBUG---DNCL:tokens---BEGIN"),console.log(pe(n)),console.log("// DEBUG---DNCL:tokens---END")),n}function Oe(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 V(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 rn(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&tn.indexOf(t.value)>=0)return t.type="DNCL2\u30E2\u30FC\u30C9",!0}return!1}var de=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}},ye=class{constructor(e,t,r){this.lines=[],this.linesInsertedByIndentationSyntax=t,this.linesDeletedByIndentationSyntax=r;let s=0;for(let i of e.split(`
|
|
448
|
-
`))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}},_e=class{constructor(e){this.lineOffsets=[];let t=0;for(let r of e.split(`
|
|
449
|
-
`))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 Fe(n,e){if(typeof n.startOffset=="number"&&(n.startOffset-=e.length),typeof n.endOffset=="number"&&(n.endOffset-=e.length),e!==""){let t=e.split(`
|
|
450
|
-
`);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 sn={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"},Ce=["black","red","green","yellow","blue","magenta","cyan","white"],on=n=>n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),un=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=Ce[l-30]),t.push(`color: ${r}; font-weight: ${s};`),"%c"}),o="inherit",u="inherit",c=n===e?e:"<span>"+on(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=Ce[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]}},j={convertColorTextFormat:un,colorNames:Ce,color:sn};var A=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]}};A.all=0;A.trace=1;A.debug=2;A.info=3;A.warn=4;A.error=5;A.stdout=6;function ee(n){return n?`${n.file||""}${n.line===void 0?"":`(${n.line+1}\u884C\u76EE): `}`:""}var te=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=A.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(A.trace,`${j.color.bold}[\u30C7\u30D0\u30C3\u30B0\u60C5\u5831\uFF08\u8A73\u7D30\uFF09]${j.color.reset}${ee(t)}${e}`,t)}debug(e,t=null){this.sendI(A.debug,`${j.color.bold}[\u30C7\u30D0\u30C3\u30B0\u60C5\u5831]${j.color.reset}${ee(t)}${e}`,t)}info(e,t=null){this.sendI(A.info,`${j.color.bold}${j.color.blue}[\u60C5\u5831]${j.color.reset}${ee(t)}${e}`,t)}warn(e,t=null){this.sendI(A.warn,`${j.color.bold}${j.color.green}[\u8B66\u544A]${j.color.reset}${ee(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 M){let s=e,i=t;i==null&&(i={file:s.file,line:s.line||0,startOffset:0,endOffset:0}),this.sendI(A.error,s.message,i);return}}e instanceof Error&&(e=e.message),this.sendI(A.error,`${j.color.bold}${j.color.red}[\u30A8\u30E9\u30FC]${j.color.reset}${ee(t)}${e}`,t)}runtimeError(e,t){return new G(e,t)}stdout(e,t=null){this.sendI(A.stdout,`${e}`,t)}send(e,t,r,s=null,i=null){let o=A.fromS(e);this.sendI(o,t,r,s,i)}sendI(e,t,r,s=null,i=null){let o=()=>{let u=j.convertColorTextFormat(t),c="";return t.includes(`
|
|
411
|
+
`&&(l=t),e.push(h),a=h,t++}return e.join("")}function R(n){return n=String(n),n.replace(/^\s+|\s+$/g,"")}var mn={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"],bn=n=>n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),kn=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>"+bn(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:kn,colorNames:Ve,color:mn};var A=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]}};A.all=0;A.trace=1;A.debug=2;A.info=3;A.warn=4;A.error=5;A.stdout=6;function re(n){return n?`${n.file||""}${n.line===void 0?"":`(${n.line+1}\u884C\u76EE): `}`:""}var se=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=A.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(A.trace,`${S.color.bold}[\u30C7\u30D0\u30C3\u30B0\u60C5\u5831\uFF08\u8A73\u7D30\uFF09]${S.color.reset}${re(t)}${e}`,t)}debug(e,t=null){this.sendI(A.debug,`${S.color.bold}[\u30C7\u30D0\u30C3\u30B0\u60C5\u5831]${S.color.reset}${re(t)}${e}`,t)}info(e,t=null){this.sendI(A.info,`${S.color.bold}${S.color.blue}[\u60C5\u5831]${S.color.reset}${re(t)}${e}`,t)}warn(e,t=null){this.sendI(A.warn,`${S.color.bold}${S.color.green}[\u8B66\u544A]${S.color.reset}${re(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 M){let s=e,i=t;i==null&&(i={file:s.file,line:s.line||0,startOffset:0,endOffset:0}),this.sendI(A.error,s.message,i);return}}e instanceof Error&&(e=e.message),this.sendI(A.error,`${S.color.bold}${S.color.red}[\u30A8\u30E9\u30FC]${S.color.reset}${re(t)}${e}`,t)}runtimeError(e,t){return new q(e,t)}stdout(e,t=null){this.sendI(A.stdout,`${e}`,t)}send(e,t,r,s=null,i=null){let o=A.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(`
|
|
451
412
|
`)&&(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:A.toString(e),position:r}};if(e===A.error){let u=o();this.logs+=u.noColor+`
|
|
452
|
-
`,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
|
|
453
|
-
`,r=0,s=0;for(let i of e)try{i.f(),t+=`${
|
|
454
|
-
`,r++}catch(o){let u=o instanceof Error?o.message:String(o);t+=`${
|
|
455
|
-
`,s++}s>0?t+=`${
|
|
413
|
+
`,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 ge=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}
|
|
414
|
+
`,r=0,s=0;for(let i of e)try{i.f(),t+=`${S.color.green}\u2714${S.color.reset} ${i.name}
|
|
415
|
+
`,r++}catch(o){let u=o instanceof Error?o.message:String(o);t+=`${S.color.red}\u2613${S.color.reset} ${i.name}: ${u}
|
|
416
|
+
`,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 ut=n=>JSON.parse(JSON.stringify(n));function ie(n){let e=[];for(let t=0;t+2<n.length;t++){if(!(n[t].type==="not"&&(n[t+1].type==="string"||n[t+1].type==="string_ex")&&n[t+2].value==="\u53D6\u8FBC"))continue;let r=String(n[t+1].value)+"";if(r=r.replace(/^(貯蔵庫|拡張プラグイン):/,"$1:"),(r.startsWith("\u8CAF\u8535\u5EAB:")||r.startsWith("\u8CAF\u8535\u5EAB\uFF1A"))&&(r=`https://n3s.nadesi.com/plain/${r.substring(4)}`),r.startsWith("\u62E1\u5F35\u30D7\u30E9\u30B0\u30A4\u30F3:")||r.startsWith("\u62E1\u5F35\u30D7\u30E9\u30B0\u30A4\u30F3\uFF1A")){let i=r.substring(8).match(/^([a-zA-Z0-9_-]+)\.(js|mjs|nako3)(@[0-9.]+)?$/);if(i){let o=i[1],u=i[2],c=i[3]||"@latest";u==="js"||u==="mjs"?(o.startsWith("nadesiko3-")||(o=`nadesiko3-${o}`),r=`https://cdn.jsdelivr.net/npm/${o}${c}/${o}.${u}`):r=`https://n3s.nadesi.com/plain/${o}.${u}`}else throw new te("\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",n[t].file,n[t].line)}e.push({...n[t],start:t,end:t+3,value:r,firstToken:n[t],lastToken:n[t+2]}),t+=2}return e}var _e=class{constructor(e){this.host=e,this.dependencies={}}load(e,t,r,s){let i={},o=this.host,u=o.createScanner(),c=(l,p)=>{let h=s.readJs(l.filePath,l.firstToken);p.push(h.task.then(d=>{let _=d();o.addPluginFromFile(l.filePath,_),i[l.filePath].funclist=_,i[l.filePath].moduleExport={},i[l.filePath].addPluginFile=()=>{o.addPluginFromFile(l.filePath,_)}}))},a=(l,p)=>{let h=s.readNako3(l.filePath,l.firstToken),d=_=>{let v=O.filenameToModName(l.filePath);_=`\u300E${v}\u300F\u306B\u540D\u524D\u7A7A\u9593\u8A2D\u5B9A;\u300E${v}\u300F\u306B\u30D7\u30E9\u30B0\u30A4\u30F3\u540D\u8A2D\u5B9A;`+_+";\u540D\u524D\u7A7A\u9593\u30DD\u30C3\u30D7;";let m=o.rawtokenize(_,0,l.filePath);i[l.filePath].tokens=m;let j=new Map,g=new Map;return O.preDefineFunc(ut(m),o.getLogger(),j,g),i[l.filePath].funclist=j,i[l.filePath].moduleExport=g,f(_,l.filePath,"")};p.push(h.task.then(_=>d(_)))},f=(l,p,h)=>{let d=[],v=ie(u.rawtokenize(l,0,p,h)).map(m=>({...m,...s.resolvePath(m.value,m.firstToken,p)}));for(let m of v){if(i.hasOwnProperty(m.filePath)){i[m.filePath].alias.add(m.value);continue}if(i[m.filePath]={tokens:[],alias:new Set([m.value]),addPluginFile:()=>{},funclist:{},moduleExport:{}},m.type==="js"||m.type==="mjs")c(m,d);else if(m.type==="nako3")a(m,d);else throw new te(`\u30D5\u30A1\u30A4\u30EB\u300E${String(m.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`,m.firstToken.file,m.firstToken.line)}if(d.length>0)return Promise.all(d)};try{let l=f(e,t,r);return l!==void 0&&l.catch(p=>{o.getLogger().error(p.msg),o.countFailure()}),this.dependencies=i,l}catch(l){throw o.getLogger().error(String(l)),l}}replaceRequireStatements(e,t=new Set){let r=[];for(let s of ie(e).reverse()){let i=Object.keys(this.dependencies).find(u=>this.dependencies[u].alias.has(s.value));if(i===void 0)throw s.firstToken?new G(`\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`);if(t.has(i)){r.push(...e.splice(s.start||0,(s.end||0)-(s.start||0)));continue}this.dependencies[i].addPluginFile();let o=ut(this.dependencies[i].tokens);t.add(i),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 ie(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}};var Pe=n=>JSON.parse(JSON.stringify(n));var me=class n{constructor(e){this.host=e,this.pluginFunclist={},this.pluginfiles={},this.commandlist=new Set,this.modules={}}addPlugin(e,t=!0,r=""){let s=this.host.getSysVars(),i=s.get("__pluginInfo");i||(i={},s.set("__pluginInfo",i));let o=this.readPluginMeta(e,r),u=o.pluginName,c=o.metaValue;if(i[u]===void 0){if(u=n.removeInvalidFilenameChars(u),i[u]=c,u=this.checkPluginVersion(u,o.intVersion,e,c),this.modules[u]=e,this.pluginfiles[u]="*",typeof e.\u521D\u671F\u5316=="object"){let a=e.\u521D\u671F\u5316;delete e.\u521D\u671F\u5316;let f=`!${u}:\u521D\u671F\u5316`;e[f]=a}this.registerPluginEntries(e,t,s)}}readPluginMeta(e,t){let r=0,s="unknown",i={pluginName:"unknown",nakoVersionResult:!0,nakoVersion:"0.0.0",path:""};if(e.meta&&e.meta.value&&typeof e.meta=="object"){i=e.meta.value||{pluginName:"unknown",nakoVersion:"0.0.0"},s=i.pluginName||"unknown";let c=((i.nakoVersion||"0.0.0")+".0.0").split(".").map(a=>parseInt(a));r=c[1]*100+c[2],i.path=t}return s==="unknown"&&(s=Object.keys(e).join("-")),{pluginName:s,intVersion:r,metaValue:i}}checkPluginVersion(e,t,r,s){if(600<=t)return e;let i=Object.keys(r).join(",");if(e==="unknown"&&(e=i.substring(0,30)+"..."),e!==""){let o=`\u306A\u3067\u3057\u3053\u30D7\u30E9\u30B0\u30A4\u30F3\u300E${e}\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: 600/\u30D7\u30E9\u30B0\u30A4\u30F3: ${t})`;console.warn(o,"see","https://github.com/kujirahand/nadesiko3/issues/1647"),this.host.getLogger().warn(o),s.nakoVersionResult=!1}return e}registerPluginEntries(e,t,r){let s=this.host.getFuncList();for(let i in e){let o=e[i];if(s.set(i,o),t&&(this.pluginFunclist[i]=Pe(o)),o.type==="func")r.set(i,o.fn),o.asyncFn&&(o.pure=!0);else if(o.type==="const"||o.type==="var")r.set(i,o.value);else throw console.error("[\u30D7\u30E9\u30B0\u30A4\u30F3\u8FFD\u52A0\u30A8\u30E9\u30FC]",o),new Error("\u30D7\u30E9\u30B0\u30A4\u30F3\u306E\u8FFD\u52A0\u3067\u30A8\u30E9\u30FC\u3002");i==="\u521D\u671F\u5316"||i.substring(0,1)==="!"||this.commandlist.add(i)}}static removeInvalidFilenameChars(e){return e.replace(/[^A-Za-z0-9\-_\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF\u3400-\u4DBF\uF900-\uFAFF]/g,"_")}addPluginObject(e,t,r=!0){t.meta===void 0&&(t.meta={type:"const",value:{pluginName:e,nakoVersion:"0.0.0"}}),this.addPlugin(t,r)}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.host.getFuncList().set(e,o),this.pluginFunclist[e]=Pe(o),this.host.getSysVars().set(e,r)}getFunc(e){return this.host.getFuncList().get(e)}hasCommand(e){return this.commandlist.has(e)}createFuncListFromPlugins(e){let t=new Map;for(let r of e.keys()){let s=this.pluginFunclist[r];s&&t.set(r,Pe(s))}return t}};var Ie=class{constructor(e,t,r){this.from=e,this.to=t,this.index=r}},N=class{constructor(e,t){this.text=e,this.sourcePosition=t}},Le=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 Ie(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}},be=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," "],[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 Le(e);t.replaceAll(`\r
|
|
417
|
+
`,`
|
|
418
|
+
`),t.replaceAll("\r",`
|
|
419
|
+
`);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 N(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 N(c+i,t.getSourcePosition(u))),a+=2,u=a;continue}c+=f,a++;continue}if(f==="\u300C"){o.push(new N(f,t.getSourcePosition(u))),a++,u=a,r=!0,i="\u300D",c="";continue}if(f==="\u300E"){o.push(new N(f,t.getSourcePosition(u))),a++,u=a,r=!0,i="\u300F",c="";continue}if(f==="\u201C"){o.push(new N(f,t.getSourcePosition(u))),a++,u=a,r=!0,i="\u201D",c="";continue}if(l==="\u{1F334}"||l==="\u{1F33F}"){o.push(new N(l,t.getSourcePosition(u))),a+=2,u=a,s=!0,i=l,c="";continue}let p=this.convert1ch(f);if(p==='"'||p==="'"){o.push(new N(p,t.getSourcePosition(u))),a++,u=a,r=!0,i=f,c="";continue}if(p==="#"){o.push(new N(p,t.getSourcePosition(u))),a++,u=a,r=!0,i=`
|
|
420
|
+
`,c="";continue}if(l==="//"||l==="\uFF0F\uFF0F"){o.push(new N("//",t.getSourcePosition(u))),a+=2,u=a,r=!0,i=`
|
|
421
|
+
`,c="";continue}if(l==="\uFF0F\uFF0A"){o.push(new N("/*",t.getSourcePosition(u))),a+=2,u=a,s=!0,i="\uFF0A\uFF0F",c="";continue}if(l==="/*"){o.push(new N(l,t.getSourcePosition(u))),a+=2,u=a,s=!0,i="*/",c="";continue}o.push(new N(p,t.getSourcePosition(u))),a++,u=a}return(r||s)&&(i==='"'||i==="'"||i==="\u300D"||i==="\u300F"||o.push(new N(c+i,t.getSourcePosition(u)))),o}};function ve(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]=vn(r.indent)),e[r.line]+=o+r.josi+"|"}return e.join(`
|
|
422
|
+
`)}function vn(n){let e="";for(let t=0;t<n;t++)e+=" ";return e}var ke=x();function w(n,e,t=void 0){return t&&(ke=t),x(n,e,ke.indent,ke.line,ke.file)}var wn=!1;function ct(n){return n.type==="\u9055\u3048\u3070"||n.type==="word"&&n.value==="\u30A8\u30E9\u30FC"&&n.josi==="\u306A\u3089\u3070"}function Sn(n){let e=0,t=0,r=-1,s=!1;for(let i=0;i<n.length;i++){let o=n[i];if(o.type==="{"){e++,r===-1&&(r=o.indent);continue}if(o.type==="["){t++,r===-1&&(r=o.indent);continue}if(o.type==="}"){e--,e===0&&t===0&&(s=!0);continue}if(o.type==="]"){t--,e===0&&t===0&&(s=!0);continue}if(e>0||t>0){o.indent=r,o.type==="eol"&&(o.type="range_comment",o.value="json::eol");continue}s&&(o.indent=r,o.type==="eol"&&(s=!1,r=-1))}}function at(n){Sn(n);let e=Z(n,"eol"),t=[],r=-1;for(let i=0;i<e.length;i++){let o=e[i];if(ft(o))continue;let u=lt(o);if(r>=0){let a=u.indent;for(;r>=a;){let f=u;if(ct(f)&&r===a||(e[i-1].push(w("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",f)),e[i-1].push(w("eol",`
|
|
423
|
+
`,f))),t.pop(),t.length>0)r=t[t.length-1];else{r=-1;break}}}let c=jn(o);c.type===":"&&(e[i]=e[i].filter(a=>a!==c),r=c.indent,t.push(r))}if(e.length>0&&t.length>0){let i=n[0];for(let o=e.length-1;o>=0;o--){let u=e[o];if(u.length>0){i=u[u.length-1];break}}for(let o=0;o<t.length;o++)e[e.length-1].push(w("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",i)),e[e.length-1].push(w("eol",`
|
|
424
|
+
`,i))}let s=H(e);return wn&&console.log("###",ve(s)),s}function H(n){let e=[];for(let t of n)for(let r of t)e.push(r);return e}function jn(n){let e=n.length,t=x("?");if(e===0)return t;for(let r=0;r<e&&(t=n[e-r-1],!(t.type!=="eol"&&!(t.type==="line_comment"||t.type==="range_comment")));r++);return 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 ft(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 lt(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 xn=["!\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 ht(n){if(!$n(n))return n;for(let c of n)if(c.type==="\u3053\u3053\u307E\u3067")throw new le("\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(ft(a))continue;if(t>0||e>0){r(a);continue}let f=lt(a),l=f.indent;if(l!==o){if(o>=0)for(;o>l;){let p=s[s.length-1][1];if(!(ct(f)&&p===l)){let h=i[c-1][0];i[c-1].push(w("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",h)),i[c-1].push(w("eol",`
|
|
425
|
+
`,h))}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){for(let p=0;p<l.length;p++){let h=l[l.length-p-1];if(h.line>0){a=h;break}}break}}i[i.length-1].push(w("\u3053\u3053\u307E\u3067","\u3053\u3053\u307E\u3067",a)),i[i.length-1].push(w("eol",`
|
|
426
|
+
`,a))}return H(i)}function $n(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&xn.indexOf(t.value)>=0)return!0}return!1}var An=["!DNCL\u30E2\u30FC\u30C9","\u{1F4A1}DNCL\u30E2\u30FC\u30C9"],Nn={"\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 yt(n){if(!On(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,x("word","\u5F8C\u5224\u5B9A",s.indent,s.line,s.file),x("word","\u7E70\u8FD4",s.indent,s.line,s.file));let i=C(r,["word:\u306A\u308B","word:\u7E70\u8FD4"]);i>0&&dt(r,i);let o=C(r,["word:\u306A\u308B","word:\u5B9F\u884C"]);o>0&&dt(r,o);let u=C(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=C(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=C(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=C(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 p=l.value.substring(4),h=x("word",p,l.indent,l.line,l.file);p.match(/^\d/)&&(h.type="number"),r.splice(a+2,0,h),l.value=l.value.substring(0,4)}l.type="\u3082\u3057",l.value="\u3082\u3057",l.josi="";continue}}break}for(;;){let a=C(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=C(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=C(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=C(r,["word:\u3059\u3079\u3066","word:\u8981\u7D20"]);if(a>=1)pt(r,a);else break}for(;;){let a=C(r,["word:\u3059\u3079\u3066","word:\u5024"]);if(a>=1)pt(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,x("word",f,a.indent,a.line,a.file))),c++;continue}c++}}for(let t=0;t<n.length;t++){let r=n[t],s=Nn[String(r.type)+":"+String(r.value)];s!==void 0&&(r.type=s[0],r.value=s[1])}return n=H(e),n}function pt(n,e){let t=n[e];n[e-1].josi="";let r=x("eq","=",t.indent,t.line,t.file),s=x("[","[",t.indent,t.line,t.file),i=x("]","]",t.indent,t.line,t.file);i.josi="\u306B";let o=n[e+2];o.josi="";let u=x("number",100,t.indent,t.line,t.file);u.josi="\u3092";let c=x("word","\u639B",t.indent,t.line,t.file);n.splice(e,4,r,s,o,i,u,c)}function dt(n,e){let t=C(n,["word:\u3092"]);t>=0&&(n[t].type="\u3053\u3053\u307E\u3067",n[t].value="\u3053\u3053\u307E\u3067");let r=C(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 C(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 On(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&An.indexOf(t.value)>=0)return t.type="DNCL\u30E2\u30FC\u30C9",!0}return!1}var Fn=!1,De=30,Cn=["!DNCL2\u30E2\u30FC\u30C9","\u{1F4A1}DNCL2\u30E2\u30FC\u30C9","!DNCL2","\u{1F4A1}DNCL2"],En={"\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 gt(n){if(!Tn(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=P(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=P(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=x("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=P(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=P(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=P(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=P(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=P(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=P(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(Je([["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",De),w(")",")")),o+=6}if(Je(["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",De),w(")",")"))}if(Je([["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",De),w(")",")"))}}for(;;){let o=P(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=P(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,x("word",u,o.indent,o.line,o.file))),i++;continue}i++}}for(let t=0;t<n.length;t++){let r=n[t],s=En[String(r.type)+":"+String(r.value)];s!==void 0&&(r.type=s[0],r.value=s[1])}return n=H(e),Fn&&(console.log("// DEBUG---DNCL:tokens---BEGIN"),console.log(ve(n)),console.log("// DEBUG---DNCL:tokens---END")),n}function Je(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 P(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 Tn(n){for(let e=0;e<n.length&&!(e>100);e++){let t=n[e];if(t.type==="line_comment"&&Cn.indexOf(t.value)>=0)return t.type="DNCL2\u30E2\u30FC\u30C9",!0}return!1}var we=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}},Se=class{constructor(e,t,r){this.lines=[],this.linesInsertedByIndentationSyntax=t,this.linesDeletedByIndentationSyntax=r;let s=0;for(let i of e.split(`
|
|
427
|
+
`))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}},je=class{constructor(e){this.lineOffsets=[];let t=0;for(let r of e.split(`
|
|
428
|
+
`))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 Re(n,e){if(typeof n.startOffset=="number"&&(n.startOffset-=e.length),typeof n.endOffset=="number"&&(n.endOffset-=e.length),e!==""){let t=e.split(`
|
|
429
|
+
`);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 xe=class{constructor(e){this.host=e,this.prepare=be.getInstance(),this.lexer=new O(e.getLogger())}getModList(){return this.lexer.modList}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 we(e.length,u),a=new Se(e,[],[]),f=new je(e),l;try{l=this.lexer.tokenize(u.map(p=>p.text).join(""),t,r)}catch(p){if(!(p instanceof D))throw p;let h=a.map(c.map(p.preprocessedCodeStartOffset),c.map(p.preprocessedCodeEndOffset)),d=h.startOffset===null?p.line:f.map(h.startOffset,!1).line,_=Re({...h,line:d},s);throw new G(p.msg,_.startOffset,_.endOffset,_.line,r)}return l=gt(l),l=yt(l),l=ht(l),l=at(l),l=l.map(p=>{let h=a.map(c.map(p.preprocessedCodeOffset||0),c.map((p.preprocessedCodeOffset||0)+(p.preprocessedCodeLength||0))),d=p.line,_=0;if(p.type==="eol"&&h.endOffset!==null){let v=f.map(h.endOffset,!1);d=v.line,_=v.column}else if(h.startOffset!==null){let v=f.map(h.startOffset,!1);d=v.line,_=v.column}return{...p,...Re({line:d,column:_,startOffset:h.startOffset,endOffset:h.endOffset},s),rawJosi:p.josi}}),l}converttoken(e,t,r){return this.lexer.replaceTokens(e,t,r)}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}}lex(e,t="main.nako3",r="",s=!1){let i=this.rawtokenize(e,0,t,r),o=s?this.host.removeRequireStatements(i):this.host.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.host.getLogger().trace(`--- lex ---
|
|
430
|
+
`+JSON.stringify(i,null,2)),{commentTokens:u,tokens:i,requireTokens:o}}};function I(n={}){return(n===null||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 $e=class{constructor(e){this.host=e,this.globals=[],this.currentGlobal=null}clearPlugins(){this.globals.forEach(e=>{e&&(e.__setSysVar("__forceClose",!0),e.reset())}),this.globals=[]}evalJS(e,t){this.currentGlobal=t,this.currentGlobal.lastJSCode=e,this.host.fireEvent("beforeRun",t);try{new Function(t.lastJSCode).apply(t)}catch(r){throw t.numFailures++,this.host.getLogger().error(r),r}this.host.fireEvent("finish",t)}runSync(e,t,r=void 0){r=I(r);let s=this.host.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=I(r);let s=this.host.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=this.host.createNakoGlobal(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}runEx(e,t,r,s="",i=void 0){return r.preCode=s,i&&(r.nakoGlobal=i),this.runSync(e,t,r)}async run(e,t,r,s,i=""){let o=I({resetEnv:r,resetAll:r,testOnly:s,preCode:i});return this.runEx(e,t,o)}async runReset(e,t="main.nako3",r=""){let s=I({resetAll:!0,resetEnv:!0,preCode:r});return this.runAsync(e,t,s)}test(e,t,r="",s=!1){let i=I();return i.preCode=r,i.testOnly=s,this.runSync(e,t,i)}};var Ae=class{constructor(){this.eventList=[]}on(e,t){this.eventList.push({eventName:e,callback:t})}fire(e,t){let r=this.eventList.slice();for(let s of r)s.eventName===e&&s.callback(t)}getEventList(){return this.eventList}clear(){this.eventList=[]}};var _t={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 e instanceof Array||(e=[e]),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,asyncFn:!0,fn:async function(n,e){let t={resetEnv:!1,resetAll:!0,nakoGlobal:e},r=String(e.__getSysVar("\u8868\u793A\u30ED\u30B0",""));e.__setSysVar("\u8868\u793A\u30ED\u30B0",""),await e.__self.runAsync(n,e.__modName,t);let s=String(e.__getSysVar("\u8868\u793A\u30ED\u30B0"));return e.__setSysVar("\u8868\u793A\u30ED\u30B0",r+s),s}},\u30CA\u30C7\u30B7\u30B3\u7D9A:{type:"func",josi:[["\u3092","\u3067"]],pure:!1,asyncFn:!0,fn:async function(n,e){let t={resetEnv:!1,resetAll:!1,nakoGlobal:e.__self},r=e.__getSysVar("\u8868\u793A\u30ED\u30B0","");e.__setSysVar("\u8868\u793A\u30ED\u30B0",""),await e.__self.runAsync(n,e.__modName,t);let s=String(e.__getSysVar("\u8868\u793A\u30ED\u30B0"));return s&&e.logger.trace(s),e.__setSysVar("\u8868\u793A\u30ED\u30B0",r+s),s}},\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")),typeof performance<"u"&&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__")}},\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}};var mt={\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)}},\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}}};var bt={\u6587\u5B57\u6570:{type:"func",josi:[["\u306E"]],pure:!0,fn:function(n){return Array.from?(typeof n!="string"&&(n=String(n)),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.fromCodePoint(t)):e.push(String.fromCharCode(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).codePointAt(0)||0):e.push(String(t).charCodeAt(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)+`
|
|
431
|
+
`}},\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){if(typeof e=="string"&&(e=parseInt(e)),typeof t=="string"&&(t=parseInt(t)),t<=0)return"";let r=Array.from(n);return e<0&&(e=r.length+e+1,e<0&&(e=1)),r.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("")}},\u6587\u5B57\u59CB:{type:"func",josi:[["\u304C"],["\u3067","\u304B\u3089"]],pure:!0,fn:function(n,e){return n.startsWith(e)}},\u6587\u5B57\u7D42:{type:"func",josi:[["\u304C"],["\u3067"]],pure:!0,fn:function(n,e){return n.endsWith(e)}},\u51FA\u73FE:{type:"func",josi:[["\u306B","\u3067"],["\u304C"]],pure:!0,fn:function(n,e){return typeof n=="string"||n instanceof Array?n.includes(e):String(n).includes(e)}},\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"},\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 n===""?!1:String(n).match(e)!==null}}};var kt={\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(`
|
|
432
|
+
`).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(`
|
|
433
|
+
`).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}}};var vt={\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)/(3600*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)/3600)}},\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 typeof performance<"u"&&performance.now?performance.now():Date.now?Date.now():new Date().getTime()}}};var wt={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){if(i==="")continue;let o=i.indexOf("="),u,c;o<0?(u=i,c=""):(u=i.substring(0,o),c=i.substring(o+1));let a=e.__exec("URL\u30C7\u30B3\u30FC\u30C9",[u]),f=e.__exec("URL\u30C7\u30B3\u30FC\u30C9",[c]);t[a]=f}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")}},\u62E1\u5F35\u5B50\u62BD\u51FA:{type:"func",josi:[["\u304B\u3089","\u306E"]],pure:!0,fn:function(n,e){if(n==null)return"";let t=e.pathSeparator||"/";if(n.indexOf(t)>=0){let s=n.split(t);n=s[s.length-1]}let r=n.match(/(\.[a-zA-Z0-9_\-+]+)$/);return r?r[1]:""}},\u62E1\u5F35\u5B50\u5909\u66F4:{type:"func",josi:[["\u306E","\u3092","\u304B\u3089"],["\u306B","\u3078"]],pure:!0,fn:function(n,e,t){if(n==null)return e;let r=t.pathSeparator||"/",s=n.split(r),i=s[s.length-1],o=s.slice(0,-1).join(r),u=(e??"").trim(),c=u;u!==""&&(c=u.startsWith(".")?u:"."+u);let a=i.replace(/(\.[a-zA-Z0-9_\-+]+)?$/,c);return t.__exec("\u7D42\u7AEF\u30D1\u30B9\u8FFD\u52A0",[o,t])+a}},\u7D42\u7AEF\u30D1\u30B9\u8FFD\u52A0:{type:"func",josi:[["\u306B","\u3078"]],pure:!0,fn:function(n,e){let t=e.pathSeparator||"/";return n==null||n===""?"":n.endsWith(t)?n:n+t}},\u7D42\u7AEF\u30D1\u30B9\u9664\u53BB:{type:"func",josi:[["\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){let t=e.pathSeparator||"/";return n?n.endsWith(t)?n.substring(0,n.length-1):n:""}},\u7D42\u7AEF\u30D1\u30B9\u524A\u9664:{type:"func",josi:[["\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){return e.__exec("\u7D42\u7AEF\u30D1\u30B9\u9664\u53BB",[n,e])}},\u30D5\u30A1\u30A4\u30EB\u540D\u62BD\u51FA:{type:"func",josi:[["\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){let t=e.pathSeparator||"/",r=n.split(t);return r[r.length-1]}},\u30D1\u30B9\u62BD\u51FA:{type:"func",josi:[["\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){let t=e.pathSeparator||"/",r=n.split(t);return r.pop(),r.join(t)}}};var St={\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)}}};var jt={JSON\u5909\u63DB:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n){return JSON.stringify(n)}},JSON\u53D6\u5F97:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n){return JSON.parse(n)}},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)}}};var xt={\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}},\u6B63\u898F\u8868\u73FE\u62BD\u51FA:{type:"func",josi:[["\u304B\u3089","\u3092"],["\u3067"]],pure:!0,fn:function(n,e,t){let r=""+e,s="g",i=r.match(/^\/(.+)\/([a-zA-Z]*)$/);i&&(r=i[1],s=i[2]||""),s.includes("g")||(s+="g");let o=new RegExp(r,s),u=t.__getSysVar("\u62BD\u51FA\u6587\u5B57\u5217");u.splice(0,u.length);let c=[],a=[];for(let f of String(n).matchAll(o)){if(f.groups&&Object.keys(f.groups).length>0){let p={};for(let[h,d]of Object.entries(f.groups))p[h]=d,c.push(d);a.push(p);continue}let l=[...f].slice(1);l.length===0&&(l=[f[0]]),a.push(l),c.push(...l)}if(a.length===0)return c;for(let f of a)u.push(f);return c}},\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)}}};var $t={\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}}};var At={\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+`
|
|
434
|
+
`),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}};var Nt={\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 q||(o=new q(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}};var E={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.pathSeparator="/",sys.engine="?",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){if(n instanceof SyntaxError&&n.message.includes("return"))try{return new Function("sys",`return (function(sys){
|
|
456
435
|
${src}
|
|
457
436
|
})(sys)`)(sys)}catch(e){return console.warn("[eval]",e),null}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:`
|
|
458
437
|
`},\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:`
|
|
459
|
-
`},\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"}},\
|
|
460
|
-
`),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,asyncFn:!0,fn:async function(n,e){let t={resetEnv:!1,resetAll:!0,nakoGlobal:e},r=String(e.__getSysVar("\u8868\u793A\u30ED\u30B0",""));e.__setSysVar("\u8868\u793A\u30ED\u30B0",""),await e.__self.runAsync(n,e.__modName,t);let s=String(e.__getSysVar("\u8868\u793A\u30ED\u30B0"));return e.__setSysVar("\u8868\u793A\u30ED\u30B0",r+s),s}},\u30CA\u30C7\u30B7\u30B3\u7D9A:{type:"func",josi:[["\u3092","\u3067"]],pure:!1,asyncFn:!0,fn:async function(n,e){let t={resetEnv:!1,resetAll:!1,nakoGlobal:e.__self},r=e.__getSysVar("\u8868\u793A\u30ED\u30B0","");e.__setSysVar("\u8868\u793A\u30ED\u30B0",""),await e.__self.runAsync(n,e.__modName,t);let s=String(e.__getSysVar("\u8868\u793A\u30ED\u30B0"));return s&&e.logger.trace(s),e.__setSysVar("\u8868\u793A\u30ED\u30B0",r+s),s}},\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)+`
|
|
461
|
-
`}},\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){if(typeof e=="string"&&(e=parseInt(e)),typeof t=="string"&&(t=parseInt(t)),t<=0)return"";let r=Array.from(n);return e<0&&(e=r.length+e+1,e<0&&(e=1)),r.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("")}},\u6587\u5B57\u59CB:{type:"func",josi:[["\u304C"],["\u3067","\u304B\u3089"]],pure:!0,fn:function(n,e){return n.startsWith(e)}},\u6587\u5B57\u7D42:{type:"func",josi:[["\u304C"],["\u3067"]],pure:!0,fn:function(n,e){return n.endsWith(e)}},\u51FA\u73FE:{type:"func",josi:[["\u306B","\u3067"],["\u304C"]],pure:!0,fn:function(n,e){return typeof n=="string"||n instanceof Array?n.includes(e):String(n).includes(e)}},\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\u5909\u63DB:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n){return JSON.stringify(n)}},JSON\u53D6\u5F97:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n){return JSON.parse(n)}},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}},\u6B63\u898F\u8868\u73FE\u62BD\u51FA:{type:"func",josi:[["\u304B\u3089","\u3092"],["\u3067"]],pure:!0,fn:function(n,e,t){let r=""+e,s="g",i=r.match(/^\/(.+)\/([a-zA-Z]*)$/);i&&(r=i[1],s=i[2]||""),s.includes("g")||(s+="g");let o=new RegExp(r,s),u=t.__getSysVar("\u62BD\u51FA\u6587\u5B57\u5217");u.splice(0,u.length);let c=[],a=[];for(let f of String(n).matchAll(o)){if(f.groups&&Object.keys(f.groups).length>0){let p={};for(let[h,d]of Object.entries(f.groups))p[h]=d,c.push(d);a.push(p);continue}let l=[...f].slice(1);l.length===0&&(l=[f[0]]),a.push(l),c.push(...l)}if(a.length===0)return c;for(let f of a)u.push(f);return c}},\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 n===""?!1: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(`
|
|
462
|
-
`).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(`
|
|
463
|
-
`).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 G||(o=new G(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)/(3600*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)/3600)}},\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")}},\u62E1\u5F35\u5B50\u62BD\u51FA:{type:"func",josi:[["\u304B\u3089","\u306E"]],pure:!0,fn:function(n,e){if(n==null)return"";let t=e.pathSeparator||"/";if(n.indexOf(t)>=0){let s=n.split(t);n=s[s.length-1]}let r=n.match(/(\.[a-zA-Z0-9_\-+]+)$/);return r?r[1]:""}},\u62E1\u5F35\u5B50\u5909\u66F4:{type:"func",josi:[["\u306E","\u3092","\u304B\u3089"],["\u306B","\u3078"]],pure:!0,fn:function(n,e,t){if(n==null)return e;let r=t.pathSeparator||"/",s=n.split(r),i=s[s.length-1],o=s.slice(0,-1).join(r),u=(e??"").trim(),c=u;u!==""&&(c=u.startsWith(".")?u:"."+u);let a=i.replace(/(\.[a-zA-Z0-9_\-+]+)?$/,c);return t.__exec("\u7D42\u7AEF\u30D1\u30B9\u8FFD\u52A0",[o,t])+a}},\u7D42\u7AEF\u30D1\u30B9\u8FFD\u52A0:{type:"func",josi:[["\u306B","\u3078"]],pure:!0,fn:function(n,e){let t=e.pathSeparator||"/";return n==null||n===""?"":n.endsWith(t)?n:n+t}},\u7D42\u7AEF\u30D1\u30B9\u9664\u53BB:{type:"func",josi:[["\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){let t=e.pathSeparator||"/";return n?n.endsWith(t)?n.substring(0,n.length-1):n:""}},\u7D42\u7AEF\u30D1\u30B9\u524A\u9664:{type:"func",josi:[["\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){return e.__exec("\u7D42\u7AEF\u30D1\u30B9\u9664\u53BB",[n,e])}},\u30D5\u30A1\u30A4\u30EB\u540D\u62BD\u51FA:{type:"func",josi:[["\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){let t=e.pathSeparator||"/",r=n.split(t);return r[r.length-1]}},\u30D1\u30B9\u62BD\u51FA:{type:"func",josi:[["\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){let t=e.pathSeparator||"/",r=n.split(t);return r.pop(),r.join(t)}}};var st={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 O={delimiter:",",eol:`\r
|
|
464
|
-
`,auto_convert_number:!0};function an(n){return/^-?\d+(\.\d+)?([eE][-+]?\d+)?$/.test(n)}function Te(n,e=void 0){e===void 0&&(e=O.delimiter),n=""+n+`
|
|
438
|
+
`},\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"}},\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}}};Object.assign(E,_t);Object.assign(E,mt);Object.assign(E,bt);Object.assign(E,kt);Object.assign(E,vt);Object.assign(E,wt);Object.assign(E,St);Object.assign(E,jt);Object.assign(E,xt);Object.assign(E,$t);Object.assign(E,At);Object.assign(E,Nt);var Ot=E;var Ft={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 F={delimiter:",",eol:`\r
|
|
439
|
+
`,auto_convert_number:!0};function Mn(n){return/^-?\d+(\.\d+)?([eE][-+]?\d+)?$/.test(n)}function Ge(n,e=void 0){e===void 0&&(e=F.delimiter),n=""+n+`
|
|
465
440
|
`,n=n.replace(/(\r\n|\r)/g,`
|
|
466
441
|
`),n=n.replace(/\s+$/,"")+`
|
|
467
|
-
`;let t="^(.*?)([\\"+e+"\\n])",r=new RegExp(t),s=function(c){let a=c;return typeof c=="string"&&
|
|
468
|
-
`){o.push(""),i.push(o),o=[],n=n.substring(1);continue}if(n=n.replace(/^\s+/,""),u=n.charAt(0),u===e){
|
|
442
|
+
`;let t="^(.*?)([\\"+e+"\\n])",r=new RegExp(t),s=function(c){let a=c;return typeof c=="string"&&F.auto_convert_number&&Mn(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===`
|
|
443
|
+
`){o.push(""),i.push(o),o=[],n=n.substring(1);continue}if(n=n.replace(/^\s+/,""),u=n.charAt(0),u===e){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]===`
|
|
469
444
|
`?(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===`
|
|
470
|
-
`){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
|
|
471
|
-
`)>=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
|
|
445
|
+
`){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 oe(n,e=void 0,t=void 0){e===void 0&&(e=F.delimiter),t===void 0&&(t=F.eol);let r=Vn(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 Vn(n){return function(e){e=""+e;let t=!1;return(e.indexOf(`
|
|
446
|
+
`)>=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 Pn={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 F.delimiter=",",Ge(n)}},TSV\u53D6\u5F97:{type:"func",josi:[["\u3092","\u306E","\u3067"]],pure:!0,fn:function(n){return F.delimiter=" ",Ge(n)}},\u8868CSV\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return F.delimiter=",",oe(n)}},CSV\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return F.delimiter=",",oe(n)}},\u8868TSV\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return F.delimiter=" ",oe(n)}},TSV\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(n){return F.delimiter=" ",oe(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"?F.delimiter=t:e==="eol"?F.eol=t:e==="auto_convert_number"&&(F.auto_convert_number=t)}},return_none:!0}},Ct=Pn;var Et={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===void 0)&&(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 In=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,Q=class n extends Date{#t=!1;#n=!1;#e=null;constructor(e){let t=!0,r=!0,s="Z";if(typeof e=="string"){let i=e.match(In);i?(i[1]||(t=!1,e=`0000-01-01T${e}`),r=!!i[2],r&&e[10]===" "&&(e=e.replace(" ","T")),i[2]&&+i[2]>23?e="":(s=i[3]||null,e=e.toUpperCase(),!s&&r&&(e+="Z"))):e=""}super(e),isNaN(this.getTime())||(this.#t=t,this.#n=r,this.#e=s)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#e===null)return e.slice(0,-1);if(this.#e==="Z")return e;let t=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return t=this.#e[0]==="-"?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(e,t="Z"){let r=new n(e);return r.#e=t,r}static wrapAsLocalDateTime(e){let t=new n(e);return t.#e=null,t}static wrapAsLocalDate(e){let t=new n(e);return t.#n=!1,t.#e=null,t}static wrapAsLocalTime(e){let t=new n(e);return t.#t=!1,t.#e=null,t}};function Ln(n,e){let t=n.slice(0,e).split(/\r\n|\n|\r/g);return[t.length,t.pop().length+1]}function Dn(n,e,t){let r=n.split(/\r\n|\n|\r/g),s="",i=(Math.log10(e+1)|0)+1;for(let o=e-1;o<=e+1;o++){let u=r[o-1];u&&(s+=o.toString().padEnd(i," "),s+=": ",s+=u,s+=`
|
|
472
447
|
`,o===e&&(s+=" ".repeat(i+t+2),s+=`^
|
|
473
|
-
`))}return s}var
|
|
448
|
+
`))}return s}var k=class extends Error{line;column;codeblock;constructor(e,t){let[r,s]=Ln(t.toml,t.ptr),i=Dn(t.toml,r,s);super(`Invalid TOML document: ${e}
|
|
474
449
|
|
|
475
|
-
${i}`,t),this.line=r,this.column=s,this.codeblock=i}};function
|
|
476
|
-
|
|
450
|
+
${i}`,t),this.line=r,this.column=s,this.codeblock=i}};var Jn=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,Rn=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Gn=/^[+-]?0[0-9_]/;function Ne(n,e){let t=n[e++],r=t,s=t==="'",i=t===n[e]&&t===n[e+1];i&&(n[e+=2]===`
|
|
451
|
+
`?e++:n[e]==="\r"&&n[e+1]===`
|
|
452
|
+
`&&(e+=2));let o="",u=e,c=0;for(let a=e;a<n.length;a++)if(t=n[a],i&&(t===`
|
|
453
|
+
`||t==="\r"&&n[a+1]===`
|
|
454
|
+
`))c=c&&3;else{if(t<" "&&t!==" "||t==="\x7F")throw new k("control characters are not allowed in strings",{toml:n,ptr:a});if((!c||c===3)&&t===r&&(!i||n[a+1]===r&&n[a+2]===r))return i&&(n[a+3]===r&&a++,n[a+3]===r&&a++),[c?o:o+n.slice(u,a),a+(i?3:1)];if(!c)!s&&t==="\\"&&(o+=n.slice(u,u=a),c=1);else if(c===1)if(t==="x"||t==="u"||t==="U"){let f=0,l=t==="x"?2:t==="u"?4:8;for(let p=0;p<l;p++,a++){let h=n.charCodeAt(a+1),d=h>=48&&h<=57?h-48:h>=65&&h<=70?h-65+10:h>=97&&h<=102?h-97+10:-1;if(d<0)throw new k("invalid non-hex character in unicode escape",{toml:n,ptr:a+1});f=f<<4|d}if(f<0||f>1114111||f>=55296&&f<=57343)throw new k("invalid unicode escape",{toml:n,ptr:a});o+=String.fromCodePoint(f),u=a+1,c=0}else if(t===" "||t===" ")c=2;else{if(t==="b")o+="\b";else if(t==="t")o+=" ";else if(t==="n")o+=`
|
|
455
|
+
`;else if(t==="f")o+="\f";else if(t==="r")o+="\r";else if(t==="e")o+="\x1B";else if(t==='"')o+='"';else if(t==="\\")o+="\\";else throw new k("unrecognized escape sequence",{toml:n,ptr:a});u=a+1,c=0}else if(t!==" "&&t!==" "){if(c===2)throw new k("invalid escape: only line-ending whitespace may be escaped",{toml:n,ptr:u});c=!s&&t==="\\"?1:0,u=a}}throw new k("unfinished string",{toml:n,ptr:e})}function Tt(n,e,t,r){if(n==="true")return!0;if(n==="false")return!1;if(n==="-inf")return-1/0;if(n==="inf"||n==="+inf")return 1/0;if(n==="nan"||n==="+nan"||n==="-nan")return NaN;if(n==="-0")return r?0n:0;let s=Jn.test(n);if(s||Rn.test(n)){if(Gn.test(n))throw new k("leading zeroes are not allowed",{toml:e,ptr:t});n=n.replace(/_/g,"");let o=+n;if(isNaN(o))throw new k("invalid number",{toml:e,ptr:t});if(s){if((s=!Number.isSafeInteger(o))&&!r)throw new k("integer value cannot be represented losslessly",{toml:e,ptr:t});(s||r===!0)&&(o=BigInt(n))}return o}let i=new Q(n);if(!i.isValid())throw new k("invalid value",{toml:e,ptr:t});return i}function Oe(n,e=0,t=n.length){let r=n.indexOf(`
|
|
456
|
+
`,e);return n[r-1]==="\r"&&r--,r<=t?r:-1}function ee(n,e){for(let t=e;t<n.length;t++){let r=n[t];if(r===`
|
|
477
457
|
`)return t;if(r==="\r"&&n[t+1]===`
|
|
478
|
-
`)return t+1;if(r<" "&&r!==" "||r==="\x7F")throw new
|
|
458
|
+
`)return t+1;if(r<" "&&r!==" "||r==="\x7F")throw new k("control characters are not allowed in comments",{toml:n,ptr:e})}return n.length}function L(n,e,t,r){let s;for(;;){for(;(s=n[e])===" "||s===" "||!t&&(s===`
|
|
479
459
|
`||s==="\r"&&n[e+1]===`
|
|
480
|
-
`);)e++;if(r||s!=="#")break;e=
|
|
460
|
+
`);)e++;if(r||s!=="#")break;e=ee(n,e)}return e}function Mt(n,e,t,r,s=!1){if(!r)return e=Oe(n,e),e<0?n.length:e;for(let i=e;i<n.length;i++){let o=n[i];if(o==="#"){if(i=Oe(n,i),i<0)break}else{if(o===t)return i+1;if(o===r||s&&(o===`
|
|
481
461
|
`||o==="\r"&&n[i+1]===`
|
|
482
|
-
`))return i}}throw new
|
|
483
|
-
|
|
484
|
-
`&&e
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
`||a===" "||a===" "||a==="\r")){if(e=C(n,e-1,!0),n[e]!==`
|
|
488
|
-
`&&n[e]!=="\r")throw new w("invalid escape: only line-ending whitespace may be escaped",{toml:n,ptr:i});e=C(n,e)}else if(a in ct)u+=ct[a];else throw new w("unrecognized escape sequence",{toml:n,ptr:i});c=e}else!r&&a==="\\"&&(i=e-1,o=!0,u+=n.slice(c,i))}return u+n.slice(c,t-1)}function at(n,e,t,r){if(n==="true")return!0;if(n==="false")return!1;if(n==="-inf")return-1/0;if(n==="inf"||n==="+inf")return 1/0;if(n==="nan"||n==="+nan"||n==="-nan")return NaN;if(n==="-0")return r?0n:0;let s=_n.test(n);if(s||mn.test(n)){if(gn.test(n))throw new w("leading zeroes are not allowed",{toml:e,ptr:t});n=n.replace(/_/g,"");let o=+n;if(isNaN(o))throw new w("invalid number",{toml:e,ptr:t});if(s){if((s=!Number.isSafeInteger(o))&&!r)throw new w("integer value cannot be represented losslessly",{toml:e,ptr:t});(s||r===!0)&&(o=BigInt(n))}return o}let i=new K(n);if(!i.isValid())throw new w("invalid value",{toml:e,ptr:t});return i}function kn(n,e,t){let r=n.slice(e,t),s=r.indexOf("#");return s>-1&&(H(n,s),r=r.slice(0,s)),[r.trimEnd(),s]}function re(n,e,t,r,s){if(r===0)throw new w("document contains excessively nested structures. aborting.",{toml:n,ptr:e});let i=n[e];if(i==="["||i==="{"){let[c,a]=i==="["?lt(n,e,r,s):ft(n,e,r,s);if(t){if(a=C(n,a),n[a]===",")a++;else if(n[a]!==t)throw new w("expected comma or end of structure",{toml:n,ptr:a})}return[c,a]}let o;if(i==='"'||i==="'"){o=be(n,e);let c=ke(n,e,o);if(t){if(o=C(n,o),n[o]&&n[o]!==","&&n[o]!==t&&n[o]!==`
|
|
489
|
-
`&&n[o]!=="\r")throw new w("unexpected character encountered",{toml:n,ptr:o});o+=+(n[o]===",")}return[c,o]}o=ut(n,e,",",t);let u=kn(n,e,o-+(n[o-1]===","));if(!u[0])throw new w("incomplete key-value declaration: no value specified",{toml:n,ptr:e});return t&&u[1]>-1&&(o=C(n,e+u[1]),o+=+(n[o]===",")),[at(u[0],n,e,s),o]}var vn=/^[a-zA-Z0-9-_]+[ \t]*$/;function ve(n,e,t="="){let r=e-1,s=[],i=n.indexOf(t,e);if(i<0)throw new w("incomplete key-value: cannot find end of key",{toml:n,ptr:e});do{let o=n[e=++r];if(o!==" "&&o!==" ")if(o==='"'||o==="'"){if(o===n[e+1]&&o===n[e+2])throw new w("multiline strings are not allowed in keys",{toml:n,ptr:e});let u=be(n,e);if(u<0)throw new w("unfinished string encountered",{toml:n,ptr:e});r=n.indexOf(".",u);let c=n.slice(u,r<0||r>i?i:r),a=ge(c);if(a>-1)throw new w("newlines are not allowed in keys",{toml:n,ptr:e+r+a});if(c.trimStart())throw new w("found extra tokens after the string part",{toml:n,ptr:u});if(i<u&&(i=n.indexOf(t,u),i<0))throw new w("incomplete key-value: cannot find end of key",{toml:n,ptr:e});s.push(ke(n,e,u))}else{r=n.indexOf(".",e);let u=n.slice(e,r<0||r>i?i:r);if(!vn.test(u))throw new w("only letter, numbers, dashes and underscores are allowed in keys",{toml:n,ptr:e});s.push(u.trimEnd())}}while(r+1&&r<i);return[s,C(n,i+1,!0,!0)]}function ft(n,e,t,r){let s={},i=new Set,o;for(e++;(o=n[e++])!=="}"&&o;){if(o===",")throw new w("expected value, found comma",{toml:n,ptr:e-1});if(o==="#")e=H(n,e);else if(o!==" "&&o!==" "&&o!==`
|
|
490
|
-
`&&o!=="\r"){let u,c=s,a=!1,[f,l]=ve(n,e-1);for(let d=0;d<f.length;d++){if(d&&(c=a?c[u]:c[u]={}),u=f[d],(a=Object.hasOwn(c,u))&&(typeof c[u]!="object"||i.has(c[u])))throw new w("trying to redefine an already defined value",{toml:n,ptr:e});!a&&u==="__proto__"&&Object.defineProperty(c,u,{enumerable:!0,configurable:!0,writable:!0})}if(a)throw new w("trying to redefine an already defined value",{toml:n,ptr:e});let[p,h]=re(n,l,"}",t-1,r);i.add(p),c[u]=p,e=h}}if(!o)throw new w("unfinished table encountered",{toml:n,ptr:e});return[s,e]}function lt(n,e,t,r){let s=[],i;for(e++;(i=n[e++])!=="]"&&i;){if(i===",")throw new w("expected value, found comma",{toml:n,ptr:e-1});if(i==="#")e=H(n,e);else if(i!==" "&&i!==" "&&i!==`
|
|
491
|
-
`&&i!=="\r"){let o=re(n,e-1,"]",t-1,r);s.push(o[0]),e=o[1]}}if(!i)throw new w("unfinished array encountered",{toml:n,ptr:e});return[s,e]}function ht(n,e,t,r){let s=e,i=t,o,u=!1,c;for(let a=0;a<n.length;a++){if(a){if(s=u?s[o]:s[o]={},i=(c=i[o]).c,r===0&&(c.t===1||c.t===2))return null;if(c.t===2){let f=s.length-1;s=s[f],i=i[f].c}}if(o=n[a],(u=Object.hasOwn(s,o))&&i[o]?.t===0&&i[o]?.d)return null;u||(o==="__proto__"&&(Object.defineProperty(s,o,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(i,o,{enumerable:!0,configurable:!0,writable:!0})),i[o]={t:a<n.length-1&&r===2?3:r,d:!1,i:0,c:{}})}if(c=i[o],c.t!==r&&!(r===1&&c.t===3)||(r===2&&(c.d||(c.d=!0,s[o]=[]),s[o].push(s={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,r===1)s=u?s[o]:s[o]={};else if(r===0&&u)return null;return[o,s,c.c]}function pt(n,{maxDepth:e=1e3,integersAsBigInt:t}={}){let r={},s={},i=r,o=s;for(let u=C(n,0);u<n.length;){if(n[u]==="["){let c=n[++u]==="[",a=ve(n,u+=+c,"]");if(c){if(n[a[1]-1]!=="]")throw new w("expected end of table declaration",{toml:n,ptr:a[1]-1});a[1]++}let f=ht(a[0],r,s,c?2:1);if(!f)throw new w("trying to redefine an already defined table or value",{toml:n,ptr:u});o=f[2],i=f[1],u=a[1]}else{let c=ve(n,u),a=ht(c[0],i,o,0);if(!a)throw new w("trying to redefine an already defined table or value",{toml:n,ptr:u});let f=re(n,c[1],void 0,e,t);a[1][a[0]]=f[0],u=f[1]}if(u=C(n,u,!0),n[u]&&n[u]!==`
|
|
492
|
-
`&&n[u]!=="\r")throw new w("each key-value declaration must be followed by an end-of-line",{toml:n,ptr:u});u=C(n,u)}return r}var dt=/^[a-z0-9-_]+$/i;function se(n){let e=typeof n;if(e==="object"){if(Array.isArray(n))return"array";if(n instanceof Date)return"date"}return e}function wn(n){for(let e=0;e<n.length;e++)if(se(n[e])!=="object")return!1;return n.length!=0}function Me(n){return JSON.stringify(n).replace(/\x7f/g,"\\u007f")}function Ve(n,e,t,r){if(t===0)throw new Error("Could not stringify the object: maximum object depth exceeded");if(e==="number")return isNaN(n)?"nan":n===1/0?"inf":n===-1/0?"-inf":r&&Number.isInteger(n)?n.toFixed(1):n.toString();if(e==="bigint"||e==="boolean")return n.toString();if(e==="string")return Me(n);if(e==="date"){if(isNaN(n.getTime()))throw new TypeError("cannot serialize invalid date");return n.toISOString()}if(e==="object")return Sn(n,t,r);if(e==="array")return jn(n,t,r)}function Sn(n,e,t){let r=Object.keys(n);if(r.length===0)return"{}";let s="{ ";for(let i=0;i<r.length;i++){let o=r[i];i&&(s+=", "),s+=dt.test(o)?o:Me(o),s+=" = ",s+=Ve(n[o],se(n[o]),e-1,t)}return s+" }"}function jn(n,e,t){if(n.length===0)return"[]";let r="[ ";for(let s=0;s<n.length;s++){if(s&&(r+=", "),n[s]===null||n[s]===void 0)throw new TypeError("arrays cannot contain null or undefined values");r+=Ve(n[s],se(n[s]),e-1,t)}return r+" ]"}function xn(n,e,t,r){if(t===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let s="";for(let i=0;i<n.length;i++)s+=`${s&&`
|
|
462
|
+
`))return i}}throw new k("cannot find end of structure",{toml:n,ptr:e})}function Bn(n,e,t){let r=n.slice(e,t),s=r.indexOf("#");return s>-1&&(ee(n,s),r=r.slice(0,s)),[r.trimEnd(),s]}function ue(n,e,t,r,s){if(r===0)throw new k("document contains excessively nested structures. aborting.",{toml:n,ptr:e});let i=n[e];if(i==="["||i==="{"){let[c,a]=i==="["?Pt(n,e,r,s):Vt(n,e,r,s);if(t){if(a=L(n,a),n[a]===",")a++;else if(n[a]!==t)throw new k("expected comma or end of structure",{toml:n,ptr:a})}return[c,a]}if(i==='"'||i==="'"){let[c,a]=Ne(n,e);if(t){if(a=L(n,a),n[a]&&n[a]!==","&&n[a]!==t&&n[a]!==`
|
|
463
|
+
`&&n[a]!=="\r")throw new k("unexpected character encountered",{toml:n,ptr:a});n[a]===","&&a++}return[c,a]}let o=Mt(n,e,",",t),u=Bn(n,e,o-(n[o-1]===","?1:0));if(!u[0])throw new k("incomplete key-value declaration: no value specified",{toml:n,ptr:e});return t&&u[1]>-1&&(o=L(n,e+u[1]),n[o]===","&&o++),[Tt(u[0],n,e,s),o]}var qn=/^[a-zA-Z0-9-_]+[ \t]*$/;function Fe(n,e,t="="){let r=e-1,s=[],i=n.indexOf(t,e);if(i<0)throw new k("incomplete key-value: cannot find end of key",{toml:n,ptr:e});do{let o=n[e=++r];if(o!==" "&&o!==" ")if(o==='"'||o==="'"){if(o===n[e+1]&&o===n[e+2])throw new k("multiline strings are not allowed in keys",{toml:n,ptr:e});let[u,c]=Ne(n,e);r=n.indexOf(".",c);let a=n.slice(c,r<0||r>i?i:r),f=Oe(a);if(f>-1)throw new k("newlines are not allowed in keys",{toml:n,ptr:e+r+f});if(a.trimStart())throw new k("found extra tokens after the string part",{toml:n,ptr:c});if(i<c&&(i=n.indexOf(t,c),i<0))throw new k("incomplete key-value: cannot find end of key",{toml:n,ptr:e});s.push(u)}else{r=n.indexOf(".",e);let u=n.slice(e,r<0||r>i?i:r);if(!qn.test(u))throw new k("only letter, numbers, dashes and underscores are allowed in keys",{toml:n,ptr:e});s.push(u.trimEnd())}}while(r+1&&r<i);return[s,L(n,i+1,!0,!0)]}function Vt(n,e,t,r){let s={},i=new Set,o;for(e++;(o=n[e++])!=="}"&&o;){if(o===",")throw new k("expected value, found comma",{toml:n,ptr:e-1});if(o==="#")e=ee(n,e);else if(o!==" "&&o!==" "&&o!==`
|
|
464
|
+
`&&o!=="\r"){let u,c=s,a=!1,[f,l]=Fe(n,e-1);for(let d=0;d<f.length;d++){if(d&&(c=a?c[u]:c[u]={}),u=f[d],(a=Object.hasOwn(c,u))&&(typeof c[u]!="object"||i.has(c[u])))throw new k("trying to redefine an already defined value",{toml:n,ptr:e});!a&&u==="__proto__"&&Object.defineProperty(c,u,{enumerable:!0,configurable:!0,writable:!0})}if(a)throw new k("trying to redefine an already defined value",{toml:n,ptr:e});let[p,h]=ue(n,l,"}",t-1,r);i.add(p),c[u]=p,e=h}}if(!o)throw new k("unfinished table encountered",{toml:n,ptr:e});return[s,e]}function Pt(n,e,t,r){let s=[],i;for(e++;(i=n[e++])!=="]"&&i;){if(i===",")throw new k("expected value, found comma",{toml:n,ptr:e-1});if(i==="#")e=ee(n,e);else if(i!==" "&&i!==" "&&i!==`
|
|
465
|
+
`&&i!=="\r"){let o=ue(n,e-1,"]",t-1,r);s.push(o[0]),e=o[1]}}if(!i)throw new k("unfinished array encountered",{toml:n,ptr:e});return[s,e]}function It(n,e,t,r){let s=e,i=t,o,u=!1,c;for(let a=0;a<n.length;a++){if(a){if(s=u?s[o]:s[o]={},i=(c=i[o]).c,r===0&&(c.t===1||c.t===2))return null;if(c.t===2){let f=s.length-1;s=s[f],i=i[f].c}}if(o=n[a],(u=Object.hasOwn(s,o))&&i[o]?.t===0&&i[o]?.d)return null;u||(o==="__proto__"&&(Object.defineProperty(s,o,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(i,o,{enumerable:!0,configurable:!0,writable:!0})),i[o]={t:a<n.length-1&&r===2?3:r,d:!1,i:0,c:{}})}if(c=i[o],c.t!==r&&!(r===1&&c.t===3)||(r===2&&(c.d||(c.d=!0,s[o]=[]),s[o].push(s={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,r===1)s=u?s[o]:s[o]={};else if(r===0&&u)return null;return[o,s,c.c]}function Lt(n,{maxDepth:e=1e3,integersAsBigInt:t}={}){let r={},s={},i=r,o=s;for(let u=L(n,0);u<n.length;){if(n[u]==="["){let c=n[++u]==="[",a=Fe(n,u+=+c,"]");if(c){if(n[a[1]-1]!=="]")throw new k("expected end of table declaration",{toml:n,ptr:a[1]-1});a[1]++}let f=It(a[0],r,s,c?2:1);if(!f)throw new k("trying to redefine an already defined table or value",{toml:n,ptr:u});o=f[2],i=f[1],u=a[1]}else{let c=Fe(n,u),a=It(c[0],i,o,0);if(!a)throw new k("trying to redefine an already defined table or value",{toml:n,ptr:u});let f=ue(n,c[1],void 0,e,t);a[1][a[0]]=f[0],u=f[1]}if(u=L(n,u,!0),n[u]&&n[u]!==`
|
|
466
|
+
`&&n[u]!=="\r")throw new k("each key-value declaration must be followed by an end-of-line",{toml:n,ptr:u});u=L(n,u)}return r}var Dt=/^[a-z0-9-_]+$/i;function ce(n){let e=typeof n;if(e==="object"){if(Array.isArray(n))return"array";if(n instanceof Date)return"date"}return e}function Wn(n){for(let e=0;e<n.length;e++)if(ce(n[e])!=="object")return!1;return n.length!=0}function Be(n){return JSON.stringify(n).replace(/\x7f/g,"\\u007f")}function qe(n,e,t,r){if(t===0)throw new Error("Could not stringify the object: maximum object depth exceeded");if(e==="number")return isNaN(n)?"nan":n===1/0?"inf":n===-1/0?"-inf":Number.isInteger(n)&&(r||!Number.isSafeInteger(n))?n.toFixed(1):n.toString();if(e==="bigint"||e==="boolean")return n.toString();if(e==="string")return Be(n);if(e==="date"){if(isNaN(n.getTime()))throw new TypeError("cannot serialize invalid date");return n.toISOString()}if(e==="object")return Un(n,t,r);if(e==="array")return zn(n,t,r)}function Un(n,e,t){let r=Object.keys(n);if(r.length===0)return"{}";let s="{ ";for(let i=0;i<r.length;i++){let o=r[i];i&&(s+=", "),s+=Dt.test(o)?o:Be(o),s+=" = ",s+=qe(n[o],ce(n[o]),e-1,t)}return s+" }"}function zn(n,e,t){if(n.length===0)return"[]";let r="[ ";for(let s=0;s<n.length;s++){if(s&&(r+=", "),n[s]===null||n[s]===void 0)throw new TypeError("arrays cannot contain null or undefined values");r+=qe(n[s],ce(n[s]),e-1,t)}return r+" ]"}function Xn(n,e,t,r){if(t===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let s="";for(let i=0;i<n.length;i++)s+=`${s&&`
|
|
493
467
|
`}[[${e}]]
|
|
494
|
-
`,s+=
|
|
495
|
-
`)+
|
|
496
|
-
`)+
|
|
468
|
+
`,s+=We(0,n[i],e,t,r);return s}function We(n,e,t,r,s){if(r===0)throw new Error("Could not stringify the object: maximum object depth exceeded");let i="",o="",u=Object.keys(e);for(let c=0;c<u.length;c++){let a=u[c];if(e[a]!==null&&e[a]!==void 0){let f=ce(e[a]);if(f==="symbol"||f==="function")throw new TypeError(`cannot serialize values of type '${f}'`);let l=Dt.test(a)?a:Be(a);if(f==="array"&&Wn(e[a]))o+=(o&&`
|
|
469
|
+
`)+Xn(e[a],t?`${t}.${l}`:l,r-1,s);else if(f==="object"){let p=t?`${t}.${l}`:l;o+=(o&&`
|
|
470
|
+
`)+We(p,e[a],p,r-1,s)}else i+=l,i+=" = ",i+=qe(e[a],f,r,s),i+=`
|
|
497
471
|
`}}return n&&(i||!o)&&(i=i?`[${n}]
|
|
498
472
|
${i}`:`[${n}]`),i&&o?`${i}
|
|
499
|
-
${o}`:i||o}function
|
|
473
|
+
${o}`:i||o}function Jt(n,{maxDepth:e=1e3,numbersAsFloat:t=!1}={}){if(ce(n)!=="object")throw new TypeError("stringify can only be called with an object");let r=We(0,n,"",e,t);return r[r.length-1]!==`
|
|
500
474
|
`?r+`
|
|
501
|
-
`:r}var
|
|
502
|
-
`+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"?_.fromNode(o.message,s.tokens[this.parser.getIndex()]):o}return this.usedFuncs=this.parser.usedFuncs,this.deleteUnNakoFuncs(),this.logger.trace(`--- ast ---
|
|
503
|
-
`+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=J();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=J());try{r.resetEnv&&this.reset(),r.resetAll&&this.clearPlugins(),this.eventList.filter(u=>u.eventName==="beforeParse").map(u=>u.callback(e));let s=this.parse(e,t,r.preCode);this.eventList.filter(u=>u.eventName==="beforeGenerate").map(u=>u.callback(s));let i=new Q(r.testOnly),o=this.generateCode(s,i);return this.eventList.filter(u=>u.eventName==="afterGenerate").map(u=>u.callback(o)),o}catch(s){throw this.logger.error(s),s}}generateCode(e,t,r="sync"){if(r==="sync")return ze(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=J({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=J(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=J(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 me(this,t,this.__globals.length+1),s.__varslist[0].set("\u540D\u524D\u7A7A\u9593",T.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=J();return i.preCode=r,i.testOnly=s,this.runSync(e,t,i)}run(e,t="main.nako3",r=""){let s=J();return s.preCode=r,this.runSync(e,t,s)}compileStandalone(e,t,r){r===void 0&&(r=new Q);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 p=((c.nakoVersion||"0.0.0")+".0.0").split(".").map(h=>parseInt(h));o=p[1]*100+p[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,gt>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: ${gt}/\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]=Le(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=J({resetAll:!0,resetEnv:!0,preCode:r});return this.runAsync(e,t,s)}newVaiables(e){return new Map(e)}};var bt={\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 kt={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");t===""&&(t={method:"GET"});let r=await fetch(n,t),s=await r.text(),i=r.status,o=r.headers.get("Content-Length");return(!s||s.trim()==="")&&(i===204||i===205||o==="0")?null:JSON.parse(s)},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 vt={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 wt={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 An=[bt,kt,vt,wt],St={\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}}};An.forEach(n=>{let e={};Object.assign(e,n),typeof e.\u521D\u671F\u5316<"u"&&delete e.\u521D\u671F\u5316,Object.assign(St,e)});var jt=St;var Nn={\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}},xt=Nn;var De=class extends we{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 De,e=n;n.addPluginObject("PluginBrowserInWorker",jt),n.addPluginObject("PluginWorker",xt),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}}}})();
|
|
475
|
+
`:r}var Ue={parse:Lt,stringify:Jt,TomlDate:Q,TomlError:k};var Kn={meta:{type:"const",value:{pluginName:"plugin_toml",description:"TOML\u5F62\u5F0F\u306E\u30C7\u30FC\u30BF\u8AAD\u307F\u66F8\u304D\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.7.6",nakoRuntime:["wnako","cnako"],nakoVersion:"3.7.6"}},\u521D\u671F\u5316:{type:"func",josi:[],pure:!0,fn:function(n){}},TOML\u53D6\u5F97:{type:"func",josi:[["\u3092","\u306E","\u304B\u3089"]],pure:!0,fn:function(n,e){return Ue.parse(n)}},TOML\u5909\u63DB:{type:"func",josi:[["\u3092","\u304B\u3089","\u306E"]],pure:!0,fn:function(n,e){return Ue.stringify(n)}}},Rt=Kn;var Gt={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 Yn=[Ot,Ft,Et,Gt,Ct,Rt];function Bt(n){for(let e of Yn)n.addPlugin(e)}var Hn={version:"3.7.22",major:3,minor:7,patch:22},ze=Hn;var Ce=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=ze.version,this.coreVersion=ze.version,this.funclist=this.newVaiables(),this.moduleExport=this.newVaiables(),this.nakoFuncList=this.newVaiables(),this.codeGenerateor={},this.debugOption={useDebug:!1,waitTime:0},this.logger=new se,this.filename="main.nako3",this.events=new Ae;let t={getFuncList:()=>this.funclist,getSysVars:()=>this.__varslist[0],getLogger:()=>this.logger};this.pluginManager=new me(t),this.__module=this.pluginManager.modules;let r={rawtokenize:(i,o,u,c)=>this.rawtokenize(i,o,u,c),addPluginFromFile:(i,o,u)=>this.addPluginFromFile(i,o,u),getLogger:()=>this.logger,createScanner:()=>new n({useBasicPlugin:!0}),countFailure:()=>{this.numFailures++}};this.requireLoader=new _e(r);let s={compileFromCode:(i,o,u)=>this.compileFromCode(i,o,u),createNakoGlobal:(i,o)=>new ge(this,i,o),getLogger:()=>this.logger,fireEvent:(i,o)=>{this.events.fire(i,o)}};this.runner=new $e(s),this.usedFuncs=new Set,this.numFailures=0,e.useBasicPlugin&&this.addBasicPlugins(),this.parser=new ye(this.logger),this.tokenizer=new xe({getLogger:()=>this.logger,replaceRequireStatements:(i,o)=>this.replaceRequireStatements(i,o),removeRequireStatements:i=>this.removeRequireStatements(i)}),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))}get lexer(){return this.tokenizer.lexer}get eventList(){return this.events.getEventList()}get __globals(){return this.runner.globals}set __globals(e){this.runner.globals=e}get __globalObj(){return this.runner.currentGlobal}set __globalObj(e){this.runner.currentGlobal=e}getModList(){return this.tokenizer.getModList()}getLogger(){return this.logger}getNakoFuncList(){return this.nakoFuncList}getNakoFunc(e){return this.nakoFuncList.get(e)}getPluginfiles(){return this.pluginManager.pluginfiles}get dependencies(){return this.requireLoader.dependencies}addBasicPlugins(){Bt(this)}replaceLogger(){return this.lexer.logger=this.parser.logger=this.logger=new se}static listRequireStatements(e){return ie(e)}_loadDependencies(e,t,r,s){return this.requireLoader.load(e,t,r,s)}rawtokenize(e,t,r,s=""){return this.tokenizer.rawtokenize(e,t,r,s)}converttoken(e,t,r){return this.tokenizer.converttoken(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=this.pluginManager.createFuncListFromPlugins(this.__v0),this.lexer.setFuncList(this.funclist),this.moduleExport=new Map,this.lexer.setModuleExport(this.moduleExport),this.logger.clear()}lexCodeToken(e,t,r,s){return this.tokenizer.lexCodeToken(e,t,r,s)}replaceRequireStatements(e,t=new Set){return this.requireLoader.replaceRequireStatements(e,t)}removeRequireStatements(e){return this.requireLoader.removeRequireStatements(e)}lex(e,t="main.nako3",r="",s=!1){return this.tokenizer.lex(e,t,r,s)}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"?y.fromNode(o.message,s.tokens[this.parser.getIndex()]):o}return this.usedFuncs=this.parser.usedFuncs,this.deleteUnNakoFuncs(),this.logger.trace(`--- ast ---
|
|
476
|
+
`+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.pluginManager.hasCommand(e)||this.usedFuncs.delete(e);return this.usedFuncs}compile(e,t,r=!1,s=""){let i=I();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=I());try{r.resetEnv&&this.reset(),r.resetAll&&this.clearPlugins(),this.events.fire("beforeParse",e);let s=this.parse(e,t,r.preCode);this.events.fire("beforeGenerate",s);let i=new ne(r.testOnly),o=this.generateCode(s,i);return this.events.fire("afterGenerate",o),o}catch(s){throw this.logger.error(s),s}}generateCode(e,t,r="sync"){if(r==="sync")return ot(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=""){return this.runner.run(e,t,r,s,i)}clearPlugins(){this.runner.clearPlugins()}evalJS(e,t){this.runner.evalJS(e,t)}runSync(e,t,r=void 0){return this.runner.runSync(e,t,r)}async runAsync(e,t,r=void 0){return this.runner.runAsync(e,t,r)}getNakoGlobal(e,t,r){return this.runner.getNakoGlobal(e,t,r)}addListener(e,t){this.events.on(e,t)}test(e,t,r="",s=!1){return this.runner.test(e,t,r,s)}run(e,t="main.nako3",r=""){let s=I();return s.preCode=r,this.runSync(e,t,s)}compileStandalone(e,t,r){r===void 0&&(r=new ne);let s=this.parse(e,t);return this.generateCode(s,r).standalone}addPlugin(e,t=!0,r=""){this.pluginManager.addPlugin(e,t,r)}addPluginObject(e,t,r=!0){this.pluginManager.addPluginObject(e,t,r)}addPluginFile(e,t,r,s=!0){this.addPluginFromFile(t,r,s)}addPluginFromFile(e,t,r=!0){this.pluginManager.addPluginFromFile(e,t,r)}addFunc(e,t,r,s=!0,i=!1){this.pluginManager.addFunc(e,t,r,s,i)}setFunc(e,t,r,s=!0,i=!1){this.addFunc(e,t,r,s,i)}getFunc(e){return this.pluginManager.getFunc(e)}_runEx(e,t,r,s="",i=void 0){return this.runner.runEx(e,t,r,s,i)}runEx(e,t,r,s=""){return this._runEx(e,t,r,s)}async runReset(e,t="main.nako3",r=""){return this.runner.runReset(e,t,r)}newVaiables(e){return new Map(e)}};var qt={\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 Wt={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");t===""&&(t={method:"GET"});let r=await fetch(n,t),s=await r.text(),i=r.status,o=r.headers.get("Content-Length");return(!s||s.trim()==="")&&(i===204||i===205||o==="0")?null:JSON.parse(s)},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 Ut={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 zt={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 Zn=[qt,Wt,Ut,zt],Xt={\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}}};Zn.forEach(n=>{let e={};Object.assign(e,n),typeof e.\u521D\u671F\u5316<"u"&&delete e.\u521D\u671F\u5316,Object.assign(Xt,e)});var Kt=Xt;var Qn={\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}},Yt=Qn;var Xe=class extends Ce{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 Xe,e=n;n.addPluginObject("PluginBrowserInWorker",Kt),n.addPluginObject("PluginWorker",Yt),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}}}})();
|
|
504
477
|
/*! Bundled license information:
|
|
505
478
|
|
|
506
|
-
smol-toml/dist/error.js:
|
|
507
|
-
smol-toml/dist/util.js:
|
|
508
479
|
smol-toml/dist/date.js:
|
|
480
|
+
smol-toml/dist/error.js:
|
|
509
481
|
smol-toml/dist/primitive.js:
|
|
482
|
+
smol-toml/dist/util.js:
|
|
510
483
|
smol-toml/dist/extract.js:
|
|
511
484
|
smol-toml/dist/struct.js:
|
|
512
485
|
smol-toml/dist/parse.js:
|