nadesiko3 3.7.20 → 3.7.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/batch/command.txt +483 -445
  2. package/batch/jsplugin2text.nako3 +1 -1
  3. package/batch/pickup_command.nako3 +12 -0
  4. package/core/command/snako.mts +5 -1
  5. package/core/deno/snako.ts +5 -1
  6. package/core/package-lock.json +382 -21
  7. package/core/package.json +4 -4
  8. package/core/src/README.md +98 -0
  9. package/core/src/nako3.mts +178 -614
  10. package/core/src/nako_basic_plugins.mts +39 -0
  11. package/core/src/nako_core_version.mts +2 -2
  12. package/core/src/nako_csv.mts +0 -1
  13. package/core/src/nako_event.mts +49 -0
  14. package/core/src/nako_gen.mts +291 -202
  15. package/core/src/nako_indent_inline.mts +2 -2
  16. package/core/src/nako_lex_rules.mts +1 -1
  17. package/core/src/nako_parser3.mts +106 -165
  18. package/core/src/nako_parser_async.mts +97 -0
  19. package/core/src/nako_parser_base.mts +4 -55
  20. package/core/src/nako_parser_message.mts +105 -0
  21. package/core/src/nako_parser_operator.mts +93 -0
  22. package/core/src/nako_plugin_manager.mts +260 -0
  23. package/core/src/nako_require.mts +292 -0
  24. package/core/src/nako_runner.mts +191 -0
  25. package/core/src/nako_tokenizer.mts +221 -0
  26. package/core/src/plugin_csv.mts +1 -1
  27. package/core/src/plugin_system.mts +34 -3259
  28. package/core/src/plugin_system_array.mts +699 -0
  29. package/core/src/plugin_system_datetime.mts +368 -0
  30. package/core/src/plugin_system_debug.mts +403 -0
  31. package/core/src/plugin_system_dict.mts +85 -0
  32. package/core/src/plugin_system_json.mts +73 -0
  33. package/core/src/plugin_system_math.mts +383 -0
  34. package/core/src/plugin_system_regexp.mts +120 -0
  35. package/core/src/plugin_system_stdio.mts +86 -0
  36. package/core/src/plugin_system_string.mts +666 -0
  37. package/core/src/plugin_system_timer.mts +152 -0
  38. package/core/src/plugin_system_types.mts +151 -0
  39. package/core/src/plugin_system_url.mts +193 -0
  40. package/core/src/plugin_toml.mts +3 -3
  41. package/core/test/fixtures/README.md +39 -0
  42. package/core/test/fixtures/make_parser_ast_golden.mjs +31 -0
  43. package/core/test/fixtures/parser_ast_golden.json +8027 -0
  44. package/core/test/fixtures/parser_corpus.mjs +120 -0
  45. package/core/test/indent_test.mjs +6 -0
  46. package/core/test/nako_basic_plugins_test.mjs +44 -0
  47. package/core/test/nako_event_test.mjs +85 -0
  48. package/core/test/nako_gen_perf_test.mjs +178 -0
  49. package/core/test/nako_parser_async_test.mjs +112 -0
  50. package/core/test/nako_parser_test.mjs +160 -0
  51. package/core/test/nako_plugin_manager_test.mjs +185 -0
  52. package/core/test/nako_require_test.mjs +153 -0
  53. package/core/test/nako_runner_test.mjs +114 -0
  54. package/core/test/nako_tokenizer_test.mjs +115 -0
  55. package/core/test/plugin_system_debug_test.mjs +141 -0
  56. package/core/test/plugin_system_split_test.mjs +179 -0
  57. package/core/test/plugin_system_test.mjs +6 -0
  58. package/core/tsconfig.json +0 -1
  59. package/package.json +24 -34
  60. package/release/_hash.txt +40 -40
  61. package/release/_script-tags.txt +16 -16
  62. package/release/command.json +1 -1
  63. package/release/command.json.js +1 -1
  64. package/release/command_cnako3.json +1 -1
  65. package/release/command_list.json +1 -1
  66. package/release/edit_main.js +6 -6
  67. package/release/edit_main.js.map +3 -3
  68. package/release/editor.js +6 -6
  69. package/release/plugin_datetime.js +1 -1
  70. package/release/plugin_datetime.js.map +3 -3
  71. package/release/plugin_keigo.js.map +3 -3
  72. package/release/plugin_markup.js +47 -47
  73. package/release/plugin_markup.js.map +3 -3
  74. package/release/plugin_weykturtle3d.js +1 -1
  75. package/release/plugin_weykturtle3d.js.map +3 -3
  76. package/release/version.js +2 -2
  77. package/release/version_main.js +2 -2
  78. package/release/version_main.js.map +2 -2
  79. package/release/wnako3.js +187 -214
  80. package/release/wnako3.js.map +4 -4
  81. package/release/wnako3webworker.js +172 -199
  82. package/release/wnako3webworker.js.map +4 -4
  83. package/src/cnako3mod.mjs +8 -4
  84. package/src/cnako3mod.mts +8 -4
  85. package/src/nako_version.mjs +2 -2
  86. package/src/nako_version.mts +2 -2
  87. package/src/plugin_browser_ajax.mjs +4 -4
  88. package/src/plugin_browser_ajax.mts +4 -4
  89. package/src/plugin_browser_audio.mjs +10 -10
  90. package/src/plugin_browser_audio.mts +10 -10
  91. package/src/plugin_browser_camera.mjs +4 -4
  92. package/src/plugin_browser_camera.mts +4 -4
  93. package/src/plugin_browser_canvas.mjs +2 -2
  94. package/src/plugin_browser_canvas.mts +2 -2
  95. package/src/plugin_browser_crypto.mjs +3 -3
  96. package/src/plugin_browser_crypto.mts +3 -3
  97. package/src/plugin_browser_dom_event.mjs +1 -1
  98. package/src/plugin_browser_dom_event.mts +1 -1
  99. package/src/plugin_browser_geolocation.mjs +1 -1
  100. package/src/plugin_browser_geolocation.mts +1 -1
  101. package/src/plugin_browser_hotkey.mjs +1 -1
  102. package/src/plugin_browser_hotkey.mts +1 -1
  103. package/src/plugin_browser_html.mjs +1 -1
  104. package/src/plugin_browser_html.mts +1 -1
  105. package/src/plugin_browser_location.mjs +1 -1
  106. package/src/plugin_browser_location.mts +1 -1
  107. package/src/plugin_browser_speech.mjs +1 -1
  108. package/src/plugin_browser_speech.mts +1 -1
  109. package/src/plugin_browser_storage.mjs +2 -2
  110. package/src/plugin_browser_storage.mts +2 -2
  111. package/src/plugin_httpserver.mjs +186 -15
  112. package/src/plugin_httpserver.mts +178 -12
  113. package/src/plugin_keigo.mjs +2 -2
  114. package/src/plugin_keigo.mts +2 -2
  115. package/src/plugin_node.mjs +48 -49
  116. package/src/plugin_node.mts +53 -54
  117. package/src/plugin_weykturtle3d.mjs +56 -56
  118. package/src/plugin_weykturtle3d.mts +56 -56
  119. package/src/wnako3.mjs +1 -1
  120. package/src/wnako3.mts +1 -1
  121. package/src/wnako3_editor.mjs +5 -5
  122. package/src/wnako3_editor.mts +5 -5
  123. package/src/wnako3mod.mjs +5 -2
  124. package/src/wnako3mod.mts +5 -2
  125. package/test/common/wnako3mod_test.mjs +48 -0
  126. package/test/node/package_json_test.mjs +17 -0
  127. package/test/node/plugin_httpserver_test.mjs +239 -0
  128. package/tools/nako3server/index.nako3 +4 -2
  129. package/core/src/nako3.mjs +0 -1021
  130. package/core/src/nako_ast.mjs +0 -4
  131. package/core/src/nako_colors.mjs +0 -77
  132. package/core/src/nako_core_version.mjs +0 -8
  133. package/core/src/nako_csv.mjs +0 -193
  134. package/core/src/nako_errors.mjs +0 -166
  135. package/core/src/nako_from_dncl.mjs +0 -285
  136. package/core/src/nako_from_dncl2.mjs +0 -347
  137. package/core/src/nako_gen.mjs +0 -2500
  138. package/core/src/nako_global.mjs +0 -138
  139. package/core/src/nako_indent.mjs +0 -442
  140. package/core/src/nako_indent_chars.mjs +0 -29
  141. package/core/src/nako_indent_inline.mjs +0 -361
  142. package/core/src/nako_josi_list.mjs +0 -47
  143. package/core/src/nako_lex_rules.mjs +0 -319
  144. package/core/src/nako_lexer.mjs +0 -794
  145. package/core/src/nako_logger.mjs +0 -221
  146. package/core/src/nako_parser3.mjs +0 -3250
  147. package/core/src/nako_parser_base.mjs +0 -403
  148. package/core/src/nako_parser_const.mjs +0 -37
  149. package/core/src/nako_prepare.mjs +0 -329
  150. package/core/src/nako_reserved_words.mjs +0 -42
  151. package/core/src/nako_source_mapping.mjs +0 -207
  152. package/core/src/nako_test.mjs +0 -37
  153. package/core/src/nako_token.mjs +0 -1
  154. package/core/src/nako_tools.mjs +0 -53
  155. package/core/src/nako_types.mjs +0 -14
  156. package/core/src/plugin_api.mjs +0 -4
  157. package/core/src/plugin_csv.mjs +0 -97
  158. package/core/src/plugin_math.mjs +0 -352
  159. package/core/src/plugin_promise.mjs +0 -102
  160. package/core/src/plugin_system.mjs +0 -3810
  161. package/core/src/plugin_test.mjs +0 -52
  162. package/core/src/plugin_toml.mjs +0 -39
