nadesiko3 3.7.21 → 3.7.23

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.
Files changed (212) hide show
  1. package/README.md +20 -1
  2. package/batch/command.txt +370 -334
  3. package/batch/generate_command_list.mjs +102 -0
  4. package/batch/jsplugin2text.nako3 +1 -1
  5. package/batch/pickup_command.nako3 +12 -0
  6. package/batch/search_command.mjs +34 -0
  7. package/batch/search_command.nako3 +430 -0
  8. package/core/command/snako.mts +5 -1
  9. package/core/deno/snako.ts +5 -1
  10. package/core/package-lock.json +382 -21
  11. package/core/package.json +7 -4
  12. package/core/sample/algorithms/README.md +43 -0
  13. package/core/sample/algorithms/graph/dijkstra.nako3 +47 -0
  14. package/core/sample/algorithms/graph/kruskal.nako3 +69 -0
  15. package/core/sample/algorithms/math/euclidean_gcd.nako3 +15 -0
  16. package/core/sample/algorithms/math/sieve_of_eratosthenes.nako3 +26 -0
  17. package/core/sample/algorithms/search/binary_search.nako3 +17 -0
  18. package/core/sample/algorithms/search/breadth_first_search.nako3 +33 -0
  19. package/core/sample/algorithms/search/depth_first_search.nako3 +25 -0
  20. package/core/sample/algorithms/sort/heap_sort.nako3 +37 -0
  21. package/core/sample/algorithms/sort/insertion_sort.nako3 +18 -0
  22. package/core/sample/algorithms/sort/merge_sort.nako3 +40 -0
  23. package/core/sample/algorithms/sort/quick_sort.nako3 +36 -0
  24. package/core/sample/algorithms/string/knuth_morris_pratt.nako3 +50 -0
  25. package/core/sample/algorithms/string/run_length_encoding.nako3 +25 -0
  26. package/core/src/nako3.mts +178 -614
  27. package/core/src/nako_basic_plugins.mts +39 -0
  28. package/core/src/nako_core_version.mts +2 -2
  29. package/core/src/nako_csv.mts +0 -1
  30. package/core/src/nako_event.mts +49 -0
  31. package/core/src/nako_gen.mts +320 -209
  32. package/core/src/nako_global.mts +18 -0
  33. package/core/src/nako_indent_inline.mts +2 -2
  34. package/core/src/nako_lex_rules.mts +1 -1
  35. package/core/src/nako_parser3.mts +111 -166
  36. package/core/src/nako_parser_async.mts +165 -0
  37. package/core/src/nako_parser_base.mts +4 -55
  38. package/core/src/nako_parser_message.mts +105 -0
  39. package/core/src/nako_parser_operator.mts +93 -0
  40. package/core/src/nako_plugin_manager.mts +260 -0
  41. package/core/src/nako_require.mts +292 -0
  42. package/core/src/nako_runner.mts +208 -0
  43. package/core/src/nako_tokenizer.mts +221 -0
  44. package/core/src/plugin_csv.mts +1 -1
  45. package/core/src/plugin_system.mts +34 -3259
  46. package/core/src/plugin_system_array.mts +699 -0
  47. package/core/src/plugin_system_datetime.mts +368 -0
  48. package/core/src/plugin_system_debug.mts +403 -0
  49. package/core/src/plugin_system_dict.mts +85 -0
  50. package/core/src/plugin_system_json.mts +73 -0
  51. package/core/src/plugin_system_math.mts +383 -0
  52. package/core/src/plugin_system_regexp.mts +120 -0
  53. package/core/src/plugin_system_stdio.mts +86 -0
  54. package/core/src/plugin_system_string.mts +666 -0
  55. package/core/src/plugin_system_timer.mts +152 -0
  56. package/core/src/plugin_system_types.mts +151 -0
  57. package/core/src/plugin_system_url.mts +193 -0
  58. package/core/src/plugin_toml.mts +3 -3
  59. package/core/test/algorithm_samples_test.mjs +58 -0
  60. package/core/test/algorithms/graph/dijkstra_test.nako3 +21 -0
  61. package/core/test/algorithms/graph/kruskal_test.nako3 +21 -0
  62. package/core/test/algorithms/helper.mjs +13 -0
  63. package/core/test/algorithms/math/euclidean_gcd_test.nako3 +13 -0
  64. package/core/test/algorithms/math/sieve_of_eratosthenes_test.nako3 +10 -0
  65. package/core/test/algorithms/search/binary_search_test.nako3 +15 -0
  66. package/core/test/algorithms/search/breadth_first_search_test.nako3 +13 -0
  67. package/core/test/algorithms/search/depth_first_search_test.nako3 +13 -0
  68. package/core/test/algorithms/sort/heap_sort_test.nako3 +13 -0
  69. package/core/test/algorithms/sort/insertion_sort_test.nako3 +13 -0
  70. package/core/test/algorithms/sort/merge_sort_test.nako3 +18 -0
  71. package/core/test/algorithms/sort/quick_sort_test.nako3 +34 -0
  72. package/core/test/algorithms/string/knuth_morris_pratt_test.nako3 +16 -0
  73. package/core/test/algorithms/string/run_length_encoding_test.nako3 +13 -0
  74. package/core/test/array_test.mjs +3 -0
  75. package/core/test/fixtures/README.md +39 -0
  76. package/core/test/fixtures/make_parser_ast_golden.mjs +31 -0
  77. package/core/test/fixtures/parser_ast_golden.json +8027 -0
  78. package/core/test/fixtures/parser_corpus.mjs +120 -0
  79. package/core/test/func_call.mjs +18 -0
  80. package/core/test/func_test.mjs +28 -0
  81. package/core/test/indent_test.mjs +6 -0
  82. package/core/test/nako_basic_plugins_test.mjs +44 -0
  83. package/core/test/nako_event_test.mjs +127 -0
  84. package/core/test/nako_gen_perf_test.mjs +178 -0
  85. package/core/test/nako_parser_async_test.mjs +385 -0
  86. package/core/test/nako_parser_test.mjs +160 -0
  87. package/core/test/nako_plugin_manager_test.mjs +185 -0
  88. package/core/test/nako_require_test.mjs +153 -0
  89. package/core/test/nako_runner_test.mjs +174 -0
  90. package/core/test/nako_tokenizer_test.mjs +115 -0
  91. package/core/test/plugin_system_debug_test.mjs +138 -0
  92. package/core/test/plugin_system_split_test.mjs +179 -0
  93. package/core/test/plugin_system_test.mjs +6 -0
  94. package/core/tsconfig.json +0 -1
  95. package/demo/browsers.html +1 -1
  96. package/doc/SETUP.md +1 -1
  97. package/doc/ai-code-generation.md +136 -0
  98. package/doc/browsers.md +1 -1
  99. package/doc/command_list.json +16842 -0
  100. package/doc/search_command.md +222 -0
  101. package/doc/syntax-nako3.md +344 -0
  102. package/package.json +29 -26
  103. package/release/_hash.txt +40 -40
  104. package/release/_script-tags.txt +16 -16
  105. package/release/command.json +1 -1
  106. package/release/command.json.js +1 -1
  107. package/release/command_cnako3.json +1 -1
  108. package/release/command_list.json +1 -1
  109. package/release/edit_main.js +6 -6
  110. package/release/edit_main.js.map +3 -3
  111. package/release/editor.js +6 -6
  112. package/release/plugin_caniuse.js +1 -1
  113. package/release/plugin_caniuse.js.map +2 -2
  114. package/release/plugin_keigo.js.map +3 -3
  115. package/release/plugin_markup.js +46 -46
  116. package/release/plugin_markup.js.map +3 -3
  117. package/release/plugin_weykturtle3d.js +1 -1
  118. package/release/plugin_weykturtle3d.js.map +3 -3
  119. package/release/version.js +2 -2
  120. package/release/version_main.js +2 -2
  121. package/release/version_main.js.map +1 -1
  122. package/release/wnako3.js +219 -230
  123. package/release/wnako3.js.map +4 -4
  124. package/release/wnako3webworker.js +193 -204
  125. package/release/wnako3webworker.js.map +4 -4
  126. package/src/browsers.mjs +1 -1
  127. package/src/browsers.txt +0 -1
  128. package/src/cnako3mod.mjs +7 -2
  129. package/src/cnako3mod.mts +7 -2
  130. package/src/nako_version.mjs +2 -2
  131. package/src/nako_version.mts +2 -2
  132. package/src/plugin_browser_ajax.mjs +4 -4
  133. package/src/plugin_browser_ajax.mts +4 -4
  134. package/src/plugin_browser_audio.mjs +10 -10
  135. package/src/plugin_browser_audio.mts +10 -10
  136. package/src/plugin_browser_camera.mjs +4 -4
  137. package/src/plugin_browser_camera.mts +4 -4
  138. package/src/plugin_browser_canvas.mjs +2 -2
  139. package/src/plugin_browser_canvas.mts +2 -2
  140. package/src/plugin_browser_crypto.mjs +3 -3
  141. package/src/plugin_browser_crypto.mts +3 -3
  142. package/src/plugin_browser_dom_event.mjs +1 -1
  143. package/src/plugin_browser_dom_event.mts +1 -1
  144. package/src/plugin_browser_geolocation.mjs +1 -1
  145. package/src/plugin_browser_geolocation.mts +1 -1
  146. package/src/plugin_browser_hotkey.mjs +1 -1
  147. package/src/plugin_browser_hotkey.mts +1 -1
  148. package/src/plugin_browser_html.mjs +1 -1
  149. package/src/plugin_browser_html.mts +1 -1
  150. package/src/plugin_browser_location.mjs +1 -1
  151. package/src/plugin_browser_location.mts +1 -1
  152. package/src/plugin_browser_speech.mjs +1 -1
  153. package/src/plugin_browser_speech.mts +1 -1
  154. package/src/plugin_browser_storage.mjs +2 -2
  155. package/src/plugin_browser_storage.mts +2 -2
  156. package/src/plugin_httpserver.mjs +3 -3
  157. package/src/plugin_httpserver.mts +3 -3
  158. package/src/plugin_keigo.mjs +2 -2
  159. package/src/plugin_keigo.mts +2 -2
  160. package/src/plugin_node.mjs +48 -48
  161. package/src/plugin_node.mts +53 -53
  162. package/src/plugin_weykturtle3d.mjs +56 -56
  163. package/src/plugin_weykturtle3d.mts +56 -56
  164. package/src/wnako3.mjs +1 -1
  165. package/src/wnako3.mts +1 -1
  166. package/src/wnako3_editor.mjs +5 -5
  167. package/src/wnako3_editor.mts +5 -5
  168. package/src/wnako3mod.mjs +2 -2
  169. package/src/wnako3mod.mts +2 -2
  170. package/test/nako3edit/index_nako3_test.mjs +282 -0
  171. package/test/nako3server/index_nako3_test.mjs +239 -0
  172. package/test/node/ai_code_generation_guide_test.mjs +29 -0
  173. package/test/node/node_version_support_test.mjs +45 -0
  174. package/test/node/search_command_test.mjs +174 -0
  175. package/tools/nako3edit/AGENTS.md +23 -0
  176. package/tools/nako3edit/index.nako3 +404 -0
  177. package/tools/nako3server/AGENTS.md +23 -0
  178. package/tools/nako3server/index.nako3 +156 -23
  179. package/core/src/nako3.mjs +0 -1021
  180. package/core/src/nako_ast.mjs +0 -4
  181. package/core/src/nako_colors.mjs +0 -77
  182. package/core/src/nako_core_version.mjs +0 -8
  183. package/core/src/nako_csv.mjs +0 -193
  184. package/core/src/nako_errors.mjs +0 -166
  185. package/core/src/nako_from_dncl.mjs +0 -285
  186. package/core/src/nako_from_dncl2.mjs +0 -347
  187. package/core/src/nako_gen.mjs +0 -2500
  188. package/core/src/nako_global.mjs +0 -138
  189. package/core/src/nako_indent.mjs +0 -442
  190. package/core/src/nako_indent_chars.mjs +0 -29
  191. package/core/src/nako_indent_inline.mjs +0 -361
  192. package/core/src/nako_josi_list.mjs +0 -47
  193. package/core/src/nako_lex_rules.mjs +0 -319
  194. package/core/src/nako_lexer.mjs +0 -794
  195. package/core/src/nako_logger.mjs +0 -221
  196. package/core/src/nako_parser3.mjs +0 -3250
  197. package/core/src/nako_parser_base.mjs +0 -403
  198. package/core/src/nako_parser_const.mjs +0 -37
  199. package/core/src/nako_prepare.mjs +0 -329
  200. package/core/src/nako_reserved_words.mjs +0 -42
  201. package/core/src/nako_source_mapping.mjs +0 -207
  202. package/core/src/nako_test.mjs +0 -37
  203. package/core/src/nako_token.mjs +0 -1
  204. package/core/src/nako_tools.mjs +0 -53
  205. package/core/src/nako_types.mjs +0 -14
  206. package/core/src/plugin_api.mjs +0 -4
  207. package/core/src/plugin_csv.mjs +0 -97
  208. package/core/src/plugin_math.mjs +0 -352
  209. package/core/src/plugin_promise.mjs +0 -102
  210. package/core/src/plugin_system.mjs +0 -3810
  211. package/core/src/plugin_test.mjs +0 -52
  212. package/core/src/plugin_toml.mjs +0 -39
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "nadesiko3core",
3
- "version": "3.7.18",
3
+ "version": "3.7.21",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "nadesiko3core",
9
- "version": "3.7.18",
9
+ "version": "3.7.21",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "cross-env": "^10.0.0",
13
- "smol-toml": "1.6.1"
13
+ "smol-toml": "1.7.1"
14
14
  },
