shellsim 0.1.20__tar.gz → 0.1.21__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.
- {shellsim-0.1.20 → shellsim-0.1.21}/Cargo.lock +3 -1
- {shellsim-0.1.20 → shellsim-0.1.21}/Cargo.toml +3 -1
- {shellsim-0.1.20 → shellsim-0.1.21}/PKG-INFO +3 -3
- {shellsim-0.1.20 → shellsim-0.1.21}/README.md +1 -1
- {shellsim-0.1.20 → shellsim-0.1.21}/pyproject.toml +2 -2
- {shellsim-0.1.20 → shellsim-0.1.21}/python/native/Cargo.lock +4 -2
- {shellsim-0.1.20 → shellsim-0.1.21}/python/native/Cargo.toml +1 -1
- {shellsim-0.1.20 → shellsim-0.1.21}/python/shellsim/_api.py +1 -1
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/ast.rs +13 -1
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/bytecode.rs +74 -16
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/compiler.rs +193 -112
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/complex.rs +67 -163
- shellsim-0.1.21/src/python/cpython_names.rs +505 -0
- shellsim-0.1.21/src/python/exception_types.rs +197 -0
- shellsim-0.1.21/src/python/float_text.rs +144 -0
- shellsim-0.1.21/src/python/hash.rs +273 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/heap.rs +257 -48
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/lexer.rs +128 -23
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/mapping.rs +32 -6
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/mod.rs +99 -175
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/native.rs +412 -93
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/number.rs +759 -67
- shellsim-0.1.21/src/python/object_model.rs +1947 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/parser.rs +371 -75
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/protocol.rs +394 -136
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/slice.rs +43 -23
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/core.rs +2443 -430
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/enum.rs +2 -2
- shellsim-0.1.21/src/python/stdlib/frozen.rs +106 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/importlib.rs +17 -2
- shellsim-0.1.21/src/python/stdlib/introspect.rs +52 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/json.rs +52 -13
- shellsim-0.1.21/src/python/stdlib/mapping_views.rs +464 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/math.rs +407 -5
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/mod.rs +24 -2
- shellsim-0.1.21/src/python/stdlib/numpy/args.rs +318 -0
- shellsim-0.1.21/src/python/stdlib/numpy/array.rs +646 -0
- shellsim-0.1.21/src/python/stdlib/numpy/construct.rs +739 -0
- shellsim-0.1.21/src/python/stdlib/numpy/convert.rs +829 -0
- shellsim-0.1.21/src/python/stdlib/numpy/dtype.rs +776 -0
- shellsim-0.1.21/src/python/stdlib/numpy/dtype_object.rs +259 -0
- shellsim-0.1.21/src/python/stdlib/numpy/element.rs +601 -0
- shellsim-0.1.21/src/python/stdlib/numpy/errstate.rs +73 -0
- shellsim-0.1.21/src/python/stdlib/numpy/format.rs +152 -0
- shellsim-0.1.21/src/python/stdlib/numpy/index.rs +716 -0
- shellsim-0.1.21/src/python/stdlib/numpy/io.rs +215 -0
- shellsim-0.1.21/src/python/stdlib/numpy/layout.rs +255 -0
- shellsim-0.1.21/src/python/stdlib/numpy/linalg/dense.rs +1585 -0
- shellsim-0.1.21/src/python/stdlib/numpy/linalg.rs +846 -0
- shellsim-0.1.21/src/python/stdlib/numpy/math.rs +188 -0
- shellsim-0.1.21/src/python/stdlib/numpy/mod.rs +429 -0
- shellsim-0.1.21/src/python/stdlib/numpy/ndarray.rs +968 -0
- shellsim-0.1.21/src/python/stdlib/numpy/ops.rs +1138 -0
- shellsim-0.1.21/src/python/stdlib/numpy/products.rs +625 -0
- shellsim-0.1.21/src/python/stdlib/numpy/random/bitgen.rs +85 -0
- shellsim-0.1.21/src/python/stdlib/numpy/random/discrete.rs +242 -0
- shellsim-0.1.21/src/python/stdlib/numpy/random/gamma.rs +85 -0
- shellsim-0.1.21/src/python/stdlib/numpy/random/integers.rs +41 -0
- shellsim-0.1.21/src/python/stdlib/numpy/random/normal.rs +32 -0
- shellsim-0.1.21/src/python/stdlib/numpy/random/sequence.rs +45 -0
- shellsim-0.1.21/src/python/stdlib/numpy/random.rs +422 -0
- shellsim-0.1.21/src/python/stdlib/numpy/reduce.rs +1607 -0
- shellsim-0.1.21/src/python/stdlib/numpy/scalar.rs +803 -0
- shellsim-0.1.21/src/python/stdlib/numpy/select.rs +264 -0
- shellsim-0.1.21/src/python/stdlib/numpy/shape/broadcast.rs +74 -0
- shellsim-0.1.21/src/python/stdlib/numpy/shape/diagonal.rs +116 -0
- shellsim-0.1.21/src/python/stdlib/numpy/shape/join.rs +200 -0
- shellsim-0.1.21/src/python/stdlib/numpy/shape/repeat.rs +134 -0
- shellsim-0.1.21/src/python/stdlib/numpy/shape.rs +601 -0
- shellsim-0.1.21/src/python/stdlib/numpy/sort/bincount.rs +107 -0
- shellsim-0.1.21/src/python/stdlib/numpy/sort/search.rs +214 -0
- shellsim-0.1.21/src/python/stdlib/numpy/sort.rs +1003 -0
- shellsim-0.1.21/src/python/stdlib/numpy/ufunc/masked.rs +136 -0
- shellsim-0.1.21/src/python/stdlib/numpy/ufunc.rs +2732 -0
- shellsim-0.1.21/src/python/stdlib/numpy/underflow.rs +96 -0
- shellsim-0.1.21/src/python/stdlib/operator.rs +47 -0
- shellsim-0.1.21/src/python/stdlib/pytest.rs +48 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/re.rs +20 -2
- shellsim-0.1.21/src/python/stdlib/scipy/mod.rs +25 -0
- shellsim-0.1.21/src/python/stdlib/scipy/special/erf.rs +259 -0
- shellsim-0.1.21/src/python/stdlib/scipy/special/gamma.rs +235 -0
- shellsim-0.1.21/src/python/stdlib/scipy/special/ibeta.rs +267 -0
- shellsim-0.1.21/src/python/stdlib/scipy/special/igam.rs +244 -0
- shellsim-0.1.21/src/python/stdlib/scipy/special/meter.rs +94 -0
- shellsim-0.1.21/src/python/stdlib/scipy/special/mod.rs +249 -0
- shellsim-0.1.21/src/python/stdlib/scipy/special/zeta.rs +72 -0
- shellsim-0.1.21/src/python/stdlib/source/collections.py +386 -0
- shellsim-0.1.21/src/python/stdlib/source/contextlib.py +173 -0
- shellsim-0.1.21/src/python/stdlib/source/fractions.py +362 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/importlib.py +24 -3
- shellsim-0.1.21/src/python/stdlib/source/inspect.py +190 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/io.py +88 -19
- shellsim-0.1.21/src/python/stdlib/source/keyword.py +54 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/__init__.py +312 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/_creation.py +552 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/_errors.py +262 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/_io.py +575 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/_math.py +975 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/_printing.py +704 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/_products.py +274 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/_sets.py +173 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/_shapes.py +629 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/_stats.py +507 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/exceptions.py +38 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/fft.py +426 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/linalg.py +301 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/random.py +668 -0
- shellsim-0.1.21/src/python/stdlib/source/numpy/testing.py +243 -0
- shellsim-0.1.21/src/python/stdlib/source/operator.py +364 -0
- shellsim-0.1.21/src/python/stdlib/source/pytest.py +243 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/random.py +69 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/__init__.py +17 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/integrate.py +659 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/interpolate.py +826 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/linalg.py +793 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/optimize.py +625 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/spatial/__init__.py +10 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/spatial/distance.py +455 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/special.py +364 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/stats/__init__.py +65 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/stats/_describe.py +359 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/stats/_distributions.py +625 -0
- shellsim-0.1.21/src/python/stdlib/source/scipy/stats/_tests.py +279 -0
- shellsim-0.1.21/src/python/stdlib/source/warnings.py +284 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/zipfile.py +46 -16
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/sys.rs +49 -5
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/typing.rs +40 -2
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/unittest.rs +43 -3
- shellsim-0.1.21/src/python/stdlib/warnings.rs +35 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/string.rs +5 -1
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/token.rs +3 -0
- shellsim-0.1.21/src/python/unicode/tables.rs +2519 -0
- shellsim-0.1.21/src/python/unicode.rs +234 -0
- shellsim-0.1.21/src/python/vm/calls.rs +2199 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/vm/dispatch.rs +109 -4
- shellsim-0.1.21/src/python/vm/equality.rs +277 -0
- shellsim-0.1.21/src/python/vm/format.rs +744 -0
- shellsim-0.1.21/src/python/vm/hashing.rs +216 -0
- shellsim-0.1.21/src/python/vm/iteration.rs +1047 -0
- shellsim-0.1.21/src/python/vm/mappings.rs +52 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/vm/namespace.rs +413 -199
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/vm/native_runtime.rs +801 -214
- shellsim-0.1.21/src/python/vm/objects.rs +4243 -0
- shellsim-0.1.21/src/python/vm/operations.rs +953 -0
- shellsim-0.1.21/src/python/vm/summation.rs +187 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/vm.rs +310 -121
- {shellsim-0.1.20 → shellsim-0.1.21}/src/resources.rs +1 -1
- shellsim-0.1.20/src/python/object_model.rs +0 -1113
- shellsim-0.1.20/src/python/stdlib/frozen.rs +0 -49
- shellsim-0.1.20/src/python/stdlib/numpy.rs +0 -5122
- shellsim-0.1.20/src/python/stdlib/pytest.rs +0 -100
- shellsim-0.1.20/src/python/stdlib/source/collections.py +0 -181
- shellsim-0.1.20/src/python/stdlib/source/numpy_random.py +0 -99
- shellsim-0.1.20/src/python/stdlib/source/pytest.py +0 -36
- shellsim-0.1.20/src/python/vm/calls.rs +0 -1603
- shellsim-0.1.20/src/python/vm/format.rs +0 -352
- shellsim-0.1.20/src/python/vm/iteration.rs +0 -470
- shellsim-0.1.20/src/python/vm/objects.rs +0 -2090
- shellsim-0.1.20/src/python/vm/operations.rs +0 -461
- {shellsim-0.1.20 → shellsim-0.1.21}/LICENSE +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/python/native/src/lib.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/python/shellsim/__init__.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/python/shellsim/__main__.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/python/shellsim/_cli.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/python/shellsim/py.typed +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/python/shellsim/python.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/rust-toolchain.toml +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/arith.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/bin/shellsim-python.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/clock.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/archives.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/arcmd.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/awk/ast.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/awk/eval.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/awk/lexer.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/awk/parser.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/awk.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/bc.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/builtins.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/dd.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/diff.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/echo.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/expr.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/find.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/format.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/fs.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/apply.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/commit.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/compare.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/config.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/conflict.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/diff.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/ignore.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/import.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/log.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/merge.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/mod.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/plumbing.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/rebase.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/refs.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/repo.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/stash.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/switch.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/git/worktree.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/grep.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/hashing.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/makecmd.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/mod.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/net.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/options.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/patch.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/pkg.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/printf.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/proc.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/regex_compat.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/rgcmd.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/sed.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/sort.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/streams.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/system.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/tarcmd.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/text.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/unavailable.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/util.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/wasm.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/xargs.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/commands/zipcmd.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/corpus.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/descriptors.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/display.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/exec.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/expand.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/harness.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/harness_manager.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/hashes.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/host_ingest.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/interp.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/jqcmd.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/lib.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/main.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/mcp.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/net.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/netcmd.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/process.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/profile.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program/cat.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program/env.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program/find.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program/head.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program/make.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program/nice.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program/nohup.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program/sleep.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program/tee.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program/timeout.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program/xargs.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/program.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/pseudo_fs.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/filesystem.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/http.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/process.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/source.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/argparse.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/asyncio.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/base64.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/bisect.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/collections.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/dataclasses.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/functools.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/hashlib.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/heapq.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/http.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/itertools.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/os.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/abc.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/asyncio.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/base64.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/cmath.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/codecs.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/copy.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/csv.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/datetime.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/functools.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/glob.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/hashlib.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/http.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/http_client.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/json.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/logging.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/os.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/pathlib.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/shutil.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/signal.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/statistics.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/struct.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/subprocess.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/tempfile.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/textwrap.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/urllib.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/urllib_error.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/urllib_request.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/uuid.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/source/zlib.py +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/string.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/struct.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/subprocess.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/time.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/vfs.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/stdlib/zlib.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/python/vm/host.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/realtime.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/sandbox.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/scenario.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/scheduler.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/shell.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/syscalls.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/telemetry.rs +0 -0
- {shellsim-0.1.20 → shellsim-0.1.21}/src/vfs.rs +0 -0
|
@@ -861,14 +861,16 @@ dependencies = [
|
|
|
861
861
|
|
|
862
862
|
[[package]]
|
|
863
863
|
name = "shellsim"
|
|
864
|
-
version = "0.1.
|
|
864
|
+
version = "0.1.21"
|
|
865
865
|
dependencies = [
|
|
866
866
|
"base64",
|
|
867
867
|
"crc32fast",
|
|
868
868
|
"flate2",
|
|
869
869
|
"glob",
|
|
870
870
|
"libc",
|
|
871
|
+
"libm",
|
|
871
872
|
"md-5",
|
|
873
|
+
"memchr",
|
|
872
874
|
"num-bigint",
|
|
873
875
|
"num-traits",
|
|
874
876
|
"regex",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "shellsim"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.21"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
description = "In-process BusyBox-like environment for RL rollouts and agent tests"
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -39,9 +39,11 @@ md-5 = "0.10"
|
|
|
39
39
|
base64 = "0.22"
|
|
40
40
|
crc32fast = "1"
|
|
41
41
|
flate2 = "1"
|
|
42
|
+
memchr = "2"
|
|
42
43
|
wasmtime = { version = "49.0.0", default-features = false, features = ["runtime", "cranelift", "gc-null", "std", "async", "call-hook"] }
|
|
43
44
|
num-bigint = "0.4"
|
|
44
45
|
num-traits = "0.2"
|
|
46
|
+
libm = "0.2"
|
|
45
47
|
|
|
46
48
|
# Process-level syscall sandbox (Linux only): a startup seccomp filter that denies
|
|
47
49
|
# network/exec/fork so no Python-level trick can reach the real OS for those. shellsim
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shellsim
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.21
|
|
4
4
|
Classifier: Development Status :: 3 - Alpha
|
|
5
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
6
5
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
7
6
|
Classifier: Operating System :: Microsoft :: Windows
|
|
8
7
|
Classifier: Operating System :: POSIX :: Linux
|
|
@@ -15,6 +14,7 @@ License-File: LICENSE
|
|
|
15
14
|
Summary: In-process BusyBox-like environment for RL rollouts and agent tests
|
|
16
15
|
Keywords: agents,containers,reinforcement-learning,sandbox,simulation,testing
|
|
17
16
|
Author: The shellsim authors
|
|
17
|
+
License-Expression: Apache-2.0
|
|
18
18
|
Requires-Python: >=3.9
|
|
19
19
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
20
20
|
Project-URL: Homepage, https://github.com/rjpower/shellsim
|
|
@@ -216,7 +216,7 @@ printf '%s\n' \
|
|
|
216
216
|
## Resource model
|
|
217
217
|
|
|
218
218
|
CPU is deterministic fuel, memory is modeled working set, disk is current virtual-filesystem
|
|
219
|
-
usage, and output bounds materialized stdout and stderr. The defaults are
|
|
219
|
+
usage, and output bounds materialized stdout and stderr. The defaults are 100,000,000 CPU units,
|
|
220
220
|
64 MiB memory, 64 MiB disk, and 4 MiB output. Costs use simple, stable approximations intended to
|
|
221
221
|
be correct within an order of magnitude. They bound runaway work and make runs comparable; they
|
|
222
222
|
do not model allocator layouts or instruction timing exactly. Exhaustion is observable and never
|
|
@@ -193,7 +193,7 @@ printf '%s\n' \
|
|
|
193
193
|
## Resource model
|
|
194
194
|
|
|
195
195
|
CPU is deterministic fuel, memory is modeled working set, disk is current virtual-filesystem
|
|
196
|
-
usage, and output bounds materialized stdout and stderr. The defaults are
|
|
196
|
+
usage, and output bounds materialized stdout and stderr. The defaults are 100,000,000 CPU units,
|
|
197
197
|
64 MiB memory, 64 MiB disk, and 4 MiB output. Costs use simple, stable approximations intended to
|
|
198
198
|
be correct within an order of magnitude. They bound runaway work and make runs comparable; they
|
|
199
199
|
do not model allocator layouts or instruction timing exactly. Exhaustion is observable and never
|
|
@@ -8,11 +8,11 @@ dynamic = ["version"]
|
|
|
8
8
|
description = "In-process BusyBox-like environment for RL rollouts and agent tests"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
11
|
-
license =
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
12
13
|
authors = [{ name = "The shellsim authors" }]
|
|
13
14
|
classifiers = [
|
|
14
15
|
"Development Status :: 3 - Alpha",
|
|
15
|
-
"License :: OSI Approved :: Apache Software License",
|
|
16
16
|
"Operating System :: MacOS :: MacOS X",
|
|
17
17
|
"Operating System :: Microsoft :: Windows",
|
|
18
18
|
"Operating System :: POSIX :: Linux",
|
|
@@ -925,14 +925,16 @@ dependencies = [
|
|
|
925
925
|
|
|
926
926
|
[[package]]
|
|
927
927
|
name = "shellsim"
|
|
928
|
-
version = "0.1.
|
|
928
|
+
version = "0.1.21"
|
|
929
929
|
dependencies = [
|
|
930
930
|
"base64",
|
|
931
931
|
"crc32fast",
|
|
932
932
|
"flate2",
|
|
933
933
|
"glob",
|
|
934
934
|
"libc",
|
|
935
|
+
"libm",
|
|
935
936
|
"md-5",
|
|
937
|
+
"memchr",
|
|
936
938
|
"num-bigint",
|
|
937
939
|
"num-traits",
|
|
938
940
|
"regex",
|
|
@@ -947,7 +949,7 @@ dependencies = [
|
|
|
947
949
|
|
|
948
950
|
[[package]]
|
|
949
951
|
name = "shellsim-python-bindings"
|
|
950
|
-
version = "0.1.
|
|
952
|
+
version = "0.1.21"
|
|
951
953
|
dependencies = [
|
|
952
954
|
"pyo3",
|
|
953
955
|
"serde",
|
|
@@ -19,7 +19,7 @@ _MAX_U64 = (1 << 64) - 1
|
|
|
19
19
|
class Limits:
|
|
20
20
|
"""Cumulative resource limits for one simulated environment."""
|
|
21
21
|
|
|
22
|
-
cpu: int =
|
|
22
|
+
cpu: int = 100_000_000
|
|
23
23
|
memory: int = 64 * 1024 * 1024
|
|
24
24
|
disk: int = 64 * 1024 * 1024
|
|
25
25
|
output: int = 4 * 1024 * 1024
|
|
@@ -23,6 +23,10 @@ pub enum StatementKind {
|
|
|
23
23
|
module: String,
|
|
24
24
|
names: Vec<(String, String)>,
|
|
25
25
|
},
|
|
26
|
+
/// `from module import *` binds the module's public names; only valid at module level.
|
|
27
|
+
ImportStar {
|
|
28
|
+
module: String,
|
|
29
|
+
},
|
|
26
30
|
Assign {
|
|
27
31
|
targets: Vec<AssignmentTarget>,
|
|
28
32
|
value: Expression,
|
|
@@ -92,7 +96,11 @@ pub enum StatementKind {
|
|
|
92
96
|
otherwise: Vec<Statement>,
|
|
93
97
|
finalbody: Vec<Statement>,
|
|
94
98
|
},
|
|
95
|
-
|
|
99
|
+
/// `raise [exception [from cause]]`.
|
|
100
|
+
Raise {
|
|
101
|
+
exception: Option<Expression>,
|
|
102
|
+
cause: Option<Expression>,
|
|
103
|
+
},
|
|
96
104
|
With {
|
|
97
105
|
context: Expression,
|
|
98
106
|
target: Option<AssignmentTarget>,
|
|
@@ -286,6 +294,8 @@ pub struct Parameter {
|
|
|
286
294
|
|
|
287
295
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
|
288
296
|
pub enum ParameterKind {
|
|
297
|
+
/// A parameter before a `/` marker, which callers cannot pass by keyword.
|
|
298
|
+
PositionalOnly,
|
|
289
299
|
Positional,
|
|
290
300
|
Variadic,
|
|
291
301
|
KeywordOnly,
|
|
@@ -295,6 +305,8 @@ pub enum ParameterKind {
|
|
|
295
305
|
#[derive(Clone, Debug, PartialEq)]
|
|
296
306
|
pub enum Constant {
|
|
297
307
|
None,
|
|
308
|
+
/// The `...` literal, which evaluates to the `Ellipsis` singleton.
|
|
309
|
+
Ellipsis,
|
|
298
310
|
Bool(bool),
|
|
299
311
|
Integer(i64),
|
|
300
312
|
BigInteger(String),
|
|
@@ -39,7 +39,7 @@ side_table_id!(CallId);
|
|
|
39
39
|
side_table_id!(FunctionId);
|
|
40
40
|
side_table_id!(ClassId);
|
|
41
41
|
side_table_id!(FormatId);
|
|
42
|
-
side_table_id!(
|
|
42
|
+
side_table_id!(UnpackId);
|
|
43
43
|
side_table_id!(ErrorId);
|
|
44
44
|
|
|
45
45
|
#[derive(Clone, Debug, PartialEq)]
|
|
@@ -57,7 +57,8 @@ pub struct Code {
|
|
|
57
57
|
functions: Box<[FunctionSpec]>,
|
|
58
58
|
classes: Box<[ClassSpec]>,
|
|
59
59
|
formats: Box<[FormatSpec]>,
|
|
60
|
-
|
|
60
|
+
/// Per-operand unpacking flags shared by dictionary and starred sequence displays.
|
|
61
|
+
unpack_flags: Box<[Box<[bool]>]>,
|
|
61
62
|
errors: Box<[String]>,
|
|
62
63
|
}
|
|
63
64
|
|
|
@@ -101,8 +102,8 @@ impl Code {
|
|
|
101
102
|
&self.formats[id.index()]
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
pub fn
|
|
105
|
-
&self.
|
|
105
|
+
pub fn unpack_flags(&self, id: UnpackId) -> &[bool] {
|
|
106
|
+
&self.unpack_flags[id.index()]
|
|
106
107
|
}
|
|
107
108
|
|
|
108
109
|
pub fn error(&self, id: ErrorId) -> &str {
|
|
@@ -119,6 +120,7 @@ pub struct Parameter {
|
|
|
119
120
|
|
|
120
121
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
|
121
122
|
pub enum ParameterKind {
|
|
123
|
+
PositionalOnly,
|
|
122
124
|
Positional,
|
|
123
125
|
Variadic,
|
|
124
126
|
KeywordOnly,
|
|
@@ -181,6 +183,7 @@ pub enum Opcode {
|
|
|
181
183
|
StoreGlobal(NameId),
|
|
182
184
|
StoreAttribute(NameId),
|
|
183
185
|
StoreSubscript,
|
|
186
|
+
DeleteAttribute(NameId),
|
|
184
187
|
DeleteName(NameId),
|
|
185
188
|
DeleteLocal(usize),
|
|
186
189
|
DeleteGlobal(NameId),
|
|
@@ -189,6 +192,10 @@ pub enum Opcode {
|
|
|
189
192
|
name: NameId,
|
|
190
193
|
bind_root: bool,
|
|
191
194
|
},
|
|
195
|
+
/// `from module import name`, with the module on top of the stack; it stays there.
|
|
196
|
+
ImportFrom(NameId),
|
|
197
|
+
/// `from module import *`: pop the module and bind its public names in the current scope.
|
|
198
|
+
ImportStar,
|
|
192
199
|
LoadAttribute(NameId),
|
|
193
200
|
LoadSubscript,
|
|
194
201
|
BuildSlice {
|
|
@@ -198,8 +205,13 @@ pub enum Opcode {
|
|
|
198
205
|
},
|
|
199
206
|
BuildList(usize),
|
|
200
207
|
BuildTuple(usize),
|
|
201
|
-
BuildDict(
|
|
208
|
+
BuildDict(UnpackId),
|
|
202
209
|
BuildSet(usize),
|
|
210
|
+
/// A list, tuple, or set display with at least one `*iterable` operand.
|
|
211
|
+
BuildUnpacked {
|
|
212
|
+
kind: DisplayKind,
|
|
213
|
+
starred: UnpackId,
|
|
214
|
+
},
|
|
203
215
|
UnpackSequence {
|
|
204
216
|
count: usize,
|
|
205
217
|
star_index: Option<usize>,
|
|
@@ -210,6 +222,8 @@ pub enum Opcode {
|
|
|
210
222
|
ForIterator(usize),
|
|
211
223
|
Unary(UnaryOperator),
|
|
212
224
|
Binary(BinaryOperator),
|
|
225
|
+
/// Augmented assignment: the left operand's in-place method, else the binary operator.
|
|
226
|
+
InPlaceBinary(BinaryOperator),
|
|
213
227
|
FormatValue(FormatId),
|
|
214
228
|
Compare(ComparisonOperator),
|
|
215
229
|
Call(CallId),
|
|
@@ -231,7 +245,9 @@ pub enum Opcode {
|
|
|
231
245
|
ClearException,
|
|
232
246
|
Reraise,
|
|
233
247
|
Raise(bool),
|
|
248
|
+
RaiseFrom,
|
|
234
249
|
Yield,
|
|
250
|
+
YieldFromSend(usize),
|
|
235
251
|
AwaitResult,
|
|
236
252
|
WithEnter,
|
|
237
253
|
WithExit,
|
|
@@ -260,6 +276,7 @@ pub enum Operation {
|
|
|
260
276
|
StoreGlobal(String),
|
|
261
277
|
StoreAttribute(String),
|
|
262
278
|
StoreSubscript,
|
|
279
|
+
DeleteAttribute(String),
|
|
263
280
|
DeleteName(String),
|
|
264
281
|
DeleteLocal(usize),
|
|
265
282
|
DeleteGlobal(String),
|
|
@@ -268,6 +285,8 @@ pub enum Operation {
|
|
|
268
285
|
name: String,
|
|
269
286
|
bind_root: bool,
|
|
270
287
|
},
|
|
288
|
+
ImportFrom(String),
|
|
289
|
+
ImportStar,
|
|
271
290
|
LoadAttribute(String),
|
|
272
291
|
LoadSubscript,
|
|
273
292
|
BuildSlice {
|
|
@@ -281,6 +300,11 @@ pub enum Operation {
|
|
|
281
300
|
/// consumes one key/value pair.
|
|
282
301
|
BuildDict(Vec<bool>),
|
|
283
302
|
BuildSet(usize),
|
|
303
|
+
/// Build a list, tuple, or set from source-ordered operands; `true` expands an iterable.
|
|
304
|
+
BuildUnpacked {
|
|
305
|
+
kind: DisplayKind,
|
|
306
|
+
starred: Vec<bool>,
|
|
307
|
+
},
|
|
284
308
|
UnpackSequence {
|
|
285
309
|
count: usize,
|
|
286
310
|
star_index: Option<usize>,
|
|
@@ -301,6 +325,8 @@ pub enum Operation {
|
|
|
301
325
|
ForIterator(usize),
|
|
302
326
|
Unary(UnaryOperator),
|
|
303
327
|
Binary(BinaryOperator),
|
|
328
|
+
/// Augmented assignment: the left operand's in-place method, else the binary operator.
|
|
329
|
+
InPlaceBinary(BinaryOperator),
|
|
304
330
|
FormatValue {
|
|
305
331
|
conversion: Option<char>,
|
|
306
332
|
format_spec: String,
|
|
@@ -331,8 +357,15 @@ pub enum Operation {
|
|
|
331
357
|
ClearException,
|
|
332
358
|
Reraise,
|
|
333
359
|
Raise(bool),
|
|
360
|
+
/// `raise exception from cause`: pops the cause, then the exception.
|
|
361
|
+
RaiseFrom,
|
|
334
362
|
/// Suspend a generator frame and return the value on top of the stack.
|
|
335
363
|
Yield,
|
|
364
|
+
/// One step of `yield from`: pop the value sent into the generator and pass it to the
|
|
365
|
+
/// subiterator below it. A yielded value suspends the frame at this same instruction, so the
|
|
366
|
+
/// next `send` repeats the step; when the subiterator finishes, it is replaced by its return
|
|
367
|
+
/// value and control jumps to the target.
|
|
368
|
+
YieldFromSend(usize),
|
|
336
369
|
/// Unwrap the scheduler outcome sent into a suspended coroutine.
|
|
337
370
|
AwaitResult,
|
|
338
371
|
WithEnter,
|
|
@@ -344,6 +377,14 @@ pub enum Operation {
|
|
|
344
377
|
Halt,
|
|
345
378
|
}
|
|
346
379
|
|
|
380
|
+
/// The container a sequence display builds.
|
|
381
|
+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
|
382
|
+
pub enum DisplayKind {
|
|
383
|
+
List,
|
|
384
|
+
Tuple,
|
|
385
|
+
Set,
|
|
386
|
+
}
|
|
387
|
+
|
|
347
388
|
#[derive(Default)]
|
|
348
389
|
pub struct CodeBuilder {
|
|
349
390
|
names: Vec<Arc<str>>,
|
|
@@ -353,7 +394,7 @@ pub struct CodeBuilder {
|
|
|
353
394
|
functions: Vec<FunctionSpec>,
|
|
354
395
|
classes: Vec<ClassSpec>,
|
|
355
396
|
formats: Vec<FormatSpec>,
|
|
356
|
-
|
|
397
|
+
unpack_flags: Vec<Box<[bool]>>,
|
|
357
398
|
errors: Vec<String>,
|
|
358
399
|
}
|
|
359
400
|
|
|
@@ -369,6 +410,12 @@ impl CodeBuilder {
|
|
|
369
410
|
id
|
|
370
411
|
}
|
|
371
412
|
|
|
413
|
+
fn unpack_flags(&mut self, flags: Vec<bool>) -> UnpackId {
|
|
414
|
+
let id = UnpackId::new(self.unpack_flags.len());
|
|
415
|
+
self.unpack_flags.push(flags.into_boxed_slice());
|
|
416
|
+
id
|
|
417
|
+
}
|
|
418
|
+
|
|
372
419
|
pub fn lower(&mut self, operation: Operation) -> Opcode {
|
|
373
420
|
match operation {
|
|
374
421
|
Operation::LoadConstant(value) => {
|
|
@@ -389,6 +436,7 @@ impl CodeBuilder {
|
|
|
389
436
|
Operation::StoreGlobal(name) => Opcode::StoreGlobal(self.name(name)),
|
|
390
437
|
Operation::StoreAttribute(name) => Opcode::StoreAttribute(self.name(name)),
|
|
391
438
|
Operation::StoreSubscript => Opcode::StoreSubscript,
|
|
439
|
+
Operation::DeleteAttribute(name) => Opcode::DeleteAttribute(self.name(name)),
|
|
392
440
|
Operation::DeleteName(name) => Opcode::DeleteName(self.name(name)),
|
|
393
441
|
Operation::DeleteLocal(slot) => Opcode::DeleteLocal(slot),
|
|
394
442
|
Operation::DeleteGlobal(name) => Opcode::DeleteGlobal(self.name(name)),
|
|
@@ -397,6 +445,8 @@ impl CodeBuilder {
|
|
|
397
445
|
name: self.name(name),
|
|
398
446
|
bind_root,
|
|
399
447
|
},
|
|
448
|
+
Operation::ImportFrom(name) => Opcode::ImportFrom(self.name(name)),
|
|
449
|
+
Operation::ImportStar => Opcode::ImportStar,
|
|
400
450
|
Operation::LoadAttribute(name) => Opcode::LoadAttribute(self.name(name)),
|
|
401
451
|
Operation::LoadSubscript => Opcode::LoadSubscript,
|
|
402
452
|
Operation::BuildSlice {
|
|
@@ -410,12 +460,12 @@ impl CodeBuilder {
|
|
|
410
460
|
},
|
|
411
461
|
Operation::BuildList(count) => Opcode::BuildList(count),
|
|
412
462
|
Operation::BuildTuple(count) => Opcode::BuildTuple(count),
|
|
413
|
-
Operation::BuildDict(entries) =>
|
|
414
|
-
let id = DictId::new(self.dicts.len());
|
|
415
|
-
self.dicts.push(entries.into_boxed_slice());
|
|
416
|
-
Opcode::BuildDict(id)
|
|
417
|
-
}
|
|
463
|
+
Operation::BuildDict(entries) => Opcode::BuildDict(self.unpack_flags(entries)),
|
|
418
464
|
Operation::BuildSet(count) => Opcode::BuildSet(count),
|
|
465
|
+
Operation::BuildUnpacked { kind, starred } => Opcode::BuildUnpacked {
|
|
466
|
+
kind,
|
|
467
|
+
starred: self.unpack_flags(starred),
|
|
468
|
+
},
|
|
419
469
|
Operation::UnpackSequence { count, star_index } => {
|
|
420
470
|
Opcode::UnpackSequence { count, star_index }
|
|
421
471
|
}
|
|
@@ -455,6 +505,7 @@ impl CodeBuilder {
|
|
|
455
505
|
Operation::ForIterator(target) => Opcode::ForIterator(target),
|
|
456
506
|
Operation::Unary(operator) => Opcode::Unary(operator),
|
|
457
507
|
Operation::Binary(operator) => Opcode::Binary(operator),
|
|
508
|
+
Operation::InPlaceBinary(operator) => Opcode::InPlaceBinary(operator),
|
|
458
509
|
Operation::FormatValue {
|
|
459
510
|
conversion,
|
|
460
511
|
format_spec,
|
|
@@ -504,7 +555,9 @@ impl CodeBuilder {
|
|
|
504
555
|
Operation::ClearException => Opcode::ClearException,
|
|
505
556
|
Operation::Reraise => Opcode::Reraise,
|
|
506
557
|
Operation::Raise(cause) => Opcode::Raise(cause),
|
|
558
|
+
Operation::RaiseFrom => Opcode::RaiseFrom,
|
|
507
559
|
Operation::Yield => Opcode::Yield,
|
|
560
|
+
Operation::YieldFromSend(target) => Opcode::YieldFromSend(target),
|
|
508
561
|
Operation::AwaitResult => Opcode::AwaitResult,
|
|
509
562
|
Operation::WithEnter => Opcode::WithEnter,
|
|
510
563
|
Operation::WithExit => Opcode::WithExit,
|
|
@@ -526,12 +579,17 @@ impl CodeBuilder {
|
|
|
526
579
|
) -> CodeRef {
|
|
527
580
|
let positional_count = parameters
|
|
528
581
|
.iter()
|
|
529
|
-
.take_while(|parameter|
|
|
582
|
+
.take_while(|parameter| {
|
|
583
|
+
matches!(
|
|
584
|
+
parameter.kind,
|
|
585
|
+
ParameterKind::PositionalOnly | ParameterKind::Positional
|
|
586
|
+
)
|
|
587
|
+
})
|
|
530
588
|
.count();
|
|
531
589
|
let call_signature = CallSignature {
|
|
532
|
-
is_generator: instructions
|
|
533
|
-
.
|
|
534
|
-
|
|
590
|
+
is_generator: instructions.iter().any(|instruction| {
|
|
591
|
+
matches!(instruction.opcode, Opcode::Yield | Opcode::YieldFromSend(_))
|
|
592
|
+
}),
|
|
535
593
|
is_coroutine,
|
|
536
594
|
positional_count,
|
|
537
595
|
variadic_slot: parameters
|
|
@@ -559,7 +617,7 @@ impl CodeBuilder {
|
|
|
559
617
|
functions: self.functions.into_boxed_slice(),
|
|
560
618
|
classes: self.classes.into_boxed_slice(),
|
|
561
619
|
formats: self.formats.into_boxed_slice(),
|
|
562
|
-
|
|
620
|
+
unpack_flags: self.unpack_flags.into_boxed_slice(),
|
|
563
621
|
errors: self.errors.into_boxed_slice(),
|
|
564
622
|
})
|
|
565
623
|
}
|