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.
Files changed (88) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/PYTHON_GAPS.md +352 -0
  3. package/README.md +176 -32
  4. package/TODO.md +1 -128
  5. package/bin/rapydscript +70 -70
  6. package/language-service/index.js +242 -11
  7. package/memory/project_string_impl.md +43 -0
  8. package/package.json +1 -1
  9. package/release/baselib-plain-pretty.js +248 -38
  10. package/release/baselib-plain-ugly.js +8 -8
  11. package/release/compiler.js +778 -277
  12. package/release/signatures.json +30 -30
  13. package/src/ast.pyj +10 -1
  14. package/src/baselib-builtins.pyj +56 -2
  15. package/src/baselib-containers.pyj +25 -1
  16. package/src/baselib-errors.pyj +7 -3
  17. package/src/baselib-internal.pyj +51 -6
  18. package/src/baselib-str.pyj +18 -5
  19. package/src/lib/asyncio.pyj +534 -0
  20. package/src/lib/base64.pyj +399 -0
  21. package/src/lib/bisect.pyj +73 -0
  22. package/src/lib/collections.pyj +228 -4
  23. package/src/lib/csv.pyj +494 -0
  24. package/src/lib/heapq.pyj +98 -0
  25. package/src/lib/html.pyj +382 -0
  26. package/src/lib/http/__init__.pyj +98 -0
  27. package/src/lib/http/client.pyj +304 -0
  28. package/src/lib/http/cookies.pyj +236 -0
  29. package/src/lib/logging.pyj +672 -0
  30. package/src/lib/pprint.pyj +455 -0
  31. package/src/lib/pythonize.pyj +20 -20
  32. package/src/lib/statistics.pyj +0 -0
  33. package/src/lib/string.pyj +357 -0
  34. package/src/lib/textwrap.pyj +329 -0
  35. package/src/lib/urllib/__init__.pyj +14 -0
  36. package/src/lib/urllib/error.pyj +66 -0
  37. package/src/lib/urllib/parse.pyj +475 -0
  38. package/src/lib/urllib/request.pyj +86 -0
  39. package/src/monaco-language-service/analyzer.js +5 -2
  40. package/src/monaco-language-service/completions.js +26 -0
  41. package/src/monaco-language-service/diagnostics.js +203 -4
  42. package/src/monaco-language-service/scope.js +1 -0
  43. package/src/output/codegen.pyj +4 -1
  44. package/src/output/functions.pyj +152 -6
  45. package/src/output/loops.pyj +17 -2
  46. package/src/output/modules.pyj +1 -1
  47. package/src/output/operators.pyj +15 -0
  48. package/src/output/stream.pyj +0 -1
  49. package/src/parse.pyj +108 -24
  50. package/src/tokenizer.pyj +19 -3
  51. package/test/async_generators.pyj +144 -0
  52. package/test/asyncio.pyj +307 -0
  53. package/test/base64.pyj +202 -0
  54. package/test/baselib.pyj +23 -0
  55. package/test/bisect.pyj +178 -0
  56. package/test/chainmap.pyj +185 -0
  57. package/test/csv.pyj +405 -0
  58. package/test/float_special.pyj +64 -0
  59. package/test/heapq.pyj +174 -0
  60. package/test/html.pyj +212 -0
  61. package/test/http.pyj +259 -0
  62. package/test/imports.pyj +79 -72
  63. package/test/logging.pyj +356 -0
  64. package/test/long.pyj +130 -0
  65. package/test/parenthesized_with.pyj +141 -0
  66. package/test/pprint.pyj +232 -0
  67. package/test/python_compat.pyj +3 -5
  68. package/test/python_modulo.pyj +76 -0
  69. package/test/python_modulo_off.pyj +21 -0
  70. package/test/statistics.pyj +224 -0
  71. package/test/str.pyj +14 -0
  72. package/test/string.pyj +245 -0
  73. package/test/textwrap.pyj +172 -0
  74. package/test/type_display.pyj +48 -0
  75. package/test/type_enforcement.pyj +164 -0
  76. package/test/unit/index.js +94 -6
  77. package/test/unit/language-service-completions.js +121 -0
  78. package/test/unit/language-service-scope.js +32 -0
  79. package/test/unit/language-service.js +190 -5
  80. package/test/unit/run-language-service.js +17 -3
  81. package/test/unit/web-repl.js +2401 -13
  82. package/test/urllib.pyj +193 -0
  83. package/tools/compile.js +1 -1
  84. package/tools/embedded_compiler.js +7 -7
  85. package/tools/export.js +4 -2
  86. package/web-repl/main.js +1 -1
  87. package/web-repl/rapydscript.js +7 -5
  88. 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
+ }