rapydscript-ns 0.9.0 → 0.9.2

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 (100) hide show
  1. package/.agignore +1 -1
  2. package/.github/workflows/ci.yml +38 -38
  3. package/=template.pyj +5 -5
  4. package/CHANGELOG.md +10 -0
  5. package/HACKING.md +103 -103
  6. package/LICENSE +24 -24
  7. package/README.md +7 -6
  8. package/TODO.md +116 -1
  9. package/add-toc-to-readme +2 -2
  10. package/bin/export +75 -75
  11. package/bin/rapydscript +70 -70
  12. package/bin/web-repl-export +102 -102
  13. package/build +2 -2
  14. package/language-service/index.js +9 -9
  15. package/language-service/language-service.d.ts +1 -1
  16. package/package.json +6 -2
  17. package/publish.py +37 -37
  18. package/release/compiler.js +246 -231
  19. package/release/signatures.json +23 -23
  20. package/session.vim +4 -4
  21. package/setup.cfg +2 -2
  22. package/src/compiler.pyj +36 -36
  23. package/src/errors.pyj +30 -30
  24. package/src/lib/aes.pyj +646 -646
  25. package/src/lib/contextlib.pyj +379 -0
  26. package/src/lib/copy.pyj +120 -120
  27. package/src/lib/datetime.pyj +712 -0
  28. package/src/lib/elementmaker.pyj +83 -83
  29. package/src/lib/encodings.pyj +126 -126
  30. package/src/lib/gettext.pyj +569 -569
  31. package/src/lib/io.pyj +500 -0
  32. package/src/lib/itertools.pyj +580 -580
  33. package/src/lib/json.pyj +227 -0
  34. package/src/lib/math.pyj +193 -193
  35. package/src/lib/operator.pyj +11 -11
  36. package/src/lib/pythonize.pyj +20 -20
  37. package/src/lib/random.pyj +118 -118
  38. package/src/lib/react.pyj +74 -74
  39. package/src/lib/traceback.pyj +63 -63
  40. package/src/lib/uuid.pyj +77 -77
  41. package/src/monaco-language-service/diagnostics.js +4 -4
  42. package/src/monaco-language-service/dts.js +550 -550
  43. package/src/monaco-language-service/index.js +2 -2
  44. package/src/output/comments.pyj +45 -45
  45. package/src/output/exceptions.pyj +201 -201
  46. package/src/output/jsx.pyj +164 -164
  47. package/src/output/loops.pyj +9 -0
  48. package/src/output/treeshake.pyj +182 -182
  49. package/src/output/utils.pyj +72 -72
  50. package/src/string_interpolation.pyj +72 -72
  51. package/src/tokenizer.pyj +1 -1
  52. package/src/unicode_aliases.pyj +576 -576
  53. package/src/utils.pyj +192 -192
  54. package/test/_import_one.pyj +37 -37
  55. package/test/_import_two/__init__.pyj +11 -11
  56. package/test/_import_two/level2/deep.pyj +4 -4
  57. package/test/_import_two/other.pyj +6 -6
  58. package/test/_import_two/sub.pyj +13 -13
  59. package/test/aes_vectors.pyj +421 -421
  60. package/test/annotations.pyj +80 -80
  61. package/test/contextlib.pyj +362 -0
  62. package/test/datetime.pyj +500 -0
  63. package/test/debugger_stmt.pyj +41 -0
  64. package/test/decorators.pyj +77 -77
  65. package/test/docstrings.pyj +39 -39
  66. package/test/elementmaker_test.pyj +45 -45
  67. package/test/functions.pyj +151 -151
  68. package/test/generators.pyj +41 -41
  69. package/test/generic.pyj +370 -370
  70. package/test/imports.pyj +72 -72
  71. package/test/internationalization.pyj +73 -73
  72. package/test/io.pyj +316 -0
  73. package/test/json.pyj +196 -0
  74. package/test/lint.pyj +164 -164
  75. package/test/loops.pyj +85 -85
  76. package/test/numpy.pyj +734 -734
  77. package/test/omit_function_metadata.pyj +20 -20
  78. package/test/repl.pyj +121 -121
  79. package/test/scoped_flags.pyj +76 -76
  80. package/test/unit/index.js +66 -0
  81. package/test/unit/language-service-dts.js +543 -543
  82. package/test/unit/language-service-hover.js +455 -455
  83. package/test/unit/language-service.js +1 -1
  84. package/test/unit/web-repl.js +533 -0
  85. package/tools/compiler.d.ts +367 -0
  86. package/tools/completer.js +131 -131
  87. package/tools/gettext.js +185 -185
  88. package/tools/ini.js +65 -65
  89. package/tools/msgfmt.js +187 -187
  90. package/tools/repl.js +223 -223
  91. package/tools/test.js +118 -118
  92. package/tools/utils.js +128 -128
  93. package/tools/web_repl.js +95 -95
  94. package/try +41 -41
  95. package/web-repl/env.js +196 -196
  96. package/web-repl/index.html +163 -163
  97. package/web-repl/prism.css +139 -139
  98. package/web-repl/prism.js +113 -113
  99. package/web-repl/rapydscript.js +224 -224
  100. package/web-repl/sha1.js +25 -25
