eolang 0.24.0 → 0.26.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/README.md +1 -1
- package/eo-version.txt +1 -1
- package/home-tag.txt +1 -1
- package/mvnw/pom.xml +1 -1
- package/package.json +2 -2
- package/src/commands/{verify.js → docs.js} +2 -10
- package/src/commands/lint.js +47 -0
- package/src/eo2jsw.js +24 -0
- package/src/eoc.js +17 -10
- package/src/version.js +2 -2
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ First, you install [npm][npm-install] and [Java SE][java-se].
|
|
|
14
14
|
Then, you install [eolang][npm] package:
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npm install -g eolang@0.
|
|
17
|
+
npm install -g eolang@0.25.0
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Then, you write a simple [EO](https://www.eolang.org) program in `hello.eo` file
|
package/eo-version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.48.1
|
package/home-tag.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.48.1
|
package/mvnw/pom.xml
CHANGED
|
@@ -29,7 +29,7 @@ SOFTWARE.
|
|
|
29
29
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
30
30
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
|
31
31
|
<eo.version>undefined</eo.version>
|
|
32
|
-
<jeo.version>0.6.
|
|
32
|
+
<jeo.version>0.6.22</jeo.version>
|
|
33
33
|
</properties>
|
|
34
34
|
<dependencies>
|
|
35
35
|
<dependency>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eolang",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"author": "Yegor Bugayenko <yegor256@gmail.com> (https://www.yegor256.com/)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "objectionary/eoc",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"commander": "12.1.0",
|
|
35
35
|
"eo2js": "0.0.7",
|
|
36
36
|
"fast-xml-parser": "4.5.0",
|
|
37
|
-
"node": "23.
|
|
37
|
+
"node": "23.4.0",
|
|
38
38
|
"relative": "3.0.2",
|
|
39
39
|
"semver": "7.6.3",
|
|
40
40
|
"sync-request": "6.1.0",
|
|
@@ -22,18 +22,10 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
const rel = require('relative');
|
|
26
|
-
const path = require('path');
|
|
27
|
-
const {mvnw, flags} = require('../mvnw');
|
|
28
|
-
|
|
29
25
|
/**
|
|
30
|
-
* Command to
|
|
26
|
+
* Command to create docs from .EO sources.
|
|
31
27
|
* @param {Hash} opts - All options
|
|
32
|
-
* @return {Promise} of assemble task
|
|
33
28
|
*/
|
|
34
29
|
module.exports = function(opts) {
|
|
35
|
-
|
|
36
|
-
console.info('EO program verified in %s', rel(path.resolve(opts.target)));
|
|
37
|
-
return r;
|
|
38
|
-
});
|
|
30
|
+
console.info('This command is not yet implemented, sorry');
|
|
39
31
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2022-2024 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 rel = require('relative');
|
|
26
|
+
const path = require('path');
|
|
27
|
+
const {mvnw, flags} = require('../mvnw');
|
|
28
|
+
const semver = require('semver');
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Command to lint .XMIR files.
|
|
32
|
+
* @param {Hash} opts - All options
|
|
33
|
+
* @return {Promise} of assemble task
|
|
34
|
+
*/
|
|
35
|
+
module.exports = function(opts) {
|
|
36
|
+
if (semver.gte(opts.parser, '0.45.0')) {
|
|
37
|
+
return mvnw(['eo:lint'].concat(flags(opts)), opts.target, opts.batch).then((r) => {
|
|
38
|
+
console.info('EO program linted in %s', rel(path.resolve(opts.target)));
|
|
39
|
+
return r;
|
|
40
|
+
});
|
|
41
|
+
} else {
|
|
42
|
+
return mvnw(['eo:verify'].concat(flags(opts)), opts.target, opts.batch).then((r) => {
|
|
43
|
+
console.info('EO program verified in %s', rel(path.resolve(opts.target)));
|
|
44
|
+
return r;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
package/src/eo2jsw.js
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The MIT License (MIT)
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2022-2024 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
|
+
|
|
1
25
|
const path = require('path');
|
|
2
26
|
const {execSync} = require('child_process');
|
|
3
27
|
|
package/src/eoc.js
CHANGED
|
@@ -48,7 +48,8 @@ const common = {
|
|
|
48
48
|
register: require('./commands/register'),
|
|
49
49
|
sodg: require('./commands/sodg'),
|
|
50
50
|
unphi: require('./commands/unphi'),
|
|
51
|
-
|
|
51
|
+
lint: require('./commands/lint'),
|
|
52
|
+
docs: require('./commands/docs'),
|
|
52
53
|
jeo_disassemble: require('./commands/jeo/disassemble'),
|
|
53
54
|
jeo_assemble: require('./commands/jeo/assemble')
|
|
54
55
|
};
|
|
@@ -249,16 +250,16 @@ program.command('print')
|
|
|
249
250
|
coms().print({...program.opts(), ...str});
|
|
250
251
|
});
|
|
251
252
|
|
|
252
|
-
program.command('
|
|
253
|
-
.description('
|
|
253
|
+
program.command('lint')
|
|
254
|
+
.description('Lint XMIR files and fail if any issues inside')
|
|
254
255
|
.action((str, opts) => {
|
|
255
256
|
clear(str);
|
|
256
257
|
if (program.opts().alone == undefined) {
|
|
257
258
|
coms().register(program.opts())
|
|
258
259
|
.then((r) => coms().assemble(program.opts()))
|
|
259
|
-
.then((r) => coms().
|
|
260
|
+
.then((r) => coms().lint(program.opts()));
|
|
260
261
|
} else {
|
|
261
|
-
coms().
|
|
262
|
+
coms().lint(program.opts());
|
|
262
263
|
}
|
|
263
264
|
});
|
|
264
265
|
|
|
@@ -269,7 +270,7 @@ program.command('transpile')
|
|
|
269
270
|
if (program.opts().alone == undefined) {
|
|
270
271
|
coms().register(program.opts())
|
|
271
272
|
.then((r) => coms().assemble(program.opts()))
|
|
272
|
-
.then((r) => coms().
|
|
273
|
+
.then((r) => coms().lint(program.opts()))
|
|
273
274
|
.then((r) => coms().transpile(program.opts()));
|
|
274
275
|
} else {
|
|
275
276
|
coms().transpile(program.opts());
|
|
@@ -283,7 +284,7 @@ program.command('compile')
|
|
|
283
284
|
if (program.opts().alone == undefined) {
|
|
284
285
|
coms().register(program.opts())
|
|
285
286
|
.then((r) => coms().assemble(program.opts()))
|
|
286
|
-
.then((r) => coms().
|
|
287
|
+
.then((r) => coms().lint(program.opts()))
|
|
287
288
|
.then((r) => coms().transpile(program.opts()))
|
|
288
289
|
.then((r) => coms().compile(program.opts()));
|
|
289
290
|
} else {
|
|
@@ -298,7 +299,7 @@ program.command('link')
|
|
|
298
299
|
if (program.opts().alone == undefined) {
|
|
299
300
|
coms().register(program.opts())
|
|
300
301
|
.then((r) => coms().assemble(program.opts()))
|
|
301
|
-
.then((r) => coms().
|
|
302
|
+
.then((r) => coms().lint(program.opts()))
|
|
302
303
|
.then((r) => coms().transpile(program.opts()))
|
|
303
304
|
.then((r) => coms().compile(program.opts()))
|
|
304
305
|
.then((r) => coms().link(program.opts()));
|
|
@@ -316,7 +317,7 @@ program.command('dataize')
|
|
|
316
317
|
if (program.opts().alone == undefined) {
|
|
317
318
|
coms().register(program.opts())
|
|
318
319
|
.then((r) => coms().assemble(program.opts()))
|
|
319
|
-
.then((r) => coms().
|
|
320
|
+
.then((r) => coms().lint(program.opts()))
|
|
320
321
|
.then((r) => coms().transpile(program.opts()))
|
|
321
322
|
.then((r) => coms().compile(program.opts()))
|
|
322
323
|
.then((r) => coms().link(program.opts()))
|
|
@@ -337,7 +338,7 @@ program.command('test')
|
|
|
337
338
|
if (program.opts().alone == undefined) {
|
|
338
339
|
coms().register(program.opts())
|
|
339
340
|
.then((r) => coms().assemble(program.opts()))
|
|
340
|
-
.then((r) => coms().
|
|
341
|
+
.then((r) => coms().lint(program.opts()))
|
|
341
342
|
.then((r) => coms().transpile(program.opts()))
|
|
342
343
|
.then((r) => coms().compile(program.opts()))
|
|
343
344
|
.then((r) => coms().link(program.opts()))
|
|
@@ -347,6 +348,12 @@ program.command('test')
|
|
|
347
348
|
}
|
|
348
349
|
});
|
|
349
350
|
|
|
351
|
+
program.command('docs')
|
|
352
|
+
.description('Generate documentation from XMIR files')
|
|
353
|
+
.action((str, opts) => {
|
|
354
|
+
coms().docs(program.opts());
|
|
355
|
+
});
|
|
356
|
+
|
|
350
357
|
program.command('jeo:disassemble')
|
|
351
358
|
.description('Disassemble .class files to .xmir files')
|
|
352
359
|
.option('--jeo-version <version>', 'Version of JEO to use', '0.6.11')
|
package/src/version.js
CHANGED