15
15
  "bin": {
16
16
  "snako": "command/snako.mjs"
17
17
  },
18
18
  "devDependencies": {
19
- "@types/node": "^25.6.0",
20
- "typescript": "^6.0.3"
19
+ "@types/node": "^26.1.2",
20
+ "typescript": "^7.0.2"
21
21
  }
22
22
  },
23
23
  "node_modules/@epic-web/invariant": {
@@ -27,13 +27,353 @@
27
27
  "license": "MIT"
28
28
  },
29
29
  "node_modules/@types/node": {
30
- "version": "25.6.0",
31
- "resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz",
32
- "integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==",
30
+ "version": "26.1.2",
31
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.2.tgz",
32
+ "integrity": "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==",
33
33
  "dev": true,
34
34
  "license": "MIT",
35
35
  "dependencies": {
36
- "undici-types": "~7.19.0"
36
+ "undici-types": "~8.3.0"
37
+ }
38
+ },
39
+ "node_modules/@typescript/typescript-aix-ppc64": {
40
+ "version": "7.0.2",
41
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz",
42
+ "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==",
43
+ "cpu": [
44
+ "ppc64"
45
+ ],
46
+ "dev": true,
47
+ "license": "Apache-2.0",
48
+ "optional": true,
49
+ "os": [
50
+ "aix"
51
+ ],
52
+ "engines": {
53
+ "node": ">=16.20.0"
54
+ }
55
+ },
56
+ "node_modules/@typescript/typescript-darwin-arm64": {
57
+ "version": "7.0.2",
58
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz",
59
+ "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==",
60
+ "cpu": [
61
+ "arm64"
62
+ ],
63
+ "dev": true,
64
+ "license": "Apache-2.0",
65
+ "optional": true,
66
+ "os": [
67
+ "darwin"
68
+ ],
69
+ "engines": {
70
+ "node": ">=16.20.0"
71
+ }
72
+ },
73
+ "node_modules/@typescript/typescript-darwin-x64": {
74
+ "version": "7.0.2",
75
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz",
76
+ "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==",
77
+ "cpu": [
78
+ "x64"
79
+ ],
80
+ "dev": true,
81
+ "license": "Apache-2.0",
82
+ "optional": true,
83
+ "os": [
84
+ "darwin"
85
+ ],
86
+ "engines": {
87
+ "node": ">=16.20.0"
88
+ }
89
+ },
90
+ "node_modules/@typescript/typescript-freebsd-arm64": {
91
+ "version": "7.0.2",
92
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz",
93
+ "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==",
94
+ "cpu": [
95
+ "arm64"
96
+ ],
97
+ "dev": true,
98
+ "license": "Apache-2.0",
99
+ "optional": true,
100
+ "os": [
101
+ "freebsd"
102
+ ],
103
+ "engines": {
104
+ "node": ">=16.20.0"
105
+ }
106
+ },
107
+ "node_modules/@typescript/typescript-freebsd-x64": {
108
+ "version": "7.0.2",
109
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz",
110
+ "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==",
111
+ "cpu": [
112
+ "x64"
113
+ ],
114
+ "dev": true,
115
+ "license": "Apache-2.0",
116
+ "optional": true,
117
+ "os": [
118
+ "freebsd"
119
+ ],
120
+ "engines": {
121
+ "node": ">=16.20.0"
122
+ }
123
+ },
124
+ "node_modules/@typescript/typescript-linux-arm": {
125
+ "version": "7.0.2",
126
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz",
127
+ "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==",
128
+ "cpu": [
129
+ "arm"
130
+ ],
131
+ "dev": true,
132
+ "license": "Apache-2.0",
133
+ "optional": true,
134
+ "os": [
135
+ "linux"
136
+ ],
137
+ "engines": {
138
+ "node": ">=16.20.0"
139
+ }
140
+ },
141
+ "node_modules/@typescript/typescript-linux-arm64": {
142
+ "version": "7.0.2",
143
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz",
144
+ "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==",
145
+ "cpu": [
146
+ "arm64"
147
+ ],
148
+ "dev": true,
149
+ "license": "Apache-2.0",
150
+ "optional": true,
151
+ "os": [
152
+ "linux"
153
+ ],
154
+ "engines": {
155
+ "node": ">=16.20.0"
156
+ }
157
+ },
158
+ "node_modules/@typescript/typescript-linux-loong64": {
159
+ "version": "7.0.2",
160
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz",
161
+ "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==",
162
+ "cpu": [
163
+ "loong64"
164
+ ],
165
+ "dev": true,
166
+ "license": "Apache-2.0",
167
+ "optional": true,
168
+ "os": [
169
+ "linux"
170
+ ],
171
+ "engines": {
172
+ "node": ">=16.20.0"
173
+ }
174
+ },
175
+ "node_modules/@typescript/typescript-linux-mips64el": {
176
+ "version": "7.0.2",
177
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz",
178
+ "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==",
179
+ "cpu": [
180
+ "mips64el"
181
+ ],
182
+ "dev": true,
183
+ "license": "Apache-2.0",
184
+ "optional": true,
185
+ "os": [
186
+ "linux"
187
+ ],
188
+ "engines": {
189
+ "node": ">=16.20.0"
190
+ }
191
+ },
192
+ "node_modules/@typescript/typescript-linux-ppc64": {
193
+ "version": "7.0.2",
194
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz",
195
+ "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==",
196
+ "cpu": [
197
+ "ppc64"
198
+ ],
199
+ "dev": true,
200
+ "license": "Apache-2.0",
201
+ "optional": true,
202
+ "os": [
203
+ "linux"
204
+ ],
205
+ "engines": {
206
+ "node": ">=16.20.0"
207
+ }
208
+ },
209
+ "node_modules/@typescript/typescript-linux-riscv64": {
210
+ "version": "7.0.2",
211
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz",
212
+ "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==",
213
+ "cpu": [
214
+ "riscv64"
215
+ ],
216
+ "dev": true,
217
+ "license": "Apache-2.0",
218
+ "optional": true,
219
+ "os": [
220
+ "linux"
221
+ ],
222
+ "engines": {
223
+ "node": ">=16.20.0"
224
+ }
225
+ },
226
+ "node_modules/@typescript/typescript-linux-s390x": {
227
+ "version": "7.0.2",
228
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz",
229
+ "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==",
230
+ "cpu": [
231
+ "s390x"
232
+ ],
233
+ "dev": true,
234
+ "license": "Apache-2.0",
235
+ "optional": true,
236
+ "os": [
237
+ "linux"
238
+ ],
239
+ "engines": {
240
+ "node": ">=16.20.0"
241
+ }
242
+ },
243
+ "node_modules/@typescript/typescript-linux-x64": {
244
+ "version": "7.0.2",
245
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz",
246
+ "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==",
247
+ "cpu": [
248
+ "x64"
249
+ ],
250
+ "dev": true,
251
+ "license": "Apache-2.0",
252
+ "optional": true,
253
+ "os": [
254
+ "linux"
255
+ ],
256
+ "engines": {
257
+ "node": ">=16.20.0"
258
+ }
259
+ },
260
+ "node_modules/@typescript/typescript-netbsd-arm64": {
261
+ "version": "7.0.2",
262
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz",
263
+ "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==",
264
+ "cpu": [
265
+ "arm64"
266
+ ],
267
+ "dev": true,
268
+ "license": "Apache-2.0",
269
+ "optional": true,
270
+ "os": [
271
+ "netbsd"
272
+ ],
273
+ "engines": {
274
+ "node": ">=16.20.0"
275
+ }
276
+ },
277
+ "node_modules/@typescript/typescript-netbsd-x64": {
278
+ "version": "7.0.2",
279
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz",
280
+ "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==",
281
+ "cpu": [
282
+ "x64"
283
+ ],
284
+ "dev": true,
285
+ "license": "Apache-2.0",
286
+ "optional": true,
287
+ "os": [
288
+ "netbsd"
289
+ ],
290
+ "engines": {
291
+ "node": ">=16.20.0"
292
+ }
293
+ },
294
+ "node_modules/@typescript/typescript-openbsd-arm64": {
295
+ "version": "7.0.2",
296
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz",
297
+ "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==",
298
+ "cpu": [
299
+ "arm64"
300
+ ],
301
+ "dev": true,
302
+ "license": "Apache-2.0",
303
+ "optional": true,
304
+ "os": [
305
+ "openbsd"
306
+ ],
307
+ "engines": {
308
+ "node": ">=16.20.0"
309
+ }
310
+ },
311
+ "node_modules/@typescript/typescript-openbsd-x64": {
312
+ "version": "7.0.2",
313
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz",
314
+ "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==",
315
+ "cpu": [
316
+ "x64"
317
+ ],
318
+ "dev": true,
319
+ "license": "Apache-2.0",
320
+ "optional": true,
321
+ "os": [
322
+ "openbsd"
323
+ ],
324
+ "engines": {
325
+ "node": ">=16.20.0"
326
+ }
327
+ },
328
+ "node_modules/@typescript/typescript-sunos-x64": {
329
+ "version": "7.0.2",
330
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz",
331
+ "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==",
332
+ "cpu": [
333
+ "x64"
334
+ ],
335
+ "dev": true,
336
+ "license": "Apache-2.0",
337
+ "optional": true,
338
+ "os": [
339
+ "sunos"
340
+ ],
341
+ "engines": {
342
+ "node": ">=16.20.0"
343
+ }
344
+ },
345
+ "node_modules/@typescript/typescript-win32-arm64": {
346
+ "version": "7.0.2",
347
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz",
348
+ "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==",
349
+ "cpu": [
350
+ "arm64"
351
+ ],
352
+ "dev": true,
353
+ "license": "Apache-2.0",
354
+ "optional": true,
355
+ "os": [
356
+ "win32"
357
+ ],
358
+ "engines": {
359
+ "node": ">=16.20.0"
360
+ }
361
+ },
362
+ "node_modules/@typescript/typescript-win32-x64": {
363
+ "version": "7.0.2",
364
+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz",
365
+ "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==",
366
+ "cpu": [
367
+ "x64"
368
+ ],
369
+ "dev": true,
370
+ "license": "Apache-2.0",
371
+ "optional": true,
372
+ "os": [
373
+ "win32"
374
+ ],
375
+ "engines": {
376
+ "node": ">=16.20.0"
37
377
  }
38
378
  },
