nadesiko3 3.2.27
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/LICENSE +21 -0
- package/README.md +107 -0
- package/bin/cnako3 +10 -0
- package/bin/cnako3.bat +11 -0
- package/bin/nako3server.bat +6 -0
- package/demo/ace_editor.html +90 -0
- package/demo/ace_editor_tabs.html +162 -0
- package/demo/basic.html +71 -0
- package/demo/browsers.html +128 -0
- package/demo/css/basic.css +3 -0
- package/demo/css/common.css +157 -0
- package/demo/css/editor.css +8 -0
- package/demo/css/flow.css +3 -0
- package/demo/css/index.css +3 -0
- package/demo/extlib/ace@1.4.12/ace.js +17 -0
- package/demo/extlib/ace@1.4.12/ext-code_lens.min.js +1 -0
- package/demo/extlib/ace@1.4.12/ext-language_tools.min.js +1 -0
- package/demo/extlib/ace@1.4.12/ext-options.min.js +1 -0
- package/demo/extlib/ace@1.4.12/ext-settings_menu.js +8 -0
- package/demo/extlib/ace@1.4.12/keybinding-vscode.js +8 -0
- package/demo/extlib/ace@1.4.12/theme-monokai.js +8 -0
- package/demo/extlib/ace@1.4.12/theme-xcode.js +8 -0
- package/demo/extlib/chart.js@3.2.1/chart.min.js +13 -0
- package/demo/extlib/pure-min.css +11 -0
- package/demo/flow.html +97 -0
- package/demo/graph.html +53 -0
- package/demo/image/nako.png +0 -0
- package/demo/image/nakopad-icon256.png +0 -0
- package/demo/image/turtle.fla +0 -0
- package/demo/image/turtle.png +0 -0
- package/demo/index.html +134 -0
- package/demo/js/common.js +17 -0
- package/demo/js/turtle3d_test.js +44 -0
- package/demo/js/turtle_test.js +44 -0
- package/demo/runscript.html +47 -0
- package/demo/runscript2.html +33 -0
- package/demo/turtle.html +58 -0
- package/demo/turtle2.html +141 -0
- package/demo/turtle3.html +278 -0
- package/demo/turtle3d.html +58 -0
- package/demo/turtle3d2.html +107 -0
- package/demo/version.html +24 -0
- package/doc/SETUP.md +172 -0
- package/doc/about.md +34 -0
- package/doc/browsers.md +60 -0
- package/doc/docgen.md +21 -0
- package/doc/editor.md +44 -0
- package/doc/files.md +37 -0
- package/doc/plugins.md +195 -0
- package/doc/release.md +78 -0
- package/doc/win32.md +57 -0
- package/package.json +196 -0
- package/release/_hash.txt +65 -0
- package/release/_script-tags.txt +13 -0
- package/release/command.json +1 -0
- package/release/command.json.js +1 -0
- package/release/command_cnako3.json +1 -0
- package/release/command_list.json +1 -0
- package/release/editor.js +2 -0
- package/release/editor.js.LICENSE.txt +32 -0
- package/release/josi.json +48 -0
- package/release/nako_gen_async.js +1 -0
- package/release/nako_gen_async.js.LICENSE.txt +595 -0
- package/release/plugin_caniuse.js +1 -0
- package/release/plugin_caniuse.js.LICENSE.txt +411 -0
- package/release/plugin_csv.js +1 -0
- package/release/plugin_csv.js.LICENSE.txt +367 -0
- package/release/plugin_datetime.js +1 -0
- package/release/plugin_datetime.js.LICENSE.txt +471 -0
- package/release/plugin_kansuji.js +1 -0
- package/release/plugin_kansuji.js.LICENSE.txt +491 -0
- package/release/plugin_markup.js +1 -0
- package/release/plugin_markup.js.LICENSE.txt +363 -0
- package/release/plugin_turtle.js +1 -0
- package/release/plugin_turtle.js.LICENSE.txt +435 -0
- package/release/plugin_webworker.js +1 -0
- package/release/plugin_webworker.js.LICENSE.txt +491 -0
- package/release/version.js +2 -0
- package/release/version.js.LICENSE.txt +32 -0
- package/release/wnako3.js +2 -0
- package/release/wnako3.js.LICENSE.txt +1 -0
- package/release/wnako3webworker.js +1 -0
- package/release/wnako3webworker.js.LICENSE.txt +847 -0
- package/release/yoyakugo.json +30 -0
- package/src/browsers.md +60 -0
- package/src/cnako3.js +466 -0
- package/src/commander_ja.js +154 -0
- package/src/enako3.js +69 -0
- package/src/era.json +22 -0
- package/src/index.js +5 -0
- package/src/nako3.js +836 -0
- package/src/nako3_assert.js +37 -0
- package/src/nako3editorfix.sfd +106 -0
- package/src/nako3editorfix.woff +0 -0
- package/src/nako3server.js +51 -0
- package/src/nako_colors.js +86 -0
- package/src/nako_errors.js +176 -0
- package/src/nako_gen.js +1459 -0
- package/src/nako_gen_async.js +1622 -0
- package/src/nako_global.js +113 -0
- package/src/nako_indent.js +480 -0
- package/src/nako_josi_list.js +46 -0
- package/src/nako_lex_rules.js +259 -0
- package/src/nako_lexer.js +576 -0
- package/src/nako_logger.js +138 -0
- package/src/nako_parser3.js +1768 -0
- package/src/nako_parser_base.js +265 -0
- package/src/nako_parser_const.js +37 -0
- package/src/nako_prepare.js +293 -0
- package/src/nako_reserved_words.js +35 -0
- package/src/nako_source_mapping.js +251 -0
- package/src/nako_test.js +37 -0
- package/src/nako_version.js +8 -0
- package/src/plugin_browser.js +191 -0
- package/src/plugin_browser_ajax.js +352 -0
- package/src/plugin_browser_audio.js +109 -0
- package/src/plugin_browser_canvas.js +462 -0
- package/src/plugin_browser_chart.js +296 -0
- package/src/plugin_browser_color.js +49 -0
- package/src/plugin_browser_crypto.js +26 -0
- package/src/plugin_browser_dialog.js +53 -0
- package/src/plugin_browser_dom_basic.js +322 -0
- package/src/plugin_browser_dom_event.js +193 -0
- package/src/plugin_browser_dom_parts.js +163 -0
- package/src/plugin_browser_geolocation.js +51 -0
- package/src/plugin_browser_hotkey.js +25 -0
- package/src/plugin_browser_html.js +59 -0
- package/src/plugin_browser_in_worker.js +44 -0
- package/src/plugin_browser_location.js +21 -0
- package/src/plugin_browser_speech.js +111 -0
- package/src/plugin_browser_storage.js +121 -0
- package/src/plugin_browser_system.js +12 -0
- package/src/plugin_browser_websocket.js +73 -0
- package/src/plugin_caniuse.js +24 -0
- package/src/plugin_csv.js +57 -0
- package/src/plugin_datetime.js +414 -0
- package/src/plugin_express.js +212 -0
- package/src/plugin_kansuji.js +224 -0
- package/src/plugin_keigo.js +55 -0
- package/src/plugin_markup.js +32 -0
- package/src/plugin_math.js +319 -0
- package/src/plugin_node.js +1018 -0
- package/src/plugin_promise.js +94 -0
- package/src/plugin_system.js +2109 -0
- package/src/plugin_test.js +38 -0
- package/src/plugin_turtle.js +646 -0
- package/src/plugin_webworker.js +334 -0
- package/src/plugin_weykturtle3d.js +1216 -0
- package/src/plugin_worker.js +92 -0
- package/src/repl.nako3 +63 -0
- package/src/turtle-elephant.png +0 -0
- package/src/turtle-panda.png +0 -0
- package/src/turtle64.png +0 -0
- package/src/wnako3.js +162 -0
- package/src/wnako3_editor.css +215 -0
- package/src/wnako3_editor.js +1645 -0
- package/src/wnako3_editor_marker_red.png +0 -0
- package/src/wnako3_editor_marker_red.xcf +0 -0
- package/src/wnako3_editor_marker_yellow.png +0 -0
- package/src/wnako3_editor_marker_yellow.xcf +0 -0
- package/src/wnako3webworker.js +70 -0
- package/test/ace_editor/karma.config.js +94 -0
- package/test/ace_editor/test/.babelrc.json +3 -0
- package/test/ace_editor/test/ace_editor_test.js +178 -0
- package/test/ace_editor/test/html/custom_context.html +140 -0
- package/test/async/async_basic_test.js +124 -0
- package/test/browser/karma.config.js +212 -0
- package/test/browser/test/.babelrc.json +3 -0
- package/test/browser/test/compare_util.js +50 -0
- package/test/browser/test/html/canvas_basic.html +1 -0
- package/test/browser/test/html/div_basic.html +2 -0
- package/test/browser/test/html/event_dom_form.html +4 -0
- package/test/browser/test/html/event_dom_scrolldiv.html +5 -0
- package/test/browser/test/image/canvas_test1.png +0 -0
- package/test/browser/test/image/canvas_test2.png +0 -0
- package/test/browser/test/image/canvas_test3.png +0 -0
- package/test/browser/test/image/canvas_test4.png +0 -0
- package/test/browser/test/image/canvas_test7.png +0 -0
- package/test/browser/test/image/canvas_test8.png +0 -0
- package/test/browser/test/image/canvas_test_blank.png +0 -0
- package/test/browser/test/image/elephant_kana.png +0 -0
- package/test/browser/test/image/panda_kana.png +0 -0
- package/test/browser/test/image/turtle_kana.png +0 -0
- package/test/browser/test/import_plugin_checker.js +24 -0
- package/test/browser/test/plugin_browser_test.js +52 -0
- package/test/browser/test/plugin_browser_test_ajax.js +123 -0
- package/test/browser/test/plugin_browser_test_color.js +18 -0
- package/test/browser/test/plugin_browser_test_dialog.js +72 -0
- package/test/browser/test/plugin_browser_test_dom_event.js +598 -0
- package/test/browser/test/plugin_browser_test_dom_parts.js +125 -0
- package/test/browser/test/plugin_browser_test_system.js +9 -0
- package/test/browser/test/plugin_turtle_test.js +817 -0
- package/test/browser/test/plugin_webworker_test.js +87 -0
- package/test/browser/test/require_test.js +71 -0
- package/test/bundled/karma.config.base.js +117 -0
- package/test/bundled/karma.config.js +86 -0
- package/test/bundled/test/.babelrc.json +3 -0
- package/test/bundled/test/bundled_test.js +69 -0
- package/test/bundled/test/html/custom_context.html +65 -0
- package/test/bundled/test/html/custom_debug.html +66 -0
- package/test/bundled/test4b.cmd +52 -0
- package/test/bundled/test_base/.babelrc.json +3 -0
- package/test/bundled/test_base/_checktool_test.js +25 -0
- package/test/bundled/test_base/basic_ajax_test.js +56 -0
- package/test/bundled/test_base/basic_async_test.js +18 -0
- package/test/bundled/test_base/basic_test.js +153 -0
- package/test/bundled/test_base/calc_test.js +132 -0
- package/test/bundled/test_base/css/browsers_box.css +114 -0
- package/test/bundled/test_base/html/custom_context.html +69 -0
- package/test/bundled/test_base/html/custom_debug.html +71 -0
- package/test/bundled/test_base/js/browsers_box.js +72 -0
- package/test/bundled/test_base/plugin_csv_test.js +37 -0
- package/test/bundled/test_base/plugin_datetime_test.js +115 -0
- package/test/bundled/test_base/plugin_kansuji_test.js +49 -0
- package/test/bundled/test_base/plugin_system_test.js +410 -0
- package/test/bundled/test_base/plugin_webworker_test.js +53 -0
- package/test/bundled/test_base/resources/ok.txt +1 -0
- package/test/bundled/test_base/test_utils.js +191 -0
- package/test/common/array_test.js +40 -0
- package/test/common/basic_test.js +317 -0
- package/test/common/calc_test.js +139 -0
- package/test/common/debug_test.js +16 -0
- package/test/common/error_test.js +16 -0
- package/test/common/flow_test.js +360 -0
- package/test/common/func_call.js +136 -0
- package/test/common/func_test.js +149 -0
- package/test/common/indent_test.js +362 -0
- package/test/common/lex_test.js +146 -0
- package/test/common/literal_test.js +72 -0
- package/test/common/nako_logger_test.js +26 -0
- package/test/common/plugin_browser_test.js +24 -0
- package/test/common/plugin_browser_ut_audio_test.js +88 -0
- package/test/common/plugin_browser_ut_color_test.js +21 -0
- package/test/common/plugin_browser_ut_dialog_test.js +100 -0
- package/test/common/plugin_browser_ut_html_test.js +13 -0
- package/test/common/plugin_browser_ut_system_test.js +10 -0
- package/test/common/plugin_csv_test.js +39 -0
- package/test/common/plugin_datetime_test.js +120 -0
- package/test/common/plugin_kansuji_test.js +59 -0
- package/test/common/plugin_promise_test.js +18 -0
- package/test/common/plugin_system_test.js +451 -0
- package/test/common/prepare_test.js +93 -0
- package/test/common/re_test.js +20 -0
- package/test/common/variable_scope_test.js +105 -0
- package/test/jsconfig.json +19 -0
- package/test/karma.config.js +91 -0
- package/test/node/add_test.nako3 +1 -0
- package/test/node/async_test.js +80 -0
- package/test/node/commander_ja_test.js +82 -0
- package/test/node/error_message_test.js +244 -0
- package/test/node/kai_test.nako3 +6 -0
- package/test/node/node_test.js +43 -0
- package/test/node/plugin_broken.js.txt +3 -0
- package/test/node/plugin_browser_ut_ajax_test.js +355 -0
- package/test/node/plugin_browser_ut_location_test.js +32 -0
- package/test/node/plugin_markup_test.js +44 -0
- package/test/node/plugin_math_test.js +42 -0
- package/test/node/plugin_node_test.js +93 -0
- package/test/node/plugin_test.js +16 -0
- package/test/node/relative_import_test_1.nako3 +1 -0
- package/test/node/relative_import_test_2.nako3 +2 -0
- package/test/node/require_nako3_test.js +59 -0
- package/test/node/requiretest.nako3 +4 -0
- package/test/node/requiretest_indirect.nako3 +1 -0
- package/test/node/requiretest_name.nako3 +5 -0
- package/test/node/runtime_error.nako3 +2 -0
- package/test/node/side_effects_test.js +106 -0
- package/test/node/sjis.txt +5 -0
- package/test/node/syntax_error.nako3 +2 -0
- package/test/node/wnako3_editor_test.js +360 -0
- package/tools/README.md +7 -0
- package/tools/nako3edit/html/edit.html +83 -0
- package/tools/nako3edit/html/edit_plugin.js +6 -0
- package/tools/nako3edit/html/files.html +49 -0
- package/tools/nako3edit/html/nako3edit.css +66 -0
- package/tools/nako3edit/index.nako3 +145 -0
- package/tools/nako3edit/run.js +12 -0
- package/tools/nako3server/html/edit.html +104 -0
- package/tools/nako3server/html/edit_plugin.js +6 -0
- package/tools/nako3server/html/files.html +53 -0
- package/tools/nako3server/html/nako3edit.css +66 -0
- package/tools/nako3server/index.nako3 +129 -0
- package/tools/nako3server/run.js +12 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
const PluginPromise = {
|
|
3
|
+
'初期化': {
|
|
4
|
+
type: 'func',
|
|
5
|
+
josi: [],
|
|
6
|
+
pure: true,
|
|
7
|
+
fn: function (sys) {
|
|
8
|
+
if (sys.__promise == null) {
|
|
9
|
+
sys.__promise = {
|
|
10
|
+
setLastPromise: function (promise) {
|
|
11
|
+
sys.__v0['そ'] = promise
|
|
12
|
+
return promise
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
// @非同期処理の保証の定数
|
|
19
|
+
'そ': { type: 'const', value: '' }, // @そ
|
|
20
|
+
// @非同期処理の保証
|
|
21
|
+
'動時': { // @非同期処理を作成する。非同期処理オブジェクト(Promise)を返す。 // @うごくとき
|
|
22
|
+
type: 'func',
|
|
23
|
+
josi: [['を', 'で']],
|
|
24
|
+
pure: true,
|
|
25
|
+
fn: function (callback, sys) {
|
|
26
|
+
return sys.__promise.setLastPromise(new Promise((resolve, reject) => {
|
|
27
|
+
return callback(resolve, reject)
|
|
28
|
+
}))
|
|
29
|
+
},
|
|
30
|
+
return_none: false
|
|
31
|
+
},
|
|
32
|
+
'成功時': { // @非同期処理で成功したときにcallbackが実行される。その際『対象』にデータが代入される。 // @せいこうしたとき
|
|
33
|
+
type: 'func',
|
|
34
|
+
josi: [['を'], ['の', 'が', 'に']],
|
|
35
|
+
pure: true,
|
|
36
|
+
fn: function (callback, promise, sys) {
|
|
37
|
+
return sys.__promise.setLastPromise(promise.then(result => {
|
|
38
|
+
sys.__v0['対象'] = result
|
|
39
|
+
return callback(result)
|
|
40
|
+
}))
|
|
41
|
+
},
|
|
42
|
+
return_none: false
|
|
43
|
+
},
|
|
44
|
+
'処理時': { // @非同期処理で終了した時にcbFuncが実行される。引数と『対象』は、成功時は真とデータが設定され、失敗時は、偽と理由が設定される。 // @しょりしたとき
|
|
45
|
+
type: 'func',
|
|
46
|
+
josi: [['を'], ['の', 'が', 'に']],
|
|
47
|
+
pure: true,
|
|
48
|
+
fn: function (cbFunc, promise, sys) {
|
|
49
|
+
return sys.__promise.setLastPromise(promise.then(result => {
|
|
50
|
+
sys.__v0['対象'] = result
|
|
51
|
+
return cbFunc(true, result, sys)
|
|
52
|
+
}, reason => {
|
|
53
|
+
sys.__v0['対象'] = reason
|
|
54
|
+
return cbFunc(false, reason, sys)
|
|
55
|
+
}))
|
|
56
|
+
},
|
|
57
|
+
return_none: false
|
|
58
|
+
},
|
|
59
|
+
'失敗時': { // @非同期処理で失敗したときにcallbackが実行される。その際『対象』にエラーが代入される。 // @しっぱいしたとき
|
|
60
|
+
type: 'func',
|
|
61
|
+
josi: [['を'], ['の', 'が', 'に']],
|
|
62
|
+
pure: true,
|
|
63
|
+
fn: function (callback, promise, sys) {
|
|
64
|
+
return sys.__promise.setLastPromise(promise.catch(err => {
|
|
65
|
+
sys.__v0['対象'] = err
|
|
66
|
+
return callback(err)
|
|
67
|
+
}))
|
|
68
|
+
},
|
|
69
|
+
return_none: false
|
|
70
|
+
},
|
|
71
|
+
'終了時': { // @非同期処理で終了したときにcallbackが実行される。成功時・失敗時・処理時とは別に実行される。 // @しゅうりょうしたとき
|
|
72
|
+
type: 'func',
|
|
73
|
+
josi: [['を'], ['の', 'が', 'に']],
|
|
74
|
+
pure: true,
|
|
75
|
+
fn: function (callback, promise, sys) {
|
|
76
|
+
return sys.__promise.setLastPromise(promise.finally(() => {
|
|
77
|
+
return callback()
|
|
78
|
+
}))
|
|
79
|
+
},
|
|
80
|
+
return_none: false
|
|
81
|
+
},
|
|
82
|
+
'束': { // @非同期処理をまとめる。 // @たばねる
|
|
83
|
+
type: 'func',
|
|
84
|
+
josi: [['と', 'を']],
|
|
85
|
+
pure: true,
|
|
86
|
+
fn: function (...args) {
|
|
87
|
+
const sys = args.pop()
|
|
88
|
+
return sys.__promise.setLastPromise(Promise.all(args))
|
|
89
|
+
},
|
|
90
|
+
return_none: false
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
module.exports = PluginPromise
|