nadesiko3 3.4.17 → 3.4.18
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 +33 -33
- package/core/package.json +2 -2
- package/core/src/nako_core_version.mjs +2 -2
- package/core/src/nako_core_version.mts +2 -2
- package/core/src/nako_gen.mjs +8 -5
- package/core/src/nako_gen.mts +8 -5
- package/core/src/nako_lex_rules.mjs +5 -0
- package/core/src/nako_lex_rules.mts +5 -0
- package/core/src/nako_lexer.mjs +14 -6
- package/core/src/nako_lexer.mts +13 -6
- package/core/src/nako_logger.mjs +1 -2
- package/core/src/nako_parser3.mjs +1 -1
- package/core/src/nako_parser3.mts +1 -1
- package/core/src/nako_parser_base.mjs +2 -0
- package/core/src/nako_parser_base.mts +2 -0
- package/core/src/plugin_system.mjs +19 -0
- package/core/src/plugin_system.mts +19 -0
- package/core/test/calc_test.mjs +67 -0
- package/core/test/lex_test.mjs +8 -0
- package/core/test/literal_test.mjs +13 -0
- package/core/test/plugin_system_test.mjs +4 -0
- package/package.json +1 -1
- package/release/stats.json +1 -1
- package/src/plugin_browser.mts +0 -1
- package/src/plugin_node.mjs +7 -4
- package/src/plugin_node.mts +6 -4
package/batch/command.txt
CHANGED
|
@@ -731,46 +731,46 @@
|
|
|
731
731
|
| 定数 | ナデシコランタイムパス | | '' | なでしこらんたいむぱす | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L633
|
|
732
732
|
| 関数 | 標準入力取得時 | CALLBACKを | 標準入力を一行取得した時に、無名関数(あるいは、文字列で関数名を指定)F(s: string)を実行する | ひょうじゅんにゅうりょくしゅとくしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L638
|
|
733
733
|
| 関数 | 尋 | MSGと/MSGを | 標準入力を一行取得する | たずねる | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L653
|
|
734
|
-
| 関数 | 文字尋 | MSGと/MSGを | 標準入力を一行取得する。ただし自動で数値に変換しない | もじたずねる | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
735
|
-
| 関数 | 標準入力全取得 | | 標準入力を全部取得して返す | ひょうじゅんにゅうりょくぜんしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
734
|
+
| 関数 | 文字尋 | MSGと/MSGを | 標準入力を一行取得する。ただし自動で数値に変換しない | もじたずねる | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L677
|
|
735
|
+
| 関数 | 標準入力全取得 | | 標準入力を全部取得して返す | ひょうじゅんにゅうりょくぜんしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L696
|
|
736
736
|
●テスト
|
|
737
|
-
| 関数 | ASSERT等 | AとBが | mochaによるテストで、ASSERTでAとBが正しいことを報告する | ASSERTひとしい | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
737
|
+
| 関数 | ASSERT等 | AとBが | mochaによるテストで、ASSERTでAとBが正しいことを報告する | ASSERTひとしい | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L718
|
|
738
738
|
●ネットワーク
|
|
739
|
-
| 関数 | 自分IPアドレス取得 | | ネットワークアダプターからIPアドレス(IPv4)を取得して配列で返す | じぶんIPあどれすしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
740
|
-
| 関数 | 自分IPV6アドレス取得 | | ネットワークアダプターからIPアドレス(IPv6)を取得して配列で返す | じぶんIPV6あどれすしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
739
|
+
| 関数 | 自分IPアドレス取得 | | ネットワークアダプターからIPアドレス(IPv4)を取得して配列で返す | じぶんIPあどれすしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L727
|
|
740
|
+
| 関数 | 自分IPV6アドレス取得 | | ネットワークアダプターからIPアドレス(IPv6)を取得して配列で返す | じぶんIPV6あどれすしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L749
|
|
741
741
|
●Ajax
|
|
742
|
-
| 関数 | AJAX送信時 | CALLBACKのURLまで/URLへ/URLに | 非同期通信(Ajax)でURLにデータを送信し、成功するとcallbackが実行される。その際『対象』にデータが代入される。 | AJAXそうしんしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
743
|
-
| 関数 | AJAX受信時 | CALLBACKでURLから/URLを | 非同期通信(Ajax)でURLにデータを送信し、成功するとcallbackが実行される。その際『対象』にデータが代入される。 | AJAXそうしんしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
744
|
-
| 関数 | GET送信時 | CALLBACKのURLまで/URLへ/URLに | 非同期通信(Ajax)でURLにデータを送信し、成功するとcallbackが実行される。その際『対象』にデータが代入される。 | GETそうしんしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
745
|
-
| 関数 | POST送信時 | CALLBACKのURLまでPARAMSを/URLへ/URLに | AjaxでURLにPARAMSをPOST送信し『対象』にデータを設定 | POSTそうしんしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
746
|
-
| 関数 | POSTフォーム送信時 | CALLBACKのURLまでPARAMSを/URLへ/URLに | AjaxでURLにPARAMSをフォームとしてPOST送信し『対象』にデータを設定 | POSTふぉーむそうしんしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
747
|
-
| 関数 | AJAX失敗時 | CALLBACKの | Ajax命令でエラーが起きたとき | AJAXえらーしっぱいしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
748
|
-
| 定数 | AJAXオプション | | '' | Ajax関連のオプションを指定 | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
749
|
-
| 関数 | AJAXオプション設定 | OPTIONに/OPTIONへ/OPTIONと | Ajax命令でオプションを設定 | AJAXおぷしょんせってい | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
750
|
-
| 関数 | AJAX保障送信 | URLまで/URLへ/URLに | 非同期通信(Ajax)でURLにデータの送信を開始する非同期処理オブジェクト(Promise)を作成する。 | AJAXほしょうそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
751
|
-
| 関数 | HTTP保障取得 | URLの/URLから/URLを | 非同期通信(Ajax)でURLにデータの送信を開始する非同期処理オブジェクト(Promise)を作成する。 | HTTPほしょうしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
752
|
-
| 関数 | GET保障送信 | URLまで/URLへ/URLに | 非同期通信(Ajax)でURLにデータの送信を開始する非同期処理オブジェクト(Promise)を作成する。 | GETほしょうそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
753
|
-
| 関数 | POST保障送信 | URLまでPARAMSを/URLへ/URLに | 非同期通信(Ajax)でURLにPARAMSをPOST送信を開始する非同期処理オブジェクト(Promise)を作成する。 | POSTほしょうそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
754
|
-
| 関数 | POSTフォーム保障送信 | URLまでPARAMSを/URLへ/URLに | 非同期通信(Ajax)でURLにPARAMSをフォームとしてPOST送信を開始する非同期処理オブジェクト(Promise)を作成する。 | POSTふぉーむほしょうそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
755
|
-
| 関数 | AJAX内容取得 | RESからTYPEで | 非同期通信(Ajax)の応答から内容を指定した形式で取り出すための非同期処理オブジェクト(Promise)を返す。 | AJAXないようしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
756
|
-
| 関数 | AJAX受信 | URLから/URLを | 「!非同期モード」で非同期通信(Ajax)でURLからデータを受信する。『AJAXオプション』を指定できる。結果は変数『対象』に入る | AJAXじゅしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
757
|
-
| 関数 | POSTデータ生成 | PARAMSの/PARAMSを | 辞書形式のデータPARAMSをkey=value&key=value...の形式に変換する | POSTでーたせいせい | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
742
|
+
| 関数 | AJAX送信時 | CALLBACKのURLまで/URLへ/URLに | 非同期通信(Ajax)でURLにデータを送信し、成功するとcallbackが実行される。その際『対象』にデータが代入される。 | AJAXそうしんしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L769
|
|
743
|
+
| 関数 | AJAX受信時 | CALLBACKでURLから/URLを | 非同期通信(Ajax)でURLにデータを送信し、成功するとcallbackが実行される。その際『対象』にデータが代入される。 | AJAXそうしんしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L788
|
|
744
|
+
| 関数 | GET送信時 | CALLBACKのURLまで/URLへ/URLに | 非同期通信(Ajax)でURLにデータを送信し、成功するとcallbackが実行される。その際『対象』にデータが代入される。 | GETそうしんしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L797
|
|
745
|
+
| 関数 | POST送信時 | CALLBACKのURLまでPARAMSを/URLへ/URLに | AjaxでURLにPARAMSをPOST送信し『対象』にデータを設定 | POSTそうしんしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L806
|
|
746
|
+
| 関数 | POSTフォーム送信時 | CALLBACKのURLまでPARAMSを/URLへ/URLに | AjaxでURLにPARAMSをフォームとしてPOST送信し『対象』にデータを設定 | POSTふぉーむそうしんしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L835
|
|
747
|
+
| 関数 | AJAX失敗時 | CALLBACKの | Ajax命令でエラーが起きたとき | AJAXえらーしっぱいしたとき | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L860
|
|
748
|
+
| 定数 | AJAXオプション | | '' | Ajax関連のオプションを指定 | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L864
|
|
749
|
+
| 関数 | AJAXオプション設定 | OPTIONに/OPTIONへ/OPTIONと | Ajax命令でオプションを設定 | AJAXおぷしょんせってい | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L869
|
|
750
|
+
| 関数 | AJAX保障送信 | URLまで/URLへ/URLに | 非同期通信(Ajax)でURLにデータの送信を開始する非同期処理オブジェクト(Promise)を作成する。 | AJAXほしょうそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L878
|
|
751
|
+
| 関数 | HTTP保障取得 | URLの/URLから/URLを | 非同期通信(Ajax)でURLにデータの送信を開始する非同期処理オブジェクト(Promise)を作成する。 | HTTPほしょうしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L889
|
|
752
|
+
| 関数 | GET保障送信 | URLまで/URLへ/URLに | 非同期通信(Ajax)でURLにデータの送信を開始する非同期処理オブジェクト(Promise)を作成する。 | GETほしょうそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L898
|
|
753
|
+
| 関数 | POST保障送信 | URLまでPARAMSを/URLへ/URLに | 非同期通信(Ajax)でURLにPARAMSをPOST送信を開始する非同期処理オブジェクト(Promise)を作成する。 | POSTほしょうそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L907
|
|
754
|
+
| 関数 | POSTフォーム保障送信 | URLまでPARAMSを/URLへ/URLに | 非同期通信(Ajax)でURLにPARAMSをフォームとしてPOST送信を開始する非同期処理オブジェクト(Promise)を作成する。 | POSTふぉーむほしょうそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L930
|
|
755
|
+
| 関数 | AJAX内容取得 | RESからTYPEで | 非同期通信(Ajax)の応答から内容を指定した形式で取り出すための非同期処理オブジェクト(Promise)を返す。 | AJAXないようしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L946
|
|
756
|
+
| 関数 | AJAX受信 | URLから/URLを | 「!非同期モード」で非同期通信(Ajax)でURLからデータを受信する。『AJAXオプション』を指定できる。結果は変数『対象』に入る | AJAXじゅしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L971
|
|
757
|
+
| 関数 | POSTデータ生成 | PARAMSの/PARAMSを | 辞書形式のデータPARAMSをkey=value&key=value...の形式に変換する | POSTでーたせいせい | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L999
|
|
758
758
|
●新AJAX
|
|
759
|
-
| 関数 | AJAXテキスト取得 | URLから | AJAXでURLにアクセスしテキスト形式で結果を得る。送信時AJAXオプションの値を参照。 | AJAXてきすとしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
760
|
-
| 関数 | AJAX_JSON取得 | URLから | AJAXでURLにアクセスしJSONの結果を得て、送信時AJAXオプションの値を参照。 | AJAX_JSONしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
761
|
-
| 関数 | AJAXバイナリ取得 | URLから | AJAXでURLにアクセスしバイナリ(arrayBuffer)形式で結果を得る。送信時AJAXオプションの値を参照。 | AJAXばいなりしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
759
|
+
| 関数 | AJAXテキスト取得 | URLから | AJAXでURLにアクセスしテキスト形式で結果を得る。送信時AJAXオプションの値を参照。 | AJAXてきすとしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1015
|
|
760
|
+
| 関数 | AJAX_JSON取得 | URLから | AJAXでURLにアクセスしJSONの結果を得て、送信時AJAXオプションの値を参照。 | AJAX_JSONしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1030
|
|
761
|
+
| 関数 | AJAXバイナリ取得 | URLから | AJAXでURLにアクセスしバイナリ(arrayBuffer)形式で結果を得る。送信時AJAXオプションの値を参照。 | AJAXばいなりしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1044
|
|
762
762
|
●LINE
|
|
763
|
-
| 関数 | LINE送信 | TOKENへMESSAGEを/TOKENに | LINEにメッセージを送信する。先にLINE Notifyのページで宛先のトークンを取得する。TOKENへMESSAGEをLINE送信する。 | LINEそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
764
|
-
| 関数 | LINE画像送信 | TOKENへIMAGEFILEとMESSAGEを/TOKENに | LINEにメッセージを送信する。先にLINE Notifyのページで宛先のトークンを取得する。TOKENへIMAGE_FILEとMESSAGEをLINE画像送信する。 | LINEがぞうそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
763
|
+
| 関数 | LINE送信 | TOKENへMESSAGEを/TOKENに | LINEにメッセージを送信する。先にLINE Notifyのページで宛先のトークンを取得する。TOKENへMESSAGEをLINE送信する。 | LINEそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1059
|
|
764
|
+
| 関数 | LINE画像送信 | TOKENへIMAGEFILEとMESSAGEを/TOKENに | LINEにメッセージを送信する。先にLINE Notifyのページで宛先のトークンを取得する。TOKENへIMAGE_FILEとMESSAGEをLINE画像送信する。 | LINEがぞうそうしん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1081
|
|
765
765
|
●文字コード
|
|
766
|
-
| 関数 | 文字コード変換サポート判定 | CODEの/CODEを | 文字コードCODEをサポートしているか確認 | もじこーどさぽーとはんてい | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
767
|
-
| 関数 | SJIS変換 | STRに/STRへ/STRを | (v1非互換)文字列をShift_JISのバイナリバッファに変換 | SJISへんかん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
768
|
-
| 関数 | SJIS取得 | BUFから/BUFを/BUFで | Shift_JISのバイナリバッファを文字列に変換 | SJISしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
769
|
-
| 関数 | エンコーディング変換 | SをCODEへ/CODEで | 文字列SをCODEへ変換してバイナリバッファを返す | えんこーでぃんぐへんかん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
770
|
-
| 関数 | エンコーディング取得 | BUFをCODEから/CODEで | バイナリバッファBUFをCODEから変換して返す | えんこーでぃんぐしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
766
|
+
| 関数 | 文字コード変換サポート判定 | CODEの/CODEを | 文字コードCODEをサポートしているか確認 | もじこーどさぽーとはんてい | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1105
|
|
767
|
+
| 関数 | SJIS変換 | STRに/STRへ/STRを | (v1非互換)文字列をShift_JISのバイナリバッファに変換 | SJISへんかん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1113
|
|
768
|
+
| 関数 | SJIS取得 | BUFから/BUFを/BUFで | Shift_JISのバイナリバッファを文字列に変換 | SJISしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1122
|
|
769
|
+
| 関数 | エンコーディング変換 | SをCODEへ/CODEで | 文字列SをCODEへ変換してバイナリバッファを返す | えんこーでぃんぐへんかん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1131
|
|
770
|
+
| 関数 | エンコーディング取得 | BUFをCODEから/CODEで | バイナリバッファBUFをCODEから変換して返す | えんこーでぃんぐしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1140
|
|
771
771
|
●ハッシュ関数
|
|
772
|
-
| 関数 | ハッシュ関数一覧取得 | | 利用可能なハッシュ関数の一覧を返す | はっしゅかんすういちらんしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
773
|
-
| 関数 | ハッシュ値計算 | SをALGのENCで | データSをアルゴリズムALG(sha256/sha512/md5)のエンコーディングENC(hex/base64)でハッシュ値を計算して返す | はっしゅちけいさん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#
|
|
772
|
+
| 関数 | ハッシュ関数一覧取得 | | 利用可能なハッシュ関数の一覧を返す | はっしゅかんすういちらんしゅとく | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1150
|
|
773
|
+
| 関数 | ハッシュ値計算 | SをALGのENCで | データSをアルゴリズムALG(sha256/sha512/md5)のエンコーディングENC(hex/base64)でハッシュ値を計算して返す | はっしゅちけいさん | https://github.com/kujirahand/nadesiko3/tree/master/src/plugin_node.mts#L1158
|
|
774
774
|
|
|
775
775
|
|
|
776
776
|
■plugin_httpserver(基本プラグイン,cnako)
|
package/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nadesiko3core",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.18",
|
|
4
4
|
"description": "Japanese Programming Language Nadesiko v3 core",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"type": "module",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
47
47
|
"eslint-config-standard-with-typescript": "^24.0.0",
|
|
48
48
|
"mocha": "^10.0.0",
|
|
49
|
-
"typescript": "^
|
|
49
|
+
"typescript": "^5.0.3"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"cross-env": "^7.0.3"
|
package/core/src/nako_gen.mjs
CHANGED
|
@@ -432,6 +432,9 @@ export class NakoGen {
|
|
|
432
432
|
case 'number':
|
|
433
433
|
code += node.value;
|
|
434
434
|
break;
|
|
435
|
+
case 'bigint':
|
|
436
|
+
code += node.value;
|
|
437
|
+
break;
|
|
435
438
|
case 'string':
|
|
436
439
|
code += this.convString(node);
|
|
437
440
|
break;
|
|
@@ -1421,16 +1424,16 @@ export class NakoGen {
|
|
|
1421
1424
|
let right = this._convGen(node.right, true);
|
|
1422
1425
|
let left = this._convGen(node.left, true);
|
|
1423
1426
|
if (op === '+' && this.speedMode.implicitTypeCasting === 0) {
|
|
1424
|
-
if (node.left && node.left.type !== 'number') {
|
|
1425
|
-
left = `
|
|
1427
|
+
if (node.left && node.left.type !== 'number' && node.left.type !== 'bigint') {
|
|
1428
|
+
left = `self.__parseFloatOrBigint(${left})`;
|
|
1426
1429
|
}
|
|
1427
|
-
if (node.right && node.right.type !== 'number') {
|
|
1428
|
-
right = `
|
|
1430
|
+
if (node.right && node.right.type !== 'number' && node.right.type !== 'bigint') {
|
|
1431
|
+
right = `self.__parseFloatOrBigint(${right})`;
|
|
1429
1432
|
}
|
|
1430
1433
|
}
|
|
1431
1434
|
// 階乗
|
|
1432
1435
|
if (op === '^' || op === '**') {
|
|
1433
|
-
return `(
|
|
1436
|
+
return `((${left}) ** (${right}))`;
|
|
1434
1437
|
}
|
|
1435
1438
|
// 整数の割り算 #1152
|
|
1436
1439
|
if (op === '÷÷') {
|
package/core/src/nako_gen.mts
CHANGED
|
@@ -494,6 +494,9 @@ export class NakoGen {
|
|
|
494
494
|
case 'number':
|
|
495
495
|
code += node.value
|
|
496
496
|
break
|
|
497
|
+
case 'bigint':
|
|
498
|
+
code += node.value
|
|
499
|
+
break
|
|
497
500
|
case 'string':
|
|
498
501
|
code += this.convString(node)
|
|
499
502
|
break
|
|
@@ -1491,15 +1494,15 @@ export class NakoGen {
|
|
|
1491
1494
|
let right = this._convGen(node.right as Ast, true)
|
|
1492
1495
|
let left = this._convGen(node.left as Ast, true)
|
|
1493
1496
|
if (op === '+' && this.speedMode.implicitTypeCasting === 0) {
|
|
1494
|
-
if (node.left && (node.left as Ast).type !== 'number') {
|
|
1495
|
-
left = `
|
|
1497
|
+
if (node.left && (node.left as Ast).type !== 'number' && (node.left as Ast).type !== 'bigint') {
|
|
1498
|
+
left = `self.__parseFloatOrBigint(${left})`
|
|
1496
1499
|
}
|
|
1497
|
-
if (node.right && (node.right as Ast).type !== 'number') {
|
|
1498
|
-
right = `
|
|
1500
|
+
if (node.right && (node.right as Ast).type !== 'number' && (node.right as Ast).type !== 'bigint') {
|
|
1501
|
+
right = `self.__parseFloatOrBigint(${right})`
|
|
1499
1502
|
}
|
|
1500
1503
|
}
|
|
1501
1504
|
// 階乗
|
|
1502
|
-
if (op === '^' || op === '**') { return `(
|
|
1505
|
+
if (op === '^' || op === '**') { return `((${left}) ** (${right}))` }
|
|
1503
1506
|
// 整数の割り算 #1152
|
|
1504
1507
|
if (op === '÷÷') { return `(Math.floor(${left} / ${right}))` }
|
|
1505
1508
|
|
|
@@ -25,6 +25,11 @@ export const rules = [
|
|
|
25
25
|
{ name: 'range_comment', pattern: /^\/\*/, cbParser: cbRangeComment },
|
|
26
26
|
{ name: 'def_test', pattern: /^●テスト:/ },
|
|
27
27
|
{ name: 'def_func', pattern: /^●/ },
|
|
28
|
+
// 多倍長整数リテラルの判定。整数の末尾に「n」がついているだけな為、数値判定より上に書かないとただの整数にされる
|
|
29
|
+
{ name: 'bigint', pattern: /^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*n/, readJosi: true },
|
|
30
|
+
{ name: 'bigint', pattern: /^0[oO][0-7]+(_[0-7]+)*n/, readJosi: true },
|
|
31
|
+
{ name: 'bigint', pattern: /^0[bB][0-1]+(_[0-1]+)*n/, readJosi: true },
|
|
32
|
+
{ name: 'bigint', pattern: /^\d+(_\d+)*?n/, readJosi: true },
|
|
28
33
|
// 数値の判定 --- この後nako_lexerにて単位を読む処理が入る(#994)
|
|
29
34
|
{ name: 'number', pattern: /^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*/, readJosi: true, cb: parseNumber },
|
|
30
35
|
{ name: 'number', pattern: /^0[oO][0-7]+(_[0-7]+)*/, readJosi: true, cb: parseNumber },
|
|
@@ -44,6 +44,11 @@ export const rules: NakoLexRule[] = [
|
|
|
44
44
|
{ name: 'range_comment', pattern: /^\/\*/, cbParser: cbRangeComment },
|
|
45
45
|
{ name: 'def_test', pattern: /^●テスト:/ },
|
|
46
46
|
{ name: 'def_func', pattern: /^●/ },
|
|
47
|
+
// 多倍長整数リテラルの判定。整数の末尾に「n」がついているだけな為、数値判定より上に書かないとただの整数にされる
|
|
48
|
+
{ name: 'bigint', pattern: /^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*n/, readJosi: true },
|
|
49
|
+
{ name: 'bigint', pattern: /^0[oO][0-7]+(_[0-7]+)*n/, readJosi: true },
|
|
50
|
+
{ name: 'bigint', pattern: /^0[bB][0-1]+(_[0-1]+)*n/, readJosi: true },
|
|
51
|
+
{ name: 'bigint', pattern: /^\d+(_\d+)*?n/, readJosi: true },
|
|
47
52
|
// 数値の判定 --- この後nako_lexerにて単位を読む処理が入る(#994)
|
|
48
53
|
{ name: 'number', pattern: /^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*/, readJosi: true, cb: parseNumber },
|
|
49
54
|
{ name: 'number', pattern: /^0[oO][0-7]+(_[0-7]+)*/, readJosi: true, cb: parseNumber },
|
package/core/src/nako_lexer.mjs
CHANGED
|
@@ -317,12 +317,20 @@ export class NakoLexer {
|
|
|
317
317
|
// 数字につくマイナス記号を判定
|
|
318
318
|
// (ng) 5 - 3 || word - 3
|
|
319
319
|
// (ok) (行頭)-3 || 1 * -3 || Aに -3を 足す
|
|
320
|
-
if (t.type === '-' && tokens[i + 1]
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
tokens[i].
|
|
320
|
+
if (t.type === '-' && tokens[i + 1]) {
|
|
321
|
+
const tokenType = tokens[i + 1].type;
|
|
322
|
+
if (tokenType === 'number' || tokenType === 'bigint') {
|
|
323
|
+
// 一つ前の語句が、(行頭|演算子|助詞付きの語句)なら 負数である
|
|
324
|
+
const ltype = getLastType();
|
|
325
|
+
if (ltype === 'eol' || opPriority[ltype] || tokens[i - 1].josi !== '') {
|
|
326
|
+
tokens.splice(i, 1); // remove '-'
|
|
327
|
+
if (tokenType === 'number') {
|
|
328
|
+
tokens[i].value *= -1;
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
tokens[i].value = '-' + tokens[i].value;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
326
334
|
}
|
|
327
335
|
}
|
|
328
336
|
// 助詞の「は」を = に展開
|
package/core/src/nako_lexer.mts
CHANGED
|
@@ -311,12 +311,19 @@ export class NakoLexer {
|
|
|
311
311
|
// 数字につくマイナス記号を判定
|
|
312
312
|
// (ng) 5 - 3 || word - 3
|
|
313
313
|
// (ok) (行頭)-3 || 1 * -3 || Aに -3を 足す
|
|
314
|
-
if (t.type === '-' && tokens[i + 1]
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
tokens[i].
|
|
314
|
+
if (t.type === '-' && tokens[i + 1]) {
|
|
315
|
+
const tokenType = tokens[i + 1].type
|
|
316
|
+
if (tokenType === 'number' || tokenType === 'bigint') {
|
|
317
|
+
// 一つ前の語句が、(行頭|演算子|助詞付きの語句)なら 負数である
|
|
318
|
+
const ltype = getLastType()
|
|
319
|
+
if (ltype === 'eol' || opPriority[ltype] || tokens[i - 1].josi !== '') {
|
|
320
|
+
tokens.splice(i, 1) // remove '-'
|
|
321
|
+
if (tokenType === 'number') {
|
|
322
|
+
tokens[i].value *= -1
|
|
323
|
+
} else {
|
|
324
|
+
tokens[i].value = '-' + tokens[i].value
|
|
325
|
+
}
|
|
326
|
+
}
|
|
320
327
|
}
|
|
321
328
|
}
|
|
322
329
|
// 助詞の「は」を = に展開
|
package/core/src/nako_logger.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { NakoError, NakoRuntimeError } from './nako_errors.mjs';
|
|
3
3
|
import { NakoColors } from './nako_colors.mjs';
|
|
4
4
|
/** ログレベル - 数字が高いほど優先度が高い。 */
|
|
5
|
-
class LogLevel {
|
|
5
|
+
export class LogLevel {
|
|
6
6
|
// string to level no
|
|
7
7
|
static fromS(levelStr) {
|
|
8
8
|
let level = LogLevel.trace;
|
|
@@ -46,7 +46,6 @@ LogLevel.info = 3;
|
|
|
46
46
|
LogLevel.warn = 4;
|
|
47
47
|
LogLevel.error = 5;
|
|
48
48
|
LogLevel.stdout = 6;
|
|
49
|
-
export { LogLevel };
|
|
50
49
|
/**
|
|
51
50
|
* エラー位置を日本語で表示する。
|
|
52
51
|
* たとえば `stringifyPosition({ file: "foo.txt", line: 5 })` は `"foo.txt(6行目):"` を出力する。
|
|
@@ -2027,7 +2027,7 @@ export class NakoParser extends NakoParserBase {
|
|
|
2027
2027
|
this.get();
|
|
2028
2028
|
}
|
|
2029
2029
|
// プリミティブな値
|
|
2030
|
-
if (this.checkTypes(['number', 'string'])) {
|
|
2030
|
+
if (this.checkTypes(['number', 'bigint', 'string'])) {
|
|
2031
2031
|
return this.getCur();
|
|
2032
2032
|
} // Token To Ast
|
|
2033
2033
|
// 丸括弧
|
|
@@ -1818,7 +1818,7 @@ export class NakoParser extends NakoParserBase {
|
|
|
1818
1818
|
if (this.check('comma')) { this.get() }
|
|
1819
1819
|
|
|
1820
1820
|
// プリミティブな値
|
|
1821
|
-
if (this.checkTypes(['number', 'string'])) { return this.getCur() as any } // Token To Ast
|
|
1821
|
+
if (this.checkTypes(['number', 'bigint', 'string'])) { return this.getCur() as any } // Token To Ast
|
|
1822
1822
|
|
|
1823
1823
|
// 丸括弧
|
|
1824
1824
|
if (this.check('(')) { return this.yValueKakko() }
|
|
@@ -349,6 +349,8 @@ export class NakoParserBase {
|
|
|
349
349
|
}
|
|
350
350
|
case 'number':
|
|
351
351
|
return `${typeName('数値')}${node.value}`;
|
|
352
|
+
case 'bigint':
|
|
353
|
+
return `${typeName('巨大整数')}${node.value}`;
|
|
352
354
|
case 'string':
|
|
353
355
|
return `${typeName('文字列')}『${node.value}${debug}』`;
|
|
354
356
|
case 'word':
|
|
@@ -356,6 +356,8 @@ export class NakoParserBase {
|
|
|
356
356
|
}
|
|
357
357
|
case 'number':
|
|
358
358
|
return `${typeName('数値')}${node.value}`
|
|
359
|
+
case 'bigint':
|
|
360
|
+
return `${typeName('巨大整数')}${node.value}`
|
|
359
361
|
case 'string':
|
|
360
362
|
return `${typeName('文字列')}『${node.value}${debug}』`
|
|
361
363
|
case 'word':
|
|
@@ -129,6 +129,10 @@ export default {
|
|
|
129
129
|
};
|
|
130
130
|
// 『継続表示』のための一時変数(『表示』実行で初期化)
|
|
131
131
|
sys.__printPool = '';
|
|
132
|
+
// 暗黙の型変換で足し算を行うときに使用。bigint はそのまま、その他は number に自動変換
|
|
133
|
+
sys.__parseFloatOrBigint = (v) => {
|
|
134
|
+
return (typeof v) === 'bigint' ? v : parseFloat(v);
|
|
135
|
+
};
|
|
132
136
|
// undefinedチェック
|
|
133
137
|
sys.chk = (value, constId) => {
|
|
134
138
|
if (typeof value === 'undefined') {
|
|
@@ -1658,6 +1662,21 @@ export default {
|
|
|
1658
1662
|
throw new Error('『配列ソート』で配列以外が指定されました。');
|
|
1659
1663
|
}
|
|
1660
1664
|
},
|
|
1665
|
+
'配列数値変換': {
|
|
1666
|
+
type: 'func',
|
|
1667
|
+
josi: [['の', 'を']],
|
|
1668
|
+
pure: true,
|
|
1669
|
+
fn: function (a) {
|
|
1670
|
+
// 配列ならOK
|
|
1671
|
+
if (a instanceof Array) {
|
|
1672
|
+
for (let i = 0; i < a.length; i++) {
|
|
1673
|
+
a[i] = parseFloat(a[i]);
|
|
1674
|
+
}
|
|
1675
|
+
return a;
|
|
1676
|
+
}
|
|
1677
|
+
throw new Error('『配列数値変換』で配列以外が指定されました。');
|
|
1678
|
+
}
|
|
1679
|
+
},
|
|
1661
1680
|
'配列数値ソート': {
|
|
1662
1681
|
type: 'func',
|
|
1663
1682
|
josi: [['の', 'を']],
|
|
@@ -117,6 +117,10 @@ export default {
|
|
|
117
117
|
}
|
|
118
118
|
// 『継続表示』のための一時変数(『表示』実行で初期化)
|
|
119
119
|
sys.__printPool = ''
|
|
120
|
+
// 暗黙の型変換で足し算を行うときに使用。bigint はそのまま、その他は number に自動変換
|
|
121
|
+
sys.__parseFloatOrBigint = (v: any): number | bigint => {
|
|
122
|
+
return (typeof v) === 'bigint' ? v : parseFloat(v)
|
|
123
|
+
}
|
|
120
124
|
// undefinedチェック
|
|
121
125
|
sys.chk = (value:any, constId: number): any => {
|
|
122
126
|
if (typeof value === 'undefined') {
|
|
@@ -1589,6 +1593,21 @@ export default {
|
|
|
1589
1593
|
throw new Error('『配列ソート』で配列以外が指定されました。')
|
|
1590
1594
|
}
|
|
1591
1595
|
},
|
|
1596
|
+
'配列数値変換': { // @配列Aを変換変換して返す(A自体を変更) // @はいれつすうちへんかん
|
|
1597
|
+
type: 'func',
|
|
1598
|
+
josi: [['の', 'を']],
|
|
1599
|
+
pure: true,
|
|
1600
|
+
fn: function (a: any) {
|
|
1601
|
+
// 配列ならOK
|
|
1602
|
+
if (a instanceof Array) {
|
|
1603
|
+
for (let i = 0; i < a.length; i++) {
|
|
1604
|
+
a[i] = parseFloat(a[i])
|
|
1605
|
+
}
|
|
1606
|
+
return a
|
|
1607
|
+
}
|
|
1608
|
+
throw new Error('『配列数値変換』で配列以外が指定されました。')
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1592
1611
|
'配列数値ソート': { // @配列Aをソートして返す(A自体を変更) // @はいれつすうちそーと
|
|
1593
1612
|
type: 'func',
|
|
1594
1613
|
josi: [['の', 'を']],
|
package/core/test/calc_test.mjs
CHANGED
|
@@ -170,4 +170,71 @@ describe('calc_test.js', async () => {
|
|
|
170
170
|
await cmp('N=文字数("abc")+1;Nを表示;', '4')
|
|
171
171
|
await cmp('N=1に2を足す+2に3を掛ける;Nを表示;', '15')
|
|
172
172
|
})
|
|
173
|
+
it('bigint足し算', async () => {
|
|
174
|
+
await cmp('3n+5nを表示', '8')
|
|
175
|
+
await cmp('1234567890123456789n+9876543219876543210nを表示', '11111111109999999999')
|
|
176
|
+
await cmp('a=1234567890123456789n;a+9876543219876543210nを表示', '11111111109999999999')
|
|
177
|
+
await cmp('a=1234567890123456789n;b=9876543219876543210n;a+bを表示', '11111111109999999999')
|
|
178
|
+
})
|
|
179
|
+
it('bigint四則演算', async () => {
|
|
180
|
+
await cmp('3n-5nを表示', '-2')
|
|
181
|
+
await cmp('9876543219876543210n-1234567890123456789nを表示', '8641975329753086421')
|
|
182
|
+
await cmp('a=9876543219876543210n;a-1234567890123456789nを表示', '8641975329753086421')
|
|
183
|
+
await cmp('a=9876543219876543210n;1234567890123456789n-aを表示', '-8641975329753086421')
|
|
184
|
+
await cmp('a=9876543219876543210n;b=1234567890123456789n;a-bを表示', '8641975329753086421')
|
|
185
|
+
|
|
186
|
+
await cmp('3n*5nを表示', '15')
|
|
187
|
+
await cmp('1234567890123456789n*9876543219876543210nを表示', '12193263124676116323609205901126352690')
|
|
188
|
+
await cmp('a=1234567890123456789n;a*9876543219876543210nを表示', '12193263124676116323609205901126352690')
|
|
189
|
+
await cmp('a=1234567890123456789n;9876543219876543210n*aを表示', '12193263124676116323609205901126352690')
|
|
190
|
+
await cmp('a=1234567890123456789n;b=9876543219876543210n;a*bを表示', '12193263124676116323609205901126352690')
|
|
191
|
+
|
|
192
|
+
await cmp('10n/3nを表示', '3')
|
|
193
|
+
await cmp('10n/-3nを表示', '-3')
|
|
194
|
+
await cmp('-10n/3nを表示', '-3')
|
|
195
|
+
await cmp('-10n/-3nを表示', '3')
|
|
196
|
+
await cmp('98765432198765432109876543210n/1234567890123456789nを表示', '80000000801')
|
|
197
|
+
await cmp('98765432198765432109876543210987654321987654321n/1234567890123456789nを表示', '80000000801000007290800066347')
|
|
198
|
+
await cmp('a=98765432198765432109876543210987654321987654321n;a/1234567890123456789nを表示', '80000000801000007290800066347')
|
|
199
|
+
await cmp('b=1234567890123456789n;98765432198765432109876543210987654321987654321n/bを表示', '80000000801000007290800066347')
|
|
200
|
+
await cmp('a=98765432198765432109876543210987654321987654321n;b=1234567890123456789n;a/bを表示', '80000000801000007290800066347')
|
|
201
|
+
|
|
202
|
+
await cmp('10n%3nを表示', '1')
|
|
203
|
+
await cmp('10n%-3nを表示', '1')
|
|
204
|
+
await cmp('-10n%3nを表示', '-1')
|
|
205
|
+
await cmp('-10n%-3nを表示', '-1')
|
|
206
|
+
await cmp('98765432198765432109876543210n%1234567890123456789nを表示', '9000987655221')
|
|
207
|
+
await cmp('98765432198765432109876543210987654321987654321n%1234567890123456789nを表示', '13091059800074538')
|
|
208
|
+
await cmp('a=98765432198765432109876543210987654321987654321n;a%1234567890123456789nを表示', '13091059800074538')
|
|
209
|
+
await cmp('b=1234567890123456789n;98765432198765432109876543210987654321987654321n%bを表示', '13091059800074538')
|
|
210
|
+
await cmp('a=98765432198765432109876543210987654321987654321n;b=1234567890123456789n;a%bを表示', '13091059800074538')
|
|
211
|
+
|
|
212
|
+
await cmp('10n ** 3nを表示', '1000')
|
|
213
|
+
await cmp('3n ** 60nを表示', '42391158275216203514294433201')
|
|
214
|
+
await cmp('-3n ** 60nを表示', '42391158275216203514294433201')
|
|
215
|
+
await cmp('-3n ** 61nを表示', '-127173474825648610542883299603')
|
|
216
|
+
})
|
|
217
|
+
it('bigint単項演算子', async () => {
|
|
218
|
+
await cmp('-3n*5nを表示', '-15')
|
|
219
|
+
await cmp('-1234567890123456789n*9876543219876543210nを表示', '-12193263124676116323609205901126352690')
|
|
220
|
+
await cmp('1234567890123456789n*-9876543219876543210nを表示', '-12193263124676116323609205901126352690')
|
|
221
|
+
await cmp('-1234567890123456789n*-9876543219876543210nを表示', '12193263124676116323609205901126352690')
|
|
222
|
+
|
|
223
|
+
await cmp('a=1234567890123456789n;a*-9876543219876543210nを表示', '-12193263124676116323609205901126352690')
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
it('bigint比較演算子', async () => {
|
|
228
|
+
await cmp('a= 1234567890123456789n > 9876543219876543210n; aを表示', 'false')
|
|
229
|
+
await cmp('a= 1234567890123456789n > 9876543219876543210; aを表示', 'false')
|
|
230
|
+
await cmp('a= 1234567890123456789 > 9876543219876543210n; aを表示', 'false')
|
|
231
|
+
await cmp('a= 1234567890123456789n < 9876543219876543210n; aを表示', 'true')
|
|
232
|
+
await cmp('a= 1234567890123456789n < 9876543219876543210; aを表示', 'true')
|
|
233
|
+
await cmp('a= 1234567890123456789 < 9876543219876543210n; aを表示', 'true')
|
|
234
|
+
})
|
|
235
|
+
|
|
236
|
+
it('bigintビット演算', async () => {
|
|
237
|
+
await cmp('1234567890123456789n<<60nを表示', '1423359869420436337641010675071320064')
|
|
238
|
+
await cmp('123456789012345678901234567890123456789n>>60nを表示', '107081695084215790682')
|
|
239
|
+
})
|
|
173
240
|
})
|
package/core/test/lex_test.mjs
CHANGED
|
@@ -62,6 +62,14 @@ describe('lex_test', async () => {
|
|
|
62
62
|
await cmp('0o10を表示', '8')
|
|
63
63
|
await cmp('0O11を表示', '9')
|
|
64
64
|
})
|
|
65
|
+
it('bigintのテスト', async () => {
|
|
66
|
+
await cmp('12345678901234567890123nを表示', '12345678901234567890123')
|
|
67
|
+
await cmp('-12345678901234567890123nを表示', '-12345678901234567890123')
|
|
68
|
+
await cmp('0x123456789abcdefnを表示', '81985529216486895')
|
|
69
|
+
await cmp('0o1234567123456712345671234567nを表示', '3158001080923004573399415')
|
|
70
|
+
await cmp('0b1101011010100101101110100101000111011011010101011110011100111000110011100110110101101nを表示', '32436594107500554171829677')
|
|
71
|
+
await cmp('1_2_3_4_5678_9_0_1_234_567_890_123nを表示', '12345678901234567890123')
|
|
72
|
+
})
|
|
65
73
|
it('《特別名トークン》のテスト', async () => {
|
|
66
74
|
await cmp('《今日から明日》=30;《今日から明日》を表示', '30')
|
|
67
75
|
await cmp('《AからBまで》=30;《AからBまで》を表示', '30')
|
|
@@ -71,4 +71,17 @@ describe('literal_test', async () => {
|
|
|
71
71
|
await cmp('A=100円;Aを表示', '100')
|
|
72
72
|
await cmp('B=300㎡;B=B+1㎡;Bを表示', '301')
|
|
73
73
|
})
|
|
74
|
+
it('bigintのテスト', async () => {
|
|
75
|
+
await cmp('123456789nの変数型確認して表示', 'bigint')
|
|
76
|
+
await cmp('-123456789nの変数型確認して表示', 'bigint')
|
|
77
|
+
await cmp('0x123456789ABCDEFnの変数型確認して表示', 'bigint')
|
|
78
|
+
await cmp('-0x123456789ABCDEFnの変数型確認して表示', 'bigint')
|
|
79
|
+
await cmp('0x123456789nの変数型確認して表示', 'bigint')
|
|
80
|
+
await cmp('-0x123456789nの変数型確認して表示', 'bigint')
|
|
81
|
+
await cmp('0o1234567nの変数型確認して表示', 'bigint')
|
|
82
|
+
await cmp('-0o1234567nの変数型確認して表示', 'bigint')
|
|
83
|
+
await cmp('0b10111010110nの変数型確認して表示', 'bigint')
|
|
84
|
+
await cmp('-0b10111010110nの変数型確認して表示', 'bigint')
|
|
85
|
+
await cmp('123_456_789nの変数型確認して表示', 'bigint')
|
|
86
|
+
})
|
|
74
87
|
})
|
|
@@ -179,6 +179,10 @@ describe('plugin_system_test', async () => {
|
|
|
179
179
|
it('配列ソート', async () => {
|
|
180
180
|
await cmp('A=[\'ccc\',\'bb\',\'aaa\'];Aを配列ソート。Aを「:」で配列結合。表示。', 'aaa:bb:ccc')
|
|
181
181
|
})
|
|
182
|
+
it('配列数値変換', async () => {
|
|
183
|
+
await cmp('A=[12,34,56];Aを配列数値変換。Aを「:」で配列結合。表示。', '12:34:56')
|
|
184
|
+
await cmp('A=[12,34,56];Aを配列数値変換。「{A[0]の変数型確認}, {A[1]の変数型確認}, {A[2]の変数型確認}」を表示', 'number, number, number')
|
|
185
|
+
})
|
|
182
186
|
it('配列数値ソート', async () => {
|
|
183
187
|
await cmp('A=[\'a\',1,3,2];Aを配列数値ソート。Aを「:」で配列結合。表示。', 'a:1:2:3')
|
|
184
188
|
await cmp('A=[\'30\',\'222\',\'55\'];Aを配列数値ソート。Aを「:」で配列結合。表示。', '30:55:222')
|