39
379
  "node_modules/cross-env": {
@@ -104,9 +444,9 @@
104
444
  }
105
445
  },
106
446
  "node_modules/smol-toml": {
107
- "version": "1.6.1",
108
- "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.1.tgz",
109
- "integrity": "sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==",
447
+ "version": "1.7.1",
448
+ "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.7.1.tgz",
449
+ "integrity": "sha512-PPlsspAZ4jbMBu5DMFhfUGDQLu/vrL4SyBROVS37x8ynnVmFIs1VPBz1Co8Xks3TvpIaZXmU85y4DrQ+UyVFoQ==",
110
450
  "license": "BSD-3-Clause",
111
451
  "engines": {
112
452
  "node": ">= 18"
@@ -116,23 +456,44 @@
116
456
  }
117
457
  },
118
458
  "node_modules/typescript": {
119
- "version": "6.0.3",
120
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",
121
- "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==",
459
+ "version": "7.0.2",
460
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz",
461
+ "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==",
122
462
  "dev": true,
123
463
  "license": "Apache-2.0",
124
464
  "bin": {
125
- "tsc": "bin/tsc",
126
- "tsserver": "bin/tsserver"
465
+ "tsc": "bin/tsc"
127
466
  },
128
467
  "engines": {
129
- "node": ">=14.17"
468
+ "node": ">=16.20.0"
469
+ },
470
+ "optionalDependencies": {
471
+ "@typescript/typescript-aix-ppc64": "7.0.2",
472
+ "@typescript/typescript-darwin-arm64": "7.0.2",
473
+ "@typescript/typescript-darwin-x64": "7.0.2",
474
+ "@typescript/typescript-freebsd-arm64": "7.0.2",
475
+ "@typescript/typescript-freebsd-x64": "7.0.2",
476
+ "@typescript/typescript-linux-arm": "7.0.2",
477
+ "@typescript/typescript-linux-arm64": "7.0.2",
478
+ "@typescript/typescript-linux-loong64": "7.0.2",
479
+ "@typescript/typescript-linux-mips64el": "7.0.2",
480
+ "@typescript/typescript-linux-ppc64": "7.0.2",
481
+ "@typescript/typescript-linux-riscv64": "7.0.2",
482
+ "@typescript/typescript-linux-s390x": "7.0.2",
483
+ "@typescript/typescript-linux-x64": "7.0.2",
484
+ "@typescript/typescript-netbsd-arm64": "7.0.2",
485
+ "@typescript/typescript-netbsd-x64": "7.0.2",
486
+ "@typescript/typescript-openbsd-arm64": "7.0.2",
487
+ "@typescript/typescript-openbsd-x64": "7.0.2",
488
+ "@typescript/typescript-sunos-x64": "7.0.2",
489
+ "@typescript/typescript-win32-arm64": "7.0.2",
490
+ "@typescript/typescript-win32-x64": "7.0.2"
130
491
  }
131
492
  },
