rapydscript-ng 0.8.0 → 0.8.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 (72) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +8 -0
  3. package/bin/build.ts +117 -0
  4. package/build_wheels.py +133 -0
  5. package/editor-plugins/README.md +80 -0
  6. package/editor-plugins/nvim.lua +321 -0
  7. package/package.json +1 -1
  8. package/publish.py +27 -17
  9. package/release/compiler.js +8125 -8093
  10. package/release/signatures.json +27 -27
  11. package/release/stdlib_modules.json +1 -0
  12. package/src/ast.pyj +379 -279
  13. package/src/baselib-builtins.pyj +47 -26
  14. package/src/baselib-containers.pyj +105 -92
  15. package/src/baselib-errors.pyj +8 -1
  16. package/src/baselib-internal.pyj +35 -20
  17. package/src/baselib-itertools.pyj +13 -7
  18. package/src/baselib-str.pyj +55 -80
  19. package/src/compiler.pyj +4 -4
  20. package/src/errors.pyj +3 -4
  21. package/src/lib/aes.pyj +46 -32
  22. package/src/lib/elementmaker.pyj +11 -9
  23. package/src/lib/encodings.pyj +15 -5
  24. package/src/lib/gettext.pyj +9 -4
  25. package/src/lib/math.pyj +106 -45
  26. package/src/lib/operator.pyj +10 -10
  27. package/src/lib/pythonize.pyj +2 -1
  28. package/src/lib/random.pyj +28 -21
  29. package/src/lib/re.pyj +490 -17
  30. package/src/lib/traceback.pyj +7 -2
  31. package/src/lib/uuid.pyj +2 -2
  32. package/src/output/classes.pyj +28 -27
  33. package/src/output/codegen.pyj +80 -83
  34. package/src/output/comments.pyj +8 -8
  35. package/src/output/exceptions.pyj +20 -21
  36. package/src/output/functions.pyj +37 -26
  37. package/src/output/literals.pyj +14 -10
  38. package/src/output/loops.pyj +63 -59
  39. package/src/output/modules.pyj +52 -23
  40. package/src/output/operators.pyj +40 -29
  41. package/src/output/statements.pyj +20 -14
  42. package/src/output/stream.pyj +33 -34
  43. package/src/output/utils.pyj +12 -8
  44. package/src/parse.pyj +234 -233
  45. package/src/string_interpolation.pyj +5 -3
  46. package/src/tokenizer.pyj +176 -148
  47. package/src/utils.pyj +31 -14
  48. package/test/fmt.pyj +94 -4
  49. package/test/generic.pyj +9 -0
  50. package/test/lsp.pyj +35 -0
  51. package/test/str.pyj +8 -0
  52. package/tools/cli.mjs +25 -4
  53. package/tools/compile.mjs +7 -3
  54. package/tools/compiler.mjs +34 -2
  55. package/tools/fmt.mjs +269 -22
  56. package/tools/ini.mjs +112 -1
  57. package/tools/lsp.mjs +56 -6
  58. package/tools/repl.mjs +5 -2
  59. package/tools/self.mjs +15 -0
  60. package/tools/test.mjs +100 -0
  61. package/tools/web_repl_export.mjs +4 -0
  62. package/tree-sitter/package.json +1 -1
  63. package/tree-sitter/tree-sitter.json +1 -1
  64. package/editor-plugins/nvim/rapydscript/README.md +0 -184
  65. package/editor-plugins/nvim/rapydscript/bin/rapydscript.so +0 -0
  66. package/editor-plugins/nvim/rapydscript/ftdetect/rapydscript.lua +0 -10
  67. package/editor-plugins/nvim/rapydscript/lua/rapydscript/health.lua +0 -88
  68. package/editor-plugins/nvim/rapydscript/lua/rapydscript/init.lua +0 -279
  69. /package/tree-sitter/queries/{rapydscript/highlights.scm → highlights.scm} +0 -0
  70. /package/tree-sitter/queries/{rapydscript/indents.scm → indents.scm} +0 -0
  71. /package/tree-sitter/queries/{rapydscript/injections.scm → injections.scm} +0 -0
  72. /package/tree-sitter/queries/{rapydscript/locals.scm → locals.scm} +0 -0
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "start": "node bin/rapydscript",
15
15
  "build-self": "node bin/rapydscript self --complete"