@@ -7,28 +7,28 @@
7
7
  "baselib-internal": "bb1eff32c1c50d5d25ea3074a968e765a136108c",
8
8
  "baselib-itertools": "268b7b7af79506e9a01023e8cd3b1741599bb6a5",
9
9
  "baselib-str": "0e8d1ee658690412140cc138adf9681425de5084",
10
- "compiler": "4c728d81b441b4b9c590f9330271f54b47cc11eb",
11
- "errors": "d1b33848d19b141e19cc079cf78421f29b6d2c05",
12
- "output/__init__": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
13
- "output/classes": "469c47511692e04eb1bc2b079af3f65b47165865",
14
- "output/codegen": "69151b2cd53ff8b3270a122c65e1a0f56735150e",
15
- "output/comments": "78ec38d8b34da96c078653e2d0d4049d7003906b",
16
- "output/exceptions": "d45bc62bc6b011bae182ed7c8df8ea5e392f6fb8",
17
- "output/functions": "5fe055661a45cf9de8ef024c758bb8214a87cd80",
18
- "output/jsx": "0a174c39378155c19dfa669e833c14d63190127b",
19
- "output/literals": "287ec4222c79f1ebfa2c6efae925e794cbb931ab",
20
- "output/loops": "8a0dd93b95e1b9c2a29344e6b41cb5cec6b7afc5",
21
- "output/modules": "15735b9b07260d11ba231fc3439818bd1a54947e",
22
- "output/operators": "14b23f4a3ab3b1997411b8ec9f0f57d3e76a7da0",
23
- "output/statements": "94ee0cd084f22aea451b96eb1a9a831084cc4267",
24
- "output/stream": "2723d80bc398468e0828f50fb0837095c52f45dc",
25
- "output/treeshake": "c1d65269ff21cfd046e947755a3489d0e670a74a",
26
- "output/utils": "595968f96f6fdcc51eb41c34d64c92bb595e3cb1",
10
+ "compiler": "bb16e915c60dc4ffb5bfe98bef411736d19fa297",
11
+ "errors": "257eca38b6de987e5fd80672bec9b9981847e1bd",
12
+ "output\\classes": "469c47511692e04eb1bc2b079af3f65b47165865",
13
+ "output\\codegen": "69151b2cd53ff8b3270a122c65e1a0f56735150e",
14
+ "output\\comments": "63b39620f9d6f407aa2d4ddb557d1c60ef296b05",
15
+ "output\\exceptions": "e7d9119550403e6c5730d40b9bc9c923a23d6eb7",
16
+ "output\\functions": "5fe055661a45cf9de8ef024c758bb8214a87cd80",
17
+ "output\\jsx": "14f32c048301965de7764c5b74b651bc279de937",
18
+ "output\\literals": "287ec4222c79f1ebfa2c6efae925e794cbb931ab",
19
+ "output\\loops": "4e644417e6f2dd1fe8d289eddf774be166a4d4a4",
20
+ "output\\modules": "15735b9b07260d11ba231fc3439818bd1a54947e",
21
+ "output\\operators": "14b23f4a3ab3b1997411b8ec9f0f57d3e76a7da0",
22
+ "output\\statements": "94ee0cd084f22aea451b96eb1a9a831084cc4267",
23
+ "output\\stream": "2723d80bc398468e0828f50fb0837095c52f45dc",
24
+ "output\\treeshake": "4a490ba097739d924db9e3cd9eb7718db5e24cae",
25
+ "output\\utils": "e957919bfccb9a3ab510d824a8f2ee3fc2689795",
26
+ "output\\__init__": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
27
27
  "parse": "0643834ed3c98d350ceb9ec71179f8923974c08c",
