lispython 0.3.1__tar.gz → 0.3.3__tar.gz

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 (44) hide show
  1. {lispython-0.3.1 → lispython-0.3.3}/PKG-INFO +1 -1
  2. {lispython-0.3.1 → lispython-0.3.3}/docs/syntax/expressions.md +3 -3
  3. lispython-0.3.3/docs/version_macro.py +11 -0
  4. {lispython-0.3.1 → lispython-0.3.3}/pyproject.toml +1 -1
  5. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/compiler/expr.py +8 -13
  6. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/compiler/stmt.py +511 -511
  7. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/macro.py +10 -6
  8. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/meta_functions.py +1 -1
  9. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/parser.py +48 -3
  10. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core_meta_functions.lpy +1 -1
  11. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/macros/sugar.lpy +2 -2
  12. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/tools.lpy +20 -9
  13. lispython-0.3.3/tests/test_include_meta.py +37 -0
  14. {lispython-0.3.1 → lispython-0.3.3}/tests/test_literal.py +15 -0
  15. lispython-0.3.3/tests/test_meta_functions.py +26 -0
  16. {lispython-0.3.1 → lispython-0.3.3}/uv.lock +1 -1
  17. lispython-0.3.1/docs/version_macro.py +0 -10
  18. {lispython-0.3.1 → lispython-0.3.3}/.claude/settings.local.json +0 -0
  19. {lispython-0.3.1 → lispython-0.3.3}/.gitignore +0 -0
  20. {lispython-0.3.1 → lispython-0.3.3}/.pre-commit-config.yaml +0 -0
  21. {lispython-0.3.1 → lispython-0.3.3}/LICENSE.md +0 -0
  22. {lispython-0.3.1 → lispython-0.3.3}/README.md +0 -0
  23. {lispython-0.3.1 → lispython-0.3.3}/docs/index.md +0 -0
  24. {lispython-0.3.1 → lispython-0.3.3}/docs/macros.md +0 -0
  25. {lispython-0.3.1 → lispython-0.3.3}/docs/syntax/overview.md +0 -0
  26. {lispython-0.3.1 → lispython-0.3.3}/docs/syntax/statements.md +0 -0
  27. {lispython-0.3.1 → lispython-0.3.3}/docs/usage/cli.md +0 -0
  28. {lispython-0.3.1 → lispython-0.3.3}/docs/usage/getting-started.md +0 -0
  29. {lispython-0.3.1 → lispython-0.3.3}/docs/why-lispy.md +0 -0
  30. {lispython-0.3.1 → lispython-0.3.3}/mkdocs.yml +0 -0
  31. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/__init__.py +0 -0
  32. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/compiler/__init__.py +0 -0
  33. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/compiler/literal.py +0 -0
  34. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/compiler/utils.py +0 -0
  35. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/importer.py +0 -0
  36. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/nodes.py +0 -0
  37. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/utils.py +0 -0
  38. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/macros/__init__.py +0 -0
  39. {lispython-0.3.1 → lispython-0.3.3}/src/lispy/macros/init.lpy +0 -0
  40. {lispython-0.3.1 → lispython-0.3.3}/tests/__init__.py +0 -0
  41. {lispython-0.3.1 → lispython-0.3.3}/tests/test_expr.py +0 -0
  42. {lispython-0.3.1 → lispython-0.3.3}/tests/test_parser.py +0 -0
  43. {lispython-0.3.1 → lispython-0.3.3}/tests/test_stmt.py +0 -0
  44. {lispython-0.3.1 → lispython-0.3.3}/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lispython
3
- Version: 0.3.1
3
+ Version: 0.3.3
4
4
  Summary: Lisp-like Syntax for Python with Lisp-like Macros
5
5
  Project-URL: Homepage, https://jetack.github.io/lispython
6
6
  Project-URL: Repository, https://github.com/jetack/lispython
@@ -250,13 +250,13 @@ obj[start:stop:step]
250
250
  ### Slice with Emptiness
251
251
  LisPy version
252
252
  ```python
253
- (sub obj [: start])
254
- (sub obj [: _ stop])
253
+ (sub obj [: stop])
254
+ (sub obj [: start _])
255
255
  (sub obj [: start _ step])
256
256
  ```
257
257
  Python version
258
258
  ```python
259
- obj[start:]
260
259
  obj[:stop]
260
+ obj[start:]
261
261
  obj[start::step]
262
262
  ```
@@ -0,0 +1,11 @@
1
+ import tomllib
2
+
3
+ def define_env(env):
4
+ try:
5
+ with open("pyproject.toml", "rb") as f:
6
+ pyproject = tomllib.load(f)
7
+ version = pyproject["project"]["version"]
8
+ except Exception:
9
+ version = "dev"
10
+
11
+ env.variables["version"] = version
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lispython"
3
- version = "0.3.1"
3
+ version = "0.3.3"
4
4
  description = "Lisp-like Syntax for Python with Lisp-like Macros"
5
5
  authors = [{ name = "Jetack", email = "jetack23@gmail.com" }]
6
6
  license = { text = "MIT" }
@@ -359,20 +359,15 @@ def paren_compiler(sexp, ctx):
359
359
 
360
360
  def slice_compile(sexp):
361
361
  [_, *args] = sexp.list
362
- args = deque(args)
362
+ assert 1 <= len(args) <= 3
363
+ [lower, upper, step] = args if len(args) == 3 else args + ["_"] if len(args) == 2 else ["_"] + args + ["_"]
363
364
  args_dict = {}
364
- if args:
365
- lower = args.popleft()
366
- if lower != "None" and lower != "_":
367
- args_dict["lower"] = expr_compile(lower)
368
- if args:
369
- upper = args.popleft()
370
- if upper != "None" and upper != "_":
371
- args_dict["upper"] = expr_compile(upper)
372
- if args:
373
- step = args.popleft()
374
- if step != "None" and step != "_":
375
- args_dict["step"] = expr_compile(step)
365
+ if lower != "None" and lower != "_":
366
+ args_dict["lower"] = expr_compile(lower)
367
+ if upper != "None" and upper != "_":
368
+ args_dict["upper"] = expr_compile(upper)
369
+ if step != "None" and step != "_":
370
+ args_dict["step"] = expr_compile(step)
376
371
  return ast.Slice(**args_dict, **sexp.position_info)
377
372
 
378
373