eolang 0.16.0 → 0.17.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/eo-version.txt +1 -1
- package/home-hash.txt +1 -0
- package/package.json +2 -1
- package/src/commands/phi.js +4 -2
- package/src/commands/unphi.js +4 -2
- package/src/demand.js +42 -0
- package/src/eoc.js +5 -1
- package/src/version.js +1 -1
package/eo-version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.35.
|
|
1
|
+
0.35.2
|
package/home-hash.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
130afdd1456a0cbafd52aee8d7bc612e1faac547
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eolang",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"author": "Yegor Bugayenko <yegor256@gmail.com> (https://www.yegor256.com/)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "objectionary/eoc",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"fast-xml-parser": "4.3.4",
|
|
36
36
|
"node": "21.6.1",
|
|
37
37
|
"relative": "3.0.2",
|
|
38
|
+
"semver": "7.6.0",
|
|
38
39
|
"sync-request": "6.1.0",
|
|
39
40
|
"xmlhttprequest": "1.8.0"
|
|
40
41
|
},
|
package/src/commands/phi.js
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
const rel = require('relative');
|
|
26
26
|
const path = require('path');
|
|
27
|
+
const {gte} = require('../demand');
|
|
27
28
|
const {mvnw, flags} = require('../mvnw');
|
|
28
29
|
|
|
29
30
|
/**
|
|
@@ -32,6 +33,7 @@ const {mvnw, flags} = require('../mvnw');
|
|
|
32
33
|
* @return {Promise} of assemble task
|
|
33
34
|
*/
|
|
34
35
|
module.exports = function(opts) {
|
|
36
|
+
gte('EO parser', opts.parser, '0.35.2');
|
|
35
37
|
const target = path.resolve(opts.target);
|
|
36
38
|
const input = path.resolve(opts.target, '2-optimize');
|
|
37
39
|
console.debug('Reading .XMIR files from %s', rel(input));
|
|
@@ -42,8 +44,8 @@ module.exports = function(opts) {
|
|
|
42
44
|
.concat(flags(opts))
|
|
43
45
|
.concat(
|
|
44
46
|
[
|
|
45
|
-
`-
|
|
46
|
-
`-
|
|
47
|
+
`-Deo.phiInputDir=${input}`,
|
|
48
|
+
`-Deo.phiOutputDir=${output}`,
|
|
47
49
|
]
|
|
48
50
|
),
|
|
49
51
|
opts.target, opts.batch
|
package/src/commands/unphi.js
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
const rel = require('relative');
|
|
26
26
|
const path = require('path');
|
|
27
27
|
const {mvnw, flags} = require('../mvnw');
|
|
28
|
+
const {gte} = require('../demand');
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* Command to convert .PHI files into .XMIR files.
|
|
@@ -32,6 +33,7 @@ const {mvnw, flags} = require('../mvnw');
|
|
|
32
33
|
* @return {Promise} of assemble task
|
|
33
34
|
*/
|
|
34
35
|
module.exports = function(opts) {
|
|
36
|
+
gte('EO parser', opts.parser, '0.35.2');
|
|
35
37
|
const input = path.resolve(opts.target, 'phi');
|
|
36
38
|
console.debug('Reading .PHI files from %s', rel(input));
|
|
37
39
|
const output = path.resolve(opts.target, 'unphi');
|
|
@@ -41,8 +43,8 @@ module.exports = function(opts) {
|
|
|
41
43
|
.concat(flags(opts))
|
|
42
44
|
.concat(
|
|
43
45
|
[
|
|
44
|
-
`-
|
|
45
|
-
`-
|
|
46
|
+
`-Deo.unphiInputDir=${input}`,
|
|
47
|
+
`-Deo.unphiOutputDir=${output}`,
|
|
46
48
|
]
|
|
47
49
|
),
|
|
48
50
|
opts.target, opts.batch
|
package/src/demand.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2022-2023 Objectionary.com
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included
|
|
14
|
+
* in all copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const semver = require('semver');
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Only if provided version is the required one or younger.
|
|
29
|
+
*
|
|
30
|
+
* @param {String} subject - What is being checked
|
|
31
|
+
* @param {String} current - Current version
|
|
32
|
+
* @param {String} min - Minimal expected version
|
|
33
|
+
*/
|
|
34
|
+
module.exports.gte = function(subject, current, min) {
|
|
35
|
+
if (semver.lt(current, min)) {
|
|
36
|
+
console.error(
|
|
37
|
+
'%s is required to have version %s or higher, while you use %s',
|
|
38
|
+
subject, min, current
|
|
39
|
+
);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
};
|
package/src/eoc.js
CHANGED
|
@@ -49,9 +49,13 @@ if (process.argv.includes('--verbose')) {
|
|
|
49
49
|
|
|
50
50
|
const fs = require('fs');
|
|
51
51
|
const path = require('path');
|
|
52
|
+
const hash = fs.readFileSync(path.join(__dirname, '../home-hash.txt'), 'utf8');
|
|
52
53
|
let parser = fs.readFileSync(path.join(__dirname, '../eo-version.txt'), 'utf8');
|
|
53
54
|
if (process.argv.includes('--latest')) {
|
|
54
55
|
parser = require('./parser-version').get();
|
|
56
|
+
// Maybe here we should also go to GITHUB, find out what is the
|
|
57
|
+
// latest hash of the objectionary/home repository, and then
|
|
58
|
+
// set it to the "hash" variable?
|
|
55
59
|
} else {
|
|
56
60
|
console.debug('EO parser ' + parser + '; use the --latest flag if you need a freshier one');
|
|
57
61
|
}
|
|
@@ -68,7 +72,7 @@ program
|
|
|
68
72
|
program
|
|
69
73
|
.option('-s, --sources <path>', 'Directory with .EO sources', '.')
|
|
70
74
|
.option('-t, --target <path>', 'Directory with all generated files', '.eoc')
|
|
71
|
-
.option('--hash <hex>', 'Hash in objectionary/home to compile against',
|
|
75
|
+
.option('--hash <hex>', 'Hash in objectionary/home to compile against', hash)
|
|
72
76
|
.option('--parser <version>', 'Set the version of EO parser to use', parser)
|
|
73
77
|
.option('--latest', 'Use the latest parser version from Maven Central')
|
|
74
78
|
.option('--alone', 'Just run a single command without dependencies')
|