rapydscript-ns 0.9.2 → 0.9.4
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/CHANGELOG.md +28 -0
- package/PYTHON_GAPS.md +352 -0
- package/README.md +176 -32
- package/TODO.md +1 -128
- package/bin/rapydscript +70 -70
- package/language-service/index.js +242 -11
- package/memory/project_string_impl.md +43 -0
- package/package.json +1 -1
- package/release/baselib-plain-pretty.js +248 -38
- package/release/baselib-plain-ugly.js +8 -8
- package/release/compiler.js +778 -277
- package/release/signatures.json +30 -30
- package/src/ast.pyj +10 -1
- package/src/baselib-builtins.pyj +56 -2
- package/src/baselib-containers.pyj +25 -1
- package/src/baselib-errors.pyj +7 -3
- package/src/baselib-internal.pyj +51 -6
- package/src/baselib-str.pyj +18 -5
- package/src/lib/asyncio.pyj +534 -0
- package/src/lib/base64.pyj +399 -0
- package/src/lib/bisect.pyj +73 -0
- package/src/lib/collections.pyj +228 -4
- package/src/lib/csv.pyj +494 -0
- package/src/lib/heapq.pyj +98 -0
- package/src/lib/html.pyj +382 -0
- package/src/lib/http/__init__.pyj +98 -0
- package/src/lib/http/client.pyj +304 -0
- package/src/lib/http/cookies.pyj +236 -0
- package/src/lib/logging.pyj +672 -0
- package/src/lib/pprint.pyj +455 -0
- package/src/lib/pythonize.pyj +20 -20
- package/src/lib/statistics.pyj +0 -0
- package/src/lib/string.pyj +357 -0
- package/src/lib/textwrap.pyj +329 -0
- package/src/lib/urllib/__init__.pyj +14 -0
- package/src/lib/urllib/error.pyj +66 -0
- package/src/lib/urllib/parse.pyj +475 -0
- package/src/lib/urllib/request.pyj +86 -0
- package/src/monaco-language-service/analyzer.js +5 -2
- package/src/monaco-language-service/completions.js +26 -0
- package/src/monaco-language-service/diagnostics.js +203 -4
- package/src/monaco-language-service/scope.js +1 -0
- package/src/output/codegen.pyj +4 -1
- package/src/output/functions.pyj +152 -6
- package/src/output/loops.pyj +17 -2
- package/src/output/modules.pyj +1 -1
- package/src/output/operators.pyj +15 -0
- package/src/output/stream.pyj +0 -1
- package/src/parse.pyj +108 -24
- package/src/tokenizer.pyj +19 -3
- package/test/async_generators.pyj +144 -0
- package/test/asyncio.pyj +307 -0
- package/test/base64.pyj +202 -0
- package/test/baselib.pyj +23 -0
- package/test/bisect.pyj +178 -0
- package/test/chainmap.pyj +185 -0
- package/test/csv.pyj +405 -0
- package/test/float_special.pyj +64 -0
- package/test/heapq.pyj +174 -0
- package/test/html.pyj +212 -0
- package/test/http.pyj +259 -0
- package/test/imports.pyj +79 -72
- package/test/logging.pyj +356 -0
- package/test/long.pyj +130 -0
- package/test/parenthesized_with.pyj +141 -0
- package/test/pprint.pyj +232 -0
- package/test/python_compat.pyj +3 -5
- package/test/python_modulo.pyj +76 -0
- package/test/python_modulo_off.pyj +21 -0
- package/test/statistics.pyj +224 -0
- package/test/str.pyj +14 -0
- package/test/string.pyj +245 -0
- package/test/textwrap.pyj +172 -0
- package/test/type_display.pyj +48 -0
- package/test/type_enforcement.pyj +164 -0
- package/test/unit/index.js +94 -6
- package/test/unit/language-service-completions.js +121 -0
- package/test/unit/language-service-scope.js +32 -0
- package/test/unit/language-service.js +190 -5
- package/test/unit/run-language-service.js +17 -3
- package/test/unit/web-repl.js +2401 -13
- package/test/urllib.pyj +193 -0
- package/tools/compile.js +1 -1
- package/tools/embedded_compiler.js +7 -7
- package/tools/export.js +4 -2
- package/web-repl/main.js +1 -1
- package/web-repl/rapydscript.js +7 -5
- package/test/omit_function_metadata.pyj +0 -20
package/bin/rapydscript
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// vim:ft=javascript:ts=4:et
|
|
3
|
-
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
function load(mod) {
|
|
7
|
-
return require('../tools/' + mod);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
var utils = load('utils');
|
|
11
|
-
|
|
12
|
-
// We need ES 6 generators so relaunch with the --harmony flag
|
|
13
|
-
if (!utils.generators_available()) {
|
|
14
|
-
if (process.execArgv.indexOf('--harmony') != -1) {
|
|
15
|
-
console.error('RapydScript needs ES 6 generators, update your version of nodejs');
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
var args = ['--harmony', module.filename].concat(process.argv.slice(2));
|
|
19
|
-
require('child_process').spawn(process.execPath, args, {stdio:'inherit'}).on('exit', function(code, signal) {
|
|
20
|
-
process.exit(code);
|
|
21
|
-
});
|
|
22
|
-
} else {
|
|
23
|
-
|
|
24
|
-
var start_time = new Date().getTime();
|
|
25
|
-
var path = require('path');
|
|
26
|
-
|
|
27
|
-
var argv = load('cli').argv;
|
|
28
|
-
|
|
29
|
-
var base_path = path.normalize(path.join(path.dirname(module.filename), ".."));
|
|
30
|
-
var src_path = path.join(base_path, 'src');
|
|
31
|
-
var lib_path = path.join(base_path, 'dev');
|
|
32
|
-
if (!utils.path_exists(path.join(lib_path, 'compiler.js'))) lib_path = path.join(base_path, 'release');
|
|
33
|
-
|
|
34
|
-
if (argv.mode === 'self') {
|
|
35
|
-
if (argv.files.length > 0) {
|
|
36
|
-
console.error("WARN: Ignoring input files since --self was passed");
|
|
37
|
-
}
|
|
38
|
-
load('self')(base_path, src_path, lib_path, argv.complete, argv.profile);
|
|
39
|
-
if (argv.test) {
|
|
40
|
-
console.log('\nRunning test suite...\n');
|
|
41
|
-
argv.files = []; // Ensure all tests are run
|
|
42
|
-
load('test')(argv, base_path, src_path, path.join(base_path, 'dev'));
|
|
43
|
-
}
|
|
44
|
-
process.exit(0);
|
|
45
|
-
} else
|
|
46
|
-
|
|
47
|
-
if (argv.mode === 'test') {
|
|
48
|
-
load('test')(argv, base_path, src_path, lib_path);
|
|
49
|
-
} else
|
|
50
|
-
|
|
51
|
-
if (argv.mode === 'lint') {
|
|
52
|
-
load('lint').cli(argv, base_path, src_path, lib_path);
|
|
53
|
-
} else
|
|
54
|
-
|
|
55
|
-
if (argv.mode === 'repl') {
|
|
56
|
-
load('repl')({'lib_path':lib_path, 'imp_path':path.join(src_path, 'lib'), show_js:!argv.no_js});
|
|
57
|
-
} else
|
|
58
|
-
|
|
59
|
-
if (argv.mode === 'gettext') {
|
|
60
|
-
load('gettext').cli(argv, base_path, src_path, lib_path);
|
|
61
|
-
} else
|
|
62
|
-
|
|
63
|
-
if (argv.mode === 'msgfmt') {
|
|
64
|
-
load('msgfmt').cli(argv, base_path, src_path, lib_path);
|
|
65
|
-
} else
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
load('compile')(start_time, argv, base_path, src_path, lib_path);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// vim:ft=javascript:ts=4:et
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function load(mod) {
|
|
7
|
+
return require('../tools/' + mod);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
var utils = load('utils');
|
|
11
|
+
|
|
12
|
+
// We need ES 6 generators so relaunch with the --harmony flag
|
|
13
|
+
if (!utils.generators_available()) {
|
|
14
|
+
if (process.execArgv.indexOf('--harmony') != -1) {
|
|
15
|
+
console.error('RapydScript needs ES 6 generators, update your version of nodejs');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
var args = ['--harmony', module.filename].concat(process.argv.slice(2));
|
|
19
|
+
require('child_process').spawn(process.execPath, args, {stdio:'inherit'}).on('exit', function(code, signal) {
|
|
20
|
+
process.exit(code);
|
|
21
|
+
});
|
|
22
|
+
} else {
|
|
23
|
+
|
|
24
|
+
var start_time = new Date().getTime();
|
|
25
|
+
var path = require('path');
|
|
26
|
+
|
|
27
|
+
var argv = load('cli').argv;
|
|
28
|
+
|
|
29
|
+
var base_path = path.normalize(path.join(path.dirname(module.filename), ".."));
|
|
30
|
+
var src_path = path.join(base_path, 'src');
|
|
31
|
+
var lib_path = path.join(base_path, 'dev');
|
|
32
|
+
if (!utils.path_exists(path.join(lib_path, 'compiler.js'))) lib_path = path.join(base_path, 'release');
|
|
33
|
+
|
|
34
|
+
if (argv.mode === 'self') {
|
|
35
|
+
if (argv.files.length > 0) {
|
|
36
|
+
console.error("WARN: Ignoring input files since --self was passed");
|
|
37
|
+
}
|
|
38
|
+
load('self')(base_path, src_path, lib_path, argv.complete, argv.profile);
|
|
39
|
+
if (argv.test) {
|
|
40
|
+
console.log('\nRunning test suite...\n');
|
|
41
|
+
argv.files = []; // Ensure all tests are run
|
|
42
|
+
load('test')(argv, base_path, src_path, path.join(base_path, 'dev'));
|
|
43
|
+
}
|
|
44
|
+
process.exit(0);
|
|
45
|
+
} else
|
|
46
|
+
|
|
47
|
+
if (argv.mode === 'test') {
|
|
48
|
+
load('test')(argv, base_path, src_path, lib_path);
|
|
49
|
+
} else
|
|
50
|
+
|
|
51
|
+
if (argv.mode === 'lint') {
|
|
52
|
+
load('lint').cli(argv, base_path, src_path, lib_path);
|
|
53
|
+
} else
|
|
54
|
+
|
|
55
|
+
if (argv.mode === 'repl') {
|
|
56
|
+
load('repl')({'lib_path':lib_path, 'imp_path':path.join(src_path, 'lib'), show_js:!argv.no_js});
|
|
57
|
+
} else
|
|
58
|
+
|
|
59
|
+
if (argv.mode === 'gettext') {
|
|
60
|
+
load('gettext').cli(argv, base_path, src_path, lib_path);
|
|
61
|
+
} else
|
|
62
|
+
|
|
63
|
+
if (argv.mode === 'msgfmt') {
|
|
64
|
+
load('msgfmt').cli(argv, base_path, src_path, lib_path);
|
|
65
|
+
} else
|
|
66
|
+
|
|
67
|
+
{
|
|
68
|
+
load('compile')(start_time, argv, base_path, src_path, lib_path);
|
|
69
|
+
}
|
|
70
|
+
}
|