nadesiko3 3.6.1 → 3.6.3
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 +47 -47
- package/core/command/plugin_snako.mjs +10 -0
- package/core/command/plugin_snako.mts +10 -0
- package/core/deno/plugin_snako_deno.ts +10 -0
- package/core/deno/snako.ts +3 -3
- package/core/package.json +2 -2
- package/core/src/nako3.mjs +79 -78
- package/core/src/nako3.mts +79 -47
- package/core/src/nako_colors.mjs +1 -1
- package/core/src/nako_core_version.mjs +2 -2
- package/core/src/nako_core_version.mts +2 -2
- package/core/src/nako_errors.mjs +0 -13
- package/core/src/nako_gen.mjs +44 -52
- package/core/src/nako_gen.mts +38 -16
- package/core/src/nako_global.mjs +2 -21
- package/core/src/nako_global.mts +1 -1
- package/core/src/nako_indent.mjs +2 -2
- package/core/src/nako_lex_rules.mjs +14 -14
- package/core/src/nako_lexer.mjs +0 -6
- package/core/src/nako_logger.mjs +9 -12
- package/core/src/nako_parser3.mjs +2 -2
- package/core/src/nako_parser_base.mjs +0 -23
- package/core/src/nako_parser_const.mjs +3 -3
- package/core/src/nako_prepare.mjs +35 -46
- package/core/src/nako_reserved_words.mjs +13 -13
- package/core/src/nako_source_mapping.mjs +0 -13
- package/core/src/plugin_api.mts +1 -0
- package/core/src/plugin_csv.mjs +4 -4
- package/core/src/plugin_math.mjs +4 -5
- package/core/src/plugin_math.mts +3 -1
- package/core/src/plugin_promise.mjs +5 -5
- package/core/src/plugin_promise.mts +16 -14
- package/core/src/plugin_system.mjs +58 -58
- package/core/src/plugin_system.mts +8 -8
- package/core/src/plugin_test.mjs +12 -4
- package/core/src/plugin_test.mts +13 -2
- package/core/test/plugin_system_test.mjs +1 -1
- package/core/test/side_effects_test.mjs +12 -6
- package/package.json +1 -1
- package/release/_hash.txt +20 -20
- package/release/_script-tags.txt +15 -15
- package/release/editor.js +1 -1
- package/release/editor.js.map +1 -1
- package/release/plugin_markup.js +1 -1
- package/release/plugin_markup.js.map +1 -1
- package/release/stats.json +1 -1
- package/release/version.js +1 -1
- package/release/version.js.map +1 -1
- package/release/wnako3.js +1 -1
- package/release/wnako3.js.LICENSE.txt +1 -341
- package/release/wnako3.js.map +1 -1
- package/release/wnako3webworker.js +1 -2
- package/release/wnako3webworker.js.map +1 -1
- package/src/nako_version.mjs +2 -2
- package/src/nako_version.mts +2 -2
- package/src/plugin_browser_chart.mjs +1 -1
- package/src/plugin_browser_chart.mts +1 -1
- package/src/plugin_browser_system.mjs +2 -2
- package/src/plugin_browser_system.mts +2 -2
- package/src/plugin_keigo.mjs +62 -51
- package/src/plugin_keigo.mts +65 -0
- package/src/plugin_markup.mjs +10 -0
- package/test/node/wnako3_editor_test.mjs +5 -1
package/batch/command.txt
CHANGED
|
@@ -319,58 +319,58 @@
|
|
|
319
319
|
|
|
320
320
|
■plugin_math(基本プラグイン,wnako,cnako)
|
|
321
321
|
●三角関数
|
|
322
|
-
| 関数 | SIN | Vの | ラジアン単位VのSINを求める | SIN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
323
|
-
| 関数 | COS | Vの | ラジアン単位VのCOSを求める | COS | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
324
|
-
| 関数 | TAN | Vの | ラジアン単位VのTANを求める | TAN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
325
|
-
| 関数 | ARCSIN | Vの | ラジアン単位VのARCSINを求める | ARCSIN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
326
|
-
| 関数 | ARCCOS | Vの | ラジアン単位VのARCCOSを求める | ARCCOS | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
327
|
-
| 関数 | ARCTAN | Vの | ラジアン単位VのARCTANを求める | ARCTAN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
328
|
-
| 関数 | ATAN2 | YとXの | ARCTAN(Y/X)をラジアン単位で返す | ATAN2 | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
329
|
-
| 関数 | 座標角度計算 | XY[]の | 点[0,0]から[x,y]の直線とX軸の角度(度)を返す | ざひょうかくどけいさん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
330
|
-
| 関数 | RAD2DEG | Vを | ラジアンから度に変換 | RAD2DEG | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
331
|
-
| 関数 | DEG2RAD | Vを | 度からラジアンに変換 | DEG2RAD | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
332
|
-
| 関数 | 度変換 | Vを | ラジアンから度に変換 | どへんかん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
333
|
-
| 関数 | ラジアン変換 | Vを | 度からラジアンに変換 | らじあんへんかん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
322
|
+
| 関数 | SIN | Vの | ラジアン単位VのSINを求める | SIN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L28
|
|
323
|
+
| 関数 | COS | Vの | ラジアン単位VのCOSを求める | COS | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L36
|
|
324
|
+
| 関数 | TAN | Vの | ラジアン単位VのTANを求める | TAN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L44
|
|
325
|
+
| 関数 | ARCSIN | Vの | ラジアン単位VのARCSINを求める | ARCSIN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L52
|
|
326
|
+
| 関数 | ARCCOS | Vの | ラジアン単位VのARCCOSを求める | ARCCOS | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L60
|
|
327
|
+
| 関数 | ARCTAN | Vの | ラジアン単位VのARCTANを求める | ARCTAN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L68
|
|
328
|
+
| 関数 | ATAN2 | YとXの | ARCTAN(Y/X)をラジアン単位で返す | ATAN2 | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L76
|
|
329
|
+
| 関数 | 座標角度計算 | XY[]の | 点[0,0]から[x,y]の直線とX軸の角度(度)を返す | ざひょうかくどけいさん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L84
|
|
330
|
+
| 関数 | RAD2DEG | Vを | ラジアンから度に変換 | RAD2DEG | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L92
|
|
331
|
+
| 関数 | DEG2RAD | Vを | 度からラジアンに変換 | DEG2RAD | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L100
|
|
332
|
+
| 関数 | 度変換 | Vを | ラジアンから度に変換 | どへんかん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L108
|
|
333
|
+
| 関数 | ラジアン変換 | Vを | 度からラジアンに変換 | らじあんへんかん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L116
|
|
334
334
|
●算術関数
|
|
335
|
-
| 関数 | SIGN | Vの | Vが0なら0を、0超なら1を、0未満なら-1を返す | SIGN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
336
|
-
| 関数 | 符号 | Vの | Vが0なら0を、0超なら1を、0未満なら-1を返す | ふごう | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
337
|
-
| 関数 | ABS | Aの | Vの絶対値を返す | ABS | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
338
|
-
| 関数 | 絶対値 | Aの | Vの絶対値を返す | ぜったいち | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
339
|
-
| 関数 | EXP | Aの | e(自然対数の底)の A 乗の値を返す | EXP | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
340
|
-
| 関数 | HYPOT | AとBの | 直角三角形の二辺の長さA,Bから斜辺を求めて返す。 | HYPOT | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
341
|
-
| 関数 | 斜辺 | AとBの | 直角三角形の二辺の長さA,Bから斜辺を求めて返す。 | しゃへん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
342
|
-
| 関数 | LN | Aの | 実数式 A の自然対数(Ln(A) = 1)を返す | LN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
343
|
-
| 関数 | LOG | Aの | Aの自然対数(底はE)を返す | LOG | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
344
|
-
| 関数 | LOGN | AでBの | 指定された底AでBの対数を計算して返す | LOGN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
345
|
-
| 関数 | FRAC | Aの | 実数Aの小数部分を返す | FRAC | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
346
|
-
| 関数 | 小数部分 | Aの | 実数Aの小数部分を返す | しょうすうぶぶん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
347
|
-
| 関数 | 整数部分 | Aの | 実数Aの整数部分を返す | せいすうぶぶん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
348
|
-
| 関数 | 乱数 | Aの | 0から(A-1)までの乱数を返す | らんすう | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
349
|
-
| 関数 | 乱数範囲 | AからBまでの/Bの | AからBまでの範囲の乱数を返す | らんすうはんい | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
350
|
-
| 関数 | SQRT | Aの | Aの平方根を返す | SQRT | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
351
|
-
| 関数 | 平方根 | Aの | Aの平方根を返す | へいほうこん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
335
|
+
| 関数 | SIGN | Vの | Vが0なら0を、0超なら1を、0未満なら-1を返す | SIGN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L126
|
|
336
|
+
| 関数 | 符号 | Vの | Vが0なら0を、0超なら1を、0未満なら-1を返す | ふごう | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L135
|
|
337
|
+
| 関数 | ABS | Aの | Vの絶対値を返す | ABS | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L143
|
|
338
|
+
| 関数 | 絶対値 | Aの | Vの絶対値を返す | ぜったいち | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L151
|
|
339
|
+
| 関数 | EXP | Aの | e(自然対数の底)の A 乗の値を返す | EXP | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L159
|
|
340
|
+
| 関数 | HYPOT | AとBの | 直角三角形の二辺の長さA,Bから斜辺を求めて返す。 | HYPOT | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L167
|
|
341
|
+
| 関数 | 斜辺 | AとBの | 直角三角形の二辺の長さA,Bから斜辺を求めて返す。 | しゃへん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L175
|
|
342
|
+
| 関数 | LN | Aの | 実数式 A の自然対数(Ln(A) = 1)を返す | LN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L183
|
|
343
|
+
| 関数 | LOG | Aの | Aの自然対数(底はE)を返す | LOG | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L191
|
|
344
|
+
| 関数 | LOGN | AでBの | 指定された底AでBの対数を計算して返す | LOGN | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L199
|
|
345
|
+
| 関数 | FRAC | Aの | 実数Aの小数部分を返す | FRAC | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L209
|
|
346
|
+
| 関数 | 小数部分 | Aの | 実数Aの小数部分を返す | しょうすうぶぶん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L217
|
|
347
|
+
| 関数 | 整数部分 | Aの | 実数Aの整数部分を返す | せいすうぶぶん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L225
|
|
348
|
+
| 関数 | 乱数 | Aの | 0から(A-1)までの乱数を返す | らんすう | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L233
|
|
349
|
+
| 関数 | 乱数範囲 | AからBまでの/Bの | AからBまでの範囲の乱数を返す | らんすうはんい | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L241
|
|
350
|
+
| 関数 | SQRT | Aの | Aの平方根を返す | SQRT | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L249
|
|
351
|
+
| 関数 | 平方根 | Aの | Aの平方根を返す | へいほうこん | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L257
|
|
352
352
|
●数値切上切捨丸め
|
|
353
|
-
| 関数 | ROUND | Vを | 実数型の値Vを丸めてもっとも近い整数値を返す | ROUND | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
354
|
-
| 関数 | 四捨五入 | Vを/Vの | 実数型の値Vを丸めてもっとも近い整数値を返す | ししゃごにゅう | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
355
|
-
| 関数 | 小数点切上 | AをBで | 整数Aを小数点第B桁で切り上げして返す | しょうすうてんきりあげ | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
356
|
-
| 関数 | 小数点切下 | AをBで | 整数Aを小数点第B桁で切り下げして返す | しょうすうてんきりさげ | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
357
|
-
| 関数 | 小数点四捨五入 | AをBで | 実数Aを小数点第B桁で四捨五入して返す | しょうすうてんししゃごにゅう | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
358
|
-
| 関数 | CEIL | Vを | 数値を正の無限大方向へ切り上げて返す。 | CEIL | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
359
|
-
| 関数 | 切上 | Vを | 数値を正の無限大方向へ切り上げて返す。 | きりあげ | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
360
|
-
| 関数 | FLOOR | Vを | 数値を負の無限大方向へ切り下げて返す。 | FLOOR | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
361
|
-
| 関数 | 切捨 | Vを | 数値を負の無限大方向へ切り下げて返す。 | きりすて | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#
|
|
353
|
+
| 関数 | ROUND | Vを | 実数型の値Vを丸めてもっとも近い整数値を返す | ROUND | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L267
|
|
354
|
+
| 関数 | 四捨五入 | Vを/Vの | 実数型の値Vを丸めてもっとも近い整数値を返す | ししゃごにゅう | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L275
|
|
355
|
+
| 関数 | 小数点切上 | AをBで | 整数Aを小数点第B桁で切り上げして返す | しょうすうてんきりあげ | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L283
|
|
356
|
+
| 関数 | 小数点切下 | AをBで | 整数Aを小数点第B桁で切り下げして返す | しょうすうてんきりさげ | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L292
|
|
357
|
+
| 関数 | 小数点四捨五入 | AをBで | 実数Aを小数点第B桁で四捨五入して返す | しょうすうてんししゃごにゅう | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L301
|
|
358
|
+
| 関数 | CEIL | Vを | 数値を正の無限大方向へ切り上げて返す。 | CEIL | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L310
|
|
359
|
+
| 関数 | 切上 | Vを | 数値を正の無限大方向へ切り上げて返す。 | きりあげ | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L318
|
|
360
|
+
| 関数 | FLOOR | Vを | 数値を負の無限大方向へ切り下げて返す。 | FLOOR | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L326
|
|
361
|
+
| 関数 | 切捨 | Vを | 数値を負の無限大方向へ切り下げて返す。 | きりすて | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_math.mts#L334
|
|
362
362
|
|
|
363
363
|
|
|
364
364
|
■plugin_promise(基本プラグイン,wnako)
|
|
365
365
|
●非同期処理の保証の定数
|
|
366
|
-
| 定数 | そ | | '' | そ | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#
|
|
366
|
+
| 定数 | そ | | '' | そ | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#L30
|
|
367
367
|
●非同期処理の保証
|
|
368
|
-
| 関数 | 動時 | CALLBACKを/CALLBACKで | 非同期処理を作成する。非同期処理オブジェクト(Promise)を返す。 | うごくとき | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#
|
|
369
|
-
| 関数 | 成功時 | CALLBACKをPROMISEの/PROMISEが/PROMISEに | 非同期処理で成功したときにcallbackが実行される。その際『対象』にデータが代入される。 | せいこうしたとき | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#
|
|
370
|
-
| 関数 | 処理時 | CBFUNCをPROMISEの/PROMISEが/PROMISEに | 非同期処理で終了した時にcbFuncが実行される。引数と『対象』は、成功時は真とデータが設定され、失敗時は、偽と理由が設定される。 | しょりしたとき | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#
|
|
371
|
-
| 関数 | 失敗時 | CALLBACKをPROMISEの/PROMISEが/PROMISEに | 非同期処理で失敗したときにcallbackが実行される。その際『対象』にエラーが代入される。 | しっぱいしたとき | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#
|
|
372
|
-
| 関数 | 終了時 | CALLBACKをPROMISEの/PROMISEが/PROMISEに | 非同期処理で終了したときにcallbackが実行される。成功時・失敗時・処理時とは別に実行される。 | しゅうりょうしたとき | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#
|
|
373
|
-
| 関数 | 束 | ...ARGSと/...ARGSを | 非同期処理をまとめる。 | たばねる | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#
|
|
368
|
+
| 関数 | 動時 | CALLBACKを/CALLBACKで | 非同期処理を作成する。非同期処理オブジェクト(Promise)を返す。 | うごくとき | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#L36
|
|
369
|
+
| 関数 | 成功時 | CALLBACKをPROMISEの/PROMISEが/PROMISEに | 非同期処理で成功したときにcallbackが実行される。その際『対象』にデータが代入される。 | せいこうしたとき | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#L47
|
|
370
|
+
| 関数 | 処理時 | CBFUNCをPROMISEの/PROMISEが/PROMISEに | 非同期処理で終了した時にcbFuncが実行される。引数と『対象』は、成功時は真とデータが設定され、失敗時は、偽と理由が設定される。 | しょりしたとき | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#L59
|
|
371
|
+
| 関数 | 失敗時 | CALLBACKをPROMISEの/PROMISEが/PROMISEに | 非同期処理で失敗したときにcallbackが実行される。その際『対象』にエラーが代入される。 | しっぱいしたとき | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#L74
|
|
372
|
+
| 関数 | 終了時 | CALLBACKをPROMISEの/PROMISEが/PROMISEに | 非同期処理で終了したときにcallbackが実行される。成功時・失敗時・処理時とは別に実行される。 | しゅうりょうしたとき | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#L86
|
|
373
|
+
| 関数 | 束 | ...ARGSと/...ARGSを | 非同期処理をまとめる。 | たばねる | https://github.com/kujirahand/nadesiko3core/blob/main/src/plugin_promise.mts#L97
|
|
374
374
|
|
|
375
375
|
|
|
376
376
|
■plugin_browser(基本プラグイン,wnako)
|
|
@@ -764,8 +764,8 @@
|
|
|
764
764
|
|
|
765
765
|
■plugin_markup(基本プラグイン,wnako,cnako)
|
|
766
766
|
●マークアップ
|
|
767
|
-
| 関数 | マークダウンHTML変換 | Sを | マークダウン形式で記述された文字列SをHTML形式に変換する | まーくだうんHTMLへんかん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_markup.mjs#
|
|
768
|
-
| 関数 | HTML整形 | Sを | HTML形式で記述された文字列Sを整形する | HTMLせいけい | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_markup.mjs#
|
|
767
|
+
| 関数 | マークダウンHTML変換 | Sを | マークダウン形式で記述された文字列SをHTML形式に変換する | まーくだうんHTMLへんかん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_markup.mjs#L26
|
|
768
|
+
| 関数 | HTML整形 | Sを | HTML形式で記述された文字列Sを整形する | HTMLせいけい | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_markup.mjs#L35
|
|
769
769
|
|
|
770
770
|
|
|
771
771
|
■plugin_datetime(基本プラグイン,wnako,cnako)
|
|
@@ -6,6 +6,16 @@ import fs from 'node:fs';
|
|
|
6
6
|
import { execSync } from 'node:child_process';
|
|
7
7
|
import path from 'node:path';
|
|
8
8
|
export default {
|
|
9
|
+
'meta': {
|
|
10
|
+
type: 'const',
|
|
11
|
+
value: {
|
|
12
|
+
pluginName: 'plugin_snako',
|
|
13
|
+
description: '最小の機能を提供するプラグイン',
|
|
14
|
+
pluginVersion: '3.6.3',
|
|
15
|
+
nakoRuntime: ['cnako'],
|
|
16
|
+
nakoVersion: '3.6.3' // 要求なでしこバージョン
|
|
17
|
+
}
|
|
18
|
+
},
|
|
9
19
|
'初期化': {
|
|
10
20
|
type: 'func',
|
|
11
21
|
josi: [],
|
|
@@ -7,6 +7,16 @@ import { execSync } from 'node:child_process'
|
|
|
7
7
|
import path from 'node:path'
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
|
+
'meta': {
|
|
11
|
+
type: 'const',
|
|
12
|
+
value: {
|
|
13
|
+
pluginName: 'plugin_snako', // プラグインの名前
|
|
14
|
+
description: '最小の機能を提供するプラグイン', // プラグインの説明
|
|
15
|
+
pluginVersion: '3.6.3', // プラグインのバージョン
|
|
16
|
+
nakoRuntime: ['cnako'], // 対象ランタイム
|
|
17
|
+
nakoVersion: '3.6.3' // 要求なでしこバージョン
|
|
18
|
+
}
|
|
19
|
+
},
|
|
10
20
|
'初期化': {
|
|
11
21
|
type: 'func',
|
|
12
22
|
josi: [],
|
|
@@ -6,6 +6,16 @@ import path from 'node:path'
|
|
|
6
6
|
import { exec, OutputMode } from "https://deno.land/x/exec/mod.ts"
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
|
+
'meta': {
|
|
10
|
+
type: 'const',
|
|
11
|
+
value: {
|
|
12
|
+
pluginName: 'plugin_snako_deno', // プラグインの名前
|
|
13
|
+
description: '最小の機能を提供するプラグイン', // プラグインの説明
|
|
14
|
+
pluginVersion: '3.6.3', // プラグインのバージョン
|
|
15
|
+
nakoRuntime: ['cnako'], // 対象ランタイム
|
|
16
|
+
nakoVersion: '3.6.3' // 要求なでしこバージョン
|
|
17
|
+
}
|
|
18
|
+
},
|
|
9
19
|
'初期化': {
|
|
10
20
|
type: 'func',
|
|
11
21
|
josi: [],
|
package/core/deno/snako.ts
CHANGED
|
@@ -54,7 +54,7 @@ async function main (argvOrg: string[]) {
|
|
|
54
54
|
nako.addPluginObject('PluginSnako', PluginSnako)
|
|
55
55
|
// 実行前にイベントを挟みたいとき
|
|
56
56
|
nako.addListener('beforeRun', (g: NakoGlobal) => {
|
|
57
|
-
g.
|
|
57
|
+
g.__setSysVar('ナデシコ種類', 'snako')
|
|
58
58
|
})
|
|
59
59
|
// logger を設定 --- リスナーを登録することでデバッグレベルを指定
|
|
60
60
|
const logger = nako.getLogger()
|
|
@@ -87,10 +87,10 @@ async function main (argvOrg: string[]) {
|
|
|
87
87
|
// -c オプションを指定したとき
|
|
88
88
|
function convert (nako: NakoCompiler, code: string, opt: CommandOptions): void {
|
|
89
89
|
// オプションを指定
|
|
90
|
-
const genOpt = new NakoGenOptions(
|
|
90
|
+
const genOpt: NakoGenOptions = new NakoGenOptions(
|
|
91
91
|
false,
|
|
92
92
|
['nako_errors.mjs', 'nako_core_version.mjs', 'plugin_system.mjs'],
|
|
93
|
-
'__self.
|
|
93
|
+
'__self.__setSysVar(\'ナデシコ種類\', \'snako\')')
|
|
94
94
|
// スタンドアロンコードを生成
|
|
95
95
|
const js = nako.compileStandalone(code, opt.filename, genOpt)
|
|
96
96
|
const jsFilename = opt.filename + '.js'
|
package/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nadesiko3core",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.3",
|
|
4
4
|
"description": "Japanese Programming Language Nadesiko v3 core",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"test:dncl2": "mocha ./test/dncl2_test.mjs",
|
|
10
10
|
"test:indent": "mocha ./test/indent_test.mjs",
|
|
11
11
|
"test:indent_inline": "mocha ./test/inline_indent_test.mjs",
|
|
12
|
-
"test:a": "mocha ./test/
|
|
12
|
+
"test:a": "mocha ./test/side_effects_test.mjs",
|
|
13
13
|
"tsc": "tsc --watch",
|
|
14
14
|
"build": "tsc && node command/snako.mjs batch/build_nako_version.nako3 && tsc",
|
|
15
15
|
"eslint": "eslint ./src/*.mts",
|
package/core/src/nako3.mjs
CHANGED
|
@@ -34,36 +34,6 @@ export function newCompilerOptions(initObj = {}) {
|
|
|
34
34
|
}
|
|
35
35
|
/** なでしこコンパイラ */
|
|
36
36
|
export class NakoCompiler {
|
|
37
|
-
nakoFuncList;
|
|
38
|
-
funclist;
|
|
39
|
-
moduleExport;
|
|
40
|
-
pluginFunclist;
|
|
41
|
-
pluginfiles;
|
|
42
|
-
commandlist;
|
|
43
|
-
prepare;
|
|
44
|
-
parser;
|
|
45
|
-
lexer;
|
|
46
|
-
dependencies;
|
|
47
|
-
usedFuncs;
|
|
48
|
-
codeGenerateor;
|
|
49
|
-
logger;
|
|
50
|
-
eventList;
|
|
51
|
-
// global objects
|
|
52
|
-
__varslist;
|
|
53
|
-
__locals;
|
|
54
|
-
// eslint-disable-next-line no-use-before-define
|
|
55
|
-
__self;
|
|
56
|
-
__vars;
|
|
57
|
-
__v0;
|
|
58
|
-
__v1;
|
|
59
|
-
__globals;
|
|
60
|
-
__globalObj; // 現在のNakoGlobalオブジェクト
|
|
61
|
-
__module;
|
|
62
|
-
numFailures; // エラーレポートの数を記録
|
|
63
|
-
version;
|
|
64
|
-
coreVersion;
|
|
65
|
-
filename;
|
|
66
|
-
debugOption;
|
|
67
37
|
/**
|
|
68
38
|
* @param {undefined | {'useBasicPlugin':true|false}} options
|
|
69
39
|
*/
|
|
@@ -135,11 +105,11 @@ export class NakoCompiler {
|
|
|
135
105
|
* 基本的なプラグインを追加する
|
|
136
106
|
*/
|
|
137
107
|
addBasicPlugins() {
|
|
138
|
-
this.
|
|
139
|
-
this.
|
|
140
|
-
this.
|
|
141
|
-
this.
|
|
142
|
-
this.
|
|
108
|
+
this.addPlugin(PluginSystem);
|
|
109
|
+
this.addPlugin(PluginMath);
|
|
110
|
+
this.addPlugin(PluginPromise);
|
|
111
|
+
this.addPlugin(PluginTest);
|
|
112
|
+
this.addPlugin(PluginCSV);
|
|
143
113
|
}
|
|
144
114
|
/**
|
|
145
115
|
* loggerを新しいインスタンスで置き換える。
|
|
@@ -713,7 +683,7 @@ export class NakoCompiler {
|
|
|
713
683
|
// 他に実行している「なでしこ」があればクリアする
|
|
714
684
|
this.__globals.forEach((sys) => {
|
|
715
685
|
// core #56
|
|
716
|
-
sys.__setSysVar('
|
|
686
|
+
sys.__setSysVar('__forceClose', true);
|
|
717
687
|
sys.reset();
|
|
718
688
|
});
|
|
719
689
|
this.__globals = []; // clear
|
|
@@ -833,21 +803,22 @@ export class NakoCompiler {
|
|
|
833
803
|
* JavaScriptのみで動くコードを取得する場合
|
|
834
804
|
* @param code
|
|
835
805
|
* @param filename
|
|
836
|
-
* @param opt
|
|
806
|
+
* @param opt? オプション
|
|
837
807
|
*/
|
|
838
|
-
compileStandalone(code, filename,
|
|
839
|
-
if (
|
|
840
|
-
|
|
808
|
+
compileStandalone(code, filename, options) {
|
|
809
|
+
if (options === undefined) {
|
|
810
|
+
options = new NakoGenOptions();
|
|
841
811
|
}
|
|
842
812
|
const ast = this.parse(code, filename);
|
|
843
|
-
return this.generateCode(ast,
|
|
813
|
+
return this.generateCode(ast, options).standalone;
|
|
844
814
|
}
|
|
845
815
|
/**
|
|
846
816
|
* プラグイン・オブジェクトを追加
|
|
847
817
|
* @param po プラグイン・オブジェクト
|
|
848
818
|
* @param persistent falseのとき、次以降の実行では使えない
|
|
819
|
+
* @param fpath ファイルパス
|
|
849
820
|
*/
|
|
850
|
-
addPlugin(po, persistent = true) {
|
|
821
|
+
addPlugin(po, persistent = true, fpath = '') {
|
|
851
822
|
// __v0を取得
|
|
852
823
|
const __v0 = this.__varslist[0];
|
|
853
824
|
// プラグインのメタ情報をチェック (#1034) (#1647)
|
|
@@ -856,31 +827,63 @@ export class NakoCompiler {
|
|
|
856
827
|
__pluginInfo = {};
|
|
857
828
|
__v0.set('__pluginInfo', __pluginInfo);
|
|
858
829
|
}
|
|
830
|
+
// バージョンチェック
|
|
831
|
+
let intVersion = 0;
|
|
832
|
+
let pluginName = 'unknown';
|
|
833
|
+
let metaValue = { pluginName: 'unknown', nakoVersionResult: true, nakoVersion: '0.0.0', path: '' };
|
|
859
834
|
if (po.meta) {
|
|
860
835
|
if (po.meta.value && typeof (po.meta) === 'object') {
|
|
861
836
|
const meta = po.meta;
|
|
862
|
-
|
|
863
|
-
|
|
837
|
+
metaValue = meta.value || { pluginName: 'unknown', nakoVersion: '0.0.0' };
|
|
838
|
+
pluginName = metaValue.pluginName || 'unknown';
|
|
864
839
|
// version check
|
|
865
840
|
const nakoVersion = (metaValue.nakoVersion || '0.0.0') + '.0.0';
|
|
866
841
|
const versions = nakoVersion.split('.').map((v) => parseInt(v));
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
`(ランタイムの要求: ${PLUGIN_MIN_VERSION_INT}/プラグイン: ${intVersion})`;
|
|
871
|
-
console.warn(errMsg, 'see', 'https://github.com/kujirahand/nadesiko3/issues/1647');
|
|
872
|
-
this.logger.warn(errMsg);
|
|
873
|
-
metaValue.nakoVersionResult = false;
|
|
874
|
-
}
|
|
875
|
-
else {
|
|
876
|
-
metaValue.nakoVersionResult = true;
|
|
877
|
-
}
|
|
878
|
-
// プラグイン情報を記録
|
|
879
|
-
__pluginInfo[pluginName] = metaValue;
|
|
842
|
+
intVersion = versions[1] * 100 + versions[2];
|
|
843
|
+
// fpath
|
|
844
|
+
metaValue.path = fpath;
|
|
880
845
|
}
|
|
881
|
-
delete po.meta;
|
|
882
846
|
}
|
|
883
|
-
//
|
|
847
|
+
// unknown の場合は、関数名からプラグイン名を自動生成する
|
|
848
|
+
if (pluginName === 'unknown') {
|
|
849
|
+
pluginName = Object.keys(po).join('-');
|
|
850
|
+
}
|
|
851
|
+
// プラグイン名の重複を確認
|
|
852
|
+
if (__pluginInfo[pluginName] !== undefined) {
|
|
853
|
+
// プラグイン名が重複した場合はプラグインとして登録しない
|
|
854
|
+
this.logger.info(`プラグイン名『${pluginName}』が重複しているため、プラグインとして登録しませんでした。`);
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
// Windowsのパスやファイル名に使えない文字列があると、JSファイル書き出しでエラーになるので置換
|
|
858
|
+
const removeInvalidFilenameChars = (str) => {
|
|
859
|
+
return str.replace(/[^a-zA-z0-9\-_\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF\u3400-\u4DBF\uF900-\uFAFF]/g, '_');
|
|
860
|
+
};
|
|
861
|
+
pluginName = removeInvalidFilenameChars(pluginName);
|
|
862
|
+
// プラグイン情報を記録
|
|
863
|
+
__pluginInfo[pluginName] = metaValue;
|
|
864
|
+
// バージョンチェック
|
|
865
|
+
if (PLUGIN_MIN_VERSION_INT > intVersion) {
|
|
866
|
+
const keyStr = Object.keys(po).join(',');
|
|
867
|
+
if (pluginName === 'unknown') {
|
|
868
|
+
pluginName = keyStr.substring(0, 30) + '...';
|
|
869
|
+
}
|
|
870
|
+
const errMsg = `なでしこプラグイン『${pluginName}』は古い形式なので正しく動作しない可能性があります。` +
|
|
871
|
+
`(ランタイムの要求: ${PLUGIN_MIN_VERSION_INT}/プラグイン: ${intVersion})`;
|
|
872
|
+
console.warn(errMsg, 'see', 'https://github.com/kujirahand/nadesiko3/issues/1647');
|
|
873
|
+
this.logger.warn(errMsg);
|
|
874
|
+
metaValue.nakoVersionResult = false;
|
|
875
|
+
}
|
|
876
|
+
// 初期化とクリアを変換する
|
|
877
|
+
this.__module[pluginName] = po;
|
|
878
|
+
this.pluginfiles[pluginName] = '*';
|
|
879
|
+
// `初期化`と`クリア`をチェック
|
|
880
|
+
if (typeof (po['初期化']) === 'object') {
|
|
881
|
+
const def = po['初期化'];
|
|
882
|
+
delete po['初期化'];
|
|
883
|
+
const initKey = `!${pluginName}:初期化`;
|
|
884
|
+
po[initKey] = def;
|
|
885
|
+
}
|
|
886
|
+
// プラグインの値を、なでしこシステム変数(Map)にコピー
|
|
884
887
|
for (const key in po) {
|
|
885
888
|
const v = po[key];
|
|
886
889
|
this.funclist.set(key, v);
|
|
@@ -911,38 +914,36 @@ export class NakoCompiler {
|
|
|
911
914
|
}
|
|
912
915
|
/**
|
|
913
916
|
* プラグイン・オブジェクトを追加(ブラウザ向け)
|
|
914
|
-
* @param objName オブジェクト名
|
|
917
|
+
* @param objName オブジェクト名 (今後プラグイン名は、meta.value.pluginNameに指定する)
|
|
915
918
|
* @param po 関数リスト
|
|
916
919
|
* @param persistent falseのとき、次以降の実行では使えない
|
|
917
920
|
*/
|
|
918
921
|
addPluginObject(objName, po, persistent = true) {
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
if (typeof (po['初期化']) === 'object') {
|
|
923
|
-
const def = po['初期化'];
|
|
924
|
-
delete po['初期化'];
|
|
925
|
-
const initKey = `!${objName}:初期化`;
|
|
926
|
-
po[initKey] = def;
|
|
922
|
+
// metaプロパティがなければ互換性のため適当に追加
|
|
923
|
+
if (po.meta === undefined) {
|
|
924
|
+
po.meta = { type: 'const', value: { pluginName: objName, nakoVersion: '0.0.0' } };
|
|
927
925
|
}
|
|
928
926
|
this.addPlugin(po, persistent);
|
|
929
927
|
}
|
|
930
928
|
/**
|
|
931
929
|
* プラグイン・ファイルを追加(Node.js向け)
|
|
932
|
-
* @param objName オブジェクト名
|
|
930
|
+
* @param objName オブジェクト名(ただし、v3.6.3以降のバージョンでは無効になる)
|
|
933
931
|
* @param fpath ファイルパス
|
|
934
932
|
* @param po 登録するオブジェクト
|
|
935
933
|
* @param persistent falseのとき、次以降の実行では使えない
|
|
934
|
+
* @deprecated 利用は非推奨
|
|
936
935
|
*/
|
|
937
|
-
addPluginFile(
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
936
|
+
addPluginFile(_objName, fpath, po, persistent = true) {
|
|
937
|
+
this.addPluginFromFile(fpath, po, persistent);
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* プラグイン・ファイルを追加(Node.js向け)
|
|
941
|
+
* @param fpath ファイルパス
|
|
942
|
+
* @param po 登録するオブジェクト
|
|
943
|
+
* @param persistent falseのとき、次以降の実行では使えない
|
|
944
|
+
*/
|
|
945
|
+
addPluginFromFile(fpath, po, persistent = true) {
|
|
946
|
+
this.addPlugin(po, persistent, fpath);
|
|
946
947
|
}
|
|
947
948
|
/**
|
|
948
949
|
* 関数を追加する
|