132
493
  "node_modules/undici-types": {
133
- "version": "7.19.2",
134
- "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz",
135
- "integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==",
494
+ "version": "8.3.0",
495
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
496
+ "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
136
497
  "dev": true,
137
498
  "license": "MIT"
138
499
  },
package/core/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nadesiko3core",
3
- "version": "3.7.21",
3
+ "version": "3.7.23",
4
4
  "description": "Japanese Programming Language Nadesiko v3 core",
5
5
  "main": "index.mjs",
6
6
  "type": "module",
@@ -29,6 +29,9 @@
29
29
  "url": "https://github.com/kujirahand/nadesiko3core/issues"
30
30
  },
31
31
  "homepage": "https://github.com/kujirahand/nadesiko3core#readme",
32
+ "engines": {
33
+ "node": ">=22.0.0"
34
+ },
32
35
  "files": [
33
36
  "src",
34
37
  "batch",
@@ -36,11 +39,11 @@
36
39
  "sample"
37
40
  ],
38
41
  "devDependencies": {
39
- "@types/node": "^26.0.0",
40
- "typescript": "^6.0.3"
42
+ "@types/node": "^26.1.1",
43
+ "typescript": "^7.0.2"
41
44
  },
42
45
  "dependencies": {
43
46
  "cross-env": "^10.0.0",
44
- "smol-toml": "1.6.1"
47
+ "smol-toml": "1.7.1"
45
48
  }