16
16
  },
17
- "version": "0.8.0",
17
+ "version": "0.8.2",
18
18
  "license": "BSD-2-Clause",
19
19
  "engines": {
20
20
  "node": ">=0.14.0"
package/publish.py CHANGED
@@ -2,36 +2,46 @@
2
2
  # vim:fileencoding=utf-8
3
3
  # License: BSD Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
4
4
 
5
+ import glob
5
6
  import subprocess
6
7
  import os
7
8
  import shutil
8
9
  import json
10
+ import runpy
9
11
 
10
12
  # Load metadata
11
13
  base = os.path.dirname(os.path.abspath(__file__))
12
- subprocess.check_call([os.path.join(base, 'build')])
13
- with open('package.json', 'rb') as f:
14
- m = json.load(f)
15
- version = m['version']
14
+ with open("package.json", "rb") as f:
15
+ metadata = json.load(f)
16
+ version = metadata["version"]
17
+
18
+ subprocess.check_call([os.path.join(base, "build")])
19
+ runpy.run_path(os.path.join(base, "build_wheels.py"))["main"]()
16
20
 
17
21
  # Update the files in release/ from dev/
18
- shutil.rmtree(os.path.join(base, 'release'))
19
- shutil.copytree(os.path.join(base, 'dev'), os.path.join(base, 'release'))
20
- subprocess.check_call(['git', 'add', os.path.join(base, 'release')])
22
+ shutil.rmtree(os.path.join(base, "release"))
23
+ shutil.copytree(os.path.join(base, "dev"), os.path.join(base, "release"))
24
+ subprocess.check_call(["git", "add", os.path.join(base, "release")])
21
25
  if subprocess.check_output(
22
- 'git status --porcelain --untracked-files release'.split()).strip():
23
- subprocess.check_call([
24
- 'git', 'commit', '-m', 'Updating release build of compiler'])
25
- subprocess.check_call('git push'.split())
26
+ "git status --porcelain --untracked-files release".split()
27
+ ).strip():
28
+ subprocess.check_call(["git", "commit", "-m", "Updating release build of compiler"])
29
+ subprocess.check_call("git push".split())
26
30
 
27
31
  # Tag the release
28
- subprocess.check_call('git tag -s v{0} -m version-{0}'.format(version).split())
29
- subprocess.check_call(['git', 'push', 'origin', 'v'+version])
32
+ subprocess.check_call("git tag -s v{0} -m version-{0}".format(version).split())
33
+ subprocess.check_call(["git", "push", "origin", "v" + version])
30
34
 
31
35
  # Update the web REPL
32
- gh_pages = os.path.join(os.path.dirname(base), 'kovidgoyal.github.io')
33
- subprocess.check_call([os.path.join(gh_pages, 'update-rapyd-repl.py')])
36
+ gh_pages = os.path.join(os.path.dirname(base), "kovidgoyal.github.io")
37
+ subprocess.check_call([os.path.join(gh_pages, "update-rapyd-repl.py")])
38
+
39
+ # Publish to PyPI
40
+ subprocess.check_call(
41
+ ["twine", "upload", "--config-file", os.path.join(os.environ["PENV"], "pypi")]
42
+ + glob.glob("dist/*.whl")
43
+ )
34
44
 
35
45
  # Publish to NPM
36
- subprocess.check_call(['npm', 'login'])
37
- subprocess.check_call(['npm', 'publish', base])
46
+ subprocess.check_call(["npm", "login"])
47
+ subprocess.check_call(["npm", "publish", base])