@@ -247,7 +247,7 @@ LINENO=0
247
247
  助詞定義=「」
248
248
  # システムオブジェクトへの参照は、なでしこ関数定義と関係ないので除去
249
249
  それ=抽出文字列[1]
250
- 「/(\,\s*sys|sys)\:?\s*[a-zA-Z]*$/」を「」に正規表現置換
250
+ 「/(\,\s*_?sys|_?sys)\:?\s*[a-zA-Z]*$/」を「」に正規表現置換
251
251
  トリム。
252
252
  # JS引数の一覧を取得
253
253
  引数一覧=[]
@@ -13,6 +13,18 @@ CORE="core/src"
13
13
 
14
14
  コアプラグイン一覧は[
15
15
  ["plugin_system.mts", 'wnako,cnako,phpnako'],
16
+ ["plugin_system_debug.mts", 'wnako,cnako,phpnako'],
17
+ ["plugin_system_math.mts", 'wnako,cnako,phpnako'],
18
+ ["plugin_system_string.mts", 'wnako,cnako,phpnako'],
19
+ ["plugin_system_array.mts", 'wnako,cnako,phpnako'],
20
+ ["plugin_system_datetime.mts", 'wnako,cnako,phpnako'],
21
+ ["plugin_system_url.mts", 'wnako,cnako,phpnako'],
22
+ ["plugin_system_types.mts", 'wnako,cnako,phpnako'],
23
+ ["plugin_system_json.mts", 'wnako,cnako,phpnako'],
24
+ ["plugin_system_regexp.mts", 'wnako,cnako,phpnako'],
25
+ ["plugin_system_dict.mts", 'wnako,cnako,phpnako'],
26
+ ["plugin_system_stdio.mts", 'wnako,cnako,phpnako'],
27
+ ["plugin_system_timer.mts", 'wnako,cnako,phpnako'],
16
28
  ["plugin_csv.mts", 'wnako,cnako'],
17
29
  ["plugin_toml.mts", 'wnako,cnako'],
18
30
  ["plugin_math.mts", 'wnako,cnako'],
@@ -92,7 +92,11 @@ function convert (nako: NakoCompiler, code: string, opt: CommandOptions): void {
92
92
  // オプションを指定
93
93
  const genOpt = new NakoGenOptions(
94
94
  false,
95
- ['nako_errors.mjs', 'nako_core_version.mjs', 'plugin_system.mjs'],
95
+ ['nako_errors.mjs', 'nako_core_version.mjs', 'plugin_system.mjs',
96
+ 'plugin_system_debug.mjs', 'plugin_system_math.mjs', 'plugin_system_string.mjs',
97
+ 'plugin_system_array.mjs', 'plugin_system_datetime.mjs', 'plugin_system_url.mjs',
98
+ 'plugin_system_types.mjs', 'plugin_system_json.mjs', 'plugin_system_regexp.mjs', 'plugin_system_dict.mjs',
99
+ 'plugin_system_stdio.mjs', 'plugin_system_timer.mjs'],
96
100
  '__self.__varslist[0].set(\'ナデシコ種類\', \'snako\')')
97
101
  // スタンドアロンコードを生成
98
102
  const js = nako.compileStandalone(code, opt.filename, genOpt)
@@ -89,7 +89,11 @@ function convert (nako: NakoCompiler, code: string, opt: CommandOptions): void {
89
89
  // オプションを指定
90
90
  const genOpt: NakoGenOptions = new NakoGenOptions(
91
91
  false,
92
- ['nako_errors.mjs', 'nako_core_version.mjs', 'plugin_system.mjs'],
92
+ ['nako_errors.mjs', 'nako_core_version.mjs', 'plugin_system.mjs',
93
+ 'plugin_system_debug.mjs', 'plugin_system_math.mjs', 'plugin_system_string.mjs',
94
+ 'plugin_system_array.mjs', 'plugin_system_datetime.mjs', 'plugin_system_url.mjs',
95
+ 'plugin_system_types.mjs', 'plugin_system_json.mjs', 'plugin_system_regexp.mjs', 'plugin_system_dict.mjs',
96
+ 'plugin_system_stdio.mjs', 'plugin_system_timer.mjs'],
93
97
  '__self.__setSysVar(\'ナデシコ種類\', \'snako\')')
94
98
  // スタンドアロンコードを生成
95
99
  const js = nako.compileStandalone(code, opt.filename, genOpt)
@@ -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.20",
3
+ "version": "3.7.22",
4
4
  "description": "Japanese Programming Language Nadesiko v3 core",
5
5
  "main": "index.mjs",
6
6
  "type": "module",
@@ -36,11 +36,11 @@
36
36
  "sample"
37
37
  ],
38
38
  "devDependencies": {
39
- "@types/node": "^25.6.0",
40
- "typescript": "^6.0.3"
39
+ "@types/node": "^26.1.1",
40
+ "typescript": "^7.0.2"
41
41
  },
42
42
  "dependencies": {
43
43
  "cross-env": "^10.0.0",
44
- "smol-toml": "1.6.1"
44
+ "smol-toml": "1.7.1"
45
45
  }
46
46
  }
@@ -0,0 +1,98 @@
1
+ # core/src ファイル構成
2
+
3
+ このディレクトリには、なでしこ3の言語コアを構成するTypeScriptソースと、そのビルド結果であるJavaScriptファイルが置かれています。
4
+ 通常の開発では `.mts` ファイルを編集し、ビルドによって対応する `.mjs` ファイルが生成されます。
5
+
6
+ ## 全体の流れ
7
+
8
+ なでしこ3のプログラムは、主に次の順で処理されます。
9
+
10
+ 1. `nako_prepare.mts` で全角半角や特殊記法を前処理する
11
+ 2. `nako_lexer.mts` と `nako_lex_rules.mts` でソースをトークン列に分割する
12
+ 3. `nako_indent_inline.mts`、`nako_from_dncl.mts`、`nako_from_dncl2.mts` などで特殊構文を変換する
13
+ 4. `nako_parser3.mts` でトークン列をASTに変換する
14
+ 5. `nako_gen.mts` でASTからJavaScriptコードを生成する
15
+ 6. `nako3.mts` の `NakoCompiler` が生成コードを評価して実行する
16
+
17
+ ## エントリポイント
18
+
19
+ | ファイル | 説明 |
20
+ | --- | --- |
21
+ | `nako3.mts` | 言語コアの中心となる `NakoCompiler` を定義する。前処理、字句解析、構文変換、構文解析、コード生成、実行を統合する。 |
22
+ | `nako_core_version.mts` | コアのバージョン情報を定義する。自動生成されるため、通常は直接編集しない。 |
23
+
24
+ ## 前処理と構文変換
25
+
26
+ | ファイル | 説明 |
27
+ | --- | --- |
28
+ | `nako_prepare.mts` | ソースコードの前処理を行う。全角半角の正規化、特殊記法の置換、変換履歴の管理などを担当する。 |
29
+ | `nako_source_mapping.mts` | 前処理やインデント構文変換の前後で、元ソース位置と変換後ソース位置を対応付ける。エラー位置の補正に使う。 |
30
+ | `nako_indent.mts` | 行単位のインデント構文を解析し、ブロック構造や `ここまで` 相当の構造に変換する。 |
31
+ | `nako_indent_inline.mts` | 字句解析後のトークン列に対して、インラインインデント構文を処理する。末尾の `:` やインデント量を見てブロック終端を補う。 |
32
+ | `nako_indent_chars.mts` | インデントとして扱う空白文字を判定する小さな補助関数を提供する。 |
33
+ | `nako_from_dncl.mts` | DNCLモードのトークン変換を行う。DNCL風の記法をなでしこ3の通常構文に寄せる。 |
34
+ | `nako_from_dncl2.mts` | DNCL2モードのトークン変換を行う。配列初期化やDNCL2固有の記法を扱う。 |
35
+
36
+ ## 字句解析
37
+
38
+ | ファイル | 説明 |
39
+ | --- | --- |
40
+ | `nako_lexer.mts` | なでしこ3の字句解析器。ソースコードをトークン列に分割し、予約語や助詞の処理も行う。 |
41
+ | `nako_lex_rules.mts` | 字句解析で使う正規表現ルールとコールバックを定義する。数値、文字列、コメント、単語、単位などを判定する。 |
42
+ | `nako_token.mts` | トークン型に関する定義をまとめる。 |
43
+ | `nako_reserved_words.mts` | 予約語と、それに対応するトークン種別を定義する。 |
44
+ | `nako_josi_list.mts` | 助詞の一覧、削除対象助詞、条件文向け助詞などを定義する。助詞判定用の正規表現も提供する。 |
45
+
46
+ ## 構文解析とAST
47
+
48
+ | ファイル | 説明 |
49
+ | --- | --- |
50
+ | `nako_parser_base.mts` | 構文解析器の基底クラス。トークン参照、読み進め、エラー生成など、パーサー共通処理を提供する。 |
51
+ | `nako_parser3.mts` | なでしこ3の主構文解析器。式、代入、関数定義、関数呼び出し、制御構文などをASTに変換する。 |
52
+ | `nako_parser_const.mts` | 演算子の優先順位、連文助詞、演算子一覧など、構文解析で使う定数を定義する。 |
53
+ | `nako_ast.mts` | ASTノードの型定義をまとめる。代入、関数、繰り返し、条件分岐、演算子などの構造を定義する。 |
54
+ | `nako_types.mts` | トークンやASTなど、コア全体で使う基本型と空トークン生成関数を定義する。 |
55
+
56
+ ## コード生成と実行補助
57
+
58
+ | ファイル | 説明 |
59
+ | --- | --- |
60
+ | `nako_gen.mts` | ASTからJavaScriptコードを生成する。同期/非同期コード、関数、変数、演算子、プラグイン呼び出し、スタンドアロンコード生成を担当する。 |
61
+ | `nako_global.mts` | 実行時のグローバル状態を管理する。プラグイン、変数、関数、ログなどを保持する基盤クラス。 |
62
+ | `nako_logger.mts` | コンパイル時や実行時のログを扱う。ログレベル、位置情報の文字列化、リスナー通知などを提供する。 |
63
+ | `nako_errors.mts` | なでしこ3用のエラークラスを定義する。字句解析、構文解析、実行時、インポートなどのエラーを表す。 |
64
+ | `nako_tools.mts` | トークンのデバッグ出力、インデント生成、トークン生成などの補助関数を提供する。 |
65
+ | `nako_colors.mts` | ANSIカラー付きテキストをHTML表示向けに変換する補助機能を提供する。 |
66
+
67
+ ## データ処理ライブラリ
68
+
69
+ | ファイル | 説明 |
70
+ | --- | --- |
71
+ | `nako_csv.mts` | CSVのパースと文字列化を行う軽量ライブラリ。区切り文字や改行文字の設定も扱う。 |
72
+
73
+ ## 標準プラグイン
74
+
75
+ | ファイル | 説明 |
76
+ | --- | --- |
77
+ | `plugin_api.mts` | プラグインAPIの型定義を提供する。プラグイン関数、引数定義、メタ情報などの構造を定める。 |
78
+ | `plugin_system.mts` | 言語の基本機能を支える標準プラグイン。表示、変数操作、文字列処理、配列処理、制御補助など、多くの基本命令を提供する。 |
79
+ | `plugin_math.mts` | 数学関数を提供する標準プラグイン。三角関数、乱数、丸め、定数などを扱う。 |
80
+ | `plugin_csv.mts` | `nako_csv.mts` を使い、CSV処理の命令をなでしこから使えるようにする。 |
81
+ | `plugin_toml.mts` | TOML文字列を読むための命令を提供する。 |
82
+ | `plugin_promise.mts` | Promiseや非同期処理を扱うための命令を提供する。 |
83
+ | `plugin_test.mts` | なでしこコードでテストを書くための命令を提供する。 |
84
+
85
+ ## 生成済みJavaScriptファイル
86
+
87
+ | ファイル | 説明 |
88
+ | --- | --- |
89
+ | `*.mjs` | `.mts` から生成されたJavaScriptファイル。実行時やパッケージ利用時に参照される。通常は直接編集せず、対応する `.mts` を編集してビルドする。 |
90
+ | `nako_test.mjs` | 簡易テスト用のJavaScriptファイル。対応する `.mts` はなく、現在は小さなテスト補助クラスのみを含む。 |
91
+
92
+ ## 変更時の目安
93
+
94
+ - 文法やパーサーを変更する場合は、`nako_parser3.mts`、`nako_parser_base.mts`、`nako_parser_const.mts`、`nako_ast.mts` を中心に確認する。
95
+ - 字句解析を変更する場合は、`nako_lexer.mts`、`nako_lex_rules.mts`、`nako_reserved_words.mts`、`nako_josi_list.mts` を確認する。
96
+ - 生成されるJavaScriptを変更する場合は、`nako_gen.mts` を確認する。
97
+ - 標準命令を追加・変更する場合は、目的に応じて `plugin_system.mts` などの `plugin_*.mts` を確認する。
98
+ - エラー位置やソースマップに関わる変更では、`nako_source_mapping.mts` と `nako_errors.mts` も確認する。