46
49
  }
@@ -0,0 +1,43 @@
1
+ # なでしこ3のアルゴリズム集
2
+
3
+ `doc/syntax-nako3.md` に記載された文法を中心に、有名なアルゴリズムをなでしこ3で実装するためのサンプル集です。
4
+
5
+ ## 追加規約
6
+
7
+ - アルゴリズムは種類ごとのディレクトリに分け、1ファイルに1つ実装します。
8
+ - ファイル名には、英語のスネークケースを使います。
9
+ - ユーザー定義関数は標準命令と区別できるよう、`クイックソート処理`のように末尾へ`処理`を付けます。補助関数にも同じ規則を適用します。
10
+ - 関数内のローカル変数は、`F左値`や`F中央値`のように先頭へ`F`を付けます。
11
+ - ファイルの冒頭に、入出力、元データを変更するか、計算量を記載します。
12
+ - サンプルファイルには関数定義だけを置き、実行時に表示などの副作用を発生させません。
13
+ - アルゴリズムと同じ処理を行う組み込み命令には処理を委譲せず、アルゴリズムそのものを実装します。
14
+ - 対応するなでしこのテストを `core/test/algorithms/` 以下の同じ分類へ、`実装名_test.nako3` という名前で追加します。
15
+ - テストの入力、期待値、比較はなでしこで記述し、`ASSERT等` で検証します。
16
+
17
+ ## 分類
18
+
19
+ - `sort/` - ソートアルゴリズム
20
+ - `search/` - 探索アルゴリズム
21
+ - `math/` - 数学アルゴリズム
22
+ - `graph/` - グラフアルゴリズム
23
+ - `string/` - 文字列アルゴリズム
24
+
25
+ ## 収録アルゴリズム
26
+
27
+ - `sort/` - クイックソート、マージソート、ヒープソート、挿入ソート
28
+ - `search/` - 二分探索、幅優先探索、深さ優先探索
29
+ - `math/` - ユークリッドの互除法、エラトステネスの篩
30
+ - `graph/` - ダイクストラ法、クラスカル法
31
+ - `string/` - KMP法、ランレングス圧縮
32
+
33
+ ## テスト
34
+
35
+ 全アルゴリズムの `*_test.nako3` は、`core/test/algorithm_samples_test.mjs` が自動的に検出します。JavaScript側は実装とテストを読み込むだけで、実際のテストケースはなでしこで実行されます。個別確認と全体の回帰確認は、リポジトリのルートで次のように実行します。
36
+
37
+ ```sh
38
+ node --test --test-name-pattern sort/quick_sort \
39
+ --import ./test/node-test-globals.mjs \
40
+ core/test/algorithm_samples_test.mjs
41
+
42
+ npm test
43
+ ```
@@ -0,0 +1,47 @@
1
+ # ダイクストラ法
2
+ # 入力: 重み付き隣接リストと開始点
3
+ # 辺の形式: {"先": 頂点番号, "重み": 0以上の数値}
4
+ # 出力: 開始点から各頂点までの最短距離。到達不能は-1
5
+ # 計算量: O(V^2+E)
6
+
7
+ ●(グラフを開始点から)ダイクストラ法処理とは:
8
+ 変数のF距離は[]
9
+ 変数のF頂点数はグラフの要素数
10
+ もし、((開始点<0)または(開始点>=F頂点数))ならば:
11
+ F距離を戻す
12
+
13
+ 変数のF確定済みは[]
14
+ 変数のF位置は0
15
+ (F位置<F頂点数)の間:
16
+ F距離[F位置]は-1
17
+ F位置はF位置+1
18
+ F距離[開始点]は0
19
+
20
+ 変数のF処理数は0
21
+ (F処理数<F頂点数)の間:
22
+ 変数のF現在点は-1
23
+ 変数のF最小距離は-1
24
+ F位置は0
25
+ (F位置<F頂点数)の間:
26
+ もし、((F確定済み[F位置]!=真)かつ(F距離[F位置]>=0))ならば:
27
+ もし、((F現在点=-1)または(F距離[F位置]<F最小距離))ならば:
28
+ F現在点はF位置
29
+ F最小距離はF距離[F位置]
30
+ F位置はF位置+1
31
+
32
+ もし、F現在点=-1ならば:
33
+ F処理数はF頂点数
34
+ 違えば:
35
+ F確定済み[F現在点]は真
36
+ F処理数はF処理数+1
37
+ 変数のF辺一覧はグラフ[F現在点]
38
+ 変数のF辺数はF辺一覧の要素数
39
+ 変数のF辺位置は0
40
+ (F辺位置<F辺数)の間:
41
+ 変数のF辺はF辺一覧[F辺位置]
42
+ 変数のF隣接点はF辺["先"]
43
+ 変数のF候補距離はF最小距離+F辺["重み"]
44
+ もし、((F距離[F隣接点]=-1)または(F候補距離<F距離[F隣接点]))ならば:
45
+ F距離[F隣接点]はF候補距離
46
+ F辺位置はF辺位置+1
47
+ F距離を戻す
@@ -0,0 +1,69 @@
1
+ # クラスカル法
2
+ # 入力: 頂点数と辺の配列
3
+ # 辺の形式: {"始": 頂点番号, "終": 頂点番号, "重み": 数値}
4
+ # 出力: 最小全域木の辺配列。非連結グラフでは最小全域森
5
+ # 計算量: O(V+E^2+E×α(V))(辺の並べ替えに挿入ソートを使用)
6
+
7
+ ●(親配列と頂点の)根取得処理とは:
8
+ 変数のF根は頂点
9
+ (親配列[F根]!=F根)の間:
10
+ F根は親配列[F根]
11
+ (親配列[頂点]!=頂点)の間:
12
+ 変数のF次点は親配列[頂点]
13
+ 親配列[頂点]はF根
14
+ 頂点はF次点
15
+ F根を戻す
16
+
17
+ ●(親配列とランク配列と始根と終根で)根統合処理とは:
18
+ もし、ランク配列[始根]<ランク配列[終根]ならば:
19
+ 親配列[始根]は終根
20
+ 違えば、もし、ランク配列[始根]>ランク配列[終根]ならば:
21
+ 親配列[終根]は始根
22
+ 違えば:
23
+ 親配列[終根]は始根
24
+ ランク配列[始根]はランク配列[始根]+1
25
+
26
+ ●(辺一覧を)辺重み順整列処理とは:
27
+ 変数のF整列済みは[]
28
+ 変数のF辺数は辺一覧の要素数
29
+ 変数のF位置は0
30
+ (F位置<F辺数)の間:
31
+ 変数のF辺は辺一覧[F位置]
32
+ F整列済みにF辺を配列プッシュ
33
+ 変数のF挿入位置はF整列済みの要素数-1
34
+ ((F挿入位置>0)かつ(F整列済み[F挿入位置-1]["重み"]>F辺["重み"]))の間:
35
+ F整列済み[F挿入位置]はF整列済み[F挿入位置-1]
36
+ F挿入位置はF挿入位置-1
37
+ F整列済み[F挿入位置]はF辺
38
+ F位置はF位置+1
39
+ F整列済みを戻す
40
+
41
+ ●(頂点数と辺一覧で)クラスカル法処理とは:
42
+ 変数のF結果は[]
43
+ もし、頂点数<=0ならば:
44
+ F結果を戻す
45
+
46
+ 変数のF親配列は[]
47
+ 変数のFランク配列は[]
48
+ 変数のF位置は0
49
+ (F位置<頂点数)の間:
50
+ F親配列[F位置]はF位置
51
+ Fランク配列[F位置]は0
52
+ F位置はF位置+1
53
+
54
+ 変数のF整列辺は辺一覧を辺重み順整列処理
55
+ 変数のF辺数はF整列辺の要素数
56
+ 変数のF採用数は0
57
+ F位置は0
58
+ ((F位置<F辺数)かつ(F採用数<(頂点数-1)))の間:
59
+ 変数のF辺はF整列辺[F位置]
60
+ 変数のF始点はF辺["始"]
61
+ 変数のF終点はF辺["終"]
62
+ 変数のF始根はF親配列とF始点の根取得処理
63
+ 変数のF終根はF親配列とF終点の根取得処理
64
+ もし、F始根!=F終根ならば:
65
+ F結果にF辺を配列プッシュ
66
+ F親配列とFランク配列とF始根とF終根で根統合処理
67
+ F採用数はF採用数+1
68
+ F位置はF位置+1
69
+ F結果を戻す
@@ -0,0 +1,15 @@
1
+ # ユークリッドの互除法
2
+ # 入力: 2つの整数
3
+ # 出力: 2数の最大公約数(常に0以上)
4
+ # 計算量: O(log(min(A, B)))
5
+
6
+ ●(AとBの)最大公約数計算処理とは:
7
+ もし、A<0ならば:
8
+ Aは0-A
9
+ もし、B<0ならば:
10
+ Bは0-B
11
+ (B!=0)の間:
12
+ 変数のF余りはA%B
13
+ AはB
14
+ BはF余り
15
+ Aを戻す