eolang 0.20.0 → 0.21.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eolang",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "author": "Yegor Bugayenko <yegor256@gmail.com> (https://www.yegor256.com/)",
5
5
  "license": "MIT",
6
6
  "repository": "objectionary/eoc",
@@ -32,8 +32,8 @@
32
32
  "dependencies": {
33
33
  "colors": "1.4.0",
34
34
  "commander": "12.0.0",
35
- "eo2js": "0.0.6",
36
- "fast-xml-parser": "4.3.6",
35
+ "eo2js": "0.0.7",
36
+ "fast-xml-parser": "4.4.0",
37
37
  "node": "22.1.0",
38
38
  "relative": "3.0.2",
39
39
  "semver": "7.6.2",
@@ -41,7 +41,7 @@
41
41
  "xmlhttprequest": "1.8.0"
42
42
  },
43
43
  "devDependencies": {
44
- "eslint": "9.2.0",
44
+ "eslint": "9.4.0",
45
45
  "eslint-config-google": "0.14.0",
46
46
  "grunt": "1.6.1",
47
47
  "grunt-contrib-clean": "2.0.1",
@@ -29,15 +29,15 @@ const {mvnw, flags} = require('../mvnw');
29
29
 
30
30
  /**
31
31
  * Command to convert .XMIR files into .PHI files.
32
- * @param {Hash} opts - All options
32
+ * @param {Object} opts - All options
33
33
  * @return {Promise} of assemble task
34
34
  */
35
35
  module.exports = function(opts) {
36
36
  gte('EO parser', opts.parser, '0.35.2');
37
37
  const target = path.resolve(opts.target);
38
- const input = path.resolve(opts.target, '2-optimize');
38
+ const input = path.resolve(opts.target, opts.phiInput);
39
39
  console.debug('Reading .XMIR files from %s', rel(input));
40
- const output = path.resolve(opts.target, 'phi');
40
+ const output = path.resolve(opts.target, opts.phiOutput);
41
41
  console.debug('Writing .PHI files to %s', rel(output));
42
42
  return mvnw(
43
43
  ['eo:xmir-to-phi']
@@ -28,13 +28,13 @@ const {mvnw, flags} = require('../mvnw');
28
28
 
29
29
  /**
30
30
  * Command to convert .XMIR files into .EO files.
31
- * @param {Hash} opts - All options
31
+ * @param {Object} opts - All options
32
32
  * @return {Promise} of assemble task
33
33
  */
34
34
  module.exports = function(opts) {
35
- const input = path.resolve(opts.target, '2-optimize');
35
+ const input = path.resolve(opts.target, opts.printInput);
36
36
  console.debug('Reading from %s', rel(input));
37
- const output = path.resolve(opts.target, 'print');
37
+ const output = path.resolve(opts.target, opts.printOutput);
38
38
  console.debug('Writing into %s', rel(output));
39
39
  return mvnw(
40
40
  ['eo:print']
@@ -29,14 +29,14 @@ const {gte} = require('../demand');
29
29
 
30
30
  /**
31
31
  * Command to convert .PHI files into .XMIR files.
32
- * @param {Hash} opts - All options
32
+ * @param {Object} opts - All options
33
33
  * @return {Promise} of assemble task
34
34
  */
35
35
  module.exports = function(opts) {
36
36
  gte('EO parser', opts.parser, '0.35.2');
37
- const input = path.resolve(opts.target, 'phi');
37
+ const input = path.resolve(opts.target, opts.unphiInput);
38
38
  console.debug('Reading .PHI files from %s', rel(input));
39
- const output = path.resolve(opts.target, 'unphi');
39
+ const output = path.resolve(opts.target, opts.unphiOutput);
40
40
  console.debug('Writing .XMIR files to %s', rel(output));
41
41
  return mvnw(
42
42
  ['eo:phi-to-xmir']
package/src/eoc.js CHANGED
@@ -179,12 +179,22 @@ program.command('sodg')
179
179
 
180
180
  program.command('phi')
181
181
  .description('Generate PHI files from XMIR')
182
+ .option(
183
+ '--phi-input <dir>',
184
+ 'Directory where XMIR files for translation to PHI are taken (relative to --target)',
185
+ '2-optimize'
186
+ )
187
+ .option(
188
+ '--phi-output <dir>',
189
+ 'Directory where translated PHI files are stored (relative to --target)',
190
+ 'phi'
191
+ )
182
192
  .action((str, opts) => {
183
193
  clear(str);
184
194
  if (program.opts().alone == undefined) {
185
195
  register(program.opts())
186
196
  .then((r) => assemble(program.opts()))
187
- .then((r) => phi(program.opts()));
197
+ .then((r) => phi({...program.opts(), ...str}));
188
198
  } else {
189
199
  phi(program.opts());
190
200
  }
@@ -192,6 +202,16 @@ program.command('phi')
192
202
 
193
203
  program.command('unphi')
194
204
  .option('--tests', 'Add "+tests" meta to result XMIR files')
205
+ .option(
206
+ '--unphi-input <dir>',
207
+ 'Directory where PHI files for translation to XMIR are taken (relative to --target)',
208
+ 'phi'
209
+ )
210
+ .option(
211
+ '--unphi-output <dir>',
212
+ 'Directory where translated XMIR files are stored (relative to --target)',
213
+ 'unphi'
214
+ )
195
215
  .description('Generate XMIR files from PHI files')
196
216
  .action((str, opts) => {
197
217
  clear(str);
@@ -200,9 +220,19 @@ program.command('unphi')
200
220
 
201
221
  program.command('print')
202
222
  .description('Generate EO files from XMIR files')
223
+ .option(
224
+ '--print-input <dir>',
225
+ 'Directory where XMIR files for translation to EO are taken (relative to --target)',
226
+ '2-optimize'
227
+ )
228
+ .option(
229
+ '--print-output <dir>',
230
+ 'Directory where translated EO files are stored (relative to --target)',
231
+ 'print'
232
+ )
203
233
  .action((str, opts) => {
204
234
  clear(str);
205
- print(program.opts());
235
+ print({...program.opts(), ...str});
206
236
  });
207
237
 
208
238
  program.command('verify')
package/src/version.js CHANGED
@@ -25,6 +25,6 @@
25
25
  // The values here are replaced automatically by the .rultor.yml script,
26
26
  // at the "release" pipeline:
27
27
  module.exports = {
28
- what: '0.20.0',
29
- when: '2024-05-31'
28
+ what: '0.21.0',
29
+ when: '2024-06-05'
30
30
  };