28
- "string_interpolation": "bff1cc76d772d24d35707f6c794f38734ca08376",
29
- "tokenizer": "134f46d5a10576c6a27d4fe024c63f45e111fefe",
30
- "unicode_aliases": "79ac6eaa5e6be44a5397d62c561f854a8fe7528e",
31
- "utils": "c1666db819aa7c8db38697e34e18362e3cb45869",
32
- "#compiler#": "d41c267ea92de4937495c7d35c8d50e1b48f550c",
33
- "#compiled_with#": "d41c267ea92de4937495c7d35c8d50e1b48f550c"
28
+ "string_interpolation": "88dce6c2c5ee75126a6838a1506841c6531a0d15",
29
+ "tokenizer": "79cf9d42ec2613b409b4dc6ed0e3ce112e4bd8c0",
30
+ "unicode_aliases": "7fbcbc9c24adcb2e33fac8d69aaafe5047fcc2c2",
31
+ "utils": "35a2a707c841da851e18c64edac54e7c20b7dfc9",
32
+ "#compiler#": "21a89c9ec81e3f4907eba75bf4c3d8b6aade4ad6",
33
+ "#compiled_with#": "21a89c9ec81e3f4907eba75bf4c3d8b6aade4ad6"
34
34
  }
package/session.vim CHANGED
@@ -1,4 +1,4 @@
1
- set wildignore+=*.pyj-cached
2
- set wildignore+=node_modules
3
- imap <F4> ρσ_
4
- cmap <F4> ρσ_
1
+ set wildignore+=*.pyj-cached
2
+ set wildignore+=node_modules
3
+ imap <F4> ρσ_
4
+ cmap <F4> ρσ_
package/setup.cfg CHANGED
@@ -1,2 +1,2 @@
1
- [rapydscript]
2
- globals=assert,RapydScript
1
+ [rapydscript]
2
+ globals=assert,RapydScript
package/src/compiler.pyj CHANGED
@@ -1,36 +1,36 @@
1
- # vim:fileencoding=utf-8
2
- # License: BSD
3
- # Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
4
- # globals: console
5
-
6
- from utils import DefaultsError, string_template
7
- from errors import ImportError, SyntaxError
8
- from tokenizer import ALL_KEYWORDS, IDENTIFIER_PAT, tokenizer
9
- from parse import parse, NATIVE_CLASSES, compile_time_decorators
10
- from output.stream import OutputStream
11
- from output.codegen import generate_code
12
- from output.treeshake import tree_shake
13
-
14
- generate_code() # create the print methods on the AST nodes
15
-
16
- # The following allows this module to be used from a pure javascript, require()
17
- # based environment like Node.js
18
- if jstype(exports) is 'object':
19
- exports.DefaultsError = DefaultsError
20
- exports.parse = parse
21
- exports.compile_time_decorators = compile_time_decorators
22
- exports.OutputStream = OutputStream
23
- exports.string_template = string_template # noqa:undef
24
- # Needed for REPL and linter
25
- exports.ALL_KEYWORDS = ALL_KEYWORDS
26
- exports.IDENTIFIER_PAT = IDENTIFIER_PAT
27
- exports.NATIVE_CLASSES = NATIVE_CLASSES
28
- exports.ImportError = ImportError
29
- exports.SyntaxError = SyntaxError
30
- exports.tokenizer = tokenizer
31
- exports.tree_shake = tree_shake
32
- # Magic! Export all the AST_* nodes
33
- ast = ρσ_modules['ast']
34
- for ast_node in ast:
35
- if ast_node.substr(0, 4) is 'AST_':
36
- exports[ast_node] = ast[ast_node] # noqa:undef
1
+ # vim:fileencoding=utf-8
2
+ # License: BSD
3
+ # Copyright: 2015, Kovid Goyal <kovid at kovidgoyal.net>
4
+ # globals: console
5
+
6
+ from utils import DefaultsError, string_template
7
+ from errors import ImportError, SyntaxError
8
+ from tokenizer import ALL_KEYWORDS, IDENTIFIER_PAT, tokenizer
9
+ from parse import parse, NATIVE_CLASSES, compile_time_decorators
10
+ from output.stream import OutputStream
11
+ from output.codegen import generate_code
12
+ from output.treeshake import tree_shake
13
+
14
+ generate_code() # create the print methods on the AST nodes
15
+
16
+ # The following allows this module to be used from a pure javascript, require()
17
+ # based environment like Node.js
18
+ if jstype(exports) is 'object':
19
+ exports.DefaultsError = DefaultsError
20
+ exports.parse = parse
21
+ exports.compile_time_decorators = compile_time_decorators
22
+ exports.OutputStream = OutputStream
23
+ exports.string_template = string_template # noqa:undef
24
+ # Needed for REPL and linter
25
+ exports.ALL_KEYWORDS = ALL_KEYWORDS
26
+ exports.IDENTIFIER_PAT = IDENTIFIER_PAT
27
+ exports.NATIVE_CLASSES = NATIVE_CLASSES
28
+ exports.ImportError = ImportError
29
+ exports.SyntaxError = SyntaxError
30
+ exports.tokenizer = tokenizer
31
+ exports.tree_shake = tree_shake
32
+ # Magic! Export all the AST_* nodes
33
+ ast = ρσ_modules['ast']
34
+ for ast_node in ast:
35
+ if ast_node.substr(0, 4) is 'AST_':
36
+ exports[ast_node] = ast[ast_node] # noqa:undef
package/src/errors.pyj CHANGED
@@ -1,30 +1,30 @@
1
- # vim:fileencoding=utf-8
2
- # License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
3
- from __python__ import hash_literals
4
-
5
- class SyntaxError(Error):
6
-
7
- def __init__(self, message, filename, line, col, pos, is_eof):
8
- self.stack = Error().stack
9
- self.message = message
10
- self.line = line
11
- self.col = col
12
- self.pos = pos
13
- self.is_eof = is_eof
14
- self.filename = filename
15
- # The "standard" form for these error attributes
16
- self.lineNumber = line
17
- self.fileName = filename
18
-
19
- def toString(self):
20
- ans = self.message + " (line: " + self.line + ", col: " + self.col + ", pos: " + self.pos + ")"
21
- if self.filename:
22
- ans = self.filename + ':' + ans
23
- if self.stack:
24
- ans += "\n\n" + self.stack
25
- return ans
26
-
27
-
28
- class ImportError(SyntaxError):
29
- pass
30
-
1
+ # vim:fileencoding=utf-8
2
+ # License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
3
+ from __python__ import hash_literals
4
+
5
+ class SyntaxError(Error):
6
+
7
+ def __init__(self, message, filename, line, col, pos, is_eof):
8
+ self.stack = Error().stack
9
+ self.message = message
10
+ self.line = line
11
+ self.col = col
12
+ self.pos = pos
13
+ self.is_eof = is_eof
14
+ self.filename = filename
15
+ # The "standard" form for these error attributes
16
+ self.lineNumber = line
17
+ self.fileName = filename
18
+
19
+ def toString(self):
20
+ ans = self.message + " (line: " + self.line + ", col: " + self.col + ", pos: " + self.pos + ")"
21
+ if self.filename:
22
+ ans = self.filename + ':' + ans
23
+ if self.stack:
24
+ ans += "\n\n" + self.stack
25
+ return ans
26
+
27
+
28
+ class ImportError(SyntaxError):
29
+ pass
30
+