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.
- {lispython-0.3.1 → lispython-0.3.3}/PKG-INFO +1 -1
- {lispython-0.3.1 → lispython-0.3.3}/docs/syntax/expressions.md +3 -3
- lispython-0.3.3/docs/version_macro.py +11 -0
- {lispython-0.3.1 → lispython-0.3.3}/pyproject.toml +1 -1
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/compiler/expr.py +8 -13
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/compiler/stmt.py +511 -511
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/macro.py +10 -6
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/meta_functions.py +1 -1
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/parser.py +48 -3
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core_meta_functions.lpy +1 -1
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/macros/sugar.lpy +2 -2
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/tools.lpy +20 -9
- lispython-0.3.3/tests/test_include_meta.py +37 -0
- {lispython-0.3.1 → lispython-0.3.3}/tests/test_literal.py +15 -0
- lispython-0.3.3/tests/test_meta_functions.py +26 -0
- {lispython-0.3.1 → lispython-0.3.3}/uv.lock +1 -1
- lispython-0.3.1/docs/version_macro.py +0 -10
- {lispython-0.3.1 → lispython-0.3.3}/.claude/settings.local.json +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/.gitignore +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/.pre-commit-config.yaml +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/LICENSE.md +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/README.md +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/docs/index.md +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/docs/macros.md +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/docs/syntax/overview.md +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/docs/syntax/statements.md +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/docs/usage/cli.md +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/docs/usage/getting-started.md +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/docs/why-lispy.md +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/mkdocs.yml +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/__init__.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/compiler/__init__.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/compiler/literal.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/compiler/utils.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/importer.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/nodes.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/core/utils.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/macros/__init__.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/src/lispy/macros/init.lpy +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/tests/__init__.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/tests/test_expr.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/tests/test_parser.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/tests/test_stmt.py +0 -0
- {lispython-0.3.1 → lispython-0.3.3}/tests/utils.py +0 -0
|
@@ -250,13 +250,13 @@ obj[start:stop:step]
|
|
|
250
250
|
### Slice with Emptiness
|
|
251
251
|
LisPy version
|
|
252
252
|
```python
|
|
253
|
-
(sub obj [:
|
|
254
|
-
(sub obj [: _
|
|
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
|
```
|
|
@@ -359,20 +359,15 @@ def paren_compiler(sexp, ctx):
|
|
|
359
359
|
|
|
360
360
|
def slice_compile(sexp):
|
|
361
361
|
[_, *args] = sexp.list
|
|
362
|
-
|
|
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
|
|
365
|
-
lower =
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
if
|
|
369
|
-
|
|
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
|
|