From 6b596dd2ec529f404eb19c2c58e8deeaacafa5df Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Thu, 21 May 2026 18:55:05 +0200 Subject: [PATCH] rustyline --- cc-1.2.60/.cargo_vcs_info.json | 6 - {cc-1.2.60 => cc-1.2.62}/.cargo-checksum.json | 2 +- cc-1.2.62/.cargo_vcs_info.json | 6 + {cc-1.2.60 => cc-1.2.62}/CHANGELOG.md | 15 + {cc-1.2.60 => cc-1.2.62}/Cargo.lock | 24 +- {cc-1.2.60 => cc-1.2.62}/Cargo.toml | 2 +- {cc-1.2.60 => cc-1.2.62}/Cargo.toml.orig | 2 +- {cc-1.2.60 => cc-1.2.62}/LICENSE-APACHE | 0 {cc-1.2.60 => cc-1.2.62}/LICENSE-MIT | 0 {cc-1.2.60 => cc-1.2.62}/README.md | 0 {cc-1.2.60 => cc-1.2.62}/clippy.toml | 0 .../src/command_helpers.rs | 2 +- .../src/detect_compiler_family.c | 0 {cc-1.2.60 => cc-1.2.62}/src/flags.rs | 0 {cc-1.2.60 => cc-1.2.62}/src/lib.rs | 13 +- .../src/parallel/async_executor.rs | 0 .../src/parallel/command_runner.rs | 0 .../src/parallel/job_token.rs | 0 {cc-1.2.60 => cc-1.2.62}/src/parallel/mod.rs | 0 .../src/parallel/stderr.rs | 0 {cc-1.2.60 => cc-1.2.62}/src/target.rs | 0 {cc-1.2.60 => cc-1.2.62}/src/target/apple.rs | 0 .../src/target/generated.rs | 2 +- {cc-1.2.60 => cc-1.2.62}/src/target/llvm.rs | 0 {cc-1.2.60 => cc-1.2.62}/src/target/parser.rs | 2 + {cc-1.2.60 => cc-1.2.62}/src/tempfile.rs | 0 {cc-1.2.60 => cc-1.2.62}/src/tool.rs | 0 {cc-1.2.60 => cc-1.2.62}/src/utilities.rs | 0 clap_complete-4.6.2/.cargo-checksum.json | 1 - clap_complete-4.6.2/.cargo_vcs_info.json | 6 - clap_complete-4.6.5/.cargo-checksum.json | 1 + clap_complete-4.6.5/.cargo_vcs_info.json | 6 + .../Cargo.lock | 6 +- .../Cargo.toml | 4 +- .../Cargo.toml.orig | 2 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 8 +- .../examples/completion-derive.rs | 7 +- .../examples/completion.rs | 7 +- .../examples/dynamic.rs | 0 .../examples/exhaustive.rs | 2 +- .../src/aot/generator/mod.rs | 0 .../src/aot/generator/utils.rs | 38 +- .../src/aot/mod.rs | 0 .../src/aot/shells/bash.rs | 56 +- .../src/aot/shells/elvish.rs | 2 +- .../src/aot/shells/fish.rs | 4 +- .../src/aot/shells/mod.rs | 0 .../src/aot/shells/powershell.rs | 2 +- .../src/aot/shells/shell.rs | 0 .../src/aot/shells/zsh.rs | 10 +- .../src/engine/candidate.rs | 0 .../src/engine/complete.rs | 34 +- .../src/engine/custom.rs | 33 + .../src/engine/mod.rs | 0 .../src/env/mod.rs | 0 .../src/env/shells.rs | 117 +- .../src/lib.rs | 0 .../src/macros.rs | 0 either-1.16.0/.cargo-checksum.json | 1 + either-1.16.0/.cargo_vcs_info.json | 6 + either-1.16.0/.github/workflows/ci.yml | 90 + either-1.16.0/Cargo.lock | 89 + either-1.16.0/Cargo.toml | 69 + either-1.16.0/Cargo.toml.orig | 39 + .../LICENSE-APACHE | 0 either-1.16.0/LICENSE-MIT | 25 + either-1.16.0/README-crates.io.md | 10 + either-1.16.0/README.rst | 220 + either-1.16.0/src/into_either.rs | 64 + either-1.16.0/src/iterator.rs | 315 + either-1.16.0/src/lib.rs | 1826 +++ either-1.16.0/src/serde_untagged.rs | 69 + either-1.16.0/src/serde_untagged_optional.rs | 74 + endian-type-0.1.2/.cargo-checksum.json | 1 + endian-type-0.1.2/Cargo.toml | 11 + endian-type-0.1.2/LICENSE | 22 + endian-type-0.1.2/src/lib.rs | 203 + hashbrown-0.17.0/.cargo_vcs_info.json | 6 - .../.cargo-checksum.json | 2 +- hashbrown-0.17.1/.cargo_vcs_info.json | 6 + .../CHANGELOG.md | 6 + .../Cargo.lock | 80 +- .../Cargo.toml | 3 +- .../Cargo.toml.orig | 3 +- .../Cross.toml | 0 .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 49 +- .../benches/bench.rs | 0 .../benches/general_ops.rs | 0 .../benches/insert_unique_unchecked.rs | 0 .../benches/set_ops.rs | 0 .../benches/with_capacity.rs | 0 .../clippy.toml | 0 .../src/alloc.rs | 0 .../src/control/bitmask.rs | 0 .../src/control/group/generic.rs | 0 .../src/control/group/lsx.rs | 5 +- .../src/control/group/mod.rs | 0 .../src/control/group/neon.rs | 0 .../src/control/group/sse2.rs | 0 .../src/control/mod.rs | 0 .../src/control/tag.rs | 0 .../src/external_trait_impls/mod.rs | 0 .../src/external_trait_impls/rayon/helpers.rs | 0 .../src/external_trait_impls/rayon/map.rs | 0 .../src/external_trait_impls/rayon/mod.rs | 0 .../src/external_trait_impls/rayon/raw.rs | 0 .../src/external_trait_impls/rayon/set.rs | 0 .../src/external_trait_impls/rayon/table.rs | 0 .../src/external_trait_impls/serde.rs | 0 .../src/hasher.rs | 0 .../src/lib.rs | 0 .../src/macros.rs | 0 .../src/map.rs | 0 .../src/raw.rs | 0 .../src/raw_entry.rs | 0 .../src/rustc_entry.rs | 68 +- .../src/scopeguard.rs | 0 .../src/set.rs | 0 .../src/table.rs | 0 .../src/util.rs | 0 .../tests/equivalent_trait.rs | 0 .../tests/hasher.rs | 0 .../tests/hasher_unwind.rs | 0 .../tests/rayon.rs | 0 .../tests/serde.rs | 0 .../tests/set.rs | 0 jiff-0.2.23/.cargo_vcs_info.json | 6 - .../.cargo-checksum.json | 2 +- jiff-0.2.24/.cargo_vcs_info.json | 6 + {jiff-0.2.23 => jiff-0.2.24}/CHANGELOG.md | 20 + {jiff-0.2.23 => jiff-0.2.24}/COMPARE.md | 0 {jiff-0.2.23 => jiff-0.2.24}/COPYING | 0 {jiff-0.2.23 => jiff-0.2.24}/Cargo.lock | 6 +- {jiff-0.2.23 => jiff-0.2.24}/Cargo.toml | 4 +- {jiff-0.2.23 => jiff-0.2.24}/Cargo.toml.orig | 4 +- {jiff-0.2.23 => jiff-0.2.24}/DESIGN.md | 0 {jiff-0.2.23 => jiff-0.2.24}/LICENSE-MIT | 0 {jiff-0.2.23 => jiff-0.2.24}/PLATFORM.md | 0 {jiff-0.2.23 => jiff-0.2.24}/README.md | 8 +- {jiff-0.2.23 => jiff-0.2.24}/UNLICENSE | 0 .../src/civil/date.rs | 2 +- .../src/civil/datetime.rs | 0 .../src/civil/iso_week_date.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/civil/mod.rs | 0 .../src/civil/time.rs | 0 .../src/civil/weekday.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/duration.rs | 0 .../src/error/civil.rs | 0 .../src/error/duration.rs | 0 .../src/error/fmt/friendly.rs | 0 .../src/error/fmt/mod.rs | 0 .../src/error/fmt/offset.rs | 0 .../src/error/fmt/rfc2822.rs | 0 .../src/error/fmt/rfc9557.rs | 0 .../src/error/fmt/strtime.rs | 0 .../src/error/fmt/temporal.rs | 0 .../src/error/fmt/util.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/error/mod.rs | 0 .../src/error/signed_duration.rs | 0 .../src/error/span.rs | 0 .../src/error/timestamp.rs | 0 .../src/error/tz/ambiguous.rs | 0 .../src/error/tz/concatenated.rs | 0 .../src/error/tz/db.rs | 0 .../src/error/tz/mod.rs | 0 .../src/error/tz/offset.rs | 0 .../src/error/tz/posix.rs | 0 .../src/error/tz/system.rs | 0 .../src/error/tz/timezone.rs | 0 .../src/error/tz/zic.rs | 0 .../src/error/unit.rs | 0 .../src/error/util.rs | 0 .../src/error/zoned.rs | 0 .../src/fmt/buffer.rs | 0 .../src/fmt/friendly/mod.rs | 0 .../src/fmt/friendly/parser.rs | 0 .../src/fmt/friendly/parser_label.rs | 0 .../src/fmt/friendly/printer.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/fmt/mod.rs | 0 .../src/fmt/offset.rs | 0 .../src/fmt/rfc2822.rs | 0 .../src/fmt/rfc9557.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/fmt/serde.rs | 0 .../src/fmt/strtime/mod.rs | 0 .../src/fmt/strtime/parse.rs | 0 .../src/fmt/strtime/printer.rs | 0 .../src/fmt/temporal/mod.rs | 0 .../src/fmt/temporal/parser.rs | 0 .../src/fmt/temporal/pieces.rs | 0 .../src/fmt/temporal/printer.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/fmt/util.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/lib.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/logging.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/now.rs | 0 .../src/shared/crc32/mod.rs | 0 .../src/shared/crc32/table.rs | 0 .../src/shared/mod.rs | 0 .../src/shared/posix.rs | 0 .../src/shared/tzif.rs | 0 .../src/shared/util/array_str.rs | 0 .../src/shared/util/itime.rs | 0 .../src/shared/util/mod.rs | 0 .../src/signed_duration.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/span.rs | 5 +- {jiff-0.2.23 => jiff-0.2.24}/src/timestamp.rs | 0 .../src/tz/ambiguous.rs | 0 .../src/tz/concatenated.rs | 0 .../src/tz/db/bundled/disabled.rs | 0 .../src/tz/db/bundled/enabled.rs | 0 .../src/tz/db/bundled/mod.rs | 0 .../src/tz/db/concatenated/disabled.rs | 0 .../src/tz/db/concatenated/enabled.rs | 0 .../src/tz/db/concatenated/mod.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/tz/db/mod.rs | 0 .../src/tz/db/zoneinfo/disabled.rs | 0 .../src/tz/db/zoneinfo/enabled.rs | 0 .../src/tz/db/zoneinfo/mod.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/tz/mod.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/tz/offset.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/tz/posix.rs | 0 .../src/tz/system/android.rs | 0 .../src/tz/system/mod.rs | 0 .../src/tz/system/unix.rs | 0 .../src/tz/system/wasm_emscripten.rs | 0 .../src/tz/system/wasm_js.rs | 0 .../src/tz/system/windows/mod.rs | 0 .../src/tz/system/windows/windows_zones.rs | 0 .../src/tz/testdata.rs | 0 .../src/tz/timezone.rs | 22 + {jiff-0.2.23 => jiff-0.2.24}/src/tz/tzif.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/tz/zic.rs | 0 .../src/util/array_str.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/util/b.rs | 0 .../src/util/borrow.rs | 0 .../src/util/cache.rs | 0 .../src/util/constant.rs | 0 .../src/util/escape.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/util/fs.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/util/libm.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/util/mod.rs | 0 .../src/util/parse.rs | 0 .../src/util/round.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/util/sync.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/util/utf8.rs | 0 {jiff-0.2.23 => jiff-0.2.24}/src/zoned.rs | 8 + {jiff-0.2.23 => jiff-0.2.24}/tests/lib.rs | 0 .../.cargo-checksum.json | 2 +- .../.cargo_vcs_info.json | 2 +- .../COPYING | 0 .../Cargo.lock | 2 +- .../Cargo.toml | 2 +- .../Cargo.toml.orig | 2 +- .../LICENSE-MIT | 0 .../README.md | 0 .../UNLICENSE | 0 .../src/lib.rs | 0 .../src/shared/crc32/mod.rs | 0 .../src/shared/crc32/table.rs | 0 .../src/shared/error/itime.rs | 0 .../src/shared/error/mod.rs | 0 .../src/shared/mod.rs | 0 .../src/shared/posix.rs | 0 .../src/shared/tzif.rs | 0 .../src/shared/util/array_str.rs | 0 .../src/shared/util/error.rs | 0 .../src/shared/util/escape.rs | 0 .../src/shared/util/itime.rs | 0 .../src/shared/util/mod.rs | 0 .../src/shared/util/utf8.rs | 0 js-sys-0.3.95/.cargo-checksum.json | 1 - js-sys-0.3.95/.cargo_vcs_info.json | 6 - js-sys-0.3.98/.cargo-checksum.json | 1 + js-sys-0.3.98/.cargo_vcs_info.json | 6 + {js-sys-0.3.95 => js-sys-0.3.98}/Cargo.lock | 18 +- {js-sys-0.3.95 => js-sys-0.3.98}/Cargo.toml | 16 +- .../Cargo.toml.orig | 17 +- .../LICENSE-APACHE | 0 {js-sys-0.3.95 => js-sys-0.3.98}/LICENSE-MIT | 0 {js-sys-0.3.95 => js-sys-0.3.98}/README.md | 0 .../src/Temporal.rs | 0 .../src/futures/mod.rs | 36 +- .../src/futures/queue.rs | 0 .../src/futures/stream.rs | 4 +- .../src/futures/task/mod.rs | 0 .../src/futures/task/multithread.rs | 0 .../src/futures/task/singlethread.rs | 0 .../src/futures/task/wait_async_polyfill.rs | 0 .../src/futures/task/worker.js | 0 {js-sys-0.3.95 => js-sys-0.3.98}/src/lib.rs | 521 +- libc-0.2.185/.cargo_vcs_info.json | 6 - .../.cargo-checksum.json | 2 +- libc-0.2.186/.cargo_vcs_info.json | 6 + {libc-0.2.185 => libc-0.2.186}/.editorconfig | 0 .../.git-blame-ignore-revs | 0 .../.release-plz.toml | 0 {libc-0.2.185 => libc-0.2.186}/.rustfmt.toml | 0 {libc-0.2.185 => libc-0.2.186}/CHANGELOG.md | 11 + .../CONTRIBUTING.md | 0 {libc-0.2.185 => libc-0.2.186}/Cargo.lock | 2 +- {libc-0.2.185 => libc-0.2.186}/Cargo.toml | 3 +- .../Cargo.toml.orig | 4 +- {libc-0.2.185 => libc-0.2.186}/LICENSE-APACHE | 0 {libc-0.2.185 => libc-0.2.186}/LICENSE-MIT | 0 {libc-0.2.185 => libc-0.2.186}/README.md | 8 +- {libc-0.2.185 => libc-0.2.186}/build.rs | 0 .../src/fuchsia/aarch64.rs | 0 .../src/fuchsia/mod.rs | 0 .../src/fuchsia/riscv64.rs | 0 .../src/fuchsia/x86_64.rs | 0 {libc-0.2.185 => libc-0.2.186}/src/hermit.rs | 0 {libc-0.2.185 => libc-0.2.186}/src/lib.rs | 0 {libc-0.2.185 => libc-0.2.186}/src/macros.rs | 0 .../src/new/aix/mod.rs | 0 .../src/new/aix/unistd.rs | 0 .../src/new/apple/libc/signal.rs | 0 .../src/new/apple/libc/unistd.rs | 0 .../src/new/apple/libpthread/mod.rs | 0 .../libpthread/pthread_/introspection.rs | 0 .../new/apple/libpthread/pthread_/pthread.rs | 0 .../apple/libpthread/pthread_/pthread_impl.rs | 0 .../apple/libpthread/pthread_/pthread_spis.rs | 0 .../src/new/apple/libpthread/pthread_/qos.rs | 0 .../new/apple/libpthread/pthread_/sched.rs | 0 .../new/apple/libpthread/pthread_/spawn.rs | 0 .../new/apple/libpthread/pthread_/stack_np.rs | 0 .../libpthread/sys/_pthread/_pthread_types.rs | 0 .../src/new/apple/libpthread/sys/mod.rs | 0 .../src/new/apple/libpthread/sys/qos.rs | 0 .../src/new/apple/mod.rs | 0 .../src/new/apple/xnu/arm/_mcontext.rs | 0 .../src/new/apple/xnu/i386/_mcontext.rs | 0 .../src/new/apple/xnu/mach/arm/_structs.rs | 0 .../src/new/apple/xnu/mach/i386/_structs.rs | 0 .../new/apple/xnu/mach/machine/_structs.rs | 0 .../src/new/apple/xnu/mach/mod.rs | 0 .../src/new/apple/xnu/machine/_mcontext.rs | 0 .../src/new/apple/xnu/mod.rs | 0 .../src/new/apple/xnu/sys/_types/_ucontext.rs | 0 .../src/new/apple/xnu/sys/mod.rs | 0 .../src/new/apple/xnu/sys/signal.rs | 0 .../src/new/bionic_libc/mod.rs | 0 .../src/new/bionic_libc/pthread.rs | 0 .../src/new/bionic_libc/sys/mod.rs | 0 .../src/new/bionic_libc/sys/socket.rs | 0 .../src/new/bionic_libc/unistd.rs | 0 .../src/new/common/bsd.rs | 0 .../src/new/common/freebsd_like.rs | 0 .../src/new/common/linux_like/mod.rs | 0 .../src/new/common/linux_like/pthread.rs | 0 .../src/new/common/mod.rs | 0 .../src/new/common/netbsd_like.rs | 0 .../src/new/common/posix/mod.rs | 0 .../src/new/common/posix/pthread.rs | 0 .../src/new/common/posix/unistd.rs | 0 .../src/new/common/solarish.rs | 0 .../src/new/cygwin/mod.rs | 0 .../src/new/cygwin/unistd.rs | 0 .../src/new/dragonfly/mod.rs | 0 .../src/new/dragonfly/unistd.rs | 0 .../src/new/emscripten/mod.rs | 0 .../src/new/emscripten/pthread.rs | 0 .../src/new/emscripten/sched.rs | 0 .../src/new/emscripten/unistd.rs | 0 .../src/new/espidf/mod.rs | 0 .../src/new/freebsd/mod.rs | 0 .../src/new/freebsd/sys/file.rs | 0 .../src/new/freebsd/sys/mod.rs | 0 .../src/new/freebsd/unistd.rs | 0 .../src/new/fuchsia/mod.rs | 0 .../src/new/fuchsia/unistd.rs | 0 .../src/new/glibc/mod.rs | 0 .../src/new/glibc/posix/unistd.rs | 0 .../src/new/glibc/sysdeps/nptl/mod.rs | 0 .../src/new/glibc/sysdeps/nptl/pthread.rs | 0 .../src/new/glibc/sysdeps/unix/linux/mod.rs | 0 .../new/glibc/sysdeps/unix/linux/net/route.rs | 0 .../src/new/glibc/sysdeps/unix/mod.rs | 0 .../src/new/haiku/mod.rs | 0 .../src/new/haiku/unistd.rs | 0 .../src/new/hermit_abi/mod.rs | 0 .../src/new/horizon/mod.rs | 0 .../src/new/hurd/mod.rs | 0 .../src/new/illumos/mod.rs | 0 .../src/new/illumos/unistd.rs | 0 .../src/new/l4re/mod.rs | 0 .../src/new/linux_uapi/linux/can.rs | 0 .../src/new/linux_uapi/linux/can/bcm.rs | 0 .../src/new/linux_uapi/linux/can/error.rs | 0 .../src/new/linux_uapi/linux/can/j1939.rs | 0 .../src/new/linux_uapi/linux/can/netlink.rs | 0 .../src/new/linux_uapi/linux/can/raw.rs | 0 .../src/new/linux_uapi/linux/keyctl.rs | 0 .../src/new/linux_uapi/linux/membarrier.rs | 0 .../src/new/linux_uapi/linux/mod.rs | 0 .../src/new/linux_uapi/linux/netlink.rs | 0 .../src/new/linux_uapi/linux/pidfd.rs | 0 .../src/new/linux_uapi/mod.rs | 0 {libc-0.2.185 => libc-0.2.186}/src/new/mod.rs | 0 .../src/new/musl/arch/generic/mod.rs | 0 .../src/new/musl/arch/mips/bits/socket.rs | 0 .../src/new/musl/arch/mips/mod.rs | 0 .../src/new/musl/arch/mips64/bits/socket.rs | 0 .../src/new/musl/arch/mips64/mod.rs | 0 .../src/new/musl/arch/mod.rs | 0 .../src/new/musl/mod.rs | 0 .../src/new/musl/pthread.rs | 0 .../src/new/musl/sched.rs | 0 .../src/new/musl/sys/socket.rs | 0 .../src/new/musl/unistd.rs | 0 .../src/new/netbsd/mod.rs | 0 .../src/new/netbsd/net/if_.rs | 0 .../src/new/netbsd/sys/file.rs | 0 .../src/new/netbsd/sys/ipc.rs | 0 .../src/new/netbsd/sys/mod.rs | 0 .../src/new/netbsd/sys/socket.rs | 0 .../src/new/netbsd/sys/statvfs.rs | 0 .../src/new/netbsd/sys/time.rs | 0 .../src/new/netbsd/sys/timex.rs | 0 .../src/new/netbsd/sys/types.rs | 0 .../src/new/netbsd/unistd.rs | 0 .../src/new/netbsd/utmp_.rs | 0 .../src/new/netbsd/utmpx_.rs | 0 .../src/new/newlib/mod.rs | 0 .../src/new/newlib/unistd.rs | 0 .../src/new/nto/mod.rs | 0 .../src/new/nto/net/bpf.rs | 0 .../src/new/nto/net/if_.rs | 0 .../src/new/nto/unistd.rs | 0 .../src/new/nuttx/mod.rs | 0 .../src/new/nuttx/unistd.rs | 0 .../src/new/openbsd/mod.rs | 0 .../src/new/openbsd/sys/ipc.rs | 0 .../src/new/openbsd/sys/mod.rs | 0 .../src/new/openbsd/unistd.rs | 0 .../src/new/qurt/dlfcn.rs | 0 .../src/new/qurt/errno.rs | 0 .../src/new/qurt/fcntl.rs | 0 .../src/new/qurt/limits.rs | 0 .../src/new/qurt/mod.rs | 0 .../src/new/qurt/pthread.rs | 0 .../src/new/qurt/semaphore.rs | 0 .../src/new/qurt/signal.rs | 0 .../src/new/qurt/stdio.rs | 0 .../src/new/qurt/stdlib.rs | 0 .../src/new/qurt/sys/mman.rs | 0 .../src/new/qurt/sys/mod.rs | 0 .../src/new/qurt/sys/sched.rs | 0 .../src/new/qurt/sys/stat.rs | 0 .../src/new/qurt/sys/types.rs | 0 .../src/new/qurt/time.rs | 0 .../src/new/qurt/unistd.rs | 0 .../src/new/redox/mod.rs | 0 .../src/new/relibc/mod.rs | 0 .../src/new/relibc/unistd.rs | 0 .../src/new/rtems/mod.rs | 0 .../src/new/sgx/mod.rs | 0 .../src/new/sgx/unistd.rs | 0 .../src/new/solaris/mod.rs | 0 .../src/new/solaris/unistd.rs | 0 .../src/new/solid/mod.rs | 0 .../src/new/teeos/mod.rs | 0 .../src/new/trusty/mod.rs | 0 .../src/new/uclibc/mod.rs | 0 .../src/new/uclibc/pthread.rs | 0 .../src/new/uclibc/unistd.rs | 0 .../src/new/ucrt/mod.rs | 0 .../src/new/vita/mod.rs | 0 .../src/new/vxworks/mod.rs | 0 .../src/new/vxworks/unistd.rs | 0 .../src/new/wasi/mod.rs | 0 .../src/new/xous/mod.rs | 0 .../src/primitives.rs | 0 {libc-0.2.185 => libc-0.2.186}/src/psp.rs | 0 .../src/qurt/mod.rs | 0 {libc-0.2.185 => libc-0.2.186}/src/sgx.rs | 0 .../src/solid/aarch64.rs | 0 .../src/solid/arm.rs | 0 .../src/solid/mod.rs | 0 {libc-0.2.185 => libc-0.2.186}/src/switch.rs | 0 .../src/teeos/mod.rs | 0 {libc-0.2.185 => libc-0.2.186}/src/trusty.rs | 0 {libc-0.2.185 => libc-0.2.186}/src/types.rs | 0 .../src/unix/aix/mod.rs | 0 .../src/unix/aix/powerpc64.rs | 0 .../src/unix/bsd/apple/b32/mod.rs | 0 .../src/unix/bsd/apple/b64/aarch64/mod.rs | 0 .../src/unix/bsd/apple/b64/mod.rs | 0 .../src/unix/bsd/apple/b64/x86_64/mod.rs | 0 .../src/unix/bsd/apple/mod.rs | 4 + .../src/unix/bsd/freebsdlike/dragonfly/mod.rs | 0 .../unix/bsd/freebsdlike/freebsd/aarch64.rs | 0 .../src/unix/bsd/freebsdlike/freebsd/arm.rs | 0 .../bsd/freebsdlike/freebsd/freebsd11/b32.rs | 0 .../bsd/freebsdlike/freebsd/freebsd11/b64.rs | 0 .../bsd/freebsdlike/freebsd/freebsd11/mod.rs | 0 .../bsd/freebsdlike/freebsd/freebsd12/mod.rs | 0 .../freebsdlike/freebsd/freebsd12/x86_64.rs | 0 .../bsd/freebsdlike/freebsd/freebsd13/mod.rs | 0 .../freebsdlike/freebsd/freebsd13/x86_64.rs | 0 .../bsd/freebsdlike/freebsd/freebsd14/mod.rs | 0 .../freebsdlike/freebsd/freebsd14/x86_64.rs | 0 .../bsd/freebsdlike/freebsd/freebsd15/mod.rs | 0 .../freebsdlike/freebsd/freebsd15/x86_64.rs | 0 .../src/unix/bsd/freebsdlike/freebsd/mod.rs | 0 .../unix/bsd/freebsdlike/freebsd/powerpc.rs | 0 .../unix/bsd/freebsdlike/freebsd/powerpc64.rs | 0 .../unix/bsd/freebsdlike/freebsd/riscv64.rs | 0 .../src/unix/bsd/freebsdlike/freebsd/x86.rs | 0 .../bsd/freebsdlike/freebsd/x86_64/mod.rs | 0 .../src/unix/bsd/freebsdlike/mod.rs | 0 .../src/unix/bsd/mod.rs | 0 .../src/unix/bsd/netbsdlike/mod.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/aarch64.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/arm.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/mips.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/mod.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/powerpc.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/riscv64.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/sparc64.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/x86.rs | 0 .../src/unix/bsd/netbsdlike/netbsd/x86_64.rs | 0 .../unix/bsd/netbsdlike/openbsd/aarch64.rs | 0 .../src/unix/bsd/netbsdlike/openbsd/arm.rs | 0 .../src/unix/bsd/netbsdlike/openbsd/mips64.rs | 0 .../src/unix/bsd/netbsdlike/openbsd/mod.rs | 0 .../unix/bsd/netbsdlike/openbsd/powerpc.rs | 0 .../unix/bsd/netbsdlike/openbsd/powerpc64.rs | 0 .../unix/bsd/netbsdlike/openbsd/riscv64.rs | 0 .../unix/bsd/netbsdlike/openbsd/sparc64.rs | 0 .../src/unix/bsd/netbsdlike/openbsd/x86.rs | 0 .../src/unix/bsd/netbsdlike/openbsd/x86_64.rs | 0 .../src/unix/cygwin/mod.rs | 0 .../src/unix/haiku/b32.rs | 0 .../src/unix/haiku/b64.rs | 0 .../src/unix/haiku/bsd.rs | 0 .../src/unix/haiku/mod.rs | 0 .../src/unix/haiku/native.rs | 0 .../src/unix/haiku/x86_64.rs | 0 .../src/unix/hurd/b32.rs | 0 .../src/unix/hurd/b64.rs | 0 .../src/unix/hurd/mod.rs | 0 .../src/unix/linux_like/android/b32/arm.rs | 0 .../src/unix/linux_like/android/b32/mod.rs | 0 .../unix/linux_like/android/b32/x86/mod.rs | 0 .../linux_like/android/b64/aarch64/mod.rs | 0 .../src/unix/linux_like/android/b64/mod.rs | 0 .../linux_like/android/b64/riscv64/mod.rs | 0 .../unix/linux_like/android/b64/x86_64/mod.rs | 0 .../src/unix/linux_like/android/mod.rs | 0 .../src/unix/linux_like/emscripten/lfs64.rs | 0 .../src/unix/linux_like/emscripten/mod.rs | 0 .../src/unix/linux_like/l4re/mod.rs | 0 .../linux_like/l4re/uclibc/aarch64/mod.rs | 0 .../src/unix/linux_like/l4re/uclibc/mod.rs | 0 .../unix/linux_like/l4re/uclibc/x86_64/mod.rs | 0 .../unix/linux_like/linux/arch/generic/mod.rs | 0 .../unix/linux_like/linux/arch/mips/mod.rs | 0 .../src/unix/linux_like/linux/arch/mod.rs | 0 .../unix/linux_like/linux/arch/powerpc/mod.rs | 0 .../unix/linux_like/linux/arch/sparc/mod.rs | 0 .../unix/linux_like/linux/gnu/b32/arm/mod.rs | 0 .../unix/linux_like/linux/gnu/b32/csky/mod.rs | 0 .../unix/linux_like/linux/gnu/b32/m68k/mod.rs | 0 .../unix/linux_like/linux/gnu/b32/mips/mod.rs | 0 .../src/unix/linux_like/linux/gnu/b32/mod.rs | 0 .../unix/linux_like/linux/gnu/b32/powerpc.rs | 0 .../linux_like/linux/gnu/b32/riscv32/mod.rs | 0 .../linux_like/linux/gnu/b32/sparc/mod.rs | 0 .../unix/linux_like/linux/gnu/b32/x86/mod.rs | 0 .../linux_like/linux/gnu/b64/aarch64/ilp32.rs | 0 .../linux_like/linux/gnu/b64/aarch64/lp64.rs | 0 .../linux_like/linux/gnu/b64/aarch64/mod.rs | 0 .../linux/gnu/b64/loongarch64/mod.rs | 0 .../linux_like/linux/gnu/b64/mips64/mod.rs | 0 .../src/unix/linux_like/linux/gnu/b64/mod.rs | 0 .../linux_like/linux/gnu/b64/powerpc64/mod.rs | 0 .../linux_like/linux/gnu/b64/riscv64/mod.rs | 0 .../unix/linux_like/linux/gnu/b64/s390x.rs | 0 .../linux_like/linux/gnu/b64/sparc64/mod.rs | 0 .../linux_like/linux/gnu/b64/x86_64/mod.rs | 0 .../linux/gnu/b64/x86_64/not_x32.rs | 0 .../linux_like/linux/gnu/b64/x86_64/x32.rs | 0 .../src/unix/linux_like/linux/gnu/mod.rs | 0 .../src/unix/linux_like/linux/mod.rs | 2 + .../unix/linux_like/linux/musl/b32/arm/mod.rs | 0 .../unix/linux_like/linux/musl/b32/hexagon.rs | 0 .../linux_like/linux/musl/b32/mips/mod.rs | 0 .../src/unix/linux_like/linux/musl/b32/mod.rs | 0 .../unix/linux_like/linux/musl/b32/powerpc.rs | 0 .../linux_like/linux/musl/b32/riscv32/mod.rs | 0 .../unix/linux_like/linux/musl/b32/x86/mod.rs | 0 .../linux_like/linux/musl/b64/aarch64/mod.rs | 0 .../linux/musl/b64/loongarch64/mod.rs | 0 .../unix/linux_like/linux/musl/b64/mips64.rs | 0 .../src/unix/linux_like/linux/musl/b64/mod.rs | 0 .../linux_like/linux/musl/b64/powerpc64.rs | 0 .../linux_like/linux/musl/b64/riscv64/mod.rs | 0 .../unix/linux_like/linux/musl/b64/s390x.rs | 0 .../linux_like/linux/musl/b64/wasm32/mod.rs | 0 .../linux_like/linux/musl/b64/wasm32/wali.rs | 0 .../linux_like/linux/musl/b64/x86_64/mod.rs | 0 .../src/unix/linux_like/linux/musl/lfs64.rs | 0 .../src/unix/linux_like/linux/musl/mod.rs | 0 .../unix/linux_like/linux/uclibc/arm/mod.rs | 0 .../linux/uclibc/mips/mips32/mod.rs | 0 .../linux/uclibc/mips/mips64/mod.rs | 0 .../unix/linux_like/linux/uclibc/mips/mod.rs | 0 .../src/unix/linux_like/linux/uclibc/mod.rs | 0 .../linux_like/linux/uclibc/x86_64/mod.rs | 0 .../src/unix/linux_like/linux_l4re_shared.rs | 0 .../src/unix/linux_like/mod.rs | 0 .../src/unix/mod.rs | 0 .../src/unix/newlib/aarch64/mod.rs | 0 .../src/unix/newlib/arm/mod.rs | 0 .../src/unix/newlib/espidf/mod.rs | 0 .../src/unix/newlib/generic.rs | 0 .../src/unix/newlib/horizon/mod.rs | 0 .../src/unix/newlib/mod.rs | 0 .../src/unix/newlib/powerpc/mod.rs | 0 .../src/unix/newlib/rtems/mod.rs | 0 .../src/unix/newlib/vita/mod.rs | 0 .../src/unix/nto/aarch64.rs | 0 .../src/unix/nto/mod.rs | 0 .../src/unix/nto/neutrino.rs | 0 .../src/unix/nto/x86_64.rs | 0 .../src/unix/nuttx/mod.rs | 0 .../src/unix/redox/mod.rs | 0 .../src/unix/solarish/compat.rs | 0 .../src/unix/solarish/illumos.rs | 0 .../src/unix/solarish/mod.rs | 0 .../src/unix/solarish/solaris.rs | 0 .../src/unix/solarish/x86.rs | 0 .../src/unix/solarish/x86_64.rs | 0 .../src/unix/solarish/x86_common.rs | 0 .../src/vxworks/aarch64.rs | 0 .../src/vxworks/arm.rs | 0 .../src/vxworks/mod.rs | 0 .../src/vxworks/powerpc.rs | 0 .../src/vxworks/powerpc64.rs | 0 .../src/vxworks/riscv32.rs | 0 .../src/vxworks/riscv64.rs | 0 .../src/vxworks/x86.rs | 0 .../src/vxworks/x86_64.rs | 0 .../src/wasi/mod.rs | 0 {libc-0.2.185 => libc-0.2.186}/src/wasi/p2.rs | 0 .../src/windows/gnu/mod.rs | 0 .../src/windows/mod.rs | 0 .../src/windows/msvc/mod.rs | 0 {libc-0.2.185 => libc-0.2.186}/src/xous.rs | 0 .../tests/const_fn.rs | 0 nibble_vec-0.1.0/.cargo-checksum.json | 1 + nibble_vec-0.1.0/.cargo_vcs_info.json | 5 + nibble_vec-0.1.0/.travis.yml | 9 + nibble_vec-0.1.0/CHANGELOG.md | 15 + nibble_vec-0.1.0/Cargo.lock | 601 + nibble_vec-0.1.0/Cargo.toml | 40 + nibble_vec-0.1.0/Cargo.toml.orig | 33 + nibble_vec-0.1.0/LICENSE | 21 + nibble_vec-0.1.0/README.md | 42 + nibble_vec-0.1.0/benches/nib_bench.rs | 99 + nibble_vec-0.1.0/examples/debug.rs | 9 + nibble_vec-0.1.0/src/lib.rs | 334 + nibble_vec-0.1.0/src/test.rs | 144 + num-conv-0.2.2/.cargo-checksum.json | 1 + num-conv-0.2.2/.cargo_vcs_info.json | 6 + num-conv-0.2.2/Cargo.lock | 7 + num-conv-0.2.2/Cargo.toml | 65 + num-conv-0.2.2/Cargo.toml.orig | 31 + num-conv-0.2.2/LICENSE-Apache | 177 + num-conv-0.2.2/LICENSE-MIT | 19 + num-conv-0.2.2/README.md | 6 + num-conv-0.2.2/src/lib.rs | 354 + prqlc-0.13.11/.cargo_vcs_info.json | 6 - .../.cargo-checksum.json | 2 +- prqlc-0.13.12/.cargo_vcs_info.json | 6 + .../ARCHITECTURE.md | 0 {prqlc-0.13.11 => prqlc-0.13.12}/Cargo.lock | 255 +- {prqlc-0.13.11 => prqlc-0.13.12}/Cargo.toml | 24 +- .../Cargo.toml.orig | 18 +- {prqlc-0.13.11 => prqlc-0.13.12}/README.md | 2 +- .../benches/bench.rs | 0 .../benches/bench_impl.rs | 0 {prqlc-0.13.11 => prqlc-0.13.12}/build.rs | 0 .../src/cli/docs_generator.rs | 8 +- .../src/cli/highlight.rs | 0 .../src/cli/jinja.rs | 0 .../src/cli/lsp.rs | 0 .../src/cli/mod.rs | 0 .../prqlc__cli__test__shell_completion-2.snap | 0 .../prqlc__cli__test__shell_completion-3.snap | 0 .../prqlc__cli__test__shell_completion-4.snap | 0 .../prqlc__cli__test__shell_completion.snap | 0 .../src/cli/test.rs | 39 +- .../src/cli/watch.rs | 0 .../src/codegen/ast.rs | 5 +- .../src/codegen/mod.rs | 2 +- .../src/codegen/types.rs | 0 .../src/debug/log.rs | 0 .../src/debug/messages.rs | 0 .../src/debug/mod.rs | 0 .../src/debug/render_html.rs | 0 .../src/error_message.rs | 0 .../src/ir/decl.rs | 0 .../src/ir/generic.rs | 0 .../src/ir/mod.rs | 0 .../src/ir/pl/expr.rs | 0 .../src/ir/pl/extra.rs | 0 .../src/ir/pl/fold.rs | 0 .../src/ir/pl/lineage.rs | 0 .../src/ir/pl/mod.rs | 0 .../src/ir/pl/stmt.rs | 0 .../src/ir/pl/utils.rs | 0 .../src/ir/rq/expr.rs | 0 .../src/ir/rq/fold.rs | 0 .../src/ir/rq/ids.rs | 0 .../src/ir/rq/mod.rs | 0 .../src/ir/rq/transform.rs | 0 .../src/ir/rq/utils.rs | 0 {prqlc-0.13.11 => prqlc-0.13.12}/src/lib.rs | 0 {prqlc-0.13.11 => prqlc-0.13.12}/src/main.rs | 0 .../src/parser.rs | 0 .../src/semantic/ast_expand.rs | 0 .../src/semantic/lowering.rs | 0 .../src/semantic/mod.rs | 0 .../src/semantic/module.rs | 0 .../src/semantic/reporting.rs | 0 .../src/semantic/resolver/expr.rs | 0 .../src/semantic/resolver/flatten.rs | 0 .../src/semantic/resolver/functions.rs | 0 .../src/semantic/resolver/inference.rs | 0 .../src/semantic/resolver/mod.rs | 0 .../src/semantic/resolver/names.rs | 0 ...__test__append_union_different_tables.snap | 8 +- ...c__resolver__test__frames_and_names-2.snap | 8 +- ...c__resolver__test__frames_and_names-3.snap | 10 +- ...tic__resolver__test__frames_and_names.snap | 10 +- ...semantic__resolver__test__functions_1.snap | 0 ...tic__resolver__test__functions_nested.snap | 0 ..._resolver__test__functions_pipeline-2.snap | 0 ...c__resolver__test__functions_pipeline.snap | 0 ..._semantic__resolver__test__named_args.snap | 0 ...semantic__resolver__test__variables_1.snap | 0 ...ms__tests__aggregate_positional_arg-2.snap | 10 +- .../src/semantic/resolver/static_eval.rs | 0 .../src/semantic/resolver/stmt.rs | 0 .../src/semantic/resolver/transforms.rs | 0 .../src/semantic/resolver/types.rs | 0 .../src/semantic/std.prql | 8 +- .../src/sql/dialect.rs | 20 +- .../src/sql/gen_expr.rs | 87 + .../src/sql/gen_projection.rs | 2 +- .../src/sql/gen_query.rs | 0 .../src/sql/keywords.rs | 0 .../src/sql/mod.rs | 0 .../src/sql/operators.rs | 0 .../src/sql/pq/anchor.rs | 0 .../src/sql/pq/ast.rs | 0 .../src/sql/pq/context.rs | 0 .../src/sql/pq/gen_query.rs | 0 .../src/sql/pq/mod.rs | 0 .../src/sql/pq/positional_mapping.rs | 2 +- .../src/sql/pq/postprocess.rs | 0 .../src/sql/pq/preprocess.rs | 0 .../src/sql/std.sql.prql | 51 +- .../src/utils/id_gen.rs | 0 .../src/utils/mod.rs | 0 .../src/utils/toposort.rs | 0 .../tests/CLAUDE.md | 0 .../tests/integration/bad_error_messages.rs | 16 +- .../tests/integration/data/chinook/albums.csv | 0 .../integration/data/chinook/artists.csv | 0 .../integration/data/chinook/customers.csv | 0 .../integration/data/chinook/employees.csv | 0 .../tests/integration/data/chinook/genres.csv | 0 .../data/chinook/invoice_items.csv | 0 .../integration/data/chinook/invoices.csv | 0 .../integration/data/chinook/media_types.csv | 0 .../integration/data/chinook/media_types.json | 0 .../data/chinook/playlist_track.csv | 0 .../integration/data/chinook/playlists.csv | 0 .../tests/integration/data/chinook/schema.sql | 0 .../tests/integration/data/chinook/tracks.csv | 0 .../tests/integration/dbs/README.md | 0 .../tests/integration/dbs/docker-compose.yaml | 0 .../dbs/dockerfiles/glaredb.Dockerfile | 0 .../tests/integration/dbs/mod.rs | 0 .../tests/integration/dbs/protocol.rs | 0 .../tests/integration/dbs/runner.rs | 0 .../tests/integration/error_messages.rs | 75 +- .../tests/integration/main.rs | 0 .../tests/integration/project/Project.prql | 0 .../tests/integration/project/artists.prql | 0 .../tests/integration/queries.rs | 17 +- .../integration/queries/aggregation.prql | 0 .../integration/queries/append_select.prql | 0 .../queries/append_select_compute.prql | 0 .../append_select_multiple_with_null.prql | 0 .../queries/append_select_nulls.prql | 0 .../queries/append_select_simple.prql | 0 .../tests/integration/queries/arithmetic.prql | 0 .../tests/integration/queries/cast.prql | 0 .../integration/queries/constants_only.prql | 0 .../integration/queries/date_to_text.prql | 0 .../tests/integration/queries/distinct.prql | 0 .../integration/queries/distinct_on.prql | 0 .../integration/queries/genre_counts.prql | 0 .../tests/integration/queries/group_all.prql | 0 .../tests/integration/queries/group_sort.prql | 0 .../group_sort_derive_select_join.prql | 0 .../group_sort_filter_derive_select_join.prql | 0 .../queries/group_sort_limit_take.prql | 0 .../integration/queries/invoice_totals.prql | 0 .../tests/integration/queries/loop_01.prql | 0 .../integration/queries/math_module.prql | 0 .../tests/integration/queries/pipelines.prql | 0 .../tests/integration/queries/read_csv.prql | 0 .../integration/queries/set_ops_remove.prql | 0 .../tests/integration/queries/sort.prql | 0 .../tests/integration/queries/sort_2.prql | 0 .../tests/integration/queries/sort_3.prql | 0 .../tests/integration/queries/switch.prql | 0 .../tests/integration/queries/take.prql | 0 .../integration/queries/text_module.prql | 0 .../tests/integration/queries/window.prql | 0 ...ration__queries__compile__aggregation.snap | 0 ...tion__queries__compile__append_select.snap | 1 - ...eries__compile__append_select_compute.snap | 1 - ...ile__append_select_multiple_with_null.snap | 1 - ...queries__compile__append_select_nulls.snap | 2 +- ...ueries__compile__append_select_simple.snap | 0 ...gration__queries__compile__arithmetic.snap | 0 .../integration__queries__compile__cast.snap | 0 ...ion__queries__compile__constants_only.snap | 0 ...tegration__queries__compile__distinct.snap | 0 ...ration__queries__compile__distinct_on.snap | 0 ...ation__queries__compile__genre_counts.snap | 0 ...egration__queries__compile__group_all.snap | 0 ...gration__queries__compile__group_sort.snap | 0 ...ompile__group_sort_derive_select_join.snap | 0 ..._group_sort_filter_derive_select_join.snap | 0 ...eries__compile__group_sort_limit_take.snap | 0 ...ion__queries__compile__invoice_totals.snap | 0 ...ntegration__queries__compile__loop_01.snap | 0 ...ration__queries__compile__math_module.snap | 0 ...egration__queries__compile__pipelines.snap | 0 ...tegration__queries__compile__read_csv.snap | 0 ...ion__queries__compile__set_ops_remove.snap | 0 .../integration__queries__compile__sort.snap | 0 ...integration__queries__compile__sort_2.snap | 0 ...integration__queries__compile__sort_3.snap | 0 ...integration__queries__compile__switch.snap | 0 .../integration__queries__compile__take.snap | 0 ...ration__queries__compile__text_module.snap | 0 ...integration__queries__compile__window.snap | 0 ...ion__queries__compileall__aggregation.snap | 0 ...n__queries__compileall__append_select.snap | 1 - ...es__compileall__append_select_compute.snap | 2 - ...all__append_select_multiple_with_null.snap | 1 - ...ries__compileall__append_select_nulls.snap | 0 ...ies__compileall__append_select_simple.snap | 0 ...tion__queries__compileall__arithmetic.snap | 18 +- ...ntegration__queries__compileall__cast.snap | 0 ...__queries__compileall__constants_only.snap | 0 ...ration__queries__compileall__distinct.snap | 0 ...ion__queries__compileall__distinct_on.snap | 4 - ...on__queries__compileall__genre_counts.snap | 0 ...ation__queries__compileall__group_all.snap | 1 - ...tion__queries__compileall__group_sort.snap | 0 ...ileall__group_sort_derive_select_join.snap | 0 ..._group_sort_filter_derive_select_join.snap | 0 ...es__compileall__group_sort_limit_take.snap | 0 ...__queries__compileall__invoice_totals.snap | 0 ...gration__queries__compileall__loop_01.snap | 0 ...ion__queries__compileall__math_module.snap | 1 - ...ation__queries__compileall__pipelines.snap | 2 - ...ration__queries__compileall__read_csv.snap | 1 - ...__queries__compileall__set_ops_remove.snap | 4 - ...ntegration__queries__compileall__sort.snap | 0 ...egration__queries__compileall__sort_2.snap | 3 - ...egration__queries__compileall__sort_3.snap | 3 - ...egration__queries__compileall__switch.snap | 0 ...ntegration__queries__compileall__take.snap | 0 ...ion__queries__compileall__text_module.snap | 1 - ...egration__queries__compileall__window.snap | 0 ...__queries__debug_lineage__aggregation.snap | 130 +- ...queries__debug_lineage__append_select.snap | 192 +- ..._debug_lineage__append_select_compute.snap | 334 +- ...age__append_select_multiple_with_null.snap | 270 +- ...s__debug_lineage__append_select_nulls.snap | 122 +- ...__debug_lineage__append_select_simple.snap | 128 +- ...n__queries__debug_lineage__arithmetic.snap | 674 +- ...gration__queries__debug_lineage__cast.snap | 84 +- ...ueries__debug_lineage__constants_only.snap | 82 +- ..._queries__debug_lineage__date_to_text.snap | 248 +- ...ion__queries__debug_lineage__distinct.snap | 100 +- ...__queries__debug_lineage__distinct_on.snap | 116 +- ..._queries__debug_lineage__genre_counts.snap | 54 +- ...on__queries__debug_lineage__group_all.snap | 142 +- ...n__queries__debug_lineage__group_sort.snap | 152 +- ...ineage__group_sort_derive_select_join.snap | 214 +- ..._group_sort_filter_derive_select_join.snap | 248 +- ..._debug_lineage__group_sort_limit_take.snap | 174 +- ...ueries__debug_lineage__invoice_totals.snap | 438 +- ...tion__queries__debug_lineage__loop_01.snap | 200 +- ...__queries__debug_lineage__math_module.snap | 360 +- ...on__queries__debug_lineage__pipelines.snap | 150 +- ...ion__queries__debug_lineage__read_csv.snap | 66 +- ...ueries__debug_lineage__set_ops_remove.snap | 160 +- ...gration__queries__debug_lineage__sort.snap | 132 +- ...ation__queries__debug_lineage__sort_2.snap | 124 +- ...ation__queries__debug_lineage__sort_3.snap | 456 +- ...ation__queries__debug_lineage__switch.snap | 100 +- ...gration__queries__debug_lineage__take.snap | 38 +- ...__queries__debug_lineage__text_module.snap | 278 +- ...ation__queries__debug_lineage__window.snap | 218 +- ...ntegration__queries__fmt__aggregation.snap | 0 ...egration__queries__fmt__append_select.snap | 0 ...__queries__fmt__append_select_compute.snap | 0 ...fmt__append_select_multiple_with_null.snap | 0 ...on__queries__fmt__append_select_nulls.snap | 2 +- ...n__queries__fmt__append_select_simple.snap | 0 ...integration__queries__fmt__arithmetic.snap | 0 .../integration__queries__fmt__cast.snap | 0 ...gration__queries__fmt__constants_only.snap | 0 ...tegration__queries__fmt__date_to_text.snap | 0 .../integration__queries__fmt__distinct.snap | 0 ...ntegration__queries__fmt__distinct_on.snap | 0 ...tegration__queries__fmt__genre_counts.snap | 0 .../integration__queries__fmt__group_all.snap | 0 ...integration__queries__fmt__group_sort.snap | 0 ...s__fmt__group_sort_derive_select_join.snap | 0 ..._group_sort_filter_derive_select_join.snap | 0 ...__queries__fmt__group_sort_limit_take.snap | 0 ...gration__queries__fmt__invoice_totals.snap | 0 .../integration__queries__fmt__loop_01.snap | 0 ...ntegration__queries__fmt__math_module.snap | 0 .../integration__queries__fmt__pipelines.snap | 0 .../integration__queries__fmt__read_csv.snap | 0 ...gration__queries__fmt__set_ops_remove.snap | 0 .../integration__queries__fmt__sort.snap | 0 .../integration__queries__fmt__sort_2.snap | 0 .../integration__queries__fmt__sort_3.snap | 0 .../integration__queries__fmt__switch.snap | 0 .../integration__queries__fmt__take.snap | 0 ...ntegration__queries__fmt__text_module.snap | 0 .../integration__queries__fmt__window.snap | 0 ...ntegration__queries__lex__aggregation.snap | 0 ...egration__queries__lex__append_select.snap | 0 ...__queries__lex__append_select_compute.snap | 0 ...lex__append_select_multiple_with_null.snap | 0 ...on__queries__lex__append_select_nulls.snap | 0 ...n__queries__lex__append_select_simple.snap | 0 ...integration__queries__lex__arithmetic.snap | 0 .../integration__queries__lex__cast.snap | 0 ...gration__queries__lex__constants_only.snap | 0 ...tegration__queries__lex__date_to_text.snap | 0 .../integration__queries__lex__distinct.snap | 0 ...ntegration__queries__lex__distinct_on.snap | 0 ...tegration__queries__lex__genre_counts.snap | 0 .../integration__queries__lex__group_all.snap | 0 ...integration__queries__lex__group_sort.snap | 0 ...s__lex__group_sort_derive_select_join.snap | 0 ..._group_sort_filter_derive_select_join.snap | 0 ...__queries__lex__group_sort_limit_take.snap | 0 ...gration__queries__lex__invoice_totals.snap | 0 .../integration__queries__lex__loop_01.snap | 0 ...ntegration__queries__lex__math_module.snap | 0 .../integration__queries__lex__pipelines.snap | 0 .../integration__queries__lex__read_csv.snap | 0 ...gration__queries__lex__set_ops_remove.snap | 0 .../integration__queries__lex__sort.snap | 0 .../integration__queries__lex__sort_2.snap | 0 .../integration__queries__lex__sort_3.snap | 0 .../integration__queries__lex__switch.snap | 0 .../integration__queries__lex__take.snap | 0 ...ntegration__queries__lex__text_module.snap | 0 .../integration__queries__lex__window.snap | 0 ...ration__queries__results__aggregation.snap | 0 ...tion__queries__results__append_select.snap | 0 ...eries__results__append_select_compute.snap | 0 ...lts__append_select_multiple_with_null.snap | 0 ...queries__results__append_select_nulls.snap | 0 ...ueries__results__append_select_simple.snap | 0 ...gration__queries__results__arithmetic.snap | 0 .../integration__queries__results__cast.snap | 0 ...ion__queries__results__constants_only.snap | 0 ...ation__queries__results__date_to_text.snap | 0 ...tegration__queries__results__distinct.snap | 0 ...ration__queries__results__distinct_on.snap | 0 ...ation__queries__results__genre_counts.snap | 0 ...egration__queries__results__group_all.snap | 0 ...gration__queries__results__group_sort.snap | 0 ...esults__group_sort_derive_select_join.snap | 0 ..._group_sort_filter_derive_select_join.snap | 0 ...eries__results__group_sort_limit_take.snap | 0 ...ion__queries__results__invoice_totals.snap | 0 ...ntegration__queries__results__loop_01.snap | 0 ...ration__queries__results__math_module.snap | 0 ...egration__queries__results__pipelines.snap | 0 ...tegration__queries__results__read_csv.snap | 0 ...ion__queries__results__set_ops_remove.snap | 0 .../integration__queries__results__sort.snap | 0 ...integration__queries__results__sort_2.snap | 0 ...integration__queries__results__sort_3.snap | 0 ...integration__queries__results__switch.snap | 0 .../integration__queries__results__take.snap | 0 ...ration__queries__results__text_module.snap | 0 ...integration__queries__results__window.snap | 0 .../tests/integration/sql.rs | 644 +- .../.cargo-checksum.json | 2 +- .../.cargo_vcs_info.json | 2 +- .../Cargo.lock | 106 +- .../Cargo.toml | 6 +- .../Cargo.toml.orig | 0 .../src/error.rs | 0 .../src/generic.rs | 0 .../src/lexer/lr.rs | 0 .../src/lexer/mod.rs | 0 .../src/lexer/test.rs | 0 .../src/lib.rs | 0 .../src/parser/expr.rs | 0 .../src/parser/interpolation.rs | 0 .../src/parser/mod.rs | 0 .../src/parser/perror.rs | 0 .../src/parser/pr/expr.rs | 0 .../src/parser/pr/ident.rs | 0 .../src/parser/pr/mod.rs | 0 .../src/parser/pr/ops.rs | 0 .../src/parser/pr/stmt.rs | 0 .../src/parser/pr/types.rs | 0 .../src/parser/stmt.rs | 0 .../src/parser/test.rs | 0 .../src/parser/types.rs | 0 ...qlc_parser__test__pipeline_parse_tree.snap | 0 .../src/span.rs | 0 .../src/test.rs | 0 pulldown-cmark-0.13.3/.cargo_vcs_info.json | 6 - .../.cargo-checksum.json | 2 +- pulldown-cmark-0.13.4/.cargo_vcs_info.json | 6 + .../Cargo.lock | 6 +- .../Cargo.toml | 2 +- .../Cargo.toml.orig | 2 +- .../LICENSE | 0 .../README.md | 0 .../build.rs | 0 .../examples/broken-link-callbacks.rs | 0 .../examples/event-filter.rs | 0 .../examples/events.rs | 0 .../examples/footnote-rewrite.rs | 0 .../examples/normalize-wikilink.rs | 0 .../examples/parser-map-event-print.rs | 0 .../examples/parser-map-tag-print.rs | 0 .../examples/string-to-string.rs | 0 .../src/entities.rs | 0 .../src/firstpass.rs | 0 .../src/html.rs | 0 .../src/lib.rs | 0 .../src/linklabel.rs | 0 .../src/main.rs | 0 .../src/parse.rs | 46 +- .../src/puncttable.rs | 0 .../src/scanners.rs | 0 .../src/strings.rs | 0 .../src/tree.rs | 0 .../src/utils.rs | 0 .../tests/errors.rs | 0 .../tests/html.rs | 0 .../tests/lib.rs | 0 .../tests/serde.rs | 0 .../tests/suite/blockquotes_tags.rs | 0 .../tests/suite/definition_lists.rs | 0 .../tests/suite/footnotes.rs | 0 .../tests/suite/gfm_strikethrough.rs | 0 .../tests/suite/gfm_table.rs | 0 .../tests/suite/gfm_tasklist.rs | 0 .../tests/suite/heading_attrs.rs | 0 .../tests/suite/math.rs | 0 .../tests/suite/metadata_blocks.rs | 0 .../tests/suite/mod.rs | 0 .../tests/suite/old_footnotes.rs | 0 .../tests/suite/regression.rs | 0 .../tests/suite/smart_punct.rs | 0 .../tests/suite/spec.rs | 0 .../tests/suite/strikethrough.rs | 0 .../tests/suite/super_sub.rs | 0 .../tests/suite/table.rs | 0 .../tests/suite/wikilinks.rs | 0 radix_trie-0.2.1/.cargo-checksum.json | 1 + radix_trie-0.2.1/.cargo_vcs_info.json | 5 + radix_trie-0.2.1/.travis.yml | 9 + radix_trie-0.2.1/CHANGELOG.md | 36 + radix_trie-0.2.1/Cargo.lock | 819 ++ radix_trie-0.2.1/Cargo.toml | 59 + radix_trie-0.2.1/Cargo.toml.orig | 37 + radix_trie-0.2.1/LICENSE | 21 + radix_trie-0.2.1/README.md | 58 + radix_trie-0.2.1/appveyor.yml | 33 + radix_trie-0.2.1/benches/trie_benches.rs | 60 + radix_trie-0.2.1/data/1984.txt | 10281 ++++++++++++++++ radix_trie-0.2.1/data/sun-rising.txt | 32 + radix_trie-0.2.1/examples/child_iter.rs | 20 + radix_trie-0.2.1/examples/debug.rs | 13 + radix_trie-0.2.1/examples/opt.rs | 17 + radix_trie-0.2.1/examples/string_frequency.rs | 34 + radix_trie-0.2.1/src/iter.rs | 187 + radix_trie-0.2.1/src/keys.rs | 253 + radix_trie-0.2.1/src/lib.rs | 79 + radix_trie-0.2.1/src/macros.rs | 6 + radix_trie-0.2.1/src/qc_test.rs | 274 + radix_trie-0.2.1/src/serde.rs | 212 + radix_trie-0.2.1/src/subtrie.rs | 114 + radix_trie-0.2.1/src/test.rs | 480 + radix_trie-0.2.1/src/traversal.rs | 390 + radix_trie-0.2.1/src/trie.rs | 245 + radix_trie-0.2.1/src/trie_common.rs | 175 + radix_trie-0.2.1/src/trie_node.rs | 310 + rustyline-15.0.0/.cargo-checksum.json | 1 + rustyline-15.0.0/.cargo_vcs_info.json | 6 + rustyline-15.0.0/Ansi.md | 23 + rustyline-15.0.0/BUGS.md | 46 + rustyline-15.0.0/Cargo.lock | 1296 ++ rustyline-15.0.0/Cargo.toml | 239 + rustyline-15.0.0/Cargo.toml.orig | 121 + rustyline-15.0.0/CustomBinding.md | 74 + rustyline-15.0.0/Features.md | 53 + rustyline-15.0.0/History.md | 32 + rustyline-15.0.0/Incremental.md | 56 + rustyline-15.0.0/LICENSE | 22 + rustyline-15.0.0/README.md | 258 + rustyline-15.0.0/TODO.md | 116 + .../examples/custom_key_bindings.rs | 108 + rustyline-15.0.0/examples/diy_hints.rs | 96 + rustyline-15.0.0/examples/example.rs | 98 + rustyline-15.0.0/examples/external_print.rs | 29 + rustyline-15.0.0/examples/input_multiline.rs | 30 + rustyline-15.0.0/examples/input_validation.rs | 31 + rustyline-15.0.0/examples/minimal.rs | 11 + rustyline-15.0.0/examples/numeric_input.rs | 33 + rustyline-15.0.0/examples/read_password.rs | 49 + rustyline-15.0.0/examples/sqlite_history.rs | 17 + rustyline-15.0.0/linenoise.md | 34 + rustyline-15.0.0/src/binding.rs | 258 + rustyline-15.0.0/src/command.rs | 236 + rustyline-15.0.0/src/completion.rs | 628 + rustyline-15.0.0/src/config.rs | 601 + rustyline-15.0.0/src/edit.rs | 812 ++ rustyline-15.0.0/src/error.rs | 147 + rustyline-15.0.0/src/highlight.rs | 259 + rustyline-15.0.0/src/hint.rs | 95 + rustyline-15.0.0/src/history.rs | 1075 ++ rustyline-15.0.0/src/keymap.rs | 1222 ++ rustyline-15.0.0/src/keys.rs | 222 + rustyline-15.0.0/src/kill_ring.rs | 230 + rustyline-15.0.0/src/layout.rs | 33 + rustyline-15.0.0/src/lib.rs | 990 ++ rustyline-15.0.0/src/line_buffer.rs | 1869 +++ rustyline-15.0.0/src/sqlite_history.rs | 679 + rustyline-15.0.0/src/test/common.rs | 340 + rustyline-15.0.0/src/test/emacs.rs | 424 + rustyline-15.0.0/src/test/history.rs | 243 + rustyline-15.0.0/src/test/mod.rs | 199 + rustyline-15.0.0/src/test/vi_cmd.rs | 598 + rustyline-15.0.0/src/test/vi_insert.rs | 46 + rustyline-15.0.0/src/tty/mod.rs | 220 + rustyline-15.0.0/src/tty/test.rs | 249 + rustyline-15.0.0/src/tty/unix.rs | 1704 +++ rustyline-15.0.0/src/tty/windows.rs | 943 ++ rustyline-15.0.0/src/undo.rs | 482 + rustyline-15.0.0/src/validate.rs | 135 + wasm-bindgen-0.2.118/.cargo-checksum.json | 1 - wasm-bindgen-0.2.118/.cargo_vcs_info.json | 6 - wasm-bindgen-0.2.121/.cargo-checksum.json | 1 + wasm-bindgen-0.2.121/.cargo_vcs_info.json | 6 + .../Cargo.lock | 14 +- .../Cargo.toml | 13 +- .../Cargo.toml.orig | 15 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 2 +- .../build.rs | 2 +- .../src/cache/intern.rs | 0 .../src/cache/mod.rs | 0 .../src/cast.rs | 0 .../src/closure.rs | 25 +- .../src/convert/closures.rs | 12 +- .../src/convert/impls.rs | 91 +- .../src/convert/mod.rs | 2 +- .../src/convert/slices.rs | 156 +- .../src/convert/traits.rs | 63 + .../src/describe.rs | 23 +- .../src/externref.rs | 33 +- .../src/handler.rs | 0 .../src/lib.rs | 33 +- .../src/link.rs | 0 wasm-bindgen-0.2.121/src/parent.rs | 95 + .../src/rt/marker.rs | 6 +- .../src/rt/mod.rs | 218 +- .../src/sys.rs | 1 - .../.cargo-checksum.json | 1 - .../.cargo_vcs_info.json | 6 - .../.cargo-checksum.json | 1 + .../.cargo_vcs_info.json | 6 + .../Cargo.lock | 14 +- .../Cargo.toml | 5 +- .../Cargo.toml.orig | 4 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../README.md | 0 .../src/lib.rs | 0 .../src/worker.js | 0 .../.cargo-checksum.json | 1 - .../.cargo-checksum.json | 1 + .../.cargo_vcs_info.json | 2 +- .../Cargo.lock | 6 +- .../Cargo.toml | 5 +- .../Cargo.toml.orig | 4 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../src/ast.rs | 82 +- .../src/codegen.rs | 717 +- .../src/encode.rs | 40 +- .../src/error.rs | 0 .../src/generics.rs | 236 +- .../src/hash.rs | 0 .../src/lib.rs | 23 +- .../src/parser.rs | 639 +- .../.cargo-checksum.json | 1 - .../.cargo_vcs_info.json | 6 - .../.cargo-checksum.json | 1 + .../.cargo_vcs_info.json | 6 + .../Cargo.lock | 2 +- .../Cargo.toml | 3 +- .../Cargo.toml.orig | 2 +- .../LICENSE-APACHE | 0 .../LICENSE-MIT | 0 .../build.rs | 0 .../src/identifier.rs | 0 .../src/lib.rs | 70 +- .../src/schema_hash_approval.rs | 2 +- .../src/tys.rs | 4 + .../.cargo-checksum.json | 2 +- .../.cargo_vcs_info.json | 2 +- .../Cargo.lock | 10 +- .../Cargo.toml | 8 +- .../Cargo.toml.orig | 0 .../LICENSE-APACHE | 0 .../LICENSE-Apache-2.0_WITH_LLVM-exception | 0 .../LICENSE-MIT | 0 .../README.md | 0 .../src/component.rs | 0 .../src/component/aliases.rs | 0 .../src/component/builder.rs | 36 +- .../src/component/canonicals.rs | 18 +- .../src/component/components.rs | 0 .../src/component/exports.rs | 17 +- .../src/component/imports.rs | 113 +- .../src/component/instances.rs | 10 +- .../src/component/modules.rs | 0 .../src/component/names.rs | 0 .../src/component/start.rs | 0 .../src/component/types.rs | 27 +- .../src/core.rs | 0 .../src/core/branch_hints.rs | 0 .../src/core/code.rs | 0 .../src/core/custom.rs | 0 .../src/core/data.rs | 0 .../src/core/dump.rs | 0 .../src/core/elements.rs | 0 .../src/core/exports.rs | 0 .../src/core/functions.rs | 0 .../src/core/globals.rs | 0 .../src/core/imports.rs | 0 .../src/core/instructions.rs | 0 .../src/core/linking.rs | 0 .../src/core/memories.rs | 0 .../src/core/names.rs | 0 .../src/core/producers.rs | 0 .../src/core/start.rs | 0 .../src/core/tables.rs | 0 .../src/core/tags.rs | 0 .../src/core/types.rs | 0 .../src/lib.rs | 0 .../src/raw.rs | 0 .../src/reencode.rs | 0 .../src/reencode/component.rs | 20 +- .../.cargo-checksum.json | 2 +- .../.cargo_vcs_info.json | 2 +- .../Cargo.lock | 2 +- .../Cargo.toml | 4 +- .../Cargo.toml.orig | 0 .../LICENSE-APACHE | 0 .../LICENSE-Apache-2.0_WITH_LLVM-exception | 0 .../LICENSE-MIT | 0 .../README.md | 0 .../benches/benchmark.rs | 0 .../examples/simple.rs | 0 .../src/arity.rs | 0 .../src/binary_reader.rs | 0 .../src/collections/hash.rs | 0 .../src/collections/index_map.rs | 0 .../src/collections/index_map/detail.rs | 0 .../src/collections/index_map/tests.rs | 0 .../src/collections/index_set.rs | 0 .../src/collections/map.rs | 0 .../src/collections/mod.rs | 0 .../src/collections/set.rs | 0 .../src/features.rs | 16 +- .../src/lib.rs | 0 .../src/limits.rs | 0 .../src/parser.rs | 0 .../src/readers.rs | 0 .../src/readers/component.rs | 0 .../src/readers/component/aliases.rs | 0 .../src/readers/component/canonicals.rs | 35 +- .../src/readers/component/exports.rs | 26 +- .../src/readers/component/imports.rs | 60 +- .../src/readers/component/instances.rs | 0 .../src/readers/component/names.rs | 0 .../src/readers/component/start.rs | 0 .../src/readers/component/types.rs | 6 +- .../src/readers/core.rs | 0 .../src/readers/core/branch_hinting.rs | 0 .../src/readers/core/code.rs | 0 .../src/readers/core/coredumps.rs | 0 .../src/readers/core/custom.rs | 0 .../src/readers/core/data.rs | 0 .../src/readers/core/dylink0.rs | 0 .../src/readers/core/elements.rs | 0 .../src/readers/core/exports.rs | 0 .../src/readers/core/functions.rs | 0 .../src/readers/core/globals.rs | 0 .../src/readers/core/imports.rs | 0 .../src/readers/core/init.rs | 0 .../src/readers/core/linking.rs | 0 .../src/readers/core/memories.rs | 0 .../src/readers/core/names.rs | 0 .../src/readers/core/operators.rs | 0 .../src/readers/core/producers.rs | 0 .../src/readers/core/reloc.rs | 26 +- .../src/readers/core/tables.rs | 0 .../src/readers/core/tags.rs | 0 .../src/readers/core/types.rs | 0 .../src/readers/core/types/matches.rs | 0 .../src/resources.rs | 0 .../src/validator.rs | 0 .../src/validator/component.rs | 344 +- .../src/validator/component_types.rs | 60 +- .../src/validator/core.rs | 0 .../src/validator/core/canonical.rs | 0 .../src/validator/func.rs | 0 .../src/validator/names.rs | 0 .../src/validator/operators.rs | 0 .../src/validator/operators/simd.rs | 0 .../src/validator/operators/transaction.rs | 0 .../operators/transaction_disabled.rs | 0 .../src/validator/types.rs | 0 .../tests/big-module.rs | 0 wast-247.0.0/.cargo_vcs_info.json | 6 - .../.cargo-checksum.json | 2 +- wast-249.0.0/.cargo_vcs_info.json | 6 + {wast-247.0.0 => wast-249.0.0}/Cargo.lock | 14 +- {wast-247.0.0 => wast-249.0.0}/Cargo.toml | 8 +- .../Cargo.toml.orig | 4 +- {wat-1.247.0 => wast-249.0.0}/LICENSE-APACHE | 0 .../LICENSE-Apache-2.0_WITH_LLVM-exception | 0 {wast-247.0.0 => wast-249.0.0}/LICENSE-MIT | 0 {wast-247.0.0 => wast-249.0.0}/README.md | 0 .../src/component.rs | 0 .../src/component/alias.rs | 0 .../src/component/binary.rs | 30 +- .../src/component/component.rs | 0 .../src/component/custom.rs | 0 .../src/component/expand.rs | 0 .../src/component/export.rs | 0 .../src/component/func.rs | 12 +- .../src/component/import.rs | 19 +- .../src/component/instance.rs | 0 .../src/component/item_ref.rs | 0 .../src/component/module.rs | 0 .../src/component/resolve.rs | 25 +- .../src/component/types.rs | 0 .../src/component/wast.rs | 0 .../src/component_disabled.rs | 0 {wast-247.0.0 => wast-249.0.0}/src/core.rs | 0 .../src/core/binary.rs | 0 .../src/core/binary/dwarf.rs | 0 .../src/core/binary/dwarf_disabled.rs | 0 .../src/core/custom.rs | 0 .../src/core/export.rs | 0 .../src/core/expr.rs | 0 .../src/core/func.rs | 0 .../src/core/global.rs | 0 .../src/core/import.rs | 0 .../src/core/memory.rs | 0 .../src/core/module.rs | 0 .../core/resolve/deinline_import_export.rs | 0 .../src/core/resolve/mod.rs | 0 .../src/core/resolve/names.rs | 0 .../src/core/resolve/types.rs | 0 .../src/core/table.rs | 0 .../src/core/tag.rs | 0 .../src/core/types.rs | 0 .../src/core/wast.rs | 0 {wast-247.0.0 => wast-249.0.0}/src/encode.rs | 0 {wast-247.0.0 => wast-249.0.0}/src/error.rs | 0 {wast-247.0.0 => wast-249.0.0}/src/gensym.rs | 0 {wast-247.0.0 => wast-249.0.0}/src/lexer.rs | 0 {wast-247.0.0 => wast-249.0.0}/src/lib.rs | 1 + {wast-247.0.0 => wast-249.0.0}/src/names.rs | 0 {wast-247.0.0 => wast-249.0.0}/src/parser.rs | 0 {wast-247.0.0 => wast-249.0.0}/src/token.rs | 0 {wast-247.0.0 => wast-249.0.0}/src/wast.rs | 0 {wast-247.0.0 => wast-249.0.0}/src/wat.rs | 0 .../tests/annotations.rs | 0 .../tests/comments.rs | 0 .../tests/parse-fail.rs | 0 .../tests/parse-fail/bad-core-func-alias.wat | 0 .../parse-fail/bad-core-func-alias.wat.err | 0 .../tests/parse-fail/bad-func-alias.wat | 0 .../tests/parse-fail/bad-func-alias.wat.err | 0 .../tests/parse-fail/bad-index.wat | 0 .../tests/parse-fail/bad-index.wat.err | 0 .../tests/parse-fail/bad-name.wat | 0 .../tests/parse-fail/bad-name.wat.err | 0 .../tests/parse-fail/bad-name2.wat | 0 .../tests/parse-fail/bad-name2.wat.err | 0 .../tests/parse-fail/bad-name3.wat | 0 .../tests/parse-fail/bad-name3.wat.err | 0 .../tests/parse-fail/block1.wat | 0 .../tests/parse-fail/block1.wat.err | 0 .../tests/parse-fail/block2.wat | 0 .../tests/parse-fail/block2.wat.err | 0 .../tests/parse-fail/block3.wat | 0 .../tests/parse-fail/block3.wat.err | 0 .../parse-fail/confusing-block-comment0.wat | 0 .../confusing-block-comment0.wat.err | 0 .../parse-fail/confusing-block-comment1.wat | 0 .../confusing-block-comment1.wat.err | 0 .../parse-fail/confusing-block-comment2.wat | 0 .../confusing-block-comment2.wat.err | 0 .../parse-fail/confusing-block-comment3.wat | 0 .../confusing-block-comment3.wat.err | 0 .../parse-fail/confusing-block-comment4.wat | 0 .../confusing-block-comment4.wat.err | 0 .../parse-fail/confusing-block-comment5.wat | 0 .../confusing-block-comment5.wat.err | 0 .../parse-fail/confusing-block-comment6.wat | 0 .../confusing-block-comment6.wat.err | 0 .../parse-fail/confusing-block-comment7.wat | 0 .../confusing-block-comment7.wat.err | 0 .../parse-fail/confusing-block-comment8.wat | 0 .../confusing-block-comment8.wat.err | 0 .../parse-fail/confusing-line-comment0.wat | 0 .../confusing-line-comment0.wat.err | 0 .../parse-fail/confusing-line-comment1.wat | 0 .../confusing-line-comment1.wat.err | 0 .../parse-fail/confusing-line-comment2.wat | 0 .../confusing-line-comment2.wat.err | 0 .../parse-fail/confusing-line-comment3.wat | 0 .../confusing-line-comment3.wat.err | 0 .../parse-fail/confusing-line-comment4.wat | 0 .../confusing-line-comment4.wat.err | 0 .../parse-fail/confusing-line-comment5.wat | 0 .../confusing-line-comment5.wat.err | 0 .../parse-fail/confusing-line-comment6.wat | 0 .../confusing-line-comment6.wat.err | 0 .../parse-fail/confusing-line-comment7.wat | 0 .../confusing-line-comment7.wat.err | 0 .../parse-fail/confusing-line-comment8.wat | 0 .../confusing-line-comment8.wat.err | 0 .../tests/parse-fail/confusing-string0.wat | 0 .../parse-fail/confusing-string0.wat.err | 0 .../tests/parse-fail/confusing-string1.wat | 0 .../parse-fail/confusing-string1.wat.err | 0 .../tests/parse-fail/confusing-string2.wat | 0 .../parse-fail/confusing-string2.wat.err | 0 .../tests/parse-fail/confusing-string3.wat | 0 .../parse-fail/confusing-string3.wat.err | 0 .../tests/parse-fail/confusing-string4.wat | 0 .../parse-fail/confusing-string4.wat.err | 0 .../tests/parse-fail/confusing-string5.wat | 0 .../parse-fail/confusing-string5.wat.err | 0 .../tests/parse-fail/confusing-string6.wat | 0 .../parse-fail/confusing-string6.wat.err | 0 .../tests/parse-fail/confusing-string7.wat | 0 .../parse-fail/confusing-string7.wat.err | 0 .../tests/parse-fail/confusing-string8.wat | 0 .../parse-fail/confusing-string8.wat.err | 0 .../tests/parse-fail/inline1.wat | 0 .../tests/parse-fail/inline1.wat.err | 0 .../tests/parse-fail/newline-in-string.wat | 0 .../parse-fail/newline-in-string.wat.err | 0 .../tests/parse-fail/string1.wat | 0 .../tests/parse-fail/string1.wat.err | 0 .../tests/parse-fail/string10.wat | 0 .../tests/parse-fail/string10.wat.err | 0 .../tests/parse-fail/string11.wat | 0 .../tests/parse-fail/string11.wat.err | 0 .../tests/parse-fail/string12.wat | 0 .../tests/parse-fail/string12.wat.err | 0 .../tests/parse-fail/string13.wat | 0 .../tests/parse-fail/string13.wat.err | 0 .../tests/parse-fail/string14.wat | 0 .../tests/parse-fail/string14.wat.err | 0 .../tests/parse-fail/string15.wat | 0 .../tests/parse-fail/string15.wat.err | 0 .../tests/parse-fail/string16.wat | 0 .../tests/parse-fail/string16.wat.err | 0 .../tests/parse-fail/string2.wat | 0 .../tests/parse-fail/string2.wat.err | 0 .../tests/parse-fail/string3.wat | 0 .../tests/parse-fail/string3.wat.err | 0 .../tests/parse-fail/string4.wat | 0 .../tests/parse-fail/string4.wat.err | 0 .../tests/parse-fail/string5.wat | 0 .../tests/parse-fail/string5.wat.err | 0 .../tests/parse-fail/string6.wat | Bin .../tests/parse-fail/string6.wat.err | Bin .../tests/parse-fail/string7.wat | 0 .../tests/parse-fail/string7.wat.err | 0 .../tests/parse-fail/string8.wat | 0 .../tests/parse-fail/string8.wat.err | 0 .../tests/parse-fail/string9.wat | 0 .../tests/parse-fail/string9.wat.err | 0 .../tests/parse-fail/unbalanced.wat | 0 .../tests/parse-fail/unbalanced.wat.err | 0 .../tests/recursive.rs | 0 wat-1.247.0/.cargo-checksum.json | 1 - wat-1.247.0/.cargo_vcs_info.json | 6 - wat-1.249.0/.cargo-checksum.json | 1 + wat-1.249.0/.cargo_vcs_info.json | 6 + {wat-1.247.0 => wat-1.249.0}/Cargo.lock | 14 +- {wat-1.247.0 => wat-1.249.0}/Cargo.toml | 6 +- {wat-1.247.0 => wat-1.249.0}/Cargo.toml.orig | 2 +- wat-1.249.0/LICENSE-APACHE | 201 + .../LICENSE-Apache-2.0_WITH_LLVM-exception | 0 {wat-1.247.0 => wat-1.249.0}/LICENSE-MIT | 0 {wat-1.247.0 => wat-1.249.0}/README.md | 0 {wat-1.247.0 => wat-1.249.0}/src/lib.rs | 0 1543 files changed, 45562 insertions(+), 4768 deletions(-) delete mode 100644 cc-1.2.60/.cargo_vcs_info.json rename {cc-1.2.60 => cc-1.2.62}/.cargo-checksum.json (54%) create mode 100644 cc-1.2.62/.cargo_vcs_info.json rename {cc-1.2.60 => cc-1.2.62}/CHANGELOG.md (98%) rename {cc-1.2.60 => cc-1.2.62}/Cargo.lock (95%) rename {cc-1.2.60 => cc-1.2.62}/Cargo.toml (98%) rename {cc-1.2.60 => cc-1.2.62}/Cargo.toml.orig (98%) rename {cc-1.2.60 => cc-1.2.62}/LICENSE-APACHE (100%) rename {cc-1.2.60 => cc-1.2.62}/LICENSE-MIT (100%) rename {cc-1.2.60 => cc-1.2.62}/README.md (100%) rename {cc-1.2.60 => cc-1.2.62}/clippy.toml (100%) rename {cc-1.2.60 => cc-1.2.62}/src/command_helpers.rs (99%) rename {cc-1.2.60 => cc-1.2.62}/src/detect_compiler_family.c (100%) rename {cc-1.2.60 => cc-1.2.62}/src/flags.rs (100%) rename {cc-1.2.60 => cc-1.2.62}/src/lib.rs (99%) rename {cc-1.2.60 => cc-1.2.62}/src/parallel/async_executor.rs (100%) rename {cc-1.2.60 => cc-1.2.62}/src/parallel/command_runner.rs (100%) rename {cc-1.2.60 => cc-1.2.62}/src/parallel/job_token.rs (100%) rename {cc-1.2.60 => cc-1.2.62}/src/parallel/mod.rs (100%) rename {cc-1.2.60 => cc-1.2.62}/src/parallel/stderr.rs (100%) rename {cc-1.2.60 => cc-1.2.62}/src/target.rs (100%) rename {cc-1.2.60 => cc-1.2.62}/src/target/apple.rs (100%) rename {cc-1.2.60 => cc-1.2.62}/src/target/generated.rs (99%) rename {cc-1.2.60 => cc-1.2.62}/src/target/llvm.rs (100%) rename {cc-1.2.60 => cc-1.2.62}/src/target/parser.rs (99%) rename {cc-1.2.60 => cc-1.2.62}/src/tempfile.rs (100%) rename {cc-1.2.60 => cc-1.2.62}/src/tool.rs (100%) rename {cc-1.2.60 => cc-1.2.62}/src/utilities.rs (100%) delete mode 100644 clap_complete-4.6.2/.cargo-checksum.json delete mode 100644 clap_complete-4.6.2/.cargo_vcs_info.json create mode 100644 clap_complete-4.6.5/.cargo-checksum.json create mode 100644 clap_complete-4.6.5/.cargo_vcs_info.json rename {clap_complete-4.6.2 => clap_complete-4.6.5}/Cargo.lock (99%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/Cargo.toml (98%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/Cargo.toml.orig (99%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/LICENSE-APACHE (100%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/LICENSE-MIT (100%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/README.md (89%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/examples/completion-derive.rs (95%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/examples/completion.rs (96%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/examples/dynamic.rs (100%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/examples/exhaustive.rs (99%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/aot/generator/mod.rs (100%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/aot/generator/utils.rs (86%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/aot/mod.rs (100%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/aot/shells/bash.rs (86%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/aot/shells/elvish.rs (98%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/aot/shells/fish.rs (99%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/aot/shells/mod.rs (100%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/aot/shells/powershell.rs (98%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/aot/shells/shell.rs (100%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/aot/shells/zsh.rs (99%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/engine/candidate.rs (100%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/engine/complete.rs (96%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/engine/custom.rs (86%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/engine/mod.rs (100%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/env/mod.rs (100%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/env/shells.rs (78%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/lib.rs (100%) rename {clap_complete-4.6.2 => clap_complete-4.6.5}/src/macros.rs (100%) create mode 100644 either-1.16.0/.cargo-checksum.json create mode 100644 either-1.16.0/.cargo_vcs_info.json create mode 100644 either-1.16.0/.github/workflows/ci.yml create mode 100644 either-1.16.0/Cargo.lock create mode 100644 either-1.16.0/Cargo.toml create mode 100644 either-1.16.0/Cargo.toml.orig rename {hashbrown-0.17.0 => either-1.16.0}/LICENSE-APACHE (100%) create mode 100644 either-1.16.0/LICENSE-MIT create mode 100644 either-1.16.0/README-crates.io.md create mode 100644 either-1.16.0/README.rst create mode 100644 either-1.16.0/src/into_either.rs create mode 100644 either-1.16.0/src/iterator.rs create mode 100644 either-1.16.0/src/lib.rs create mode 100644 either-1.16.0/src/serde_untagged.rs create mode 100644 either-1.16.0/src/serde_untagged_optional.rs create mode 100644 endian-type-0.1.2/.cargo-checksum.json create mode 100644 endian-type-0.1.2/Cargo.toml create mode 100644 endian-type-0.1.2/LICENSE create mode 100644 endian-type-0.1.2/src/lib.rs delete mode 100644 hashbrown-0.17.0/.cargo_vcs_info.json rename {hashbrown-0.17.0 => hashbrown-0.17.1}/.cargo-checksum.json (79%) create mode 100644 hashbrown-0.17.1/.cargo_vcs_info.json rename {hashbrown-0.17.0 => hashbrown-0.17.1}/CHANGELOG.md (99%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/Cargo.lock (88%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/Cargo.toml (98%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/Cargo.toml.orig (98%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/Cross.toml (100%) rename {js-sys-0.3.95 => hashbrown-0.17.1}/LICENSE-APACHE (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/LICENSE-MIT (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/README.md (69%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/benches/bench.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/benches/general_ops.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/benches/insert_unique_unchecked.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/benches/set_ops.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/benches/with_capacity.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/clippy.toml (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/alloc.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/control/bitmask.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/control/group/generic.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/control/group/lsx.rs (95%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/control/group/mod.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/control/group/neon.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/control/group/sse2.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/control/mod.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/control/tag.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/external_trait_impls/mod.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/external_trait_impls/rayon/helpers.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/external_trait_impls/rayon/map.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/external_trait_impls/rayon/mod.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/external_trait_impls/rayon/raw.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/external_trait_impls/rayon/set.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/external_trait_impls/rayon/table.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/external_trait_impls/serde.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/hasher.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/lib.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/macros.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/map.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/raw.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/raw_entry.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/rustc_entry.rs (87%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/scopeguard.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/set.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/table.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/src/util.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/tests/equivalent_trait.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/tests/hasher.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/tests/hasher_unwind.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/tests/rayon.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/tests/serde.rs (100%) rename {hashbrown-0.17.0 => hashbrown-0.17.1}/tests/set.rs (100%) delete mode 100644 jiff-0.2.23/.cargo_vcs_info.json rename {jiff-0.2.23 => jiff-0.2.24}/.cargo-checksum.json (88%) create mode 100644 jiff-0.2.24/.cargo_vcs_info.json rename {jiff-0.2.23 => jiff-0.2.24}/CHANGELOG.md (99%) rename {jiff-0.2.23 => jiff-0.2.24}/COMPARE.md (100%) rename {jiff-0.2.23 => jiff-0.2.24}/COPYING (100%) rename {jiff-0.2.23 => jiff-0.2.24}/Cargo.lock (99%) rename {jiff-0.2.23 => jiff-0.2.24}/Cargo.toml (99%) rename {jiff-0.2.23 => jiff-0.2.24}/Cargo.toml.orig (99%) rename {jiff-0.2.23 => jiff-0.2.24}/DESIGN.md (100%) rename {jiff-0.2.23 => jiff-0.2.24}/LICENSE-MIT (100%) rename {jiff-0.2.23 => jiff-0.2.24}/PLATFORM.md (100%) rename {jiff-0.2.23 => jiff-0.2.24}/README.md (97%) rename {jiff-0.2.23 => jiff-0.2.24}/UNLICENSE (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/civil/date.rs (99%) rename {jiff-0.2.23 => jiff-0.2.24}/src/civil/datetime.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/civil/iso_week_date.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/civil/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/civil/time.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/civil/weekday.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/duration.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/civil.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/duration.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/fmt/friendly.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/fmt/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/fmt/offset.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/fmt/rfc2822.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/fmt/rfc9557.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/fmt/strtime.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/fmt/temporal.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/fmt/util.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/signed_duration.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/span.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/timestamp.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/tz/ambiguous.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/tz/concatenated.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/tz/db.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/tz/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/tz/offset.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/tz/posix.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/tz/system.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/tz/timezone.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/tz/zic.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/unit.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/util.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/error/zoned.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/buffer.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/friendly/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/friendly/parser.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/friendly/parser_label.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/friendly/printer.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/offset.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/rfc2822.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/rfc9557.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/serde.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/strtime/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/strtime/parse.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/strtime/printer.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/temporal/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/temporal/parser.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/temporal/pieces.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/temporal/printer.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/fmt/util.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/lib.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/logging.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/now.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/shared/crc32/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/shared/crc32/table.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/shared/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/shared/posix.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/shared/tzif.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/shared/util/array_str.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/shared/util/itime.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/shared/util/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/signed_duration.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/span.rs (99%) rename {jiff-0.2.23 => jiff-0.2.24}/src/timestamp.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/ambiguous.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/concatenated.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/db/bundled/disabled.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/db/bundled/enabled.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/db/bundled/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/db/concatenated/disabled.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/db/concatenated/enabled.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/db/concatenated/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/db/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/db/zoneinfo/disabled.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/db/zoneinfo/enabled.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/db/zoneinfo/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/offset.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/posix.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/system/android.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/system/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/system/unix.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/system/wasm_emscripten.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/system/wasm_js.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/system/windows/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/system/windows/windows_zones.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/testdata.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/timezone.rs (99%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/tzif.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/tz/zic.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/array_str.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/b.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/borrow.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/cache.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/constant.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/escape.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/fs.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/libm.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/mod.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/parse.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/round.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/sync.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/util/utf8.rs (100%) rename {jiff-0.2.23 => jiff-0.2.24}/src/zoned.rs (99%) rename {jiff-0.2.23 => jiff-0.2.24}/tests/lib.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/.cargo-checksum.json (72%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/.cargo_vcs_info.json (50%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/COPYING (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/Cargo.lock (98%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/Cargo.toml (98%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/Cargo.toml.orig (97%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/LICENSE-MIT (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/README.md (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/UNLICENSE (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/lib.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/crc32/mod.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/crc32/table.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/error/itime.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/error/mod.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/mod.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/posix.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/tzif.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/util/array_str.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/util/error.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/util/escape.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/util/itime.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/util/mod.rs (100%) rename {jiff-static-0.2.23 => jiff-static-0.2.24}/src/shared/util/utf8.rs (100%) delete mode 100644 js-sys-0.3.95/.cargo-checksum.json delete mode 100644 js-sys-0.3.95/.cargo_vcs_info.json create mode 100644 js-sys-0.3.98/.cargo-checksum.json create mode 100644 js-sys-0.3.98/.cargo_vcs_info.json rename {js-sys-0.3.95 => js-sys-0.3.98}/Cargo.lock (92%) rename {js-sys-0.3.95 => js-sys-0.3.98}/Cargo.toml (94%) rename {js-sys-0.3.95 => js-sys-0.3.98}/Cargo.toml.orig (78%) rename {wasm-bindgen-0.2.118 => js-sys-0.3.98}/LICENSE-APACHE (100%) rename {js-sys-0.3.95 => js-sys-0.3.98}/LICENSE-MIT (100%) rename {js-sys-0.3.95 => js-sys-0.3.98}/README.md (100%) rename {js-sys-0.3.95 => js-sys-0.3.98}/src/Temporal.rs (100%) rename {js-sys-0.3.95 => js-sys-0.3.98}/src/futures/mod.rs (89%) rename {js-sys-0.3.95 => js-sys-0.3.98}/src/futures/queue.rs (100%) rename {js-sys-0.3.95 => js-sys-0.3.98}/src/futures/stream.rs (95%) rename {js-sys-0.3.95 => js-sys-0.3.98}/src/futures/task/mod.rs (100%) rename {js-sys-0.3.95 => js-sys-0.3.98}/src/futures/task/multithread.rs (100%) rename {js-sys-0.3.95 => js-sys-0.3.98}/src/futures/task/singlethread.rs (100%) rename {js-sys-0.3.95 => js-sys-0.3.98}/src/futures/task/wait_async_polyfill.rs (100%) rename {js-sys-0.3.95 => js-sys-0.3.98}/src/futures/task/worker.js (100%) rename {js-sys-0.3.95 => js-sys-0.3.98}/src/lib.rs (96%) delete mode 100644 libc-0.2.185/.cargo_vcs_info.json rename {libc-0.2.185 => libc-0.2.186}/.cargo-checksum.json (97%) create mode 100644 libc-0.2.186/.cargo_vcs_info.json rename {libc-0.2.185 => libc-0.2.186}/.editorconfig (100%) rename {libc-0.2.185 => libc-0.2.186}/.git-blame-ignore-revs (100%) rename {libc-0.2.185 => libc-0.2.186}/.release-plz.toml (100%) rename {libc-0.2.185 => libc-0.2.186}/.rustfmt.toml (100%) rename {libc-0.2.185 => libc-0.2.186}/CHANGELOG.md (99%) rename {libc-0.2.185 => libc-0.2.186}/CONTRIBUTING.md (100%) rename {libc-0.2.185 => libc-0.2.186}/Cargo.lock (95%) rename {libc-0.2.185 => libc-0.2.186}/Cargo.toml (99%) rename {libc-0.2.185 => libc-0.2.186}/Cargo.toml.orig (98%) rename {libc-0.2.185 => libc-0.2.186}/LICENSE-APACHE (100%) rename {libc-0.2.185 => libc-0.2.186}/LICENSE-MIT (100%) rename {libc-0.2.185 => libc-0.2.186}/README.md (91%) rename {libc-0.2.185 => libc-0.2.186}/build.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/fuchsia/aarch64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/fuchsia/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/fuchsia/riscv64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/fuchsia/x86_64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/hermit.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/lib.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/macros.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/aix/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/aix/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libc/signal.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libc/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/pthread_/introspection.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/pthread_/pthread.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/pthread_/pthread_impl.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/pthread_/pthread_spis.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/pthread_/qos.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/pthread_/sched.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/pthread_/spawn.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/pthread_/stack_np.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/sys/_pthread/_pthread_types.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/sys/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/libpthread/sys/qos.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/xnu/arm/_mcontext.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/xnu/i386/_mcontext.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/xnu/mach/arm/_structs.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/xnu/mach/i386/_structs.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/xnu/mach/machine/_structs.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/xnu/mach/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/xnu/machine/_mcontext.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/xnu/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/xnu/sys/_types/_ucontext.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/xnu/sys/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/apple/xnu/sys/signal.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/bionic_libc/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/bionic_libc/pthread.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/bionic_libc/sys/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/bionic_libc/sys/socket.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/bionic_libc/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/common/bsd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/common/freebsd_like.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/common/linux_like/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/common/linux_like/pthread.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/common/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/common/netbsd_like.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/common/posix/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/common/posix/pthread.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/common/posix/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/common/solarish.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/cygwin/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/cygwin/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/dragonfly/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/dragonfly/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/emscripten/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/emscripten/pthread.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/emscripten/sched.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/emscripten/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/espidf/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/freebsd/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/freebsd/sys/file.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/freebsd/sys/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/freebsd/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/fuchsia/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/fuchsia/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/glibc/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/glibc/posix/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/glibc/sysdeps/nptl/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/glibc/sysdeps/nptl/pthread.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/glibc/sysdeps/unix/linux/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/glibc/sysdeps/unix/linux/net/route.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/glibc/sysdeps/unix/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/haiku/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/haiku/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/hermit_abi/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/horizon/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/hurd/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/illumos/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/illumos/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/l4re/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/linux/can.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/linux/can/bcm.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/linux/can/error.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/linux/can/j1939.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/linux/can/netlink.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/linux/can/raw.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/linux/keyctl.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/linux/membarrier.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/linux/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/linux/netlink.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/linux/pidfd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/linux_uapi/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/musl/arch/generic/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/musl/arch/mips/bits/socket.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/musl/arch/mips/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/musl/arch/mips64/bits/socket.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/musl/arch/mips64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/musl/arch/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/musl/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/musl/pthread.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/musl/sched.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/musl/sys/socket.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/musl/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/net/if_.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/sys/file.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/sys/ipc.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/sys/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/sys/socket.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/sys/statvfs.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/sys/time.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/sys/timex.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/sys/types.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/utmp_.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/netbsd/utmpx_.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/newlib/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/newlib/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/nto/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/nto/net/bpf.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/nto/net/if_.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/nto/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/nuttx/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/nuttx/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/openbsd/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/openbsd/sys/ipc.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/openbsd/sys/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/openbsd/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/dlfcn.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/errno.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/fcntl.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/limits.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/pthread.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/semaphore.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/signal.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/stdio.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/stdlib.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/sys/mman.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/sys/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/sys/sched.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/sys/stat.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/sys/types.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/time.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/qurt/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/redox/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/relibc/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/relibc/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/rtems/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/sgx/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/sgx/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/solaris/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/solaris/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/solid/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/teeos/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/trusty/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/uclibc/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/uclibc/pthread.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/uclibc/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/ucrt/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/vita/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/vxworks/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/vxworks/unistd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/wasi/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/new/xous/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/primitives.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/psp.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/qurt/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/sgx.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/solid/aarch64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/solid/arm.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/solid/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/switch.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/teeos/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/trusty.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/types.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/aix/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/aix/powerpc64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/apple/b32/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/apple/b64/aarch64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/apple/b64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/apple/b64/x86_64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/apple/mod.rs (99%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/dragonfly/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/aarch64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/arm.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/powerpc.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/riscv64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/x86.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/freebsdlike/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/netbsd/aarch64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/netbsd/arm.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/netbsd/mips.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/netbsd/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/netbsd/powerpc.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/netbsd/riscv64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/netbsd/sparc64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/netbsd/x86.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/netbsd/x86_64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/openbsd/aarch64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/openbsd/arm.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/openbsd/mips64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/openbsd/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/openbsd/powerpc.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/openbsd/riscv64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/openbsd/sparc64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/openbsd/x86.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/bsd/netbsdlike/openbsd/x86_64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/cygwin/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/haiku/b32.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/haiku/b64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/haiku/bsd.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/haiku/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/haiku/native.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/haiku/x86_64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/hurd/b32.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/hurd/b64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/hurd/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/android/b32/arm.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/android/b32/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/android/b32/x86/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/android/b64/aarch64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/android/b64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/android/b64/riscv64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/android/b64/x86_64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/android/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/emscripten/lfs64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/emscripten/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/l4re/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/l4re/uclibc/aarch64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/l4re/uclibc/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/l4re/uclibc/x86_64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/arch/generic/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/arch/mips/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/arch/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/arch/powerpc/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/arch/sparc/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b32/arm/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b32/csky/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b32/mips/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b32/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b32/powerpc.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b32/x86/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/s390x.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/gnu/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/mod.rs (99%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b32/arm/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b32/hexagon.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b32/mips/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b32/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b32/powerpc.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b32/x86/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b64/mips64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b64/powerpc64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b64/s390x.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b64/wasm32/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b64/wasm32/wali.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/lfs64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/musl/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/uclibc/arm/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/uclibc/mips/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/uclibc/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux/uclibc/x86_64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/linux_l4re_shared.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/linux_like/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/newlib/aarch64/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/newlib/arm/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/newlib/espidf/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/newlib/generic.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/newlib/horizon/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/newlib/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/newlib/powerpc/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/newlib/rtems/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/newlib/vita/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/nto/aarch64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/nto/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/nto/neutrino.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/nto/x86_64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/nuttx/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/redox/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/solarish/compat.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/solarish/illumos.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/solarish/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/solarish/solaris.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/solarish/x86.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/solarish/x86_64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/unix/solarish/x86_common.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/vxworks/aarch64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/vxworks/arm.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/vxworks/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/vxworks/powerpc.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/vxworks/powerpc64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/vxworks/riscv32.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/vxworks/riscv64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/vxworks/x86.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/vxworks/x86_64.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/wasi/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/wasi/p2.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/windows/gnu/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/windows/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/windows/msvc/mod.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/src/xous.rs (100%) rename {libc-0.2.185 => libc-0.2.186}/tests/const_fn.rs (100%) create mode 100644 nibble_vec-0.1.0/.cargo-checksum.json create mode 100644 nibble_vec-0.1.0/.cargo_vcs_info.json create mode 100644 nibble_vec-0.1.0/.travis.yml create mode 100644 nibble_vec-0.1.0/CHANGELOG.md create mode 100644 nibble_vec-0.1.0/Cargo.lock create mode 100644 nibble_vec-0.1.0/Cargo.toml create mode 100644 nibble_vec-0.1.0/Cargo.toml.orig create mode 100644 nibble_vec-0.1.0/LICENSE create mode 100644 nibble_vec-0.1.0/README.md create mode 100644 nibble_vec-0.1.0/benches/nib_bench.rs create mode 100644 nibble_vec-0.1.0/examples/debug.rs create mode 100644 nibble_vec-0.1.0/src/lib.rs create mode 100644 nibble_vec-0.1.0/src/test.rs create mode 100644 num-conv-0.2.2/.cargo-checksum.json create mode 100644 num-conv-0.2.2/.cargo_vcs_info.json create mode 100644 num-conv-0.2.2/Cargo.lock create mode 100644 num-conv-0.2.2/Cargo.toml create mode 100644 num-conv-0.2.2/Cargo.toml.orig create mode 100644 num-conv-0.2.2/LICENSE-Apache create mode 100644 num-conv-0.2.2/LICENSE-MIT create mode 100644 num-conv-0.2.2/README.md create mode 100644 num-conv-0.2.2/src/lib.rs delete mode 100644 prqlc-0.13.11/.cargo_vcs_info.json rename {prqlc-0.13.11 => prqlc-0.13.12}/.cargo-checksum.json (79%) create mode 100644 prqlc-0.13.12/.cargo_vcs_info.json rename {prqlc-0.13.11 => prqlc-0.13.12}/ARCHITECTURE.md (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/Cargo.lock (96%) rename {prqlc-0.13.11 => prqlc-0.13.12}/Cargo.toml (96%) rename {prqlc-0.13.11 => prqlc-0.13.12}/Cargo.toml.orig (92%) rename {prqlc-0.13.11 => prqlc-0.13.12}/README.md (98%) rename {prqlc-0.13.11 => prqlc-0.13.12}/benches/bench.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/benches/bench_impl.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/build.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/cli/docs_generator.rs (98%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/cli/highlight.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/cli/jinja.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/cli/lsp.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/cli/mod.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/cli/snapshots/prqlc__cli__test__shell_completion-2.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/cli/snapshots/prqlc__cli__test__shell_completion-3.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/cli/snapshots/prqlc__cli__test__shell_completion-4.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/cli/snapshots/prqlc__cli__test__shell_completion.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/cli/test.rs (98%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/cli/watch.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/codegen/ast.rs (99%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/codegen/mod.rs (98%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/codegen/types.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/debug/log.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/debug/messages.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/debug/mod.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/debug/render_html.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/error_message.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/decl.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/generic.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/mod.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/pl/expr.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/pl/extra.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/pl/fold.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/pl/lineage.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/pl/mod.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/pl/stmt.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/pl/utils.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/rq/expr.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/rq/fold.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/rq/ids.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/rq/mod.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/rq/transform.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/ir/rq/utils.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/lib.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/main.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/parser.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/ast_expand.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/lowering.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/mod.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/module.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/reporting.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/expr.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/flatten.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/functions.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/inference.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/mod.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/names.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap (85%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap (85%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap (89%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap (92%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_1.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_nested.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline-2.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__named_args.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__variables_1.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap (94%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/static_eval.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/stmt.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/transforms.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/resolver/types.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/semantic/std.prql (96%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/dialect.rs (98%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/gen_expr.rs (91%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/gen_projection.rs (99%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/gen_query.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/keywords.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/mod.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/operators.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/pq/anchor.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/pq/ast.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/pq/context.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/pq/gen_query.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/pq/mod.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/pq/positional_mapping.rs (98%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/pq/postprocess.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/pq/preprocess.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/sql/std.sql.prql (81%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/utils/id_gen.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/utils/mod.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/src/utils/toposort.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/CLAUDE.md (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/bad_error_messages.rs (96%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/albums.csv (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/artists.csv (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/customers.csv (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/employees.csv (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/genres.csv (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/invoice_items.csv (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/invoices.csv (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/media_types.csv (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/media_types.json (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/playlist_track.csv (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/playlists.csv (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/schema.sql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/data/chinook/tracks.csv (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/dbs/README.md (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/dbs/docker-compose.yaml (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/dbs/dockerfiles/glaredb.Dockerfile (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/dbs/mod.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/dbs/protocol.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/dbs/runner.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/error_messages.rs (89%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/main.rs (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/project/Project.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/project/artists.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries.rs (94%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/aggregation.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/append_select.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/append_select_compute.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/append_select_multiple_with_null.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/append_select_nulls.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/append_select_simple.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/arithmetic.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/cast.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/constants_only.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/date_to_text.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/distinct.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/distinct_on.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/genre_counts.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/group_all.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/group_sort.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/group_sort_derive_select_join.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/group_sort_filter_derive_select_join.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/group_sort_limit_take.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/invoice_totals.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/loop_01.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/math_module.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/pipelines.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/read_csv.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/set_ops_remove.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/sort.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/sort_2.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/sort_3.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/switch.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/take.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/text_module.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/queries/window.prql (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__aggregation.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__append_select.snap (97%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__append_select_compute.snap (98%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__append_select_multiple_with_null.snap (97%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__append_select_nulls.snap (67%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__append_select_simple.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__arithmetic.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__cast.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__constants_only.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__distinct.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__distinct_on.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__genre_counts.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__group_all.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__group_sort.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__group_sort_derive_select_join.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__group_sort_filter_derive_select_join.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__group_sort_limit_take.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__invoice_totals.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__loop_01.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__math_module.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__pipelines.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__read_csv.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__set_ops_remove.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__sort.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__sort_2.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__sort_3.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__switch.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__take.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__text_module.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compile__window.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__aggregation.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__append_select.snap (98%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__append_select_compute.snap (99%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__append_select_multiple_with_null.snap (98%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__append_select_nulls.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__append_select_simple.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__arithmetic.snap (94%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__cast.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__constants_only.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__distinct.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__distinct_on.snap (99%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__genre_counts.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__group_all.snap (99%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__group_sort.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__group_sort_derive_select_join.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__group_sort_filter_derive_select_join.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__group_sort_limit_take.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__invoice_totals.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__loop_01.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__math_module.snap (99%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__pipelines.snap (99%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__read_csv.snap (99%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__set_ops_remove.snap (97%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__sort.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__sort_2.snap (99%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__sort_3.snap (99%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__switch.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__take.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__text_module.snap (99%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__compileall__window.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap (91%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap (90%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap (92%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap (91%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap (90%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap (91%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap (88%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__cast.snap (91%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap (90%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap (92%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap (88%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap (90%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap (94%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap (89%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap (89%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap (84%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap (84%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap (90%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap (90%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap (87%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap (93%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap (92%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap (85%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap (85%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__sort.snap (91%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap (89%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap (81%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__switch.snap (93%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__take.snap (92%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap (91%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__debug_lineage__window.snap (91%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__aggregation.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__append_select.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__append_select_compute.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__append_select_multiple_with_null.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__append_select_nulls.snap (57%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__append_select_simple.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__arithmetic.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__cast.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__constants_only.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__date_to_text.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__distinct.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__distinct_on.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__genre_counts.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__group_all.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__group_sort.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__group_sort_derive_select_join.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__group_sort_filter_derive_select_join.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__group_sort_limit_take.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__invoice_totals.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__loop_01.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__math_module.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__pipelines.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__read_csv.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__set_ops_remove.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__sort.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__sort_2.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__sort_3.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__switch.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__take.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__text_module.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__fmt__window.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__aggregation.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__append_select.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__append_select_compute.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__append_select_multiple_with_null.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__append_select_nulls.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__append_select_simple.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__arithmetic.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__cast.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__constants_only.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__date_to_text.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__distinct.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__distinct_on.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__genre_counts.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__group_all.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__group_sort.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__group_sort_derive_select_join.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__group_sort_filter_derive_select_join.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__group_sort_limit_take.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__invoice_totals.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__loop_01.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__math_module.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__pipelines.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__read_csv.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__set_ops_remove.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__sort.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__sort_2.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__sort_3.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__switch.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__take.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__text_module.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__lex__window.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__aggregation.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__append_select.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__append_select_compute.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__append_select_multiple_with_null.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__append_select_nulls.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__append_select_simple.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__arithmetic.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__cast.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__constants_only.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__date_to_text.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__distinct.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__distinct_on.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__genre_counts.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__group_all.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__group_sort.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__group_sort_derive_select_join.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__group_sort_filter_derive_select_join.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__group_sort_limit_take.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__invoice_totals.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__loop_01.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__math_module.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__pipelines.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__read_csv.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__set_ops_remove.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__sort.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__sort_2.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__sort_3.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__switch.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__take.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__text_module.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/snapshots/integration__queries__results__window.snap (100%) rename {prqlc-0.13.11 => prqlc-0.13.12}/tests/integration/sql.rs (93%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/.cargo-checksum.json (83%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/.cargo_vcs_info.json (50%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/Cargo.lock (83%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/Cargo.toml (96%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/Cargo.toml.orig (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/error.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/generic.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/lexer/lr.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/lexer/mod.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/lexer/test.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/lib.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/expr.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/interpolation.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/mod.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/perror.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/pr/expr.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/pr/ident.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/pr/mod.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/pr/ops.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/pr/stmt.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/pr/types.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/stmt.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/test.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/parser/types.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/snapshots/prqlc_parser__test__pipeline_parse_tree.snap (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/span.rs (100%) rename {prqlc-parser-0.13.11 => prqlc-parser-0.13.12}/src/test.rs (100%) delete mode 100644 pulldown-cmark-0.13.3/.cargo_vcs_info.json rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/.cargo-checksum.json (86%) create mode 100644 pulldown-cmark-0.13.4/.cargo_vcs_info.json rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/Cargo.lock (97%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/Cargo.toml (99%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/Cargo.toml.orig (99%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/LICENSE (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/README.md (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/build.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/examples/broken-link-callbacks.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/examples/event-filter.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/examples/events.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/examples/footnote-rewrite.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/examples/normalize-wikilink.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/examples/parser-map-event-print.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/examples/parser-map-tag-print.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/examples/string-to-string.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/entities.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/firstpass.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/html.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/lib.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/linklabel.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/main.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/parse.rs (98%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/puncttable.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/scanners.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/strings.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/tree.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/src/utils.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/errors.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/html.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/lib.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/serde.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/blockquotes_tags.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/definition_lists.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/footnotes.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/gfm_strikethrough.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/gfm_table.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/gfm_tasklist.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/heading_attrs.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/math.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/metadata_blocks.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/mod.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/old_footnotes.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/regression.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/smart_punct.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/spec.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/strikethrough.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/super_sub.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/table.rs (100%) rename {pulldown-cmark-0.13.3 => pulldown-cmark-0.13.4}/tests/suite/wikilinks.rs (100%) create mode 100644 radix_trie-0.2.1/.cargo-checksum.json create mode 100644 radix_trie-0.2.1/.cargo_vcs_info.json create mode 100644 radix_trie-0.2.1/.travis.yml create mode 100644 radix_trie-0.2.1/CHANGELOG.md create mode 100644 radix_trie-0.2.1/Cargo.lock create mode 100644 radix_trie-0.2.1/Cargo.toml create mode 100644 radix_trie-0.2.1/Cargo.toml.orig create mode 100644 radix_trie-0.2.1/LICENSE create mode 100644 radix_trie-0.2.1/README.md create mode 100644 radix_trie-0.2.1/appveyor.yml create mode 100644 radix_trie-0.2.1/benches/trie_benches.rs create mode 100644 radix_trie-0.2.1/data/1984.txt create mode 100644 radix_trie-0.2.1/data/sun-rising.txt create mode 100644 radix_trie-0.2.1/examples/child_iter.rs create mode 100644 radix_trie-0.2.1/examples/debug.rs create mode 100644 radix_trie-0.2.1/examples/opt.rs create mode 100644 radix_trie-0.2.1/examples/string_frequency.rs create mode 100644 radix_trie-0.2.1/src/iter.rs create mode 100644 radix_trie-0.2.1/src/keys.rs create mode 100644 radix_trie-0.2.1/src/lib.rs create mode 100644 radix_trie-0.2.1/src/macros.rs create mode 100644 radix_trie-0.2.1/src/qc_test.rs create mode 100644 radix_trie-0.2.1/src/serde.rs create mode 100644 radix_trie-0.2.1/src/subtrie.rs create mode 100644 radix_trie-0.2.1/src/test.rs create mode 100644 radix_trie-0.2.1/src/traversal.rs create mode 100644 radix_trie-0.2.1/src/trie.rs create mode 100644 radix_trie-0.2.1/src/trie_common.rs create mode 100644 radix_trie-0.2.1/src/trie_node.rs create mode 100644 rustyline-15.0.0/.cargo-checksum.json create mode 100644 rustyline-15.0.0/.cargo_vcs_info.json create mode 100644 rustyline-15.0.0/Ansi.md create mode 100644 rustyline-15.0.0/BUGS.md create mode 100644 rustyline-15.0.0/Cargo.lock create mode 100644 rustyline-15.0.0/Cargo.toml create mode 100644 rustyline-15.0.0/Cargo.toml.orig create mode 100644 rustyline-15.0.0/CustomBinding.md create mode 100644 rustyline-15.0.0/Features.md create mode 100644 rustyline-15.0.0/History.md create mode 100644 rustyline-15.0.0/Incremental.md create mode 100644 rustyline-15.0.0/LICENSE create mode 100644 rustyline-15.0.0/README.md create mode 100644 rustyline-15.0.0/TODO.md create mode 100644 rustyline-15.0.0/examples/custom_key_bindings.rs create mode 100644 rustyline-15.0.0/examples/diy_hints.rs create mode 100644 rustyline-15.0.0/examples/example.rs create mode 100644 rustyline-15.0.0/examples/external_print.rs create mode 100644 rustyline-15.0.0/examples/input_multiline.rs create mode 100644 rustyline-15.0.0/examples/input_validation.rs create mode 100644 rustyline-15.0.0/examples/minimal.rs create mode 100644 rustyline-15.0.0/examples/numeric_input.rs create mode 100644 rustyline-15.0.0/examples/read_password.rs create mode 100644 rustyline-15.0.0/examples/sqlite_history.rs create mode 100644 rustyline-15.0.0/linenoise.md create mode 100644 rustyline-15.0.0/src/binding.rs create mode 100644 rustyline-15.0.0/src/command.rs create mode 100644 rustyline-15.0.0/src/completion.rs create mode 100644 rustyline-15.0.0/src/config.rs create mode 100644 rustyline-15.0.0/src/edit.rs create mode 100644 rustyline-15.0.0/src/error.rs create mode 100644 rustyline-15.0.0/src/highlight.rs create mode 100644 rustyline-15.0.0/src/hint.rs create mode 100644 rustyline-15.0.0/src/history.rs create mode 100644 rustyline-15.0.0/src/keymap.rs create mode 100644 rustyline-15.0.0/src/keys.rs create mode 100644 rustyline-15.0.0/src/kill_ring.rs create mode 100644 rustyline-15.0.0/src/layout.rs create mode 100644 rustyline-15.0.0/src/lib.rs create mode 100644 rustyline-15.0.0/src/line_buffer.rs create mode 100644 rustyline-15.0.0/src/sqlite_history.rs create mode 100644 rustyline-15.0.0/src/test/common.rs create mode 100644 rustyline-15.0.0/src/test/emacs.rs create mode 100644 rustyline-15.0.0/src/test/history.rs create mode 100644 rustyline-15.0.0/src/test/mod.rs create mode 100644 rustyline-15.0.0/src/test/vi_cmd.rs create mode 100644 rustyline-15.0.0/src/test/vi_insert.rs create mode 100644 rustyline-15.0.0/src/tty/mod.rs create mode 100644 rustyline-15.0.0/src/tty/test.rs create mode 100644 rustyline-15.0.0/src/tty/unix.rs create mode 100644 rustyline-15.0.0/src/tty/windows.rs create mode 100644 rustyline-15.0.0/src/undo.rs create mode 100644 rustyline-15.0.0/src/validate.rs delete mode 100644 wasm-bindgen-0.2.118/.cargo-checksum.json delete mode 100644 wasm-bindgen-0.2.118/.cargo_vcs_info.json create mode 100644 wasm-bindgen-0.2.121/.cargo-checksum.json create mode 100644 wasm-bindgen-0.2.121/.cargo_vcs_info.json rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/Cargo.lock (93%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/Cargo.toml (90%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/Cargo.toml.orig (89%) rename {wasm-bindgen-macro-0.2.118 => wasm-bindgen-0.2.121}/LICENSE-APACHE (100%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/LICENSE-MIT (100%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/README.md (99%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/build.rs (96%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/cache/intern.rs (100%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/cache/mod.rs (100%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/cast.rs (100%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/closure.rs (97%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/convert/closures.rs (98%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/convert/impls.rs (89%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/convert/mod.rs (82%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/convert/slices.rs (71%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/convert/traits.rs (89%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/describe.rs (90%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/externref.rs (79%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/handler.rs (100%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/lib.rs (98%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/link.rs (100%) create mode 100644 wasm-bindgen-0.2.121/src/parent.rs rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/rt/marker.rs (97%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/rt/mod.rs (83%) rename {wasm-bindgen-0.2.118 => wasm-bindgen-0.2.121}/src/sys.rs (99%) delete mode 100644 wasm-bindgen-macro-0.2.118/.cargo-checksum.json delete mode 100644 wasm-bindgen-macro-0.2.118/.cargo_vcs_info.json create mode 100644 wasm-bindgen-macro-0.2.121/.cargo-checksum.json create mode 100644 wasm-bindgen-macro-0.2.121/.cargo_vcs_info.json rename {wasm-bindgen-macro-0.2.118 => wasm-bindgen-macro-0.2.121}/Cargo.lock (95%) rename {wasm-bindgen-macro-0.2.118 => wasm-bindgen-macro-0.2.121}/Cargo.toml (95%) rename {wasm-bindgen-macro-0.2.118 => wasm-bindgen-macro-0.2.121}/Cargo.toml.orig (95%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-0.2.121}/LICENSE-APACHE (100%) rename {wasm-bindgen-macro-0.2.118 => wasm-bindgen-macro-0.2.121}/LICENSE-MIT (100%) rename {wasm-bindgen-macro-0.2.118 => wasm-bindgen-macro-0.2.121}/README.md (100%) rename {wasm-bindgen-macro-0.2.118 => wasm-bindgen-macro-0.2.121}/src/lib.rs (100%) rename {wasm-bindgen-macro-0.2.118 => wasm-bindgen-macro-0.2.121}/src/worker.js (100%) delete mode 100644 wasm-bindgen-macro-support-0.2.118/.cargo-checksum.json create mode 100644 wasm-bindgen-macro-support-0.2.121/.cargo-checksum.json rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/.cargo_vcs_info.json (51%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/Cargo.lock (92%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/Cargo.toml (96%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/Cargo.toml.orig (89%) rename {wasm-bindgen-shared-0.2.118 => wasm-bindgen-macro-support-0.2.121}/LICENSE-APACHE (100%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/LICENSE-MIT (100%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/src/ast.rs (85%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/src/codegen.rs (78%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/src/encode.rs (94%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/src/error.rs (100%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/src/generics.rs (75%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/src/hash.rs (100%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/src/lib.rs (86%) rename {wasm-bindgen-macro-support-0.2.118 => wasm-bindgen-macro-support-0.2.121}/src/parser.rs (78%) delete mode 100644 wasm-bindgen-shared-0.2.118/.cargo-checksum.json delete mode 100644 wasm-bindgen-shared-0.2.118/.cargo_vcs_info.json create mode 100644 wasm-bindgen-shared-0.2.121/.cargo-checksum.json create mode 100644 wasm-bindgen-shared-0.2.121/.cargo_vcs_info.json rename {wasm-bindgen-shared-0.2.118 => wasm-bindgen-shared-0.2.121}/Cargo.lock (95%) rename {wasm-bindgen-shared-0.2.118 => wasm-bindgen-shared-0.2.121}/Cargo.toml (96%) rename {wasm-bindgen-shared-0.2.118 => wasm-bindgen-shared-0.2.121}/Cargo.toml.orig (97%) rename {wasm-encoder-0.247.0 => wasm-bindgen-shared-0.2.121}/LICENSE-APACHE (100%) rename {wasm-bindgen-shared-0.2.118 => wasm-bindgen-shared-0.2.121}/LICENSE-MIT (100%) rename {wasm-bindgen-shared-0.2.118 => wasm-bindgen-shared-0.2.121}/build.rs (100%) rename {wasm-bindgen-shared-0.2.118 => wasm-bindgen-shared-0.2.121}/src/identifier.rs (100%) rename {wasm-bindgen-shared-0.2.118 => wasm-bindgen-shared-0.2.121}/src/lib.rs (76%) rename {wasm-bindgen-shared-0.2.118 => wasm-bindgen-shared-0.2.121}/src/schema_hash_approval.rs (89%) rename {wasm-bindgen-shared-0.2.118 => wasm-bindgen-shared-0.2.121}/src/tys.rs (89%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/.cargo-checksum.json (71%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/.cargo_vcs_info.json (51%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/Cargo.lock (97%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/Cargo.toml (97%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/Cargo.toml.orig (100%) rename {wasmparser-0.247.0 => wasm-encoder-0.249.0}/LICENSE-APACHE (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/LICENSE-Apache-2.0_WITH_LLVM-exception (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/LICENSE-MIT (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/README.md (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component/aliases.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component/builder.rs (96%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component/canonicals.rs (97%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component/components.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component/exports.rs (88%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component/imports.rs (58%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component/instances.rs (93%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component/modules.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component/names.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component/start.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/component/types.rs (96%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/branch_hints.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/code.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/custom.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/data.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/dump.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/elements.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/exports.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/functions.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/globals.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/imports.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/instructions.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/linking.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/memories.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/names.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/producers.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/start.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/tables.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/tags.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/core/types.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/lib.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/raw.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/reencode.rs (100%) rename {wasm-encoder-0.247.0 => wasm-encoder-0.249.0}/src/reencode/component.rs (99%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/.cargo-checksum.json (80%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/.cargo_vcs_info.json (50%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/Cargo.lock (99%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/Cargo.toml (98%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/Cargo.toml.orig (100%) rename {wast-247.0.0 => wasmparser-0.249.0}/LICENSE-APACHE (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/LICENSE-Apache-2.0_WITH_LLVM-exception (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/LICENSE-MIT (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/README.md (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/benches/benchmark.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/examples/simple.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/arity.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/binary_reader.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/collections/hash.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/collections/index_map.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/collections/index_map/detail.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/collections/index_map/tests.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/collections/index_set.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/collections/map.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/collections/mod.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/collections/set.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/features.rs (96%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/lib.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/limits.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/parser.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/component.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/component/aliases.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/component/canonicals.rs (94%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/component/exports.rs (79%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/component/imports.rs (75%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/component/instances.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/component/names.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/component/start.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/component/types.rs (99%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/branch_hinting.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/code.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/coredumps.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/custom.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/data.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/dylink0.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/elements.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/exports.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/functions.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/globals.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/imports.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/init.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/linking.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/memories.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/names.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/operators.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/producers.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/reloc.rs (93%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/tables.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/tags.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/types.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/readers/core/types/matches.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/resources.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator/component.rs (94%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator/component_types.rs (98%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator/core.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator/core/canonical.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator/func.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator/names.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator/operators.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator/operators/simd.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator/operators/transaction.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator/operators/transaction_disabled.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/src/validator/types.rs (100%) rename {wasmparser-0.247.0 => wasmparser-0.249.0}/tests/big-module.rs (100%) delete mode 100644 wast-247.0.0/.cargo_vcs_info.json rename {wast-247.0.0 => wast-249.0.0}/.cargo-checksum.json (93%) create mode 100644 wast-249.0.0/.cargo_vcs_info.json rename {wast-247.0.0 => wast-249.0.0}/Cargo.lock (98%) rename {wast-247.0.0 => wast-249.0.0}/Cargo.toml (97%) rename {wast-247.0.0 => wast-249.0.0}/Cargo.toml.orig (97%) rename {wat-1.247.0 => wast-249.0.0}/LICENSE-APACHE (100%) rename {wast-247.0.0 => wast-249.0.0}/LICENSE-Apache-2.0_WITH_LLVM-exception (100%) rename {wast-247.0.0 => wast-249.0.0}/LICENSE-MIT (100%) rename {wast-247.0.0 => wast-249.0.0}/README.md (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component/alias.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component/binary.rs (97%) rename {wast-247.0.0 => wast-249.0.0}/src/component/component.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component/custom.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component/expand.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component/export.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component/func.rs (99%) rename {wast-247.0.0 => wast-249.0.0}/src/component/import.rs (92%) rename {wast-247.0.0 => wast-249.0.0}/src/component/instance.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component/item_ref.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component/module.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component/resolve.rs (98%) rename {wast-247.0.0 => wast-249.0.0}/src/component/types.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component/wast.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/component_disabled.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/binary.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/binary/dwarf.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/binary/dwarf_disabled.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/custom.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/export.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/expr.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/func.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/global.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/import.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/memory.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/module.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/resolve/deinline_import_export.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/resolve/mod.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/resolve/names.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/resolve/types.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/table.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/tag.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/types.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/core/wast.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/encode.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/error.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/gensym.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/lexer.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/lib.rs (99%) rename {wast-247.0.0 => wast-249.0.0}/src/names.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/parser.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/token.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/wast.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/src/wat.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/annotations.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/comments.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail.rs (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-core-func-alias.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-core-func-alias.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-func-alias.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-func-alias.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-index.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-index.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-name.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-name.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-name2.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-name2.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-name3.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/bad-name3.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/block1.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/block1.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/block2.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/block2.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/block3.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/block3.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment0.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment0.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment1.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment1.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment2.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment2.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment3.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment3.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment4.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment4.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment5.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment5.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment6.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment6.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment7.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment7.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment8.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-block-comment8.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment0.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment0.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment1.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment1.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment2.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment2.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment3.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment3.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment4.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment4.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment5.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment5.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment6.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment6.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment7.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment7.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment8.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-line-comment8.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string0.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string0.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string1.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string1.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string2.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string2.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string3.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string3.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string4.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string4.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string5.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string5.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string6.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string6.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string7.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string7.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string8.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/confusing-string8.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/inline1.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/inline1.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/newline-in-string.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/newline-in-string.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string1.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string1.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string10.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string10.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string11.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string11.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string12.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string12.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string13.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string13.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string14.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string14.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string15.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string15.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string16.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string16.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string2.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string2.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string3.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string3.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string4.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string4.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string5.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string5.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string6.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string6.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string7.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string7.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string8.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string8.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string9.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/string9.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/unbalanced.wat (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/parse-fail/unbalanced.wat.err (100%) rename {wast-247.0.0 => wast-249.0.0}/tests/recursive.rs (100%) delete mode 100644 wat-1.247.0/.cargo-checksum.json delete mode 100644 wat-1.247.0/.cargo_vcs_info.json create mode 100644 wat-1.249.0/.cargo-checksum.json create mode 100644 wat-1.249.0/.cargo_vcs_info.json rename {wat-1.247.0 => wat-1.249.0}/Cargo.lock (90%) rename {wat-1.247.0 => wat-1.249.0}/Cargo.toml (97%) rename {wat-1.247.0 => wat-1.249.0}/Cargo.toml.orig (97%) create mode 100644 wat-1.249.0/LICENSE-APACHE rename {wat-1.247.0 => wat-1.249.0}/LICENSE-Apache-2.0_WITH_LLVM-exception (100%) rename {wat-1.247.0 => wat-1.249.0}/LICENSE-MIT (100%) rename {wat-1.247.0 => wat-1.249.0}/README.md (100%) rename {wat-1.247.0 => wat-1.249.0}/src/lib.rs (100%) diff --git a/cc-1.2.60/.cargo_vcs_info.json b/cc-1.2.60/.cargo_vcs_info.json deleted file mode 100644 index 7ebab0301b..0000000000 --- a/cc-1.2.60/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "7cad9f5b10c33fa969a13ead70b43b64380cc9e2" - }, - "path_in_vcs": "" -} \ No newline at end of file diff --git a/cc-1.2.60/.cargo-checksum.json b/cc-1.2.62/.cargo-checksum.json similarity index 54% rename from cc-1.2.60/.cargo-checksum.json rename to cc-1.2.62/.cargo-checksum.json index 7c5a66d156..a48bdd51a0 100644 --- a/cc-1.2.60/.cargo-checksum.json +++ b/cc-1.2.62/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo_vcs_info.json":"13368d230bb646ded49e41cacd95eafd5c7efe46c5397d2ac4279958b68c1115","CHANGELOG.md":"a6c6641008dc5104dbfb52aa1e34609669d51f0ed57bd044194db8f57ea5d725","Cargo.lock":"f8606ab464231108d23ebf16de3c689a4de10ba1c945230d3db024f8d7ca49ac","Cargo.toml":"4fccb9c4c260a1ee08b283b90218e28e0b1da061c271cd92e35a8f764093e16e","Cargo.toml.orig":"22eefddd40e12548f773158e325dec11ab2e73f4c8d65baee347bd3bd4e9dbbc","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"cc952a506dc726eed3e128d47d62defbac4470bbb0e465f6a043ae8bf0c96d19","clippy.toml":"cf46251b0953d1a3c7a4f8f8941a08d8a416d5fc348dfe3f3c520eb93fcc18ea","src/command_helpers.rs":"293feaca0ef3b92105028c23b3cc3c5c3657af05db3239a703d84e473b1a7f86","src/detect_compiler_family.c":"97ca4b021495611e828becea6187add37414186a16dfedd26c2947cbce6e8b2f","src/flags.rs":"11f22aa9741b0d445b19ab29ea1076cc32a4143316a74855b6bd682004217543","src/lib.rs":"cf86f5d21f52009967479b557ad934e54a9164f161bc2d715b1ca037d3b3d501","src/parallel/async_executor.rs":"4ce24435fff6b6555b43fee042c16bd65d4150d0346567f246b9190d85b45983","src/parallel/command_runner.rs":"1d17d9a037de93b31cc7ee6a914a1e1f6c1ac156cf8619f0014dcbaca6a0b215","src/parallel/job_token.rs":"858b684423bce773d04a042f3f9bafbd21deda21bbb1efefb078a20ef5d8a134","src/parallel/mod.rs":"bf156170790d40a76015a8c78cc2a391cbe1b60bb96c1fac1d047d26e342386a","src/parallel/stderr.rs":"840fe8d0ba613c98fa92cbebc374a028a3212ba7dcea58285483223a31acc7eb","src/target.rs":"a9d2d347a3a08015531f00b32bc8a7478f5636822cc8e0237ea9efa3f07d4cd4","src/target/apple.rs":"da9411b2c4db419e0fa39f765ee53b8665b3837fb39827679a53238734a4a1c1","src/target/generated.rs":"99463a5ffa411bafe7f91e8d7ee0f8f4d29ca28c59a42175e7955a3249301ce0","src/target/llvm.rs":"190fe8d2b204cd4a6e68f2a1aada17ecd6390799564ed25792fcc08ab34710ba","src/target/parser.rs":"56ebea1e462a35c54e53b50a130284f0fb6fd43ad84ddafda2cdb01272e36d60","src/tempfile.rs":"3d9a4bd894862a345aa230a61ec266f0c68f4ef9713d1d9c727482e61f1ea7c3","src/tool.rs":"1d279a6f0738f9164ca794c85bd55951aa95e2adc788e75a6bb8133393d6cce8","src/utilities.rs":"ebb59ac01fb9588bcea0d0ee786e5d5a5696b4284a1245657625db03e830b72e"},"package":"43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20"} \ No newline at end of file +{"files":{".cargo_vcs_info.json":"7d81f2990233c40ed9edbf2a95740a6b69dd06c9dbc64199c047f4496b43d82a","CHANGELOG.md":"eb499d4a77f09e6d21508e872e2ee4f78f7d2afed9e9921654d6bc3d688f10e1","Cargo.lock":"4dedebe3cf78840025a1008199478ed14bc1a2fd33f01aa3d559f07258180683","Cargo.toml":"b31a35c88facff9879fa4a2cdf9f53c76fc056d8be4db05ccb672fb5ece4f0fe","Cargo.toml.orig":"09ffbc9dc9dc5d406796b5fb4c0020f56d435283e7f26f0d55eb8d7b76b14fc7","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"cc952a506dc726eed3e128d47d62defbac4470bbb0e465f6a043ae8bf0c96d19","clippy.toml":"cf46251b0953d1a3c7a4f8f8941a08d8a416d5fc348dfe3f3c520eb93fcc18ea","src/command_helpers.rs":"650c9682edc3d7732249e327c1026c7cc733f3702f4867b9580223e97522d3c6","src/detect_compiler_family.c":"97ca4b021495611e828becea6187add37414186a16dfedd26c2947cbce6e8b2f","src/flags.rs":"11f22aa9741b0d445b19ab29ea1076cc32a4143316a74855b6bd682004217543","src/lib.rs":"e893112abbdb4784ea895438e90d1e9261c02bcbc712b8d878e8bfd5c5722d78","src/parallel/async_executor.rs":"4ce24435fff6b6555b43fee042c16bd65d4150d0346567f246b9190d85b45983","src/parallel/command_runner.rs":"1d17d9a037de93b31cc7ee6a914a1e1f6c1ac156cf8619f0014dcbaca6a0b215","src/parallel/job_token.rs":"858b684423bce773d04a042f3f9bafbd21deda21bbb1efefb078a20ef5d8a134","src/parallel/mod.rs":"bf156170790d40a76015a8c78cc2a391cbe1b60bb96c1fac1d047d26e342386a","src/parallel/stderr.rs":"840fe8d0ba613c98fa92cbebc374a028a3212ba7dcea58285483223a31acc7eb","src/target.rs":"a9d2d347a3a08015531f00b32bc8a7478f5636822cc8e0237ea9efa3f07d4cd4","src/target/apple.rs":"da9411b2c4db419e0fa39f765ee53b8665b3837fb39827679a53238734a4a1c1","src/target/generated.rs":"2e1d7e5d8fd954bdcc6e45ef16f69af1a798eacb8d212a516aaf8025908f6d36","src/target/llvm.rs":"190fe8d2b204cd4a6e68f2a1aada17ecd6390799564ed25792fcc08ab34710ba","src/target/parser.rs":"e2a5246a8fe46d39616410685cf7418f6b86344c5309bf09817978b182b3b38c","src/tempfile.rs":"3d9a4bd894862a345aa230a61ec266f0c68f4ef9713d1d9c727482e61f1ea7c3","src/tool.rs":"1d279a6f0738f9164ca794c85bd55951aa95e2adc788e75a6bb8133393d6cce8","src/utilities.rs":"ebb59ac01fb9588bcea0d0ee786e5d5a5696b4284a1245657625db03e830b72e"},"package":"a1dce859f0832a7d088c4f1119888ab94ef4b5d6795d1ce05afb7fe159d79f98"} \ No newline at end of file diff --git a/cc-1.2.62/.cargo_vcs_info.json b/cc-1.2.62/.cargo_vcs_info.json new file mode 100644 index 0000000000..42efaf466e --- /dev/null +++ b/cc-1.2.62/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "37a5f8f4e1a2eaf4cf483fc0fb97d35761b720c5" + }, + "path_in_vcs": "" +} \ No newline at end of file diff --git a/cc-1.2.60/CHANGELOG.md b/cc-1.2.62/CHANGELOG.md similarity index 98% rename from cc-1.2.60/CHANGELOG.md rename to cc-1.2.62/CHANGELOG.md index 911a1fe103..d69e859427 100644 --- a/cc-1.2.60/CHANGELOG.md +++ b/cc-1.2.62/CHANGELOG.md @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.2.62](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.61...cc-v1.2.62) - 2026-05-08 + +### Other + +- Regenerate target info ([#1721](https://github.com/rust-lang/cc-rs/pull/1721)) +- Allow exceptions on wasm platforms ([#1714](https://github.com/rust-lang/cc-rs/pull/1714)) +- Add relibc env ([#1710](https://github.com/rust-lang/cc-rs/pull/1710)) +- recognize sh4 architecture in parse_arch() ([#1712](https://github.com/rust-lang/cc-rs/pull/1712)) + +## [1.2.61](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.60...cc-v1.2.61) - 2026-04-24 + +### Other + +- fix `OutputKind::Capture` documentation ([#1705](https://github.com/rust-lang/cc-rs/pull/1705)) + ## [1.2.60](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.59...cc-v1.2.60) - 2026-04-10 ### Fixed diff --git a/cc-1.2.60/Cargo.lock b/cc-1.2.62/Cargo.lock similarity index 95% rename from cc-1.2.60/Cargo.lock rename to cc-1.2.62/Cargo.lock index 03d0b52cdf..611989da9e 100644 --- a/cc-1.2.60/Cargo.lock +++ b/cc-1.2.62/Cargo.lock @@ -10,13 +10,13 @@ checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] name = "bitflags" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" [[package]] name = "cc" -version = "1.2.60" +version = "1.2.62" dependencies = [ "find-msvc-tools", "jobserver", @@ -153,9 +153,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.184" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "linux-raw-sys" @@ -326,11 +326,11 @@ checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "wasip2" -version = "1.0.2+wasi-0.2.9" +version = "1.0.3+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" dependencies = [ - "wit-bindgen", + "wit-bindgen 0.57.1", ] [[package]] @@ -339,7 +339,7 @@ version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ - "wit-bindgen", + "wit-bindgen 0.51.0", ] [[package]] @@ -400,6 +400,12 @@ dependencies = [ "wit-bindgen-rust-macro", ] +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + [[package]] name = "wit-bindgen-core" version = "0.51.0" diff --git a/cc-1.2.60/Cargo.toml b/cc-1.2.62/Cargo.toml similarity index 98% rename from cc-1.2.60/Cargo.toml rename to cc-1.2.62/Cargo.toml index 81febe3ed0..673bcd45c7 100644 --- a/cc-1.2.60/Cargo.toml +++ b/cc-1.2.62/Cargo.toml @@ -13,7 +13,7 @@ edition = "2018" rust-version = "1.63" name = "cc" -version = "1.2.60" +version = "1.2.62" authors = ["Alex Crichton "] build = false exclude = [ diff --git a/cc-1.2.60/Cargo.toml.orig b/cc-1.2.62/Cargo.toml.orig similarity index 98% rename from cc-1.2.60/Cargo.toml.orig rename to cc-1.2.62/Cargo.toml.orig index 414dbd636a..35890682e3 100644 --- a/cc-1.2.60/Cargo.toml.orig +++ b/cc-1.2.62/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "cc" -version = "1.2.60" +version = "1.2.62" authors = ["Alex Crichton "] license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/cc-rs" diff --git a/cc-1.2.60/LICENSE-APACHE b/cc-1.2.62/LICENSE-APACHE similarity index 100% rename from cc-1.2.60/LICENSE-APACHE rename to cc-1.2.62/LICENSE-APACHE diff --git a/cc-1.2.60/LICENSE-MIT b/cc-1.2.62/LICENSE-MIT similarity index 100% rename from cc-1.2.60/LICENSE-MIT rename to cc-1.2.62/LICENSE-MIT diff --git a/cc-1.2.60/README.md b/cc-1.2.62/README.md similarity index 100% rename from cc-1.2.60/README.md rename to cc-1.2.62/README.md diff --git a/cc-1.2.60/clippy.toml b/cc-1.2.62/clippy.toml similarity index 100% rename from cc-1.2.60/clippy.toml rename to cc-1.2.62/clippy.toml diff --git a/cc-1.2.60/src/command_helpers.rs b/cc-1.2.62/src/command_helpers.rs similarity index 99% rename from cc-1.2.60/src/command_helpers.rs rename to cc-1.2.62/src/command_helpers.rs index 547943b426..57c49f434e 100644 --- a/cc-1.2.60/src/command_helpers.rs +++ b/cc-1.2.62/src/command_helpers.rs @@ -34,7 +34,7 @@ pub(crate) enum OutputKind { Forward, /// Discard the output ([`Stdio::null()`]) Discard, - /// Capture the result (`[Stdio::piped()`]) + /// Capture the result ([`Stdio::piped()`]) Capture, } diff --git a/cc-1.2.60/src/detect_compiler_family.c b/cc-1.2.62/src/detect_compiler_family.c similarity index 100% rename from cc-1.2.60/src/detect_compiler_family.c rename to cc-1.2.62/src/detect_compiler_family.c diff --git a/cc-1.2.60/src/flags.rs b/cc-1.2.62/src/flags.rs similarity index 100% rename from cc-1.2.60/src/flags.rs rename to cc-1.2.62/src/flags.rs diff --git a/cc-1.2.60/src/lib.rs b/cc-1.2.62/src/lib.rs similarity index 99% rename from cc-1.2.60/src/lib.rs rename to cc-1.2.62/src/lib.rs index f2c4194771..5afd420de3 100644 --- a/cc-1.2.60/src/lib.rs +++ b/cc-1.2.62/src/lib.rs @@ -2161,15 +2161,6 @@ impl Build { cmd.push_cc_arg("-fno-plt".into()); } } - if target.arch == "wasm32" || target.arch == "wasm64" { - // WASI does not support exceptions yet. - // https://github.com/WebAssembly/exception-handling - // - // `rustc` also defaults to (currently) disable exceptions - // on all WASM targets: - // - cmd.push_cc_arg("-fno-exceptions".into()); - } if target.os == "wasi" { // Link clang sysroot @@ -3611,6 +3602,7 @@ impl Build { "aarch64-unknown-helenos" => Some("aarch64-helenos"), "aarch64-unknown-linux-gnu" => Some("aarch64-linux-gnu"), "aarch64-unknown-linux-musl" => Some("aarch64-linux-musl"), + "aarch64-unknown-linux-relibc" => Some("aarch64-linux-relibc"), "aarch64-unknown-netbsd" => Some("aarch64--netbsd"), "arm-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"), "armv4t-unknown-linux-gnueabi" => Some("arm-linux-gnueabi"), @@ -3741,6 +3733,9 @@ impl Build { "x86_64-unknown-linux-musl" => { self.find_working_gnu_prefix(&["x86_64-linux-musl", "musl"]) } + "x86_64-unknown-linux-relibc" => { + self.find_working_gnu_prefix(&["x86_64-linux-relibc", "relibc"]) + } "x86_64-unknown-netbsd" => Some("x86_64--netbsd"), "xtensa-esp32-espidf" | "xtensa-esp32-none-elf" diff --git a/cc-1.2.60/src/parallel/async_executor.rs b/cc-1.2.62/src/parallel/async_executor.rs similarity index 100% rename from cc-1.2.60/src/parallel/async_executor.rs rename to cc-1.2.62/src/parallel/async_executor.rs diff --git a/cc-1.2.60/src/parallel/command_runner.rs b/cc-1.2.62/src/parallel/command_runner.rs similarity index 100% rename from cc-1.2.60/src/parallel/command_runner.rs rename to cc-1.2.62/src/parallel/command_runner.rs diff --git a/cc-1.2.60/src/parallel/job_token.rs b/cc-1.2.62/src/parallel/job_token.rs similarity index 100% rename from cc-1.2.60/src/parallel/job_token.rs rename to cc-1.2.62/src/parallel/job_token.rs diff --git a/cc-1.2.60/src/parallel/mod.rs b/cc-1.2.62/src/parallel/mod.rs similarity index 100% rename from cc-1.2.60/src/parallel/mod.rs rename to cc-1.2.62/src/parallel/mod.rs diff --git a/cc-1.2.60/src/parallel/stderr.rs b/cc-1.2.62/src/parallel/stderr.rs similarity index 100% rename from cc-1.2.60/src/parallel/stderr.rs rename to cc-1.2.62/src/parallel/stderr.rs diff --git a/cc-1.2.60/src/target.rs b/cc-1.2.62/src/target.rs similarity index 100% rename from cc-1.2.60/src/target.rs rename to cc-1.2.62/src/target.rs diff --git a/cc-1.2.60/src/target/apple.rs b/cc-1.2.62/src/target/apple.rs similarity index 100% rename from cc-1.2.60/src/target/apple.rs rename to cc-1.2.62/src/target/apple.rs diff --git a/cc-1.2.60/src/target/generated.rs b/cc-1.2.62/src/target/generated.rs similarity index 99% rename from cc-1.2.60/src/target/generated.rs rename to cc-1.2.62/src/target/generated.rs index e1db88067d..cab775bb53 100644 --- a/cc-1.2.60/src/target/generated.rs +++ b/cc-1.2.62/src/target/generated.rs @@ -270,7 +270,7 @@ pub(crate) const LLVM_TARGETS: &[(&str, &str)] = &[ ("thumbv8r-none-eabihf", "thumbv8r-none-eabihf"), ("wasm32-unknown-emscripten", "wasm32-unknown-emscripten"), ("wasm32-unknown-unknown", "wasm32-unknown-unknown"), - ("wasm32-wali-linux-musl", "wasm32-wasi"), + ("wasm32-wali-linux-musl", "wasm32-linux-muslwali"), ("wasm32-wasi", "wasm32-wasi"), ("wasm32-wasip1", "wasm32-wasip1"), ("wasm32-wasip1-threads", "wasm32-wasi"), diff --git a/cc-1.2.60/src/target/llvm.rs b/cc-1.2.62/src/target/llvm.rs similarity index 100% rename from cc-1.2.60/src/target/llvm.rs rename to cc-1.2.62/src/target/llvm.rs diff --git a/cc-1.2.60/src/target/parser.rs b/cc-1.2.62/src/target/parser.rs similarity index 99% rename from cc-1.2.60/src/target/parser.rs rename to cc-1.2.62/src/target/parser.rs index 7231d10ef5..ff7fa50471 100644 --- a/cc-1.2.60/src/target/parser.rs +++ b/cc-1.2.62/src/target/parser.rs @@ -168,6 +168,7 @@ fn parse_arch(full_arch: &str) -> Option<&str> { arch if arch.starts_with("nvptx") => "nvptx", arch if arch.starts_with("bpf") => "bpf", // bpfeb | bpfel + arch if arch.starts_with("sh4") => "sh4", // sh4 | sh4-unknown-linux-gnu | sh4-unknown-redox // https://github.com/bytecodealliance/wasmtime/tree/v30.0.1/pulley arch if arch.starts_with("pulley64") => "pulley64", @@ -231,6 +232,7 @@ fn parse_envabi(last_component: &str) -> Option<(&str, &str)> { "sgx" => ("sgx", ""), "threads" => ("threads", ""), "mlibc" => ("mlibc", ""), + "relibc" => ("relibc", ""), // ABIs "abi64" => ("", "abi64"), diff --git a/cc-1.2.60/src/tempfile.rs b/cc-1.2.62/src/tempfile.rs similarity index 100% rename from cc-1.2.60/src/tempfile.rs rename to cc-1.2.62/src/tempfile.rs diff --git a/cc-1.2.60/src/tool.rs b/cc-1.2.62/src/tool.rs similarity index 100% rename from cc-1.2.60/src/tool.rs rename to cc-1.2.62/src/tool.rs diff --git a/cc-1.2.60/src/utilities.rs b/cc-1.2.62/src/utilities.rs similarity index 100% rename from cc-1.2.60/src/utilities.rs rename to cc-1.2.62/src/utilities.rs diff --git a/clap_complete-4.6.2/.cargo-checksum.json b/clap_complete-4.6.2/.cargo-checksum.json deleted file mode 100644 index 544650e6c0..0000000000 --- a/clap_complete-4.6.2/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{".cargo_vcs_info.json":"8a8d49e77b0dd520e1f9d07675785d18d7268f00c59befa4f4b5cf5bcb2e0fa3","Cargo.lock":"4694f30cde0141e2f18a6113b28e53a5657ebc08fb180e37069ddba8e960a61c","Cargo.toml":"dd5952c3365f05240c38be39699dd17761ddbb56bf24a2c99c2a04559f06a6cc","Cargo.toml.orig":"2c335522f3bff9c14f8e50114f2ceb27da293dfbcd1ccf21ef4ccd6791ceaf72","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"6efb0476a1cc085077ed49357026d8c173bf33017278ef440f222fb9cbcb66e6","README.md":"b0ca49e6d97f35e31cdf7739633d729ae6da6065c2f6768b50c5c2ac16410f82","examples/completion-derive.rs":"4893083919a54252ffdf54239a3335fe71c03fc05c2c274d773255d2f51b4234","examples/completion.rs":"51a8fb7954b1a0556e185655d9c4d47825f62244266c007ef9ccd62e84d9b3bc","examples/dynamic.rs":"295c0e6b51155bcab3924d7c774283b8baeb6ec93184295426844b612578eb29","examples/exhaustive.rs":"27bea2d94b30bbf9729b1c3ed86f8b5fba38018c944b037ff371b14234eeeab0","src/aot/generator/mod.rs":"a75292daf9cac79fcdf376cbb0fc49a1d34fad5721f1eb4e35b987b67fb2a4e2","src/aot/generator/utils.rs":"dcc06ad3b16575818c7213a634cf20fd87c77f3cc7d7acad13ba067d4bbfb0a2","src/aot/mod.rs":"b173a23f43e59d0095814c837f7af3b832c665e49db0a2a136a43c8b2c810ce8","src/aot/shells/bash.rs":"978640672618bbb8550aff912c986b2dfb5f58b67bb3d7310192ddac9d6ef784","src/aot/shells/elvish.rs":"409deb684511c3b4f24f49c3114c89e0ddb713662ed774b3327abe195e494893","src/aot/shells/fish.rs":"c052c3216f1a9228114c6afaf4c38eb0b23102040973de8a834f99b2c0525cc5","src/aot/shells/mod.rs":"002352299be1ece75540e7b1502120590f4635f69a925b19484d272bd5491505","src/aot/shells/powershell.rs":"2eaafb935aef85461646f54a232540ced68cb19944b26d201f80a930091a499b","src/aot/shells/shell.rs":"ff49f719c1b07cac22234d4ee7b640aaa010be588d8372997f35fa64cd7cb26d","src/aot/shells/zsh.rs":"33be209a53d0c794100049f16a99ba61010b95dce05a020dfd4d77a3ed038a5c","src/engine/candidate.rs":"7da2172bcbee45f0c6281738d81e75c0c7d571b2c3c205a30ac419cb102cd078","src/engine/complete.rs":"caefd6dd03093ab670e3e1f031939d09ba633003cf801c3e1aff9dd2f59ee204","src/engine/custom.rs":"43fa3a6a6ebc2ca3ea1186289aa2dfbfa642f43306ac09afa378794cd7787605","src/engine/mod.rs":"ae834d8a460f51e76d5938775930fb8c37c1c4021fc82081ed3cfe030234efee","src/env/mod.rs":"d0132da23ef7bcbc9e2aacbf0ade8e0d3bb1016efc5bc9b141e23aa3452b5d82","src/env/shells.rs":"3e2cdd4408b4aaf5809cbe3af253ddadb9606b314bae18f85e5b9824b9f0e653","src/lib.rs":"083c5b958db79384aa0d35e57d0554b964de207936560350996219a69b1be374","src/macros.rs":"c6d771067cfae00ed78d128f408944fbab35bfd80d8458e18a833e38d73e0c03"},"package":"3ff7a1dccbdd8b078c2bdebff47e404615151534d5043da397ec50286816f9cb"} \ No newline at end of file diff --git a/clap_complete-4.6.2/.cargo_vcs_info.json b/clap_complete-4.6.2/.cargo_vcs_info.json deleted file mode 100644 index c954162308..0000000000 --- a/clap_complete-4.6.2/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "0fe0be302726f4253b9bee27eed48438c92917aa" - }, - "path_in_vcs": "clap_complete" -} \ No newline at end of file diff --git a/clap_complete-4.6.5/.cargo-checksum.json b/clap_complete-4.6.5/.cargo-checksum.json new file mode 100644 index 0000000000..5cd64fbcb9 --- /dev/null +++ b/clap_complete-4.6.5/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"555317d9da8de9d20d4721c3cda59864f2ddb213e558d99d90d1d75cf6d03b65","Cargo.lock":"20486cf5723b980f08d22f3ca15f519dd92746207087e7cdc647d663a0d11dce","Cargo.toml":"9e7729e650baa00b777adac6e4a783f1b247efe4eeb4a5838bf80644f581d26e","Cargo.toml.orig":"5a9de01359a55306d35ae01fbc4e908d755455fc5ebfa8c8928168db70565db5","LICENSE-APACHE":"c6596eb7be8581c18be736c846fb9173b69eccf6ef94c5135893ec56bd92ba08","LICENSE-MIT":"6efb0476a1cc085077ed49357026d8c173bf33017278ef440f222fb9cbcb66e6","README.md":"81895bd657e87cb393a95998d6c17db4fc40631bf6bb54d320c4a4233bae9468","examples/completion-derive.rs":"e3fe06cb39faa5c3c4d46aeb7faab83680702cbf6d0084eac682a8722ef1d88b","examples/completion.rs":"a6a4fd141dd2e339d5fc7f3f80b4825eee18f51f7bcb4a2123ddc2b3c942bb28","examples/dynamic.rs":"295c0e6b51155bcab3924d7c774283b8baeb6ec93184295426844b612578eb29","examples/exhaustive.rs":"fb7279ed457875be2d30f7a938e4cfe4e9cb41b6325b6596f3360428954a5fbb","src/aot/generator/mod.rs":"a75292daf9cac79fcdf376cbb0fc49a1d34fad5721f1eb4e35b987b67fb2a4e2","src/aot/generator/utils.rs":"40365e7d748293f51ac25449c56c3088f5bc92fe7802865903e111ab45a605e6","src/aot/mod.rs":"b173a23f43e59d0095814c837f7af3b832c665e49db0a2a136a43c8b2c810ce8","src/aot/shells/bash.rs":"c61f5d6e0bb64cbf6cf89320f19856e8144174339eef513d5b3815edf2caac88","src/aot/shells/elvish.rs":"875868b3c8e5e20276fca7f2b45c6bad01592f826e90ea11c7a5f630b945a499","src/aot/shells/fish.rs":"4a6fb932f3db3363a2cbc2a7c7956342992913125b83e09c21a2d88238594670","src/aot/shells/mod.rs":"002352299be1ece75540e7b1502120590f4635f69a925b19484d272bd5491505","src/aot/shells/powershell.rs":"db202dba067bc3ce2138eb79fff64a5beee7ba563214812dfbaeaf04371e1bae","src/aot/shells/shell.rs":"ff49f719c1b07cac22234d4ee7b640aaa010be588d8372997f35fa64cd7cb26d","src/aot/shells/zsh.rs":"aaa901f2a8d7ad1ed89f0bc400436b7fd981424e6de50a4d78ce848a2c418c2f","src/engine/candidate.rs":"7da2172bcbee45f0c6281738d81e75c0c7d571b2c3c205a30ac419cb102cd078","src/engine/complete.rs":"72e3d3d69babf94b9a772bff8ad603e09d5fd9f974bb0e40ec05d6eaae22fdd6","src/engine/custom.rs":"24c5ce91957114edd5a5c8180be01853583fc586480b96554e28bab49bb2d1a4","src/engine/mod.rs":"ae834d8a460f51e76d5938775930fb8c37c1c4021fc82081ed3cfe030234efee","src/env/mod.rs":"d0132da23ef7bcbc9e2aacbf0ade8e0d3bb1016efc5bc9b141e23aa3452b5d82","src/env/shells.rs":"992d0614e61aabc25f465a36a574e27ed860ac371a96e50f2767151238690550","src/lib.rs":"083c5b958db79384aa0d35e57d0554b964de207936560350996219a69b1be374","src/macros.rs":"c6d771067cfae00ed78d128f408944fbab35bfd80d8458e18a833e38d73e0c03"},"package":"e0a7a9bfdb35811f9e59832f0f05975114d2251b415fb534108e6f34060fd772"} \ No newline at end of file diff --git a/clap_complete-4.6.5/.cargo_vcs_info.json b/clap_complete-4.6.5/.cargo_vcs_info.json new file mode 100644 index 0000000000..1ef132be73 --- /dev/null +++ b/clap_complete-4.6.5/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "c8c935504a3f1a015470199ae82c3cb124b5b1d5" + }, + "path_in_vcs": "clap_complete" +} \ No newline at end of file diff --git a/clap_complete-4.6.2/Cargo.lock b/clap_complete-4.6.5/Cargo.lock similarity index 99% rename from clap_complete-4.6.2/Cargo.lock rename to clap_complete-4.6.5/Cargo.lock index a63f127e1a..9755e81bda 100644 --- a/clap_complete-4.6.2/Cargo.lock +++ b/clap_complete-4.6.5/Cargo.lock @@ -146,7 +146,7 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.6.2" +version = "4.6.5" dependencies = [ "automod", "clap", @@ -638,9 +638,9 @@ checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" [[package]] name = "snapbox" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9a4b69d5b4116a26b662c0bb38895261da3f3bfc171657d66a2a3c7a41e929" +checksum = "f92ac911648d788a6435401d9b4803959039d4de9919fdabdb415a8bebd027be" dependencies = [ "anstream", "anstyle", diff --git a/clap_complete-4.6.2/Cargo.toml b/clap_complete-4.6.5/Cargo.toml similarity index 98% rename from clap_complete-4.6.2/Cargo.toml rename to clap_complete-4.6.5/Cargo.toml index 7fb0d220ff..25d95032ab 100644 --- a/clap_complete-4.6.2/Cargo.toml +++ b/clap_complete-4.6.5/Cargo.toml @@ -13,7 +13,7 @@ edition = "2024" rust-version = "1.85" name = "clap_complete" -version = "4.6.2" +version = "4.6.5" build = false include = [ "build.rs", @@ -230,6 +230,8 @@ result_large_err = "allow" same_functions_in_if_condition = "warn" self_named_module_files = "warn" semicolon_if_nothing_returned = "warn" +str_to_string = "warn" +string_add = "warn" string_add_assign = "warn" string_lit_as_bytes = "warn" todo = "warn" diff --git a/clap_complete-4.6.2/Cargo.toml.orig b/clap_complete-4.6.5/Cargo.toml.orig similarity index 99% rename from clap_complete-4.6.2/Cargo.toml.orig rename to clap_complete-4.6.5/Cargo.toml.orig index 027969fc43..253e422d97 100644 --- a/clap_complete-4.6.2/Cargo.toml.orig +++ b/clap_complete-4.6.5/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "clap_complete" -version = "4.6.2" +version = "4.6.5" description = "Generate shell completion scripts for your clap::Command" categories = ["command-line-interface"] keywords = [ diff --git a/clap_complete-4.6.2/LICENSE-APACHE b/clap_complete-4.6.5/LICENSE-APACHE similarity index 100% rename from clap_complete-4.6.2/LICENSE-APACHE rename to clap_complete-4.6.5/LICENSE-APACHE diff --git a/clap_complete-4.6.2/LICENSE-MIT b/clap_complete-4.6.5/LICENSE-MIT similarity index 100% rename from clap_complete-4.6.2/LICENSE-MIT rename to clap_complete-4.6.5/LICENSE-MIT diff --git a/clap_complete-4.6.2/README.md b/clap_complete-4.6.5/README.md similarity index 89% rename from clap_complete-4.6.2/README.md rename to clap_complete-4.6.5/README.md index 6890cb3667..0256750f27 100644 --- a/clap_complete-4.6.2/README.md +++ b/clap_complete-4.6.5/README.md @@ -5,16 +5,16 @@ [![Crates.io](https://img.shields.io/crates/v/clap_complete?style=flat-square)](https://crates.io/crates/clap_complete) [![Crates.io](https://img.shields.io/crates/d/clap_complete?style=flat-square)](https://crates.io/crates/clap_complete) -[![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_complete-v4.6.2/LICENSE-APACHE) -[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_complete-v4.6.2/LICENSE-MIT) +[![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_complete-v4.6.5/LICENSE-APACHE) +[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/clap-rs/clap/blob/clap_complete-v4.6.5/LICENSE-MIT) Dual-licensed under [Apache 2.0](LICENSE-APACHE) or [MIT](LICENSE-MIT). 1. [About](#about) 2. [API Reference](https://docs.rs/clap_complete) 3. [Questions & Discussions](https://github.com/clap-rs/clap/discussions) -4. [CONTRIBUTING](https://github.com/clap-rs/clap/blob/clap_complete-v4.6.2/clap_complete/CONTRIBUTING.md) -5. [Sponsors](https://github.com/clap-rs/clap/blob/clap_complete-v4.6.2/README.md#sponsors) +4. [CONTRIBUTING](https://github.com/clap-rs/clap/blob/clap_complete-v4.6.5/clap_complete/CONTRIBUTING.md) +5. [Sponsors](https://github.com/clap-rs/clap/blob/clap_complete-v4.6.5/README.md#sponsors) ## About diff --git a/clap_complete-4.6.2/examples/completion-derive.rs b/clap_complete-4.6.5/examples/completion-derive.rs similarity index 95% rename from clap_complete-4.6.2/examples/completion-derive.rs rename to clap_complete-4.6.5/examples/completion-derive.rs index e9a02e508c..e66c56086c 100644 --- a/clap_complete-4.6.2/examples/completion-derive.rs +++ b/clap_complete-4.6.5/examples/completion-derive.rs @@ -67,12 +67,7 @@ struct ValueHintOpt { } fn print_completions(generator: G, cmd: &mut Command) { - generate( - generator, - cmd, - cmd.get_name().to_string(), - &mut io::stdout(), - ); + generate(generator, cmd, cmd.get_name().to_owned(), &mut io::stdout()); } fn main() { diff --git a/clap_complete-4.6.2/examples/completion.rs b/clap_complete-4.6.5/examples/completion.rs similarity index 96% rename from clap_complete-4.6.2/examples/completion.rs rename to clap_complete-4.6.5/examples/completion.rs index 14f189adf8..5a0fc1b667 100644 --- a/clap_complete-4.6.2/examples/completion.rs +++ b/clap_complete-4.6.5/examples/completion.rs @@ -95,12 +95,7 @@ fn build_cli() -> Command { } fn print_completions(generator: G, cmd: &mut Command) { - generate( - generator, - cmd, - cmd.get_name().to_string(), - &mut io::stdout(), - ); + generate(generator, cmd, cmd.get_name().to_owned(), &mut io::stdout()); } fn main() { diff --git a/clap_complete-4.6.2/examples/dynamic.rs b/clap_complete-4.6.5/examples/dynamic.rs similarity index 100% rename from clap_complete-4.6.2/examples/dynamic.rs rename to clap_complete-4.6.5/examples/dynamic.rs diff --git a/clap_complete-4.6.2/examples/exhaustive.rs b/clap_complete-4.6.5/examples/exhaustive.rs similarity index 99% rename from clap_complete-4.6.2/examples/exhaustive.rs rename to clap_complete-4.6.5/examples/exhaustive.rs index e8cb525690..7db956e50d 100644 --- a/clap_complete-4.6.2/examples/exhaustive.rs +++ b/clap_complete-4.6.5/examples/exhaustive.rs @@ -23,7 +23,7 @@ fn print_completions(generator: G, cmd: &mut clap::Command) { generate( generator, cmd, - cmd.get_name().to_string(), + cmd.get_name().to_owned(), &mut std::io::stdout(), ); } diff --git a/clap_complete-4.6.2/src/aot/generator/mod.rs b/clap_complete-4.6.5/src/aot/generator/mod.rs similarity index 100% rename from clap_complete-4.6.2/src/aot/generator/mod.rs rename to clap_complete-4.6.5/src/aot/generator/mod.rs diff --git a/clap_complete-4.6.2/src/aot/generator/utils.rs b/clap_complete-4.6.5/src/aot/generator/utils.rs similarity index 86% rename from clap_complete-4.6.2/src/aot/generator/utils.rs rename to clap_complete-4.6.5/src/aot/generator/utils.rs index da5a4d8a98..99609d9d46 100644 --- a/clap_complete-4.6.2/src/aot/generator/utils.rs +++ b/clap_complete-4.6.5/src/aot/generator/utils.rs @@ -51,14 +51,14 @@ pub fn subcommands(p: &Command) -> Vec<(String, String)> { sc.get_name(), sc_bin_name ); - subcmds.push((sc.get_name().to_string(), sc_bin_name.to_string())); + subcmds.push((sc.get_name().to_owned(), sc_bin_name.to_owned())); for alias in sc.get_visible_aliases() { debug!( "subcommands:iter: alias={}, bin_name={}", alias, sc_bin_name ); - subcmds.push((alias.to_string(), sc_bin_name.to_string())); + subcmds.push((alias.to_owned(), sc_bin_name.to_owned())); } } @@ -103,12 +103,12 @@ pub fn longs_and_visible_aliases(p: &Command) -> Vec { .get_visible_aliases() .unwrap() .into_iter() - .map(|s| s.to_string()) + .map(|s| s.to_owned()) .collect(); - visible_aliases.push(a.get_long().unwrap().to_string()); + visible_aliases.push(a.get_long().unwrap().to_owned()); Some(visible_aliases) } else if a.get_visible_aliases().is_none() && a.get_long().is_some() { - Some(vec![a.get_long().unwrap().to_string()]) + Some(vec![a.get_long().unwrap().to_owned()]) } else { None } @@ -185,9 +185,9 @@ mod tests { assert_eq!( subcommands(&cmd), vec![ - ("test".to_string(), "my-cmd test".to_string()), - ("hello".to_string(), "my-cmd hello".to_string()), - ("help".to_string(), "my-cmd help".to_string()), + ("test".to_owned(), "my-cmd test".to_owned()), + ("hello".to_owned(), "my-cmd hello".to_owned()), + ("help".to_owned(), "my-cmd help".to_owned()), ] ); } @@ -199,17 +199,17 @@ mod tests { assert_eq!( all_subcommands(&cmd), vec![ - ("test".to_string(), "my-cmd test".to_string()), - ("hello".to_string(), "my-cmd hello".to_string()), - ("help".to_string(), "my-cmd help".to_string()), - ("config".to_string(), "my-cmd test config".to_string()), - ("help".to_string(), "my-cmd test help".to_string()), - ("config".to_string(), "my-cmd test help config".to_string()), - ("help".to_string(), "my-cmd test help help".to_string()), - ("test".to_string(), "my-cmd help test".to_string()), - ("hello".to_string(), "my-cmd help hello".to_string()), - ("help".to_string(), "my-cmd help help".to_string()), - ("config".to_string(), "my-cmd help test config".to_string()), + ("test".to_owned(), "my-cmd test".to_owned()), + ("hello".to_owned(), "my-cmd hello".to_owned()), + ("help".to_owned(), "my-cmd help".to_owned()), + ("config".to_owned(), "my-cmd test config".to_owned()), + ("help".to_owned(), "my-cmd test help".to_owned()), + ("config".to_owned(), "my-cmd test help config".to_owned()), + ("help".to_owned(), "my-cmd test help help".to_owned()), + ("test".to_owned(), "my-cmd help test".to_owned()), + ("hello".to_owned(), "my-cmd help hello".to_owned()), + ("help".to_owned(), "my-cmd help help".to_owned()), + ("config".to_owned(), "my-cmd help test config".to_owned()), ] ); } diff --git a/clap_complete-4.6.2/src/aot/mod.rs b/clap_complete-4.6.5/src/aot/mod.rs similarity index 100% rename from clap_complete-4.6.2/src/aot/mod.rs rename to clap_complete-4.6.5/src/aot/mod.rs diff --git a/clap_complete-4.6.2/src/aot/shells/bash.rs b/clap_complete-4.6.5/src/aot/shells/bash.rs similarity index 86% rename from clap_complete-4.6.2/src/aot/shells/bash.rs rename to clap_complete-4.6.5/src/aot/shells/bash.rs index 9d055b5dd9..960932a0b0 100644 --- a/clap_complete-4.6.2/src/aot/shells/bash.rs +++ b/clap_complete-4.6.5/src/aot/shells/bash.rs @@ -98,19 +98,15 @@ fn all_subcommands(cmd: &Command, parent_fn_name: &str) -> String { let fn_name = format!( "{parent_fn_name}{CMD_SEP}{cmd_name}", parent_fn_name = parent_fn_name, - cmd_name = cmd.get_name().to_string().replace('-', CMD_SEP) + cmd_name = cmd.get_name().to_owned().replace('-', CMD_SEP) ); subcmds.push(( - parent_fn_name.to_string(), - cmd.get_name().to_string(), + parent_fn_name.to_owned(), + cmd.get_name().to_owned(), fn_name.clone(), )); for alias in cmd.get_visible_aliases() { - subcmds.push(( - parent_fn_name.to_string(), - alias.to_string(), - fn_name.clone(), - )); + subcmds.push((parent_fn_name.to_owned(), alias.to_owned(), fn_name.clone())); } for subcmd in cmd.get_subcommands() { add_command(&fn_name, subcmd, subcmds); @@ -192,15 +188,15 @@ fn option_details_for_path(cmd: &Command, path: &str) -> String { if o.get_value_hint() == ValueHint::FilePath { v.extend([ - "local oldifs".to_string(), - r#"if [ -n "${IFS+x}" ]; then"#.to_string(), - r#" oldifs="$IFS""#.to_string(), - "fi".to_string(), - r#"IFS=$'\n'"#.to_string(), + "local oldifs".to_owned(), + r#"if [ -n "${IFS+x}" ]; then"#.to_owned(), + r#" oldifs="$IFS""#.to_owned(), + "fi".to_owned(), + r#"IFS=$'\n'"#.to_owned(), format!("COMPREPLY=({})", vals_for(o)), - r#"if [ -n "${oldifs+x}" ]; then"#.to_string(), - r#" IFS="$oldifs""#.to_string(), - "fi".to_string(), + r#"if [ -n "${oldifs+x}" ]; then"#.to_owned(), + r#" IFS="$oldifs""#.to_owned(), + "fi".to_owned(), ]); } else { v.push(format!("COMPREPLY=({})", vals_for(o))); @@ -208,13 +204,13 @@ fn option_details_for_path(cmd: &Command, path: &str) -> String { if let Some(copt) = compopt { v.extend([ - r#"if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then"#.to_string(), + r#"if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then"#.to_owned(), format!(" {copt}"), - "fi".to_string(), + "fi".to_owned(), ]); } - v.extend(["return 0", ";;"].iter().map(|s| (*s).to_string())); + v.extend(["return 0", ";;"].iter().map(|s| (*s).to_owned())); v.join("\n ") })); } @@ -225,15 +221,15 @@ fn option_details_for_path(cmd: &Command, path: &str) -> String { if o.get_value_hint() == ValueHint::FilePath { v.extend([ - "local oldifs".to_string(), - r#"if [ -n "${IFS+x}" ]; then"#.to_string(), - r#" oldifs="$IFS""#.to_string(), - "fi".to_string(), - r#"IFS=$'\n'"#.to_string(), + "local oldifs".to_owned(), + r#"if [ -n "${IFS+x}" ]; then"#.to_owned(), + r#" oldifs="$IFS""#.to_owned(), + "fi".to_owned(), + r#"IFS=$'\n'"#.to_owned(), format!("COMPREPLY=({})", vals_for(o)), - r#"if [ -n "${oldifs+x}" ]; then"#.to_string(), - r#" IFS="$oldifs""#.to_string(), - "fi".to_string(), + r#"if [ -n "${oldifs+x}" ]; then"#.to_owned(), + r#" IFS="$oldifs""#.to_owned(), + "fi".to_owned(), ]); } else { v.push(format!("COMPREPLY=({})", vals_for(o))); @@ -241,13 +237,13 @@ fn option_details_for_path(cmd: &Command, path: &str) -> String { if let Some(copt) = compopt { v.extend([ - r#"if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then"#.to_string(), + r#"if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then"#.to_owned(), format!(" {copt}"), - "fi".to_string(), + "fi".to_owned(), ]); } - v.extend(["return 0", ";;"].iter().map(|s| (*s).to_string())); + v.extend(["return 0", ";;"].iter().map(|s| (*s).to_owned())); v.join("\n ") })); } diff --git a/clap_complete-4.6.2/src/aot/shells/elvish.rs b/clap_complete-4.6.5/src/aot/shells/elvish.rs similarity index 98% rename from clap_complete-4.6.2/src/aot/shells/elvish.rs rename to clap_complete-4.6.5/src/aot/shells/elvish.rs index cc8df36aa9..ce2e78aeb4 100644 --- a/clap_complete-4.6.2/src/aot/shells/elvish.rs +++ b/clap_complete-4.6.5/src/aot/shells/elvish.rs @@ -72,7 +72,7 @@ fn generate_inner(p: &Command, previous_command_name: &str) -> String { debug!("generate_inner"); let command_names = if previous_command_name.is_empty() { - vec![p.get_bin_name().expect(INTERNAL_ERROR_MSG).to_string()] + vec![p.get_bin_name().expect(INTERNAL_ERROR_MSG).to_owned()] } else { p.get_name_and_visible_aliases() .into_iter() diff --git a/clap_complete-4.6.2/src/aot/shells/fish.rs b/clap_complete-4.6.5/src/aot/shells/fish.rs similarity index 99% rename from clap_complete-4.6.2/src/aot/shells/fish.rs rename to clap_complete-4.6.5/src/aot/shells/fish.rs index 27d33e5f57..c4c3038330 100644 --- a/clap_complete-4.6.2/src/aot/shells/fish.rs +++ b/clap_complete-4.6.5/src/aot/shells/fish.rs @@ -276,7 +276,7 @@ fn gen_subcommand_helpers( fn value_completion(option: &Arg) -> String { if !option.get_num_args().expect("built").takes_values() { - return "".to_string(); + return "".to_owned(); } if let Some(data) = utils::possible_values(option) { @@ -316,6 +316,6 @@ fn value_completion(option: &Arg) -> String { // Disable completion for others _ => " -r -f", } - .to_string() + .to_owned() } } diff --git a/clap_complete-4.6.2/src/aot/shells/mod.rs b/clap_complete-4.6.5/src/aot/shells/mod.rs similarity index 100% rename from clap_complete-4.6.2/src/aot/shells/mod.rs rename to clap_complete-4.6.5/src/aot/shells/mod.rs diff --git a/clap_complete-4.6.2/src/aot/shells/powershell.rs b/clap_complete-4.6.5/src/aot/shells/powershell.rs similarity index 98% rename from clap_complete-4.6.2/src/aot/shells/powershell.rs rename to clap_complete-4.6.5/src/aot/shells/powershell.rs index a7191c0c19..49f2eabaa3 100644 --- a/clap_complete-4.6.2/src/aot/shells/powershell.rs +++ b/clap_complete-4.6.5/src/aot/shells/powershell.rs @@ -80,7 +80,7 @@ fn generate_inner(p: &Command, previous_command_name: &str) -> String { debug!("generate_inner"); let command_names = if previous_command_name.is_empty() { - vec![p.get_bin_name().expect(INTERNAL_ERROR_MSG).to_string()] + vec![p.get_bin_name().expect(INTERNAL_ERROR_MSG).to_owned()] } else { p.get_name_and_visible_aliases() .into_iter() diff --git a/clap_complete-4.6.2/src/aot/shells/shell.rs b/clap_complete-4.6.5/src/aot/shells/shell.rs similarity index 100% rename from clap_complete-4.6.2/src/aot/shells/shell.rs rename to clap_complete-4.6.5/src/aot/shells/shell.rs diff --git a/clap_complete-4.6.2/src/aot/shells/zsh.rs b/clap_complete-4.6.5/src/aot/shells/zsh.rs similarity index 99% rename from clap_complete-4.6.2/src/aot/shells/zsh.rs rename to clap_complete-4.6.5/src/aot/shells/zsh.rs index b06f0725c4..451bb7128c 100644 --- a/clap_complete-4.6.2/src/aot/shells/zsh.rs +++ b/clap_complete-4.6.5/src/aot/shells/zsh.rs @@ -183,8 +183,8 @@ fn subcommands_of(p: &Command) -> String { // We need this to prevent weirdly formatted `command=(\n \n)` sections. // When there are no (sub-)commands. if !segments.is_empty() { - segments.insert(0, "".to_string()); - segments.push(" ".to_string()); + segments.insert(0, "".to_owned()); + segments.push(" ".to_owned()); } segments.join("\n") @@ -421,7 +421,7 @@ fn value_completion(arg: &Arg) -> Option { return None; } } - .to_string(), + .to_owned(), ) } } @@ -472,7 +472,7 @@ fn write_opts_of(p: &Command, p_global: Option<&Command>) -> String { }; let vn = match o.get_value_names() { - None => " ".to_string(), + None => " ".to_owned(), Some(val) => val[0].to_string(), }; let vc = match value_completion(o) { @@ -661,7 +661,7 @@ fn write_positionals_of(p: &Command) -> String { help = arg .get_help() .map(|s| s.to_string()) - .map(|v| " -- ".to_owned() + &v) + .map(|v| format!(" -- {v}")) .unwrap_or_else(|| "".to_owned()) .replace('[', "\\[") .replace(']', "\\]") diff --git a/clap_complete-4.6.2/src/engine/candidate.rs b/clap_complete-4.6.5/src/engine/candidate.rs similarity index 100% rename from clap_complete-4.6.2/src/engine/candidate.rs rename to clap_complete-4.6.5/src/engine/candidate.rs diff --git a/clap_complete-4.6.2/src/engine/complete.rs b/clap_complete-4.6.5/src/engine/complete.rs similarity index 96% rename from clap_complete-4.6.2/src/engine/complete.rs rename to clap_complete-4.6.5/src/engine/complete.rs index c5eff4f90c..321b3a02e7 100644 --- a/clap_complete-4.6.2/src/engine/complete.rs +++ b/clap_complete-4.6.5/src/engine/complete.rs @@ -160,7 +160,12 @@ fn complete_arg( .get_positionals() .find(|p| p.get_index() == Some(pos_index)) { - completions.extend(complete_arg_value(arg.to_value(), positional, current_dir)); + completions.extend(complete_arg_value( + arg.to_value(), + positional, + current_dir, + 0, + )); } if !is_escaped { completions.extend(complete_option(arg, cmd, current_dir)); @@ -171,7 +176,12 @@ fn complete_arg( .get_positionals() .find(|p| p.get_index() == Some(pos_index)) { - completions.extend(complete_arg_value(arg.to_value(), positional, current_dir)); + completions.extend(complete_arg_value( + arg.to_value(), + positional, + current_dir, + num_arg.saturating_sub(1), + )); if !is_escaped && positional .get_num_args() @@ -182,7 +192,12 @@ fn complete_arg( } } ParseState::Opt((opt, count)) => { - completions.extend(complete_arg_value(arg.to_value(), opt, current_dir)); + completions.extend(complete_arg_value( + arg.to_value(), + opt, + current_dir, + count.saturating_sub(1), + )); let min = opt.get_num_args().map(|r| r.min_values()).unwrap_or(0); if count > min { // Also complete this raw_arg as a positional argument, flags, options and subcommand. @@ -270,7 +285,7 @@ fn complete_option( if let Some(value) = value { if let Some(arg) = cmd.get_arguments().find(|a| a.get_long() == Some(flag)) { completions.extend( - complete_arg_value(value.to_str().ok_or(value), arg, current_dir) + complete_arg_value(value.to_str().ok_or(value), arg, current_dir, 0) .into_iter() .map(|comp| comp.add_prefix(format!("--{flag}="))), ); @@ -305,7 +320,7 @@ fn complete_option( let value = short.next_value_os().unwrap_or(OsStr::new("")); completions.extend( - complete_arg_value(value.to_str().ok_or(value), opt, current_dir) + complete_arg_value(value.to_str().ok_or(value), opt, current_dir, 0) .into_iter() .map(|comp| { let sep = if has_equal { "=" } else { "" }; @@ -328,9 +343,10 @@ fn complete_arg_value( value: Result<&str, &OsStr>, arg: &clap::Arg, current_dir: Option<&std::path::Path>, + arg_index: usize, ) -> Vec { let mut values = Vec::new(); - debug!("complete_arg_value: arg={arg:?}, value={value:?}"); + debug!("complete_arg_value: arg={arg:?}, value={value:?}, arg_index={arg_index:?}"); let (prefix, value) = rsplit_delimiter(value, arg.get_value_delimiter()).unwrap_or((None, value)); @@ -341,7 +357,7 @@ fn complete_arg_value( }; if let Some(completer) = arg.get::() { - values.extend(completer.complete(value_os)); + values.extend(completer.complete_at(arg_index, value_os)); } else if let Some(completer) = arg.get::() { values.extend(complete_custom_arg_value(value_os, completer)); } else if let Some(possible_values) = possible_values(arg) { @@ -561,9 +577,9 @@ fn subcommands(p: &clap::Command) -> Vec { .flat_map(|sc| { sc.get_name_and_visible_aliases() .into_iter() - .map(|s| populate_command_candidate(CompletionCandidate::new(s.to_string()), p, sc)) + .map(|s| populate_command_candidate(CompletionCandidate::new(s.to_owned()), p, sc)) .chain(sc.get_aliases().map(|s| { - populate_command_candidate(CompletionCandidate::new(s.to_string()), p, sc) + populate_command_candidate(CompletionCandidate::new(s.to_owned()), p, sc) .hide(true) })) }) diff --git a/clap_complete-4.6.2/src/engine/custom.rs b/clap_complete-4.6.5/src/engine/custom.rs similarity index 86% rename from clap_complete-4.6.2/src/engine/custom.rs rename to clap_complete-4.6.5/src/engine/custom.rs index 52f8117b92..adea9cd1e8 100644 --- a/clap_complete-4.6.2/src/engine/custom.rs +++ b/clap_complete-4.6.5/src/engine/custom.rs @@ -58,6 +58,22 @@ impl ArgValueCompleter { pub fn complete(&self, current: &OsStr) -> Vec { self.0.complete(current) } + + /// Candidates that match `current` at `arg_index` within the current occurrence. + /// + /// `arg_index` is the position of the value being completed within an + /// argument's [`num_args`][clap::Arg::num_args] range, starting at `0`. + /// This lets a completer return different candidates for each value of a + /// multi-value argument (for example, a remote name first and a branch + /// name second for `--set-upstream `). + /// + /// `arg_index` is unaffected by [`value_delimiter`][clap::Arg::value_delimiter]: + /// it counts shell arguments, not delimiter-separated values. + /// + /// See [`CompletionCandidate`] for more information. + pub fn complete_at(&self, arg_index: usize, current: &OsStr) -> Vec { + self.0.complete_at(arg_index, current) + } } impl std::fmt::Debug for ArgValueCompleter { @@ -76,6 +92,23 @@ pub trait ValueCompleter: Send + Sync { /// /// See [`CompletionCandidate`] for more information. fn complete(&self, current: &OsStr) -> Vec; + + /// All potential candidates for the value at `arg_index` within the current occurrence. + /// + /// `arg_index` is the position of the value being completed within an + /// argument's [`num_args`][clap::Arg::num_args] range, starting at `0`. + /// This lets a completer return different candidates for each value of a + /// multi-value argument (for example, a remote name first and a branch + /// name second for `--set-upstream `). + /// + /// `arg_index` is unaffected by [`value_delimiter`][clap::Arg::value_delimiter]: + /// it counts shell arguments, not delimiter-separated values. + /// + /// See [`CompletionCandidate`] for more information. + fn complete_at(&self, arg_index: usize, current: &OsStr) -> Vec { + let _ = arg_index; + self.complete(current) + } } impl ValueCompleter for F diff --git a/clap_complete-4.6.2/src/engine/mod.rs b/clap_complete-4.6.5/src/engine/mod.rs similarity index 100% rename from clap_complete-4.6.2/src/engine/mod.rs rename to clap_complete-4.6.5/src/engine/mod.rs diff --git a/clap_complete-4.6.2/src/env/mod.rs b/clap_complete-4.6.5/src/env/mod.rs similarity index 100% rename from clap_complete-4.6.2/src/env/mod.rs rename to clap_complete-4.6.5/src/env/mod.rs diff --git a/clap_complete-4.6.2/src/env/shells.rs b/clap_complete-4.6.5/src/env/shells.rs similarity index 78% rename from clap_complete-4.6.2/src/env/shells.rs rename to clap_complete-4.6.5/src/env/shells.rs index a46d5d439e..b3d164d829 100644 --- a/clap_complete-4.6.2/src/env/shells.rs +++ b/clap_complete-4.6.5/src/env/shells.rs @@ -213,9 +213,8 @@ impl EnvCompleter for Fish { completer: &str, buf: &mut dyn std::io::Write, ) -> Result<(), std::io::Error> { - let bin = shlex::try_quote(bin).unwrap_or(std::borrow::Cow::Borrowed(bin)); - let completer = - shlex::try_quote(completer).unwrap_or(std::borrow::Cow::Borrowed(completer)); + let bin = fish_quote(bin); + let completer = fish_quote_for_eval(completer); writeln!( buf, @@ -247,6 +246,62 @@ impl EnvCompleter for Fish { } } +/// Quote `s` for embedding inside fish's `--arguments` value. +/// +/// Fish parses `--arguments` twice: once when sourcing the registration (the +/// outer double-quoted string) and again when evaluating the embedded command +/// substitution at completion time. Each special character must therefore +/// survive two rounds of unescaping, which is what this helper does that +/// [`fish_quote`] does not. +fn fish_quote_for_eval(s: &str) -> std::borrow::Cow<'_, str> { + if !fish_needs_quoting(s) { + return std::borrow::Cow::Borrowed(s); + } + let mut out = String::with_capacity(s.len() + 2); + out.push('\''); + for c in s.chars() { + match c { + '\\' => out.push_str(r"\\\\"), + '\'' => out.push_str(r"\\'"), + '"' => out.push_str(r#"\""#), + '$' => out.push_str(r"\$"), + _ => out.push(c), + } + } + out.push('\''); + std::borrow::Cow::Owned(out) +} + +/// Quote `s` for fish's first-pass parser. +/// +/// Used for the `--command` value, where fish reads the token once when +/// sourcing the registration and never re-evaluates it. Single-quoting plus +/// escaping `\` and `'` is sufficient. +fn fish_quote(s: &str) -> std::borrow::Cow<'_, str> { + if !fish_needs_quoting(s) { + return std::borrow::Cow::Borrowed(s); + } + let mut out = String::with_capacity(s.len() + 2); + out.push('\''); + for c in s.chars() { + match c { + '\\' => out.push_str(r"\\"), + '\'' => out.push_str(r"\'"), + _ => out.push(c), + } + } + out.push('\''); + std::borrow::Cow::Owned(out) +} + +fn fish_needs_quoting(s: &str) -> bool { + s.is_empty() + || s.chars().any(|c| { + !(c.is_ascii_alphanumeric() + || matches!(c, '/' | '_' | '-' | '.' | ',' | '+' | '=' | ':' | '@')) + }) +} + /// Powershell completion adapter #[derive(Copy, Clone, PartialEq, Eq, Debug)] pub struct Powershell; @@ -393,8 +448,8 @@ function _clap_dynamic_completer_NAME() { other+=("$completion") fi done - [[ -n $dirs ]] && _describe 'values' dirs -S '/' -r '/' - [[ -n $other ]] && _describe 'values' other + [[ -n $dirs ]] && _describe -V 'values' dirs -S '/' -r '/' + [[ -n $other ]] && _describe -V 'values' other fi } @@ -463,6 +518,7 @@ impl Zsh { #[cfg(test)] mod tests { use super::*; + use snapbox::IntoData as _; use snapbox::assert_data_eq; // This test verifies that fish shell path quoting works with or without spaces in the path. @@ -504,4 +560,55 @@ mod tests { snapbox::str![r#"complete [..] "([..] '/path with a space/completer' [..])""#] ); } + + #[test] + #[cfg(all(unix, feature = "unstable-dynamic"))] + fn fish_env_completer_path_with_backslash() { + let mut buf = Vec::new(); + Fish.write_registration("V", "n", "/ignored/bin", "/p/dyn\\amic/foo", &mut buf) + .expect("write_registration failed"); + let script = String::from_utf8(buf).expect("Invalid UTF-8"); + assert_data_eq!( + script, + snapbox::str![[r#" +complete --keep-order --exclusive --command /ignored/bin --arguments "(V=fish '/p/dyn\\\\amic/foo' -- (commandline --current-process --tokenize --cut-at-cursor) (commandline --current-token))" + +"#]] + .raw() + ); + } + + #[test] + #[cfg(all(unix, feature = "unstable-dynamic"))] + fn fish_env_command_name_with_backslash() { + let mut buf = Vec::new(); + Fish.write_registration("V", "n", "dyn\\amic", "/p/completer", &mut buf) + .expect("write_registration failed"); + let script = String::from_utf8(buf).expect("Invalid UTF-8"); + assert_data_eq!( + script, + snapbox::str![[r#" +complete --keep-order --exclusive --command 'dyn\\amic' --arguments "(V=fish /p/completer -- (commandline --current-process --tokenize --cut-at-cursor) (commandline --current-token))" + +"#]] + .raw() + ); + } + + #[test] + #[cfg(all(unix, feature = "unstable-dynamic"))] + fn fish_env_completer_path_with_dollar() { + let mut buf = Vec::new(); + Fish.write_registration("V", "n", "/ignored/bin", "/p/$var/c", &mut buf) + .expect("write_registration failed"); + let script = String::from_utf8(buf).expect("Invalid UTF-8"); + assert_data_eq!( + script, + snapbox::str![[r#" +complete --keep-order --exclusive --command /ignored/bin --arguments "(V=fish '/p/\$var/c' -- (commandline --current-process --tokenize --cut-at-cursor) (commandline --current-token))" + +"#]] + .raw() + ); + } } diff --git a/clap_complete-4.6.2/src/lib.rs b/clap_complete-4.6.5/src/lib.rs similarity index 100% rename from clap_complete-4.6.2/src/lib.rs rename to clap_complete-4.6.5/src/lib.rs diff --git a/clap_complete-4.6.2/src/macros.rs b/clap_complete-4.6.5/src/macros.rs similarity index 100% rename from clap_complete-4.6.2/src/macros.rs rename to clap_complete-4.6.5/src/macros.rs diff --git a/either-1.16.0/.cargo-checksum.json b/either-1.16.0/.cargo-checksum.json new file mode 100644 index 0000000000..9915491767 --- /dev/null +++ b/either-1.16.0/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"3f0041c1992d886f8f19441bd5fd859e3a68cbc9f91d006494ec4bd587653bfc",".github/workflows/ci.yml":"d2da89285c13788a6a355b9ad5fdd84941b3982e395270cb809b64d9be8c9c1f","Cargo.lock":"47e4ddc10d96119e10d5172d19a7eef277f18e93c7a9e7a48e28f0e822b422fa","Cargo.toml":"1f4d971b97901d1420a508ca4c9cc7ec3e2114c782500e5192801509cf043725","Cargo.toml.orig":"f82350f4effc4946b40f8d37e3db28488319cf4def755d00f5687f7cf768621a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7576269ea71f767b99297934c0b2367532690f8c4badc695edf8e04ab6a1e545","README-crates.io.md":"b775991a01ab4a0a8de6169f597775319d9ce8178f5c74ccdc634f13a286b20c","README.rst":"01c248679713f4109b8aedb904bb79edef054e477fce9ab260921b1c0861c70a","src/into_either.rs":"0477f226bbba78ef017de08b87d421d3cd99fbc95b90ba4e6e3e803e3d15254e","src/iterator.rs":"3dd8a1255e1448eeee20b24de849523a13ca0d3c178b81d1d5adc6220ca692c4","src/lib.rs":"481ca250233811a5ccbff9a9fc7c2acb15287aede47d8ec280484fe5209e2ad7","src/serde_untagged.rs":"5f7a4035ca164125a433f42ac0949185d1732e2fcf5b1ac6dfca1e5aede439bb","src/serde_untagged_optional.rs":"ba5d6c2213388b69e127e763b6e394de6388bdd682ffb5d5696b068f1938ec79"},"package":"91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"} \ No newline at end of file diff --git a/either-1.16.0/.cargo_vcs_info.json b/either-1.16.0/.cargo_vcs_info.json new file mode 100644 index 0000000000..148bd94dd5 --- /dev/null +++ b/either-1.16.0/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "8f4ecd9964ea909a7f989a3668a2710310a0e62f" + }, + "path_in_vcs": "" +} \ No newline at end of file diff --git a/either-1.16.0/.github/workflows/ci.yml b/either-1.16.0/.github/workflows/ci.yml new file mode 100644 index 0000000000..1c6dbb0a5e --- /dev/null +++ b/either-1.16.0/.github/workflows/ci.yml @@ -0,0 +1,90 @@ +on: + push: + branches: [ main ] + pull_request: + merge_group: + +name: CI + +jobs: + ci: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust: + - 1.63.0 # MSRV + - stable + - beta + - nightly + features: + - "" + - "serde" + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache the registry + uses: actions/cache@v4 + if: startsWith(matrix.rust, '1') + with: + path: ~/.cargo/registry/index + key: cargo-${{ matrix.rust }}-git-index + + - name: Lock MSRV-compatible dependencies + if: startsWith(matrix.rust, '1') + env: + CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback + # Note that this uses the runner's pre-installed stable cargo + run: cargo generate-lockfile + + - name: Set up Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + + - name: Build (no_std) + run: cargo build --no-default-features --features "${{ matrix.features }}" + + - name: Build + run: cargo build --features "${{ matrix.features }}" + + - name: Test + run: cargo test --features "${{ matrix.features }}" + + - name: Doc + run: cargo doc --features "${{ matrix.features }}" + + clippy: + name: Rustfmt and Clippy + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up nightly Rust + uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt, clippy + + - name: Rustfmt + run: cargo fmt --all -- --check + + - name: Clippy + run: cargo clippy # -- -D warnings + + # One job that "summarizes" the success state of this pipeline. This can then be added to branch + # protection, rather than having to add each job separately. + success: + name: Success + runs-on: ubuntu-latest + needs: [ci, clippy] + # Github branch protection is exceedingly silly and treats "jobs skipped because a dependency + # failed" as success. So we have to do some contortions to ensure the job fails if any of its + # dependencies fails. + if: always() # make sure this is never "skipped" + steps: + # Manually check the status of all dependencies. `if: failure()` does not work. + - name: check if any dependency failed + run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' diff --git a/either-1.16.0/Cargo.lock b/either-1.16.0/Cargo.lock new file mode 100644 index 0000000000..3064f8b7e5 --- /dev/null +++ b/either-1.16.0/Cargo.lock @@ -0,0 +1,89 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "either" +version = "1.16.0" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "proc-macro2" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "serde" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.193" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "2.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" diff --git a/either-1.16.0/Cargo.toml b/either-1.16.0/Cargo.toml new file mode 100644 index 0000000000..15de8104b8 --- /dev/null +++ b/either-1.16.0/Cargo.toml @@ -0,0 +1,69 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2021" +rust-version = "1.63.0" +name = "either" +version = "1.16.0" +build = false +autolib = false +autobins = false +autoexamples = false +autotests = false +autobenches = false +description = """ +The enum `Either` with variants `Left` and `Right` is a general purpose sum type with two cases. +""" +documentation = "https://docs.rs/either/1/" +readme = "README-crates.io.md" +keywords = [ + "data-structure", + "no_std", +] +categories = [ + "data-structures", + "no-std", +] +license = "MIT OR Apache-2.0" +repository = "https://github.com/rayon-rs/either" + +[package.metadata.release] +allow-branch = ["main"] +sign-tag = true +tag-name = "{{version}}" + +[package.metadata.docs.rs] +features = ["serde"] + +[package.metadata.playground] +features = ["serde"] + +[features] +default = ["std"] +std = [] +use_std = ["std"] + +[lib] +name = "either" +path = "src/lib.rs" + +[dependencies.serde] +version = "1.0.95" +features = [ + "alloc", + "derive", +] +optional = true +default-features = false + +[dev-dependencies.serde_json] +version = "1.0.0" diff --git a/either-1.16.0/Cargo.toml.orig b/either-1.16.0/Cargo.toml.orig new file mode 100644 index 0000000000..fc46d174ec --- /dev/null +++ b/either-1.16.0/Cargo.toml.orig @@ -0,0 +1,39 @@ +[package] +name = "either" +version = "1.16.0" +edition = "2021" +rust-version = "1.63.0" + +license = "MIT OR Apache-2.0" +repository = "https://github.com/rayon-rs/either" +documentation = "https://docs.rs/either/1/" +readme = "README-crates.io.md" + +description = """ +The enum `Either` with variants `Left` and `Right` is a general purpose sum type with two cases. +""" + +keywords = ["data-structure", "no_std"] +categories = ["data-structures", "no-std"] + +[dependencies] +serde = { version = "1.0.95", optional = true, default-features = false, features = ["alloc", "derive"] } + +[features] +default = ["std"] +std = [] +use_std = ["std"] # deprecated alias + +[dev-dependencies] +serde_json = "1.0.0" + +[package.metadata.release] +allow-branch = ["main"] +sign-tag = true +tag-name = "{{version}}" + +[package.metadata.docs.rs] +features = ["serde"] + +[package.metadata.playground] +features = ["serde"] diff --git a/hashbrown-0.17.0/LICENSE-APACHE b/either-1.16.0/LICENSE-APACHE similarity index 100% rename from hashbrown-0.17.0/LICENSE-APACHE rename to either-1.16.0/LICENSE-APACHE diff --git a/either-1.16.0/LICENSE-MIT b/either-1.16.0/LICENSE-MIT new file mode 100644 index 0000000000..9203baa055 --- /dev/null +++ b/either-1.16.0/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2015 + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/either-1.16.0/README-crates.io.md b/either-1.16.0/README-crates.io.md new file mode 100644 index 0000000000..d36890278b --- /dev/null +++ b/either-1.16.0/README-crates.io.md @@ -0,0 +1,10 @@ +The enum `Either` with variants `Left` and `Right` is a general purpose +sum type with two cases. + +Either has methods that are similar to Option and Result, and it also implements +traits like `Iterator`. + +Includes macros `try_left!()` and `try_right!()` to use for +short-circuiting logic, similar to how the `?` operator is used with `Result`. +Note that `Either` is general purpose. For describing success or error, use the +regular `Result`. diff --git a/either-1.16.0/README.rst b/either-1.16.0/README.rst new file mode 100644 index 0000000000..10f392a75b --- /dev/null +++ b/either-1.16.0/README.rst @@ -0,0 +1,220 @@ + +Either +====== + +The enum ``Either`` with variants ``Left`` and ``Right`` and trait +implementations including Iterator, Read, Write. + +Either has methods that are similar to Option and Result. + +Includes convenience macros ``try_left!()`` and ``try_right!()`` to use for +short-circuiting logic. + +Please read the `API documentation here`__ + +__ https://docs.rs/either/ + +|build_status|_ |crates|_ + +.. |build_status| image:: https://github.com/rayon-rs/either/workflows/CI/badge.svg?branch=main +.. _build_status: https://github.com/rayon-rs/either/actions + +.. |crates| image:: https://img.shields.io/crates/v/either.svg +.. _crates: https://crates.io/crates/either + +How to use with cargo:: + + [dependencies] + either = "1" + + +Recent Changes +-------------- + +- 1.16.0 + + - Add many new methods dealing with each side, by @A4-Tacks: + + - ``inspect_left`` and ``inspect_right`` (#124) + + - ``left_and`` and ``right_and`` (#125) + + - ``is_left_and`` and ``is_right_and`` (#126) + + - ``map_left_or`` and ``map_right_or`` (#127) + + - Add a version of ``for_both!`` with a single ``ident``, by @A4-Tacks (#128) + + - Add a ``map_both!`` macro, by @JohnScience (#109) and @ronnodas (#137) + +- 1.15.0 + + - Fix ``serde`` support when building without ``std``, by @klkvr (#119) + + - Use a more common ``std`` feature for default enablement, deprecating + the ``use_std`` feature as a mere alias of the new name. + +- 1.14.0 + + - **MSRV**: ``either`` now requires Rust 1.63 or later. + + - Implement ``fmt::Write`` for ``Either``, by @yotamofek (#113) + + - Replace ``Into for Either`` with ``From for Result``, by @cuviper (#118) + +- 1.13.0 + + - Add new methods ``.cloned()`` and ``.copied()``, by @ColonelThirtyTwo (#107) + +- 1.12.0 + + - **MSRV**: ``either`` now requires Rust 1.37 or later. + + - Specialize ``nth_back`` for ``Either`` and ``IterEither``, by @cuviper (#106) + +- 1.11.0 + + - Add new trait ``IntoEither`` that is useful to convert to ``Either`` in method chains, + by @SFM61319 (#101) + +- 1.10.0 + + - Add new methods ``.factor_iter()``, ``.factor_iter_mut()``, and ``.factor_into_iter()`` + that return ``Either`` items, plus ``.iter()`` and ``.iter_mut()`` to convert to direct + reference iterators; by @aj-bagwell and @cuviper (#91) + +- 1.9.0 + + - Add new methods ``.map_either()`` and ``.map_either_with()``, by @nasadorian (#82) + +- 1.8.1 + + - Clarified that the multiple licenses are combined with OR. + +- 1.8.0 + + - **MSRV**: ``either`` now requires Rust 1.36 or later. + + - Add new methods ``.as_pin_ref()`` and ``.as_pin_mut()`` to project a + pinned ``Either`` as inner ``Pin`` variants, by @cuviper (#77) + + - Implement the ``Future`` trait, by @cuviper (#77) + + - Specialize more methods of the ``io`` traits, by @Kixunil and @cuviper (#75) + +- 1.7.0 + + - **MSRV**: ``either`` now requires Rust 1.31 or later. + + - Export the macro ``for_both!``, by @thomaseizinger (#58) + + - Implement the ``io::Seek`` trait, by @Kerollmops (#60) + + - Add new method ``.either_into()`` for ``Into`` conversion, by @TonalidadeHidrica (#63) + + - Add new methods ``.factor_ok()``, ``.factor_err()``, and ``.factor_none()``, + by @zachs18 (#67) + + - Specialize ``source`` in the ``Error`` implementation, by @thomaseizinger (#69) + + - Specialize more iterator methods and implement the ``FusedIterator`` trait, + by @Ten0 (#66) and @cuviper (#71) + + - Specialize ``Clone::clone_from``, by @cuviper (#72) + +- 1.6.1 + + - Add new methods ``.expect_left()``, ``.unwrap_left()``, + and equivalents on the right, by @spenserblack (#51) + +- 1.6.0 + + - Add new modules ``serde_untagged`` and ``serde_untagged_optional`` to customize + how ``Either`` fields are serialized in other types, by @MikailBag (#49) + +- 1.5.3 + + - Add new method ``.map()`` for ``Either`` by @nvzqz (#40). + +- 1.5.2 + + - Add new methods ``.left_or()``, ``.left_or_default()``, ``.left_or_else()``, + and equivalents on the right, by @DCjanus (#36) + +- 1.5.1 + + - Add ``AsRef`` and ``AsMut`` implementations for common unsized types: + ``str``, ``[T]``, ``CStr``, ``OsStr``, and ``Path``, by @mexus (#29) + +- 1.5.0 + + - Add new methods ``.factor_first()``, ``.factor_second()`` and ``.into_inner()`` + by @mathstuf (#19) + +- 1.4.0 + + - Add inherent method ``.into_iter()`` by @cuviper (#12) + +- 1.3.0 + + - Add opt-in serde support by @hcpl + +- 1.2.0 + + - Add method ``.either_with()`` by @Twey (#13) + +- 1.1.0 + + - Add methods ``left_and_then``, ``right_and_then`` by @rampantmonkey + - Include license files in the repository and released crate + +- 1.0.3 + + - Add crate categories + +- 1.0.2 + + - Forward more ``Iterator`` methods + - Implement ``Extend`` for ``Either`` if ``L, R`` do. + +- 1.0.1 + + - Fix ``Iterator`` impl for ``Either`` to forward ``.fold()``. + +- 1.0.0 + + - Add default crate feature ``use_std`` so that you can opt out of linking to + std. + +- 0.1.7 + + - Add methods ``.map_left()``, ``.map_right()`` and ``.either()``. + - Add more documentation + +- 0.1.3 + + - Implement Display, Error + +- 0.1.2 + + - Add macros ``try_left!`` and ``try_right!``. + +- 0.1.1 + + - Implement Deref, DerefMut + +- 0.1.0 + + - Initial release + - Support Iterator, Read, Write + +License +------- + +Dual-licensed to be compatible with the Rust project. + +Licensed under the Apache License, Version 2.0 +https://www.apache.org/licenses/LICENSE-2.0 or the MIT license +https://opensource.org/licenses/MIT, at your +option. This file may not be copied, modified, or distributed +except according to those terms. diff --git a/either-1.16.0/src/into_either.rs b/either-1.16.0/src/into_either.rs new file mode 100644 index 0000000000..73746c80f1 --- /dev/null +++ b/either-1.16.0/src/into_either.rs @@ -0,0 +1,64 @@ +//! The trait [`IntoEither`] provides methods for converting a type `Self`, whose +//! size is constant and known at compile-time, into an [`Either`] variant. + +use super::{Either, Left, Right}; + +/// Provides methods for converting a type `Self` into either a [`Left`] or [`Right`] +/// variant of [`Either`](Either). +/// +/// The [`into_either`](IntoEither::into_either) method takes a [`bool`] to determine +/// whether to convert to [`Left`] or [`Right`]. +/// +/// The [`into_either_with`](IntoEither::into_either_with) method takes a +/// [predicate function](FnOnce) to determine whether to convert to [`Left`] or [`Right`]. +pub trait IntoEither: Sized { + /// Converts `self` into a [`Left`] variant of [`Either`](Either) + /// if `into_left` is `true`. + /// Converts `self` into a [`Right`] variant of [`Either`](Either) + /// otherwise. + /// + /// # Examples + /// + /// ``` + /// use either::{IntoEither, Left, Right}; + /// + /// let x = 0; + /// assert_eq!(x.into_either(true), Left(x)); + /// assert_eq!(x.into_either(false), Right(x)); + /// ``` + fn into_either(self, into_left: bool) -> Either { + if into_left { + Left(self) + } else { + Right(self) + } + } + + /// Converts `self` into a [`Left`] variant of [`Either`](Either) + /// if `into_left(&self)` returns `true`. + /// Converts `self` into a [`Right`] variant of [`Either`](Either) + /// otherwise. + /// + /// # Examples + /// + /// ``` + /// use either::{IntoEither, Left, Right}; + /// + /// fn is_even(x: &u8) -> bool { + /// x % 2 == 0 + /// } + /// + /// let x = 0; + /// assert_eq!(x.into_either_with(is_even), Left(x)); + /// assert_eq!(x.into_either_with(|x| !is_even(x)), Right(x)); + /// ``` + fn into_either_with(self, into_left: F) -> Either + where + F: FnOnce(&Self) -> bool, + { + let into_left = into_left(&self); + self.into_either(into_left) + } +} + +impl IntoEither for T {} diff --git a/either-1.16.0/src/iterator.rs b/either-1.16.0/src/iterator.rs new file mode 100644 index 0000000000..a5535f0530 --- /dev/null +++ b/either-1.16.0/src/iterator.rs @@ -0,0 +1,315 @@ +use super::{Either, Left, Right}; +use core::iter; + +macro_rules! wrap_either { + ($value:expr => $( $tail:tt )*) => { + match $value { + Left(inner) => inner.map(Left) $($tail)*, + Right(inner) => inner.map(Right) $($tail)*, + } + }; +} + +/// Iterator that maps left or right iterators to corresponding `Either`-wrapped items. +/// +/// This struct is created by the [`Either::factor_into_iter`], +/// [`factor_iter`][Either::factor_iter], +/// and [`factor_iter_mut`][Either::factor_iter_mut] methods. +#[derive(Clone, Debug)] +pub struct IterEither { + inner: Either, +} + +impl IterEither { + pub(crate) fn new(inner: Either) -> Self { + IterEither { inner } + } +} + +impl Extend for Either +where + L: Extend, + R: Extend, +{ + fn extend(&mut self, iter: T) + where + T: IntoIterator, + { + for_both!(self, inner => inner.extend(iter)) + } +} + +/// `Either` is an iterator if both `L` and `R` are iterators. +impl Iterator for Either +where + L: Iterator, + R: Iterator, +{ + type Item = L::Item; + + fn next(&mut self) -> Option { + for_both!(self, inner => inner.next()) + } + + fn size_hint(&self) -> (usize, Option) { + for_both!(self, inner => inner.size_hint()) + } + + fn fold(self, init: Acc, f: G) -> Acc + where + G: FnMut(Acc, Self::Item) -> Acc, + { + for_both!(self, inner => inner.fold(init, f)) + } + + fn for_each(self, f: F) + where + F: FnMut(Self::Item), + { + for_both!(self, inner => inner.for_each(f)) + } + + fn count(self) -> usize { + for_both!(self, inner => inner.count()) + } + + fn last(self) -> Option { + for_both!(self, inner => inner.last()) + } + + fn nth(&mut self, n: usize) -> Option { + for_both!(self, inner => inner.nth(n)) + } + + fn collect(self) -> B + where + B: iter::FromIterator, + { + for_both!(self, inner => inner.collect()) + } + + fn partition(self, f: F) -> (B, B) + where + B: Default + Extend, + F: FnMut(&Self::Item) -> bool, + { + for_both!(self, inner => inner.partition(f)) + } + + fn all(&mut self, f: F) -> bool + where + F: FnMut(Self::Item) -> bool, + { + for_both!(self, inner => inner.all(f)) + } + + fn any(&mut self, f: F) -> bool + where + F: FnMut(Self::Item) -> bool, + { + for_both!(self, inner => inner.any(f)) + } + + fn find

(&mut self, predicate: P) -> Option + where + P: FnMut(&Self::Item) -> bool, + { + for_both!(self, inner => inner.find(predicate)) + } + + fn find_map(&mut self, f: F) -> Option + where + F: FnMut(Self::Item) -> Option, + { + for_both!(self, inner => inner.find_map(f)) + } + + fn position

(&mut self, predicate: P) -> Option + where + P: FnMut(Self::Item) -> bool, + { + for_both!(self, inner => inner.position(predicate)) + } +} + +impl DoubleEndedIterator for Either +where + L: DoubleEndedIterator, + R: DoubleEndedIterator, +{ + fn next_back(&mut self) -> Option { + for_both!(self, inner => inner.next_back()) + } + + fn nth_back(&mut self, n: usize) -> Option { + for_both!(self, inner => inner.nth_back(n)) + } + + fn rfold(self, init: Acc, f: G) -> Acc + where + G: FnMut(Acc, Self::Item) -> Acc, + { + for_both!(self, inner => inner.rfold(init, f)) + } + + fn rfind

(&mut self, predicate: P) -> Option + where + P: FnMut(&Self::Item) -> bool, + { + for_both!(self, inner => inner.rfind(predicate)) + } +} + +impl ExactSizeIterator for Either +where + L: ExactSizeIterator, + R: ExactSizeIterator, +{ + fn len(&self) -> usize { + for_both!(self, inner => inner.len()) + } +} + +impl iter::FusedIterator for Either +where + L: iter::FusedIterator, + R: iter::FusedIterator, +{ +} + +impl Iterator for IterEither +where + L: Iterator, + R: Iterator, +{ + type Item = Either; + + fn next(&mut self) -> Option { + Some(map_both!(self.inner, ref mut inner => inner.next()?)) + } + + fn size_hint(&self) -> (usize, Option) { + for_both!(self.inner, ref inner => inner.size_hint()) + } + + fn fold(self, init: Acc, f: G) -> Acc + where + G: FnMut(Acc, Self::Item) -> Acc, + { + wrap_either!(self.inner => .fold(init, f)) + } + + fn for_each(self, f: F) + where + F: FnMut(Self::Item), + { + wrap_either!(self.inner => .for_each(f)) + } + + fn count(self) -> usize { + for_both!(self.inner, inner => inner.count()) + } + + fn last(self) -> Option { + Some(map_both!(self.inner, inner => inner.last()?)) + } + + fn nth(&mut self, n: usize) -> Option { + Some(map_both!(self.inner, ref mut inner => inner.nth(n)?)) + } + + fn collect(self) -> B + where + B: iter::FromIterator, + { + wrap_either!(self.inner => .collect()) + } + + fn partition(self, f: F) -> (B, B) + where + B: Default + Extend, + F: FnMut(&Self::Item) -> bool, + { + wrap_either!(self.inner => .partition(f)) + } + + fn all(&mut self, f: F) -> bool + where + F: FnMut(Self::Item) -> bool, + { + wrap_either!(&mut self.inner => .all(f)) + } + + fn any(&mut self, f: F) -> bool + where + F: FnMut(Self::Item) -> bool, + { + wrap_either!(&mut self.inner => .any(f)) + } + + fn find

(&mut self, predicate: P) -> Option + where + P: FnMut(&Self::Item) -> bool, + { + wrap_either!(&mut self.inner => .find(predicate)) + } + + fn find_map(&mut self, f: F) -> Option + where + F: FnMut(Self::Item) -> Option, + { + wrap_either!(&mut self.inner => .find_map(f)) + } + + fn position

(&mut self, predicate: P) -> Option + where + P: FnMut(Self::Item) -> bool, + { + wrap_either!(&mut self.inner => .position(predicate)) + } +} + +impl DoubleEndedIterator for IterEither +where + L: DoubleEndedIterator, + R: DoubleEndedIterator, +{ + fn next_back(&mut self) -> Option { + Some(map_both!(self.inner, ref mut inner => inner.next_back()?)) + } + + fn nth_back(&mut self, n: usize) -> Option { + Some(map_both!(self.inner, ref mut inner => inner.nth_back(n)?)) + } + + fn rfold(self, init: Acc, f: G) -> Acc + where + G: FnMut(Acc, Self::Item) -> Acc, + { + wrap_either!(self.inner => .rfold(init, f)) + } + + fn rfind

(&mut self, predicate: P) -> Option + where + P: FnMut(&Self::Item) -> bool, + { + wrap_either!(&mut self.inner => .rfind(predicate)) + } +} + +impl ExactSizeIterator for IterEither +where + L: ExactSizeIterator, + R: ExactSizeIterator, +{ + fn len(&self) -> usize { + for_both!(self.inner, ref inner => inner.len()) + } +} + +impl iter::FusedIterator for IterEither +where + L: iter::FusedIterator, + R: iter::FusedIterator, +{ +} diff --git a/either-1.16.0/src/lib.rs b/either-1.16.0/src/lib.rs new file mode 100644 index 0000000000..ec16cee001 --- /dev/null +++ b/either-1.16.0/src/lib.rs @@ -0,0 +1,1826 @@ +//! The enum [`Either`] with variants `Left` and `Right` is a general purpose +//! sum type with two cases. +//! +//! [`Either`]: enum.Either.html +//! +//! **Crate features:** +//! +//! * `"std"` +//! Enabled by default. Disable to make the library `#![no_std]`. +//! +//! * `"serde"` +//! Disabled by default. Enable to `#[derive(Serialize, Deserialize)]` for `Either` +//! + +#![doc(html_root_url = "https://docs.rs/either/1/")] +#![no_std] + +#[cfg(any(test, feature = "std"))] +extern crate std; + +#[cfg(feature = "serde")] +pub mod serde_untagged; + +#[cfg(feature = "serde")] +pub mod serde_untagged_optional; + +use core::convert::{AsMut, AsRef}; +use core::fmt; +use core::future::Future; +use core::ops::Deref; +use core::ops::DerefMut; +use core::pin::Pin; + +#[cfg(any(test, feature = "std"))] +use std::error::Error; +#[cfg(any(test, feature = "std"))] +use std::io::{self, BufRead, Read, Seek, SeekFrom, Write}; + +pub use crate::Either::{Left, Right}; + +/// The enum `Either` with variants `Left` and `Right` is a general purpose +/// sum type with two cases. +/// +/// The `Either` type is symmetric and treats its variants the same way, without +/// preference. +/// (For representing success or error, use the regular `Result` enum instead.) +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] +pub enum Either { + /// A value of type `L`. + Left(L), + /// A value of type `R`. + Right(R), +} + +/// Evaluate the provided expression for both [`Either::Left`] and [`Either::Right`]. +/// +/// This macro is useful in cases where both sides of [`Either`] can be interacted with +/// in the same way even though the don't share the same type. +/// +/// Syntax: +/// +/// - `either::for_both!(` *expression* `,` *pattern* `=>` *expression* `)` +/// - `either::for_both!(` *ident* `=>` *expression* `)` +/// +/// Unlike [`map_both!`], this macro converges both variants to the type returned by the expression. +/// +/// # Example +/// +/// ``` +/// use either::Either; +/// +/// fn length(owned_or_borrowed: Either) -> usize { +/// either::for_both!(owned_or_borrowed, s => s.len()) +/// } +/// +/// fn main() { +/// let borrowed = Either::Right("Hello world!"); +/// let owned = Either::Left("Hello world!".to_owned()); +/// +/// assert_eq!(length(borrowed), 12); +/// assert_eq!(length(owned), 12); +/// } +/// ``` +/// +/// ``` +/// use either::Either; +/// +/// fn length(s: Either>) -> usize { +/// either::for_both!(s => s.len()) +/// } +/// +/// fn main() { +/// let string = Either::Left("Hello world!".to_owned()); +/// let bytes = Either::Right(b"Hello world!".to_vec()); +/// +/// assert_eq!(length(string), 12); +/// assert_eq!(length(bytes), 12); +/// } +/// ``` +#[macro_export] +macro_rules! for_both { + ($value:expr, $pattern:pat => $result:expr) => { + match $value { + $crate::Either::Left($pattern) => $result, + $crate::Either::Right($pattern) => $result, + } + }; + ($name:ident => $result:expr) => { + match $name { + $crate::Either::Left($name) => $result, + $crate::Either::Right($name) => $result, + } + }; +} + +/// Evaluate the provided expression for both [`Either::Left`] and [`Either::Right`], +/// returning an [`Either`] with the results. +/// +/// This macro is useful in cases where both sides of [`Either`] can be interacted with +/// in the same way even though the don't share the same type. +/// +/// Syntax: `either::map_both!(` *expression* `,` *pattern* `=>` *expression* `)` +/// +/// Unlike [`for_both!`], this macro returns an [`Either`] with the results of the expressions. +/// +/// # Example +/// +/// ``` +/// use either::Either; +/// +/// struct Wrapper(T); +/// +/// fn wrap( +/// owned_or_borrowed: Either, +/// ) -> Either, Wrapper<&'static str>> { +/// either::map_both!(owned_or_borrowed, s => Wrapper(s)) +/// } +/// ``` +/// +/// ``` +/// use either::Either; +/// +/// fn widen(x: Either) -> Either { +/// either::map_both!(x => x.into()) +/// } +/// ``` +#[macro_export] +macro_rules! map_both { + ($value:expr, $pattern:pat => $result:expr) => { + match $value { + $crate::Either::Left($pattern) => $crate::Either::Left($result), + $crate::Either::Right($pattern) => $crate::Either::Right($result), + } + }; + ($name:ident => $result:expr) => { + match $name { + $crate::Either::Left($name) => $crate::Either::Left($result), + $crate::Either::Right($name) => $crate::Either::Right($result), + } + }; +} + +/// Macro for unwrapping the left side of an [`Either`], which fails early +/// with the opposite side. Can only be used in functions that return +/// `Either` because of the early return of `Right` that it provides. +/// +/// See also [`try_right!`] for its dual, which applies the same just to the +/// right side. +/// +/// # Example +/// +/// ``` +/// use either::{Either, Left, Right}; +/// +/// fn twice(wrapper: Either) -> Either { +/// let value = either::try_left!(wrapper); +/// Left(value * 2) +/// } +/// +/// fn main() { +/// assert_eq!(twice(Left(2)), Left(4)); +/// assert_eq!(twice(Right("ups")), Right("ups")); +/// } +/// ``` +#[macro_export] +macro_rules! try_left { + ($expr:expr) => { + match $expr { + $crate::Left(val) => val, + $crate::Right(err) => return $crate::Right(::core::convert::From::from(err)), + } + }; +} + +/// Dual to [`try_left!`], see its documentation for more information. +#[macro_export] +macro_rules! try_right { + ($expr:expr) => { + match $expr { + $crate::Left(err) => return $crate::Left(::core::convert::From::from(err)), + $crate::Right(val) => val, + } + }; +} + +mod iterator; +pub use self::iterator::IterEither; + +mod into_either; +pub use self::into_either::IntoEither; + +impl Clone for Either { + fn clone(&self) -> Self { + match self { + Left(inner) => Left(inner.clone()), + Right(inner) => Right(inner.clone()), + } + } + + fn clone_from(&mut self, source: &Self) { + match (self, source) { + (Left(dest), Left(source)) => dest.clone_from(source), + (Right(dest), Right(source)) => dest.clone_from(source), + (dest, source) => *dest = source.clone(), + } + } +} + +impl Either { + /// Return true if the value is the `Left` variant. + /// + /// ``` + /// use either::*; + /// + /// let values = [Left(1), Right("the right value")]; + /// assert_eq!(values[0].is_left(), true); + /// assert_eq!(values[1].is_left(), false); + /// ``` + pub fn is_left(&self) -> bool { + match self { + Left(_) => true, + Right(_) => false, + } + } + + /// Returns `true` if the value is [`Left`] and the value inside of it matches a predicate. + /// + /// # Examples + /// + /// ``` + /// use either::*; + /// + /// let left0: Either = Left(0); + /// let left2: Either = Left(2); + /// let right: Either = Right(2); + /// + /// assert_eq!(left2.is_left_and(|n| n > 1), true); + /// assert_eq!(left0.is_left_and(|n| n > 1), false); + /// assert_eq!(right.is_left_and(|n| n > 1), false); + /// ``` + pub fn is_left_and(self, f: F) -> bool + where + F: FnOnce(L) -> bool, + { + match self { + Left(left) => f(left), + Right(_) => false, + } + } + + /// Returns `true` if the value is [`Right`] and the value inside of it matches a predicate. + /// + /// # Examples + /// + /// ``` + /// use either::*; + /// + /// let right0: Either = Right(0); + /// let right2: Either = Right(2); + /// let left: Either = Left(2); + /// + /// assert_eq!(right2.is_right_and(|n| n > 1), true); + /// assert_eq!(right0.is_right_and(|n| n > 1), false); + /// assert_eq!(left.is_right_and(|n| n > 1), false); + /// ``` + pub fn is_right_and(self, f: F) -> bool + where + F: FnOnce(R) -> bool, + { + match self { + Left(_) => false, + Right(right) => f(right), + } + } + + /// Return true if the value is the `Right` variant. + /// + /// ``` + /// use either::*; + /// + /// let values = [Left(1), Right("the right value")]; + /// assert_eq!(values[0].is_right(), false); + /// assert_eq!(values[1].is_right(), true); + /// ``` + pub fn is_right(&self) -> bool { + !self.is_left() + } + + /// Convert the left side of `Either` to an `Option`. + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, ()> = Left("some value"); + /// assert_eq!(left.left(), Some("some value")); + /// + /// let right: Either<(), _> = Right(321); + /// assert_eq!(right.left(), None); + /// ``` + pub fn left(self) -> Option { + match self { + Left(l) => Some(l), + Right(_) => None, + } + } + + /// Convert the right side of `Either` to an `Option`. + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, ()> = Left("some value"); + /// assert_eq!(left.right(), None); + /// + /// let right: Either<(), _> = Right(321); + /// assert_eq!(right.right(), Some(321)); + /// ``` + pub fn right(self) -> Option { + match self { + Left(_) => None, + Right(r) => Some(r), + } + } + + /// Convert `&Either` to `Either<&L, &R>`. + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, ()> = Left("some value"); + /// assert_eq!(left.as_ref(), Left(&"some value")); + /// + /// let right: Either<(), _> = Right("some value"); + /// assert_eq!(right.as_ref(), Right(&"some value")); + /// ``` + pub fn as_ref(&self) -> Either<&L, &R> { + map_both!(self, inner => inner) + } + + /// Convert `&mut Either` to `Either<&mut L, &mut R>`. + /// + /// ``` + /// use either::*; + /// + /// fn mutate_left(value: &mut Either) { + /// if let Some(l) = value.as_mut().left() { + /// *l = 999; + /// } + /// } + /// + /// let mut left = Left(123); + /// let mut right = Right(123); + /// mutate_left(&mut left); + /// mutate_left(&mut right); + /// assert_eq!(left, Left(999)); + /// assert_eq!(right, Right(123)); + /// ``` + pub fn as_mut(&mut self) -> Either<&mut L, &mut R> { + map_both!(self, inner => inner) + } + + /// Convert `Pin<&Either>` to `Either, Pin<&R>>`, + /// pinned projections of the inner variants. + pub fn as_pin_ref(self: Pin<&Self>) -> Either, Pin<&R>> { + // SAFETY: We can use `new_unchecked` because the `inner` parts are + // guaranteed to be pinned, as they come from `self` which is pinned. + unsafe { map_both!(Pin::get_ref(self), inner => Pin::new_unchecked(inner)) } + } + + /// Convert `Pin<&mut Either>` to `Either, Pin<&mut R>>`, + /// pinned projections of the inner variants. + pub fn as_pin_mut(self: Pin<&mut Self>) -> Either, Pin<&mut R>> { + // SAFETY: `get_unchecked_mut` is fine because we don't move anything. + // We can use `new_unchecked` because the `inner` parts are guaranteed + // to be pinned, as they come from `self` which is pinned, and we never + // offer an unpinned `&mut L` or `&mut R` through `Pin<&mut Self>`. We + // also don't have an implementation of `Drop`, nor manual `Unpin`. + unsafe { map_both!(Pin::get_unchecked_mut(self), inner => Pin::new_unchecked(inner)) } + } + + /// Convert `Either` to `Either`. + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, ()> = Left(123); + /// assert_eq!(left.flip(), Right(123)); + /// + /// let right: Either<(), _> = Right("some value"); + /// assert_eq!(right.flip(), Left("some value")); + /// ``` + pub fn flip(self) -> Either { + match self { + Left(l) => Right(l), + Right(r) => Left(r), + } + } + + /// Apply the function `f` on the value in the `Left` variant if it is present rewrapping the + /// result in `Left`. + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, u32> = Left(123); + /// assert_eq!(left.map_left(|x| x * 2), Left(246)); + /// + /// let right: Either = Right(123); + /// assert_eq!(right.map_left(|x| x * 2), Right(123)); + /// ``` + pub fn map_left(self, f: F) -> Either + where + F: FnOnce(L) -> M, + { + match self { + Left(l) => Left(f(l)), + Right(r) => Right(r), + } + } + + /// Apply the function `f` on the value in the `Right` variant if it is present rewrapping the + /// result in `Right`. + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, u32> = Left(123); + /// assert_eq!(left.map_right(|x| x * 2), Left(123)); + /// + /// let right: Either = Right(123); + /// assert_eq!(right.map_right(|x| x * 2), Right(246)); + /// ``` + pub fn map_right(self, f: F) -> Either + where + F: FnOnce(R) -> S, + { + match self { + Left(l) => Left(l), + Right(r) => Right(f(r)), + } + } + + /// Returns the provided default (if [`Right`]), or + /// applies a function to the contained value (if [`Left`]). + /// + /// # Examples + /// + /// ``` + /// use either::*; + /// + /// let x: Either<_, i32> = Left(123); + /// assert_eq!(x.map_left_or(0, |n| n * 2), 246); + /// + /// let x: Either = Right(123); + /// assert_eq!(x.map_left_or(0, |n| n * 2), 0); + /// ``` + pub fn map_left_or(self, default: S, f: F) -> S + where + F: FnOnce(L) -> S, + { + match self { + Left(left) => f(left), + Right(_) => default, + } + } + + /// Returns the provided default (if [`Left`]), or + /// applies a function to the contained value (if [`Right`]). + /// + /// # Examples + /// + /// ``` + /// use either::*; + /// + /// let x: Either<_, i32> = Left(123); + /// assert_eq!(x.map_right_or(0, |n| n * 2), 0); + /// + /// let x: Either = Right(123); + /// assert_eq!(x.map_right_or(0, |n| n * 2), 246); + /// ``` + pub fn map_right_or(self, default: S, f: F) -> S + where + F: FnOnce(R) -> S, + { + match self { + Left(_) => default, + Right(right) => f(right), + } + } + + /// Apply the functions `f` and `g` to the `Left` and `Right` variants + /// respectively. This is equivalent to + /// [bimap](https://hackage.haskell.org/package/bifunctors-5/docs/Data-Bifunctor.html) + /// in functional programming. + /// + /// ``` + /// use either::*; + /// + /// let f = |s: String| s.len(); + /// let g = |u: u8| u.to_string(); + /// + /// let left: Either = Left("loopy".into()); + /// assert_eq!(left.map_either(f, g), Left(5)); + /// + /// let right: Either = Right(42); + /// assert_eq!(right.map_either(f, g), Right("42".into())); + /// ``` + pub fn map_either(self, f: F, g: G) -> Either + where + F: FnOnce(L) -> M, + G: FnOnce(R) -> S, + { + match self { + Left(l) => Left(f(l)), + Right(r) => Right(g(r)), + } + } + + /// Similar to [`map_either`][Self::map_either], with an added context `ctx` accessible to + /// both functions. + /// + /// ``` + /// use either::*; + /// + /// let mut sum = 0; + /// + /// // Both closures want to update the same value, so pass it as context. + /// let mut f = |sum: &mut usize, s: String| { *sum += s.len(); s.to_uppercase() }; + /// let mut g = |sum: &mut usize, u: usize| { *sum += u; u.to_string() }; + /// + /// let left: Either = Left("loopy".into()); + /// assert_eq!(left.map_either_with(&mut sum, &mut f, &mut g), Left("LOOPY".into())); + /// + /// let right: Either = Right(42); + /// assert_eq!(right.map_either_with(&mut sum, &mut f, &mut g), Right("42".into())); + /// + /// assert_eq!(sum, 47); + /// ``` + pub fn map_either_with(self, ctx: Ctx, f: F, g: G) -> Either + where + F: FnOnce(Ctx, L) -> M, + G: FnOnce(Ctx, R) -> S, + { + match self { + Left(l) => Left(f(ctx, l)), + Right(r) => Right(g(ctx, r)), + } + } + + /// Apply one of two functions depending on contents, unifying their result. If the value is + /// `Left(L)` then the first function `f` is applied; if it is `Right(R)` then the second + /// function `g` is applied. + /// + /// ``` + /// use either::*; + /// + /// fn square(n: u32) -> i32 { (n * n) as i32 } + /// fn negate(n: i32) -> i32 { -n } + /// + /// let left: Either = Left(4); + /// assert_eq!(left.either(square, negate), 16); + /// + /// let right: Either = Right(-4); + /// assert_eq!(right.either(square, negate), 4); + /// ``` + pub fn either(self, f: F, g: G) -> T + where + F: FnOnce(L) -> T, + G: FnOnce(R) -> T, + { + match self { + Left(l) => f(l), + Right(r) => g(r), + } + } + + /// Like [`either`][Self::either], but provide some context to whichever of the + /// functions ends up being called. + /// + /// ``` + /// // In this example, the context is a mutable reference + /// use either::*; + /// + /// let mut result = Vec::new(); + /// + /// let values = vec![Left(2), Right(2.7)]; + /// + /// for value in values { + /// value.either_with(&mut result, + /// |ctx, integer| ctx.push(integer), + /// |ctx, real| ctx.push(f64::round(real) as i32)); + /// } + /// + /// assert_eq!(result, vec![2, 3]); + /// ``` + pub fn either_with(self, ctx: Ctx, f: F, g: G) -> T + where + F: FnOnce(Ctx, L) -> T, + G: FnOnce(Ctx, R) -> T, + { + match self { + Left(l) => f(ctx, l), + Right(r) => g(ctx, r), + } + } + + /// Returns `other` if the value is [`Left`], otherwise returns the [`Right`] value of `self`. + /// + /// Arguments passed to `left_and` are eagerly evaluated; if you are passing the + /// result of a function call, it is recommended to use [`left_and_then`], which is + /// lazily evaluated. + /// + /// [`left_and_then`]: Either::left_and_then + /// + /// # Examples + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, u32> = Left(123); + /// assert_eq!(left.left_and::<()>(Right(246)), Right(246)); + /// assert_eq!(left.left_and(Left(246)), Left(246)); + /// + /// let right: Either = Right(123); + /// assert_eq!(right.left_and::<()>(Right(246)), Right(123)); + /// assert_eq!(right.left_and(Left(246)), Right(123)); + /// ``` + pub fn left_and(self, other: Either) -> Either { + match self { + Left(_) => other, + Right(r) => Right(r), + } + } + + /// Returns `other` if the value is [`Right`], otherwise returns the [`Left`] value of `self`. + /// + /// Arguments passed to `right_and` are eagerly evaluated; if you are passing the + /// result of a function call, it is recommended to use [`right_and_then`], which is + /// lazily evaluated. + /// + /// [`right_and_then`]: Either::right_and_then + /// + /// # Examples + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, u32> = Left(123); + /// assert_eq!(left.right_and(Right(246)), Left(123)); + /// assert_eq!(left.right_and::<()>(Left(246)), Left(123)); + /// + /// let right: Either = Right(123); + /// assert_eq!(right.right_and(Right(246)), Right(246)); + /// assert_eq!(right.right_and::<()>(Left(246)), Left(246)); + /// ``` + pub fn right_and(self, other: Either) -> Either { + match self { + Left(l) => Left(l), + Right(_) => other, + } + } + + /// Apply the function `f` on the value in the `Left` variant if it is present. + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, u32> = Left(123); + /// assert_eq!(left.left_and_then::<_,()>(|x| Right(x * 2)), Right(246)); + /// + /// let right: Either = Right(123); + /// assert_eq!(right.left_and_then(|x| Right::<(), _>(x * 2)), Right(123)); + /// ``` + pub fn left_and_then(self, f: F) -> Either + where + F: FnOnce(L) -> Either, + { + match self { + Left(l) => f(l), + Right(r) => Right(r), + } + } + + /// Apply the function `f` on the value in the `Right` variant if it is present. + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, u32> = Left(123); + /// assert_eq!(left.right_and_then(|x| Right(x * 2)), Left(123)); + /// + /// let right: Either = Right(123); + /// assert_eq!(right.right_and_then(|x| Right(x * 2)), Right(246)); + /// ``` + pub fn right_and_then(self, f: F) -> Either + where + F: FnOnce(R) -> Either, + { + match self { + Left(l) => Left(l), + Right(r) => f(r), + } + } + + /// Convert the inner value to an iterator. + /// + /// This requires the `Left` and `Right` iterators to have the same item type. + /// See [`factor_into_iter`][Either::factor_into_iter] to iterate different types. + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, Vec> = Left(vec![1, 2, 3, 4, 5]); + /// let mut right: Either, _> = Right(vec![]); + /// right.extend(left.into_iter()); + /// assert_eq!(right, Right(vec![1, 2, 3, 4, 5])); + /// ``` + #[allow(clippy::should_implement_trait)] + pub fn into_iter(self) -> Either + where + L: IntoIterator, + R: IntoIterator, + { + map_both!(self, inner => inner.into_iter()) + } + + /// Borrow the inner value as an iterator. + /// + /// This requires the `Left` and `Right` iterators to have the same item type. + /// See [`factor_iter`][Either::factor_iter] to iterate different types. + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, &[u32]> = Left(vec![2, 3]); + /// let mut right: Either, _> = Right(&[4, 5][..]); + /// let mut all = vec![1]; + /// all.extend(left.iter()); + /// all.extend(right.iter()); + /// assert_eq!(all, vec![1, 2, 3, 4, 5]); + /// ``` + pub fn iter(&self) -> Either<<&L as IntoIterator>::IntoIter, <&R as IntoIterator>::IntoIter> + where + for<'a> &'a L: IntoIterator, + for<'a> &'a R: IntoIterator::Item>, + { + map_both!(self, inner => inner.into_iter()) + } + + /// Mutably borrow the inner value as an iterator. + /// + /// This requires the `Left` and `Right` iterators to have the same item type. + /// See [`factor_iter_mut`][Either::factor_iter_mut] to iterate different types. + /// + /// ``` + /// use either::*; + /// + /// let mut left: Either<_, &mut [u32]> = Left(vec![2, 3]); + /// for l in left.iter_mut() { + /// *l *= *l + /// } + /// assert_eq!(left, Left(vec![4, 9])); + /// + /// let mut inner = [4, 5]; + /// let mut right: Either, _> = Right(&mut inner[..]); + /// for r in right.iter_mut() { + /// *r *= *r + /// } + /// assert_eq!(inner, [16, 25]); + /// ``` + pub fn iter_mut( + &mut self, + ) -> Either<<&mut L as IntoIterator>::IntoIter, <&mut R as IntoIterator>::IntoIter> + where + for<'a> &'a mut L: IntoIterator, + for<'a> &'a mut R: IntoIterator::Item>, + { + map_both!(self, inner => inner.into_iter()) + } + + /// Converts an `Either` of `Iterator`s to be an `Iterator` of `Either`s + /// + /// Unlike [`into_iter`][Either::into_iter], this does not require the + /// `Left` and `Right` iterators to have the same item type. + /// + /// ``` + /// use either::*; + /// let left: Either<_, Vec> = Left(&["hello"]); + /// assert_eq!(left.factor_into_iter().next(), Some(Left(&"hello"))); + /// + /// let right: Either<&[&str], _> = Right(vec![0, 1]); + /// assert_eq!(right.factor_into_iter().collect::>(), vec![Right(0), Right(1)]); + /// + /// ``` + pub fn factor_into_iter(self) -> IterEither + where + L: IntoIterator, + R: IntoIterator, + { + IterEither::new(map_both!(self, inner => inner.into_iter())) + } + + /// Borrows an `Either` of `Iterator`s to be an `Iterator` of `Either`s + /// + /// Unlike [`iter`][Either::iter], this does not require the + /// `Left` and `Right` iterators to have the same item type. + /// + /// ``` + /// use either::*; + /// let left: Either<_, Vec> = Left(["hello"]); + /// assert_eq!(left.factor_iter().next(), Some(Left(&"hello"))); + /// + /// let right: Either<[&str; 2], _> = Right(vec![0, 1]); + /// assert_eq!(right.factor_iter().collect::>(), vec![Right(&0), Right(&1)]); + /// + /// ``` + pub fn factor_iter( + &self, + ) -> IterEither<<&L as IntoIterator>::IntoIter, <&R as IntoIterator>::IntoIter> + where + for<'a> &'a L: IntoIterator, + for<'a> &'a R: IntoIterator, + { + IterEither::new(map_both!(self, inner => inner.into_iter())) + } + + /// Mutably borrows an `Either` of `Iterator`s to be an `Iterator` of `Either`s + /// + /// Unlike [`iter_mut`][Either::iter_mut], this does not require the + /// `Left` and `Right` iterators to have the same item type. + /// + /// ``` + /// use either::*; + /// let mut left: Either<_, Vec> = Left(["hello"]); + /// left.factor_iter_mut().for_each(|x| *x.unwrap_left() = "goodbye"); + /// assert_eq!(left, Left(["goodbye"])); + /// + /// let mut right: Either<[&str; 2], _> = Right(vec![0, 1, 2]); + /// right.factor_iter_mut().for_each(|x| if let Right(r) = x { *r = -*r; }); + /// assert_eq!(right, Right(vec![0, -1, -2])); + /// + /// ``` + pub fn factor_iter_mut( + &mut self, + ) -> IterEither<<&mut L as IntoIterator>::IntoIter, <&mut R as IntoIterator>::IntoIter> + where + for<'a> &'a mut L: IntoIterator, + for<'a> &'a mut R: IntoIterator, + { + IterEither::new(map_both!(self, inner => inner.into_iter())) + } + + /// Return left value or given value + /// + /// Arguments passed to `left_or` are eagerly evaluated; if you are passing + /// the result of a function call, it is recommended to use + /// [`left_or_else`][Self::left_or_else], which is lazily evaluated. + /// + /// # Examples + /// + /// ``` + /// # use either::*; + /// let left: Either<&str, &str> = Left("left"); + /// assert_eq!(left.left_or("foo"), "left"); + /// + /// let right: Either<&str, &str> = Right("right"); + /// assert_eq!(right.left_or("left"), "left"); + /// ``` + pub fn left_or(self, other: L) -> L { + match self { + Either::Left(l) => l, + Either::Right(_) => other, + } + } + + /// Return left or a default + /// + /// # Examples + /// + /// ``` + /// # use either::*; + /// let left: Either = Left("left".to_string()); + /// assert_eq!(left.left_or_default(), "left"); + /// + /// let right: Either = Right(42); + /// assert_eq!(right.left_or_default(), String::default()); + /// ``` + pub fn left_or_default(self) -> L + where + L: Default, + { + match self { + Either::Left(l) => l, + Either::Right(_) => L::default(), + } + } + + /// Returns left value or computes it from a closure + /// + /// # Examples + /// + /// ``` + /// # use either::*; + /// let left: Either = Left("3".to_string()); + /// assert_eq!(left.left_or_else(|_| unreachable!()), "3"); + /// + /// let right: Either = Right(3); + /// assert_eq!(right.left_or_else(|x| x.to_string()), "3"); + /// ``` + pub fn left_or_else(self, f: F) -> L + where + F: FnOnce(R) -> L, + { + match self { + Either::Left(l) => l, + Either::Right(r) => f(r), + } + } + + /// Return right value or given value + /// + /// Arguments passed to `right_or` are eagerly evaluated; if you are passing + /// the result of a function call, it is recommended to use + /// [`right_or_else`][Self::right_or_else], which is lazily evaluated. + /// + /// # Examples + /// + /// ``` + /// # use either::*; + /// let right: Either<&str, &str> = Right("right"); + /// assert_eq!(right.right_or("foo"), "right"); + /// + /// let left: Either<&str, &str> = Left("left"); + /// assert_eq!(left.right_or("right"), "right"); + /// ``` + pub fn right_or(self, other: R) -> R { + match self { + Either::Left(_) => other, + Either::Right(r) => r, + } + } + + /// Return right or a default + /// + /// # Examples + /// + /// ``` + /// # use either::*; + /// let left: Either = Left("left".to_string()); + /// assert_eq!(left.right_or_default(), u32::default()); + /// + /// let right: Either = Right(42); + /// assert_eq!(right.right_or_default(), 42); + /// ``` + pub fn right_or_default(self) -> R + where + R: Default, + { + match self { + Either::Left(_) => R::default(), + Either::Right(r) => r, + } + } + + /// Returns right value or computes it from a closure + /// + /// # Examples + /// + /// ``` + /// # use either::*; + /// let left: Either = Left("3".to_string()); + /// assert_eq!(left.right_or_else(|x| x.parse().unwrap()), 3); + /// + /// let right: Either = Right(3); + /// assert_eq!(right.right_or_else(|_| unreachable!()), 3); + /// ``` + pub fn right_or_else(self, f: F) -> R + where + F: FnOnce(L) -> R, + { + match self { + Either::Left(l) => f(l), + Either::Right(r) => r, + } + } + + /// Returns the left value + /// + /// # Examples + /// + /// ``` + /// # use either::*; + /// let left: Either<_, ()> = Left(3); + /// assert_eq!(left.unwrap_left(), 3); + /// ``` + /// + /// # Panics + /// + /// When `Either` is a `Right` value + /// + /// ```should_panic + /// # use either::*; + /// let right: Either<(), _> = Right(3); + /// right.unwrap_left(); + /// ``` + #[track_caller] + pub fn unwrap_left(self) -> L + where + R: core::fmt::Debug, + { + match self { + Either::Left(l) => l, + Either::Right(r) => { + panic!("called `Either::unwrap_left()` on a `Right` value: {:?}", r) + } + } + } + + /// Returns the right value + /// + /// # Examples + /// + /// ``` + /// # use either::*; + /// let right: Either<(), _> = Right(3); + /// assert_eq!(right.unwrap_right(), 3); + /// ``` + /// + /// # Panics + /// + /// When `Either` is a `Left` value + /// + /// ```should_panic + /// # use either::*; + /// let left: Either<_, ()> = Left(3); + /// left.unwrap_right(); + /// ``` + #[track_caller] + pub fn unwrap_right(self) -> R + where + L: core::fmt::Debug, + { + match self { + Either::Right(r) => r, + Either::Left(l) => panic!("called `Either::unwrap_right()` on a `Left` value: {:?}", l), + } + } + + /// Returns the left value + /// + /// # Examples + /// + /// ``` + /// # use either::*; + /// let left: Either<_, ()> = Left(3); + /// assert_eq!(left.expect_left("value was Right"), 3); + /// ``` + /// + /// # Panics + /// + /// When `Either` is a `Right` value + /// + /// ```should_panic + /// # use either::*; + /// let right: Either<(), _> = Right(3); + /// right.expect_left("value was Right"); + /// ``` + #[track_caller] + pub fn expect_left(self, msg: &str) -> L + where + R: core::fmt::Debug, + { + match self { + Either::Left(l) => l, + Either::Right(r) => panic!("{}: {:?}", msg, r), + } + } + + /// Returns the right value + /// + /// # Examples + /// + /// ``` + /// # use either::*; + /// let right: Either<(), _> = Right(3); + /// assert_eq!(right.expect_right("value was Left"), 3); + /// ``` + /// + /// # Panics + /// + /// When `Either` is a `Left` value + /// + /// ```should_panic + /// # use either::*; + /// let left: Either<_, ()> = Left(3); + /// left.expect_right("value was Right"); + /// ``` + #[track_caller] + pub fn expect_right(self, msg: &str) -> R + where + L: core::fmt::Debug, + { + match self { + Either::Right(r) => r, + Either::Left(l) => panic!("{}: {:?}", msg, l), + } + } + + /// Calls a function with a reference to the contained value if [`Left`]. + /// + /// Returns the original self. + /// + /// # Examples + /// + /// ``` + /// use either::*; + /// + /// # fn foo() -> Either { Right(2) } + /// let x = foo() + /// .inspect_left(|n| println!("left: {n}")) + /// .left_or(0); + /// ``` + pub fn inspect_left(self, f: F) -> Self + where + F: FnOnce(&L), + { + if let Left(ref left) = self { + f(left); + } + + self + } + + /// Calls a function with a reference to the contained value if [`Right`]. + /// + /// Returns the original self. + /// + /// # Examples + /// + /// ``` + /// use either::*; + /// + /// # fn foo() -> Either { Right(2) } + /// let x = foo() + /// .inspect_right(|n| println!("right: {n}")) + /// .left_or(0); + /// ``` + pub fn inspect_right(self, f: F) -> Self + where + F: FnOnce(&R), + { + if let Right(ref right) = self { + f(right); + } + + self + } + + /// Convert the contained value into `T` + /// + /// # Examples + /// + /// ``` + /// # use either::*; + /// // Both u16 and u32 can be converted to u64. + /// let left: Either = Left(3u16); + /// assert_eq!(left.either_into::(), 3u64); + /// let right: Either = Right(7u32); + /// assert_eq!(right.either_into::(), 7u64); + /// ``` + pub fn either_into(self) -> T + where + L: Into, + R: Into, + { + for_both!(self, inner => inner.into()) + } +} + +impl Either, Option> { + /// Factors out `None` from an `Either` of [`Option`]. + /// + /// ``` + /// use either::*; + /// let left: Either<_, Option> = Left(Some(vec![0])); + /// assert_eq!(left.factor_none(), Some(Left(vec![0]))); + /// + /// let right: Either>, _> = Right(Some(String::new())); + /// assert_eq!(right.factor_none(), Some(Right(String::new()))); + /// ``` + #[doc(alias = "transpose")] + pub fn factor_none(self) -> Option> { + match self { + Left(l) => l.map(Either::Left), + Right(r) => r.map(Either::Right), + } + } +} + +impl Either, Result> { + /// Factors out a homogeneous type from an `Either` of [`Result`]. + /// + /// Here, the homogeneous type is the `Err` type of the [`Result`]. + /// + /// ``` + /// use either::*; + /// let left: Either<_, Result> = Left(Ok(vec![0])); + /// assert_eq!(left.factor_err(), Ok(Left(vec![0]))); + /// + /// let right: Either, u32>, _> = Right(Ok(String::new())); + /// assert_eq!(right.factor_err(), Ok(Right(String::new()))); + /// ``` + #[doc(alias = "transpose")] + pub fn factor_err(self) -> Result, E> { + match self { + Left(l) => l.map(Either::Left), + Right(r) => r.map(Either::Right), + } + } +} + +impl Either, Result> { + /// Factors out a homogeneous type from an `Either` of [`Result`]. + /// + /// Here, the homogeneous type is the `Ok` type of the [`Result`]. + /// + /// ``` + /// use either::*; + /// let left: Either<_, Result> = Left(Err(vec![0])); + /// assert_eq!(left.factor_ok(), Err(Left(vec![0]))); + /// + /// let right: Either>, _> = Right(Err(String::new())); + /// assert_eq!(right.factor_ok(), Err(Right(String::new()))); + /// ``` + #[doc(alias = "transpose")] + pub fn factor_ok(self) -> Result> { + match self { + Left(l) => l.map_err(Either::Left), + Right(r) => r.map_err(Either::Right), + } + } +} + +impl Either<(T, L), (T, R)> { + /// Factor out a homogeneous type from an either of pairs. + /// + /// Here, the homogeneous type is the first element of the pairs. + /// + /// ``` + /// use either::*; + /// let left: Either<_, (u32, String)> = Left((123, vec![0])); + /// assert_eq!(left.factor_first().0, 123); + /// + /// let right: Either<(u32, Vec), _> = Right((123, String::new())); + /// assert_eq!(right.factor_first().0, 123); + /// ``` + pub fn factor_first(self) -> (T, Either) { + match self { + Left((t, l)) => (t, Left(l)), + Right((t, r)) => (t, Right(r)), + } + } +} + +impl Either<(L, T), (R, T)> { + /// Factor out a homogeneous type from an either of pairs. + /// + /// Here, the homogeneous type is the second element of the pairs. + /// + /// ``` + /// use either::*; + /// let left: Either<_, (String, u32)> = Left((vec![0], 123)); + /// assert_eq!(left.factor_second().1, 123); + /// + /// let right: Either<(Vec, u32), _> = Right((String::new(), 123)); + /// assert_eq!(right.factor_second().1, 123); + /// ``` + pub fn factor_second(self) -> (Either, T) { + match self { + Left((l, t)) => (Left(l), t), + Right((r, t)) => (Right(r), t), + } + } +} + +impl Either { + /// Extract the value of an either over two equivalent types. + /// + /// ``` + /// use either::*; + /// + /// let left: Either<_, u32> = Left(123); + /// assert_eq!(left.into_inner(), 123); + /// + /// let right: Either = Right(123); + /// assert_eq!(right.into_inner(), 123); + /// ``` + pub fn into_inner(self) -> T { + for_both!(self, inner => inner) + } + + /// Map `f` over the contained value and return the result in the + /// corresponding variant. + /// + /// ``` + /// use either::*; + /// + /// let value: Either<_, i32> = Right(42); + /// + /// let other = value.map(|x| x * 2); + /// assert_eq!(other, Right(84)); + /// ``` + pub fn map(self, f: F) -> Either + where + F: FnOnce(T) -> M, + { + map_both!(self, t => f(t)) + } +} + +impl Either<&L, &R> { + /// Maps an `Either<&L, &R>` to an `Either` by cloning the contents of + /// either branch. + pub fn cloned(self) -> Either + where + L: Clone, + R: Clone, + { + map_both!(self, inner => inner.clone()) + } + + /// Maps an `Either<&L, &R>` to an `Either` by copying the contents of + /// either branch. + pub fn copied(self) -> Either + where + L: Copy, + R: Copy, + { + map_both!(self, inner => *inner) + } +} + +impl Either<&mut L, &mut R> { + /// Maps an `Either<&mut L, &mut R>` to an `Either` by cloning the contents of + /// either branch. + pub fn cloned(self) -> Either + where + L: Clone, + R: Clone, + { + map_both!(self, inner => inner.clone()) + } + + /// Maps an `Either<&mut L, &mut R>` to an `Either` by copying the contents of + /// either branch. + pub fn copied(self) -> Either + where + L: Copy, + R: Copy, + { + map_both!(self, inner => *inner) + } +} + +/// Convert from `Result` to `Either` with `Ok => Right` and `Err => Left`. +impl From> for Either { + fn from(r: Result) -> Self { + match r { + Err(e) => Left(e), + Ok(o) => Right(o), + } + } +} + +/// Convert from `Either` to `Result` with `Right => Ok` and `Left => Err`. +impl From> for Result { + fn from(val: Either) -> Self { + match val { + Left(l) => Err(l), + Right(r) => Ok(r), + } + } +} + +/// `Either` is a future if both `L` and `R` are futures. +impl Future for Either +where + L: Future, + R: Future, +{ + type Output = L::Output; + + fn poll( + self: Pin<&mut Self>, + cx: &mut core::task::Context<'_>, + ) -> core::task::Poll { + for_both!(self.as_pin_mut(), inner => inner.poll(cx)) + } +} + +#[cfg(any(test, feature = "std"))] +/// `Either` implements `Read` if both `L` and `R` do. +/// +/// Requires crate feature `"std"` +impl Read for Either +where + L: Read, + R: Read, +{ + fn read(&mut self, buf: &mut [u8]) -> io::Result { + for_both!(self, inner => inner.read(buf)) + } + + fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> { + for_both!(self, inner => inner.read_exact(buf)) + } + + fn read_to_end(&mut self, buf: &mut std::vec::Vec) -> io::Result { + for_both!(self, inner => inner.read_to_end(buf)) + } + + fn read_to_string(&mut self, buf: &mut std::string::String) -> io::Result { + for_both!(self, inner => inner.read_to_string(buf)) + } +} + +#[cfg(any(test, feature = "std"))] +/// `Either` implements `Seek` if both `L` and `R` do. +/// +/// Requires crate feature `"std"` +impl Seek for Either +where + L: Seek, + R: Seek, +{ + fn seek(&mut self, pos: SeekFrom) -> io::Result { + for_both!(self, inner => inner.seek(pos)) + } +} + +#[cfg(any(test, feature = "std"))] +/// Requires crate feature `"std"` +impl BufRead for Either +where + L: BufRead, + R: BufRead, +{ + fn fill_buf(&mut self) -> io::Result<&[u8]> { + for_both!(self, inner => inner.fill_buf()) + } + + fn consume(&mut self, amt: usize) { + for_both!(self, inner => inner.consume(amt)) + } + + fn read_until(&mut self, byte: u8, buf: &mut std::vec::Vec) -> io::Result { + for_both!(self, inner => inner.read_until(byte, buf)) + } + + fn read_line(&mut self, buf: &mut std::string::String) -> io::Result { + for_both!(self, inner => inner.read_line(buf)) + } +} + +#[cfg(any(test, feature = "std"))] +/// `Either` implements `Write` if both `L` and `R` do. +/// +/// Requires crate feature `"std"` +impl Write for Either +where + L: Write, + R: Write, +{ + fn write(&mut self, buf: &[u8]) -> io::Result { + for_both!(self, inner => inner.write(buf)) + } + + fn write_all(&mut self, buf: &[u8]) -> io::Result<()> { + for_both!(self, inner => inner.write_all(buf)) + } + + fn write_fmt(&mut self, fmt: fmt::Arguments<'_>) -> io::Result<()> { + for_both!(self, inner => inner.write_fmt(fmt)) + } + + fn flush(&mut self) -> io::Result<()> { + for_both!(self, inner => inner.flush()) + } +} + +impl AsRef for Either +where + L: AsRef, + R: AsRef, +{ + fn as_ref(&self) -> &Target { + for_both!(self, inner => inner.as_ref()) + } +} + +macro_rules! impl_specific_ref_and_mut { + ($t:ty, $($attr:meta),* ) => { + $(#[$attr])* + impl AsRef<$t> for Either + where L: AsRef<$t>, R: AsRef<$t> + { + fn as_ref(&self) -> &$t { + for_both!(self, inner => inner.as_ref()) + } + } + + $(#[$attr])* + impl AsMut<$t> for Either + where L: AsMut<$t>, R: AsMut<$t> + { + fn as_mut(&mut self) -> &mut $t { + for_both!(self, inner => inner.as_mut()) + } + } + }; +} + +impl_specific_ref_and_mut!(str,); +impl_specific_ref_and_mut!( + ::std::path::Path, + cfg(feature = "std"), + doc = "Requires crate feature `std`." +); +impl_specific_ref_and_mut!( + ::std::ffi::OsStr, + cfg(feature = "std"), + doc = "Requires crate feature `std`." +); +impl_specific_ref_and_mut!( + ::std::ffi::CStr, + cfg(feature = "std"), + doc = "Requires crate feature `std`." +); + +impl AsRef<[Target]> for Either +where + L: AsRef<[Target]>, + R: AsRef<[Target]>, +{ + fn as_ref(&self) -> &[Target] { + for_both!(self, inner => inner.as_ref()) + } +} + +impl AsMut for Either +where + L: AsMut, + R: AsMut, +{ + fn as_mut(&mut self) -> &mut Target { + for_both!(self, inner => inner.as_mut()) + } +} + +impl AsMut<[Target]> for Either +where + L: AsMut<[Target]>, + R: AsMut<[Target]>, +{ + fn as_mut(&mut self) -> &mut [Target] { + for_both!(self, inner => inner.as_mut()) + } +} + +impl Deref for Either +where + L: Deref, + R: Deref, +{ + type Target = L::Target; + + fn deref(&self) -> &Self::Target { + for_both!(self, inner => &**inner) + } +} + +impl DerefMut for Either +where + L: DerefMut, + R: DerefMut, +{ + fn deref_mut(&mut self) -> &mut Self::Target { + for_both!(self, inner => &mut *inner) + } +} + +#[cfg(any(test, feature = "std"))] +/// `Either` implements `Error` if *both* `L` and `R` implement it. +/// +/// Requires crate feature `"std"` +impl Error for Either +where + L: Error, + R: Error, +{ + fn source(&self) -> Option<&(dyn Error + 'static)> { + for_both!(self, inner => inner.source()) + } + + #[allow(deprecated)] + fn description(&self) -> &str { + for_both!(self, inner => inner.description()) + } + + #[allow(deprecated)] + fn cause(&self) -> Option<&dyn Error> { + for_both!(self, inner => inner.cause()) + } +} + +impl fmt::Display for Either +where + L: fmt::Display, + R: fmt::Display, +{ + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + for_both!(self, inner => inner.fmt(f)) + } +} + +impl fmt::Write for Either +where + L: fmt::Write, + R: fmt::Write, +{ + fn write_str(&mut self, s: &str) -> fmt::Result { + for_both!(self, inner => inner.write_str(s)) + } + + fn write_char(&mut self, c: char) -> fmt::Result { + for_both!(self, inner => inner.write_char(c)) + } + + fn write_fmt(&mut self, args: fmt::Arguments<'_>) -> fmt::Result { + for_both!(self, inner => inner.write_fmt(args)) + } +} + +#[test] +fn basic() { + let mut e = Left(2); + let r = Right(2); + assert_eq!(e, Left(2)); + e = r; + assert_eq!(e, Right(2)); + assert_eq!(e.left(), None); + assert_eq!(e.right(), Some(2)); + assert_eq!(e.as_ref().right(), Some(&2)); + assert_eq!(e.as_mut().right(), Some(&mut 2)); +} + +#[test] +fn macros() { + use std::string::String; + + fn a() -> Either { + let x: u32 = try_left!(Right(1337u32)); + Left(x * 2) + } + assert_eq!(a(), Right(1337)); + + fn b() -> Either { + Right(try_right!(Left("foo bar"))) + } + assert_eq!(b(), Left(String::from("foo bar"))); +} + +#[test] +fn deref() { + use std::string::String; + + fn is_str(_: &str) {} + let value: Either = Left(String::from("test")); + is_str(&value); +} + +#[test] +fn iter() { + let x = 3; + let mut iter = match x { + 3 => Left(0..10), + _ => Right(17..), + }; + + assert_eq!(iter.next(), Some(0)); + assert_eq!(iter.count(), 9); +} + +#[test] +fn seek() { + use std::io; + + let use_empty = false; + let mut mockdata = [0x00; 256]; + for (i, data) in mockdata.iter_mut().enumerate() { + *data = i as u8; + } + + let mut reader = if use_empty { + // Empty didn't impl Seek until Rust 1.51 + Left(io::Cursor::new([])) + } else { + Right(io::Cursor::new(&mockdata[..])) + }; + + let mut buf = [0u8; 16]; + assert_eq!(reader.read(&mut buf).unwrap(), buf.len()); + assert_eq!(buf, mockdata[..buf.len()]); + + // the first read should advance the cursor and return the next 16 bytes thus the `ne` + assert_eq!(reader.read(&mut buf).unwrap(), buf.len()); + assert_ne!(buf, mockdata[..buf.len()]); + + // if the seek operation fails it should read 16..31 instead of 0..15 + reader.seek(io::SeekFrom::Start(0)).unwrap(); + assert_eq!(reader.read(&mut buf).unwrap(), buf.len()); + assert_eq!(buf, mockdata[..buf.len()]); +} + +#[test] +fn read_write() { + use std::io; + + let use_stdio = false; + let mockdata = [0xff; 256]; + + let mut reader = if use_stdio { + Left(io::stdin()) + } else { + Right(&mockdata[..]) + }; + + let mut buf = [0u8; 16]; + assert_eq!(reader.read(&mut buf).unwrap(), buf.len()); + assert_eq!(&buf, &mockdata[..buf.len()]); + + let mut mockbuf = [0u8; 256]; + let mut writer = if use_stdio { + Left(io::stdout()) + } else { + Right(&mut mockbuf[..]) + }; + + let buf = [1u8; 16]; + assert_eq!(writer.write(&buf).unwrap(), buf.len()); +} + +#[test] +fn error() { + let invalid_utf8 = b"\xff"; + #[allow(invalid_from_utf8)] + let res = if let Err(error) = ::std::str::from_utf8(invalid_utf8) { + Err(Left(error)) + } else if let Err(error) = "x".parse::() { + Err(Right(error)) + } else { + Ok(()) + }; + assert!(res.is_err()); + #[allow(deprecated)] + res.unwrap_err().description(); // make sure this can be called +} + +/// A helper macro to check if AsRef and AsMut are implemented for a given type. +macro_rules! check_t { + ($t:ty) => {{ + fn check_ref>() {} + fn propagate_ref, T2: AsRef<$t>>() { + check_ref::>() + } + fn check_mut>() {} + fn propagate_mut, T2: AsMut<$t>>() { + check_mut::>() + } + }}; +} + +// This "unused" method is here to ensure that compilation doesn't fail on given types. +fn _unsized_ref_propagation() { + check_t!(str); + + fn check_array_ref, Item>() {} + fn check_array_mut, Item>() {} + + fn propagate_array_ref, T2: AsRef<[Item]>, Item>() { + check_array_ref::, _>() + } + + fn propagate_array_mut, T2: AsMut<[Item]>, Item>() { + check_array_mut::, _>() + } +} + +// This "unused" method is here to ensure that compilation doesn't fail on given types. +#[cfg(feature = "std")] +fn _unsized_std_propagation() { + check_t!(::std::path::Path); + check_t!(::std::ffi::OsStr); + check_t!(::std::ffi::CStr); +} diff --git a/either-1.16.0/src/serde_untagged.rs b/either-1.16.0/src/serde_untagged.rs new file mode 100644 index 0000000000..d62dd7d065 --- /dev/null +++ b/either-1.16.0/src/serde_untagged.rs @@ -0,0 +1,69 @@ +//! Untagged serialization/deserialization support for `Either`. +//! +//! `Either` uses default, externally-tagged representation. +//! However, sometimes it is useful to support several alternative types. +//! For example, we may have a field which is generally a `HashMap` +//! but in typical cases `Vec` would suffice, too. +//! +//! ```rust +//! # fn main() -> Result<(), Box> { +//! use either::Either; +//! use std::collections::HashMap; +//! +//! #[derive(serde::Serialize, serde::Deserialize, Debug)] +//! #[serde(transparent)] +//! struct IntOrString { +//! #[serde(with = "either::serde_untagged")] +//! inner: Either, HashMap> +//! }; +//! +//! // serialization +//! let data = IntOrString { +//! inner: Either::Left(vec!["Hello".to_string()]) +//! }; +//! // notice: no tags are emitted. +//! assert_eq!(serde_json::to_string(&data)?, r#"["Hello"]"#); +//! +//! // deserialization +//! let data: IntOrString = serde_json::from_str( +//! r#"{"a": 0, "b": 14}"# +//! )?; +//! println!("found {:?}", data); +//! # Ok(()) +//! # } +//! ``` + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[derive(serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +enum Either { + Left(L), + Right(R), +} + +pub fn serialize(this: &super::Either, serializer: S) -> Result +where + S: Serializer, + L: Serialize, + R: Serialize, +{ + let untagged = match this { + super::Either::Left(left) => Either::Left(left), + super::Either::Right(right) => Either::Right(right), + }; + untagged.serialize(serializer) +} + +pub fn deserialize<'de, L, R, D>(deserializer: D) -> Result, D::Error> +where + D: Deserializer<'de>, + L: Deserialize<'de>, + R: Deserialize<'de>, +{ + match Either::deserialize(deserializer) { + Ok(Either::Left(left)) => Ok(super::Either::Left(left)), + Ok(Either::Right(right)) => Ok(super::Either::Right(right)), + Err(error) => Err(error), + } +} diff --git a/either-1.16.0/src/serde_untagged_optional.rs b/either-1.16.0/src/serde_untagged_optional.rs new file mode 100644 index 0000000000..d1316935c4 --- /dev/null +++ b/either-1.16.0/src/serde_untagged_optional.rs @@ -0,0 +1,74 @@ +//! Untagged serialization/deserialization support for `Option>`. +//! +//! `Either` uses default, externally-tagged representation. +//! However, sometimes it is useful to support several alternative types. +//! For example, we may have a field which is generally a `HashMap` +//! but in typical cases `Vec` would suffice, too. +//! +//! ```rust +//! # fn main() -> Result<(), Box> { +//! use either::Either; +//! use std::collections::HashMap; +//! +//! #[derive(serde::Serialize, serde::Deserialize, Debug)] +//! #[serde(transparent)] +//! struct IntOrString { +//! #[serde(with = "either::serde_untagged_optional")] +//! inner: Option, HashMap>> +//! }; +//! +//! // serialization +//! let data = IntOrString { +//! inner: Some(Either::Left(vec!["Hello".to_string()])) +//! }; +//! // notice: no tags are emitted. +//! assert_eq!(serde_json::to_string(&data)?, r#"["Hello"]"#); +//! +//! // deserialization +//! let data: IntOrString = serde_json::from_str( +//! r#"{"a": 0, "b": 14}"# +//! )?; +//! println!("found {:?}", data); +//! # Ok(()) +//! # } +//! ``` + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[derive(Serialize, Deserialize)] +#[serde(untagged)] +enum Either { + Left(L), + Right(R), +} + +pub fn serialize( + this: &Option>, + serializer: S, +) -> Result +where + S: Serializer, + L: Serialize, + R: Serialize, +{ + let untagged = match this { + Some(super::Either::Left(left)) => Some(Either::Left(left)), + Some(super::Either::Right(right)) => Some(Either::Right(right)), + None => None, + }; + untagged.serialize(serializer) +} + +pub fn deserialize<'de, L, R, D>(deserializer: D) -> Result>, D::Error> +where + D: Deserializer<'de>, + L: Deserialize<'de>, + R: Deserialize<'de>, +{ + match Option::deserialize(deserializer) { + Ok(Some(Either::Left(left))) => Ok(Some(super::Either::Left(left))), + Ok(Some(Either::Right(right))) => Ok(Some(super::Either::Right(right))), + Ok(None) => Ok(None), + Err(error) => Err(error), + } +} diff --git a/endian-type-0.1.2/.cargo-checksum.json b/endian-type-0.1.2/.cargo-checksum.json new file mode 100644 index 0000000000..824cc7d0af --- /dev/null +++ b/endian-type-0.1.2/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"c6caf6a591cb0174aa8b6c7782496ebe7462c95d9236ee2a2fc37fe750495e0b","LICENSE":"2a50d5b85df79a0ad844670b1c93fbbbfa2d243e23109ab04c3b273950efa329","src/lib.rs":"aa19bb9dd61ec389893bdba5a3e96a6e03b912f8ca40213d60278663959108f1"},"package":"c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d"} \ No newline at end of file diff --git a/endian-type-0.1.2/Cargo.toml b/endian-type-0.1.2/Cargo.toml new file mode 100644 index 0000000000..bf0dac130a --- /dev/null +++ b/endian-type-0.1.2/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "endian-type" +version = "0.1.2" +authors = ["Lolirofle "] +description = "Type safe wrappers for types with a defined byte order" +#documentation = "..." +homepage = "https://github.com/Lolirofle/endian-type" +repository = "https://github.com/Lolirofle/endian-type.git" +#readme = "README.md" +keywords = ["endian","byteorder"] +license = "MIT" diff --git a/endian-type-0.1.2/LICENSE b/endian-type-0.1.2/LICENSE new file mode 100644 index 0000000000..20efd1b3e9 --- /dev/null +++ b/endian-type-0.1.2/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/endian-type-0.1.2/src/lib.rs b/endian-type-0.1.2/src/lib.rs new file mode 100644 index 0000000000..c28524e8b5 --- /dev/null +++ b/endian-type-0.1.2/src/lib.rs @@ -0,0 +1,203 @@ +use std::{mem,slice}; +use std::convert::{From,Into}; +use std::ops::{BitAnd,BitOr,BitXor}; + +///Type with a specified byte order +pub trait Endian{} + +macro_rules! impl_Endian{ + ( for $e:ident) => { + impl BitAnd for $e + where T: BitAnd + { + type Output = $e<::Output>; + + #[inline] + fn bitand(self,other: Self) -> Self::Output{ + $e(self.0 & other.0) + } + } + impl BitOr for $e + where T: BitOr + { + type Output = $e<::Output>; + + #[inline] + fn bitor(self,other: Self) -> Self::Output{ + $e(self.0 | other.0) + } + } + impl BitXor for $e + where T: BitXor + { + type Output = $e<::Output>; + + #[inline] + fn bitxor(self,other: Self) -> Self::Output{ + $e(self.0 ^ other.0) + } + } + + impl $e + where T: Sized + Copy + { + #[inline] + pub fn from_bytes(bytes: &[u8]) -> Self{ + debug_assert!(bytes.len() >= mem::size_of::()); + $e(unsafe{*(bytes.as_ptr() as *const T)}) + } + + #[inline] + pub fn as_bytes(&self) -> &[u8]{ + unsafe{slice::from_raw_parts( + &self.0 as *const T as *const u8, + mem::size_of::() + )} + } + + /*pub fn write_bytes(self,buffer: &mut [u8]){ + debug_assert!(buffer.len() >= mem::size_of::()); + let bytes = mem::transmute::<_,[u8; mem::size_of::()]>(); + unsafe{ptr::copy_nonoverlapping(bytes.as_ptr(),buffer.as_mut_ptr(),mem::size_of::())}; + }*/ + } + } +} + + + +///Big endian byte order +/// +///Most significant byte first +#[derive(Copy,Clone,Debug,Eq,PartialEq,Hash,Ord,PartialOrd)] +pub struct BigEndian(T); +impl Endian for BigEndian{} +macro_rules! impl_for_BigEndian{ + ( $t:ident ) => { + impl Into<$t> for BigEndian<$t>{ + #[inline] + fn into(self) -> $t{ + $t::from_be(self.0) + } + } + + impl From<$t> for BigEndian<$t>{ + #[inline] + fn from(data: $t) -> Self{ + BigEndian(data.to_be()) + } + } + + impl From> for BigEndian<$t>{ + #[inline] + fn from(data: LittleEndian<$t>) -> Self{ + BigEndian(data.0.swap_bytes()) + } + } + } +} +impl_Endian!(for BigEndian); +impl_for_BigEndian!(u16); +impl_for_BigEndian!(u32); +impl_for_BigEndian!(u64); +impl_for_BigEndian!(usize); +impl_for_BigEndian!(i16); +impl_for_BigEndian!(i32); +impl_for_BigEndian!(i64); +impl_for_BigEndian!(isize); + + + +///Little endian byte order +/// +///Least significant byte first +#[derive(Copy,Clone,Debug,Eq,PartialEq,Hash,Ord,PartialOrd)] +pub struct LittleEndian(T); +impl Endian for LittleEndian{} +macro_rules! impl_for_LittleEndian{ + ( $t:ident ) => { + impl Into<$t> for LittleEndian<$t>{ + #[inline] + fn into(self) -> $t{ + $t::from_le(self.0) + } + } + + impl From<$t> for LittleEndian<$t>{ + #[inline] + fn from(data: $t) -> Self{ + LittleEndian(data.to_le()) + } + } + + impl From> for LittleEndian<$t>{ + #[inline] + fn from(data: BigEndian<$t>) -> Self{ + LittleEndian(data.0.swap_bytes()) + } + } + } +} +impl_Endian!(for LittleEndian); +impl_for_LittleEndian!(u16); +impl_for_LittleEndian!(u32); +impl_for_LittleEndian!(u64); +impl_for_LittleEndian!(usize); +impl_for_LittleEndian!(i16); +impl_for_LittleEndian!(i32); +impl_for_LittleEndian!(i64); +impl_for_LittleEndian!(isize); + + +///Network byte order as defined by IETF RFC1700 [http://tools.ietf.org/html/rfc1700] +pub type NetworkOrder = BigEndian; + + +///Type aliases for primitive types +pub mod types{ + #![allow(non_camel_case_types)] + + use super::*; + + pub type i16_be = BigEndian; + pub type i32_be = BigEndian; + pub type i64_be = BigEndian; + pub type isize_be = BigEndian; + + pub type u16_be = BigEndian; + pub type u32_be = BigEndian; + pub type u64_be = BigEndian; + pub type usize_be = BigEndian; + + pub type i16_le = LittleEndian; + pub type i32_le = LittleEndian; + pub type i64_le = LittleEndian; + pub type isize_le = LittleEndian; + + pub type u16_le = LittleEndian; + pub type u32_le = LittleEndian; + pub type u64_le = LittleEndian; + pub type usize_le = LittleEndian; + + pub type i16_net = NetworkOrder; + pub type i32_net = NetworkOrder; + pub type i64_net = NetworkOrder; + pub type isize_net = NetworkOrder; + + pub type u16_net = NetworkOrder; + pub type u32_net = NetworkOrder; + pub type u64_net = NetworkOrder; + pub type usize_net = NetworkOrder; +} + +/*#[cfg(test)] +mod tests{ + use super::*; + use super::types::*; + + #[test] + fn construct_big(){ + //#[cfg(target_endian = "big")]{} + + } +}*/ diff --git a/hashbrown-0.17.0/.cargo_vcs_info.json b/hashbrown-0.17.0/.cargo_vcs_info.json deleted file mode 100644 index ff0304abcb..0000000000 --- a/hashbrown-0.17.0/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "d290456969d0e89e6799d8a673c95112962b70ec" - }, - "path_in_vcs": "" -} \ No newline at end of file diff --git a/hashbrown-0.17.0/.cargo-checksum.json b/hashbrown-0.17.1/.cargo-checksum.json similarity index 79% rename from hashbrown-0.17.0/.cargo-checksum.json rename to hashbrown-0.17.1/.cargo-checksum.json index e5e945c87c..75e2ab3d74 100644 --- a/hashbrown-0.17.0/.cargo-checksum.json +++ b/hashbrown-0.17.1/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo_vcs_info.json":"803392e4d2f4e80c1553f6a32c20da6ed00c95c154a3e5d890ef891ae8d21797","CHANGELOG.md":"6f0fd2619eccf0f920593293177b62fce5cb5357af4e5a656b422f1e253bf0fa","Cargo.lock":"0f68a377f467ab247b6e16d9cdad927bd6a561e34ab2587356185a3a6040d0d6","Cargo.toml":"564e1fe565896de6ed4811222b105d3e4abe54c2097b9c14bef5e7c92bc1bb83","Cargo.toml.orig":"5c7253cc5a964ea6d59c8f52c7f8d25a76afb367059826155c63aa40ffb084aa","Cross.toml":"47aeebdfd782a5052346ce29bf750c225828e108aca723486c3839adba5d6901","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"ff8f68cb076caf8cefe7a6430d4ac086ce6af2ca8ce2c4e5a2004d4552ef52a2","README.md":"f793b5cfaab5702b9e8bcf5ac7ec5bb198bdf2a89c1861070c1ad64b33a27ad3","benches/bench.rs":"63fb7937742da3d6223e5b52beed98ac4b4b27b712d13cf71da22d9d025d8f18","benches/general_ops.rs":"82430662ad66109c3b1026edf8ed89faee09a23fd34291cf7b2e68903ab5f718","benches/insert_unique_unchecked.rs":"ed3fad0a5c5ca654f0ab16694cb48152046d5a503e85902cd83cbdda7d9c89c4","benches/set_ops.rs":"14ba987967d74eae0f0775e20371c14aa533032bc03cb6a48653c12f32df01a3","benches/with_capacity.rs":"65efebbedbb9ede57ba8b9e60674358e4dd6124aadc58ffa3084b4b94d2ed65a","clippy.toml":"b350f0ed39349f1151326c565f5ea8dea3cf9e2a708c33b435ceb5f98ec5237c","src/alloc.rs":"7ffdd9a84787cb1f93b31184c32733649324faf500bcc3012197ee91353c9ac7","src/control/bitmask.rs":"5aaa52db03d2d17fe85fed67aa2bdc4ea376a0bf0e18010576e794b502d44689","src/control/group/generic.rs":"5d244fc9f9cd05ab8b92954452b43d8c321452d0dfa8816c2b1ce539fbb3270b","src/control/group/lsx.rs":"2164bb735d9123fb4ebb452a91a76d2ed84b277602c6ea79564e439e1c148359","src/control/group/mod.rs":"32150c3ac5bd4197ce122fea5b45ec1047c1e5227a4ba940aef6ceab2c00f54b","src/control/group/neon.rs":"bd8366684d86f456b9880940bbc72d7aabfb642d88a7bdd90de66ef7f643fae5","src/control/group/sse2.rs":"53d7d09c72332232b4562aa7dfabf18e5f57c5009a672b2cfac7193ef468b349","src/control/mod.rs":"83fede19e9c5a26fd2c7372e6cf92547d32ade4cd69fde8a0eaaeb1be6ddc2ba","src/control/tag.rs":"691dc7aa8d720e6df59a82ac11d66c72802ffffc684620c8ff29523352aefd13","src/external_trait_impls/mod.rs":"d69528827794524cfd9acbeacc1ac4f6131e3c7574311e6d919f818f65fbff07","src/external_trait_impls/rayon/helpers.rs":"1d882a124ffbdfd168796dcc3767205cb578d0643fdd91b768efea340fbdc9ec","src/external_trait_impls/rayon/map.rs":"2819b0e7bb77594710a0173d2a7bda318350096f79d0e0e3be4e92c616d38f69","src/external_trait_impls/rayon/mod.rs":"126edc882501dddd25e442d9236508b5b386eb8c0a9f5d654f2dd081086c1616","src/external_trait_impls/rayon/raw.rs":"518dcab0a1399b91411a7b93ed8b8e02543d5404cfc45e67b891ddc811e487b7","src/external_trait_impls/rayon/set.rs":"f58a884cb2d74ecb6e165d4f63710199db8b4c4e9935e355e258ae7eb9d76fa8","src/external_trait_impls/rayon/table.rs":"6703ed24b69510b74a6777388d6fe303f8838c740c809ea4ce5e9c87aec088df","src/external_trait_impls/serde.rs":"cbb5f60e0b093730a340e6133b0b5f5842ba6398a454acdabd635ae75c1d8010","src/hasher.rs":"939bc4f8c9e2d7e7ace266a8c121360ab4b44ad0540cdee06951e0197d96bc3c","src/lib.rs":"23de74f311e3584574b39041df306b0cbb9ecb700ed33fba1e02ba9d26f70a23","src/macros.rs":"4c949a8c44e457c4f04f0b55d5c1e0214b52a6ed2951f265af0113b0d2adb015","src/map.rs":"b79497ce537ffc5ed4f8f3399434b9216c01e7927fdc434fee190e9e9ce2abb0","src/raw.rs":"0c8ad353ba95817e72b0a8fea48fa2599099ea3def374f254ab6402a9c468d22","src/raw_entry.rs":"6393317a9818e2a9121b76d53083cd5ce358bc63e2702e17b9c138914d6842ee","src/rustc_entry.rs":"9d7ca1d375ace25d2107e09a840ac950dfacbd3543dde424e0f1e714878bdec6","src/scopeguard.rs":"aa557686a2090eee1da25e960a4461d3750725065a4a1266b80a2eadfec38b2a","src/set.rs":"71485eb08e622a7aeb1978817233f0e9c75f4daec87d2d6fa6eba6e0aaf80f2f","src/table.rs":"9d37739758f9df08d23c3ab792d29547b04bfd29b08900407a0d2b8ecd26cda9","src/util.rs":"02546d6e681f833405b8a15ef9bc8d3e80b1ef3bce65caf70d8e16cbadf4a410","tests/equivalent_trait.rs":"092e4b137b6abf7d57277f77ebc4f3641eba22a650dade79f2b0d793062627fb","tests/hasher.rs":"fd06130f011660743202904221f3f7487d8d143d8903c73cd3a76d079ebbe9fb","tests/hasher_unwind.rs":"d36a1650a5cf7a5f424250d80abe8496385f6395e37fd9262262724c22306a0f","tests/rayon.rs":"5470842da0372b03059de3c8eaeb59b72bfd52eb76026d0eda51cf4634047add","tests/serde.rs":"27689fe22b6301db7fdf01de19be621b2d9af7d2ad157c000600bfe760f1cbb3","tests/set.rs":"dc4e546c94f95869ce85f55ce8e10b9d100b7b0ef6e80e1720b94af621f45ed0"},"package":"4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51"} \ No newline at end of file +{"files":{".cargo_vcs_info.json":"b41a5623404ae232c5432fb7dfeb74f93c40f532ae057179b9a8b00982a006d4","CHANGELOG.md":"dddef7405a9fccaffc2ca6c3a76f602bb2d2b4caac35370dbb0a3787ffcd4993","Cargo.lock":"718cdd290a7ed54fa011baeabe23779746318ec79e6f02918b423fce8bdc05b9","Cargo.toml":"afcb0e62d498f756bd4ddf69785c8282d01ee4fa40016158c7eac12ceb302f8c","Cargo.toml.orig":"3e1f9929f381f46f969ea49faab281dc3c6ee08b24ef41f3ac8e2eec209ca078","Cross.toml":"47aeebdfd782a5052346ce29bf750c225828e108aca723486c3839adba5d6901","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"ff8f68cb076caf8cefe7a6430d4ac086ce6af2ca8ce2c4e5a2004d4552ef52a2","README.md":"d58265d24271a49876da9c77eaaa00093e01e41011e7e603da1f738ecdec4f47","benches/bench.rs":"63fb7937742da3d6223e5b52beed98ac4b4b27b712d13cf71da22d9d025d8f18","benches/general_ops.rs":"82430662ad66109c3b1026edf8ed89faee09a23fd34291cf7b2e68903ab5f718","benches/insert_unique_unchecked.rs":"ed3fad0a5c5ca654f0ab16694cb48152046d5a503e85902cd83cbdda7d9c89c4","benches/set_ops.rs":"14ba987967d74eae0f0775e20371c14aa533032bc03cb6a48653c12f32df01a3","benches/with_capacity.rs":"65efebbedbb9ede57ba8b9e60674358e4dd6124aadc58ffa3084b4b94d2ed65a","clippy.toml":"b350f0ed39349f1151326c565f5ea8dea3cf9e2a708c33b435ceb5f98ec5237c","src/alloc.rs":"7ffdd9a84787cb1f93b31184c32733649324faf500bcc3012197ee91353c9ac7","src/control/bitmask.rs":"5aaa52db03d2d17fe85fed67aa2bdc4ea376a0bf0e18010576e794b502d44689","src/control/group/generic.rs":"5d244fc9f9cd05ab8b92954452b43d8c321452d0dfa8816c2b1ce539fbb3270b","src/control/group/lsx.rs":"2b27cf856196f1e1a34ff91f3a70da711d94d13bb68d669478063748889cdd94","src/control/group/mod.rs":"32150c3ac5bd4197ce122fea5b45ec1047c1e5227a4ba940aef6ceab2c00f54b","src/control/group/neon.rs":"bd8366684d86f456b9880940bbc72d7aabfb642d88a7bdd90de66ef7f643fae5","src/control/group/sse2.rs":"53d7d09c72332232b4562aa7dfabf18e5f57c5009a672b2cfac7193ef468b349","src/control/mod.rs":"83fede19e9c5a26fd2c7372e6cf92547d32ade4cd69fde8a0eaaeb1be6ddc2ba","src/control/tag.rs":"691dc7aa8d720e6df59a82ac11d66c72802ffffc684620c8ff29523352aefd13","src/external_trait_impls/mod.rs":"d69528827794524cfd9acbeacc1ac4f6131e3c7574311e6d919f818f65fbff07","src/external_trait_impls/rayon/helpers.rs":"1d882a124ffbdfd168796dcc3767205cb578d0643fdd91b768efea340fbdc9ec","src/external_trait_impls/rayon/map.rs":"2819b0e7bb77594710a0173d2a7bda318350096f79d0e0e3be4e92c616d38f69","src/external_trait_impls/rayon/mod.rs":"126edc882501dddd25e442d9236508b5b386eb8c0a9f5d654f2dd081086c1616","src/external_trait_impls/rayon/raw.rs":"518dcab0a1399b91411a7b93ed8b8e02543d5404cfc45e67b891ddc811e487b7","src/external_trait_impls/rayon/set.rs":"f58a884cb2d74ecb6e165d4f63710199db8b4c4e9935e355e258ae7eb9d76fa8","src/external_trait_impls/rayon/table.rs":"6703ed24b69510b74a6777388d6fe303f8838c740c809ea4ce5e9c87aec088df","src/external_trait_impls/serde.rs":"cbb5f60e0b093730a340e6133b0b5f5842ba6398a454acdabd635ae75c1d8010","src/hasher.rs":"939bc4f8c9e2d7e7ace266a8c121360ab4b44ad0540cdee06951e0197d96bc3c","src/lib.rs":"23de74f311e3584574b39041df306b0cbb9ecb700ed33fba1e02ba9d26f70a23","src/macros.rs":"4c949a8c44e457c4f04f0b55d5c1e0214b52a6ed2951f265af0113b0d2adb015","src/map.rs":"b79497ce537ffc5ed4f8f3399434b9216c01e7927fdc434fee190e9e9ce2abb0","src/raw.rs":"0c8ad353ba95817e72b0a8fea48fa2599099ea3def374f254ab6402a9c468d22","src/raw_entry.rs":"6393317a9818e2a9121b76d53083cd5ce358bc63e2702e17b9c138914d6842ee","src/rustc_entry.rs":"35212ecf4d0195954aa6ecc6c0b8e99a8628dffb4fb101fa67d3d7a31a52b837","src/scopeguard.rs":"aa557686a2090eee1da25e960a4461d3750725065a4a1266b80a2eadfec38b2a","src/set.rs":"71485eb08e622a7aeb1978817233f0e9c75f4daec87d2d6fa6eba6e0aaf80f2f","src/table.rs":"9d37739758f9df08d23c3ab792d29547b04bfd29b08900407a0d2b8ecd26cda9","src/util.rs":"02546d6e681f833405b8a15ef9bc8d3e80b1ef3bce65caf70d8e16cbadf4a410","tests/equivalent_trait.rs":"092e4b137b6abf7d57277f77ebc4f3641eba22a650dade79f2b0d793062627fb","tests/hasher.rs":"fd06130f011660743202904221f3f7487d8d143d8903c73cd3a76d079ebbe9fb","tests/hasher_unwind.rs":"d36a1650a5cf7a5f424250d80abe8496385f6395e37fd9262262724c22306a0f","tests/rayon.rs":"5470842da0372b03059de3c8eaeb59b72bfd52eb76026d0eda51cf4634047add","tests/serde.rs":"27689fe22b6301db7fdf01de19be621b2d9af7d2ad157c000600bfe760f1cbb3","tests/set.rs":"dc4e546c94f95869ce85f55ce8e10b9d100b7b0ef6e80e1720b94af621f45ed0"},"package":"ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"} \ No newline at end of file diff --git a/hashbrown-0.17.1/.cargo_vcs_info.json b/hashbrown-0.17.1/.cargo_vcs_info.json new file mode 100644 index 0000000000..017ccccdaa --- /dev/null +++ b/hashbrown-0.17.1/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "c62a63a61b7caf2de8f9ecb7b06a66b0ab6bdf3d" + }, + "path_in_vcs": "" +} \ No newline at end of file diff --git a/hashbrown-0.17.0/CHANGELOG.md b/hashbrown-0.17.1/CHANGELOG.md similarity index 99% rename from hashbrown-0.17.0/CHANGELOG.md rename to hashbrown-0.17.1/CHANGELOG.md index 25f26c0c0e..30865f958a 100644 --- a/hashbrown-0.17.0/CHANGELOG.md +++ b/hashbrown-0.17.1/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.17.1](https://github.com/rust-lang/hashbrown/compare/v0.17.0...v0.17.1) - 2026-04-20 + +### Added + +- Added `HashMap::rustc_try_insert` (#722) + ## [0.17.0](https://github.com/rust-lang/hashbrown/compare/v0.16.1...v0.17.0) - 2026-04-06 ### Added diff --git a/hashbrown-0.17.0/Cargo.lock b/hashbrown-0.17.1/Cargo.lock similarity index 88% rename from hashbrown-0.17.0/Cargo.lock rename to hashbrown-0.17.1/Cargo.lock index 9a76fd99d4..2bd6719cd9 100644 --- a/hashbrown-0.17.0/Cargo.lock +++ b/hashbrown-0.17.1/Cargo.lock @@ -85,9 +85,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.6.0" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" dependencies = [ "clap_builder", ] @@ -196,6 +196,30 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "slab", +] + [[package]] name = "getrandom" version = "0.3.4" @@ -221,7 +245,7 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.17.0" +version = "0.17.1" dependencies = [ "allocator-api2", "bumpalo", @@ -256,19 +280,21 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "js-sys" -version = "0.3.94" +version = "0.3.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9" +checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" dependencies = [ + "cfg-if", + "futures-util", "once_cell", "wasm-bindgen", ] [[package]] name = "libc" -version = "0.2.184" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "memchr" @@ -297,6 +323,12 @@ version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + [[package]] name = "plotters" version = "0.3.7" @@ -360,9 +392,9 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" dependencies = [ "rand_chacha", "rand_core", @@ -389,9 +421,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" dependencies = [ "either", "rayon-core", @@ -515,6 +547,12 @@ dependencies = [ "serde", ] +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + [[package]] name = "syn" version = "2.0.117" @@ -563,9 +601,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.117" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0" +checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" dependencies = [ "cfg-if", "once_cell", @@ -576,9 +614,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.117" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be" +checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -586,9 +624,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.117" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2" +checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" dependencies = [ "bumpalo", "proc-macro2", @@ -599,18 +637,18 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.117" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b" +checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.94" +version = "0.3.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a" +checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/hashbrown-0.17.0/Cargo.toml b/hashbrown-0.17.1/Cargo.toml similarity index 98% rename from hashbrown-0.17.0/Cargo.toml rename to hashbrown-0.17.1/Cargo.toml index 3b5e1bf0ea..ce7e0b35d7 100644 --- a/hashbrown-0.17.0/Cargo.toml +++ b/hashbrown-0.17.1/Cargo.toml @@ -13,8 +13,7 @@ edition = "2024" rust-version = "1.85.0" name = "hashbrown" -version = "0.17.0" -authors = ["Amanieu d'Antras "] +version = "0.17.1" build = false exclude = [ ".github", diff --git a/hashbrown-0.17.0/Cargo.toml.orig b/hashbrown-0.17.1/Cargo.toml.orig similarity index 98% rename from hashbrown-0.17.0/Cargo.toml.orig rename to hashbrown-0.17.1/Cargo.toml.orig index 0bcb60112a..518758388c 100644 --- a/hashbrown-0.17.0/Cargo.toml.orig +++ b/hashbrown-0.17.1/Cargo.toml.orig @@ -1,7 +1,6 @@ [package] name = "hashbrown" -version = "0.17.0" -authors = ["Amanieu d'Antras "] +version = "0.17.1" description = "A Rust port of Google's SwissTable hash map" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang/hashbrown" diff --git a/hashbrown-0.17.0/Cross.toml b/hashbrown-0.17.1/Cross.toml similarity index 100% rename from hashbrown-0.17.0/Cross.toml rename to hashbrown-0.17.1/Cross.toml diff --git a/js-sys-0.3.95/LICENSE-APACHE b/hashbrown-0.17.1/LICENSE-APACHE similarity index 100% rename from js-sys-0.3.95/LICENSE-APACHE rename to hashbrown-0.17.1/LICENSE-APACHE diff --git a/hashbrown-0.17.0/LICENSE-MIT b/hashbrown-0.17.1/LICENSE-MIT similarity index 100% rename from hashbrown-0.17.0/LICENSE-MIT rename to hashbrown-0.17.1/LICENSE-MIT diff --git a/hashbrown-0.17.0/README.md b/hashbrown-0.17.1/README.md similarity index 69% rename from hashbrown-0.17.0/README.md rename to hashbrown-0.17.1/README.md index fc566be2d2..ce19947e4b 100644 --- a/hashbrown-0.17.0/README.md +++ b/hashbrown-0.17.1/README.md @@ -1,20 +1,20 @@ -hashbrown -========= +# hashbrown [![Build Status](https://github.com/rust-lang/hashbrown/actions/workflows/rust.yml/badge.svg)](https://github.com/rust-lang/hashbrown/actions) -[![Crates.io](https://img.shields.io/crates/v/hashbrown.svg)](https://crates.io/crates/hashbrown) +[![crates.io](https://img.shields.io/crates/v/hashbrown.svg)](https://crates.io/crates/hashbrown) [![Documentation](https://docs.rs/hashbrown/badge.svg)](https://docs.rs/hashbrown) [![Rust](https://img.shields.io/badge/rust-1.85.0%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/hashbrown) -This crate is a Rust port of Google's high-performance [SwissTable] hash -map, adapted to make it a drop-in replacement for Rust's standard `HashMap` -and `HashSet` types. +This crate is a Rust port of Google's high-performance [SwissTable] hash map, +adapted to make it a drop-in replacement for Rust's standard `HashMap` and +`HashSet` types. The original C++ version of SwissTable can be found [here], and this [CppCon talk] gives an overview of how the algorithm works. Since Rust 1.36, the Rust standard library has adopted this implementation for -`HashMap`, using its own default hasher (see [`std::hash::DefaultHasher`](https://doc.rust-lang.org/std/hash/struct.DefaultHasher.html)). +`HashMap`, using its own default hasher (see +[`std::hash::DefaultHasher`](https://doc.rust-lang.org/std/hash/struct.DefaultHasher.html)). However you may still want to use this crate instead since it works in environments without `std`, such as embedded systems and kernels. @@ -27,11 +27,14 @@ environments without `std`, such as embedded systems and kernels. ## Features - Drop-in replacement for the standard library `HashMap` and `HashSet` types. -- Uses [foldhash](https://github.com/orlp/foldhash) as the default hasher, which is much faster than SipHash. - However, foldhash does *not provide the same level of HashDoS resistance* as SipHash, so if that is important to you, you might want to consider using a different hasher. +- Uses [foldhash](https://github.com/orlp/foldhash) as the default hasher, which + is much faster than SipHash. However, foldhash does *not provide the same + level of HashDoS resistance* as SipHash, so if that is important to you, you + might want to consider using a different hasher. - Around 2x faster than the previous standard library `HashMap`. - Lower memory usage: only 1 byte of overhead per entry instead of 8. -- Compatible with `#[no_std]` (but requires a global allocator with the `alloc` crate). +- Compatible with `#[no_std]` (but requires a global allocator with the `alloc` + crate). - Empty hash maps do not allocate any memory. - SIMD lookups to scan multiple hash entries in parallel. @@ -41,7 +44,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -hashbrown = "0.16" +hashbrown = "0.17" ``` Then: @@ -54,29 +57,35 @@ map.insert(1, "one"); ``` ## Flags + This crate has the following Cargo features: - `nightly`: Enables nightly-only features including: `#[may_dangle]`. - `serde`: Enables serde serialization support. - `rayon`: Enables rayon parallel iterator support. -- `equivalent`: Allows comparisons to be customized with the `Equivalent` trait. (enabled by default) +- `equivalent`: Allows comparisons to be customized with the `Equivalent` trait. + (enabled by default) - `raw-entry`: Enables access to the deprecated `RawEntry` API. -- `inline-more`: Adds inline hints to most functions, improving run-time performance at the cost - of compilation time. (enabled by default) -- `default-hasher`: Compiles with foldhash as default hasher. (enabled by default) -- `allocator-api2`: Enables support for allocators that support `allocator-api2`. (enabled by default) +- `inline-more`: Adds inline hints to most functions, improving run-time + performance at the cost of compilation time. (enabled by default) +- `default-hasher`: Compiles with foldhash as default hasher. (enabled by + default) +- `allocator-api2`: Enables support for allocators that support + `allocator-api2`. (enabled by default) ## License Licensed under either of: - * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) - * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + https://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + https://opensource.org/license/mit) at your option. ### Contribution Unless you explicitly state otherwise, any contribution intentionally submitted -for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any -additional terms or conditions. +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +dual licensed as above, without any additional terms or conditions. diff --git a/hashbrown-0.17.0/benches/bench.rs b/hashbrown-0.17.1/benches/bench.rs similarity index 100% rename from hashbrown-0.17.0/benches/bench.rs rename to hashbrown-0.17.1/benches/bench.rs diff --git a/hashbrown-0.17.0/benches/general_ops.rs b/hashbrown-0.17.1/benches/general_ops.rs similarity index 100% rename from hashbrown-0.17.0/benches/general_ops.rs rename to hashbrown-0.17.1/benches/general_ops.rs diff --git a/hashbrown-0.17.0/benches/insert_unique_unchecked.rs b/hashbrown-0.17.1/benches/insert_unique_unchecked.rs similarity index 100% rename from hashbrown-0.17.0/benches/insert_unique_unchecked.rs rename to hashbrown-0.17.1/benches/insert_unique_unchecked.rs diff --git a/hashbrown-0.17.0/benches/set_ops.rs b/hashbrown-0.17.1/benches/set_ops.rs similarity index 100% rename from hashbrown-0.17.0/benches/set_ops.rs rename to hashbrown-0.17.1/benches/set_ops.rs diff --git a/hashbrown-0.17.0/benches/with_capacity.rs b/hashbrown-0.17.1/benches/with_capacity.rs similarity index 100% rename from hashbrown-0.17.0/benches/with_capacity.rs rename to hashbrown-0.17.1/benches/with_capacity.rs diff --git a/hashbrown-0.17.0/clippy.toml b/hashbrown-0.17.1/clippy.toml similarity index 100% rename from hashbrown-0.17.0/clippy.toml rename to hashbrown-0.17.1/clippy.toml diff --git a/hashbrown-0.17.0/src/alloc.rs b/hashbrown-0.17.1/src/alloc.rs similarity index 100% rename from hashbrown-0.17.0/src/alloc.rs rename to hashbrown-0.17.1/src/alloc.rs diff --git a/hashbrown-0.17.0/src/control/bitmask.rs b/hashbrown-0.17.1/src/control/bitmask.rs similarity index 100% rename from hashbrown-0.17.0/src/control/bitmask.rs rename to hashbrown-0.17.1/src/control/bitmask.rs diff --git a/hashbrown-0.17.0/src/control/group/generic.rs b/hashbrown-0.17.1/src/control/group/generic.rs similarity index 100% rename from hashbrown-0.17.0/src/control/group/generic.rs rename to hashbrown-0.17.1/src/control/group/generic.rs diff --git a/hashbrown-0.17.0/src/control/group/lsx.rs b/hashbrown-0.17.1/src/control/group/lsx.rs similarity index 95% rename from hashbrown-0.17.0/src/control/group/lsx.rs rename to hashbrown-0.17.1/src/control/group/lsx.rs index 031c75c830..7da098aedb 100644 --- a/hashbrown-0.17.0/src/control/group/lsx.rs +++ b/hashbrown-0.17.1/src/control/group/lsx.rs @@ -117,9 +117,8 @@ impl Group { // 1111_1111 | 1000_0000 = 1111_1111 // 0000_0000 | 1000_0000 = 1000_0000 unsafe { - let zero = lsx_vreplgr2vr_b(0); - let special = lsx_vslt_b(self.0, zero); - Group(lsx_vor_v(special, lsx_vreplgr2vr_b(Tag::DELETED.0 as i32))) + let special = lsx_vslti_b::<0>(self.0); + Group(lsx_vori_b::<{ Tag::DELETED.0 as u32 }>(special)) } } } diff --git a/hashbrown-0.17.0/src/control/group/mod.rs b/hashbrown-0.17.1/src/control/group/mod.rs similarity index 100% rename from hashbrown-0.17.0/src/control/group/mod.rs rename to hashbrown-0.17.1/src/control/group/mod.rs diff --git a/hashbrown-0.17.0/src/control/group/neon.rs b/hashbrown-0.17.1/src/control/group/neon.rs similarity index 100% rename from hashbrown-0.17.0/src/control/group/neon.rs rename to hashbrown-0.17.1/src/control/group/neon.rs diff --git a/hashbrown-0.17.0/src/control/group/sse2.rs b/hashbrown-0.17.1/src/control/group/sse2.rs similarity index 100% rename from hashbrown-0.17.0/src/control/group/sse2.rs rename to hashbrown-0.17.1/src/control/group/sse2.rs diff --git a/hashbrown-0.17.0/src/control/mod.rs b/hashbrown-0.17.1/src/control/mod.rs similarity index 100% rename from hashbrown-0.17.0/src/control/mod.rs rename to hashbrown-0.17.1/src/control/mod.rs diff --git a/hashbrown-0.17.0/src/control/tag.rs b/hashbrown-0.17.1/src/control/tag.rs similarity index 100% rename from hashbrown-0.17.0/src/control/tag.rs rename to hashbrown-0.17.1/src/control/tag.rs diff --git a/hashbrown-0.17.0/src/external_trait_impls/mod.rs b/hashbrown-0.17.1/src/external_trait_impls/mod.rs similarity index 100% rename from hashbrown-0.17.0/src/external_trait_impls/mod.rs rename to hashbrown-0.17.1/src/external_trait_impls/mod.rs diff --git a/hashbrown-0.17.0/src/external_trait_impls/rayon/helpers.rs b/hashbrown-0.17.1/src/external_trait_impls/rayon/helpers.rs similarity index 100% rename from hashbrown-0.17.0/src/external_trait_impls/rayon/helpers.rs rename to hashbrown-0.17.1/src/external_trait_impls/rayon/helpers.rs diff --git a/hashbrown-0.17.0/src/external_trait_impls/rayon/map.rs b/hashbrown-0.17.1/src/external_trait_impls/rayon/map.rs similarity index 100% rename from hashbrown-0.17.0/src/external_trait_impls/rayon/map.rs rename to hashbrown-0.17.1/src/external_trait_impls/rayon/map.rs diff --git a/hashbrown-0.17.0/src/external_trait_impls/rayon/mod.rs b/hashbrown-0.17.1/src/external_trait_impls/rayon/mod.rs similarity index 100% rename from hashbrown-0.17.0/src/external_trait_impls/rayon/mod.rs rename to hashbrown-0.17.1/src/external_trait_impls/rayon/mod.rs diff --git a/hashbrown-0.17.0/src/external_trait_impls/rayon/raw.rs b/hashbrown-0.17.1/src/external_trait_impls/rayon/raw.rs similarity index 100% rename from hashbrown-0.17.0/src/external_trait_impls/rayon/raw.rs rename to hashbrown-0.17.1/src/external_trait_impls/rayon/raw.rs diff --git a/hashbrown-0.17.0/src/external_trait_impls/rayon/set.rs b/hashbrown-0.17.1/src/external_trait_impls/rayon/set.rs similarity index 100% rename from hashbrown-0.17.0/src/external_trait_impls/rayon/set.rs rename to hashbrown-0.17.1/src/external_trait_impls/rayon/set.rs diff --git a/hashbrown-0.17.0/src/external_trait_impls/rayon/table.rs b/hashbrown-0.17.1/src/external_trait_impls/rayon/table.rs similarity index 100% rename from hashbrown-0.17.0/src/external_trait_impls/rayon/table.rs rename to hashbrown-0.17.1/src/external_trait_impls/rayon/table.rs diff --git a/hashbrown-0.17.0/src/external_trait_impls/serde.rs b/hashbrown-0.17.1/src/external_trait_impls/serde.rs similarity index 100% rename from hashbrown-0.17.0/src/external_trait_impls/serde.rs rename to hashbrown-0.17.1/src/external_trait_impls/serde.rs diff --git a/hashbrown-0.17.0/src/hasher.rs b/hashbrown-0.17.1/src/hasher.rs similarity index 100% rename from hashbrown-0.17.0/src/hasher.rs rename to hashbrown-0.17.1/src/hasher.rs diff --git a/hashbrown-0.17.0/src/lib.rs b/hashbrown-0.17.1/src/lib.rs similarity index 100% rename from hashbrown-0.17.0/src/lib.rs rename to hashbrown-0.17.1/src/lib.rs diff --git a/hashbrown-0.17.0/src/macros.rs b/hashbrown-0.17.1/src/macros.rs similarity index 100% rename from hashbrown-0.17.0/src/macros.rs rename to hashbrown-0.17.1/src/macros.rs diff --git a/hashbrown-0.17.0/src/map.rs b/hashbrown-0.17.1/src/map.rs similarity index 100% rename from hashbrown-0.17.0/src/map.rs rename to hashbrown-0.17.1/src/map.rs diff --git a/hashbrown-0.17.0/src/raw.rs b/hashbrown-0.17.1/src/raw.rs similarity index 100% rename from hashbrown-0.17.0/src/raw.rs rename to hashbrown-0.17.1/src/raw.rs diff --git a/hashbrown-0.17.0/src/raw_entry.rs b/hashbrown-0.17.1/src/raw_entry.rs similarity index 100% rename from hashbrown-0.17.0/src/raw_entry.rs rename to hashbrown-0.17.1/src/raw_entry.rs diff --git a/hashbrown-0.17.0/src/rustc_entry.rs b/hashbrown-0.17.1/src/rustc_entry.rs similarity index 87% rename from hashbrown-0.17.0/src/rustc_entry.rs rename to hashbrown-0.17.1/src/rustc_entry.rs index d442f79036..45009bb0bd 100644 --- a/hashbrown-0.17.0/src/rustc_entry.rs +++ b/hashbrown-0.17.1/src/rustc_entry.rs @@ -1,6 +1,6 @@ use self::RustcEntry::*; use crate::alloc::{Allocator, Global}; -use crate::map::{Drain, HashMap, IntoIter, Iter, IterMut, make_hash}; +use crate::map::{Drain, HashMap, IntoIter, Iter, IterMut, make_hash, make_hasher}; use crate::raw::{Bucket, RawTable}; use core::fmt::{self, Debug}; use core::hash::{BuildHasher, Hash}; @@ -52,6 +52,72 @@ where }) } } + + /// Tries to insert a key-value pair into the map, and returns + /// a mutable reference to the value in the entry. + /// + /// # Errors + /// + /// If the map already had this key present, nothing is updated, and an error + /// containing the occupied entry, the key, and the value is returned. + /// + /// # Examples + /// + /// Basic usage: + /// + /// ``` + /// use hashbrown::HashMap; + /// use hashbrown::hash_map::RustcOccupiedError; + /// + /// let mut map = HashMap::new(); + /// assert_eq!(map.rustc_try_insert(37, "a").ok().unwrap(), &"a"); + /// + /// match map.rustc_try_insert(37, "b") { + /// Err(RustcOccupiedError { entry, key, value, .. }) => { + /// assert_eq!(entry.key(), &37); + /// assert_eq!(entry.get(), &"a"); + /// assert_eq!(key, 37); + /// assert_eq!(value, "b"); + /// } + /// _ => panic!() + /// } + /// ``` + #[cfg_attr(feature = "inline-more", inline)] + pub fn rustc_try_insert( + &mut self, + key: K, + value: V, + ) -> Result<&mut V, RustcOccupiedError<'_, K, V, A>> { + let hash = make_hash(&self.hash_builder, &key); + if let Some(elem) = self.table.find(hash, |q| q.0.eq(&key)) { + let entry = RustcOccupiedEntry { + elem, + table: &mut self.table, + }; + Err(RustcOccupiedError { entry, key, value }) + } else { + let hasher = make_hasher(&self.hash_builder); + let entry = self.table.insert_entry(hash, (key, value), hasher); + Ok(&mut entry.1) + } + } +} + +/// The error returned by [`rustc_try_insert`](HashMap::rustc_try_insert) when the key already exists. +/// +/// Note: There are no impls for this type, because we expect the standard library will +/// immediately reconstruct these errors into its own `OccupiedError`. +#[non_exhaustive] +pub struct RustcOccupiedError<'a, K, V, A = Global> +where + A: Allocator, +{ + /// The entry in the map that was already occupied. + pub entry: RustcOccupiedEntry<'a, K, V, A>, + /// The key which was not inserted, because the entry was already occupied. + pub key: K, + /// The value which was not inserted, because the entry was already occupied. + pub value: V, } /// A view into a single entry in a map, which may either be vacant or occupied. diff --git a/hashbrown-0.17.0/src/scopeguard.rs b/hashbrown-0.17.1/src/scopeguard.rs similarity index 100% rename from hashbrown-0.17.0/src/scopeguard.rs rename to hashbrown-0.17.1/src/scopeguard.rs diff --git a/hashbrown-0.17.0/src/set.rs b/hashbrown-0.17.1/src/set.rs similarity index 100% rename from hashbrown-0.17.0/src/set.rs rename to hashbrown-0.17.1/src/set.rs diff --git a/hashbrown-0.17.0/src/table.rs b/hashbrown-0.17.1/src/table.rs similarity index 100% rename from hashbrown-0.17.0/src/table.rs rename to hashbrown-0.17.1/src/table.rs diff --git a/hashbrown-0.17.0/src/util.rs b/hashbrown-0.17.1/src/util.rs similarity index 100% rename from hashbrown-0.17.0/src/util.rs rename to hashbrown-0.17.1/src/util.rs diff --git a/hashbrown-0.17.0/tests/equivalent_trait.rs b/hashbrown-0.17.1/tests/equivalent_trait.rs similarity index 100% rename from hashbrown-0.17.0/tests/equivalent_trait.rs rename to hashbrown-0.17.1/tests/equivalent_trait.rs diff --git a/hashbrown-0.17.0/tests/hasher.rs b/hashbrown-0.17.1/tests/hasher.rs similarity index 100% rename from hashbrown-0.17.0/tests/hasher.rs rename to hashbrown-0.17.1/tests/hasher.rs diff --git a/hashbrown-0.17.0/tests/hasher_unwind.rs b/hashbrown-0.17.1/tests/hasher_unwind.rs similarity index 100% rename from hashbrown-0.17.0/tests/hasher_unwind.rs rename to hashbrown-0.17.1/tests/hasher_unwind.rs diff --git a/hashbrown-0.17.0/tests/rayon.rs b/hashbrown-0.17.1/tests/rayon.rs similarity index 100% rename from hashbrown-0.17.0/tests/rayon.rs rename to hashbrown-0.17.1/tests/rayon.rs diff --git a/hashbrown-0.17.0/tests/serde.rs b/hashbrown-0.17.1/tests/serde.rs similarity index 100% rename from hashbrown-0.17.0/tests/serde.rs rename to hashbrown-0.17.1/tests/serde.rs diff --git a/hashbrown-0.17.0/tests/set.rs b/hashbrown-0.17.1/tests/set.rs similarity index 100% rename from hashbrown-0.17.0/tests/set.rs rename to hashbrown-0.17.1/tests/set.rs diff --git a/jiff-0.2.23/.cargo_vcs_info.json b/jiff-0.2.23/.cargo_vcs_info.json deleted file mode 100644 index 82ee63ef33..0000000000 --- a/jiff-0.2.23/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "e5b7f0d061e4da9598aed73f6171e78baa8b007f" - }, - "path_in_vcs": "" -} \ No newline at end of file diff --git a/jiff-0.2.23/.cargo-checksum.json b/jiff-0.2.24/.cargo-checksum.json similarity index 88% rename from jiff-0.2.23/.cargo-checksum.json rename to jiff-0.2.24/.cargo-checksum.json index 57ba6fa973..9b33b1279b 100644 --- a/jiff-0.2.23/.cargo-checksum.json +++ b/jiff-0.2.24/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo_vcs_info.json":"5e1b745c6bdbc20a6fa40bee1d40b1020a46a8456cb06562b9e5a9bd05953f03","CHANGELOG.md":"b0a69b27ba1d0c7df74c4e2684864edfbb7358ae92d8056e7ab4532663fd722e","COMPARE.md":"442f95db5a01d8fa9086b11f7fb3d958fd81eeef26e4fd8f073fb152009caa63","COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.lock":"381506e1f27043db4a9def94ca95f6524e2f94cc38a4a0d3a415e66f2c3230d9","Cargo.toml":"eef8de705bce965265f901c40887c793b749d3824b3da841824be52d0c4e3625","Cargo.toml.orig":"e9c3d83049f8586f42d99dd2c9fbaa87dc7af0ba08e7521228627bbb5f897a49","DESIGN.md":"d21d19e129bdd48a88529f14a75f7bc6e68eb8623b1b6cb3c1f8cfafebc58cba","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","PLATFORM.md":"02a7a064986fa2a4a0541dfacfb55d105340c5aebd7f1c3bdef5d60ae8778445","README.md":"85bf0d99f4d35f42d463e9de6bc22de311c61874810e53cf2ecfdfe591b6a095","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","src/civil/date.rs":"63f47a2ad1f54f9546cd78d836f1abe3efc9c5a408e3d2c925a765a242231ca5","src/civil/datetime.rs":"3b13abf72a32fd80014616631c449461a33b0f842018d277204a74161c50d7f7","src/civil/iso_week_date.rs":"469a7c9c98cda8aa31c3fabbcbe25486f9abd2194140ae751fbfd76774547fa7","src/civil/mod.rs":"0860304a71e1139335ba03a8e2da811ed85c8052f1ca5c391143e9341db4533e","src/civil/time.rs":"73b468402e62514deeef67a0fe34b4cc7e1e0e2a0676e60b1aa214b7a5edd39a","src/civil/weekday.rs":"bf17f6d53c1064c38d3abd20c86a8c39b1e78fcacd604b46b1d2edabc7822d3b","src/duration.rs":"57228c034f222ed78a62a3936ba3881bacbd86955c40637151bc7cd9695901ae","src/error/civil.rs":"9c87174bec1b0340692b09505adfe2c6af86d77eada0b20a833d41a99420a6f2","src/error/duration.rs":"f7441181ba851dad753fc20fa7c8ca4b54c4b565a5d13b3070a2f9138956d88f","src/error/fmt/friendly.rs":"5e07fc237cd9addfd60692e2a931268c7c6886652db2423fb043b3de3560a7f1","src/error/fmt/mod.rs":"5ed8215ace05e01890769a8d66f548ea35cf7acd72dc72171e804a638e40c9e4","src/error/fmt/offset.rs":"0a73bdffba338dc758cf259f205d11905a94db43e7a0137788f554e4b9b7ba9f","src/error/fmt/rfc2822.rs":"333de0a9d2087934f57dd14081d3f5b129130b86617ce6382ccdf49368624b00","src/error/fmt/rfc9557.rs":"f041a4e46881e8651c0ac4fa95c659adba753f3c8ffa1b0c4dd5ddf5c51a20a8","src/error/fmt/strtime.rs":"c4cde14a5cd003f8d223b1d18f505bec68d52fbfa865b46661661bc5c36cb066","src/error/fmt/temporal.rs":"46d0f782f3ccb1e4337cee7b87a67e8c279753363403a28e8cd4359057f319b8","src/error/fmt/util.rs":"60595171152242fb544138378ee5dccea0b590b0ba74f08389ec0035d9d2a2f6","src/error/mod.rs":"56409ebaee9af9fb8a7d77994f90d3e2b557d326f5f55e6116ee99cc9edcfd10","src/error/signed_duration.rs":"3069ff2c85b4629aff34a3423ffd6ee22951ed91c5de145b9d3e6156ea807883","src/error/span.rs":"a2a806def4166a5e9bccd904600b93556dba4ebf7e5d0fbbb7982ca44cdb1839","src/error/timestamp.rs":"90b35dd3acbbac3d1f477186672e87d7023647ad21fcb18295efe053736a389b","src/error/tz/ambiguous.rs":"343950b71cf18772b6d892d0627237128fe557736a2a6b01b9efaf275805ba02","src/error/tz/concatenated.rs":"a073b5d9e46d898d26e661198da4c0cf4894faa4b278d453908d32d7189a4073","src/error/tz/db.rs":"7f1b850176d5093f0b6285fc8cd327f34083cd39d2140d49f2199f6f8af4b8ee","src/error/tz/mod.rs":"22ab0f7a23a828c1cc355ae6a0e6ce09f6b532e0669ad0a00ab5050ee2ce5807","src/error/tz/offset.rs":"06b9ef025de9005002e88d4766e5e599ab74de17dd5385043d28403c0a4e6d20","src/error/tz/posix.rs":"8048897f456cac4a85f06d123c937bedcdee974422c541139069188df452ed0e","src/error/tz/system.rs":"66876a02fefeeb6a750a883058a902934fcc3d9cc0f080feea66300e5231c1b5","src/error/tz/timezone.rs":"b8535574602859f97ef0fdfff530c768228ba3895a9226b81ec6552212f8aa33","src/error/tz/zic.rs":"4f8eb5c1a97e3a5f4b6f6283d83f8eac5d94638f0df0244fb548eb91b2b46a53","src/error/unit.rs":"b0fb666385248db60ae453249755a031142cbebf42e832055c225d3df0b397c2","src/error/util.rs":"db8eee30c288a3d1a4d1203db3b971a14e054b7a86139cac36a6baaaa567d991","src/error/zoned.rs":"c83ac198d6496fb63c801b2bb7ca55648c806a1e3e688f456420d4f3a6bf0193","src/fmt/buffer.rs":"81cc62b698cce06886ad2bd97a396ec93bc6fe83536b8e7a82defda5aa8d0b72","src/fmt/friendly/mod.rs":"c22216f172c5d945f19fbe60a36789d1c071b7365b88ad108a51325386564cfc","src/fmt/friendly/parser.rs":"3e65a534005c742ffc792661e7f3bea1e88b6b365f63ca9fb4fafb75731d37d2","src/fmt/friendly/parser_label.rs":"e4a155bccc9968583d69773547160924813aab412b47cbd9c1e09446b0d34305","src/fmt/friendly/printer.rs":"08068d233c46a6650c44cddabd3bc149c89404da33769732f8fc47749b0a3822","src/fmt/mod.rs":"b14ad051f233111a37233e9b47e63fae557175a7714f3bf94d7562e34458a31c","src/fmt/offset.rs":"12b86def7f6507ff7522694666798c7ffc6092e162d20a649b450c3155bbf250","src/fmt/rfc2822.rs":"989adb9a39992852d10dbc8d95c478ea8742b2d256596c184fa85c4a2da02ccf","src/fmt/rfc9557.rs":"6d07fcebf288ed0c422f988a18426aad2f4e6cc723e5b120b88b1ab9f70021ed","src/fmt/serde.rs":"293ec7cadce4c98e630e9fe8a6a9971208e678fcde094f3519f59b38a7147e53","src/fmt/strtime/mod.rs":"fa4cd3b41468b9fb562a32146c8d1db5c902baf878ac06e1c202e9f18acf6c2a","src/fmt/strtime/parse.rs":"c6cf2b8903827613bae559a73674afc2ac6202558551e483463645da3923de16","src/fmt/strtime/printer.rs":"7faa6812ffa0719d2c6e09e8364785cbcc36cab7774368d78b8a2d527fe82406","src/fmt/temporal/mod.rs":"9b31f9cb583984460bc59deb0da178b21079e6fae62791c9a03267b617332217","src/fmt/temporal/parser.rs":"3d58eac738f403fca4df236a7437f1de8f8593f0865497b848ea8ad19cc3c1a9","src/fmt/temporal/pieces.rs":"3691d79e148a9ac44ec9c5218de9e3ddaee65dbcd5afccba2e9fb2f11e0e130f","src/fmt/temporal/printer.rs":"6d78722d1fc63f1f1e0d2b96288b55b8092d089bac097a87605917c39f309fe9","src/fmt/util.rs":"624f2d0de3470d49b9e0b5acf24c384f7de3892d985030e514bb34ba27f1c402","src/lib.rs":"6f43e89c9d704439ad41561e1debaad968cf266546f5ab8b65cfd83ff9eea87c","src/logging.rs":"95afe00674ee99240ff3e5cef6b349a1540930d59ce089a429d1d9fa0543a693","src/now.rs":"722f5edfb097103f83898631156601aae8dda1244301febf9706fac31c22cace","src/shared/crc32/mod.rs":"398b03985ae57a2ede9f173ee3b8f0538b4c715dae98b4b5f043a0b77b86140d","src/shared/crc32/table.rs":"a8552e6af79d33cb5b59ccc078cd1139d0f981f3d27851af3918c87fd1c4df61","src/shared/mod.rs":"82f683de7e824d29091c45a9fe59be4c1d51ed5075189d0444de6adb4a8bc364","src/shared/posix.rs":"e0d99732205ad5b8e5b8c8dfaa7331c65c34ff3705492dc172e3f930b5e5adbb","src/shared/tzif.rs":"9d0f0f84222b689b33f94f6dfb507477a236737e15a394212adc284f208b23a9","src/shared/util/array_str.rs":"9e4f14875cc4e3a713731a0d79614a7dd1e21598826dc9474abd03ce9bc93ba2","src/shared/util/itime.rs":"4558d3f712e33b2419a4b1590da393070fdd04b8d1cb44b1761474383e102e8f","src/shared/util/mod.rs":"1c013d21d401a822d94fd2adc4bf59844ac6a84ff32a6c6958b75b5898bc803e","src/signed_duration.rs":"7a88bdb81e1a5b14c12ba0086557c82bbfdf69b66b3686835acec16f07451321","src/span.rs":"ab7261e4b5f4220018a271f9b87c65f671d84425d0ea30fc1d4dd09d4eba65c0","src/timestamp.rs":"8ed06cad25b842613ca8eff3f675eaa31f2459ca32a713a2b2fca3a0f4eb0ea4","src/tz/ambiguous.rs":"d3232d13f3b6a795cdc6cb2247a17c53cd2e32de4bd7789910fbdb2bc5f2d05c","src/tz/concatenated.rs":"210ca0deae397e36584acc6b13eccbe89ee1ce1f33d6506ebf6f7ed95f134650","src/tz/db/bundled/disabled.rs":"60d2c796ce12f9468d4cc1cd51713c28eb64bbe60c1a8bdc07c1db63fe82afb5","src/tz/db/bundled/enabled.rs":"8d4150a58638757feff660325c136f44983ace42d2ba5b27ef3776e6c9079039","src/tz/db/bundled/mod.rs":"be47b2a9f1047d5bf43a53d82245d40bfa7c064af133cf4f0a4cd6e430a5c049","src/tz/db/concatenated/disabled.rs":"2bb5ab1200a2fd8de977625e5ed6e6e1b70e4eba5b9f7b7754e2906ced0cd423","src/tz/db/concatenated/enabled.rs":"4825948694e5da3fdb448e672ef4f48e7374fe3dd19f6173b6f3ec70ec0e28e7","src/tz/db/concatenated/mod.rs":"6a57f4796c0a2c9b9f3b13a50050bb0b6946ce6c8590e2de5b0141076960246a","src/tz/db/mod.rs":"6c97f1a6e114d2e57e711d153d1ef0023fe67e7bc23efa4be92e390a2bb56ce7","src/tz/db/zoneinfo/disabled.rs":"aa84ebfa9fbc73c7a29600bc28ac41b5df296d6a36cbc35e0dabbf7542b89488","src/tz/db/zoneinfo/enabled.rs":"0c1d1616ac2a5fe915753661df8db70768f66ca20c0e4dfe08b99d32b37ff864","src/tz/db/zoneinfo/mod.rs":"41653636523558b0c563b6132dd05379e1ca5d77f9ca3ecf6d540ff4a4b84aa3","src/tz/mod.rs":"c25be33649c56fd2f5da9f65eb909e4c5076a833f7bb0c2e201f3cce7f8bf314","src/tz/offset.rs":"b4abc1af09f622aba9d1a7546d0477d8ba06c35cea8353c0433ba6aabdb427fc","src/tz/posix.rs":"16717ab6a5f806c63f3b86480a855cf961398a5df21e6dee31556c227385ba51","src/tz/system/android.rs":"79c8ce1d7b368d2ec2eb9a60e302b9d5870c5b8fd5d13f8c779ed30342479375","src/tz/system/mod.rs":"0079febc4ec314d7a3d42e356c369d658215cf75e560512c127284445a3b89a0","src/tz/system/unix.rs":"37e440380315e922996514e1c5dbb8f298cc0a34ca8bf4617ab7f2b949f1c57b","src/tz/system/wasm_emscripten.rs":"958211d1d2b12c091768dedc64936e866a583a58049cebfb13f35889b0e81588","src/tz/system/wasm_js.rs":"484dbc81f18c3f6d600879541cecc7dca5d4e0dc316587b3df532ab4dc09ea1a","src/tz/system/windows/mod.rs":"be38bfaad2998c8f0bff6ec124b64fc93622e110bc3293fd06238fbd158ca62a","src/tz/system/windows/windows_zones.rs":"b29a64e0677dfa6fe11f79a267d0b9401a400c6ee770a619766d78eec1c20445","src/tz/testdata.rs":"414dd0cf2a1b6cc9c28dc065a6443abdb5240a9c46d53fa6d9e8bc875430ee6d","src/tz/timezone.rs":"7df85d7fcba2596ffbfd5cc801dd1c248431222a1587ce0d0a9eee8c74e43151","src/tz/tzif.rs":"a1af6ed688ef9ef48ccac22a9157c4f8f2f0694f57f1238cabb2d19184526cce","src/tz/zic.rs":"4767470687de037ff604d19041f10a14b25e69e8f93e321b782bc81506de44fb","src/util/array_str.rs":"9c4ecbaa0ad3754403998e9bddeab85905c61276e9f7b1f8b83ff18f3c9b14ed","src/util/b.rs":"c06fa0ce3e51a15192754b672048bf728e3a0a768da27c5b6866b1a517775c2f","src/util/borrow.rs":"d03200cbf7c3a778a53ffb952e55fe90922051ab18f1de2a8101b1148110854d","src/util/cache.rs":"b4506e3fd63b6ce0ef2d5272ece73a71894f3c59dd952507f40d22944b9a5b51","src/util/constant.rs":"3b7770b3a8743582c794295679493d9f82017685e7d8b49b62f201dc77b1f608","src/util/escape.rs":"75c47b446f6c279459a4f6f49d547de485cb17e661419aebd21e7dcefcfb7519","src/util/fs.rs":"9f722129a91aa0d80e60c6171127d4b330cc1f88504d54e5528c4f68f1540ef6","src/util/libm.rs":"5dc6d82d684a604ce1158a88b81ad09915626211e4f76197d4892c03456a3452","src/util/mod.rs":"3b7ac512f906e629ef153836e47779f73f345da6dcea27b7acafe22b549f6a0f","src/util/parse.rs":"ea0b475d0ba88fa14aa9a84a5a27c7b5ccab07497f5514d321d943490546065d","src/util/round.rs":"794e98b5dcc865012eb9efe7a1d7a189627d5a16daa4379feec3ffab58904ffe","src/util/sync.rs":"6c251c21c756851edc6bb5b4642ecea51a4730a2ea1eec9c8970ada508a215a9","src/util/utf8.rs":"c86ee661e9ba9749fdb66640ffc719143e5784eaebc2df94e702c622e85c4fc9","src/zoned.rs":"c90143c1b7a535459cf6a5f83ebee6f2bc2fc5eeeb2d3a7fe6ee35187ef58295","tests/lib.rs":"e3677c0f1ab7de936a9f556644b7864f53fbdad9a15d773313ee77b3eb2e1a7c"},"package":"1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359"} \ No newline at end of file +{"files":{".cargo_vcs_info.json":"1b6048b31eeacbffd41879e1629170c1c3ce35fa416158d14abb5d77bc1974d3","CHANGELOG.md":"9a5a6cdb7f6ff09f49fdfbd2ea310cf55cd1d03a59b4ad4445e27a805a6ba5f0","COMPARE.md":"442f95db5a01d8fa9086b11f7fb3d958fd81eeef26e4fd8f073fb152009caa63","COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.lock":"00108dcc6ae3a44c458113bd14fb5a35d15b0e5b98aa887f5e7c764ed3c5996e","Cargo.toml":"7ccb5fad188c094a495c4b0a04ed32da5312013378348e2082a9eab846d04aaa","Cargo.toml.orig":"23c50bd7bee47a883703ac121517159d5ded7a8fb645ad96b783ee8e2be36664","DESIGN.md":"d21d19e129bdd48a88529f14a75f7bc6e68eb8623b1b6cb3c1f8cfafebc58cba","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","PLATFORM.md":"02a7a064986fa2a4a0541dfacfb55d105340c5aebd7f1c3bdef5d60ae8778445","README.md":"7f8ddafd6571991a11f5b07cbd7f4edb34e88196e766aa7ffe371b6cbfae3ea1","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","src/civil/date.rs":"83c178f75fa552cc95ebd667c8b5d52f29b7de251de9c701c99feeb751991f8b","src/civil/datetime.rs":"3b13abf72a32fd80014616631c449461a33b0f842018d277204a74161c50d7f7","src/civil/iso_week_date.rs":"469a7c9c98cda8aa31c3fabbcbe25486f9abd2194140ae751fbfd76774547fa7","src/civil/mod.rs":"0860304a71e1139335ba03a8e2da811ed85c8052f1ca5c391143e9341db4533e","src/civil/time.rs":"73b468402e62514deeef67a0fe34b4cc7e1e0e2a0676e60b1aa214b7a5edd39a","src/civil/weekday.rs":"bf17f6d53c1064c38d3abd20c86a8c39b1e78fcacd604b46b1d2edabc7822d3b","src/duration.rs":"57228c034f222ed78a62a3936ba3881bacbd86955c40637151bc7cd9695901ae","src/error/civil.rs":"9c87174bec1b0340692b09505adfe2c6af86d77eada0b20a833d41a99420a6f2","src/error/duration.rs":"f7441181ba851dad753fc20fa7c8ca4b54c4b565a5d13b3070a2f9138956d88f","src/error/fmt/friendly.rs":"5e07fc237cd9addfd60692e2a931268c7c6886652db2423fb043b3de3560a7f1","src/error/fmt/mod.rs":"5ed8215ace05e01890769a8d66f548ea35cf7acd72dc72171e804a638e40c9e4","src/error/fmt/offset.rs":"0a73bdffba338dc758cf259f205d11905a94db43e7a0137788f554e4b9b7ba9f","src/error/fmt/rfc2822.rs":"333de0a9d2087934f57dd14081d3f5b129130b86617ce6382ccdf49368624b00","src/error/fmt/rfc9557.rs":"f041a4e46881e8651c0ac4fa95c659adba753f3c8ffa1b0c4dd5ddf5c51a20a8","src/error/fmt/strtime.rs":"c4cde14a5cd003f8d223b1d18f505bec68d52fbfa865b46661661bc5c36cb066","src/error/fmt/temporal.rs":"46d0f782f3ccb1e4337cee7b87a67e8c279753363403a28e8cd4359057f319b8","src/error/fmt/util.rs":"60595171152242fb544138378ee5dccea0b590b0ba74f08389ec0035d9d2a2f6","src/error/mod.rs":"56409ebaee9af9fb8a7d77994f90d3e2b557d326f5f55e6116ee99cc9edcfd10","src/error/signed_duration.rs":"3069ff2c85b4629aff34a3423ffd6ee22951ed91c5de145b9d3e6156ea807883","src/error/span.rs":"a2a806def4166a5e9bccd904600b93556dba4ebf7e5d0fbbb7982ca44cdb1839","src/error/timestamp.rs":"90b35dd3acbbac3d1f477186672e87d7023647ad21fcb18295efe053736a389b","src/error/tz/ambiguous.rs":"343950b71cf18772b6d892d0627237128fe557736a2a6b01b9efaf275805ba02","src/error/tz/concatenated.rs":"a073b5d9e46d898d26e661198da4c0cf4894faa4b278d453908d32d7189a4073","src/error/tz/db.rs":"7f1b850176d5093f0b6285fc8cd327f34083cd39d2140d49f2199f6f8af4b8ee","src/error/tz/mod.rs":"22ab0f7a23a828c1cc355ae6a0e6ce09f6b532e0669ad0a00ab5050ee2ce5807","src/error/tz/offset.rs":"06b9ef025de9005002e88d4766e5e599ab74de17dd5385043d28403c0a4e6d20","src/error/tz/posix.rs":"8048897f456cac4a85f06d123c937bedcdee974422c541139069188df452ed0e","src/error/tz/system.rs":"66876a02fefeeb6a750a883058a902934fcc3d9cc0f080feea66300e5231c1b5","src/error/tz/timezone.rs":"b8535574602859f97ef0fdfff530c768228ba3895a9226b81ec6552212f8aa33","src/error/tz/zic.rs":"4f8eb5c1a97e3a5f4b6f6283d83f8eac5d94638f0df0244fb548eb91b2b46a53","src/error/unit.rs":"b0fb666385248db60ae453249755a031142cbebf42e832055c225d3df0b397c2","src/error/util.rs":"db8eee30c288a3d1a4d1203db3b971a14e054b7a86139cac36a6baaaa567d991","src/error/zoned.rs":"c83ac198d6496fb63c801b2bb7ca55648c806a1e3e688f456420d4f3a6bf0193","src/fmt/buffer.rs":"81cc62b698cce06886ad2bd97a396ec93bc6fe83536b8e7a82defda5aa8d0b72","src/fmt/friendly/mod.rs":"c22216f172c5d945f19fbe60a36789d1c071b7365b88ad108a51325386564cfc","src/fmt/friendly/parser.rs":"3e65a534005c742ffc792661e7f3bea1e88b6b365f63ca9fb4fafb75731d37d2","src/fmt/friendly/parser_label.rs":"e4a155bccc9968583d69773547160924813aab412b47cbd9c1e09446b0d34305","src/fmt/friendly/printer.rs":"08068d233c46a6650c44cddabd3bc149c89404da33769732f8fc47749b0a3822","src/fmt/mod.rs":"b14ad051f233111a37233e9b47e63fae557175a7714f3bf94d7562e34458a31c","src/fmt/offset.rs":"12b86def7f6507ff7522694666798c7ffc6092e162d20a649b450c3155bbf250","src/fmt/rfc2822.rs":"989adb9a39992852d10dbc8d95c478ea8742b2d256596c184fa85c4a2da02ccf","src/fmt/rfc9557.rs":"6d07fcebf288ed0c422f988a18426aad2f4e6cc723e5b120b88b1ab9f70021ed","src/fmt/serde.rs":"293ec7cadce4c98e630e9fe8a6a9971208e678fcde094f3519f59b38a7147e53","src/fmt/strtime/mod.rs":"fa4cd3b41468b9fb562a32146c8d1db5c902baf878ac06e1c202e9f18acf6c2a","src/fmt/strtime/parse.rs":"c6cf2b8903827613bae559a73674afc2ac6202558551e483463645da3923de16","src/fmt/strtime/printer.rs":"7faa6812ffa0719d2c6e09e8364785cbcc36cab7774368d78b8a2d527fe82406","src/fmt/temporal/mod.rs":"9b31f9cb583984460bc59deb0da178b21079e6fae62791c9a03267b617332217","src/fmt/temporal/parser.rs":"3d58eac738f403fca4df236a7437f1de8f8593f0865497b848ea8ad19cc3c1a9","src/fmt/temporal/pieces.rs":"3691d79e148a9ac44ec9c5218de9e3ddaee65dbcd5afccba2e9fb2f11e0e130f","src/fmt/temporal/printer.rs":"6d78722d1fc63f1f1e0d2b96288b55b8092d089bac097a87605917c39f309fe9","src/fmt/util.rs":"624f2d0de3470d49b9e0b5acf24c384f7de3892d985030e514bb34ba27f1c402","src/lib.rs":"6f43e89c9d704439ad41561e1debaad968cf266546f5ab8b65cfd83ff9eea87c","src/logging.rs":"95afe00674ee99240ff3e5cef6b349a1540930d59ce089a429d1d9fa0543a693","src/now.rs":"722f5edfb097103f83898631156601aae8dda1244301febf9706fac31c22cace","src/shared/crc32/mod.rs":"398b03985ae57a2ede9f173ee3b8f0538b4c715dae98b4b5f043a0b77b86140d","src/shared/crc32/table.rs":"a8552e6af79d33cb5b59ccc078cd1139d0f981f3d27851af3918c87fd1c4df61","src/shared/mod.rs":"82f683de7e824d29091c45a9fe59be4c1d51ed5075189d0444de6adb4a8bc364","src/shared/posix.rs":"e0d99732205ad5b8e5b8c8dfaa7331c65c34ff3705492dc172e3f930b5e5adbb","src/shared/tzif.rs":"9d0f0f84222b689b33f94f6dfb507477a236737e15a394212adc284f208b23a9","src/shared/util/array_str.rs":"9e4f14875cc4e3a713731a0d79614a7dd1e21598826dc9474abd03ce9bc93ba2","src/shared/util/itime.rs":"4558d3f712e33b2419a4b1590da393070fdd04b8d1cb44b1761474383e102e8f","src/shared/util/mod.rs":"1c013d21d401a822d94fd2adc4bf59844ac6a84ff32a6c6958b75b5898bc803e","src/signed_duration.rs":"7a88bdb81e1a5b14c12ba0086557c82bbfdf69b66b3686835acec16f07451321","src/span.rs":"769a02f2ba7d2144ac572b5745a4d1fa226d986e696cd8570910677e175a7196","src/timestamp.rs":"8ed06cad25b842613ca8eff3f675eaa31f2459ca32a713a2b2fca3a0f4eb0ea4","src/tz/ambiguous.rs":"d3232d13f3b6a795cdc6cb2247a17c53cd2e32de4bd7789910fbdb2bc5f2d05c","src/tz/concatenated.rs":"210ca0deae397e36584acc6b13eccbe89ee1ce1f33d6506ebf6f7ed95f134650","src/tz/db/bundled/disabled.rs":"60d2c796ce12f9468d4cc1cd51713c28eb64bbe60c1a8bdc07c1db63fe82afb5","src/tz/db/bundled/enabled.rs":"8d4150a58638757feff660325c136f44983ace42d2ba5b27ef3776e6c9079039","src/tz/db/bundled/mod.rs":"be47b2a9f1047d5bf43a53d82245d40bfa7c064af133cf4f0a4cd6e430a5c049","src/tz/db/concatenated/disabled.rs":"2bb5ab1200a2fd8de977625e5ed6e6e1b70e4eba5b9f7b7754e2906ced0cd423","src/tz/db/concatenated/enabled.rs":"4825948694e5da3fdb448e672ef4f48e7374fe3dd19f6173b6f3ec70ec0e28e7","src/tz/db/concatenated/mod.rs":"6a57f4796c0a2c9b9f3b13a50050bb0b6946ce6c8590e2de5b0141076960246a","src/tz/db/mod.rs":"6c97f1a6e114d2e57e711d153d1ef0023fe67e7bc23efa4be92e390a2bb56ce7","src/tz/db/zoneinfo/disabled.rs":"aa84ebfa9fbc73c7a29600bc28ac41b5df296d6a36cbc35e0dabbf7542b89488","src/tz/db/zoneinfo/enabled.rs":"0c1d1616ac2a5fe915753661df8db70768f66ca20c0e4dfe08b99d32b37ff864","src/tz/db/zoneinfo/mod.rs":"41653636523558b0c563b6132dd05379e1ca5d77f9ca3ecf6d540ff4a4b84aa3","src/tz/mod.rs":"c25be33649c56fd2f5da9f65eb909e4c5076a833f7bb0c2e201f3cce7f8bf314","src/tz/offset.rs":"b4abc1af09f622aba9d1a7546d0477d8ba06c35cea8353c0433ba6aabdb427fc","src/tz/posix.rs":"16717ab6a5f806c63f3b86480a855cf961398a5df21e6dee31556c227385ba51","src/tz/system/android.rs":"79c8ce1d7b368d2ec2eb9a60e302b9d5870c5b8fd5d13f8c779ed30342479375","src/tz/system/mod.rs":"0079febc4ec314d7a3d42e356c369d658215cf75e560512c127284445a3b89a0","src/tz/system/unix.rs":"37e440380315e922996514e1c5dbb8f298cc0a34ca8bf4617ab7f2b949f1c57b","src/tz/system/wasm_emscripten.rs":"958211d1d2b12c091768dedc64936e866a583a58049cebfb13f35889b0e81588","src/tz/system/wasm_js.rs":"484dbc81f18c3f6d600879541cecc7dca5d4e0dc316587b3df532ab4dc09ea1a","src/tz/system/windows/mod.rs":"be38bfaad2998c8f0bff6ec124b64fc93622e110bc3293fd06238fbd158ca62a","src/tz/system/windows/windows_zones.rs":"b29a64e0677dfa6fe11f79a267d0b9401a400c6ee770a619766d78eec1c20445","src/tz/testdata.rs":"414dd0cf2a1b6cc9c28dc065a6443abdb5240a9c46d53fa6d9e8bc875430ee6d","src/tz/timezone.rs":"c8e1fdf5a7fe9fd205670cc803272261bc1fa82dbc23013c8bad95e5e000e098","src/tz/tzif.rs":"a1af6ed688ef9ef48ccac22a9157c4f8f2f0694f57f1238cabb2d19184526cce","src/tz/zic.rs":"4767470687de037ff604d19041f10a14b25e69e8f93e321b782bc81506de44fb","src/util/array_str.rs":"9c4ecbaa0ad3754403998e9bddeab85905c61276e9f7b1f8b83ff18f3c9b14ed","src/util/b.rs":"c06fa0ce3e51a15192754b672048bf728e3a0a768da27c5b6866b1a517775c2f","src/util/borrow.rs":"d03200cbf7c3a778a53ffb952e55fe90922051ab18f1de2a8101b1148110854d","src/util/cache.rs":"b4506e3fd63b6ce0ef2d5272ece73a71894f3c59dd952507f40d22944b9a5b51","src/util/constant.rs":"3b7770b3a8743582c794295679493d9f82017685e7d8b49b62f201dc77b1f608","src/util/escape.rs":"75c47b446f6c279459a4f6f49d547de485cb17e661419aebd21e7dcefcfb7519","src/util/fs.rs":"9f722129a91aa0d80e60c6171127d4b330cc1f88504d54e5528c4f68f1540ef6","src/util/libm.rs":"5dc6d82d684a604ce1158a88b81ad09915626211e4f76197d4892c03456a3452","src/util/mod.rs":"3b7ac512f906e629ef153836e47779f73f345da6dcea27b7acafe22b549f6a0f","src/util/parse.rs":"ea0b475d0ba88fa14aa9a84a5a27c7b5ccab07497f5514d321d943490546065d","src/util/round.rs":"794e98b5dcc865012eb9efe7a1d7a189627d5a16daa4379feec3ffab58904ffe","src/util/sync.rs":"6c251c21c756851edc6bb5b4642ecea51a4730a2ea1eec9c8970ada508a215a9","src/util/utf8.rs":"c86ee661e9ba9749fdb66640ffc719143e5784eaebc2df94e702c622e85c4fc9","src/zoned.rs":"56b2a47d6556e376b7de837e5d201efe9fec0d30ccbe7520c158321de98af607","tests/lib.rs":"e3677c0f1ab7de936a9f556644b7864f53fbdad9a15d773313ee77b3eb2e1a7c"},"package":"f00b5dbd620d61dfdcb6007c9c1f6054ebd75319f163d886a9055cec1155073d"} \ No newline at end of file diff --git a/jiff-0.2.24/.cargo_vcs_info.json b/jiff-0.2.24/.cargo_vcs_info.json new file mode 100644 index 0000000000..b3a9821fa8 --- /dev/null +++ b/jiff-0.2.24/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "2cc55b285dee2ac78da352d5ac269f091d1f7a50" + }, + "path_in_vcs": "" +} \ No newline at end of file diff --git a/jiff-0.2.23/CHANGELOG.md b/jiff-0.2.24/CHANGELOG.md similarity index 99% rename from jiff-0.2.23/CHANGELOG.md rename to jiff-0.2.24/CHANGELOG.md index 3ea8bf835a..b57013ab5e 100644 --- a/jiff-0.2.23/CHANGELOG.md +++ b/jiff-0.2.24/CHANGELOG.md @@ -1,5 +1,25 @@ # CHANGELOG +0.2.24 (2026-04-23) +=================== +This release primarily adds a new `memory_usage` routine for reporting +heap allocation sizes for the `TimeZone` and `Zoned` types. This +release also acknowledges and updates the timeline expectations for a +Jiff 1.0 release in `README.md`. + +Enhancements: + +* [#520](https://github.com/BurntSushi/jiff/issues/520): +Add `memory_usage` to the `TimeZone` and `Zoned` types. +* [#535](https://github.com/BurntSushi/jiff/pull/535): +Improve comment in `Span::checked_add` example. + +Bug fixes: + +* [#541](https://github.com/BurntSushi/jiff/pull/541): +Update Jiff 1.0 timeline. + + 0.2.23 (2026-03-03) =================== This release updates Jiff's bundled copy of the [IANA Time Zone Database] diff --git a/jiff-0.2.23/COMPARE.md b/jiff-0.2.24/COMPARE.md similarity index 100% rename from jiff-0.2.23/COMPARE.md rename to jiff-0.2.24/COMPARE.md diff --git a/jiff-0.2.23/COPYING b/jiff-0.2.24/COPYING similarity index 100% rename from jiff-0.2.23/COPYING rename to jiff-0.2.24/COPYING diff --git a/jiff-0.2.23/Cargo.lock b/jiff-0.2.24/Cargo.lock similarity index 99% rename from jiff-0.2.23/Cargo.lock rename to jiff-0.2.24/Cargo.lock index 52d2a042e2..542aef5837 100644 --- a/jiff-0.2.23/Cargo.lock +++ b/jiff-0.2.24/Cargo.lock @@ -255,7 +255,7 @@ checksum = "7ee5b5339afb4c41626dde77b7a611bd4f2c202b897852b4bcf5d03eddc61010" [[package]] name = "jiff" -version = "0.2.23" +version = "0.2.24" dependencies = [ "anyhow", "chrono", @@ -286,9 +286,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.23" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" +checksum = "e000de030ff8022ea1da3f466fbb0f3a809f5e51ed31f6dd931c35181ad8e6d7" dependencies = [ "jiff-tzdb", "proc-macro2", diff --git a/jiff-0.2.23/Cargo.toml b/jiff-0.2.24/Cargo.toml similarity index 99% rename from jiff-0.2.23/Cargo.toml rename to jiff-0.2.24/Cargo.toml index 032f8d9c6a..c8f8230e3d 100644 --- a/jiff-0.2.23/Cargo.toml +++ b/jiff-0.2.24/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.70" name = "jiff" -version = "0.2.23" +version = "0.2.24" authors = ["Andrew Gallant "] build = false include = [ @@ -201,7 +201,7 @@ version = "0.2.70" optional = true [target."cfg(any())".dependencies.jiff-static] -version = "=0.2.23" +version = "=0.2.24" [target.'cfg(any(windows, target_family = "wasm"))'.dependencies.jiff-tzdb-platform] version = "0.1.3" diff --git a/jiff-0.2.23/Cargo.toml.orig b/jiff-0.2.24/Cargo.toml.orig similarity index 99% rename from jiff-0.2.23/Cargo.toml.orig rename to jiff-0.2.24/Cargo.toml.orig index 15b60def31..22f5f35521 100644 --- a/jiff-0.2.23/Cargo.toml.orig +++ b/jiff-0.2.24/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "jiff" -version = "0.2.23" #:version +version = "0.2.24" #:version authors = ["Andrew Gallant "] license = "Unlicense OR MIT" repository = "https://github.com/BurntSushi/jiff" @@ -196,7 +196,7 @@ serde_core = { version = "1.0.221", optional = true, default-features = false } # # See: https://github.com/matklad/macro-dep-test [target.'cfg(any())'.dependencies] -jiff-static = { version = "=0.2.23", path = "crates/jiff-static" } +jiff-static = { version = "=0.2.24", path = "crates/jiff-static" } # Note that the `cfg` gate for the `tzdb-bundle-platform` must repeat the # target gate on this dependency. The intent is that `tzdb-bundle-platform` diff --git a/jiff-0.2.23/DESIGN.md b/jiff-0.2.24/DESIGN.md similarity index 100% rename from jiff-0.2.23/DESIGN.md rename to jiff-0.2.24/DESIGN.md diff --git a/jiff-0.2.23/LICENSE-MIT b/jiff-0.2.24/LICENSE-MIT similarity index 100% rename from jiff-0.2.23/LICENSE-MIT rename to jiff-0.2.24/LICENSE-MIT diff --git a/jiff-0.2.23/PLATFORM.md b/jiff-0.2.24/PLATFORM.md similarity index 100% rename from jiff-0.2.23/PLATFORM.md rename to jiff-0.2.24/PLATFORM.md diff --git a/jiff-0.2.23/README.md b/jiff-0.2.24/README.md similarity index 97% rename from jiff-0.2.23/README.md rename to jiff-0.2.24/README.md index 6b979a7479..a919116827 100644 --- a/jiff-0.2.23/README.md +++ b/jiff-0.2.24/README.md @@ -108,10 +108,10 @@ documentation lists the full set of supported features. ### Future plans -My original plan was to release Jiff 1.0 in Summer 2025. It is now Winter 2026, +My original plan was to release Jiff 1.0 in Summer 2025. It is now April 2026, so that deadline has clearly slipped. I've continued to make progress toward -Jiff 1.0, but it has been more work than anticipated. My current hope is to -have Jiff 1.0 out by Spring or Summer 2026. +Jiff 1.0, but it has been more work than anticipated. I don't currently have a +timeline for a Jiff 1.0 release. It's important to get Jiff 1.0 as "right" as possible. Namely, once it's released, I plan to commit to its API indefinitely. At which point, users of @@ -171,7 +171,7 @@ adding new dependencies: 1. When a dependency is _practically_ required in order to interact with a platform. For example, `windows-sys` for discovering the system time zone on Windows. -2. When a dependency is necessary for inter-operability. For example, `serde`. +2. When a dependency is necessary for interoperability. For example, `serde`. But even here, I expect to be conservative, where I'm generally only willing to depend on things that have fewer breaking change releases than Jiff. diff --git a/jiff-0.2.23/UNLICENSE b/jiff-0.2.24/UNLICENSE similarity index 100% rename from jiff-0.2.23/UNLICENSE rename to jiff-0.2.24/UNLICENSE diff --git a/jiff-0.2.23/src/civil/date.rs b/jiff-0.2.24/src/civil/date.rs similarity index 99% rename from jiff-0.2.23/src/civil/date.rs rename to jiff-0.2.24/src/civil/date.rs index 739f934512..99934ccb69 100644 --- a/jiff-0.2.23/src/civil/date.rs +++ b/jiff-0.2.24/src/civil/date.rs @@ -3531,7 +3531,7 @@ fn month_add_overflowing(month: i8, span: i32) -> (i8, i16) { let years = total.div_euclid(12); let month = total.rem_euclid(12) + 1; // OK because `month` is derived from `% 12`, so must fit into an `i8`. And - // becuase `years` is derived from `([1-12] - 1 + SpanMonths) / 12` where + // because `years` is derived from `([1-12] - 1 + SpanMonths) / 12` where // the maximum `SpanMonths` is `239976`. Thus, the result is guaranteed to // fit into an `i16`. (month as i8, years as i16) diff --git a/jiff-0.2.23/src/civil/datetime.rs b/jiff-0.2.24/src/civil/datetime.rs similarity index 100% rename from jiff-0.2.23/src/civil/datetime.rs rename to jiff-0.2.24/src/civil/datetime.rs diff --git a/jiff-0.2.23/src/civil/iso_week_date.rs b/jiff-0.2.24/src/civil/iso_week_date.rs similarity index 100% rename from jiff-0.2.23/src/civil/iso_week_date.rs rename to jiff-0.2.24/src/civil/iso_week_date.rs diff --git a/jiff-0.2.23/src/civil/mod.rs b/jiff-0.2.24/src/civil/mod.rs similarity index 100% rename from jiff-0.2.23/src/civil/mod.rs rename to jiff-0.2.24/src/civil/mod.rs diff --git a/jiff-0.2.23/src/civil/time.rs b/jiff-0.2.24/src/civil/time.rs similarity index 100% rename from jiff-0.2.23/src/civil/time.rs rename to jiff-0.2.24/src/civil/time.rs diff --git a/jiff-0.2.23/src/civil/weekday.rs b/jiff-0.2.24/src/civil/weekday.rs similarity index 100% rename from jiff-0.2.23/src/civil/weekday.rs rename to jiff-0.2.24/src/civil/weekday.rs diff --git a/jiff-0.2.23/src/duration.rs b/jiff-0.2.24/src/duration.rs similarity index 100% rename from jiff-0.2.23/src/duration.rs rename to jiff-0.2.24/src/duration.rs diff --git a/jiff-0.2.23/src/error/civil.rs b/jiff-0.2.24/src/error/civil.rs similarity index 100% rename from jiff-0.2.23/src/error/civil.rs rename to jiff-0.2.24/src/error/civil.rs diff --git a/jiff-0.2.23/src/error/duration.rs b/jiff-0.2.24/src/error/duration.rs similarity index 100% rename from jiff-0.2.23/src/error/duration.rs rename to jiff-0.2.24/src/error/duration.rs diff --git a/jiff-0.2.23/src/error/fmt/friendly.rs b/jiff-0.2.24/src/error/fmt/friendly.rs similarity index 100% rename from jiff-0.2.23/src/error/fmt/friendly.rs rename to jiff-0.2.24/src/error/fmt/friendly.rs diff --git a/jiff-0.2.23/src/error/fmt/mod.rs b/jiff-0.2.24/src/error/fmt/mod.rs similarity index 100% rename from jiff-0.2.23/src/error/fmt/mod.rs rename to jiff-0.2.24/src/error/fmt/mod.rs diff --git a/jiff-0.2.23/src/error/fmt/offset.rs b/jiff-0.2.24/src/error/fmt/offset.rs similarity index 100% rename from jiff-0.2.23/src/error/fmt/offset.rs rename to jiff-0.2.24/src/error/fmt/offset.rs diff --git a/jiff-0.2.23/src/error/fmt/rfc2822.rs b/jiff-0.2.24/src/error/fmt/rfc2822.rs similarity index 100% rename from jiff-0.2.23/src/error/fmt/rfc2822.rs rename to jiff-0.2.24/src/error/fmt/rfc2822.rs diff --git a/jiff-0.2.23/src/error/fmt/rfc9557.rs b/jiff-0.2.24/src/error/fmt/rfc9557.rs similarity index 100% rename from jiff-0.2.23/src/error/fmt/rfc9557.rs rename to jiff-0.2.24/src/error/fmt/rfc9557.rs diff --git a/jiff-0.2.23/src/error/fmt/strtime.rs b/jiff-0.2.24/src/error/fmt/strtime.rs similarity index 100% rename from jiff-0.2.23/src/error/fmt/strtime.rs rename to jiff-0.2.24/src/error/fmt/strtime.rs diff --git a/jiff-0.2.23/src/error/fmt/temporal.rs b/jiff-0.2.24/src/error/fmt/temporal.rs similarity index 100% rename from jiff-0.2.23/src/error/fmt/temporal.rs rename to jiff-0.2.24/src/error/fmt/temporal.rs diff --git a/jiff-0.2.23/src/error/fmt/util.rs b/jiff-0.2.24/src/error/fmt/util.rs similarity index 100% rename from jiff-0.2.23/src/error/fmt/util.rs rename to jiff-0.2.24/src/error/fmt/util.rs diff --git a/jiff-0.2.23/src/error/mod.rs b/jiff-0.2.24/src/error/mod.rs similarity index 100% rename from jiff-0.2.23/src/error/mod.rs rename to jiff-0.2.24/src/error/mod.rs diff --git a/jiff-0.2.23/src/error/signed_duration.rs b/jiff-0.2.24/src/error/signed_duration.rs similarity index 100% rename from jiff-0.2.23/src/error/signed_duration.rs rename to jiff-0.2.24/src/error/signed_duration.rs diff --git a/jiff-0.2.23/src/error/span.rs b/jiff-0.2.24/src/error/span.rs similarity index 100% rename from jiff-0.2.23/src/error/span.rs rename to jiff-0.2.24/src/error/span.rs diff --git a/jiff-0.2.23/src/error/timestamp.rs b/jiff-0.2.24/src/error/timestamp.rs similarity index 100% rename from jiff-0.2.23/src/error/timestamp.rs rename to jiff-0.2.24/src/error/timestamp.rs diff --git a/jiff-0.2.23/src/error/tz/ambiguous.rs b/jiff-0.2.24/src/error/tz/ambiguous.rs similarity index 100% rename from jiff-0.2.23/src/error/tz/ambiguous.rs rename to jiff-0.2.24/src/error/tz/ambiguous.rs diff --git a/jiff-0.2.23/src/error/tz/concatenated.rs b/jiff-0.2.24/src/error/tz/concatenated.rs similarity index 100% rename from jiff-0.2.23/src/error/tz/concatenated.rs rename to jiff-0.2.24/src/error/tz/concatenated.rs diff --git a/jiff-0.2.23/src/error/tz/db.rs b/jiff-0.2.24/src/error/tz/db.rs similarity index 100% rename from jiff-0.2.23/src/error/tz/db.rs rename to jiff-0.2.24/src/error/tz/db.rs diff --git a/jiff-0.2.23/src/error/tz/mod.rs b/jiff-0.2.24/src/error/tz/mod.rs similarity index 100% rename from jiff-0.2.23/src/error/tz/mod.rs rename to jiff-0.2.24/src/error/tz/mod.rs diff --git a/jiff-0.2.23/src/error/tz/offset.rs b/jiff-0.2.24/src/error/tz/offset.rs similarity index 100% rename from jiff-0.2.23/src/error/tz/offset.rs rename to jiff-0.2.24/src/error/tz/offset.rs diff --git a/jiff-0.2.23/src/error/tz/posix.rs b/jiff-0.2.24/src/error/tz/posix.rs similarity index 100% rename from jiff-0.2.23/src/error/tz/posix.rs rename to jiff-0.2.24/src/error/tz/posix.rs diff --git a/jiff-0.2.23/src/error/tz/system.rs b/jiff-0.2.24/src/error/tz/system.rs similarity index 100% rename from jiff-0.2.23/src/error/tz/system.rs rename to jiff-0.2.24/src/error/tz/system.rs diff --git a/jiff-0.2.23/src/error/tz/timezone.rs b/jiff-0.2.24/src/error/tz/timezone.rs similarity index 100% rename from jiff-0.2.23/src/error/tz/timezone.rs rename to jiff-0.2.24/src/error/tz/timezone.rs diff --git a/jiff-0.2.23/src/error/tz/zic.rs b/jiff-0.2.24/src/error/tz/zic.rs similarity index 100% rename from jiff-0.2.23/src/error/tz/zic.rs rename to jiff-0.2.24/src/error/tz/zic.rs diff --git a/jiff-0.2.23/src/error/unit.rs b/jiff-0.2.24/src/error/unit.rs similarity index 100% rename from jiff-0.2.23/src/error/unit.rs rename to jiff-0.2.24/src/error/unit.rs diff --git a/jiff-0.2.23/src/error/util.rs b/jiff-0.2.24/src/error/util.rs similarity index 100% rename from jiff-0.2.23/src/error/util.rs rename to jiff-0.2.24/src/error/util.rs diff --git a/jiff-0.2.23/src/error/zoned.rs b/jiff-0.2.24/src/error/zoned.rs similarity index 100% rename from jiff-0.2.23/src/error/zoned.rs rename to jiff-0.2.24/src/error/zoned.rs diff --git a/jiff-0.2.23/src/fmt/buffer.rs b/jiff-0.2.24/src/fmt/buffer.rs similarity index 100% rename from jiff-0.2.23/src/fmt/buffer.rs rename to jiff-0.2.24/src/fmt/buffer.rs diff --git a/jiff-0.2.23/src/fmt/friendly/mod.rs b/jiff-0.2.24/src/fmt/friendly/mod.rs similarity index 100% rename from jiff-0.2.23/src/fmt/friendly/mod.rs rename to jiff-0.2.24/src/fmt/friendly/mod.rs diff --git a/jiff-0.2.23/src/fmt/friendly/parser.rs b/jiff-0.2.24/src/fmt/friendly/parser.rs similarity index 100% rename from jiff-0.2.23/src/fmt/friendly/parser.rs rename to jiff-0.2.24/src/fmt/friendly/parser.rs diff --git a/jiff-0.2.23/src/fmt/friendly/parser_label.rs b/jiff-0.2.24/src/fmt/friendly/parser_label.rs similarity index 100% rename from jiff-0.2.23/src/fmt/friendly/parser_label.rs rename to jiff-0.2.24/src/fmt/friendly/parser_label.rs diff --git a/jiff-0.2.23/src/fmt/friendly/printer.rs b/jiff-0.2.24/src/fmt/friendly/printer.rs similarity index 100% rename from jiff-0.2.23/src/fmt/friendly/printer.rs rename to jiff-0.2.24/src/fmt/friendly/printer.rs diff --git a/jiff-0.2.23/src/fmt/mod.rs b/jiff-0.2.24/src/fmt/mod.rs similarity index 100% rename from jiff-0.2.23/src/fmt/mod.rs rename to jiff-0.2.24/src/fmt/mod.rs diff --git a/jiff-0.2.23/src/fmt/offset.rs b/jiff-0.2.24/src/fmt/offset.rs similarity index 100% rename from jiff-0.2.23/src/fmt/offset.rs rename to jiff-0.2.24/src/fmt/offset.rs diff --git a/jiff-0.2.23/src/fmt/rfc2822.rs b/jiff-0.2.24/src/fmt/rfc2822.rs similarity index 100% rename from jiff-0.2.23/src/fmt/rfc2822.rs rename to jiff-0.2.24/src/fmt/rfc2822.rs diff --git a/jiff-0.2.23/src/fmt/rfc9557.rs b/jiff-0.2.24/src/fmt/rfc9557.rs similarity index 100% rename from jiff-0.2.23/src/fmt/rfc9557.rs rename to jiff-0.2.24/src/fmt/rfc9557.rs diff --git a/jiff-0.2.23/src/fmt/serde.rs b/jiff-0.2.24/src/fmt/serde.rs similarity index 100% rename from jiff-0.2.23/src/fmt/serde.rs rename to jiff-0.2.24/src/fmt/serde.rs diff --git a/jiff-0.2.23/src/fmt/strtime/mod.rs b/jiff-0.2.24/src/fmt/strtime/mod.rs similarity index 100% rename from jiff-0.2.23/src/fmt/strtime/mod.rs rename to jiff-0.2.24/src/fmt/strtime/mod.rs diff --git a/jiff-0.2.23/src/fmt/strtime/parse.rs b/jiff-0.2.24/src/fmt/strtime/parse.rs similarity index 100% rename from jiff-0.2.23/src/fmt/strtime/parse.rs rename to jiff-0.2.24/src/fmt/strtime/parse.rs diff --git a/jiff-0.2.23/src/fmt/strtime/printer.rs b/jiff-0.2.24/src/fmt/strtime/printer.rs similarity index 100% rename from jiff-0.2.23/src/fmt/strtime/printer.rs rename to jiff-0.2.24/src/fmt/strtime/printer.rs diff --git a/jiff-0.2.23/src/fmt/temporal/mod.rs b/jiff-0.2.24/src/fmt/temporal/mod.rs similarity index 100% rename from jiff-0.2.23/src/fmt/temporal/mod.rs rename to jiff-0.2.24/src/fmt/temporal/mod.rs diff --git a/jiff-0.2.23/src/fmt/temporal/parser.rs b/jiff-0.2.24/src/fmt/temporal/parser.rs similarity index 100% rename from jiff-0.2.23/src/fmt/temporal/parser.rs rename to jiff-0.2.24/src/fmt/temporal/parser.rs diff --git a/jiff-0.2.23/src/fmt/temporal/pieces.rs b/jiff-0.2.24/src/fmt/temporal/pieces.rs similarity index 100% rename from jiff-0.2.23/src/fmt/temporal/pieces.rs rename to jiff-0.2.24/src/fmt/temporal/pieces.rs diff --git a/jiff-0.2.23/src/fmt/temporal/printer.rs b/jiff-0.2.24/src/fmt/temporal/printer.rs similarity index 100% rename from jiff-0.2.23/src/fmt/temporal/printer.rs rename to jiff-0.2.24/src/fmt/temporal/printer.rs diff --git a/jiff-0.2.23/src/fmt/util.rs b/jiff-0.2.24/src/fmt/util.rs similarity index 100% rename from jiff-0.2.23/src/fmt/util.rs rename to jiff-0.2.24/src/fmt/util.rs diff --git a/jiff-0.2.23/src/lib.rs b/jiff-0.2.24/src/lib.rs similarity index 100% rename from jiff-0.2.23/src/lib.rs rename to jiff-0.2.24/src/lib.rs diff --git a/jiff-0.2.23/src/logging.rs b/jiff-0.2.24/src/logging.rs similarity index 100% rename from jiff-0.2.23/src/logging.rs rename to jiff-0.2.24/src/logging.rs diff --git a/jiff-0.2.23/src/now.rs b/jiff-0.2.24/src/now.rs similarity index 100% rename from jiff-0.2.23/src/now.rs rename to jiff-0.2.24/src/now.rs diff --git a/jiff-0.2.23/src/shared/crc32/mod.rs b/jiff-0.2.24/src/shared/crc32/mod.rs similarity index 100% rename from jiff-0.2.23/src/shared/crc32/mod.rs rename to jiff-0.2.24/src/shared/crc32/mod.rs diff --git a/jiff-0.2.23/src/shared/crc32/table.rs b/jiff-0.2.24/src/shared/crc32/table.rs similarity index 100% rename from jiff-0.2.23/src/shared/crc32/table.rs rename to jiff-0.2.24/src/shared/crc32/table.rs diff --git a/jiff-0.2.23/src/shared/mod.rs b/jiff-0.2.24/src/shared/mod.rs similarity index 100% rename from jiff-0.2.23/src/shared/mod.rs rename to jiff-0.2.24/src/shared/mod.rs diff --git a/jiff-0.2.23/src/shared/posix.rs b/jiff-0.2.24/src/shared/posix.rs similarity index 100% rename from jiff-0.2.23/src/shared/posix.rs rename to jiff-0.2.24/src/shared/posix.rs diff --git a/jiff-0.2.23/src/shared/tzif.rs b/jiff-0.2.24/src/shared/tzif.rs similarity index 100% rename from jiff-0.2.23/src/shared/tzif.rs rename to jiff-0.2.24/src/shared/tzif.rs diff --git a/jiff-0.2.23/src/shared/util/array_str.rs b/jiff-0.2.24/src/shared/util/array_str.rs similarity index 100% rename from jiff-0.2.23/src/shared/util/array_str.rs rename to jiff-0.2.24/src/shared/util/array_str.rs diff --git a/jiff-0.2.23/src/shared/util/itime.rs b/jiff-0.2.24/src/shared/util/itime.rs similarity index 100% rename from jiff-0.2.23/src/shared/util/itime.rs rename to jiff-0.2.24/src/shared/util/itime.rs diff --git a/jiff-0.2.23/src/shared/util/mod.rs b/jiff-0.2.24/src/shared/util/mod.rs similarity index 100% rename from jiff-0.2.23/src/shared/util/mod.rs rename to jiff-0.2.24/src/shared/util/mod.rs diff --git a/jiff-0.2.23/src/signed_duration.rs b/jiff-0.2.24/src/signed_duration.rs similarity index 100% rename from jiff-0.2.23/src/signed_duration.rs rename to jiff-0.2.24/src/signed_duration.rs diff --git a/jiff-0.2.23/src/span.rs b/jiff-0.2.24/src/span.rs similarity index 99% rename from jiff-0.2.23/src/span.rs rename to jiff-0.2.24/src/span.rs index 396be0e892..81b9a0dbd7 100644 --- a/jiff-0.2.23/src/span.rs +++ b/jiff-0.2.24/src/span.rs @@ -1681,12 +1681,13 @@ impl Span { /// /// let span1 = 1.month().days(15); /// let span2 = 15.days(); - /// // 1 month from March 1 is 31 days... + /// // March 1 plus 1 month is April 1 + /// // 1 month from April 1 is 30 days... /// assert_eq!( /// span1.checked_add((span2, date(2008, 3, 1)))?, /// 2.months().fieldwise(), /// ); - /// // ... but 1 month from April 1 is 30 days! + /// // ... but 1 month from May 1 is 31 days! /// assert_eq!( /// span1.checked_add((span2, date(2008, 4, 1)))?, /// 1.month().days(30).fieldwise(), diff --git a/jiff-0.2.23/src/timestamp.rs b/jiff-0.2.24/src/timestamp.rs similarity index 100% rename from jiff-0.2.23/src/timestamp.rs rename to jiff-0.2.24/src/timestamp.rs diff --git a/jiff-0.2.23/src/tz/ambiguous.rs b/jiff-0.2.24/src/tz/ambiguous.rs similarity index 100% rename from jiff-0.2.23/src/tz/ambiguous.rs rename to jiff-0.2.24/src/tz/ambiguous.rs diff --git a/jiff-0.2.23/src/tz/concatenated.rs b/jiff-0.2.24/src/tz/concatenated.rs similarity index 100% rename from jiff-0.2.23/src/tz/concatenated.rs rename to jiff-0.2.24/src/tz/concatenated.rs diff --git a/jiff-0.2.23/src/tz/db/bundled/disabled.rs b/jiff-0.2.24/src/tz/db/bundled/disabled.rs similarity index 100% rename from jiff-0.2.23/src/tz/db/bundled/disabled.rs rename to jiff-0.2.24/src/tz/db/bundled/disabled.rs diff --git a/jiff-0.2.23/src/tz/db/bundled/enabled.rs b/jiff-0.2.24/src/tz/db/bundled/enabled.rs similarity index 100% rename from jiff-0.2.23/src/tz/db/bundled/enabled.rs rename to jiff-0.2.24/src/tz/db/bundled/enabled.rs diff --git a/jiff-0.2.23/src/tz/db/bundled/mod.rs b/jiff-0.2.24/src/tz/db/bundled/mod.rs similarity index 100% rename from jiff-0.2.23/src/tz/db/bundled/mod.rs rename to jiff-0.2.24/src/tz/db/bundled/mod.rs diff --git a/jiff-0.2.23/src/tz/db/concatenated/disabled.rs b/jiff-0.2.24/src/tz/db/concatenated/disabled.rs similarity index 100% rename from jiff-0.2.23/src/tz/db/concatenated/disabled.rs rename to jiff-0.2.24/src/tz/db/concatenated/disabled.rs diff --git a/jiff-0.2.23/src/tz/db/concatenated/enabled.rs b/jiff-0.2.24/src/tz/db/concatenated/enabled.rs similarity index 100% rename from jiff-0.2.23/src/tz/db/concatenated/enabled.rs rename to jiff-0.2.24/src/tz/db/concatenated/enabled.rs diff --git a/jiff-0.2.23/src/tz/db/concatenated/mod.rs b/jiff-0.2.24/src/tz/db/concatenated/mod.rs similarity index 100% rename from jiff-0.2.23/src/tz/db/concatenated/mod.rs rename to jiff-0.2.24/src/tz/db/concatenated/mod.rs diff --git a/jiff-0.2.23/src/tz/db/mod.rs b/jiff-0.2.24/src/tz/db/mod.rs similarity index 100% rename from jiff-0.2.23/src/tz/db/mod.rs rename to jiff-0.2.24/src/tz/db/mod.rs diff --git a/jiff-0.2.23/src/tz/db/zoneinfo/disabled.rs b/jiff-0.2.24/src/tz/db/zoneinfo/disabled.rs similarity index 100% rename from jiff-0.2.23/src/tz/db/zoneinfo/disabled.rs rename to jiff-0.2.24/src/tz/db/zoneinfo/disabled.rs diff --git a/jiff-0.2.23/src/tz/db/zoneinfo/enabled.rs b/jiff-0.2.24/src/tz/db/zoneinfo/enabled.rs similarity index 100% rename from jiff-0.2.23/src/tz/db/zoneinfo/enabled.rs rename to jiff-0.2.24/src/tz/db/zoneinfo/enabled.rs diff --git a/jiff-0.2.23/src/tz/db/zoneinfo/mod.rs b/jiff-0.2.24/src/tz/db/zoneinfo/mod.rs similarity index 100% rename from jiff-0.2.23/src/tz/db/zoneinfo/mod.rs rename to jiff-0.2.24/src/tz/db/zoneinfo/mod.rs diff --git a/jiff-0.2.23/src/tz/mod.rs b/jiff-0.2.24/src/tz/mod.rs similarity index 100% rename from jiff-0.2.23/src/tz/mod.rs rename to jiff-0.2.24/src/tz/mod.rs diff --git a/jiff-0.2.23/src/tz/offset.rs b/jiff-0.2.24/src/tz/offset.rs similarity index 100% rename from jiff-0.2.23/src/tz/offset.rs rename to jiff-0.2.24/src/tz/offset.rs diff --git a/jiff-0.2.23/src/tz/posix.rs b/jiff-0.2.24/src/tz/posix.rs similarity index 100% rename from jiff-0.2.23/src/tz/posix.rs rename to jiff-0.2.24/src/tz/posix.rs diff --git a/jiff-0.2.23/src/tz/system/android.rs b/jiff-0.2.24/src/tz/system/android.rs similarity index 100% rename from jiff-0.2.23/src/tz/system/android.rs rename to jiff-0.2.24/src/tz/system/android.rs diff --git a/jiff-0.2.23/src/tz/system/mod.rs b/jiff-0.2.24/src/tz/system/mod.rs similarity index 100% rename from jiff-0.2.23/src/tz/system/mod.rs rename to jiff-0.2.24/src/tz/system/mod.rs diff --git a/jiff-0.2.23/src/tz/system/unix.rs b/jiff-0.2.24/src/tz/system/unix.rs similarity index 100% rename from jiff-0.2.23/src/tz/system/unix.rs rename to jiff-0.2.24/src/tz/system/unix.rs diff --git a/jiff-0.2.23/src/tz/system/wasm_emscripten.rs b/jiff-0.2.24/src/tz/system/wasm_emscripten.rs similarity index 100% rename from jiff-0.2.23/src/tz/system/wasm_emscripten.rs rename to jiff-0.2.24/src/tz/system/wasm_emscripten.rs diff --git a/jiff-0.2.23/src/tz/system/wasm_js.rs b/jiff-0.2.24/src/tz/system/wasm_js.rs similarity index 100% rename from jiff-0.2.23/src/tz/system/wasm_js.rs rename to jiff-0.2.24/src/tz/system/wasm_js.rs diff --git a/jiff-0.2.23/src/tz/system/windows/mod.rs b/jiff-0.2.24/src/tz/system/windows/mod.rs similarity index 100% rename from jiff-0.2.23/src/tz/system/windows/mod.rs rename to jiff-0.2.24/src/tz/system/windows/mod.rs diff --git a/jiff-0.2.23/src/tz/system/windows/windows_zones.rs b/jiff-0.2.24/src/tz/system/windows/windows_zones.rs similarity index 100% rename from jiff-0.2.23/src/tz/system/windows/windows_zones.rs rename to jiff-0.2.24/src/tz/system/windows/windows_zones.rs diff --git a/jiff-0.2.23/src/tz/testdata.rs b/jiff-0.2.24/src/tz/testdata.rs similarity index 100% rename from jiff-0.2.23/src/tz/testdata.rs rename to jiff-0.2.24/src/tz/testdata.rs diff --git a/jiff-0.2.23/src/tz/timezone.rs b/jiff-0.2.24/src/tz/timezone.rs similarity index 99% rename from jiff-0.2.23/src/tz/timezone.rs rename to jiff-0.2.24/src/tz/timezone.rs index c9275596ee..d0f4f194e2 100644 --- a/jiff-0.2.23/src/tz/timezone.rs +++ b/jiff-0.2.24/src/tz/timezone.rs @@ -1395,6 +1395,28 @@ impl TimeZone { ARC_POSIX(_posix) => "POSIX", } } + + /// Returns the heap memory usage, in bytes, of this timezone. + /// + /// This does **not** include the stack size used up by this timezone. + /// To compute that, use `std::mem::size_of::()`. + pub fn memory_usage(&self) -> usize { + repr::each! { + &self.repr, + UTC => 0, + UNKNOWN => 0, + FIXED(_offset) => 0, + STATIC_TZIF(_tzif) => 0, + ARC_TZIF(_tzif) => { + core::mem::size_of::() + + (core::mem::size_of::() * 2) + }, + ARC_POSIX(_posix) => { + core::mem::size_of::() + + (core::mem::size_of::() * 2) + }, + } + } } // Exposed APIs for Jiff's time zone proc macro. diff --git a/jiff-0.2.23/src/tz/tzif.rs b/jiff-0.2.24/src/tz/tzif.rs similarity index 100% rename from jiff-0.2.23/src/tz/tzif.rs rename to jiff-0.2.24/src/tz/tzif.rs diff --git a/jiff-0.2.23/src/tz/zic.rs b/jiff-0.2.24/src/tz/zic.rs similarity index 100% rename from jiff-0.2.23/src/tz/zic.rs rename to jiff-0.2.24/src/tz/zic.rs diff --git a/jiff-0.2.23/src/util/array_str.rs b/jiff-0.2.24/src/util/array_str.rs similarity index 100% rename from jiff-0.2.23/src/util/array_str.rs rename to jiff-0.2.24/src/util/array_str.rs diff --git a/jiff-0.2.23/src/util/b.rs b/jiff-0.2.24/src/util/b.rs similarity index 100% rename from jiff-0.2.23/src/util/b.rs rename to jiff-0.2.24/src/util/b.rs diff --git a/jiff-0.2.23/src/util/borrow.rs b/jiff-0.2.24/src/util/borrow.rs similarity index 100% rename from jiff-0.2.23/src/util/borrow.rs rename to jiff-0.2.24/src/util/borrow.rs diff --git a/jiff-0.2.23/src/util/cache.rs b/jiff-0.2.24/src/util/cache.rs similarity index 100% rename from jiff-0.2.23/src/util/cache.rs rename to jiff-0.2.24/src/util/cache.rs diff --git a/jiff-0.2.23/src/util/constant.rs b/jiff-0.2.24/src/util/constant.rs similarity index 100% rename from jiff-0.2.23/src/util/constant.rs rename to jiff-0.2.24/src/util/constant.rs diff --git a/jiff-0.2.23/src/util/escape.rs b/jiff-0.2.24/src/util/escape.rs similarity index 100% rename from jiff-0.2.23/src/util/escape.rs rename to jiff-0.2.24/src/util/escape.rs diff --git a/jiff-0.2.23/src/util/fs.rs b/jiff-0.2.24/src/util/fs.rs similarity index 100% rename from jiff-0.2.23/src/util/fs.rs rename to jiff-0.2.24/src/util/fs.rs diff --git a/jiff-0.2.23/src/util/libm.rs b/jiff-0.2.24/src/util/libm.rs similarity index 100% rename from jiff-0.2.23/src/util/libm.rs rename to jiff-0.2.24/src/util/libm.rs diff --git a/jiff-0.2.23/src/util/mod.rs b/jiff-0.2.24/src/util/mod.rs similarity index 100% rename from jiff-0.2.23/src/util/mod.rs rename to jiff-0.2.24/src/util/mod.rs diff --git a/jiff-0.2.23/src/util/parse.rs b/jiff-0.2.24/src/util/parse.rs similarity index 100% rename from jiff-0.2.23/src/util/parse.rs rename to jiff-0.2.24/src/util/parse.rs diff --git a/jiff-0.2.23/src/util/round.rs b/jiff-0.2.24/src/util/round.rs similarity index 100% rename from jiff-0.2.23/src/util/round.rs rename to jiff-0.2.24/src/util/round.rs diff --git a/jiff-0.2.23/src/util/sync.rs b/jiff-0.2.24/src/util/sync.rs similarity index 100% rename from jiff-0.2.23/src/util/sync.rs rename to jiff-0.2.24/src/util/sync.rs diff --git a/jiff-0.2.23/src/util/utf8.rs b/jiff-0.2.24/src/util/utf8.rs similarity index 100% rename from jiff-0.2.23/src/util/utf8.rs rename to jiff-0.2.24/src/util/utf8.rs diff --git a/jiff-0.2.23/src/zoned.rs b/jiff-0.2.24/src/zoned.rs similarity index 99% rename from jiff-0.2.23/src/zoned.rs rename to jiff-0.2.24/src/zoned.rs index 13461d758d..ef328ddc63 100644 --- a/jiff-0.2.23/src/zoned.rs +++ b/jiff-0.2.24/src/zoned.rs @@ -3237,6 +3237,14 @@ impl Zoned { let ZonedInner { timestamp, datetime, offset, time_zone } = inner; (timestamp, datetime, offset, time_zone) } + + /// Returns the heap memory usage, in bytes, of this zoned. + /// + /// This does **not** include the stack size used up by this zoned. + /// To compute that, use `std::mem::size_of::()`. + pub fn memory_usage(&self) -> usize { + self.inner.time_zone.memory_usage() + } } /// Parsing and formatting using a "printf"-style API. diff --git a/jiff-0.2.23/tests/lib.rs b/jiff-0.2.24/tests/lib.rs similarity index 100% rename from jiff-0.2.23/tests/lib.rs rename to jiff-0.2.24/tests/lib.rs diff --git a/jiff-static-0.2.23/.cargo-checksum.json b/jiff-static-0.2.24/.cargo-checksum.json similarity index 72% rename from jiff-static-0.2.23/.cargo-checksum.json rename to jiff-static-0.2.24/.cargo-checksum.json index 1f982b4abb..b2e3b3e361 100644 --- a/jiff-static-0.2.23/.cargo-checksum.json +++ b/jiff-static-0.2.24/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo_vcs_info.json":"1aa1f2081d385921425f0fe58d36eb3737f96b0c429d0dc06ce047cdc11ba5e5","COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.lock":"c3be1fcbc09d39ef1b593f32ab810f52b8a01c9794703212b0f1eb5d35f6f292","Cargo.toml":"415893f75a77e8152089304c5ae5711b26fb0e4de773a223703b939b6f1d091a","Cargo.toml.orig":"f2e2dfdbdb96b7fc2efb614c2e1fd04caa76513304d829fd3c8951e5f1039625","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"1703b78df7b46a4d02c3992d5cf6aeb6d6dd4686322db5d73a1a228291cb913c","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","src/lib.rs":"19e845c2c7e3b8acf846b05d39e46146dd54ce8a334e213b47244004a989c32e","src/shared/crc32/mod.rs":"d15141848dad2ac189bf1bd1dbccd629039015f7bbe101f071ac39973a575af0","src/shared/crc32/table.rs":"ce74ebe69462392b239143edf58c17ae29a7c93e43c34c84cf1a24401fd1bd1c","src/shared/error/itime.rs":"9165704bfd4416f70d663f6ae078bb06bd9b11b65efd401a2d32ec63a2107b13","src/shared/error/mod.rs":"a2f4bd19776970920abb540b6da3d3c0dc0422bacc49a0665326956c174a042f","src/shared/mod.rs":"15cdae67df68f1ffdfb505bacffc27dd907964b482925b1eb5d23dc629e970e8","src/shared/posix.rs":"2cbc54a651c1eed1028c5a052dd13d2c2e2d3127379667be615c7a2785ec5efe","src/shared/tzif.rs":"a59435d0ab55687533f16f5c2da8a5d04555df438524222a7faf2df6ce486d23","src/shared/util/array_str.rs":"9735a5384687620b087280824631cc9b5f29eee96aec350dbf2038d89c17598f","src/shared/util/error.rs":"6f1a13eef24512dda28a3127c498ae6e53fac887670f03d4ce4982f6c80e04af","src/shared/util/escape.rs":"2041bce3fbb6628aa2ff8a858b2cc3adf80696b500b049547e5e39e79a759ef7","src/shared/util/itime.rs":"78a41a686427271e097035aa2bc00b44a4a097f021d7414c432423f96bea02ee","src/shared/util/mod.rs":"ac49711b4995fcd64f8fc41bfb0d3d3fde96740eb5ae92bf7356e8ca51e2877a","src/shared/util/utf8.rs":"a0fad1d925ece6687da97e9308aed25e28980f2e6ae8775e186c6cb32a3217db"},"package":"2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4"} \ No newline at end of file +{"files":{".cargo_vcs_info.json":"1d58b1610305c5e2c0e44b7ac83b115d44edb74fb8191178573cbff33e3842ce","COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.lock":"406a9af7fad7353c10a602f41acc3f50e22d9c55bdfd1b9c0487f22cb359910e","Cargo.toml":"65e2d3d1e845f300f640eddb9738a421adf67151419cb28c8e41df58877cb9bb","Cargo.toml.orig":"b19ff3cc9c78279b1fe5bd3f5f864d6a2f3fe5a57a5962d595448abbb2a52a74","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"1703b78df7b46a4d02c3992d5cf6aeb6d6dd4686322db5d73a1a228291cb913c","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","src/lib.rs":"19e845c2c7e3b8acf846b05d39e46146dd54ce8a334e213b47244004a989c32e","src/shared/crc32/mod.rs":"d15141848dad2ac189bf1bd1dbccd629039015f7bbe101f071ac39973a575af0","src/shared/crc32/table.rs":"ce74ebe69462392b239143edf58c17ae29a7c93e43c34c84cf1a24401fd1bd1c","src/shared/error/itime.rs":"9165704bfd4416f70d663f6ae078bb06bd9b11b65efd401a2d32ec63a2107b13","src/shared/error/mod.rs":"a2f4bd19776970920abb540b6da3d3c0dc0422bacc49a0665326956c174a042f","src/shared/mod.rs":"15cdae67df68f1ffdfb505bacffc27dd907964b482925b1eb5d23dc629e970e8","src/shared/posix.rs":"2cbc54a651c1eed1028c5a052dd13d2c2e2d3127379667be615c7a2785ec5efe","src/shared/tzif.rs":"a59435d0ab55687533f16f5c2da8a5d04555df438524222a7faf2df6ce486d23","src/shared/util/array_str.rs":"9735a5384687620b087280824631cc9b5f29eee96aec350dbf2038d89c17598f","src/shared/util/error.rs":"6f1a13eef24512dda28a3127c498ae6e53fac887670f03d4ce4982f6c80e04af","src/shared/util/escape.rs":"2041bce3fbb6628aa2ff8a858b2cc3adf80696b500b049547e5e39e79a759ef7","src/shared/util/itime.rs":"78a41a686427271e097035aa2bc00b44a4a097f021d7414c432423f96bea02ee","src/shared/util/mod.rs":"ac49711b4995fcd64f8fc41bfb0d3d3fde96740eb5ae92bf7356e8ca51e2877a","src/shared/util/utf8.rs":"a0fad1d925ece6687da97e9308aed25e28980f2e6ae8775e186c6cb32a3217db"},"package":"e000de030ff8022ea1da3f466fbb0f3a809f5e51ed31f6dd931c35181ad8e6d7"} \ No newline at end of file diff --git a/jiff-static-0.2.23/.cargo_vcs_info.json b/jiff-static-0.2.24/.cargo_vcs_info.json similarity index 50% rename from jiff-static-0.2.23/.cargo_vcs_info.json rename to jiff-static-0.2.24/.cargo_vcs_info.json index 2cb279cd33..3892969fff 100644 --- a/jiff-static-0.2.23/.cargo_vcs_info.json +++ b/jiff-static-0.2.24/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "e5b7f0d061e4da9598aed73f6171e78baa8b007f" + "sha1": "2cc55b285dee2ac78da352d5ac269f091d1f7a50" }, "path_in_vcs": "crates/jiff-static" } \ No newline at end of file diff --git a/jiff-static-0.2.23/COPYING b/jiff-static-0.2.24/COPYING similarity index 100% rename from jiff-static-0.2.23/COPYING rename to jiff-static-0.2.24/COPYING diff --git a/jiff-static-0.2.23/Cargo.lock b/jiff-static-0.2.24/Cargo.lock similarity index 98% rename from jiff-static-0.2.23/Cargo.lock rename to jiff-static-0.2.24/Cargo.lock index 3e393eeaa1..1fcee7de4a 100644 --- a/jiff-static-0.2.23/Cargo.lock +++ b/jiff-static-0.2.24/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "jiff-static" -version = "0.2.23" +version = "0.2.24" dependencies = [ "jiff-tzdb", "proc-macro2", diff --git a/jiff-static-0.2.23/Cargo.toml b/jiff-static-0.2.24/Cargo.toml similarity index 98% rename from jiff-static-0.2.23/Cargo.toml rename to jiff-static-0.2.24/Cargo.toml index ba7238555a..18d189d71c 100644 --- a/jiff-static-0.2.23/Cargo.toml +++ b/jiff-static-0.2.24/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.70" name = "jiff-static" -version = "0.2.23" +version = "0.2.24" authors = ["Andrew Gallant "] build = false include = [ diff --git a/jiff-static-0.2.23/Cargo.toml.orig b/jiff-static-0.2.24/Cargo.toml.orig similarity index 97% rename from jiff-static-0.2.23/Cargo.toml.orig rename to jiff-static-0.2.24/Cargo.toml.orig index b3d1515f8d..e82727ee48 100644 --- a/jiff-static-0.2.23/Cargo.toml.orig +++ b/jiff-static-0.2.24/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "jiff-static" -version = "0.2.23" #:version +version = "0.2.24" #:version authors = ["Andrew Gallant "] license = "Unlicense OR MIT" homepage = "https://github.com/BurntSushi/jiff/tree/master/crates/jiff-static" diff --git a/jiff-static-0.2.23/LICENSE-MIT b/jiff-static-0.2.24/LICENSE-MIT similarity index 100% rename from jiff-static-0.2.23/LICENSE-MIT rename to jiff-static-0.2.24/LICENSE-MIT diff --git a/jiff-static-0.2.23/README.md b/jiff-static-0.2.24/README.md similarity index 100% rename from jiff-static-0.2.23/README.md rename to jiff-static-0.2.24/README.md diff --git a/jiff-static-0.2.23/UNLICENSE b/jiff-static-0.2.24/UNLICENSE similarity index 100% rename from jiff-static-0.2.23/UNLICENSE rename to jiff-static-0.2.24/UNLICENSE diff --git a/jiff-static-0.2.23/src/lib.rs b/jiff-static-0.2.24/src/lib.rs similarity index 100% rename from jiff-static-0.2.23/src/lib.rs rename to jiff-static-0.2.24/src/lib.rs diff --git a/jiff-static-0.2.23/src/shared/crc32/mod.rs b/jiff-static-0.2.24/src/shared/crc32/mod.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/crc32/mod.rs rename to jiff-static-0.2.24/src/shared/crc32/mod.rs diff --git a/jiff-static-0.2.23/src/shared/crc32/table.rs b/jiff-static-0.2.24/src/shared/crc32/table.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/crc32/table.rs rename to jiff-static-0.2.24/src/shared/crc32/table.rs diff --git a/jiff-static-0.2.23/src/shared/error/itime.rs b/jiff-static-0.2.24/src/shared/error/itime.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/error/itime.rs rename to jiff-static-0.2.24/src/shared/error/itime.rs diff --git a/jiff-static-0.2.23/src/shared/error/mod.rs b/jiff-static-0.2.24/src/shared/error/mod.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/error/mod.rs rename to jiff-static-0.2.24/src/shared/error/mod.rs diff --git a/jiff-static-0.2.23/src/shared/mod.rs b/jiff-static-0.2.24/src/shared/mod.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/mod.rs rename to jiff-static-0.2.24/src/shared/mod.rs diff --git a/jiff-static-0.2.23/src/shared/posix.rs b/jiff-static-0.2.24/src/shared/posix.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/posix.rs rename to jiff-static-0.2.24/src/shared/posix.rs diff --git a/jiff-static-0.2.23/src/shared/tzif.rs b/jiff-static-0.2.24/src/shared/tzif.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/tzif.rs rename to jiff-static-0.2.24/src/shared/tzif.rs diff --git a/jiff-static-0.2.23/src/shared/util/array_str.rs b/jiff-static-0.2.24/src/shared/util/array_str.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/util/array_str.rs rename to jiff-static-0.2.24/src/shared/util/array_str.rs diff --git a/jiff-static-0.2.23/src/shared/util/error.rs b/jiff-static-0.2.24/src/shared/util/error.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/util/error.rs rename to jiff-static-0.2.24/src/shared/util/error.rs diff --git a/jiff-static-0.2.23/src/shared/util/escape.rs b/jiff-static-0.2.24/src/shared/util/escape.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/util/escape.rs rename to jiff-static-0.2.24/src/shared/util/escape.rs diff --git a/jiff-static-0.2.23/src/shared/util/itime.rs b/jiff-static-0.2.24/src/shared/util/itime.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/util/itime.rs rename to jiff-static-0.2.24/src/shared/util/itime.rs diff --git a/jiff-static-0.2.23/src/shared/util/mod.rs b/jiff-static-0.2.24/src/shared/util/mod.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/util/mod.rs rename to jiff-static-0.2.24/src/shared/util/mod.rs diff --git a/jiff-static-0.2.23/src/shared/util/utf8.rs b/jiff-static-0.2.24/src/shared/util/utf8.rs similarity index 100% rename from jiff-static-0.2.23/src/shared/util/utf8.rs rename to jiff-static-0.2.24/src/shared/util/utf8.rs diff --git a/js-sys-0.3.95/.cargo-checksum.json b/js-sys-0.3.95/.cargo-checksum.json deleted file mode 100644 index 5f4dd3c8d1..0000000000 --- a/js-sys-0.3.95/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{".cargo_vcs_info.json":"6032beca9e961110fadacd02d90143efc5b80289f733b4209c9d5cb2ac432e3b","Cargo.lock":"62117c39bb13aba478d0e2fa5243434a0f7afd747d3b3116c6b0526b632a37c7","Cargo.toml":"15d272c71a03d3e7859a87a3f799800a4fb7ebbd5cbf27ec0b4b4c34f4b044eb","Cargo.toml.orig":"55edc3a720f2f69382c085a00f67b6606aa3c3f5fa7f7a31963f8988a28ba937","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"ada8f33d7201e841c1fb1f007b8232afd50bf1194ae38e5e6b1e7274a6b4c447","src/Temporal.rs":"83dff27662620878df37b152dc35f7e4eaebbf04c7ab40b760d5631ef864dc97","src/futures/mod.rs":"fc22f473a3e2f556d8ee525bacffa1abbb8cc2651c017f3bec738b606c4174f7","src/futures/queue.rs":"f97ba1e3d1f336b850401da3b6b766b3add7bccaec05a0c5f9128efc0fa46637","src/futures/stream.rs":"c55c7b8b0443fefd655084506e5736098692fd30de48eeb53c746e92bf9d6b3b","src/futures/task/mod.rs":"eadd65ff4397eff6aedafe712f4e04a64694f9dbc30bf928a18bb87477d9a644","src/futures/task/multithread.rs":"19da8da771b5e11d9aa0fc1c4f4baf2a39a3b7353bb790b1c895ec9a2c5699d1","src/futures/task/singlethread.rs":"8a47d877ee03fb172c9dd1fb82494620418570180ea2b3f2493fa3fc3c3fe97e","src/futures/task/wait_async_polyfill.rs":"a4b4f5caf80f7d73dc268baee32eca34c6b140d92ee2ce4ea3b4fc25c99a8011","src/futures/task/worker.js":"1f1b207b7f45925d8c50f51538d3c23caf14073080bfe6e6bc64a3689b93db78","src/lib.rs":"9ada11c6877f01ef3753109c230c1cd956ed342098926918a39548f19f184842"},"package":"2964e92d1d9dc3364cae4d718d93f227e3abb088e747d92e0395bfdedf1c12ca"} \ No newline at end of file diff --git a/js-sys-0.3.95/.cargo_vcs_info.json b/js-sys-0.3.95/.cargo_vcs_info.json deleted file mode 100644 index 04efc8e4b0..0000000000 --- a/js-sys-0.3.95/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "753bb7ff4de2a00e30d2c6b56ee8e06a9e527f01" - }, - "path_in_vcs": "crates/js-sys" -} \ No newline at end of file diff --git a/js-sys-0.3.98/.cargo-checksum.json b/js-sys-0.3.98/.cargo-checksum.json new file mode 100644 index 0000000000..cc3bd73c20 --- /dev/null +++ b/js-sys-0.3.98/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"40f7c1a4bb1f5bd3da0464d29712c1238b009db4a1d944c5d6172b9a9f0c3c50","Cargo.lock":"629b4cd3733f834e025b831257e5748aae8f0cf51ccc0dbab4f48ea1cd424635","Cargo.toml":"5ba473142e17f6e34826a167e6134ede4a2ecbe8dee63a64409fa84fb9a7cb8f","Cargo.toml.orig":"2ca4b8e462c0eb1e81d03e0e99ef67c34ee976d10e23f20ced24e6616fd74761","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"ada8f33d7201e841c1fb1f007b8232afd50bf1194ae38e5e6b1e7274a6b4c447","src/Temporal.rs":"83dff27662620878df37b152dc35f7e4eaebbf04c7ab40b760d5631ef864dc97","src/futures/mod.rs":"966a07222bce18a58cd21291d649ddd0368580a555ae135b4a4f2770f652c03d","src/futures/queue.rs":"f97ba1e3d1f336b850401da3b6b766b3add7bccaec05a0c5f9128efc0fa46637","src/futures/stream.rs":"71432e8401092d42e5d57a885c5bb63b3706adb43a4d2c4bce20a290a0cd3cb0","src/futures/task/mod.rs":"eadd65ff4397eff6aedafe712f4e04a64694f9dbc30bf928a18bb87477d9a644","src/futures/task/multithread.rs":"19da8da771b5e11d9aa0fc1c4f4baf2a39a3b7353bb790b1c895ec9a2c5699d1","src/futures/task/singlethread.rs":"8a47d877ee03fb172c9dd1fb82494620418570180ea2b3f2493fa3fc3c3fe97e","src/futures/task/wait_async_polyfill.rs":"a4b4f5caf80f7d73dc268baee32eca34c6b140d92ee2ce4ea3b4fc25c99a8011","src/futures/task/worker.js":"1f1b207b7f45925d8c50f51538d3c23caf14073080bfe6e6bc64a3689b93db78","src/lib.rs":"445e7c981658d48d544c47c4b249d3fa9b4d240747647c54a517dc3f3cc08128"},"package":"67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08"} \ No newline at end of file diff --git a/js-sys-0.3.98/.cargo_vcs_info.json b/js-sys-0.3.98/.cargo_vcs_info.json new file mode 100644 index 0000000000..0ddb5ba1ba --- /dev/null +++ b/js-sys-0.3.98/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "49457f2db4465688cb597e9030ccfdefbd2b662e" + }, + "path_in_vcs": "crates/js-sys" +} \ No newline at end of file diff --git a/js-sys-0.3.95/Cargo.lock b/js-sys-0.3.98/Cargo.lock similarity index 92% rename from js-sys-0.3.95/Cargo.lock rename to js-sys-0.3.98/Cargo.lock index 1114567b7b..53e54a3a84 100644 --- a/js-sys-0.3.95/Cargo.lock +++ b/js-sys-0.3.98/Cargo.lock @@ -76,7 +76,7 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.95" +version = "0.3.98" dependencies = [ "cfg-if", "futures-channel", @@ -149,9 +149,9 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "wasm-bindgen" -version = "0.2.118" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89" +checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" dependencies = [ "cfg-if", "once_cell", @@ -162,9 +162,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.118" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -172,9 +172,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.118" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" dependencies = [ "bumpalo", "proc-macro2", @@ -185,9 +185,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" dependencies = [ "unicode-ident", ] diff --git a/js-sys-0.3.95/Cargo.toml b/js-sys-0.3.98/Cargo.toml similarity index 94% rename from js-sys-0.3.95/Cargo.toml rename to js-sys-0.3.98/Cargo.toml index a46f5d3bce..4d1684cdf8 100644 --- a/js-sys-0.3.95/Cargo.toml +++ b/js-sys-0.3.98/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.77" name = "js-sys" -version = "0.3.95" +version = "0.3.98" authors = ["The wasm-bindgen Developers"] build = false include = [ @@ -41,15 +41,14 @@ default = [ "std", "unsafe-eval", ] -futures = [ - "dep:cfg-if", - "dep:futures-util", -] futures-core-03-stream = [ - "futures", + "dep:futures-util", "dep:futures-core", ] -std = ["wasm-bindgen/std"] +std = [ + "wasm-bindgen/std", + "dep:futures-util", +] unsafe-eval = [] [lib] @@ -60,7 +59,6 @@ doctest = false [dependencies.cfg-if] version = "1.0.0" -optional = true [dependencies.futures-core] version = "0.3.8" @@ -78,7 +76,7 @@ version = "1.12" default-features = false [dependencies.wasm-bindgen] -version = "=0.2.118" +version = "=0.2.121" default-features = false [target.'cfg(target_arch = "wasm32")'.dev-dependencies.futures-channel] diff --git a/js-sys-0.3.95/Cargo.toml.orig b/js-sys-0.3.98/Cargo.toml.orig similarity index 78% rename from js-sys-0.3.95/Cargo.toml.orig rename to js-sys-0.3.98/Cargo.toml.orig index 4e4ac93618..e827d3e666 100644 --- a/js-sys-0.3.95/Cargo.toml.orig +++ b/js-sys-0.3.98/Cargo.toml.orig @@ -14,7 +14,7 @@ name = "js-sys" readme = "./README.md" repository = "https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/js-sys" rust-version = "1.77" -version = "0.3.95" +version = "0.3.98" [lib] doctest = false @@ -23,22 +23,21 @@ test = false [features] # TODO: remove unsafe-eval for 1.0 release default = ["std", "unsafe-eval"] -std = ["wasm-bindgen/std"] +std = ["wasm-bindgen/std", "dep:futures-util"] # It has been agreed to gate functionnality requiring CSP unsafe-eval behind this feature # See https://github.com/wasm-bindgen/wasm-bindgen/issues/1647#issuecomment-3775469177 unsafe-eval = [] -# Enables JsFuture, spawn_local, future_to_promise, and IntoFuture for Promise. -# Automatically enabled when depending on wasm-bindgen-futures. -futures = ["dep:cfg-if", "dep:futures-util"] -# Enables JsStream (AsyncIterator -> Stream bridge). Implies futures. -futures-core-03-stream = ["futures", "dep:futures-core"] +# Enables JsStream (AsyncIterator -> Stream bridge). +# Pulls in `futures-util` directly so this keeps working under +# `default-features = false`. +futures-core-03-stream = ["dep:futures-util", "dep:futures-core"] [dependencies] -cfg-if = { version = "1.0.0", optional = true } +cfg-if = "1.0.0" futures-core = { version = "0.3.8", default-features = false, optional = true } futures-util = { version = "0.3.31", default-features = false, features = ["std"], optional = true } once_cell = { version = "1.12", default-features = false } -wasm-bindgen = { path = "../..", version = "=0.2.118", default-features = false } +wasm-bindgen = { path = "../..", version = "=0.2.121", default-features = false } [target.'cfg(target_arch = "wasm32")'.dev-dependencies] futures-channel = "0.3" diff --git a/wasm-bindgen-0.2.118/LICENSE-APACHE b/js-sys-0.3.98/LICENSE-APACHE similarity index 100% rename from wasm-bindgen-0.2.118/LICENSE-APACHE rename to js-sys-0.3.98/LICENSE-APACHE diff --git a/js-sys-0.3.95/LICENSE-MIT b/js-sys-0.3.98/LICENSE-MIT similarity index 100% rename from js-sys-0.3.95/LICENSE-MIT rename to js-sys-0.3.98/LICENSE-MIT diff --git a/js-sys-0.3.95/README.md b/js-sys-0.3.98/README.md similarity index 100% rename from js-sys-0.3.95/README.md rename to js-sys-0.3.98/README.md diff --git a/js-sys-0.3.95/src/Temporal.rs b/js-sys-0.3.98/src/Temporal.rs similarity index 100% rename from js-sys-0.3.95/src/Temporal.rs rename to js-sys-0.3.98/src/Temporal.rs diff --git a/js-sys-0.3.95/src/futures/mod.rs b/js-sys-0.3.98/src/futures/mod.rs similarity index 89% rename from js-sys-0.3.95/src/futures/mod.rs rename to js-sys-0.3.98/src/futures/mod.rs index e5224c1fad..cb0f32882f 100644 --- a/js-sys-0.3.95/src/futures/mod.rs +++ b/js-sys-0.3.98/src/futures/mod.rs @@ -40,12 +40,13 @@ use core::future::{Future, IntoFuture}; use core::panic::AssertUnwindSafe; use core::pin::Pin; use core::task::{Context, Poll, Waker}; -#[cfg(all(target_arch = "wasm32", feature = "std", panic = "unwind"))] +#[cfg(all(target_family = "wasm", feature = "std", panic = "unwind"))] use futures_util::FutureExt; use wasm_bindgen::__rt::marker::ErasableGeneric; -#[cfg(all(target_arch = "wasm32", feature = "std", panic = "unwind"))] +#[cfg(all(target_family = "wasm", feature = "std", panic = "unwind"))] use wasm_bindgen::__rt::panic_to_panic_error; use wasm_bindgen::convert::{FromWasmAbi, Upcast}; +use wasm_bindgen::sys::Promising; use wasm_bindgen::{prelude::*, JsError, JsGeneric}; #[cfg_attr(docsrs, doc(cfg(feature = "futures-core-03-stream")))] @@ -126,7 +127,11 @@ impl fmt::Debug for JsFuture { } } -impl From> for JsFuture { +// `FromWasmAbi` is what the closure shim invokes on the resolved value; +// no layout equivalence with `JsValue` is required at this seam — the +// per-type `from_abi` does the conversion (e.g. for dynamic unions it +// runs the variant dispatcher). +impl From> for JsFuture { fn from(js: Promise) -> JsFuture { // Use the `then` method to schedule two callbacks, one for the // resolved value and one for the rejected value. We're currently @@ -216,7 +221,7 @@ impl Future for JsFuture { } } -impl IntoFuture for Promise { +impl IntoFuture for Promise { type Output = Result; type IntoFuture = JsFuture; @@ -241,7 +246,7 @@ impl IntoFuture for Promise { /// Note that in Wasm panics are currently translated to aborts, but "abort" in /// this case means that a JavaScript exception is thrown. The Wasm module is /// still usable (likely erroneously) after Rust panics. -#[cfg(not(all(target_arch = "wasm32", feature = "std", panic = "unwind")))] +#[cfg(not(all(target_family = "wasm", feature = "std", panic = "unwind")))] pub fn future_to_promise(future: F) -> Promise where F: Future> + 'static, @@ -254,10 +259,10 @@ where spawn_local(async move { match future.await { Ok(val) => { - resolve.call(&JsValue::undefined(), (&val,)).unwrap_throw(); + resolve.call(&JsValue::UNDEFINED, (&val,)).unwrap_throw(); } Err(val) => { - reject.call(&JsValue::undefined(), (&val,)).unwrap_throw(); + reject.call(&JsValue::UNDEFINED, (&val,)).unwrap_throw(); } } }); @@ -279,7 +284,7 @@ where /// /// If the `future` provided panics then the returned `Promise` will be rejected /// with a PanicError. -#[cfg(all(target_arch = "wasm32", feature = "std", panic = "unwind"))] +#[cfg(all(target_family = "wasm", feature = "std", panic = "unwind"))] pub fn future_to_promise(future: F) -> Promise where F: Future> + 'static + std::panic::UnwindSafe, @@ -295,14 +300,14 @@ where let res = future.catch_unwind().await; match res { Ok(Ok(val)) => { - resolve.call(&JsValue::undefined(), (&val,)).unwrap_throw(); + resolve.call(&JsValue::UNDEFINED, (&val,)).unwrap_throw(); } Ok(Err(val)) => { - reject.call(&JsValue::undefined(), (&val,)).unwrap_throw(); + reject.call(&JsValue::UNDEFINED, (&val,)).unwrap_throw(); } Err(val) => { reject - .call(&JsValue::undefined(), (&panic_to_panic_error(val),)) + .call(&JsValue::UNDEFINED, (&panic_to_panic_error(val),)) .unwrap_throw(); } } @@ -331,10 +336,11 @@ where /// If the `future` provided panics then the returned `Promise` **will not /// resolve**. Instead it will be a leaked promise. This is an unfortunate /// limitation of Wasm currently that's hoped to be fixed one day! -pub fn future_to_promise_typed(future: F) -> Promise +pub fn future_to_promise_typed(future: F) -> Promise<::Resolution> where F: Future> + 'static, - T: FromWasmAbi + JsGeneric + Upcast + 'static, + T: Promising + FromWasmAbi + JsGeneric, + ::Resolution: JsGeneric, { let mut future = Some(future); @@ -343,10 +349,10 @@ where spawn_local(async move { match future.await { Ok(val) => { - resolve.call(&JsValue::undefined(), (&val,)).unwrap_throw(); + resolve.call(&JsValue::UNDEFINED, (&val,)).unwrap_throw(); } Err(val) => { - reject.call(&JsValue::undefined(), (&val,)).unwrap_throw(); + reject.call(&JsValue::UNDEFINED, (&val,)).unwrap_throw(); } } }); diff --git a/js-sys-0.3.95/src/futures/queue.rs b/js-sys-0.3.98/src/futures/queue.rs similarity index 100% rename from js-sys-0.3.95/src/futures/queue.rs rename to js-sys-0.3.98/src/futures/queue.rs diff --git a/js-sys-0.3.95/src/futures/stream.rs b/js-sys-0.3.98/src/futures/stream.rs similarity index 95% rename from js-sys-0.3.95/src/futures/stream.rs rename to js-sys-0.3.98/src/futures/stream.rs index 75b07226a4..401474b0fa 100644 --- a/js-sys-0.3.95/src/futures/stream.rs +++ b/js-sys-0.3.98/src/futures/stream.rs @@ -21,7 +21,7 @@ pub struct JsStream { done: bool, } -impl JsStream { +impl JsStream { fn next_future(&self) -> Result>, JsValue> { self.iter.next_iterator().map(JsFuture::from) } @@ -37,7 +37,7 @@ impl From> for JsStream { } } -impl Stream for JsStream { +impl Stream for JsStream { type Item = Result; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll> { diff --git a/js-sys-0.3.95/src/futures/task/mod.rs b/js-sys-0.3.98/src/futures/task/mod.rs similarity index 100% rename from js-sys-0.3.95/src/futures/task/mod.rs rename to js-sys-0.3.98/src/futures/task/mod.rs diff --git a/js-sys-0.3.95/src/futures/task/multithread.rs b/js-sys-0.3.98/src/futures/task/multithread.rs similarity index 100% rename from js-sys-0.3.95/src/futures/task/multithread.rs rename to js-sys-0.3.98/src/futures/task/multithread.rs diff --git a/js-sys-0.3.95/src/futures/task/singlethread.rs b/js-sys-0.3.98/src/futures/task/singlethread.rs similarity index 100% rename from js-sys-0.3.95/src/futures/task/singlethread.rs rename to js-sys-0.3.98/src/futures/task/singlethread.rs diff --git a/js-sys-0.3.95/src/futures/task/wait_async_polyfill.rs b/js-sys-0.3.98/src/futures/task/wait_async_polyfill.rs similarity index 100% rename from js-sys-0.3.95/src/futures/task/wait_async_polyfill.rs rename to js-sys-0.3.98/src/futures/task/wait_async_polyfill.rs diff --git a/js-sys-0.3.95/src/futures/task/worker.js b/js-sys-0.3.98/src/futures/task/worker.js similarity index 100% rename from js-sys-0.3.95/src/futures/task/worker.js rename to js-sys-0.3.98/src/futures/task/worker.js diff --git a/js-sys-0.3.95/src/lib.rs b/js-sys-0.3.98/src/lib.rs similarity index 96% rename from js-sys-0.3.95/src/lib.rs rename to js-sys-0.3.98/src/lib.rs index aa5aa6ba6d..efa25abe3c 100644 --- a/js-sys-0.3.95/src/lib.rs +++ b/js-sys-0.3.98/src/lib.rs @@ -27,10 +27,7 @@ #![doc(html_root_url = "https://docs.rs/js-sys/0.2")] #![cfg_attr(not(feature = "std"), no_std)] #![cfg_attr(target_feature = "atomics", feature(thread_local))] -#![cfg_attr( - all(feature = "futures", target_feature = "atomics"), - feature(stdarch_wasm_atomic_wait) -)] +#![cfg_attr(target_feature = "atomics", feature(stdarch_wasm_atomic_wait))] extern crate alloc; @@ -56,7 +53,7 @@ use wasm_bindgen::JsError; // Re-export sys types as js-sys types pub use wasm_bindgen::sys::{JsOption, Null, Promising, Undefined}; -pub use wasm_bindgen::JsGeneric; +pub use wasm_bindgen::{IntoJsGeneric, JsGeneric}; // When adding new imports: // @@ -441,6 +438,90 @@ extern "C" { pub fn unescape(string: &str) -> JsString; } +// AggregateError +#[wasm_bindgen] +extern "C" { + /// The `AggregateError` object represents an error when several errors need + /// to be wrapped in a single error. It is thrown when multiple errors need + /// to be reported by an operation, for example by [`Promise::any`], when + /// all promises passed to it reject. + /// + /// `AggregateError` is a subclass of [`Error`]. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError) + #[wasm_bindgen(extends = Error, extends = Object, typescript_type = "AggregateError")] + #[derive(Clone, Debug, PartialEq, Eq)] + pub type AggregateError; + + /// Creates a new `AggregateError` from the given iterable of errors. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError/AggregateError) + #[wasm_bindgen(constructor)] + pub fn new(errors: &[JsValue]) -> AggregateError; + + /// Creates a new `AggregateError` from the given iterable of errors with a + /// human-readable description of the aggregate error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError/AggregateError) + #[wasm_bindgen(constructor)] + pub fn new_with_message(errors: &[JsValue], message: &str) -> AggregateError; + + /// Creates a new `AggregateError` from the given iterable of errors, a + /// human-readable description of the aggregate error, and an + /// [`ErrorOptions`] dictionary whose `cause` property indicates the + /// original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError/AggregateError) + #[wasm_bindgen(constructor)] + pub fn new_with_options( + errors: &[JsValue], + message: &str, + options: &ErrorOptions, + ) -> AggregateError; + + /// The `errors` property of an `AggregateError` instance is an array + /// representing the errors that were aggregated. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError/errors) + #[wasm_bindgen(method, getter)] + pub fn errors(this: &AggregateError) -> Array; +} + +// ErrorOptions +#[wasm_bindgen] +extern "C" { + /// The options dictionary accepted as the second argument to the + /// [`Error`] constructor (and other built-in error constructors such as + /// [`AggregateError`]). Its sole standard property is `cause`, which + /// indicates the original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) + #[wasm_bindgen(extends = Object, typescript_type = "ErrorOptions")] + #[derive(Clone, Debug, PartialEq, Eq)] + pub type ErrorOptions; + + /// The `cause` property indicates the underlying cause of an error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) + #[wasm_bindgen(method, getter = "cause")] + pub fn get_cause(this: &ErrorOptions) -> JsValue; + + /// Sets the `cause` property of this `ErrorOptions` dictionary. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) + #[wasm_bindgen(method, setter = "cause")] + pub fn set_cause(this: &ErrorOptions, cause: &JsValue); +} + +impl ErrorOptions { + /// Construct a new `ErrorOptions` dictionary with the given `cause`. + pub fn new(cause: &JsValue) -> Self { + let ret: Self = ::wasm_bindgen::JsCast::unchecked_into(Object::new()); + ret.set_cause(cause); + ret + } +} + // Array #[wasm_bindgen] extern "C" { @@ -1680,11 +1761,17 @@ macro_rules! impl_tuple { self.$last() } - /// Convert the ArrayTuple into its corresponding Rust tuple - pub fn into_parts(self) -> ($($T,)+) { + /// Convert the ArrayTuple into its corresponding Rust tuple. + pub fn into_tuple(self) -> ($($T,)+) { ($(self.$vars(),)+) } + /// Deprecated alias for [`ArrayTuple::into_tuple`]. + #[deprecated(note = "renamed to `into_tuple`")] + pub fn into_parts(self) -> ($($T,)+) { + self.into_tuple() + } + /// Create a new ArrayTuple from the corresponding parts. /// /// # Example @@ -1944,7 +2031,23 @@ impl core::iter::IntoIterator for Array { } } -#[cfg(not(js_sys_unstable_apis))] +// `FromIterator` / `Extend` for `Array` (= `Array` via the default +// type parameter) preserve the long-standing stable behaviour: any iterator +// of items convertible to `&JsValue` collects into an erased `Array`. +// +// Typed collection (where the element type is inferred from the iterator +// item via [`IntoJsGeneric`]) is exposed as the inherent constructor +// [`Array::from_iter_typed`] rather than a second `FromIterator` impl. A +// blanket `impl FromIterator for Array` +// would overlap with the stable `AsRef` impl on `Array` +// (since `JsValue: IntoJsGeneric` with `JsCanon = JsValue`), so the two +// cannot coexist as `FromIterator` impls without coherence violations. +// +// TODO(next major): deprecate this `FromIterator`/`Extend` pair in favour +// of a single `IntoJsGeneric`-based impl, and rename `from_iter_typed` to +// take its place. That migration is source-breaking for callers relying on +// `.collect::()` implicit erasure of typed items, so it is deferred. + impl core::iter::FromIterator for Array where A: AsRef, @@ -1959,58 +2062,63 @@ where } } -#[cfg(js_sys_unstable_apis)] -impl core::iter::FromIterator for Array +impl core::iter::Extend for Array where - A: AsRef, + A: AsRef, { - fn from_iter(iter: I) -> Array + fn extend(&mut self, iter: I) where I: IntoIterator, { - let iter = iter.into_iter(); - let (lower, upper) = iter.size_hint(); - let capacity = upper.unwrap_or(lower); - let out = Array::new_with_length_typed(capacity as u32); - let mut i = 0; for value in iter { - out.set(i, value.as_ref()); - i += 1; - } - // Trim to the actual number of items written, in case size_hint over-estimated. - if i < capacity as u32 { - out.set_length(i); + self.push(value.as_ref()); } - out } } -#[cfg(not(js_sys_unstable_apis))] -impl core::iter::Extend for Array -where - A: AsRef, -{ - fn extend(&mut self, iter: I) +impl Array { + /// Collect an iterator into a typed `Array`, projecting each item + /// through its canonical [`JsGeneric`] via [`IntoJsGeneric`]. + /// + /// This is the typed counterpart to the stable + /// `impl FromIterator for Array where A: AsRef`, which always + /// produces an erased `Array`. Use `from_iter_typed` when you + /// want the element type inferred from the iterator item: + /// + /// ```ignore + /// use js_sys::{Array, Number}; + /// + /// let arr = Array::from_iter_typed((0..10).map(Number::from)); + /// // arr: Array + /// ``` + /// + /// Reference iteration (`Item = &U`) is supported transparently via the + /// `&U: IntoJsGeneric` blanket in `wasm-bindgen` core. + // + // TODO(next major): replace the stable `FromIterator` impl above with + // this behaviour and remove `from_iter_typed`. + pub fn from_iter_typed(iter: I) -> Array where + A: IntoJsGeneric, I: IntoIterator, { - for value in iter { - self.push(value.as_ref()); - } + let mut out = Array::::new_typed(); + out.extend_typed(iter); + out } -} -#[cfg(js_sys_unstable_apis)] -impl core::iter::Extend for Array -where - A: AsRef, -{ - fn extend(&mut self, iter: I) + /// Extend a typed `Array` with an iterator of items convertible to + /// `T` via [`IntoJsGeneric`]. Companion to [`Array::from_iter_typed`]. + // + // TODO(next major): replace the stable `Extend` impl above with this + // behaviour and remove `extend_typed`. + pub fn extend_typed(&mut self, iter: I) where + A: IntoJsGeneric, I: IntoIterator, { for value in iter { - self.push(value.as_ref()); + self.push(&value.to_js()); } } } @@ -2406,8 +2514,14 @@ extern "C" { pub fn values(this: &Array) -> Iterator; } +// FIXME(next-major): rename this trait to `ArrayBufferView`. The DOM/WebIDL +// spec name `ArrayBufferView` covers both `DataView` and the typed-array +// types, which more accurately reflects the set of types that implement this +// trait. The `TypedArray` name is kept for now to avoid a breaking change. pub trait TypedArray: JsGeneric {} +impl TypedArray for DataView {} + // Next major: use usize/isize for indices /// The `Atomics` object provides atomic operations as static methods. /// They are used with `SharedArrayBuffer` objects. @@ -3546,9 +3660,26 @@ extern "C" { /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) #[wasm_bindgen(constructor)] pub fn new(message: &str) -> Error; + + /// Creates a new `Error` with the given message and an untyped options + /// object whose `cause` property indicates the original cause of the + /// error. + /// + /// New code should prefer [`Error::new_with_error_options`], which takes + /// a typed [`ErrorOptions`] dictionary. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) #[wasm_bindgen(constructor)] pub fn new_with_options(message: &str, options: &Object) -> Error; + /// Creates a new `Error` with the given message and a typed + /// [`ErrorOptions`] dictionary whose `cause` property indicates the + /// original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) + #[wasm_bindgen(constructor)] + pub fn new_with_error_options(message: &str, options: &ErrorOptions) -> Error; + /// The cause property is the underlying cause of the error. /// Usually this is used to add context to re-thrown errors. /// @@ -3616,6 +3747,14 @@ extern "C" { /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError) #[wasm_bindgen(constructor)] pub fn new(message: &str) -> EvalError; + + /// Creates a new `EvalError` with the given message and a typed + /// [`ErrorOptions`] dictionary whose `cause` property indicates the + /// original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError/EvalError) + #[wasm_bindgen(constructor)] + pub fn new_with_options(message: &str, options: &ErrorOptions) -> EvalError; } #[wasm_bindgen] @@ -4810,6 +4949,74 @@ impl Default for Function { } } +// FinalizationRegistry +#[wasm_bindgen] +extern "C" { + /// The `FinalizationRegistry` object lets you request a callback when an + /// object is garbage-collected. + /// + /// `FinalizationRegistry` provides a way to request that a cleanup + /// callback get called at some point when an object registered with the + /// registry has been reclaimed (garbage-collected). Cleanup callbacks + /// are sometimes called *finalizers*. + /// + /// Avoid where possible: cleanup callbacks should not be relied upon for + /// anything essential. They are best used to reduce memory usage over the + /// course of a program for objects that benefit from cleanup. Whether, + /// when, and in what order callbacks fire is implementation-defined. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry) + #[wasm_bindgen(extends = Object, typescript_type = "FinalizationRegistry")] + #[derive(Clone, Debug, PartialEq, Eq)] + pub type FinalizationRegistry; + + /// Creates a new `FinalizationRegistry` with the given cleanup callback. + /// + /// The cleanup callback is invoked, at some point after a registered + /// target is garbage-collected, with the `held_value` that was passed to + /// [`FinalizationRegistry::register`]. Because callbacks may be deferred + /// or skipped entirely, the callback should normally outlive the + /// `FinalizationRegistry` (for example by being created via + /// [`Function::from_closure`]). + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry/FinalizationRegistry) + #[wasm_bindgen(constructor)] + pub fn new(cleanup_callback: &Function Undefined>) -> FinalizationRegistry; + + /// Registers `target` with this `FinalizationRegistry`. When `target` is + /// reclaimed by the garbage collector the cleanup callback may be called + /// with `held_value`. + /// + /// `target` must be an object (or a non-registered symbol). + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry/register) + #[wasm_bindgen(method)] + pub fn register(this: &FinalizationRegistry, target: &JsValue, held_value: &JsValue); + + /// Registers `target` with this `FinalizationRegistry`, with an + /// `unregister_token` that can later be passed to + /// [`FinalizationRegistry::unregister`] to remove the registration. + /// + /// `target` and `unregister_token` must be objects (or non-registered + /// symbols), and the same value may be passed for both. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry/register) + #[wasm_bindgen(method, js_name = register)] + pub fn register_with_token( + this: &FinalizationRegistry, + target: &JsValue, + held_value: &JsValue, + unregister_token: &JsValue, + ); + + /// Unregisters all entries registered with this `FinalizationRegistry` + /// using `unregister_token`. Returns `true` if any cells were removed. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry/unregister) + #[wasm_bindgen(method)] + pub fn unregister(this: &FinalizationRegistry, unregister_token: &JsValue) -> bool; +} + // Generator #[wasm_bindgen] extern "C" { @@ -5167,6 +5374,7 @@ impl Iterator { fn looks_like_iterator(it: &JsValue) -> bool { #[wasm_bindgen] extern "C" { + #[derive(Clone, Debug)] type MaybeIterator; #[wasm_bindgen(method, getter)] @@ -7273,6 +7481,14 @@ extern "C" { /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError) #[wasm_bindgen(constructor)] pub fn new(message: &str) -> RangeError; + + /// Creates a new `RangeError` with the given message and a typed + /// [`ErrorOptions`] dictionary whose `cause` property indicates the + /// original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError/RangeError) + #[wasm_bindgen(constructor)] + pub fn new_with_options(message: &str, options: &ErrorOptions) -> RangeError; } // ReferenceError @@ -7292,6 +7508,14 @@ extern "C" { /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError) #[wasm_bindgen(constructor)] pub fn new(message: &str) -> ReferenceError; + + /// Creates a new `ReferenceError` with the given message and a typed + /// [`ErrorOptions`] dictionary whose `cause` property indicates the + /// original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError/ReferenceError) + #[wasm_bindgen(constructor)] + pub fn new_with_options(message: &str, options: &ErrorOptions) -> ReferenceError; } #[allow(non_snake_case)] @@ -8093,6 +8317,14 @@ extern "C" { /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError) #[wasm_bindgen(constructor)] pub fn new(message: &str) -> SyntaxError; + + /// Creates a new `SyntaxError` with the given message and a typed + /// [`ErrorOptions`] dictionary whose `cause` property indicates the + /// original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError/SyntaxError) + #[wasm_bindgen(constructor)] + pub fn new_with_options(message: &str, options: &ErrorOptions) -> SyntaxError; } // TypeError @@ -8112,6 +8344,14 @@ extern "C" { /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError) #[wasm_bindgen(constructor)] pub fn new(message: &str) -> TypeError; + + /// Creates a new `TypeError` with the given message and a typed + /// [`ErrorOptions`] dictionary whose `cause` property indicates the + /// original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError/TypeError) + #[wasm_bindgen(constructor)] + pub fn new_with_options(message: &str, options: &ErrorOptions) -> TypeError; } // URIError @@ -8131,6 +8371,14 @@ extern "C" { /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError) #[wasm_bindgen(constructor, js_class = "URIError")] pub fn new(message: &str) -> UriError; + + /// Creates a new `URIError` with the given message and a typed + /// [`ErrorOptions`] dictionary whose `cause` property indicates the + /// original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError/URIError) + #[wasm_bindgen(constructor, js_class = "URIError")] + pub fn new_with_options(message: &str, options: &ErrorOptions) -> UriError; } // WeakMap @@ -8435,6 +8683,14 @@ pub mod WebAssembly { /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError) #[wasm_bindgen(constructor, js_namespace = WebAssembly)] pub fn new(message: &str) -> CompileError; + + /// Creates a new `WebAssembly.CompileError` with the given message and + /// a typed [`ErrorOptions`] dictionary whose `cause` property + /// indicates the original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/CompileError/CompileError) + #[wasm_bindgen(constructor, js_namespace = WebAssembly)] + pub fn new_with_options(message: &str, options: &ErrorOptions) -> CompileError; } // WebAssembly.Instance @@ -8488,6 +8744,14 @@ pub mod WebAssembly { /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/LinkError) #[wasm_bindgen(constructor, js_namespace = WebAssembly)] pub fn new(message: &str) -> LinkError; + + /// Creates a new `WebAssembly.LinkError` with the given message and a + /// typed [`ErrorOptions`] dictionary whose `cause` property indicates + /// the original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/LinkError/LinkError) + #[wasm_bindgen(constructor, js_namespace = WebAssembly)] + pub fn new_with_options(message: &str, options: &ErrorOptions) -> LinkError; } // WebAssembly.RuntimeError @@ -8509,6 +8773,14 @@ pub mod WebAssembly { /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/RuntimeError) #[wasm_bindgen(constructor, js_namespace = WebAssembly)] pub fn new(message: &str) -> RuntimeError; + + /// Creates a new `WebAssembly.RuntimeError` with the given message + /// and a typed [`ErrorOptions`] dictionary whose `cause` property + /// indicates the original cause of the error. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/RuntimeError/RuntimeError) + #[wasm_bindgen(constructor, js_namespace = WebAssembly)] + pub fn new_with_options(message: &str, options: &ErrorOptions) -> RuntimeError; } // WebAssembly.Module @@ -10551,6 +10823,7 @@ pub mod Intl { #[wasm_bindgen] extern "C" { #[wasm_bindgen(extends = CollatorOptions)] + #[derive(Clone, Debug)] pub type ResolvedCollatorOptions; #[wasm_bindgen(method, getter = locale)] @@ -12810,6 +13083,19 @@ impl PromiseState { } } +/// Converts a `PromiseState` into a `Result`, matching the +/// spec invariant that exactly one of the fulfilled value or the rejection +/// reason is populated per slot. +impl From> for Result { + fn from(state: PromiseState) -> Result { + if state.is_fulfilled() { + Ok(state.get_value().unwrap()) + } else { + Err(state.get_reason().unwrap()) + } + } +} + // Promise #[wasm_bindgen] extern "C" { @@ -12869,9 +13155,9 @@ extern "C" { /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) #[wasm_bindgen(constructor)] - pub fn new_typed( + pub fn new_typed( cb: &mut dyn FnMut(Function Undefined>, Function Undefined>), - ) -> Promise; + ) -> Promise<::Resolution>; /// The `Promise.all(iterable)` method returns a single `Promise` that /// resolves when all of the promises in the iterable argument have resolved @@ -12971,7 +13257,6 @@ extern "C" { /// `AggregateError` if all promises in the iterable rejected. /// /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any) - #[cfg(not(js_sys_unstable_apis))] #[wasm_bindgen(static_method_of = Promise, js_name = any)] pub fn any_iterable(obj: &I) -> Promise<::Resolution> where @@ -13144,6 +13429,148 @@ impl Promising for Promise { type Resolution = T; } +/// Internal: maps a tuple of `Promise` to the result shapes of +/// [`Promise::all_tuple`] and [`Promise::all_settled_tuple`]. +/// +/// Implemented for every tuple arity 1..=8 of `Promise`. The +/// associated `Joined` / `Settled` types pin down the [`ArrayTuple`] shape +/// of the result so the one [`JsCast::unchecked_into`] needed to reinterpret +/// the [`Array`] returned by `Promise.all` / `Promise.allSettled` +/// is encapsulated inside each impl — the caller sees a fully-typed +/// `Promise>`. +/// +/// The soundness of the `unchecked_into`s here rests on `Promise.all` and +/// `Promise.allSettled` preserving input order and arity, which they do by +/// spec. +/// +/// You normally call [`Promise::all_tuple`] / [`Promise::all_settled_tuple`] +/// rather than using this trait directly. +#[doc(hidden)] +pub trait PromiseTuple { + /// The typed `ArrayTuple` shape the joined promise resolves to. + /// + /// For a tuple `(Promise, Promise, ...)` this is + /// `ArrayTuple<(T1, T2, ...)>`. + type Joined: JsGeneric; + + /// The typed `ArrayTuple` shape the all-settled promise resolves to. + /// + /// For a tuple `(Promise, Promise, ...)` this is + /// `ArrayTuple<(PromiseState, PromiseState, ...)>`. + type Settled: JsGeneric; + + /// Join via `Promise.all`, returning a typed `Promise`. + fn all(self) -> Promise; + + /// Settle via `Promise.allSettled`, returning a typed `Promise`. + fn all_settled(self) -> Promise; +} + +macro_rules! impl_promise_tuple { + ([$($T:ident)+] [$($idx:tt)+]) => { + // Rust tuple of `Promise`. Builds the heterogeneous + // `ArrayTuple` of promises via the existing `From<(...)>` impl + // (each element upcasts through `JsGeneric`), then delegates to + // the `ArrayTuple` impl below. + impl<$($T: JsGeneric),+> PromiseTuple for ($(Promise<$T>,)+) { + type Joined = ArrayTuple<($($T,)+)>; + type Settled = ArrayTuple<($(PromiseState<$T>,)+)>; + + fn all(self) -> Promise { + let tuple: ArrayTuple<($(Promise<$T>,)+)> = ($(self.$idx,)+).into(); + tuple.all() + } + + fn all_settled(self) -> Promise { + let tuple: ArrayTuple<($(Promise<$T>,)+)> = ($(self.$idx,)+).into(); + tuple.all_settled() + } + } + + // `ArrayTuple<(Promise, ..., Promise)>` — callers who + // already have an `ArrayTuple` (e.g. from a binding that returns + // one, or built via `.into()` earlier in a pipeline) can pass it + // directly without unpacking into a Rust tuple. + // + // Hands the `ArrayTuple` straight to `Promise.all_iterable` / + // `Promise.allSettled_iterable` and reinterprets the result + // `Array` as the intended typed `ArrayTuple`. Safe because + // `Promise.all` / `Promise.allSettled` preserve input order and + // arity by spec. + impl<$($T: JsGeneric),+> PromiseTuple for ArrayTuple<($(Promise<$T>,)+)> { + type Joined = ArrayTuple<($($T,)+)>; + type Settled = ArrayTuple<($(PromiseState<$T>,)+)>; + + fn all(self) -> Promise { + use wasm_bindgen::JsCast; + Promise::all_iterable(&self).unchecked_into() + } + + fn all_settled(self) -> Promise { + use wasm_bindgen::JsCast; + Promise::all_settled_iterable(&self).unchecked_into() + } + } + }; +} + +impl_promise_tuple!([T1][0]); +impl_promise_tuple!([T1 T2] [0 1]); +impl_promise_tuple!([T1 T2 T3] [0 1 2]); +impl_promise_tuple!([T1 T2 T3 T4] [0 1 2 3]); +impl_promise_tuple!([T1 T2 T3 T4 T5] [0 1 2 3 4]); +impl_promise_tuple!([T1 T2 T3 T4 T5 T6] [0 1 2 3 4 5]); +impl_promise_tuple!([T1 T2 T3 T4 T5 T6 T7] [0 1 2 3 4 5 6]); +impl_promise_tuple!([T1 T2 T3 T4 T5 T6 T7 T8] [0 1 2 3 4 5 6 7]); + +impl Promise { + /// Heterogeneous counterpart to [`Promise::all_iterable`]: accepts a Rust + /// tuple of `Promise` and returns a single [`Promise`] resolving to a + /// typed [`ArrayTuple<(T_1, T_2, ..., T_n)>`]. + /// + /// Destructure the awaited result via [`ArrayTuple::into_tuple`] to get + /// the individual values back as a native Rust tuple. Implemented for + /// arity 1..=8. + /// + /// Rejects with the first rejection, matching `Promise.all` semantics. + /// + /// # Example + /// + /// ```ignore + /// use js_sys::Promise; + /// + /// let (response, buffer) = Promise::all_tuple((fetch_promise, buffer_promise)) + /// .await? + /// .into_tuple(); + /// ``` + #[inline] + pub fn all_tuple(promises: T) -> Promise { + promises.all() + } + + /// Heterogeneous counterpart to [`Promise::all_settled_iterable`]: accepts + /// a Rust tuple of `Promise` and returns a single [`Promise`] + /// resolving to a typed + /// `ArrayTuple<(PromiseState, ..., PromiseState)>`. + /// + /// Unlike [`Promise::all_tuple`], this never rejects early: every input + /// settles (fulfills or rejects) and is reflected by its [`PromiseState`] + /// slot in the result tuple. Implemented for arity 1..=8. + /// + /// # Example + /// + /// ```ignore + /// use js_sys::Promise; + /// + /// let results = Promise::all_settled_tuple((fetch_promise, buffer_promise)).await?; + /// let (response_state, buffer_state) = results.into_tuple(); + /// ``` + #[inline] + pub fn all_settled_tuple(promises: T) -> Promise { + promises.all_settled() + } +} + /// Returns a handle to the global scope object. /// /// This allows access to the global properties and global names by accessing @@ -13176,6 +13603,7 @@ pub fn global() -> Object { // the end which triggers CSP errors. #[wasm_bindgen] extern "C" { + #[derive(Clone, Debug)] type Global; #[wasm_bindgen(thread_local_v2, js_name = globalThis)] @@ -13764,7 +14192,6 @@ arrays! { /// Bridging between JavaScript `Promise`s and Rust `Future`s. /// -/// Enables `promise.await` directly on any [`Promise`] when this feature is active. -/// This module is automatically available when depending on `wasm-bindgen-futures`. -#[cfg(feature = "futures")] +/// Enables `promise.await` directly on any [`Promise`]. +/// This module is also re-exported by `wasm-bindgen-futures` for backwards compatibility. pub mod futures; diff --git a/libc-0.2.185/.cargo_vcs_info.json b/libc-0.2.185/.cargo_vcs_info.json deleted file mode 100644 index f3ca026a95..0000000000 --- a/libc-0.2.185/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "71d5bfcc1bda05da1783666fc2cd7d9669c9c4c8" - }, - "path_in_vcs": "" -} \ No newline at end of file diff --git a/libc-0.2.185/.cargo-checksum.json b/libc-0.2.186/.cargo-checksum.json similarity index 97% rename from libc-0.2.185/.cargo-checksum.json rename to libc-0.2.186/.cargo-checksum.json index 6a23a6861a..ccc8537184 100644 --- a/libc-0.2.185/.cargo-checksum.json +++ b/libc-0.2.186/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo_vcs_info.json":"0bbebb7f1d27737bd569e11d5f934243e59f0df3569b4a050f19aa104ed2dd89",".editorconfig":"e57fecd6b82cd69640ca1bc4e44f0c7acfe5fc12f641f14af9536e323b4159db",".git-blame-ignore-revs":"761aa385c661241fa77c15b502c361398cf500bbb9f8c3a4579b412c4c6249d7",".release-plz.toml":"fcf2d382c4a2abd96caf9cc391b63e0c94d5832f5c48e9ab9eb4b2c847c0887c",".rustfmt.toml":"c88d9ba0e884291a2904d43cc7b940fafcb1ab443cdb7bcfca7117809c4f2816","CHANGELOG.md":"06f7330cbbfa0a4b1851dade212b0b1d82d9819565372bd2226693478970a05e","CONTRIBUTING.md":"a79d97a32ebab59a5d7b360f9f9bd5b8e98b58cd83a7c0853059347f1f81cb53","Cargo.lock":"8ff70df27ecc37f9ef130b117f62f62a77db4e24580e59cc4a8ab68782ab0e92","Cargo.toml":"89d682c2bf38c3051425fd0fc4319e31d55d4d20082fc6f3445f4681e95a4b8d","Cargo.toml.orig":"e6b107bb3de87b26953d9f7f5c97330d1d4e0c828a076c09fcc2e85cae040cb7","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"123a331b5dbf04c30097fa43b8f858bc85df671fe776de498d01f3d6b7c1f69e","README.md":"0795294e9f08f32259a9ea3d694a867998f35cbccf38263205555d2dbc1ed2a5","build.rs":"4b348c53d0a0cd0067ef9887b50f60a1fffdc5d00dda5c0e27fae6aa0ce3dee8","src/fuchsia/aarch64.rs":"34105478e20e9ce40b9e484eea6494e2408fead17c13500da90a2d44d996ce63","src/fuchsia/mod.rs":"b4fc067b8408844fb80be9d017896e41763e2595fcd3526c4fcfed809dd90459","src/fuchsia/riscv64.rs":"a91ae8276df139f6181591be7209f9a68e9f3de5eec881c2e1c9768c53c4e292","src/fuchsia/x86_64.rs":"543ea567b29d646afc026956ee5e652c10e87256789058e7e39f91bf2fe8bf14","src/hermit.rs":"b8e56d680321459a27740aa95fe6576ee6d4e223abce74c0a4795fe998c6c30f","src/lib.rs":"cc2d16d6a06b312913276cb785d637d0755e3afbafc92f18376692dc31e1dc77","src/macros.rs":"e1a7439f50a1d7a47a3268b625e36e7c9a916909f5b3a7fae35217e454e5680c","src/new/aix/mod.rs":"df0de5d8e452a8abb27727b8451b2ceff3bb856f7e5d9e9306df5177e4c6326f","src/new/aix/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/apple/libc/signal.rs":"a960b6153775d791055b278534f79e21f8ff76c2c0c2891271e7abdf26e193d3","src/new/apple/libc/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/apple/libpthread/mod.rs":"1e99efe513b0ee1fa6e53daf5950fc027380b1d71d793eca9e5b22af7b331b5b","src/new/apple/libpthread/pthread_/introspection.rs":"3c797ded6d1a55670f9537a997407cf2267e6c7e7dbfa360d32474e2432979af","src/new/apple/libpthread/pthread_/pthread.rs":"c2b680120ec8db839e702c4340bc39748ac34c806b5fc08acea0a4593131a015","src/new/apple/libpthread/pthread_/pthread_impl.rs":"57a9925a75b79d092c65288b8a8eb21bfb6c7de4c70d37a49018b4eb8b32a646","src/new/apple/libpthread/pthread_/pthread_spis.rs":"1ba51c251249822fae222db6a19e17278ffffc424fc6eea30282a6171491edbe","src/new/apple/libpthread/pthread_/qos.rs":"40f816fb6cebd19ead21197671e5425b454144515ee4b966d00db32ba6b0dfe5","src/new/apple/libpthread/pthread_/sched.rs":"7b22a3204e72d5013ebac7b830235d50883aefca86d720f1f38b93d54e309477","src/new/apple/libpthread/pthread_/spawn.rs":"daef8af8ed0b3d16922c2f5a511a67f57f69b5f80dfe37362bd0b410213f95ca","src/new/apple/libpthread/pthread_/stack_np.rs":"d1b6e2eab1850c303f8eec4059b3e8ec57d69eb47c216243f6b4b7523761fc29","src/new/apple/libpthread/sys/_pthread/_pthread_types.rs":"a7a4307d7c3f91a6b03f76599fac5f40de556e5652123c6bc3b95df2bfa685de","src/new/apple/libpthread/sys/mod.rs":"337265fe49d77a7dcc879cd23e4f5baedcffab4808433dfb6ab9deb4ab490380","src/new/apple/libpthread/sys/qos.rs":"a6297cbab4089b330416bfcbe13b6d7aa8e75352299295046429b2e9d3bada42","src/new/apple/mod.rs":"45464bc6661b88e55856acb6ce4c47467a9aba44083e42b0e0d87d80ca3c11fd","src/new/apple/xnu/arm/_mcontext.rs":"63f1c62b47e7d7181c2b85f3cd3833c69a29eb0cad37a5754bfa6b5954ae7f6f","src/new/apple/xnu/i386/_mcontext.rs":"50543eaa5cf1d87f900b0c3e531dbfefd7586e1be2be3406223b2319edfcb7f2","src/new/apple/xnu/mach/arm/_structs.rs":"8e4af554170cef61c9143f92a283fd7eef66ad78824f194bbc89b098c6049a43","src/new/apple/xnu/mach/i386/_structs.rs":"d7316b7d3fa5e55a5818cfd8a1977921bb14e07133648cffa8f4d9da2e31a604","src/new/apple/xnu/mach/machine/_structs.rs":"82f5a7f751897c882ed4c378d6282976ff21cf0c9cdf7f3be3cecd369a63b6f8","src/new/apple/xnu/mach/mod.rs":"46aad5c7197df2cc57c4392d9019034236233f0240bc7975f9e22ac33c9d40ed","src/new/apple/xnu/machine/_mcontext.rs":"166b0a450b730e2a943ca08a0c70061effb77ff9eff6f41c7b0c51b2d4215db9","src/new/apple/xnu/mod.rs":"b35c4301d54dd2a207c32750f09f989dcc2de6e470a5cfa936de69c550555c7e","src/new/apple/xnu/sys/_types/_ucontext.rs":"1651132d39042f0fc8cca7a23c890da0031b74359472189f851fb3458f2fde3e","src/new/apple/xnu/sys/mod.rs":"734e1803a311320fd6f0b7b10929fe90a0b27322e792c95d42c620cc59b25563","src/new/apple/xnu/sys/signal.rs":"a03cb64ec19326657c87ff8a5a31c2e6bc1deb55f9a7343ab1b2420819ed72bf","src/new/bionic_libc/mod.rs":"5b2b375123095ae59617ffc1b5e13970ae685c823e3cecf014a173d56162d77c","src/new/bionic_libc/pthread.rs":"d40b7f8421cf78d61f23224c3bda17407e40a1c85dd8122ca4f290624b21d8a1","src/new/bionic_libc/sys/mod.rs":"570e7c97f7c1efb14e167a3f0688547fbc907ed9dca93ad6d90dc719289cb6f1","src/new/bionic_libc/sys/socket.rs":"19877b1de0e235a01734f9aebf20fc1ff1a01fd17302ed1a7d7b520a9fa68edb","src/new/bionic_libc/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/common/bsd.rs":"8282cc2b87ca3afc6b01216fe3c3fe1818a3d57e95aa8d1e1a36cc5af1660609","src/new/common/freebsd_like.rs":"156dce9baa6b0ac57d483ffb582a913b9e4944cf10bbb5711a64da5f496a55c2","src/new/common/linux_like/mod.rs":"d42e65b3d6fccd5ba85a8397abb28267a96bfb76b6b47754000fbe9332c03fe4","src/new/common/linux_like/pthread.rs":"a1a33b1e27cd159ab1035c73e72fa8b0c266dd5a28f1079ad74d3c370857f097","src/new/common/mod.rs":"5bcbce2960ff0840ab67a1ba5011009fa1f0f7697cff745d1461bf2b1460ddc6","src/new/common/netbsd_like.rs":"4327dd28d929f2c7b316f9241c44da6f6069d3db4381fb82700ec6d70d749041","src/new/common/posix/mod.rs":"f64b9d7f78e924529c62f2cd78199075eb334e0db9479cb59787f2740bd82d51","src/new/common/posix/pthread.rs":"7bd380ac6cda7940f5e160b6f9d1cf45885f2ba1d7e96014828b13e830eaf230","src/new/common/posix/unistd.rs":"3f633a8c6776d1442f014717785fea3f068d1d3edbfad545d445f8076cb58447","src/new/common/solarish.rs":"ac208e1ad95d07b7528419fd9c573612d58af3d50766816b81667570ccb8b3b3","src/new/cygwin/mod.rs":"9de4cba157252e7731256d60192468f5a759ebd33ab2b509819ffc7557adced5","src/new/cygwin/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/dragonfly/mod.rs":"7b96df7e566874a736d0c33ffc9e75a5f80e674da990cb664556728769ff25f9","src/new/dragonfly/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/emscripten/mod.rs":"d0ec81b919d9d078bb7d66d9429c08b609e2b0fab512be30aa22cc00fa620660","src/new/emscripten/pthread.rs":"65b51deca94ba18d81608191a5523c37f9508a87a76934006d1173869996531c","src/new/emscripten/sched.rs":"6f0a5b3cefb42bb01feabf34ad92d4bdbe5743263d4cd7b754baf921da81a127","src/new/emscripten/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/espidf/mod.rs":"c89c7d3b96583d84888aae0c463dc49b5af61b34a97e9cde52fb9b62d301a023","src/new/freebsd/mod.rs":"cca5cd6815abcaf276799618b748117eee7a6484bc48c629773eaed622188ccc","src/new/freebsd/sys/file.rs":"4dffceca36eaa53c3ace434e4fed1309009448c67ea6684a067a2cf362235e02","src/new/freebsd/sys/mod.rs":"1b064e41914b6e434be2b0c9d3f21f0365eaeeb358a231010c9b817bbd8f730e","src/new/freebsd/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/fuchsia/mod.rs":"c15b2da96c52281e86d4f114522999e6e713723f4950d62c2d544be641b28722","src/new/fuchsia/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/glibc/mod.rs":"1867ccaee8fe486b3723d683db23b40b2ff0c029c9d6281fd63d6de9de77d4fd","src/new/glibc/posix/unistd.rs":"b8528999ecab0a4883c0d89b1cb3c585a666255ab4a4bf5bfc705f7613edd8f4","src/new/glibc/sysdeps/nptl/mod.rs":"36c75e15c94efdc9db1ff8747cc557b5a314e0e3fdb006581f4a96b322ccde9d","src/new/glibc/sysdeps/nptl/pthread.rs":"b3bb630c736ffbe99081f5bec4c99f50cc36fe159b8059594b1d6965d178936c","src/new/glibc/sysdeps/unix/linux/mod.rs":"9a7c4d5c62c37166b35d2daa69a3dc8f5b4548ef49955463ae41393e260a4cb5","src/new/glibc/sysdeps/unix/linux/net/route.rs":"d8ec70bbaa919692430fdd608b70db11dbfe86b202760727dfd474a4b25b35c2","src/new/glibc/sysdeps/unix/mod.rs":"aa6d2fb4c32f5e1139cae14bcf7cee5935657aeff97df9c064ae9acd67620d04","src/new/haiku/mod.rs":"b3863768692c6da24fc28fdcf0c29a9dd9e3a84f301d4bee6ccc4f802befc4f8","src/new/haiku/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/hermit_abi/mod.rs":"25e5d698f292b95057f18dfe203fa96316326e0ca103da532190bb17c29cfdcf","src/new/horizon/mod.rs":"44b47e15d429026d369adfc16a4e9783cdda1be3d0a04f17c283da06573df886","src/new/hurd/mod.rs":"190a149192c237634df3e49c4834d05299aee91a3d399f356d97c36d35571a59","src/new/illumos/mod.rs":"eb5dd158844f63375a6fbb881d63279b12865342d1bb0da221216b7aa9c474b5","src/new/illumos/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/l4re/mod.rs":"d0cd277d7c0b32cd5d3619f7a188f3e646da8f71ae07012dccd921b3fb2b2300","src/new/linux_uapi/linux/can.rs":"b30565ca3a98f76f98a6410fdd0649336270aa1ae4c677d1ce0d67a9be8803ee","src/new/linux_uapi/linux/can/bcm.rs":"1718a1c3aae686d18ec83dff1560439d61de244bfaf332256cc2b42b85fe5249","src/new/linux_uapi/linux/can/error.rs":"5c5ef6d7c2b9432ebbf6147f96cd260e10686f449f879e64db4757670a6ec638","src/new/linux_uapi/linux/can/j1939.rs":"ab2a330c3d3cca3ac6a693b381661772036e10a6dc0004db3809a4f42cf724ba","src/new/linux_uapi/linux/can/netlink.rs":"2d90a0cb5dc9a15365c99c5101db1698f2da2df66704cfefdafd06252bcabe3e","src/new/linux_uapi/linux/can/raw.rs":"933ed151ce976b869b239abc031bb626dd3fa48ec3dd63d2c2b1b891c7bedf1c","src/new/linux_uapi/linux/keyctl.rs":"c25ee20a54a14d56de2c886c32f718b7a403b18152cc81bd7726f974cdf5b3a3","src/new/linux_uapi/linux/membarrier.rs":"5d6b55b1f7410aeb24ce6bcdbac0d33144b14dc048641ebccb5adc697ea7de2f","src/new/linux_uapi/linux/mod.rs":"c17b121acb9e3bd807ab58e532a19bf76f7a19a38ae94e7812beb14ddc3362b0","src/new/linux_uapi/linux/netlink.rs":"1ee00c018a23cac0ade157d6c725b3e6f0b69b23b46b9690c5ab398c889527b7","src/new/linux_uapi/linux/pidfd.rs":"6500c63d1ccaf4b7e14a36f225fd309bce9de80a50b81bca14bc6bded6ebd04e","src/new/linux_uapi/mod.rs":"76cc081d46d008fe05fbb3d7f007fb62374d4efd9464916bbeb9b20c288c6416","src/new/mod.rs":"360bd97f6f1cc19143289c05c0f9e3b86029918f6d9ed78d09c752c81a53ae6c","src/new/musl/arch/generic/mod.rs":"106383ed35cb7526bbbb0e16ce3521ddb2a9e61fb533687922fc9b43cd654af7","src/new/musl/arch/mips/bits/socket.rs":"eb4dff2ab581eb893e0e6547ae7a7d86453caa069b61272a818256280a23ca71","src/new/musl/arch/mips/mod.rs":"cc6c0a24ef77b7c404887fb5b7a7fd15c2a79e2a3396531ea0058636cacb3018","src/new/musl/arch/mips64/bits/socket.rs":"eb4dff2ab581eb893e0e6547ae7a7d86453caa069b61272a818256280a23ca71","src/new/musl/arch/mips64/mod.rs":"40242447a56ed21249f0417f87a7ccd074a366f19eb1353d94e904f370e0f20f","src/new/musl/arch/mod.rs":"31a73fedfd8606e04352425fb4917181f2d7376f445cb61a5460bd682ce29ed4","src/new/musl/mod.rs":"6b2e092bdc907d2d236a5f6ad977d931e13e99425a3738a62769220697cc13de","src/new/musl/pthread.rs":"e76e8f71cba55b45e4aa954970f939142595b828fd7e83586fc9145299a3b1cb","src/new/musl/sched.rs":"6f0a5b3cefb42bb01feabf34ad92d4bdbe5743263d4cd7b754baf921da81a127","src/new/musl/sys/socket.rs":"ed9de77a5937115aada325ce3d68b31e24e7ac21691dc2cb52c4e4695aa1e1dd","src/new/musl/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/netbsd/mod.rs":"d7bddddf98b09188a6fe541feaaaecdee85eb55fee2aa3cf670f7e6afa4ac342","src/new/netbsd/net/if_.rs":"5083d0f9d84de47c8b6fae60c9bb74d7c0586a80ccb8d625e5e2b4876e7f9444","src/new/netbsd/sys/file.rs":"a30095d85a4f8af49494f9b38114415f5c30e1d96a8c882eb7efd83a1cb6816a","src/new/netbsd/sys/ipc.rs":"91af85c26b3dca2a0661c820871d176baf29c00d53540f4807b9b28f9f3dfae4","src/new/netbsd/sys/mod.rs":"2dfbbf18e7585b64acfeb2f39d0495b50c142caec680db64bb4655e182347262","src/new/netbsd/sys/socket.rs":"a926087991d4cd7ebe31a3f626b5a196047c20955e9e3c99f5abe50b899b1ef3","src/new/netbsd/sys/statvfs.rs":"875c73a2c18ef78c7363b2196282579b88beca2d42ed24bda4fe8e7800db9bd4","src/new/netbsd/sys/time.rs":"7d420d5384e13ca361aaf9a7fc9faafe29a55b216988c8252a891d2232407a0c","src/new/netbsd/sys/timex.rs":"1b476328c16ce06e316485bd9dc751f31e51f63d0c07e438bf3227e66da07768","src/new/netbsd/sys/types.rs":"a0ec3ac038f0026c285ebfd869a8ae062117b1ff29855cbcf570f7f55860c854","src/new/netbsd/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/netbsd/utmp_.rs":"cbd35108f4ad7fd3c4fc65b888ba7813a29e3ed4af7920604df8085345f81973","src/new/netbsd/utmpx_.rs":"27171f826d6d2bf962a1d973a3427477ae960ad5dccc947c481d45f17ae645f0","src/new/newlib/mod.rs":"046372b698393e20436c85b28dac6f02b5cc7d599d134637bbdaa89f2530d1a6","src/new/newlib/unistd.rs":"15e74fb2c22e2343faa06a7a61baca198d7867cd70f8a4ead6cdc1f4fae24905","src/new/nto/mod.rs":"2e80a71385d3344a5f0b95b8d509148b52ea1a253d87e8f27345956d119f7e58","src/new/nto/net/bpf.rs":"1ee0b92315fb2926085777a024cb92d7c1f71328eca1af09a3db0417f180d263","src/new/nto/net/if_.rs":"cdea96569bb155c7372da481dbf00630aadfadb68ef07bfe94d258a6c600b82b","src/new/nto/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/nuttx/mod.rs":"7dbbf039987cb5ca17d2a1a562dc967de1c31b970568f728339cd5b9c8e05e25","src/new/nuttx/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/openbsd/mod.rs":"7d86ff099ddfdc8c383f49a1f6fa9c1169810cbe0c1c57d0e86dc14cb1d87320","src/new/openbsd/sys/ipc.rs":"dd37c821138dbf723d637319ad0849e9ed0b2fce1d498e7e38627a8b0a8bf142","src/new/openbsd/sys/mod.rs":"a8fd8f1cb50bffb34db04d1040048e7c23043fea834c1915453b5d539034a845","src/new/openbsd/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/qurt/dlfcn.rs":"8bfec94f78786e2eee9d4306efbf9ad977cf2b3f0d930f8cc65186e922371a9a","src/new/qurt/errno.rs":"2456f7f7557e4716f8b65b1ef67281f795c70ad1d5515d6b001d26c07b943af3","src/new/qurt/fcntl.rs":"ce176e0c9fb6799004cfc9f1fe5eb20ab7226cf8d304bf8ae9cfe4e3f37ad680","src/new/qurt/limits.rs":"5c76ea0d9560d5da65fe7ecaba8e45766dd56b203523979359e5436062306359","src/new/qurt/mod.rs":"6325ef45b6ad49aaba335a52b85a90eceaf5b2d782c06210edefc1999c1fcf99","src/new/qurt/pthread.rs":"8e64d22f2c73ea8559bd7c4de5d21b077969638e1e12c979c1d77c1a2ea2aaf2","src/new/qurt/semaphore.rs":"eb995a92cdead52ee61c3f498c7e408430b8430cd6cb6be74b47e6728c6773ae","src/new/qurt/signal.rs":"3d9b0cdba135af86fed0846b710fef48edba54a034e14147c7e7785db282a335","src/new/qurt/stdio.rs":"280e1faa29c7e2749469a9f9c4b0fa4ba8e0cee42a6e53d9376be6b8e3b8c2ff","src/new/qurt/stdlib.rs":"7d2aad4837a4be08083be8153ecf3e95d8c70469598fbad25793c4cfed1939d8","src/new/qurt/sys/mman.rs":"c0b862bf262564507796b1cdda967c601d265e6a1f1abfe1a5b6d45aa0742df6","src/new/qurt/sys/mod.rs":"e8585c4d447d02d1f4b72183e3d8b8c0d57301ca7099534ce2086a7a3d384b7d","src/new/qurt/sys/sched.rs":"12dfe86d5bb8c96a8624b3a408df7bc1595dfc71ca870e9ea586f68a32bc67f6","src/new/qurt/sys/stat.rs":"bbd98cd523dfc7e34c163bc2d397be8ed08401fe24d85d617b581d31e5bdb708","src/new/qurt/sys/types.rs":"c23c7f02eaa198f04991f0dede9e55279effd49ec4a341fb13064f68c19f24ca","src/new/qurt/time.rs":"598e21d7205714c2f8c92e7dd1f6f7162d5552c453ac68aeb3d38346cff52e4a","src/new/qurt/unistd.rs":"49b2b023a1276f9de2e093f03609e8cb5b0cefa9f0ea96b5bf3009d159b0dcd8","src/new/redox/mod.rs":"aaeaa40c0bffde42973cd1809c1c845075f92fac95a074fe3d01d4fb02dc0992","src/new/relibc/mod.rs":"5c6955e052d8b7ead97179e356c369ffcc435e09fcca4def3e100568845e7296","src/new/relibc/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/rtems/mod.rs":"8ad621434ced0a9d1c0ed5d68514f59b0c8bd4c77fdad81eb09e671e7a42cf1d","src/new/sgx/mod.rs":"c500dc72eff5cbf99c9d7e0e3f1faa3c680bfd7f6ac0166fa1a35fd0d7e69f41","src/new/sgx/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/solaris/mod.rs":"ce8a152ebacb9e8e0d87829d166e3ead64222ead397371bd557e18eefdcafe3d","src/new/solaris/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/solid/mod.rs":"dc5c3c8a627972865ef0a968125e74b2f87636dc89dd2df0f7cea9a40d7c6beb","src/new/teeos/mod.rs":"1d69f212e2a848a32292eef9ad16a44a8d5cf80c7d43db5f445dbd1a49400e3b","src/new/trusty/mod.rs":"3f009fef70cbe062126c82f1f9274cba60b12d3766b825d66326666a1f240fc2","src/new/uclibc/mod.rs":"c3f988f3eb289ba6bc3b2535b82163a7ff160288b7494c156f0fba62143cf2d5","src/new/uclibc/pthread.rs":"ab235319003806c5f20aef5f851af472480e88ff13d2a5f730870efb95e7982e","src/new/uclibc/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/ucrt/mod.rs":"4fd3a973de4c4c6349e76320e09b13701ac284e7ae03c671054b1eeebb86215d","src/new/vita/mod.rs":"196d6ca5c9b1ccc602a6270c3cf0b0bdbd39246066d1a8385df03ba45b31d368","src/new/vxworks/mod.rs":"fa569763957eb87e7e1ce5fa07293116c66661ff0c21d277fda5b30c61451176","src/new/vxworks/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/wasi/mod.rs":"2a74140697bc528193214aad11edc632923bd0cf8350d24f6d600f849dd19e19","src/new/xous/mod.rs":"69016c5c153d9a14003b15558cab96b4691a927586c20ca493fc8d3bb65594eb","src/primitives.rs":"af323402fee13278461bcaec6a06a15dfca24a02d48b0570c88e2746288d7078","src/psp.rs":"081cf4e5127ba10ebb62a9a5f8f849dd92742693db443db429d446ee472b5d41","src/qurt/mod.rs":"5af8edfb34f5431586b7ae00b341daa4312737c1e39c16348b1fff1d1cb8c642","src/sgx.rs":"964d6af358f5c85f948275090e5a7854e0169c43b5c338070b6a4cd156ebc9e6","src/solid/aarch64.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/solid/arm.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/solid/mod.rs":"0b5a07cf7df8227fecc13ea5b7ddf0bb9520c8be44bfb8c15f9449715911dfa0","src/switch.rs":"5db5be2d9c235c00f74b25cceabdf2ce5ec9e1936f991815513e4edf5dec0d56","src/teeos/mod.rs":"ad18343da08ebb6c1fba77fb8efe9ce4551519bea617c1a000aa92f3e50b8565","src/trusty.rs":"cc90bf6b35a515021a3155aa3cc5fcab33457b8fbb2ac7259f0b694d33625fd8","src/types.rs":"5d7831b60664bbe955e00b9b8c75cf834e27295ad36f249f9aee534f533571bc","src/unix/aix/mod.rs":"89a4848c84c15b827021da8b92770d73505bb2edf3ca2429dbcfd007dec02721","src/unix/aix/powerpc64.rs":"724b02ca3afb2722930de172b3144a6bffb70792612a7fbe53553cac58bd2ccc","src/unix/bsd/apple/b32/mod.rs":"30a6d351260806e98666ee4ba64b783d1fe1d8b1d32c3ba7766bd5d638dab2dd","src/unix/bsd/apple/b64/aarch64/mod.rs":"bf2e39a80c8d768c2969197b80fafa50608ac0186b4f4aea53e7fa8bf40d2214","src/unix/bsd/apple/b64/mod.rs":"2619b6afd99e938157753c436e969aa1703b0404b913e456e469df5c6d69538f","src/unix/bsd/apple/b64/x86_64/mod.rs":"ff16a360cb478a4c2e912b9779a806d0e3439e4c5110e0325c82af5ee8429591","src/unix/bsd/apple/mod.rs":"953ac89b5a2ff86e6229fc774e63aea296d6c9710e99c7b95b9bfb5f3a09f154","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"3ec640c35a0b5c0dfdf3fb981e6c3ac74e33781941ecca67390d076b167b5564","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"f13a68b825a58596b5d3339378b0812b778481a291aeacb41de74cb65ad66d3f","src/unix/bsd/freebsdlike/freebsd/arm.rs":"d627ed0bf17932ec0e3226944a4f9714805b27a953778b309d914545cf21b82a","src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs":"316e70938d2b050fd67e5aaf0bcdd0a70d55f195b26ce4ad6055cdf05cea2e61","src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs":"811c3f1aeb70dfd051abc9d3357e8eca9564c08b85d3ea6f81caacfa559e3060","src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs":"87fdf9253ff788b9b66d0bd26b1e7e401e80d165bb4278833dfb80046ee06064","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"7153ee461d9c41e5b849603561dd118091af53a7c990d94a171a4e1412381ec8","src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs":"64c4bd82eaf30a2681417f982fce28de7d1b0743bfaa14004692a56cee44be21","src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs":"bee7fcbb5ff8d1a011b56afa025bcab87bff3e3f90d5d4e0bbbb5349f5bc6b5f","src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs":"64c4bd82eaf30a2681417f982fce28de7d1b0743bfaa14004692a56cee44be21","src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs":"4dbfaa01fce15bcaaab3d70f9f8da3b2e34a93cb2ca0d380b582926bbe43c2ce","src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs":"d6e66809e109dc779efe5584b79d34fcd6fdba91973a415d64ae66f481f45940","src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs":"55c0ce55e6c140d9c0c8b3fce76b23e975eff6c4d5eeb14c9581f8e51638e34a","src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs":"d6e66809e109dc779efe5584b79d34fcd6fdba91973a415d64ae66f481f45940","src/unix/bsd/freebsdlike/freebsd/mod.rs":"ab3734f8aa742fe5c3b5e31c29f0a99e7522abe28b3f7560ccf01f7c64305ca8","src/unix/bsd/freebsdlike/freebsd/powerpc.rs":"af7a43826e3ca9e5e7c3d7c1b50defa482074fd9909de3ee2e52cd0109c1a950","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"f7be922bddd7a4b7da863d6aba057aab2d27f500c7101596bbaaccf075133451","src/unix/bsd/freebsdlike/freebsd/riscv64.rs":"69242a001ab21b6e06b7442c37a89dbc5a67660c7c3cade1d46b65adf32a5669","src/unix/bsd/freebsdlike/freebsd/x86.rs":"5165242f0c82040898dbf711294ba45c5ab2635d39d0bbf9cc899b816415e2a4","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"84044f397dbf13a1c517885c7b234efa2900d116324a4cca626d2f8df398d655","src/unix/bsd/freebsdlike/mod.rs":"c183016e0d192bd490958e4aeb5022dd203ca288abe8f1f502b2d1215b47e30c","src/unix/bsd/mod.rs":"a51588c418deaa58acecddc08c3578cd45659af7a6aec055447ec05143534b0d","src/unix/bsd/netbsdlike/mod.rs":"78f8873b9b91362253031ad6d3d6ee61640496b1c24b75b3ab9186e1eb35a545","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"ba2425edbf025f13ab3c3534d1671d310392df3a7d237539817d9cfa675971c8","src/unix/bsd/netbsdlike/netbsd/arm.rs":"8dd57613695dec1b2104ec35839f0b9b6d234c6cc80365e9fef9ca977c1865a0","src/unix/bsd/netbsdlike/netbsd/mips.rs":"20cdd8d1427c986ecc3fcf7960d337917a13cfd8386dd2d54f8693a23d60892f","src/unix/bsd/netbsdlike/netbsd/mod.rs":"12d1e288aa3c351000721502e3cbd7115d7d5584ffc5c37f5c00e9c56f657385","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"c19c4edbc73b5a97b51e3e2ad39b9fee02ad15e80c70ceb3a1abfe977e5c0ead","src/unix/bsd/netbsdlike/netbsd/riscv64.rs":"f446c996f00e4d15fd25461a30c767c05d083df9e047b0da497ce7c545acfa96","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"d50816e830225779ac9e9a55a7e3e097882153d72987061d76a96ee736c8af9c","src/unix/bsd/netbsdlike/netbsd/x86.rs":"3006b6a086c0241f5383ca101e7b9357368d713f9c38400633491656d110798e","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"13dd36a0db740930155b5f28fedfac606c7291c0276bbf2c2b3fe03a4dbd2a51","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"13c91b304dfb5c3c26777863827c7b3707fe245fcf50da32caab641aff998c63","src/unix/bsd/netbsdlike/openbsd/arm.rs":"f064d935f416ca9f7e5e767b9b46da2250c997d667c0c7f4b4c7dfe02d0258c3","src/unix/bsd/netbsdlike/openbsd/mips64.rs":"bee7664d88f8451ae22552fc0721b6b6a6dee2493cc42bcb9829c1e47e4b05f5","src/unix/bsd/netbsdlike/openbsd/mod.rs":"9943458aaf3a35ce0d3b259b0b666d29347b04cb1a1722e6450073e71f894398","src/unix/bsd/netbsdlike/openbsd/powerpc.rs":"f064d935f416ca9f7e5e767b9b46da2250c997d667c0c7f4b4c7dfe02d0258c3","src/unix/bsd/netbsdlike/openbsd/powerpc64.rs":"1f62a42e2970c42de9e3492fbf3cd5b45410889f033743579266342d1a9e2a00","src/unix/bsd/netbsdlike/openbsd/riscv64.rs":"b2cf3778bfb51d1c0277f0e92963a04f734be3e29879c6c09a25bad2d9b5ab6a","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"8d4c5a4cae63e09e1c156164ddc82e0fc77926841d4d4e419dd2e7a7b7145f58","src/unix/bsd/netbsdlike/openbsd/x86.rs":"e6da2fdff7706fd3eac147d3aaf16afdd8542f231f502660d1d89c79b5eca21b","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"bc7ed75ce66059aafa7a86986aefff267b2c951e47558453fe13ce1bdb48dc0b","src/unix/cygwin/mod.rs":"0da02791aefa8c45531abbea9a9f55b3c3d0d7e8d9af0c250d969ce22b48ee95","src/unix/haiku/b32.rs":"c3f8678ceee65a3094d8133b0d1a94470860e0b1867977f0569c52c5a20e039f","src/unix/haiku/b64.rs":"f97ce9225f4710893dab03ab3e13bc62152cc84f90c597ec88f6dc1f4c27d242","src/unix/haiku/bsd.rs":"4d9af31fdac2561ee5f942dca97dd2f48139ca74660d40b854b307fa5679d1c8","src/unix/haiku/mod.rs":"5a619d44c8e1205ada8f4bf67cf94b8f133949d15d505cba5dceb65557eaa736","src/unix/haiku/native.rs":"85836b1063ddc01c176c61cff8c006cf6f5dc4b1f465f41b5c330aa372a44ab6","src/unix/haiku/x86_64.rs":"def40c16609b5d62c3cdbba6a38340720a96b326ad98d53838554e4b6878d2ee","src/unix/hurd/b32.rs":"501f426f7aeb60acf4119064100dd94bbdfebff2cec785428708059d853dc123","src/unix/hurd/b64.rs":"b9b2082e721a5ec89ba55fd5a16bbffcc8a05ca7cef6dbfbd78aff0806cb931f","src/unix/hurd/mod.rs":"287a2fdd2065fc8a13c4932b3f241d1453607e74829b6d2012a44b6f5f36f654","src/unix/linux_like/android/b32/arm.rs":"5c6ad12746052b86846f9d7c3bd484d15bd3e2113785a19220186ab2a9bb31ba","src/unix/linux_like/android/b32/mod.rs":"04edc73374218c6b854929cae4bc5171ad5066f3636f87235640ec20a49f1559","src/unix/linux_like/android/b32/x86/mod.rs":"72cd0fb5a067170e7409359b6c0114f5472e313060b9642e2e48dc9fabfd4614","src/unix/linux_like/android/b64/aarch64/mod.rs":"66def5f0af9594af50535eba7501bce89620010a7d7aa769ef401235b03efa88","src/unix/linux_like/android/b64/mod.rs":"5afe4dc379ae30ddab9295e5ab8ac89f39f5129f519612d7528bfbfeb0a1d934","src/unix/linux_like/android/b64/riscv64/mod.rs":"47c97eeb221c48bd08c2fc2ddf5f9f4d20c185df76681fe14e3a0950fb37ecbf","src/unix/linux_like/android/b64/x86_64/mod.rs":"4d6eb98fd17e821d0e05755ccb3f4f2b6e37bfbab533894ed444138b750e6b08","src/unix/linux_like/android/mod.rs":"9f0cce22a507e263c4a9bf3501fbd85e14b2e7e9a71c6fe1e046ee051470a1eb","src/unix/linux_like/emscripten/lfs64.rs":"486f987bc39653a48e6538ab0e8263cd2c1bd3d4732a2c573f89f7a037936c38","src/unix/linux_like/emscripten/mod.rs":"538dbcd492324f0254c1ed1f66ad8e7bc9e367cdd70a004cb0183b6fb368e64a","src/unix/linux_like/l4re/mod.rs":"47c07dc3c5e368ec9a64b33af9a314f51e5ed6c7fc6456bfba919d661a812275","src/unix/linux_like/l4re/uclibc/aarch64/mod.rs":"3111d03e5f43dfe1639fe7189903044cb980591c0580a62e8b511de4943201e2","src/unix/linux_like/l4re/uclibc/mod.rs":"3678301a89b80f638ea90b4ec2e3d225bb186eaba3d07f324969e46b81a1955a","src/unix/linux_like/l4re/uclibc/x86_64/mod.rs":"89bb7c67398c836c7f17727338c6032e7667307f02ef0f5d0121031fea1aa358","src/unix/linux_like/linux/arch/generic/mod.rs":"f531e877d712eb30cddf97c76273b7ba7fef19cf8eaafd60ca9ac26019b49adf","src/unix/linux_like/linux/arch/mips/mod.rs":"dcc1d2e85dd2087f61635c753d1781ec70dcba5c95aee285255f09216ea1e0f8","src/unix/linux_like/linux/arch/mod.rs":"8bc5898b03760a95dd4f124ac76ad92e5ae36b2d0644203d752ef2b37e487c3a","src/unix/linux_like/linux/arch/powerpc/mod.rs":"77b286fce4ac755ec840b9c70824a648314b3a5ed2a385d291138589647fdbaf","src/unix/linux_like/linux/arch/sparc/mod.rs":"46f3bd08ec01147af43c93a22c21956af038fa5f6e56643f8e39ca30721bf8cd","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"60d5c7667d81db0ad9faf65edc79420b2100cab27699e03de4d415de931e9f58","src/unix/linux_like/linux/gnu/b32/csky/mod.rs":"627e61997c33fc12fca9e337d248d8531ef0751f21f70110b65631a0e481b66d","src/unix/linux_like/linux/gnu/b32/m68k/mod.rs":"2ea8f649fc9f01829de439ffe0fdbf9566602ed6ec0088128167af1080c3a1b2","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"8b3254b47401cde6118f9eea7e98319af8174d99feac451949e673a28ed4ff6e","src/unix/linux_like/linux/gnu/b32/mod.rs":"5ff89d834a09550c9393965bfd2b74e0f9ab6059bc76f2a827faed631afe10a7","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"585983c6617a590ee0ac5217280d03642efcf721bd80fdabd6b9477031574fee","src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs":"a5e6c931ca8da568626233f2aa5ee0dd0b8e4e1e8905d52ab9dd0ea618376c2f","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"0ddd77054079d7f7ee7aede95552e6494f67fc3db332ec1f5f83a9d09e1a9710","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"e370a80bfdec000347c384f080b30c6f537dc51e17e715c2dd8a360e6a1407f3","src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs":"638b2d717dcf5b59a0058c3dabab43edd84de9d1d7da6e16ad0c58e863000417","src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs":"28c11e70467b2f00735d3a04c369e96e04fd44d0587ee33359f38328b0677ee6","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"7948baae6e8dfbbba78caaea27a2ef059dbe5f0a2b533bd89cc5d6c5dd7f7f1d","src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs":"242cd513eca13d14fbcc326369bb54006782260a558f0c2367102471d4081631","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"007809bca7493eab4ac99a30b4495f73b544d7c882b81b5ca719c1b70761e0bf","src/unix/linux_like/linux/gnu/b64/mod.rs":"64d4182c10180692d381d8eea3d9ce8a6d47289b9c1218070241c5a445d9f1a0","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"4dafacc390ff02ae3c34591a1605e1ac380c13338928a7e2e1ce748fc1e46323","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"f1a54e0bc0d791ad642e07df5f8d4eda1b4d497059c0e5d20b52e094ed635b19","src/unix/linux_like/linux/gnu/b64/s390x.rs":"741d95cf29b65a9fa5c7316b888f8c79f944376b308c7929eb21054b5a16a83d","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"adc09bb20980ee2d5892a2f68949505bed2fa00954b837aa0a15eeb04edd53cb","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"d72ae5556347be715e3fdfc084e7e95a184504f1575230f163ab7a72a405cb24","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"07240332eaf44996d86e37b12d71b519b499c9c9b57898441c58ac2e8c0cb6f7","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"914898b781dfe6b2f755730d6000223d1beea177731e180ccbfdd84a0b8b3bd9","src/unix/linux_like/linux/gnu/mod.rs":"0ff72f74b015bc9ef4d1732fc5594945fdb5ca388e4aa0be71260fecb90e6f1f","src/unix/linux_like/linux/mod.rs":"9e31fda0ea90602bc8b6cb32a8247f8a78b9c1323c81774c73ab76119610127c","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"7dc4b9a4d723d6868a84e81dbd5953b234c4540db3edd5a4a7ea0e154b101d91","src/unix/linux_like/linux/musl/b32/hexagon.rs":"17063ab52334500ec67d9f1f706bfcd493092d7a7f28f3b5558915cce756885e","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"64f6b834d3d98db1c2d95d40371c644f71170d7710fcdd933f1ff51c3fbe2c70","src/unix/linux_like/linux/musl/b32/mod.rs":"6630c3ae8e27eb2bae6309bef4c96be9a21ebb877ce281b881a73589b7264a7a","src/unix/linux_like/linux/musl/b32/powerpc.rs":"a946612120ed9700ff1e4e729b0f8107a40f9ed7f5b320357552d5475441042d","src/unix/linux_like/linux/musl/b32/riscv32/mod.rs":"df3e3bbd2f69420b6de3a1d9aa242402f0bf26c77c573b2debea53af964f07d7","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"83e340712e8acd89cefcb5eef0e826da79f47a7a42784699df90604c4e9a8712","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"b165f81469b144a9c6d60486c3a8b4770fce5f4ad67958aad3c0b0ee85fde117","src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs":"9885dd43e46d3f34156b2871c3c08a88775efecb9eab0b4ed9bf396c1cb509d3","src/unix/linux_like/linux/musl/b64/mips64.rs":"24dd0c412ae02b84552a1803b4369dcc0fa3b989f9b6a406f404690c757fbc8b","src/unix/linux_like/linux/musl/b64/mod.rs":"1ce1eee49b1c7c5c02fe04b1539a0316becf0295763e3e18b1088895ed937373","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"5f2a8d0a5b6a4d044c75ba433b4f69e27d475cbd5ba81e659e756757b5c36111","src/unix/linux_like/linux/musl/b64/riscv64/mod.rs":"d5298d224be38474d05c53ffda6384fdb24771774e5c19f84898c23e4603459c","src/unix/linux_like/linux/musl/b64/s390x.rs":"77079b262e2fda7b569c19236f264f460c157051bac349928306a07c4cb61195","src/unix/linux_like/linux/musl/b64/wasm32/mod.rs":"bd65c06c4e422cb859be803e0dc7404513c13e9d9c3c672f5462f0bbd3dc8ef2","src/unix/linux_like/linux/musl/b64/wasm32/wali.rs":"006149b7af0145dc40123fc7991d853c7f2c5c77bbc9c8a44c276be0d99a1343","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"4535e44cfc85c66253c4cda347366d54c3ffa8e0b47b4b89cd87d96fb4005b1e","src/unix/linux_like/linux/musl/lfs64.rs":"61b1eae698d93dbd7c665e920ef685fd6eea0c4a2d96acc1d5f111d87b88ef38","src/unix/linux_like/linux/musl/mod.rs":"56c79797cafb7949f639f84a5a34676b34d776c843f0ad49ddca0684092580f4","src/unix/linux_like/linux/uclibc/arm/mod.rs":"9eb48a19e49cd2a989f6daae9552dd477d645bc2540a8bae5ac71894565375b0","src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs":"0b3c063ff6510c68577f8789ff87c1b630dc1c219611070fa91aa2b5b5ec595f","src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs":"3a3b90f896a07f5d17e3440bbff7b3153aed564732ef2e468167c7a425922ea8","src/unix/linux_like/linux/uclibc/mips/mod.rs":"e552f579a8dc9e690891113aa6360607ad962bd84cbb60c370b5c5f7c7d1d8c0","src/unix/linux_like/linux/uclibc/mod.rs":"413b7cc1cd88580162836dc8b1cf1fa569b3431248c13e030a1f50519ddaa875","src/unix/linux_like/linux/uclibc/x86_64/mod.rs":"53937263439095a4af0e5d583eb6cc621dd07a41aaa154b2f4cd1ec799dd7187","src/unix/linux_like/linux_l4re_shared.rs":"c21e27065fb45df318fe76366f8250cf1e6bb0a15394f4d6bc69686d774a780c","src/unix/linux_like/mod.rs":"399dc67be0898f73946145b26e12bf23beeb9048fb86b69affdc56be5622bf19","src/unix/mod.rs":"32699be951ec02142e7de59f34ae0f6162620576a4bd88ae372d39d2027421ea","src/unix/newlib/aarch64/mod.rs":"d72d067a433bf24ee6b6255c4d04ea7c966518b8d064560c593f1ab23c025962","src/unix/newlib/arm/mod.rs":"95b6e4b3cd1eeb0386d4867e9e4c3438305aa3e8ae75697e06720aa06540a666","src/unix/newlib/espidf/mod.rs":"cbaf10ccdb429719003cac3f3cd4aa0aa63a12a383afc5bd88a4ab3abaef9e2e","src/unix/newlib/generic.rs":"c435a955d72878a71ea0719a75a4579818da6a2e01635f9fe1073d9a0d67352f","src/unix/newlib/horizon/mod.rs":"7c4680766b9986a379fc354a183f4072c1c70d643307edd1a0ca8e0f2c34d5a8","src/unix/newlib/mod.rs":"1aac15b55a852732174bcfee52f3b1452c3e491461a87b70a7ee4c97a458785f","src/unix/newlib/powerpc/mod.rs":"4d6dca09ea5dc000cbd39fb939a9b1a743d819931dfca3c896659e919a07a7da","src/unix/newlib/rtems/mod.rs":"7d06863f1942a90c9a6dd412637b93c18df00e7397cb1289176b9a2a19004b7c","src/unix/newlib/vita/mod.rs":"2f9bf66b40c2aa611033faf3ade5510dc9789af7302571fade40a1715398f06c","src/unix/nto/aarch64.rs":"73ad54ebca13454a75c7b0815e853175070a8ac2eefa338012a03e8b59f01e0c","src/unix/nto/mod.rs":"ddcb98afedf905c0af8819af1591a0c7df629a187ceb35108aeaa467c4879746","src/unix/nto/neutrino.rs":"bb9d24ccee3b9e53af6d028f04ecb646e216ac1a9e2b2ade54bc06135ce3ac59","src/unix/nto/x86_64.rs":"c2e46c6ab4c02c8f773298ec1e90eeccac43c09fa111ac9ae63408abc6eff584","src/unix/nuttx/mod.rs":"4083559d825d2af9ade2c3f14e29802315c9a79091ce8d480c438c3242c7ba80","src/unix/redox/mod.rs":"40dbff61515612a7275ca1454a912ddc08f1b6f73bc084f4b563213bd46fde94","src/unix/solarish/compat.rs":"3d120a056208c03215cfbe3eef1584105160d133c0aa4557bb38018c177640b0","src/unix/solarish/illumos.rs":"74fa022e2799fed83ddeefecfdf559fff63e315ba36304845d65c9721b3ce3b7","src/unix/solarish/mod.rs":"03d1a75ecb758dde3c9ae3c3300c6d241e5e2481329724e32cfca6ffd5882cb3","src/unix/solarish/solaris.rs":"2be39ce5f464823359e7e2e4bae94c9acac9245042570df11a0ed75d49f8acad","src/unix/solarish/x86.rs":"44261c1f1b300dac9fa0dab93ec85d0c3b3c48b15bc4515b9820c9421cff7427","src/unix/solarish/x86_64.rs":"eec1602998dbd3b3aeb2d9a5bd66fc53a6fbbcd7967ed0bb2dd61a8c176023e4","src/unix/solarish/x86_common.rs":"4ae02d88622f7f080f5e8cd328f13187edbc5e124fb3e05e4cf212597f6cce48","src/vxworks/aarch64.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/vxworks/arm.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/vxworks/mod.rs":"e687423e39c07ca03d735f464537f40cc6d45407eaf6bbcfcead4a26a2e68881","src/vxworks/powerpc.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/vxworks/powerpc64.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/vxworks/riscv32.rs":"b1f933205800f0da00f975d53b18fe0035e075cc4613acf110a09a277dc3302a","src/vxworks/riscv64.rs":"b1f933205800f0da00f975d53b18fe0035e075cc4613acf110a09a277dc3302a","src/vxworks/x86.rs":"b1f933205800f0da00f975d53b18fe0035e075cc4613acf110a09a277dc3302a","src/vxworks/x86_64.rs":"b1f933205800f0da00f975d53b18fe0035e075cc4613acf110a09a277dc3302a","src/wasi/mod.rs":"bf128fa1c53277185b638eb953c5b8d503ae7a182780470b40b06f7c29331f38","src/wasi/p2.rs":"feecc0485eabd2c32bc5d800df6ad1b9b4d282741342fb08792f2635204e1e08","src/windows/gnu/mod.rs":"6422acc5c5a82122c11efb84882778e30888c0693c0993fbf7f3baa59e4cbbb5","src/windows/mod.rs":"01da11840df8118ad12f40dc38e921b4ecfd1045badc700d456f549789df24d4","src/windows/msvc/mod.rs":"40410b26b606d1b59b0742b2632f3cd0a28a5429f784f9693fae0a78c15b3889","src/xous.rs":"1a83621c40248ad4d0c08e1fd4c1107d5efcbc2f4f0169538b7b4a885abedbfa","tests/const_fn.rs":"8ac3171d7bced3576a4e93f48570b3e00c553d7510ab85a7473ae3b716a812dc"},"package":"52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f"} \ No newline at end of file +{"files":{".cargo_vcs_info.json":"79f4e131fdc5bb4c9e7e0bd24728a9988a8c5d41a0aac106f906a181d3b6e52f",".editorconfig":"e57fecd6b82cd69640ca1bc4e44f0c7acfe5fc12f641f14af9536e323b4159db",".git-blame-ignore-revs":"761aa385c661241fa77c15b502c361398cf500bbb9f8c3a4579b412c4c6249d7",".release-plz.toml":"fcf2d382c4a2abd96caf9cc391b63e0c94d5832f5c48e9ab9eb4b2c847c0887c",".rustfmt.toml":"c88d9ba0e884291a2904d43cc7b940fafcb1ab443cdb7bcfca7117809c4f2816","CHANGELOG.md":"4a8d73789fafa25546de9333d49eed4a1a2e99075fd323b556bc1f65feb19f53","CONTRIBUTING.md":"a79d97a32ebab59a5d7b360f9f9bd5b8e98b58cd83a7c0853059347f1f81cb53","Cargo.lock":"f73065fee2180d2c25908eb5dadd8a152a7906095b1f2bca0f1da26087d67775","Cargo.toml":"9a45433b9dc5f1dcd397062608a320c2ab472319e79566ea4646dfff3ca67821","Cargo.toml.orig":"1aa1b972f961d26c76f62db1292be9d7fc4d24ccccbe8a3c22ffd3a6fc1c2c8d","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"123a331b5dbf04c30097fa43b8f858bc85df671fe776de498d01f3d6b7c1f69e","README.md":"cc560a2a9ab2a264fe78ec49fe5e5aed8cffdb8ad011a7dfeaaccbf161696bd8","build.rs":"4b348c53d0a0cd0067ef9887b50f60a1fffdc5d00dda5c0e27fae6aa0ce3dee8","src/fuchsia/aarch64.rs":"34105478e20e9ce40b9e484eea6494e2408fead17c13500da90a2d44d996ce63","src/fuchsia/mod.rs":"b4fc067b8408844fb80be9d017896e41763e2595fcd3526c4fcfed809dd90459","src/fuchsia/riscv64.rs":"a91ae8276df139f6181591be7209f9a68e9f3de5eec881c2e1c9768c53c4e292","src/fuchsia/x86_64.rs":"543ea567b29d646afc026956ee5e652c10e87256789058e7e39f91bf2fe8bf14","src/hermit.rs":"b8e56d680321459a27740aa95fe6576ee6d4e223abce74c0a4795fe998c6c30f","src/lib.rs":"cc2d16d6a06b312913276cb785d637d0755e3afbafc92f18376692dc31e1dc77","src/macros.rs":"e1a7439f50a1d7a47a3268b625e36e7c9a916909f5b3a7fae35217e454e5680c","src/new/aix/mod.rs":"df0de5d8e452a8abb27727b8451b2ceff3bb856f7e5d9e9306df5177e4c6326f","src/new/aix/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/apple/libc/signal.rs":"a960b6153775d791055b278534f79e21f8ff76c2c0c2891271e7abdf26e193d3","src/new/apple/libc/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/apple/libpthread/mod.rs":"1e99efe513b0ee1fa6e53daf5950fc027380b1d71d793eca9e5b22af7b331b5b","src/new/apple/libpthread/pthread_/introspection.rs":"3c797ded6d1a55670f9537a997407cf2267e6c7e7dbfa360d32474e2432979af","src/new/apple/libpthread/pthread_/pthread.rs":"c2b680120ec8db839e702c4340bc39748ac34c806b5fc08acea0a4593131a015","src/new/apple/libpthread/pthread_/pthread_impl.rs":"57a9925a75b79d092c65288b8a8eb21bfb6c7de4c70d37a49018b4eb8b32a646","src/new/apple/libpthread/pthread_/pthread_spis.rs":"1ba51c251249822fae222db6a19e17278ffffc424fc6eea30282a6171491edbe","src/new/apple/libpthread/pthread_/qos.rs":"40f816fb6cebd19ead21197671e5425b454144515ee4b966d00db32ba6b0dfe5","src/new/apple/libpthread/pthread_/sched.rs":"7b22a3204e72d5013ebac7b830235d50883aefca86d720f1f38b93d54e309477","src/new/apple/libpthread/pthread_/spawn.rs":"daef8af8ed0b3d16922c2f5a511a67f57f69b5f80dfe37362bd0b410213f95ca","src/new/apple/libpthread/pthread_/stack_np.rs":"d1b6e2eab1850c303f8eec4059b3e8ec57d69eb47c216243f6b4b7523761fc29","src/new/apple/libpthread/sys/_pthread/_pthread_types.rs":"a7a4307d7c3f91a6b03f76599fac5f40de556e5652123c6bc3b95df2bfa685de","src/new/apple/libpthread/sys/mod.rs":"337265fe49d77a7dcc879cd23e4f5baedcffab4808433dfb6ab9deb4ab490380","src/new/apple/libpthread/sys/qos.rs":"a6297cbab4089b330416bfcbe13b6d7aa8e75352299295046429b2e9d3bada42","src/new/apple/mod.rs":"45464bc6661b88e55856acb6ce4c47467a9aba44083e42b0e0d87d80ca3c11fd","src/new/apple/xnu/arm/_mcontext.rs":"63f1c62b47e7d7181c2b85f3cd3833c69a29eb0cad37a5754bfa6b5954ae7f6f","src/new/apple/xnu/i386/_mcontext.rs":"50543eaa5cf1d87f900b0c3e531dbfefd7586e1be2be3406223b2319edfcb7f2","src/new/apple/xnu/mach/arm/_structs.rs":"8e4af554170cef61c9143f92a283fd7eef66ad78824f194bbc89b098c6049a43","src/new/apple/xnu/mach/i386/_structs.rs":"d7316b7d3fa5e55a5818cfd8a1977921bb14e07133648cffa8f4d9da2e31a604","src/new/apple/xnu/mach/machine/_structs.rs":"82f5a7f751897c882ed4c378d6282976ff21cf0c9cdf7f3be3cecd369a63b6f8","src/new/apple/xnu/mach/mod.rs":"46aad5c7197df2cc57c4392d9019034236233f0240bc7975f9e22ac33c9d40ed","src/new/apple/xnu/machine/_mcontext.rs":"166b0a450b730e2a943ca08a0c70061effb77ff9eff6f41c7b0c51b2d4215db9","src/new/apple/xnu/mod.rs":"b35c4301d54dd2a207c32750f09f989dcc2de6e470a5cfa936de69c550555c7e","src/new/apple/xnu/sys/_types/_ucontext.rs":"1651132d39042f0fc8cca7a23c890da0031b74359472189f851fb3458f2fde3e","src/new/apple/xnu/sys/mod.rs":"734e1803a311320fd6f0b7b10929fe90a0b27322e792c95d42c620cc59b25563","src/new/apple/xnu/sys/signal.rs":"a03cb64ec19326657c87ff8a5a31c2e6bc1deb55f9a7343ab1b2420819ed72bf","src/new/bionic_libc/mod.rs":"5b2b375123095ae59617ffc1b5e13970ae685c823e3cecf014a173d56162d77c","src/new/bionic_libc/pthread.rs":"d40b7f8421cf78d61f23224c3bda17407e40a1c85dd8122ca4f290624b21d8a1","src/new/bionic_libc/sys/mod.rs":"570e7c97f7c1efb14e167a3f0688547fbc907ed9dca93ad6d90dc719289cb6f1","src/new/bionic_libc/sys/socket.rs":"19877b1de0e235a01734f9aebf20fc1ff1a01fd17302ed1a7d7b520a9fa68edb","src/new/bionic_libc/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/common/bsd.rs":"8282cc2b87ca3afc6b01216fe3c3fe1818a3d57e95aa8d1e1a36cc5af1660609","src/new/common/freebsd_like.rs":"156dce9baa6b0ac57d483ffb582a913b9e4944cf10bbb5711a64da5f496a55c2","src/new/common/linux_like/mod.rs":"d42e65b3d6fccd5ba85a8397abb28267a96bfb76b6b47754000fbe9332c03fe4","src/new/common/linux_like/pthread.rs":"a1a33b1e27cd159ab1035c73e72fa8b0c266dd5a28f1079ad74d3c370857f097","src/new/common/mod.rs":"5bcbce2960ff0840ab67a1ba5011009fa1f0f7697cff745d1461bf2b1460ddc6","src/new/common/netbsd_like.rs":"4327dd28d929f2c7b316f9241c44da6f6069d3db4381fb82700ec6d70d749041","src/new/common/posix/mod.rs":"f64b9d7f78e924529c62f2cd78199075eb334e0db9479cb59787f2740bd82d51","src/new/common/posix/pthread.rs":"7bd380ac6cda7940f5e160b6f9d1cf45885f2ba1d7e96014828b13e830eaf230","src/new/common/posix/unistd.rs":"3f633a8c6776d1442f014717785fea3f068d1d3edbfad545d445f8076cb58447","src/new/common/solarish.rs":"ac208e1ad95d07b7528419fd9c573612d58af3d50766816b81667570ccb8b3b3","src/new/cygwin/mod.rs":"9de4cba157252e7731256d60192468f5a759ebd33ab2b509819ffc7557adced5","src/new/cygwin/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/dragonfly/mod.rs":"7b96df7e566874a736d0c33ffc9e75a5f80e674da990cb664556728769ff25f9","src/new/dragonfly/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/emscripten/mod.rs":"d0ec81b919d9d078bb7d66d9429c08b609e2b0fab512be30aa22cc00fa620660","src/new/emscripten/pthread.rs":"65b51deca94ba18d81608191a5523c37f9508a87a76934006d1173869996531c","src/new/emscripten/sched.rs":"6f0a5b3cefb42bb01feabf34ad92d4bdbe5743263d4cd7b754baf921da81a127","src/new/emscripten/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/espidf/mod.rs":"c89c7d3b96583d84888aae0c463dc49b5af61b34a97e9cde52fb9b62d301a023","src/new/freebsd/mod.rs":"cca5cd6815abcaf276799618b748117eee7a6484bc48c629773eaed622188ccc","src/new/freebsd/sys/file.rs":"4dffceca36eaa53c3ace434e4fed1309009448c67ea6684a067a2cf362235e02","src/new/freebsd/sys/mod.rs":"1b064e41914b6e434be2b0c9d3f21f0365eaeeb358a231010c9b817bbd8f730e","src/new/freebsd/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/fuchsia/mod.rs":"c15b2da96c52281e86d4f114522999e6e713723f4950d62c2d544be641b28722","src/new/fuchsia/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/glibc/mod.rs":"1867ccaee8fe486b3723d683db23b40b2ff0c029c9d6281fd63d6de9de77d4fd","src/new/glibc/posix/unistd.rs":"b8528999ecab0a4883c0d89b1cb3c585a666255ab4a4bf5bfc705f7613edd8f4","src/new/glibc/sysdeps/nptl/mod.rs":"36c75e15c94efdc9db1ff8747cc557b5a314e0e3fdb006581f4a96b322ccde9d","src/new/glibc/sysdeps/nptl/pthread.rs":"b3bb630c736ffbe99081f5bec4c99f50cc36fe159b8059594b1d6965d178936c","src/new/glibc/sysdeps/unix/linux/mod.rs":"9a7c4d5c62c37166b35d2daa69a3dc8f5b4548ef49955463ae41393e260a4cb5","src/new/glibc/sysdeps/unix/linux/net/route.rs":"d8ec70bbaa919692430fdd608b70db11dbfe86b202760727dfd474a4b25b35c2","src/new/glibc/sysdeps/unix/mod.rs":"aa6d2fb4c32f5e1139cae14bcf7cee5935657aeff97df9c064ae9acd67620d04","src/new/haiku/mod.rs":"b3863768692c6da24fc28fdcf0c29a9dd9e3a84f301d4bee6ccc4f802befc4f8","src/new/haiku/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/hermit_abi/mod.rs":"25e5d698f292b95057f18dfe203fa96316326e0ca103da532190bb17c29cfdcf","src/new/horizon/mod.rs":"44b47e15d429026d369adfc16a4e9783cdda1be3d0a04f17c283da06573df886","src/new/hurd/mod.rs":"190a149192c237634df3e49c4834d05299aee91a3d399f356d97c36d35571a59","src/new/illumos/mod.rs":"eb5dd158844f63375a6fbb881d63279b12865342d1bb0da221216b7aa9c474b5","src/new/illumos/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/l4re/mod.rs":"d0cd277d7c0b32cd5d3619f7a188f3e646da8f71ae07012dccd921b3fb2b2300","src/new/linux_uapi/linux/can.rs":"b30565ca3a98f76f98a6410fdd0649336270aa1ae4c677d1ce0d67a9be8803ee","src/new/linux_uapi/linux/can/bcm.rs":"1718a1c3aae686d18ec83dff1560439d61de244bfaf332256cc2b42b85fe5249","src/new/linux_uapi/linux/can/error.rs":"5c5ef6d7c2b9432ebbf6147f96cd260e10686f449f879e64db4757670a6ec638","src/new/linux_uapi/linux/can/j1939.rs":"ab2a330c3d3cca3ac6a693b381661772036e10a6dc0004db3809a4f42cf724ba","src/new/linux_uapi/linux/can/netlink.rs":"2d90a0cb5dc9a15365c99c5101db1698f2da2df66704cfefdafd06252bcabe3e","src/new/linux_uapi/linux/can/raw.rs":"933ed151ce976b869b239abc031bb626dd3fa48ec3dd63d2c2b1b891c7bedf1c","src/new/linux_uapi/linux/keyctl.rs":"c25ee20a54a14d56de2c886c32f718b7a403b18152cc81bd7726f974cdf5b3a3","src/new/linux_uapi/linux/membarrier.rs":"5d6b55b1f7410aeb24ce6bcdbac0d33144b14dc048641ebccb5adc697ea7de2f","src/new/linux_uapi/linux/mod.rs":"c17b121acb9e3bd807ab58e532a19bf76f7a19a38ae94e7812beb14ddc3362b0","src/new/linux_uapi/linux/netlink.rs":"1ee00c018a23cac0ade157d6c725b3e6f0b69b23b46b9690c5ab398c889527b7","src/new/linux_uapi/linux/pidfd.rs":"6500c63d1ccaf4b7e14a36f225fd309bce9de80a50b81bca14bc6bded6ebd04e","src/new/linux_uapi/mod.rs":"76cc081d46d008fe05fbb3d7f007fb62374d4efd9464916bbeb9b20c288c6416","src/new/mod.rs":"360bd97f6f1cc19143289c05c0f9e3b86029918f6d9ed78d09c752c81a53ae6c","src/new/musl/arch/generic/mod.rs":"106383ed35cb7526bbbb0e16ce3521ddb2a9e61fb533687922fc9b43cd654af7","src/new/musl/arch/mips/bits/socket.rs":"eb4dff2ab581eb893e0e6547ae7a7d86453caa069b61272a818256280a23ca71","src/new/musl/arch/mips/mod.rs":"cc6c0a24ef77b7c404887fb5b7a7fd15c2a79e2a3396531ea0058636cacb3018","src/new/musl/arch/mips64/bits/socket.rs":"eb4dff2ab581eb893e0e6547ae7a7d86453caa069b61272a818256280a23ca71","src/new/musl/arch/mips64/mod.rs":"40242447a56ed21249f0417f87a7ccd074a366f19eb1353d94e904f370e0f20f","src/new/musl/arch/mod.rs":"31a73fedfd8606e04352425fb4917181f2d7376f445cb61a5460bd682ce29ed4","src/new/musl/mod.rs":"6b2e092bdc907d2d236a5f6ad977d931e13e99425a3738a62769220697cc13de","src/new/musl/pthread.rs":"e76e8f71cba55b45e4aa954970f939142595b828fd7e83586fc9145299a3b1cb","src/new/musl/sched.rs":"6f0a5b3cefb42bb01feabf34ad92d4bdbe5743263d4cd7b754baf921da81a127","src/new/musl/sys/socket.rs":"ed9de77a5937115aada325ce3d68b31e24e7ac21691dc2cb52c4e4695aa1e1dd","src/new/musl/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/netbsd/mod.rs":"d7bddddf98b09188a6fe541feaaaecdee85eb55fee2aa3cf670f7e6afa4ac342","src/new/netbsd/net/if_.rs":"5083d0f9d84de47c8b6fae60c9bb74d7c0586a80ccb8d625e5e2b4876e7f9444","src/new/netbsd/sys/file.rs":"a30095d85a4f8af49494f9b38114415f5c30e1d96a8c882eb7efd83a1cb6816a","src/new/netbsd/sys/ipc.rs":"91af85c26b3dca2a0661c820871d176baf29c00d53540f4807b9b28f9f3dfae4","src/new/netbsd/sys/mod.rs":"2dfbbf18e7585b64acfeb2f39d0495b50c142caec680db64bb4655e182347262","src/new/netbsd/sys/socket.rs":"a926087991d4cd7ebe31a3f626b5a196047c20955e9e3c99f5abe50b899b1ef3","src/new/netbsd/sys/statvfs.rs":"875c73a2c18ef78c7363b2196282579b88beca2d42ed24bda4fe8e7800db9bd4","src/new/netbsd/sys/time.rs":"7d420d5384e13ca361aaf9a7fc9faafe29a55b216988c8252a891d2232407a0c","src/new/netbsd/sys/timex.rs":"1b476328c16ce06e316485bd9dc751f31e51f63d0c07e438bf3227e66da07768","src/new/netbsd/sys/types.rs":"a0ec3ac038f0026c285ebfd869a8ae062117b1ff29855cbcf570f7f55860c854","src/new/netbsd/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/netbsd/utmp_.rs":"cbd35108f4ad7fd3c4fc65b888ba7813a29e3ed4af7920604df8085345f81973","src/new/netbsd/utmpx_.rs":"27171f826d6d2bf962a1d973a3427477ae960ad5dccc947c481d45f17ae645f0","src/new/newlib/mod.rs":"046372b698393e20436c85b28dac6f02b5cc7d599d134637bbdaa89f2530d1a6","src/new/newlib/unistd.rs":"15e74fb2c22e2343faa06a7a61baca198d7867cd70f8a4ead6cdc1f4fae24905","src/new/nto/mod.rs":"2e80a71385d3344a5f0b95b8d509148b52ea1a253d87e8f27345956d119f7e58","src/new/nto/net/bpf.rs":"1ee0b92315fb2926085777a024cb92d7c1f71328eca1af09a3db0417f180d263","src/new/nto/net/if_.rs":"cdea96569bb155c7372da481dbf00630aadfadb68ef07bfe94d258a6c600b82b","src/new/nto/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/nuttx/mod.rs":"7dbbf039987cb5ca17d2a1a562dc967de1c31b970568f728339cd5b9c8e05e25","src/new/nuttx/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/openbsd/mod.rs":"7d86ff099ddfdc8c383f49a1f6fa9c1169810cbe0c1c57d0e86dc14cb1d87320","src/new/openbsd/sys/ipc.rs":"dd37c821138dbf723d637319ad0849e9ed0b2fce1d498e7e38627a8b0a8bf142","src/new/openbsd/sys/mod.rs":"a8fd8f1cb50bffb34db04d1040048e7c23043fea834c1915453b5d539034a845","src/new/openbsd/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/qurt/dlfcn.rs":"8bfec94f78786e2eee9d4306efbf9ad977cf2b3f0d930f8cc65186e922371a9a","src/new/qurt/errno.rs":"2456f7f7557e4716f8b65b1ef67281f795c70ad1d5515d6b001d26c07b943af3","src/new/qurt/fcntl.rs":"ce176e0c9fb6799004cfc9f1fe5eb20ab7226cf8d304bf8ae9cfe4e3f37ad680","src/new/qurt/limits.rs":"5c76ea0d9560d5da65fe7ecaba8e45766dd56b203523979359e5436062306359","src/new/qurt/mod.rs":"6325ef45b6ad49aaba335a52b85a90eceaf5b2d782c06210edefc1999c1fcf99","src/new/qurt/pthread.rs":"8e64d22f2c73ea8559bd7c4de5d21b077969638e1e12c979c1d77c1a2ea2aaf2","src/new/qurt/semaphore.rs":"eb995a92cdead52ee61c3f498c7e408430b8430cd6cb6be74b47e6728c6773ae","src/new/qurt/signal.rs":"3d9b0cdba135af86fed0846b710fef48edba54a034e14147c7e7785db282a335","src/new/qurt/stdio.rs":"280e1faa29c7e2749469a9f9c4b0fa4ba8e0cee42a6e53d9376be6b8e3b8c2ff","src/new/qurt/stdlib.rs":"7d2aad4837a4be08083be8153ecf3e95d8c70469598fbad25793c4cfed1939d8","src/new/qurt/sys/mman.rs":"c0b862bf262564507796b1cdda967c601d265e6a1f1abfe1a5b6d45aa0742df6","src/new/qurt/sys/mod.rs":"e8585c4d447d02d1f4b72183e3d8b8c0d57301ca7099534ce2086a7a3d384b7d","src/new/qurt/sys/sched.rs":"12dfe86d5bb8c96a8624b3a408df7bc1595dfc71ca870e9ea586f68a32bc67f6","src/new/qurt/sys/stat.rs":"bbd98cd523dfc7e34c163bc2d397be8ed08401fe24d85d617b581d31e5bdb708","src/new/qurt/sys/types.rs":"c23c7f02eaa198f04991f0dede9e55279effd49ec4a341fb13064f68c19f24ca","src/new/qurt/time.rs":"598e21d7205714c2f8c92e7dd1f6f7162d5552c453ac68aeb3d38346cff52e4a","src/new/qurt/unistd.rs":"49b2b023a1276f9de2e093f03609e8cb5b0cefa9f0ea96b5bf3009d159b0dcd8","src/new/redox/mod.rs":"aaeaa40c0bffde42973cd1809c1c845075f92fac95a074fe3d01d4fb02dc0992","src/new/relibc/mod.rs":"5c6955e052d8b7ead97179e356c369ffcc435e09fcca4def3e100568845e7296","src/new/relibc/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/rtems/mod.rs":"8ad621434ced0a9d1c0ed5d68514f59b0c8bd4c77fdad81eb09e671e7a42cf1d","src/new/sgx/mod.rs":"c500dc72eff5cbf99c9d7e0e3f1faa3c680bfd7f6ac0166fa1a35fd0d7e69f41","src/new/sgx/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/solaris/mod.rs":"ce8a152ebacb9e8e0d87829d166e3ead64222ead397371bd557e18eefdcafe3d","src/new/solaris/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/solid/mod.rs":"dc5c3c8a627972865ef0a968125e74b2f87636dc89dd2df0f7cea9a40d7c6beb","src/new/teeos/mod.rs":"1d69f212e2a848a32292eef9ad16a44a8d5cf80c7d43db5f445dbd1a49400e3b","src/new/trusty/mod.rs":"3f009fef70cbe062126c82f1f9274cba60b12d3766b825d66326666a1f240fc2","src/new/uclibc/mod.rs":"c3f988f3eb289ba6bc3b2535b82163a7ff160288b7494c156f0fba62143cf2d5","src/new/uclibc/pthread.rs":"ab235319003806c5f20aef5f851af472480e88ff13d2a5f730870efb95e7982e","src/new/uclibc/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/ucrt/mod.rs":"4fd3a973de4c4c6349e76320e09b13701ac284e7ae03c671054b1eeebb86215d","src/new/vita/mod.rs":"196d6ca5c9b1ccc602a6270c3cf0b0bdbd39246066d1a8385df03ba45b31d368","src/new/vxworks/mod.rs":"fa569763957eb87e7e1ce5fa07293116c66661ff0c21d277fda5b30c61451176","src/new/vxworks/unistd.rs":"bcbb65f70759cd84c81fc24ea36aac423edb8f9d7148f65b545ee63954411fd1","src/new/wasi/mod.rs":"2a74140697bc528193214aad11edc632923bd0cf8350d24f6d600f849dd19e19","src/new/xous/mod.rs":"69016c5c153d9a14003b15558cab96b4691a927586c20ca493fc8d3bb65594eb","src/primitives.rs":"af323402fee13278461bcaec6a06a15dfca24a02d48b0570c88e2746288d7078","src/psp.rs":"081cf4e5127ba10ebb62a9a5f8f849dd92742693db443db429d446ee472b5d41","src/qurt/mod.rs":"5af8edfb34f5431586b7ae00b341daa4312737c1e39c16348b1fff1d1cb8c642","src/sgx.rs":"964d6af358f5c85f948275090e5a7854e0169c43b5c338070b6a4cd156ebc9e6","src/solid/aarch64.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/solid/arm.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/solid/mod.rs":"0b5a07cf7df8227fecc13ea5b7ddf0bb9520c8be44bfb8c15f9449715911dfa0","src/switch.rs":"5db5be2d9c235c00f74b25cceabdf2ce5ec9e1936f991815513e4edf5dec0d56","src/teeos/mod.rs":"ad18343da08ebb6c1fba77fb8efe9ce4551519bea617c1a000aa92f3e50b8565","src/trusty.rs":"cc90bf6b35a515021a3155aa3cc5fcab33457b8fbb2ac7259f0b694d33625fd8","src/types.rs":"5d7831b60664bbe955e00b9b8c75cf834e27295ad36f249f9aee534f533571bc","src/unix/aix/mod.rs":"89a4848c84c15b827021da8b92770d73505bb2edf3ca2429dbcfd007dec02721","src/unix/aix/powerpc64.rs":"724b02ca3afb2722930de172b3144a6bffb70792612a7fbe53553cac58bd2ccc","src/unix/bsd/apple/b32/mod.rs":"30a6d351260806e98666ee4ba64b783d1fe1d8b1d32c3ba7766bd5d638dab2dd","src/unix/bsd/apple/b64/aarch64/mod.rs":"bf2e39a80c8d768c2969197b80fafa50608ac0186b4f4aea53e7fa8bf40d2214","src/unix/bsd/apple/b64/mod.rs":"2619b6afd99e938157753c436e969aa1703b0404b913e456e469df5c6d69538f","src/unix/bsd/apple/b64/x86_64/mod.rs":"ff16a360cb478a4c2e912b9779a806d0e3439e4c5110e0325c82af5ee8429591","src/unix/bsd/apple/mod.rs":"8f3299d0de1c3f39aad406c7955760168734300d62850bdcc862611fc25a199b","src/unix/bsd/freebsdlike/dragonfly/mod.rs":"3ec640c35a0b5c0dfdf3fb981e6c3ac74e33781941ecca67390d076b167b5564","src/unix/bsd/freebsdlike/freebsd/aarch64.rs":"f13a68b825a58596b5d3339378b0812b778481a291aeacb41de74cb65ad66d3f","src/unix/bsd/freebsdlike/freebsd/arm.rs":"d627ed0bf17932ec0e3226944a4f9714805b27a953778b309d914545cf21b82a","src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs":"316e70938d2b050fd67e5aaf0bcdd0a70d55f195b26ce4ad6055cdf05cea2e61","src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs":"811c3f1aeb70dfd051abc9d3357e8eca9564c08b85d3ea6f81caacfa559e3060","src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs":"87fdf9253ff788b9b66d0bd26b1e7e401e80d165bb4278833dfb80046ee06064","src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs":"7153ee461d9c41e5b849603561dd118091af53a7c990d94a171a4e1412381ec8","src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs":"64c4bd82eaf30a2681417f982fce28de7d1b0743bfaa14004692a56cee44be21","src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs":"bee7fcbb5ff8d1a011b56afa025bcab87bff3e3f90d5d4e0bbbb5349f5bc6b5f","src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs":"64c4bd82eaf30a2681417f982fce28de7d1b0743bfaa14004692a56cee44be21","src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs":"4dbfaa01fce15bcaaab3d70f9f8da3b2e34a93cb2ca0d380b582926bbe43c2ce","src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs":"d6e66809e109dc779efe5584b79d34fcd6fdba91973a415d64ae66f481f45940","src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs":"55c0ce55e6c140d9c0c8b3fce76b23e975eff6c4d5eeb14c9581f8e51638e34a","src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs":"d6e66809e109dc779efe5584b79d34fcd6fdba91973a415d64ae66f481f45940","src/unix/bsd/freebsdlike/freebsd/mod.rs":"ab3734f8aa742fe5c3b5e31c29f0a99e7522abe28b3f7560ccf01f7c64305ca8","src/unix/bsd/freebsdlike/freebsd/powerpc.rs":"af7a43826e3ca9e5e7c3d7c1b50defa482074fd9909de3ee2e52cd0109c1a950","src/unix/bsd/freebsdlike/freebsd/powerpc64.rs":"f7be922bddd7a4b7da863d6aba057aab2d27f500c7101596bbaaccf075133451","src/unix/bsd/freebsdlike/freebsd/riscv64.rs":"69242a001ab21b6e06b7442c37a89dbc5a67660c7c3cade1d46b65adf32a5669","src/unix/bsd/freebsdlike/freebsd/x86.rs":"5165242f0c82040898dbf711294ba45c5ab2635d39d0bbf9cc899b816415e2a4","src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs":"84044f397dbf13a1c517885c7b234efa2900d116324a4cca626d2f8df398d655","src/unix/bsd/freebsdlike/mod.rs":"c183016e0d192bd490958e4aeb5022dd203ca288abe8f1f502b2d1215b47e30c","src/unix/bsd/mod.rs":"a51588c418deaa58acecddc08c3578cd45659af7a6aec055447ec05143534b0d","src/unix/bsd/netbsdlike/mod.rs":"78f8873b9b91362253031ad6d3d6ee61640496b1c24b75b3ab9186e1eb35a545","src/unix/bsd/netbsdlike/netbsd/aarch64.rs":"ba2425edbf025f13ab3c3534d1671d310392df3a7d237539817d9cfa675971c8","src/unix/bsd/netbsdlike/netbsd/arm.rs":"8dd57613695dec1b2104ec35839f0b9b6d234c6cc80365e9fef9ca977c1865a0","src/unix/bsd/netbsdlike/netbsd/mips.rs":"20cdd8d1427c986ecc3fcf7960d337917a13cfd8386dd2d54f8693a23d60892f","src/unix/bsd/netbsdlike/netbsd/mod.rs":"12d1e288aa3c351000721502e3cbd7115d7d5584ffc5c37f5c00e9c56f657385","src/unix/bsd/netbsdlike/netbsd/powerpc.rs":"c19c4edbc73b5a97b51e3e2ad39b9fee02ad15e80c70ceb3a1abfe977e5c0ead","src/unix/bsd/netbsdlike/netbsd/riscv64.rs":"f446c996f00e4d15fd25461a30c767c05d083df9e047b0da497ce7c545acfa96","src/unix/bsd/netbsdlike/netbsd/sparc64.rs":"d50816e830225779ac9e9a55a7e3e097882153d72987061d76a96ee736c8af9c","src/unix/bsd/netbsdlike/netbsd/x86.rs":"3006b6a086c0241f5383ca101e7b9357368d713f9c38400633491656d110798e","src/unix/bsd/netbsdlike/netbsd/x86_64.rs":"13dd36a0db740930155b5f28fedfac606c7291c0276bbf2c2b3fe03a4dbd2a51","src/unix/bsd/netbsdlike/openbsd/aarch64.rs":"13c91b304dfb5c3c26777863827c7b3707fe245fcf50da32caab641aff998c63","src/unix/bsd/netbsdlike/openbsd/arm.rs":"f064d935f416ca9f7e5e767b9b46da2250c997d667c0c7f4b4c7dfe02d0258c3","src/unix/bsd/netbsdlike/openbsd/mips64.rs":"bee7664d88f8451ae22552fc0721b6b6a6dee2493cc42bcb9829c1e47e4b05f5","src/unix/bsd/netbsdlike/openbsd/mod.rs":"9943458aaf3a35ce0d3b259b0b666d29347b04cb1a1722e6450073e71f894398","src/unix/bsd/netbsdlike/openbsd/powerpc.rs":"f064d935f416ca9f7e5e767b9b46da2250c997d667c0c7f4b4c7dfe02d0258c3","src/unix/bsd/netbsdlike/openbsd/powerpc64.rs":"1f62a42e2970c42de9e3492fbf3cd5b45410889f033743579266342d1a9e2a00","src/unix/bsd/netbsdlike/openbsd/riscv64.rs":"b2cf3778bfb51d1c0277f0e92963a04f734be3e29879c6c09a25bad2d9b5ab6a","src/unix/bsd/netbsdlike/openbsd/sparc64.rs":"8d4c5a4cae63e09e1c156164ddc82e0fc77926841d4d4e419dd2e7a7b7145f58","src/unix/bsd/netbsdlike/openbsd/x86.rs":"e6da2fdff7706fd3eac147d3aaf16afdd8542f231f502660d1d89c79b5eca21b","src/unix/bsd/netbsdlike/openbsd/x86_64.rs":"bc7ed75ce66059aafa7a86986aefff267b2c951e47558453fe13ce1bdb48dc0b","src/unix/cygwin/mod.rs":"0da02791aefa8c45531abbea9a9f55b3c3d0d7e8d9af0c250d969ce22b48ee95","src/unix/haiku/b32.rs":"c3f8678ceee65a3094d8133b0d1a94470860e0b1867977f0569c52c5a20e039f","src/unix/haiku/b64.rs":"f97ce9225f4710893dab03ab3e13bc62152cc84f90c597ec88f6dc1f4c27d242","src/unix/haiku/bsd.rs":"4d9af31fdac2561ee5f942dca97dd2f48139ca74660d40b854b307fa5679d1c8","src/unix/haiku/mod.rs":"5a619d44c8e1205ada8f4bf67cf94b8f133949d15d505cba5dceb65557eaa736","src/unix/haiku/native.rs":"85836b1063ddc01c176c61cff8c006cf6f5dc4b1f465f41b5c330aa372a44ab6","src/unix/haiku/x86_64.rs":"def40c16609b5d62c3cdbba6a38340720a96b326ad98d53838554e4b6878d2ee","src/unix/hurd/b32.rs":"501f426f7aeb60acf4119064100dd94bbdfebff2cec785428708059d853dc123","src/unix/hurd/b64.rs":"b9b2082e721a5ec89ba55fd5a16bbffcc8a05ca7cef6dbfbd78aff0806cb931f","src/unix/hurd/mod.rs":"287a2fdd2065fc8a13c4932b3f241d1453607e74829b6d2012a44b6f5f36f654","src/unix/linux_like/android/b32/arm.rs":"5c6ad12746052b86846f9d7c3bd484d15bd3e2113785a19220186ab2a9bb31ba","src/unix/linux_like/android/b32/mod.rs":"04edc73374218c6b854929cae4bc5171ad5066f3636f87235640ec20a49f1559","src/unix/linux_like/android/b32/x86/mod.rs":"72cd0fb5a067170e7409359b6c0114f5472e313060b9642e2e48dc9fabfd4614","src/unix/linux_like/android/b64/aarch64/mod.rs":"66def5f0af9594af50535eba7501bce89620010a7d7aa769ef401235b03efa88","src/unix/linux_like/android/b64/mod.rs":"5afe4dc379ae30ddab9295e5ab8ac89f39f5129f519612d7528bfbfeb0a1d934","src/unix/linux_like/android/b64/riscv64/mod.rs":"47c97eeb221c48bd08c2fc2ddf5f9f4d20c185df76681fe14e3a0950fb37ecbf","src/unix/linux_like/android/b64/x86_64/mod.rs":"4d6eb98fd17e821d0e05755ccb3f4f2b6e37bfbab533894ed444138b750e6b08","src/unix/linux_like/android/mod.rs":"9f0cce22a507e263c4a9bf3501fbd85e14b2e7e9a71c6fe1e046ee051470a1eb","src/unix/linux_like/emscripten/lfs64.rs":"486f987bc39653a48e6538ab0e8263cd2c1bd3d4732a2c573f89f7a037936c38","src/unix/linux_like/emscripten/mod.rs":"538dbcd492324f0254c1ed1f66ad8e7bc9e367cdd70a004cb0183b6fb368e64a","src/unix/linux_like/l4re/mod.rs":"47c07dc3c5e368ec9a64b33af9a314f51e5ed6c7fc6456bfba919d661a812275","src/unix/linux_like/l4re/uclibc/aarch64/mod.rs":"3111d03e5f43dfe1639fe7189903044cb980591c0580a62e8b511de4943201e2","src/unix/linux_like/l4re/uclibc/mod.rs":"3678301a89b80f638ea90b4ec2e3d225bb186eaba3d07f324969e46b81a1955a","src/unix/linux_like/l4re/uclibc/x86_64/mod.rs":"89bb7c67398c836c7f17727338c6032e7667307f02ef0f5d0121031fea1aa358","src/unix/linux_like/linux/arch/generic/mod.rs":"f531e877d712eb30cddf97c76273b7ba7fef19cf8eaafd60ca9ac26019b49adf","src/unix/linux_like/linux/arch/mips/mod.rs":"dcc1d2e85dd2087f61635c753d1781ec70dcba5c95aee285255f09216ea1e0f8","src/unix/linux_like/linux/arch/mod.rs":"8bc5898b03760a95dd4f124ac76ad92e5ae36b2d0644203d752ef2b37e487c3a","src/unix/linux_like/linux/arch/powerpc/mod.rs":"77b286fce4ac755ec840b9c70824a648314b3a5ed2a385d291138589647fdbaf","src/unix/linux_like/linux/arch/sparc/mod.rs":"46f3bd08ec01147af43c93a22c21956af038fa5f6e56643f8e39ca30721bf8cd","src/unix/linux_like/linux/gnu/b32/arm/mod.rs":"60d5c7667d81db0ad9faf65edc79420b2100cab27699e03de4d415de931e9f58","src/unix/linux_like/linux/gnu/b32/csky/mod.rs":"627e61997c33fc12fca9e337d248d8531ef0751f21f70110b65631a0e481b66d","src/unix/linux_like/linux/gnu/b32/m68k/mod.rs":"2ea8f649fc9f01829de439ffe0fdbf9566602ed6ec0088128167af1080c3a1b2","src/unix/linux_like/linux/gnu/b32/mips/mod.rs":"8b3254b47401cde6118f9eea7e98319af8174d99feac451949e673a28ed4ff6e","src/unix/linux_like/linux/gnu/b32/mod.rs":"5ff89d834a09550c9393965bfd2b74e0f9ab6059bc76f2a827faed631afe10a7","src/unix/linux_like/linux/gnu/b32/powerpc.rs":"585983c6617a590ee0ac5217280d03642efcf721bd80fdabd6b9477031574fee","src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs":"a5e6c931ca8da568626233f2aa5ee0dd0b8e4e1e8905d52ab9dd0ea618376c2f","src/unix/linux_like/linux/gnu/b32/sparc/mod.rs":"0ddd77054079d7f7ee7aede95552e6494f67fc3db332ec1f5f83a9d09e1a9710","src/unix/linux_like/linux/gnu/b32/x86/mod.rs":"e370a80bfdec000347c384f080b30c6f537dc51e17e715c2dd8a360e6a1407f3","src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs":"638b2d717dcf5b59a0058c3dabab43edd84de9d1d7da6e16ad0c58e863000417","src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs":"28c11e70467b2f00735d3a04c369e96e04fd44d0587ee33359f38328b0677ee6","src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs":"7948baae6e8dfbbba78caaea27a2ef059dbe5f0a2b533bd89cc5d6c5dd7f7f1d","src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs":"242cd513eca13d14fbcc326369bb54006782260a558f0c2367102471d4081631","src/unix/linux_like/linux/gnu/b64/mips64/mod.rs":"007809bca7493eab4ac99a30b4495f73b544d7c882b81b5ca719c1b70761e0bf","src/unix/linux_like/linux/gnu/b64/mod.rs":"64d4182c10180692d381d8eea3d9ce8a6d47289b9c1218070241c5a445d9f1a0","src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs":"4dafacc390ff02ae3c34591a1605e1ac380c13338928a7e2e1ce748fc1e46323","src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs":"f1a54e0bc0d791ad642e07df5f8d4eda1b4d497059c0e5d20b52e094ed635b19","src/unix/linux_like/linux/gnu/b64/s390x.rs":"741d95cf29b65a9fa5c7316b888f8c79f944376b308c7929eb21054b5a16a83d","src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs":"adc09bb20980ee2d5892a2f68949505bed2fa00954b837aa0a15eeb04edd53cb","src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs":"d72ae5556347be715e3fdfc084e7e95a184504f1575230f163ab7a72a405cb24","src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs":"07240332eaf44996d86e37b12d71b519b499c9c9b57898441c58ac2e8c0cb6f7","src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs":"914898b781dfe6b2f755730d6000223d1beea177731e180ccbfdd84a0b8b3bd9","src/unix/linux_like/linux/gnu/mod.rs":"0ff72f74b015bc9ef4d1732fc5594945fdb5ca388e4aa0be71260fecb90e6f1f","src/unix/linux_like/linux/mod.rs":"3d293f05bfb6f9605e238399e404bf77ca91f4f7def6596f77f404c71b80b572","src/unix/linux_like/linux/musl/b32/arm/mod.rs":"7dc4b9a4d723d6868a84e81dbd5953b234c4540db3edd5a4a7ea0e154b101d91","src/unix/linux_like/linux/musl/b32/hexagon.rs":"17063ab52334500ec67d9f1f706bfcd493092d7a7f28f3b5558915cce756885e","src/unix/linux_like/linux/musl/b32/mips/mod.rs":"64f6b834d3d98db1c2d95d40371c644f71170d7710fcdd933f1ff51c3fbe2c70","src/unix/linux_like/linux/musl/b32/mod.rs":"6630c3ae8e27eb2bae6309bef4c96be9a21ebb877ce281b881a73589b7264a7a","src/unix/linux_like/linux/musl/b32/powerpc.rs":"a946612120ed9700ff1e4e729b0f8107a40f9ed7f5b320357552d5475441042d","src/unix/linux_like/linux/musl/b32/riscv32/mod.rs":"df3e3bbd2f69420b6de3a1d9aa242402f0bf26c77c573b2debea53af964f07d7","src/unix/linux_like/linux/musl/b32/x86/mod.rs":"83e340712e8acd89cefcb5eef0e826da79f47a7a42784699df90604c4e9a8712","src/unix/linux_like/linux/musl/b64/aarch64/mod.rs":"b165f81469b144a9c6d60486c3a8b4770fce5f4ad67958aad3c0b0ee85fde117","src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs":"9885dd43e46d3f34156b2871c3c08a88775efecb9eab0b4ed9bf396c1cb509d3","src/unix/linux_like/linux/musl/b64/mips64.rs":"24dd0c412ae02b84552a1803b4369dcc0fa3b989f9b6a406f404690c757fbc8b","src/unix/linux_like/linux/musl/b64/mod.rs":"1ce1eee49b1c7c5c02fe04b1539a0316becf0295763e3e18b1088895ed937373","src/unix/linux_like/linux/musl/b64/powerpc64.rs":"5f2a8d0a5b6a4d044c75ba433b4f69e27d475cbd5ba81e659e756757b5c36111","src/unix/linux_like/linux/musl/b64/riscv64/mod.rs":"d5298d224be38474d05c53ffda6384fdb24771774e5c19f84898c23e4603459c","src/unix/linux_like/linux/musl/b64/s390x.rs":"77079b262e2fda7b569c19236f264f460c157051bac349928306a07c4cb61195","src/unix/linux_like/linux/musl/b64/wasm32/mod.rs":"bd65c06c4e422cb859be803e0dc7404513c13e9d9c3c672f5462f0bbd3dc8ef2","src/unix/linux_like/linux/musl/b64/wasm32/wali.rs":"006149b7af0145dc40123fc7991d853c7f2c5c77bbc9c8a44c276be0d99a1343","src/unix/linux_like/linux/musl/b64/x86_64/mod.rs":"4535e44cfc85c66253c4cda347366d54c3ffa8e0b47b4b89cd87d96fb4005b1e","src/unix/linux_like/linux/musl/lfs64.rs":"61b1eae698d93dbd7c665e920ef685fd6eea0c4a2d96acc1d5f111d87b88ef38","src/unix/linux_like/linux/musl/mod.rs":"56c79797cafb7949f639f84a5a34676b34d776c843f0ad49ddca0684092580f4","src/unix/linux_like/linux/uclibc/arm/mod.rs":"9eb48a19e49cd2a989f6daae9552dd477d645bc2540a8bae5ac71894565375b0","src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs":"0b3c063ff6510c68577f8789ff87c1b630dc1c219611070fa91aa2b5b5ec595f","src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs":"3a3b90f896a07f5d17e3440bbff7b3153aed564732ef2e468167c7a425922ea8","src/unix/linux_like/linux/uclibc/mips/mod.rs":"e552f579a8dc9e690891113aa6360607ad962bd84cbb60c370b5c5f7c7d1d8c0","src/unix/linux_like/linux/uclibc/mod.rs":"413b7cc1cd88580162836dc8b1cf1fa569b3431248c13e030a1f50519ddaa875","src/unix/linux_like/linux/uclibc/x86_64/mod.rs":"53937263439095a4af0e5d583eb6cc621dd07a41aaa154b2f4cd1ec799dd7187","src/unix/linux_like/linux_l4re_shared.rs":"c21e27065fb45df318fe76366f8250cf1e6bb0a15394f4d6bc69686d774a780c","src/unix/linux_like/mod.rs":"399dc67be0898f73946145b26e12bf23beeb9048fb86b69affdc56be5622bf19","src/unix/mod.rs":"32699be951ec02142e7de59f34ae0f6162620576a4bd88ae372d39d2027421ea","src/unix/newlib/aarch64/mod.rs":"d72d067a433bf24ee6b6255c4d04ea7c966518b8d064560c593f1ab23c025962","src/unix/newlib/arm/mod.rs":"95b6e4b3cd1eeb0386d4867e9e4c3438305aa3e8ae75697e06720aa06540a666","src/unix/newlib/espidf/mod.rs":"cbaf10ccdb429719003cac3f3cd4aa0aa63a12a383afc5bd88a4ab3abaef9e2e","src/unix/newlib/generic.rs":"c435a955d72878a71ea0719a75a4579818da6a2e01635f9fe1073d9a0d67352f","src/unix/newlib/horizon/mod.rs":"7c4680766b9986a379fc354a183f4072c1c70d643307edd1a0ca8e0f2c34d5a8","src/unix/newlib/mod.rs":"1aac15b55a852732174bcfee52f3b1452c3e491461a87b70a7ee4c97a458785f","src/unix/newlib/powerpc/mod.rs":"4d6dca09ea5dc000cbd39fb939a9b1a743d819931dfca3c896659e919a07a7da","src/unix/newlib/rtems/mod.rs":"7d06863f1942a90c9a6dd412637b93c18df00e7397cb1289176b9a2a19004b7c","src/unix/newlib/vita/mod.rs":"2f9bf66b40c2aa611033faf3ade5510dc9789af7302571fade40a1715398f06c","src/unix/nto/aarch64.rs":"73ad54ebca13454a75c7b0815e853175070a8ac2eefa338012a03e8b59f01e0c","src/unix/nto/mod.rs":"ddcb98afedf905c0af8819af1591a0c7df629a187ceb35108aeaa467c4879746","src/unix/nto/neutrino.rs":"bb9d24ccee3b9e53af6d028f04ecb646e216ac1a9e2b2ade54bc06135ce3ac59","src/unix/nto/x86_64.rs":"c2e46c6ab4c02c8f773298ec1e90eeccac43c09fa111ac9ae63408abc6eff584","src/unix/nuttx/mod.rs":"4083559d825d2af9ade2c3f14e29802315c9a79091ce8d480c438c3242c7ba80","src/unix/redox/mod.rs":"40dbff61515612a7275ca1454a912ddc08f1b6f73bc084f4b563213bd46fde94","src/unix/solarish/compat.rs":"3d120a056208c03215cfbe3eef1584105160d133c0aa4557bb38018c177640b0","src/unix/solarish/illumos.rs":"74fa022e2799fed83ddeefecfdf559fff63e315ba36304845d65c9721b3ce3b7","src/unix/solarish/mod.rs":"03d1a75ecb758dde3c9ae3c3300c6d241e5e2481329724e32cfca6ffd5882cb3","src/unix/solarish/solaris.rs":"2be39ce5f464823359e7e2e4bae94c9acac9245042570df11a0ed75d49f8acad","src/unix/solarish/x86.rs":"44261c1f1b300dac9fa0dab93ec85d0c3b3c48b15bc4515b9820c9421cff7427","src/unix/solarish/x86_64.rs":"eec1602998dbd3b3aeb2d9a5bd66fc53a6fbbcd7967ed0bb2dd61a8c176023e4","src/unix/solarish/x86_common.rs":"4ae02d88622f7f080f5e8cd328f13187edbc5e124fb3e05e4cf212597f6cce48","src/vxworks/aarch64.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/vxworks/arm.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/vxworks/mod.rs":"e687423e39c07ca03d735f464537f40cc6d45407eaf6bbcfcead4a26a2e68881","src/vxworks/powerpc.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/vxworks/powerpc64.rs":"4d4236500f98858fc249f3b6858af5009851c8c582031926b8195b2646f7da5e","src/vxworks/riscv32.rs":"b1f933205800f0da00f975d53b18fe0035e075cc4613acf110a09a277dc3302a","src/vxworks/riscv64.rs":"b1f933205800f0da00f975d53b18fe0035e075cc4613acf110a09a277dc3302a","src/vxworks/x86.rs":"b1f933205800f0da00f975d53b18fe0035e075cc4613acf110a09a277dc3302a","src/vxworks/x86_64.rs":"b1f933205800f0da00f975d53b18fe0035e075cc4613acf110a09a277dc3302a","src/wasi/mod.rs":"bf128fa1c53277185b638eb953c5b8d503ae7a182780470b40b06f7c29331f38","src/wasi/p2.rs":"feecc0485eabd2c32bc5d800df6ad1b9b4d282741342fb08792f2635204e1e08","src/windows/gnu/mod.rs":"6422acc5c5a82122c11efb84882778e30888c0693c0993fbf7f3baa59e4cbbb5","src/windows/mod.rs":"01da11840df8118ad12f40dc38e921b4ecfd1045badc700d456f549789df24d4","src/windows/msvc/mod.rs":"40410b26b606d1b59b0742b2632f3cd0a28a5429f784f9693fae0a78c15b3889","src/xous.rs":"1a83621c40248ad4d0c08e1fd4c1107d5efcbc2f4f0169538b7b4a885abedbfa","tests/const_fn.rs":"8ac3171d7bced3576a4e93f48570b3e00c553d7510ab85a7473ae3b716a812dc"},"package":"68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"} \ No newline at end of file diff --git a/libc-0.2.186/.cargo_vcs_info.json b/libc-0.2.186/.cargo_vcs_info.json new file mode 100644 index 0000000000..2e53efb9b4 --- /dev/null +++ b/libc-0.2.186/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "42620ffc4109dc32e02f1cae9e63a3f4311b4b71" + }, + "path_in_vcs": "" +} \ No newline at end of file diff --git a/libc-0.2.185/.editorconfig b/libc-0.2.186/.editorconfig similarity index 100% rename from libc-0.2.185/.editorconfig rename to libc-0.2.186/.editorconfig diff --git a/libc-0.2.185/.git-blame-ignore-revs b/libc-0.2.186/.git-blame-ignore-revs similarity index 100% rename from libc-0.2.185/.git-blame-ignore-revs rename to libc-0.2.186/.git-blame-ignore-revs diff --git a/libc-0.2.185/.release-plz.toml b/libc-0.2.186/.release-plz.toml similarity index 100% rename from libc-0.2.185/.release-plz.toml rename to libc-0.2.186/.release-plz.toml diff --git a/libc-0.2.185/.rustfmt.toml b/libc-0.2.186/.rustfmt.toml similarity index 100% rename from libc-0.2.185/.rustfmt.toml rename to libc-0.2.186/.rustfmt.toml diff --git a/libc-0.2.185/CHANGELOG.md b/libc-0.2.186/CHANGELOG.md similarity index 99% rename from libc-0.2.185/CHANGELOG.md rename to libc-0.2.186/CHANGELOG.md index d9ffc7cc27..0e37267c09 100644 --- a/libc-0.2.185/CHANGELOG.md +++ b/libc-0.2.186/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [0.2.186](https://github.com/rust-lang/libc/compare/0.2.185...0.2.186) - 2026-04-24 + +### Added + +- Apple: Add `KEVENT_FLAG_*` constants ([#5070](https://github.com/rust-lang/libc/pull/5070)) +- Linux: Add `PR_SET_MEMORY_MERGE` and `PR_GET_MEMORY_MERGE` ([#5060](https://github.com/rust-lang/libc/pull/5060)) + +### Changed + +- CI: Migrate FreeBSD CI from Cirrus CI to GitHub Actions ([#5058](https://github.com/rust-lang/libc/pull/5058)) + ## [0.2.185](https://github.com/rust-lang/libc/compare/0.2.184...0.2.185) - 2026-04-13 ### Added diff --git a/libc-0.2.185/CONTRIBUTING.md b/libc-0.2.186/CONTRIBUTING.md similarity index 100% rename from libc-0.2.185/CONTRIBUTING.md rename to libc-0.2.186/CONTRIBUTING.md diff --git a/libc-0.2.185/Cargo.lock b/libc-0.2.186/Cargo.lock similarity index 95% rename from libc-0.2.185/Cargo.lock rename to libc-0.2.186/Cargo.lock index 620cd8ed21..3f41b68601 100644 --- a/libc-0.2.185/Cargo.lock +++ b/libc-0.2.186/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "libc" -version = "0.2.185" +version = "0.2.186" dependencies = [ "rustc-std-workspace-core", ] diff --git a/libc-0.2.185/Cargo.toml b/libc-0.2.186/Cargo.toml similarity index 99% rename from libc-0.2.185/Cargo.toml rename to libc-0.2.186/Cargo.toml index 6aeb7adc0e..991aac2cd9 100644 --- a/libc-0.2.185/Cargo.toml +++ b/libc-0.2.186/Cargo.toml @@ -13,13 +13,12 @@ edition = "2021" rust-version = "1.65" name = "libc" -version = "0.2.185" +version = "0.2.186" authors = ["The Rust Project Developers"] build = "build.rs" exclude = [ "/ci/*", "/.github/*", - "/.cirrus.yml", "/triagebot.toml", "cherry-pick-stable.sh", ] diff --git a/libc-0.2.185/Cargo.toml.orig b/libc-0.2.186/Cargo.toml.orig similarity index 98% rename from libc-0.2.185/Cargo.toml.orig rename to libc-0.2.186/Cargo.toml.orig index 1e05a83c0e..a448d888c7 100644 --- a/libc-0.2.185/Cargo.toml.orig +++ b/libc-0.2.186/Cargo.toml.orig @@ -1,9 +1,9 @@ [package] name = "libc" -version = "0.2.185" +version = "0.2.186" keywords = ["libc", "ffi", "bindings", "operating", "system"] categories = ["external-ffi-bindings", "no-std", "os"] -exclude = ["/ci/*", "/.github/*", "/.cirrus.yml", "/triagebot.toml", "cherry-pick-stable.sh"] +exclude = ["/ci/*", "/.github/*", "/triagebot.toml", "cherry-pick-stable.sh"] description = "Raw FFI bindings to platform libraries like libc." authors = ["The Rust Project Developers"] edition = "2021" diff --git a/libc-0.2.185/LICENSE-APACHE b/libc-0.2.186/LICENSE-APACHE similarity index 100% rename from libc-0.2.185/LICENSE-APACHE rename to libc-0.2.186/LICENSE-APACHE diff --git a/libc-0.2.185/LICENSE-MIT b/libc-0.2.186/LICENSE-MIT similarity index 100% rename from libc-0.2.185/LICENSE-MIT rename to libc-0.2.186/LICENSE-MIT diff --git a/libc-0.2.185/README.md b/libc-0.2.186/README.md similarity index 91% rename from libc-0.2.185/README.md rename to libc-0.2.186/README.md index 69aff2cae1..76ecb8673b 100644 --- a/libc-0.2.185/README.md +++ b/libc-0.2.186/README.md @@ -1,6 +1,6 @@ # libc - Raw FFI bindings to platforms' system libraries -[![GHA Status]][GitHub Actions] [![Cirrus CI Status]][Cirrus CI] [![Latest Version]][crates.io] [![Documentation]][docs.rs] ![License] +[![GHA Status]][GitHub Actions] [![Latest Version]][crates.io] [![Documentation]][docs.rs] ![License] `libc` provides all of the definitions necessary to easily interoperate with C code (or "C-like" code) on each of the platforms that Rust supports. This @@ -73,8 +73,8 @@ you want to see. See [`ci/verify-build.py`](https://github.com/rust-lang/libc/blob/HEAD/ci/verify-build.py) for the platforms on which `libc` is guaranteed to build for each Rust toolchain. -The test-matrix at [GitHub Actions] and [Cirrus CI] show the platforms in which -`libc` tests are run. +The test matrices at [GitHub Actions] show the platforms in which `libc` tests +are run.

@@ -108,8 +108,6 @@ dual licensed as above, without any additional terms or conditions. [GitHub Actions]: https://github.com/rust-lang/libc/actions [GHA Status]: https://github.com/rust-lang/libc/workflows/CI/badge.svg -[Cirrus CI]: https://cirrus-ci.com/github/rust-lang/libc -[Cirrus CI Status]: https://api.cirrus-ci.com/github/rust-lang/libc.svg [crates.io]: https://crates.io/crates/libc [Latest Version]: https://img.shields.io/crates/v/libc.svg [Documentation]: https://docs.rs/libc/badge.svg diff --git a/libc-0.2.185/build.rs b/libc-0.2.186/build.rs similarity index 100% rename from libc-0.2.185/build.rs rename to libc-0.2.186/build.rs diff --git a/libc-0.2.185/src/fuchsia/aarch64.rs b/libc-0.2.186/src/fuchsia/aarch64.rs similarity index 100% rename from libc-0.2.185/src/fuchsia/aarch64.rs rename to libc-0.2.186/src/fuchsia/aarch64.rs diff --git a/libc-0.2.185/src/fuchsia/mod.rs b/libc-0.2.186/src/fuchsia/mod.rs similarity index 100% rename from libc-0.2.185/src/fuchsia/mod.rs rename to libc-0.2.186/src/fuchsia/mod.rs diff --git a/libc-0.2.185/src/fuchsia/riscv64.rs b/libc-0.2.186/src/fuchsia/riscv64.rs similarity index 100% rename from libc-0.2.185/src/fuchsia/riscv64.rs rename to libc-0.2.186/src/fuchsia/riscv64.rs diff --git a/libc-0.2.185/src/fuchsia/x86_64.rs b/libc-0.2.186/src/fuchsia/x86_64.rs similarity index 100% rename from libc-0.2.185/src/fuchsia/x86_64.rs rename to libc-0.2.186/src/fuchsia/x86_64.rs diff --git a/libc-0.2.185/src/hermit.rs b/libc-0.2.186/src/hermit.rs similarity index 100% rename from libc-0.2.185/src/hermit.rs rename to libc-0.2.186/src/hermit.rs diff --git a/libc-0.2.185/src/lib.rs b/libc-0.2.186/src/lib.rs similarity index 100% rename from libc-0.2.185/src/lib.rs rename to libc-0.2.186/src/lib.rs diff --git a/libc-0.2.185/src/macros.rs b/libc-0.2.186/src/macros.rs similarity index 100% rename from libc-0.2.185/src/macros.rs rename to libc-0.2.186/src/macros.rs diff --git a/libc-0.2.185/src/new/aix/mod.rs b/libc-0.2.186/src/new/aix/mod.rs similarity index 100% rename from libc-0.2.185/src/new/aix/mod.rs rename to libc-0.2.186/src/new/aix/mod.rs diff --git a/libc-0.2.185/src/new/aix/unistd.rs b/libc-0.2.186/src/new/aix/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/aix/unistd.rs rename to libc-0.2.186/src/new/aix/unistd.rs diff --git a/libc-0.2.185/src/new/apple/libc/signal.rs b/libc-0.2.186/src/new/apple/libc/signal.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libc/signal.rs rename to libc-0.2.186/src/new/apple/libc/signal.rs diff --git a/libc-0.2.185/src/new/apple/libc/unistd.rs b/libc-0.2.186/src/new/apple/libc/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libc/unistd.rs rename to libc-0.2.186/src/new/apple/libc/unistd.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/mod.rs b/libc-0.2.186/src/new/apple/libpthread/mod.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/mod.rs rename to libc-0.2.186/src/new/apple/libpthread/mod.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/pthread_/introspection.rs b/libc-0.2.186/src/new/apple/libpthread/pthread_/introspection.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/pthread_/introspection.rs rename to libc-0.2.186/src/new/apple/libpthread/pthread_/introspection.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/pthread_/pthread.rs b/libc-0.2.186/src/new/apple/libpthread/pthread_/pthread.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/pthread_/pthread.rs rename to libc-0.2.186/src/new/apple/libpthread/pthread_/pthread.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/pthread_/pthread_impl.rs b/libc-0.2.186/src/new/apple/libpthread/pthread_/pthread_impl.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/pthread_/pthread_impl.rs rename to libc-0.2.186/src/new/apple/libpthread/pthread_/pthread_impl.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/pthread_/pthread_spis.rs b/libc-0.2.186/src/new/apple/libpthread/pthread_/pthread_spis.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/pthread_/pthread_spis.rs rename to libc-0.2.186/src/new/apple/libpthread/pthread_/pthread_spis.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/pthread_/qos.rs b/libc-0.2.186/src/new/apple/libpthread/pthread_/qos.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/pthread_/qos.rs rename to libc-0.2.186/src/new/apple/libpthread/pthread_/qos.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/pthread_/sched.rs b/libc-0.2.186/src/new/apple/libpthread/pthread_/sched.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/pthread_/sched.rs rename to libc-0.2.186/src/new/apple/libpthread/pthread_/sched.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/pthread_/spawn.rs b/libc-0.2.186/src/new/apple/libpthread/pthread_/spawn.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/pthread_/spawn.rs rename to libc-0.2.186/src/new/apple/libpthread/pthread_/spawn.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/pthread_/stack_np.rs b/libc-0.2.186/src/new/apple/libpthread/pthread_/stack_np.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/pthread_/stack_np.rs rename to libc-0.2.186/src/new/apple/libpthread/pthread_/stack_np.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/sys/_pthread/_pthread_types.rs b/libc-0.2.186/src/new/apple/libpthread/sys/_pthread/_pthread_types.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/sys/_pthread/_pthread_types.rs rename to libc-0.2.186/src/new/apple/libpthread/sys/_pthread/_pthread_types.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/sys/mod.rs b/libc-0.2.186/src/new/apple/libpthread/sys/mod.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/sys/mod.rs rename to libc-0.2.186/src/new/apple/libpthread/sys/mod.rs diff --git a/libc-0.2.185/src/new/apple/libpthread/sys/qos.rs b/libc-0.2.186/src/new/apple/libpthread/sys/qos.rs similarity index 100% rename from libc-0.2.185/src/new/apple/libpthread/sys/qos.rs rename to libc-0.2.186/src/new/apple/libpthread/sys/qos.rs diff --git a/libc-0.2.185/src/new/apple/mod.rs b/libc-0.2.186/src/new/apple/mod.rs similarity index 100% rename from libc-0.2.185/src/new/apple/mod.rs rename to libc-0.2.186/src/new/apple/mod.rs diff --git a/libc-0.2.185/src/new/apple/xnu/arm/_mcontext.rs b/libc-0.2.186/src/new/apple/xnu/arm/_mcontext.rs similarity index 100% rename from libc-0.2.185/src/new/apple/xnu/arm/_mcontext.rs rename to libc-0.2.186/src/new/apple/xnu/arm/_mcontext.rs diff --git a/libc-0.2.185/src/new/apple/xnu/i386/_mcontext.rs b/libc-0.2.186/src/new/apple/xnu/i386/_mcontext.rs similarity index 100% rename from libc-0.2.185/src/new/apple/xnu/i386/_mcontext.rs rename to libc-0.2.186/src/new/apple/xnu/i386/_mcontext.rs diff --git a/libc-0.2.185/src/new/apple/xnu/mach/arm/_structs.rs b/libc-0.2.186/src/new/apple/xnu/mach/arm/_structs.rs similarity index 100% rename from libc-0.2.185/src/new/apple/xnu/mach/arm/_structs.rs rename to libc-0.2.186/src/new/apple/xnu/mach/arm/_structs.rs diff --git a/libc-0.2.185/src/new/apple/xnu/mach/i386/_structs.rs b/libc-0.2.186/src/new/apple/xnu/mach/i386/_structs.rs similarity index 100% rename from libc-0.2.185/src/new/apple/xnu/mach/i386/_structs.rs rename to libc-0.2.186/src/new/apple/xnu/mach/i386/_structs.rs diff --git a/libc-0.2.185/src/new/apple/xnu/mach/machine/_structs.rs b/libc-0.2.186/src/new/apple/xnu/mach/machine/_structs.rs similarity index 100% rename from libc-0.2.185/src/new/apple/xnu/mach/machine/_structs.rs rename to libc-0.2.186/src/new/apple/xnu/mach/machine/_structs.rs diff --git a/libc-0.2.185/src/new/apple/xnu/mach/mod.rs b/libc-0.2.186/src/new/apple/xnu/mach/mod.rs similarity index 100% rename from libc-0.2.185/src/new/apple/xnu/mach/mod.rs rename to libc-0.2.186/src/new/apple/xnu/mach/mod.rs diff --git a/libc-0.2.185/src/new/apple/xnu/machine/_mcontext.rs b/libc-0.2.186/src/new/apple/xnu/machine/_mcontext.rs similarity index 100% rename from libc-0.2.185/src/new/apple/xnu/machine/_mcontext.rs rename to libc-0.2.186/src/new/apple/xnu/machine/_mcontext.rs diff --git a/libc-0.2.185/src/new/apple/xnu/mod.rs b/libc-0.2.186/src/new/apple/xnu/mod.rs similarity index 100% rename from libc-0.2.185/src/new/apple/xnu/mod.rs rename to libc-0.2.186/src/new/apple/xnu/mod.rs diff --git a/libc-0.2.185/src/new/apple/xnu/sys/_types/_ucontext.rs b/libc-0.2.186/src/new/apple/xnu/sys/_types/_ucontext.rs similarity index 100% rename from libc-0.2.185/src/new/apple/xnu/sys/_types/_ucontext.rs rename to libc-0.2.186/src/new/apple/xnu/sys/_types/_ucontext.rs diff --git a/libc-0.2.185/src/new/apple/xnu/sys/mod.rs b/libc-0.2.186/src/new/apple/xnu/sys/mod.rs similarity index 100% rename from libc-0.2.185/src/new/apple/xnu/sys/mod.rs rename to libc-0.2.186/src/new/apple/xnu/sys/mod.rs diff --git a/libc-0.2.185/src/new/apple/xnu/sys/signal.rs b/libc-0.2.186/src/new/apple/xnu/sys/signal.rs similarity index 100% rename from libc-0.2.185/src/new/apple/xnu/sys/signal.rs rename to libc-0.2.186/src/new/apple/xnu/sys/signal.rs diff --git a/libc-0.2.185/src/new/bionic_libc/mod.rs b/libc-0.2.186/src/new/bionic_libc/mod.rs similarity index 100% rename from libc-0.2.185/src/new/bionic_libc/mod.rs rename to libc-0.2.186/src/new/bionic_libc/mod.rs diff --git a/libc-0.2.185/src/new/bionic_libc/pthread.rs b/libc-0.2.186/src/new/bionic_libc/pthread.rs similarity index 100% rename from libc-0.2.185/src/new/bionic_libc/pthread.rs rename to libc-0.2.186/src/new/bionic_libc/pthread.rs diff --git a/libc-0.2.185/src/new/bionic_libc/sys/mod.rs b/libc-0.2.186/src/new/bionic_libc/sys/mod.rs similarity index 100% rename from libc-0.2.185/src/new/bionic_libc/sys/mod.rs rename to libc-0.2.186/src/new/bionic_libc/sys/mod.rs diff --git a/libc-0.2.185/src/new/bionic_libc/sys/socket.rs b/libc-0.2.186/src/new/bionic_libc/sys/socket.rs similarity index 100% rename from libc-0.2.185/src/new/bionic_libc/sys/socket.rs rename to libc-0.2.186/src/new/bionic_libc/sys/socket.rs diff --git a/libc-0.2.185/src/new/bionic_libc/unistd.rs b/libc-0.2.186/src/new/bionic_libc/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/bionic_libc/unistd.rs rename to libc-0.2.186/src/new/bionic_libc/unistd.rs diff --git a/libc-0.2.185/src/new/common/bsd.rs b/libc-0.2.186/src/new/common/bsd.rs similarity index 100% rename from libc-0.2.185/src/new/common/bsd.rs rename to libc-0.2.186/src/new/common/bsd.rs diff --git a/libc-0.2.185/src/new/common/freebsd_like.rs b/libc-0.2.186/src/new/common/freebsd_like.rs similarity index 100% rename from libc-0.2.185/src/new/common/freebsd_like.rs rename to libc-0.2.186/src/new/common/freebsd_like.rs diff --git a/libc-0.2.185/src/new/common/linux_like/mod.rs b/libc-0.2.186/src/new/common/linux_like/mod.rs similarity index 100% rename from libc-0.2.185/src/new/common/linux_like/mod.rs rename to libc-0.2.186/src/new/common/linux_like/mod.rs diff --git a/libc-0.2.185/src/new/common/linux_like/pthread.rs b/libc-0.2.186/src/new/common/linux_like/pthread.rs similarity index 100% rename from libc-0.2.185/src/new/common/linux_like/pthread.rs rename to libc-0.2.186/src/new/common/linux_like/pthread.rs diff --git a/libc-0.2.185/src/new/common/mod.rs b/libc-0.2.186/src/new/common/mod.rs similarity index 100% rename from libc-0.2.185/src/new/common/mod.rs rename to libc-0.2.186/src/new/common/mod.rs diff --git a/libc-0.2.185/src/new/common/netbsd_like.rs b/libc-0.2.186/src/new/common/netbsd_like.rs similarity index 100% rename from libc-0.2.185/src/new/common/netbsd_like.rs rename to libc-0.2.186/src/new/common/netbsd_like.rs diff --git a/libc-0.2.185/src/new/common/posix/mod.rs b/libc-0.2.186/src/new/common/posix/mod.rs similarity index 100% rename from libc-0.2.185/src/new/common/posix/mod.rs rename to libc-0.2.186/src/new/common/posix/mod.rs diff --git a/libc-0.2.185/src/new/common/posix/pthread.rs b/libc-0.2.186/src/new/common/posix/pthread.rs similarity index 100% rename from libc-0.2.185/src/new/common/posix/pthread.rs rename to libc-0.2.186/src/new/common/posix/pthread.rs diff --git a/libc-0.2.185/src/new/common/posix/unistd.rs b/libc-0.2.186/src/new/common/posix/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/common/posix/unistd.rs rename to libc-0.2.186/src/new/common/posix/unistd.rs diff --git a/libc-0.2.185/src/new/common/solarish.rs b/libc-0.2.186/src/new/common/solarish.rs similarity index 100% rename from libc-0.2.185/src/new/common/solarish.rs rename to libc-0.2.186/src/new/common/solarish.rs diff --git a/libc-0.2.185/src/new/cygwin/mod.rs b/libc-0.2.186/src/new/cygwin/mod.rs similarity index 100% rename from libc-0.2.185/src/new/cygwin/mod.rs rename to libc-0.2.186/src/new/cygwin/mod.rs diff --git a/libc-0.2.185/src/new/cygwin/unistd.rs b/libc-0.2.186/src/new/cygwin/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/cygwin/unistd.rs rename to libc-0.2.186/src/new/cygwin/unistd.rs diff --git a/libc-0.2.185/src/new/dragonfly/mod.rs b/libc-0.2.186/src/new/dragonfly/mod.rs similarity index 100% rename from libc-0.2.185/src/new/dragonfly/mod.rs rename to libc-0.2.186/src/new/dragonfly/mod.rs diff --git a/libc-0.2.185/src/new/dragonfly/unistd.rs b/libc-0.2.186/src/new/dragonfly/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/dragonfly/unistd.rs rename to libc-0.2.186/src/new/dragonfly/unistd.rs diff --git a/libc-0.2.185/src/new/emscripten/mod.rs b/libc-0.2.186/src/new/emscripten/mod.rs similarity index 100% rename from libc-0.2.185/src/new/emscripten/mod.rs rename to libc-0.2.186/src/new/emscripten/mod.rs diff --git a/libc-0.2.185/src/new/emscripten/pthread.rs b/libc-0.2.186/src/new/emscripten/pthread.rs similarity index 100% rename from libc-0.2.185/src/new/emscripten/pthread.rs rename to libc-0.2.186/src/new/emscripten/pthread.rs diff --git a/libc-0.2.185/src/new/emscripten/sched.rs b/libc-0.2.186/src/new/emscripten/sched.rs similarity index 100% rename from libc-0.2.185/src/new/emscripten/sched.rs rename to libc-0.2.186/src/new/emscripten/sched.rs diff --git a/libc-0.2.185/src/new/emscripten/unistd.rs b/libc-0.2.186/src/new/emscripten/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/emscripten/unistd.rs rename to libc-0.2.186/src/new/emscripten/unistd.rs diff --git a/libc-0.2.185/src/new/espidf/mod.rs b/libc-0.2.186/src/new/espidf/mod.rs similarity index 100% rename from libc-0.2.185/src/new/espidf/mod.rs rename to libc-0.2.186/src/new/espidf/mod.rs diff --git a/libc-0.2.185/src/new/freebsd/mod.rs b/libc-0.2.186/src/new/freebsd/mod.rs similarity index 100% rename from libc-0.2.185/src/new/freebsd/mod.rs rename to libc-0.2.186/src/new/freebsd/mod.rs diff --git a/libc-0.2.185/src/new/freebsd/sys/file.rs b/libc-0.2.186/src/new/freebsd/sys/file.rs similarity index 100% rename from libc-0.2.185/src/new/freebsd/sys/file.rs rename to libc-0.2.186/src/new/freebsd/sys/file.rs diff --git a/libc-0.2.185/src/new/freebsd/sys/mod.rs b/libc-0.2.186/src/new/freebsd/sys/mod.rs similarity index 100% rename from libc-0.2.185/src/new/freebsd/sys/mod.rs rename to libc-0.2.186/src/new/freebsd/sys/mod.rs diff --git a/libc-0.2.185/src/new/freebsd/unistd.rs b/libc-0.2.186/src/new/freebsd/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/freebsd/unistd.rs rename to libc-0.2.186/src/new/freebsd/unistd.rs diff --git a/libc-0.2.185/src/new/fuchsia/mod.rs b/libc-0.2.186/src/new/fuchsia/mod.rs similarity index 100% rename from libc-0.2.185/src/new/fuchsia/mod.rs rename to libc-0.2.186/src/new/fuchsia/mod.rs diff --git a/libc-0.2.185/src/new/fuchsia/unistd.rs b/libc-0.2.186/src/new/fuchsia/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/fuchsia/unistd.rs rename to libc-0.2.186/src/new/fuchsia/unistd.rs diff --git a/libc-0.2.185/src/new/glibc/mod.rs b/libc-0.2.186/src/new/glibc/mod.rs similarity index 100% rename from libc-0.2.185/src/new/glibc/mod.rs rename to libc-0.2.186/src/new/glibc/mod.rs diff --git a/libc-0.2.185/src/new/glibc/posix/unistd.rs b/libc-0.2.186/src/new/glibc/posix/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/glibc/posix/unistd.rs rename to libc-0.2.186/src/new/glibc/posix/unistd.rs diff --git a/libc-0.2.185/src/new/glibc/sysdeps/nptl/mod.rs b/libc-0.2.186/src/new/glibc/sysdeps/nptl/mod.rs similarity index 100% rename from libc-0.2.185/src/new/glibc/sysdeps/nptl/mod.rs rename to libc-0.2.186/src/new/glibc/sysdeps/nptl/mod.rs diff --git a/libc-0.2.185/src/new/glibc/sysdeps/nptl/pthread.rs b/libc-0.2.186/src/new/glibc/sysdeps/nptl/pthread.rs similarity index 100% rename from libc-0.2.185/src/new/glibc/sysdeps/nptl/pthread.rs rename to libc-0.2.186/src/new/glibc/sysdeps/nptl/pthread.rs diff --git a/libc-0.2.185/src/new/glibc/sysdeps/unix/linux/mod.rs b/libc-0.2.186/src/new/glibc/sysdeps/unix/linux/mod.rs similarity index 100% rename from libc-0.2.185/src/new/glibc/sysdeps/unix/linux/mod.rs rename to libc-0.2.186/src/new/glibc/sysdeps/unix/linux/mod.rs diff --git a/libc-0.2.185/src/new/glibc/sysdeps/unix/linux/net/route.rs b/libc-0.2.186/src/new/glibc/sysdeps/unix/linux/net/route.rs similarity index 100% rename from libc-0.2.185/src/new/glibc/sysdeps/unix/linux/net/route.rs rename to libc-0.2.186/src/new/glibc/sysdeps/unix/linux/net/route.rs diff --git a/libc-0.2.185/src/new/glibc/sysdeps/unix/mod.rs b/libc-0.2.186/src/new/glibc/sysdeps/unix/mod.rs similarity index 100% rename from libc-0.2.185/src/new/glibc/sysdeps/unix/mod.rs rename to libc-0.2.186/src/new/glibc/sysdeps/unix/mod.rs diff --git a/libc-0.2.185/src/new/haiku/mod.rs b/libc-0.2.186/src/new/haiku/mod.rs similarity index 100% rename from libc-0.2.185/src/new/haiku/mod.rs rename to libc-0.2.186/src/new/haiku/mod.rs diff --git a/libc-0.2.185/src/new/haiku/unistd.rs b/libc-0.2.186/src/new/haiku/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/haiku/unistd.rs rename to libc-0.2.186/src/new/haiku/unistd.rs diff --git a/libc-0.2.185/src/new/hermit_abi/mod.rs b/libc-0.2.186/src/new/hermit_abi/mod.rs similarity index 100% rename from libc-0.2.185/src/new/hermit_abi/mod.rs rename to libc-0.2.186/src/new/hermit_abi/mod.rs diff --git a/libc-0.2.185/src/new/horizon/mod.rs b/libc-0.2.186/src/new/horizon/mod.rs similarity index 100% rename from libc-0.2.185/src/new/horizon/mod.rs rename to libc-0.2.186/src/new/horizon/mod.rs diff --git a/libc-0.2.185/src/new/hurd/mod.rs b/libc-0.2.186/src/new/hurd/mod.rs similarity index 100% rename from libc-0.2.185/src/new/hurd/mod.rs rename to libc-0.2.186/src/new/hurd/mod.rs diff --git a/libc-0.2.185/src/new/illumos/mod.rs b/libc-0.2.186/src/new/illumos/mod.rs similarity index 100% rename from libc-0.2.185/src/new/illumos/mod.rs rename to libc-0.2.186/src/new/illumos/mod.rs diff --git a/libc-0.2.185/src/new/illumos/unistd.rs b/libc-0.2.186/src/new/illumos/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/illumos/unistd.rs rename to libc-0.2.186/src/new/illumos/unistd.rs diff --git a/libc-0.2.185/src/new/l4re/mod.rs b/libc-0.2.186/src/new/l4re/mod.rs similarity index 100% rename from libc-0.2.185/src/new/l4re/mod.rs rename to libc-0.2.186/src/new/l4re/mod.rs diff --git a/libc-0.2.185/src/new/linux_uapi/linux/can.rs b/libc-0.2.186/src/new/linux_uapi/linux/can.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/linux/can.rs rename to libc-0.2.186/src/new/linux_uapi/linux/can.rs diff --git a/libc-0.2.185/src/new/linux_uapi/linux/can/bcm.rs b/libc-0.2.186/src/new/linux_uapi/linux/can/bcm.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/linux/can/bcm.rs rename to libc-0.2.186/src/new/linux_uapi/linux/can/bcm.rs diff --git a/libc-0.2.185/src/new/linux_uapi/linux/can/error.rs b/libc-0.2.186/src/new/linux_uapi/linux/can/error.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/linux/can/error.rs rename to libc-0.2.186/src/new/linux_uapi/linux/can/error.rs diff --git a/libc-0.2.185/src/new/linux_uapi/linux/can/j1939.rs b/libc-0.2.186/src/new/linux_uapi/linux/can/j1939.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/linux/can/j1939.rs rename to libc-0.2.186/src/new/linux_uapi/linux/can/j1939.rs diff --git a/libc-0.2.185/src/new/linux_uapi/linux/can/netlink.rs b/libc-0.2.186/src/new/linux_uapi/linux/can/netlink.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/linux/can/netlink.rs rename to libc-0.2.186/src/new/linux_uapi/linux/can/netlink.rs diff --git a/libc-0.2.185/src/new/linux_uapi/linux/can/raw.rs b/libc-0.2.186/src/new/linux_uapi/linux/can/raw.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/linux/can/raw.rs rename to libc-0.2.186/src/new/linux_uapi/linux/can/raw.rs diff --git a/libc-0.2.185/src/new/linux_uapi/linux/keyctl.rs b/libc-0.2.186/src/new/linux_uapi/linux/keyctl.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/linux/keyctl.rs rename to libc-0.2.186/src/new/linux_uapi/linux/keyctl.rs diff --git a/libc-0.2.185/src/new/linux_uapi/linux/membarrier.rs b/libc-0.2.186/src/new/linux_uapi/linux/membarrier.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/linux/membarrier.rs rename to libc-0.2.186/src/new/linux_uapi/linux/membarrier.rs diff --git a/libc-0.2.185/src/new/linux_uapi/linux/mod.rs b/libc-0.2.186/src/new/linux_uapi/linux/mod.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/linux/mod.rs rename to libc-0.2.186/src/new/linux_uapi/linux/mod.rs diff --git a/libc-0.2.185/src/new/linux_uapi/linux/netlink.rs b/libc-0.2.186/src/new/linux_uapi/linux/netlink.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/linux/netlink.rs rename to libc-0.2.186/src/new/linux_uapi/linux/netlink.rs diff --git a/libc-0.2.185/src/new/linux_uapi/linux/pidfd.rs b/libc-0.2.186/src/new/linux_uapi/linux/pidfd.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/linux/pidfd.rs rename to libc-0.2.186/src/new/linux_uapi/linux/pidfd.rs diff --git a/libc-0.2.185/src/new/linux_uapi/mod.rs b/libc-0.2.186/src/new/linux_uapi/mod.rs similarity index 100% rename from libc-0.2.185/src/new/linux_uapi/mod.rs rename to libc-0.2.186/src/new/linux_uapi/mod.rs diff --git a/libc-0.2.185/src/new/mod.rs b/libc-0.2.186/src/new/mod.rs similarity index 100% rename from libc-0.2.185/src/new/mod.rs rename to libc-0.2.186/src/new/mod.rs diff --git a/libc-0.2.185/src/new/musl/arch/generic/mod.rs b/libc-0.2.186/src/new/musl/arch/generic/mod.rs similarity index 100% rename from libc-0.2.185/src/new/musl/arch/generic/mod.rs rename to libc-0.2.186/src/new/musl/arch/generic/mod.rs diff --git a/libc-0.2.185/src/new/musl/arch/mips/bits/socket.rs b/libc-0.2.186/src/new/musl/arch/mips/bits/socket.rs similarity index 100% rename from libc-0.2.185/src/new/musl/arch/mips/bits/socket.rs rename to libc-0.2.186/src/new/musl/arch/mips/bits/socket.rs diff --git a/libc-0.2.185/src/new/musl/arch/mips/mod.rs b/libc-0.2.186/src/new/musl/arch/mips/mod.rs similarity index 100% rename from libc-0.2.185/src/new/musl/arch/mips/mod.rs rename to libc-0.2.186/src/new/musl/arch/mips/mod.rs diff --git a/libc-0.2.185/src/new/musl/arch/mips64/bits/socket.rs b/libc-0.2.186/src/new/musl/arch/mips64/bits/socket.rs similarity index 100% rename from libc-0.2.185/src/new/musl/arch/mips64/bits/socket.rs rename to libc-0.2.186/src/new/musl/arch/mips64/bits/socket.rs diff --git a/libc-0.2.185/src/new/musl/arch/mips64/mod.rs b/libc-0.2.186/src/new/musl/arch/mips64/mod.rs similarity index 100% rename from libc-0.2.185/src/new/musl/arch/mips64/mod.rs rename to libc-0.2.186/src/new/musl/arch/mips64/mod.rs diff --git a/libc-0.2.185/src/new/musl/arch/mod.rs b/libc-0.2.186/src/new/musl/arch/mod.rs similarity index 100% rename from libc-0.2.185/src/new/musl/arch/mod.rs rename to libc-0.2.186/src/new/musl/arch/mod.rs diff --git a/libc-0.2.185/src/new/musl/mod.rs b/libc-0.2.186/src/new/musl/mod.rs similarity index 100% rename from libc-0.2.185/src/new/musl/mod.rs rename to libc-0.2.186/src/new/musl/mod.rs diff --git a/libc-0.2.185/src/new/musl/pthread.rs b/libc-0.2.186/src/new/musl/pthread.rs similarity index 100% rename from libc-0.2.185/src/new/musl/pthread.rs rename to libc-0.2.186/src/new/musl/pthread.rs diff --git a/libc-0.2.185/src/new/musl/sched.rs b/libc-0.2.186/src/new/musl/sched.rs similarity index 100% rename from libc-0.2.185/src/new/musl/sched.rs rename to libc-0.2.186/src/new/musl/sched.rs diff --git a/libc-0.2.185/src/new/musl/sys/socket.rs b/libc-0.2.186/src/new/musl/sys/socket.rs similarity index 100% rename from libc-0.2.185/src/new/musl/sys/socket.rs rename to libc-0.2.186/src/new/musl/sys/socket.rs diff --git a/libc-0.2.185/src/new/musl/unistd.rs b/libc-0.2.186/src/new/musl/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/musl/unistd.rs rename to libc-0.2.186/src/new/musl/unistd.rs diff --git a/libc-0.2.185/src/new/netbsd/mod.rs b/libc-0.2.186/src/new/netbsd/mod.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/mod.rs rename to libc-0.2.186/src/new/netbsd/mod.rs diff --git a/libc-0.2.185/src/new/netbsd/net/if_.rs b/libc-0.2.186/src/new/netbsd/net/if_.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/net/if_.rs rename to libc-0.2.186/src/new/netbsd/net/if_.rs diff --git a/libc-0.2.185/src/new/netbsd/sys/file.rs b/libc-0.2.186/src/new/netbsd/sys/file.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/sys/file.rs rename to libc-0.2.186/src/new/netbsd/sys/file.rs diff --git a/libc-0.2.185/src/new/netbsd/sys/ipc.rs b/libc-0.2.186/src/new/netbsd/sys/ipc.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/sys/ipc.rs rename to libc-0.2.186/src/new/netbsd/sys/ipc.rs diff --git a/libc-0.2.185/src/new/netbsd/sys/mod.rs b/libc-0.2.186/src/new/netbsd/sys/mod.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/sys/mod.rs rename to libc-0.2.186/src/new/netbsd/sys/mod.rs diff --git a/libc-0.2.185/src/new/netbsd/sys/socket.rs b/libc-0.2.186/src/new/netbsd/sys/socket.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/sys/socket.rs rename to libc-0.2.186/src/new/netbsd/sys/socket.rs diff --git a/libc-0.2.185/src/new/netbsd/sys/statvfs.rs b/libc-0.2.186/src/new/netbsd/sys/statvfs.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/sys/statvfs.rs rename to libc-0.2.186/src/new/netbsd/sys/statvfs.rs diff --git a/libc-0.2.185/src/new/netbsd/sys/time.rs b/libc-0.2.186/src/new/netbsd/sys/time.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/sys/time.rs rename to libc-0.2.186/src/new/netbsd/sys/time.rs diff --git a/libc-0.2.185/src/new/netbsd/sys/timex.rs b/libc-0.2.186/src/new/netbsd/sys/timex.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/sys/timex.rs rename to libc-0.2.186/src/new/netbsd/sys/timex.rs diff --git a/libc-0.2.185/src/new/netbsd/sys/types.rs b/libc-0.2.186/src/new/netbsd/sys/types.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/sys/types.rs rename to libc-0.2.186/src/new/netbsd/sys/types.rs diff --git a/libc-0.2.185/src/new/netbsd/unistd.rs b/libc-0.2.186/src/new/netbsd/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/unistd.rs rename to libc-0.2.186/src/new/netbsd/unistd.rs diff --git a/libc-0.2.185/src/new/netbsd/utmp_.rs b/libc-0.2.186/src/new/netbsd/utmp_.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/utmp_.rs rename to libc-0.2.186/src/new/netbsd/utmp_.rs diff --git a/libc-0.2.185/src/new/netbsd/utmpx_.rs b/libc-0.2.186/src/new/netbsd/utmpx_.rs similarity index 100% rename from libc-0.2.185/src/new/netbsd/utmpx_.rs rename to libc-0.2.186/src/new/netbsd/utmpx_.rs diff --git a/libc-0.2.185/src/new/newlib/mod.rs b/libc-0.2.186/src/new/newlib/mod.rs similarity index 100% rename from libc-0.2.185/src/new/newlib/mod.rs rename to libc-0.2.186/src/new/newlib/mod.rs diff --git a/libc-0.2.185/src/new/newlib/unistd.rs b/libc-0.2.186/src/new/newlib/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/newlib/unistd.rs rename to libc-0.2.186/src/new/newlib/unistd.rs diff --git a/libc-0.2.185/src/new/nto/mod.rs b/libc-0.2.186/src/new/nto/mod.rs similarity index 100% rename from libc-0.2.185/src/new/nto/mod.rs rename to libc-0.2.186/src/new/nto/mod.rs diff --git a/libc-0.2.185/src/new/nto/net/bpf.rs b/libc-0.2.186/src/new/nto/net/bpf.rs similarity index 100% rename from libc-0.2.185/src/new/nto/net/bpf.rs rename to libc-0.2.186/src/new/nto/net/bpf.rs diff --git a/libc-0.2.185/src/new/nto/net/if_.rs b/libc-0.2.186/src/new/nto/net/if_.rs similarity index 100% rename from libc-0.2.185/src/new/nto/net/if_.rs rename to libc-0.2.186/src/new/nto/net/if_.rs diff --git a/libc-0.2.185/src/new/nto/unistd.rs b/libc-0.2.186/src/new/nto/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/nto/unistd.rs rename to libc-0.2.186/src/new/nto/unistd.rs diff --git a/libc-0.2.185/src/new/nuttx/mod.rs b/libc-0.2.186/src/new/nuttx/mod.rs similarity index 100% rename from libc-0.2.185/src/new/nuttx/mod.rs rename to libc-0.2.186/src/new/nuttx/mod.rs diff --git a/libc-0.2.185/src/new/nuttx/unistd.rs b/libc-0.2.186/src/new/nuttx/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/nuttx/unistd.rs rename to libc-0.2.186/src/new/nuttx/unistd.rs diff --git a/libc-0.2.185/src/new/openbsd/mod.rs b/libc-0.2.186/src/new/openbsd/mod.rs similarity index 100% rename from libc-0.2.185/src/new/openbsd/mod.rs rename to libc-0.2.186/src/new/openbsd/mod.rs diff --git a/libc-0.2.185/src/new/openbsd/sys/ipc.rs b/libc-0.2.186/src/new/openbsd/sys/ipc.rs similarity index 100% rename from libc-0.2.185/src/new/openbsd/sys/ipc.rs rename to libc-0.2.186/src/new/openbsd/sys/ipc.rs diff --git a/libc-0.2.185/src/new/openbsd/sys/mod.rs b/libc-0.2.186/src/new/openbsd/sys/mod.rs similarity index 100% rename from libc-0.2.185/src/new/openbsd/sys/mod.rs rename to libc-0.2.186/src/new/openbsd/sys/mod.rs diff --git a/libc-0.2.185/src/new/openbsd/unistd.rs b/libc-0.2.186/src/new/openbsd/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/openbsd/unistd.rs rename to libc-0.2.186/src/new/openbsd/unistd.rs diff --git a/libc-0.2.185/src/new/qurt/dlfcn.rs b/libc-0.2.186/src/new/qurt/dlfcn.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/dlfcn.rs rename to libc-0.2.186/src/new/qurt/dlfcn.rs diff --git a/libc-0.2.185/src/new/qurt/errno.rs b/libc-0.2.186/src/new/qurt/errno.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/errno.rs rename to libc-0.2.186/src/new/qurt/errno.rs diff --git a/libc-0.2.185/src/new/qurt/fcntl.rs b/libc-0.2.186/src/new/qurt/fcntl.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/fcntl.rs rename to libc-0.2.186/src/new/qurt/fcntl.rs diff --git a/libc-0.2.185/src/new/qurt/limits.rs b/libc-0.2.186/src/new/qurt/limits.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/limits.rs rename to libc-0.2.186/src/new/qurt/limits.rs diff --git a/libc-0.2.185/src/new/qurt/mod.rs b/libc-0.2.186/src/new/qurt/mod.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/mod.rs rename to libc-0.2.186/src/new/qurt/mod.rs diff --git a/libc-0.2.185/src/new/qurt/pthread.rs b/libc-0.2.186/src/new/qurt/pthread.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/pthread.rs rename to libc-0.2.186/src/new/qurt/pthread.rs diff --git a/libc-0.2.185/src/new/qurt/semaphore.rs b/libc-0.2.186/src/new/qurt/semaphore.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/semaphore.rs rename to libc-0.2.186/src/new/qurt/semaphore.rs diff --git a/libc-0.2.185/src/new/qurt/signal.rs b/libc-0.2.186/src/new/qurt/signal.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/signal.rs rename to libc-0.2.186/src/new/qurt/signal.rs diff --git a/libc-0.2.185/src/new/qurt/stdio.rs b/libc-0.2.186/src/new/qurt/stdio.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/stdio.rs rename to libc-0.2.186/src/new/qurt/stdio.rs diff --git a/libc-0.2.185/src/new/qurt/stdlib.rs b/libc-0.2.186/src/new/qurt/stdlib.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/stdlib.rs rename to libc-0.2.186/src/new/qurt/stdlib.rs diff --git a/libc-0.2.185/src/new/qurt/sys/mman.rs b/libc-0.2.186/src/new/qurt/sys/mman.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/sys/mman.rs rename to libc-0.2.186/src/new/qurt/sys/mman.rs diff --git a/libc-0.2.185/src/new/qurt/sys/mod.rs b/libc-0.2.186/src/new/qurt/sys/mod.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/sys/mod.rs rename to libc-0.2.186/src/new/qurt/sys/mod.rs diff --git a/libc-0.2.185/src/new/qurt/sys/sched.rs b/libc-0.2.186/src/new/qurt/sys/sched.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/sys/sched.rs rename to libc-0.2.186/src/new/qurt/sys/sched.rs diff --git a/libc-0.2.185/src/new/qurt/sys/stat.rs b/libc-0.2.186/src/new/qurt/sys/stat.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/sys/stat.rs rename to libc-0.2.186/src/new/qurt/sys/stat.rs diff --git a/libc-0.2.185/src/new/qurt/sys/types.rs b/libc-0.2.186/src/new/qurt/sys/types.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/sys/types.rs rename to libc-0.2.186/src/new/qurt/sys/types.rs diff --git a/libc-0.2.185/src/new/qurt/time.rs b/libc-0.2.186/src/new/qurt/time.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/time.rs rename to libc-0.2.186/src/new/qurt/time.rs diff --git a/libc-0.2.185/src/new/qurt/unistd.rs b/libc-0.2.186/src/new/qurt/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/qurt/unistd.rs rename to libc-0.2.186/src/new/qurt/unistd.rs diff --git a/libc-0.2.185/src/new/redox/mod.rs b/libc-0.2.186/src/new/redox/mod.rs similarity index 100% rename from libc-0.2.185/src/new/redox/mod.rs rename to libc-0.2.186/src/new/redox/mod.rs diff --git a/libc-0.2.185/src/new/relibc/mod.rs b/libc-0.2.186/src/new/relibc/mod.rs similarity index 100% rename from libc-0.2.185/src/new/relibc/mod.rs rename to libc-0.2.186/src/new/relibc/mod.rs diff --git a/libc-0.2.185/src/new/relibc/unistd.rs b/libc-0.2.186/src/new/relibc/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/relibc/unistd.rs rename to libc-0.2.186/src/new/relibc/unistd.rs diff --git a/libc-0.2.185/src/new/rtems/mod.rs b/libc-0.2.186/src/new/rtems/mod.rs similarity index 100% rename from libc-0.2.185/src/new/rtems/mod.rs rename to libc-0.2.186/src/new/rtems/mod.rs diff --git a/libc-0.2.185/src/new/sgx/mod.rs b/libc-0.2.186/src/new/sgx/mod.rs similarity index 100% rename from libc-0.2.185/src/new/sgx/mod.rs rename to libc-0.2.186/src/new/sgx/mod.rs diff --git a/libc-0.2.185/src/new/sgx/unistd.rs b/libc-0.2.186/src/new/sgx/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/sgx/unistd.rs rename to libc-0.2.186/src/new/sgx/unistd.rs diff --git a/libc-0.2.185/src/new/solaris/mod.rs b/libc-0.2.186/src/new/solaris/mod.rs similarity index 100% rename from libc-0.2.185/src/new/solaris/mod.rs rename to libc-0.2.186/src/new/solaris/mod.rs diff --git a/libc-0.2.185/src/new/solaris/unistd.rs b/libc-0.2.186/src/new/solaris/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/solaris/unistd.rs rename to libc-0.2.186/src/new/solaris/unistd.rs diff --git a/libc-0.2.185/src/new/solid/mod.rs b/libc-0.2.186/src/new/solid/mod.rs similarity index 100% rename from libc-0.2.185/src/new/solid/mod.rs rename to libc-0.2.186/src/new/solid/mod.rs diff --git a/libc-0.2.185/src/new/teeos/mod.rs b/libc-0.2.186/src/new/teeos/mod.rs similarity index 100% rename from libc-0.2.185/src/new/teeos/mod.rs rename to libc-0.2.186/src/new/teeos/mod.rs diff --git a/libc-0.2.185/src/new/trusty/mod.rs b/libc-0.2.186/src/new/trusty/mod.rs similarity index 100% rename from libc-0.2.185/src/new/trusty/mod.rs rename to libc-0.2.186/src/new/trusty/mod.rs diff --git a/libc-0.2.185/src/new/uclibc/mod.rs b/libc-0.2.186/src/new/uclibc/mod.rs similarity index 100% rename from libc-0.2.185/src/new/uclibc/mod.rs rename to libc-0.2.186/src/new/uclibc/mod.rs diff --git a/libc-0.2.185/src/new/uclibc/pthread.rs b/libc-0.2.186/src/new/uclibc/pthread.rs similarity index 100% rename from libc-0.2.185/src/new/uclibc/pthread.rs rename to libc-0.2.186/src/new/uclibc/pthread.rs diff --git a/libc-0.2.185/src/new/uclibc/unistd.rs b/libc-0.2.186/src/new/uclibc/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/uclibc/unistd.rs rename to libc-0.2.186/src/new/uclibc/unistd.rs diff --git a/libc-0.2.185/src/new/ucrt/mod.rs b/libc-0.2.186/src/new/ucrt/mod.rs similarity index 100% rename from libc-0.2.185/src/new/ucrt/mod.rs rename to libc-0.2.186/src/new/ucrt/mod.rs diff --git a/libc-0.2.185/src/new/vita/mod.rs b/libc-0.2.186/src/new/vita/mod.rs similarity index 100% rename from libc-0.2.185/src/new/vita/mod.rs rename to libc-0.2.186/src/new/vita/mod.rs diff --git a/libc-0.2.185/src/new/vxworks/mod.rs b/libc-0.2.186/src/new/vxworks/mod.rs similarity index 100% rename from libc-0.2.185/src/new/vxworks/mod.rs rename to libc-0.2.186/src/new/vxworks/mod.rs diff --git a/libc-0.2.185/src/new/vxworks/unistd.rs b/libc-0.2.186/src/new/vxworks/unistd.rs similarity index 100% rename from libc-0.2.185/src/new/vxworks/unistd.rs rename to libc-0.2.186/src/new/vxworks/unistd.rs diff --git a/libc-0.2.185/src/new/wasi/mod.rs b/libc-0.2.186/src/new/wasi/mod.rs similarity index 100% rename from libc-0.2.185/src/new/wasi/mod.rs rename to libc-0.2.186/src/new/wasi/mod.rs diff --git a/libc-0.2.185/src/new/xous/mod.rs b/libc-0.2.186/src/new/xous/mod.rs similarity index 100% rename from libc-0.2.185/src/new/xous/mod.rs rename to libc-0.2.186/src/new/xous/mod.rs diff --git a/libc-0.2.185/src/primitives.rs b/libc-0.2.186/src/primitives.rs similarity index 100% rename from libc-0.2.185/src/primitives.rs rename to libc-0.2.186/src/primitives.rs diff --git a/libc-0.2.185/src/psp.rs b/libc-0.2.186/src/psp.rs similarity index 100% rename from libc-0.2.185/src/psp.rs rename to libc-0.2.186/src/psp.rs diff --git a/libc-0.2.185/src/qurt/mod.rs b/libc-0.2.186/src/qurt/mod.rs similarity index 100% rename from libc-0.2.185/src/qurt/mod.rs rename to libc-0.2.186/src/qurt/mod.rs diff --git a/libc-0.2.185/src/sgx.rs b/libc-0.2.186/src/sgx.rs similarity index 100% rename from libc-0.2.185/src/sgx.rs rename to libc-0.2.186/src/sgx.rs diff --git a/libc-0.2.185/src/solid/aarch64.rs b/libc-0.2.186/src/solid/aarch64.rs similarity index 100% rename from libc-0.2.185/src/solid/aarch64.rs rename to libc-0.2.186/src/solid/aarch64.rs diff --git a/libc-0.2.185/src/solid/arm.rs b/libc-0.2.186/src/solid/arm.rs similarity index 100% rename from libc-0.2.185/src/solid/arm.rs rename to libc-0.2.186/src/solid/arm.rs diff --git a/libc-0.2.185/src/solid/mod.rs b/libc-0.2.186/src/solid/mod.rs similarity index 100% rename from libc-0.2.185/src/solid/mod.rs rename to libc-0.2.186/src/solid/mod.rs diff --git a/libc-0.2.185/src/switch.rs b/libc-0.2.186/src/switch.rs similarity index 100% rename from libc-0.2.185/src/switch.rs rename to libc-0.2.186/src/switch.rs diff --git a/libc-0.2.185/src/teeos/mod.rs b/libc-0.2.186/src/teeos/mod.rs similarity index 100% rename from libc-0.2.185/src/teeos/mod.rs rename to libc-0.2.186/src/teeos/mod.rs diff --git a/libc-0.2.185/src/trusty.rs b/libc-0.2.186/src/trusty.rs similarity index 100% rename from libc-0.2.185/src/trusty.rs rename to libc-0.2.186/src/trusty.rs diff --git a/libc-0.2.185/src/types.rs b/libc-0.2.186/src/types.rs similarity index 100% rename from libc-0.2.185/src/types.rs rename to libc-0.2.186/src/types.rs diff --git a/libc-0.2.185/src/unix/aix/mod.rs b/libc-0.2.186/src/unix/aix/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/aix/mod.rs rename to libc-0.2.186/src/unix/aix/mod.rs diff --git a/libc-0.2.185/src/unix/aix/powerpc64.rs b/libc-0.2.186/src/unix/aix/powerpc64.rs similarity index 100% rename from libc-0.2.185/src/unix/aix/powerpc64.rs rename to libc-0.2.186/src/unix/aix/powerpc64.rs diff --git a/libc-0.2.185/src/unix/bsd/apple/b32/mod.rs b/libc-0.2.186/src/unix/bsd/apple/b32/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/apple/b32/mod.rs rename to libc-0.2.186/src/unix/bsd/apple/b32/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/apple/b64/aarch64/mod.rs b/libc-0.2.186/src/unix/bsd/apple/b64/aarch64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/apple/b64/aarch64/mod.rs rename to libc-0.2.186/src/unix/bsd/apple/b64/aarch64/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/apple/b64/mod.rs b/libc-0.2.186/src/unix/bsd/apple/b64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/apple/b64/mod.rs rename to libc-0.2.186/src/unix/bsd/apple/b64/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/apple/b64/x86_64/mod.rs b/libc-0.2.186/src/unix/bsd/apple/b64/x86_64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/apple/b64/x86_64/mod.rs rename to libc-0.2.186/src/unix/bsd/apple/b64/x86_64/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/apple/mod.rs b/libc-0.2.186/src/unix/bsd/apple/mod.rs similarity index 99% rename from libc-0.2.185/src/unix/bsd/apple/mod.rs rename to libc-0.2.186/src/unix/bsd/apple/mod.rs index d42f0ab16f..ff0e24a90a 100644 --- a/libc-0.2.185/src/unix/bsd/apple/mod.rs +++ b/libc-0.2.186/src/unix/bsd/apple/mod.rs @@ -3185,6 +3185,10 @@ pub const EV_ERROR: u16 = 0x4000; pub const EV_EOF: u16 = 0x8000; pub const EV_SYSFLAGS: u16 = 0xf000; +pub const KEVENT_FLAG_NONE: c_uint = 0x000000; +pub const KEVENT_FLAG_IMMEDIATE: c_uint = 0x000001; +pub const KEVENT_FLAG_ERROR_EVENTS: c_uint = 0x000002; + pub const NOTE_TRIGGER: u32 = 0x01000000; pub const NOTE_FFNOP: u32 = 0x00000000; pub const NOTE_FFAND: u32 = 0x40000000; diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/dragonfly/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/dragonfly/mod.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/dragonfly/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/aarch64.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/aarch64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/aarch64.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/aarch64.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/arm.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/arm.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/arm.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/arm.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/mod.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/mod.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/powerpc.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/powerpc.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/powerpc.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/riscv64.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/riscv64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/riscv64.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/riscv64.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/x86.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/x86.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/x86.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/x86.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/freebsdlike/mod.rs b/libc-0.2.186/src/unix/bsd/freebsdlike/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/freebsdlike/mod.rs rename to libc-0.2.186/src/unix/bsd/freebsdlike/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/mod.rs b/libc-0.2.186/src/unix/bsd/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/mod.rs rename to libc-0.2.186/src/unix/bsd/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/mod.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/mod.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/aarch64.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/aarch64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/aarch64.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/aarch64.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/arm.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/arm.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/arm.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/arm.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/mips.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/mips.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/mips.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/mips.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/mod.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/mod.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/powerpc.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/powerpc.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/powerpc.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/powerpc.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/riscv64.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/riscv64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/riscv64.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/riscv64.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/sparc64.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/sparc64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/sparc64.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/sparc64.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/x86.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/x86.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/x86.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/x86.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/x86_64.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/x86_64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/netbsd/x86_64.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/netbsd/x86_64.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/aarch64.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/aarch64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/aarch64.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/aarch64.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/arm.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/arm.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/arm.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/arm.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/mips64.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/mips64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/mips64.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/mips64.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/mod.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/mod.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/mod.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/powerpc.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/powerpc.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/powerpc.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/powerpc.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/riscv64.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/riscv64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/riscv64.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/riscv64.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/sparc64.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/sparc64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/sparc64.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/sparc64.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/x86.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/x86.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/x86.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/x86.rs diff --git a/libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/x86_64.rs b/libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/x86_64.rs similarity index 100% rename from libc-0.2.185/src/unix/bsd/netbsdlike/openbsd/x86_64.rs rename to libc-0.2.186/src/unix/bsd/netbsdlike/openbsd/x86_64.rs diff --git a/libc-0.2.185/src/unix/cygwin/mod.rs b/libc-0.2.186/src/unix/cygwin/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/cygwin/mod.rs rename to libc-0.2.186/src/unix/cygwin/mod.rs diff --git a/libc-0.2.185/src/unix/haiku/b32.rs b/libc-0.2.186/src/unix/haiku/b32.rs similarity index 100% rename from libc-0.2.185/src/unix/haiku/b32.rs rename to libc-0.2.186/src/unix/haiku/b32.rs diff --git a/libc-0.2.185/src/unix/haiku/b64.rs b/libc-0.2.186/src/unix/haiku/b64.rs similarity index 100% rename from libc-0.2.185/src/unix/haiku/b64.rs rename to libc-0.2.186/src/unix/haiku/b64.rs diff --git a/libc-0.2.185/src/unix/haiku/bsd.rs b/libc-0.2.186/src/unix/haiku/bsd.rs similarity index 100% rename from libc-0.2.185/src/unix/haiku/bsd.rs rename to libc-0.2.186/src/unix/haiku/bsd.rs diff --git a/libc-0.2.185/src/unix/haiku/mod.rs b/libc-0.2.186/src/unix/haiku/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/haiku/mod.rs rename to libc-0.2.186/src/unix/haiku/mod.rs diff --git a/libc-0.2.185/src/unix/haiku/native.rs b/libc-0.2.186/src/unix/haiku/native.rs similarity index 100% rename from libc-0.2.185/src/unix/haiku/native.rs rename to libc-0.2.186/src/unix/haiku/native.rs diff --git a/libc-0.2.185/src/unix/haiku/x86_64.rs b/libc-0.2.186/src/unix/haiku/x86_64.rs similarity index 100% rename from libc-0.2.185/src/unix/haiku/x86_64.rs rename to libc-0.2.186/src/unix/haiku/x86_64.rs diff --git a/libc-0.2.185/src/unix/hurd/b32.rs b/libc-0.2.186/src/unix/hurd/b32.rs similarity index 100% rename from libc-0.2.185/src/unix/hurd/b32.rs rename to libc-0.2.186/src/unix/hurd/b32.rs diff --git a/libc-0.2.185/src/unix/hurd/b64.rs b/libc-0.2.186/src/unix/hurd/b64.rs similarity index 100% rename from libc-0.2.185/src/unix/hurd/b64.rs rename to libc-0.2.186/src/unix/hurd/b64.rs diff --git a/libc-0.2.185/src/unix/hurd/mod.rs b/libc-0.2.186/src/unix/hurd/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/hurd/mod.rs rename to libc-0.2.186/src/unix/hurd/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/android/b32/arm.rs b/libc-0.2.186/src/unix/linux_like/android/b32/arm.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/android/b32/arm.rs rename to libc-0.2.186/src/unix/linux_like/android/b32/arm.rs diff --git a/libc-0.2.185/src/unix/linux_like/android/b32/mod.rs b/libc-0.2.186/src/unix/linux_like/android/b32/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/android/b32/mod.rs rename to libc-0.2.186/src/unix/linux_like/android/b32/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/android/b32/x86/mod.rs b/libc-0.2.186/src/unix/linux_like/android/b32/x86/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/android/b32/x86/mod.rs rename to libc-0.2.186/src/unix/linux_like/android/b32/x86/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/android/b64/aarch64/mod.rs b/libc-0.2.186/src/unix/linux_like/android/b64/aarch64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/android/b64/aarch64/mod.rs rename to libc-0.2.186/src/unix/linux_like/android/b64/aarch64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/android/b64/mod.rs b/libc-0.2.186/src/unix/linux_like/android/b64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/android/b64/mod.rs rename to libc-0.2.186/src/unix/linux_like/android/b64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/android/b64/riscv64/mod.rs b/libc-0.2.186/src/unix/linux_like/android/b64/riscv64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/android/b64/riscv64/mod.rs rename to libc-0.2.186/src/unix/linux_like/android/b64/riscv64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/android/b64/x86_64/mod.rs b/libc-0.2.186/src/unix/linux_like/android/b64/x86_64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/android/b64/x86_64/mod.rs rename to libc-0.2.186/src/unix/linux_like/android/b64/x86_64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/android/mod.rs b/libc-0.2.186/src/unix/linux_like/android/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/android/mod.rs rename to libc-0.2.186/src/unix/linux_like/android/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/emscripten/lfs64.rs b/libc-0.2.186/src/unix/linux_like/emscripten/lfs64.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/emscripten/lfs64.rs rename to libc-0.2.186/src/unix/linux_like/emscripten/lfs64.rs diff --git a/libc-0.2.185/src/unix/linux_like/emscripten/mod.rs b/libc-0.2.186/src/unix/linux_like/emscripten/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/emscripten/mod.rs rename to libc-0.2.186/src/unix/linux_like/emscripten/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/l4re/mod.rs b/libc-0.2.186/src/unix/linux_like/l4re/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/l4re/mod.rs rename to libc-0.2.186/src/unix/linux_like/l4re/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/l4re/uclibc/aarch64/mod.rs b/libc-0.2.186/src/unix/linux_like/l4re/uclibc/aarch64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/l4re/uclibc/aarch64/mod.rs rename to libc-0.2.186/src/unix/linux_like/l4re/uclibc/aarch64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/l4re/uclibc/mod.rs b/libc-0.2.186/src/unix/linux_like/l4re/uclibc/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/l4re/uclibc/mod.rs rename to libc-0.2.186/src/unix/linux_like/l4re/uclibc/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/l4re/uclibc/x86_64/mod.rs b/libc-0.2.186/src/unix/linux_like/l4re/uclibc/x86_64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/l4re/uclibc/x86_64/mod.rs rename to libc-0.2.186/src/unix/linux_like/l4re/uclibc/x86_64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/arch/generic/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/arch/generic/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/arch/generic/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/arch/generic/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/arch/mips/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/arch/mips/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/arch/mips/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/arch/mips/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/arch/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/arch/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/arch/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/arch/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/arch/powerpc/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/arch/powerpc/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/arch/powerpc/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/arch/powerpc/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/arch/sparc/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/arch/sparc/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/arch/sparc/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/arch/sparc/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b32/arm/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b32/arm/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b32/arm/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b32/csky/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b32/csky/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b32/csky/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b32/csky/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b32/mips/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b32/mips/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b32/mips/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b32/mips/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b32/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b32/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b32/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b32/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b32/powerpc.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b32/powerpc.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b32/powerpc.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b32/x86/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b32/x86/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b32/x86/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/s390x.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/s390x.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/s390x.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/s390x.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/gnu/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/gnu/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/gnu/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/gnu/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/mod.rs similarity index 99% rename from libc-0.2.185/src/unix/linux_like/linux/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/mod.rs index 9a1432e4e9..e58849b4e0 100644 --- a/libc-0.2.185/src/unix/linux_like/linux/mod.rs +++ b/libc-0.2.186/src/unix/linux_like/linux/mod.rs @@ -1644,6 +1644,8 @@ pub const PR_SET_MDWE: c_int = 65; pub const PR_GET_MDWE: c_int = 66; pub const PR_MDWE_REFUSE_EXEC_GAIN: c_uint = 1 << 0; pub const PR_MDWE_NO_INHERIT: c_uint = 1 << 1; +pub const PR_SET_MEMORY_MERGE: c_int = 67; +pub const PR_GET_MEMORY_MERGE: c_int = 68; pub const GRND_NONBLOCK: c_uint = 0x0001; pub const GRND_RANDOM: c_uint = 0x0002; diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b32/arm/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b32/arm/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b32/arm/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b32/arm/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b32/hexagon.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b32/hexagon.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b32/hexagon.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b32/hexagon.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b32/mips/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b32/mips/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b32/mips/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b32/mips/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b32/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b32/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b32/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b32/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b32/powerpc.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b32/powerpc.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b32/powerpc.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b32/powerpc.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b32/x86/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b32/x86/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b32/x86/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b32/x86/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b64/mips64.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b64/mips64.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b64/mips64.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b64/mips64.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b64/powerpc64.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b64/powerpc64.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b64/powerpc64.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b64/powerpc64.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b64/s390x.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b64/s390x.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b64/s390x.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b64/s390x.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b64/wasm32/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b64/wasm32/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b64/wasm32/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b64/wasm32/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b64/wasm32/wali.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b64/wasm32/wali.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b64/wasm32/wali.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b64/wasm32/wali.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/lfs64.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/lfs64.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/lfs64.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/lfs64.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/musl/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/musl/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/musl/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/musl/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/uclibc/arm/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/uclibc/arm/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/uclibc/arm/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/uclibc/arm/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/uclibc/mips/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/uclibc/mips/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/uclibc/mips/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/uclibc/mips/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/uclibc/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/uclibc/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/uclibc/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/uclibc/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux/uclibc/x86_64/mod.rs b/libc-0.2.186/src/unix/linux_like/linux/uclibc/x86_64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux/uclibc/x86_64/mod.rs rename to libc-0.2.186/src/unix/linux_like/linux/uclibc/x86_64/mod.rs diff --git a/libc-0.2.185/src/unix/linux_like/linux_l4re_shared.rs b/libc-0.2.186/src/unix/linux_like/linux_l4re_shared.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/linux_l4re_shared.rs rename to libc-0.2.186/src/unix/linux_like/linux_l4re_shared.rs diff --git a/libc-0.2.185/src/unix/linux_like/mod.rs b/libc-0.2.186/src/unix/linux_like/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/linux_like/mod.rs rename to libc-0.2.186/src/unix/linux_like/mod.rs diff --git a/libc-0.2.185/src/unix/mod.rs b/libc-0.2.186/src/unix/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/mod.rs rename to libc-0.2.186/src/unix/mod.rs diff --git a/libc-0.2.185/src/unix/newlib/aarch64/mod.rs b/libc-0.2.186/src/unix/newlib/aarch64/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/newlib/aarch64/mod.rs rename to libc-0.2.186/src/unix/newlib/aarch64/mod.rs diff --git a/libc-0.2.185/src/unix/newlib/arm/mod.rs b/libc-0.2.186/src/unix/newlib/arm/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/newlib/arm/mod.rs rename to libc-0.2.186/src/unix/newlib/arm/mod.rs diff --git a/libc-0.2.185/src/unix/newlib/espidf/mod.rs b/libc-0.2.186/src/unix/newlib/espidf/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/newlib/espidf/mod.rs rename to libc-0.2.186/src/unix/newlib/espidf/mod.rs diff --git a/libc-0.2.185/src/unix/newlib/generic.rs b/libc-0.2.186/src/unix/newlib/generic.rs similarity index 100% rename from libc-0.2.185/src/unix/newlib/generic.rs rename to libc-0.2.186/src/unix/newlib/generic.rs diff --git a/libc-0.2.185/src/unix/newlib/horizon/mod.rs b/libc-0.2.186/src/unix/newlib/horizon/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/newlib/horizon/mod.rs rename to libc-0.2.186/src/unix/newlib/horizon/mod.rs diff --git a/libc-0.2.185/src/unix/newlib/mod.rs b/libc-0.2.186/src/unix/newlib/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/newlib/mod.rs rename to libc-0.2.186/src/unix/newlib/mod.rs diff --git a/libc-0.2.185/src/unix/newlib/powerpc/mod.rs b/libc-0.2.186/src/unix/newlib/powerpc/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/newlib/powerpc/mod.rs rename to libc-0.2.186/src/unix/newlib/powerpc/mod.rs diff --git a/libc-0.2.185/src/unix/newlib/rtems/mod.rs b/libc-0.2.186/src/unix/newlib/rtems/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/newlib/rtems/mod.rs rename to libc-0.2.186/src/unix/newlib/rtems/mod.rs diff --git a/libc-0.2.185/src/unix/newlib/vita/mod.rs b/libc-0.2.186/src/unix/newlib/vita/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/newlib/vita/mod.rs rename to libc-0.2.186/src/unix/newlib/vita/mod.rs diff --git a/libc-0.2.185/src/unix/nto/aarch64.rs b/libc-0.2.186/src/unix/nto/aarch64.rs similarity index 100% rename from libc-0.2.185/src/unix/nto/aarch64.rs rename to libc-0.2.186/src/unix/nto/aarch64.rs diff --git a/libc-0.2.185/src/unix/nto/mod.rs b/libc-0.2.186/src/unix/nto/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/nto/mod.rs rename to libc-0.2.186/src/unix/nto/mod.rs diff --git a/libc-0.2.185/src/unix/nto/neutrino.rs b/libc-0.2.186/src/unix/nto/neutrino.rs similarity index 100% rename from libc-0.2.185/src/unix/nto/neutrino.rs rename to libc-0.2.186/src/unix/nto/neutrino.rs diff --git a/libc-0.2.185/src/unix/nto/x86_64.rs b/libc-0.2.186/src/unix/nto/x86_64.rs similarity index 100% rename from libc-0.2.185/src/unix/nto/x86_64.rs rename to libc-0.2.186/src/unix/nto/x86_64.rs diff --git a/libc-0.2.185/src/unix/nuttx/mod.rs b/libc-0.2.186/src/unix/nuttx/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/nuttx/mod.rs rename to libc-0.2.186/src/unix/nuttx/mod.rs diff --git a/libc-0.2.185/src/unix/redox/mod.rs b/libc-0.2.186/src/unix/redox/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/redox/mod.rs rename to libc-0.2.186/src/unix/redox/mod.rs diff --git a/libc-0.2.185/src/unix/solarish/compat.rs b/libc-0.2.186/src/unix/solarish/compat.rs similarity index 100% rename from libc-0.2.185/src/unix/solarish/compat.rs rename to libc-0.2.186/src/unix/solarish/compat.rs diff --git a/libc-0.2.185/src/unix/solarish/illumos.rs b/libc-0.2.186/src/unix/solarish/illumos.rs similarity index 100% rename from libc-0.2.185/src/unix/solarish/illumos.rs rename to libc-0.2.186/src/unix/solarish/illumos.rs diff --git a/libc-0.2.185/src/unix/solarish/mod.rs b/libc-0.2.186/src/unix/solarish/mod.rs similarity index 100% rename from libc-0.2.185/src/unix/solarish/mod.rs rename to libc-0.2.186/src/unix/solarish/mod.rs diff --git a/libc-0.2.185/src/unix/solarish/solaris.rs b/libc-0.2.186/src/unix/solarish/solaris.rs similarity index 100% rename from libc-0.2.185/src/unix/solarish/solaris.rs rename to libc-0.2.186/src/unix/solarish/solaris.rs diff --git a/libc-0.2.185/src/unix/solarish/x86.rs b/libc-0.2.186/src/unix/solarish/x86.rs similarity index 100% rename from libc-0.2.185/src/unix/solarish/x86.rs rename to libc-0.2.186/src/unix/solarish/x86.rs diff --git a/libc-0.2.185/src/unix/solarish/x86_64.rs b/libc-0.2.186/src/unix/solarish/x86_64.rs similarity index 100% rename from libc-0.2.185/src/unix/solarish/x86_64.rs rename to libc-0.2.186/src/unix/solarish/x86_64.rs diff --git a/libc-0.2.185/src/unix/solarish/x86_common.rs b/libc-0.2.186/src/unix/solarish/x86_common.rs similarity index 100% rename from libc-0.2.185/src/unix/solarish/x86_common.rs rename to libc-0.2.186/src/unix/solarish/x86_common.rs diff --git a/libc-0.2.185/src/vxworks/aarch64.rs b/libc-0.2.186/src/vxworks/aarch64.rs similarity index 100% rename from libc-0.2.185/src/vxworks/aarch64.rs rename to libc-0.2.186/src/vxworks/aarch64.rs diff --git a/libc-0.2.185/src/vxworks/arm.rs b/libc-0.2.186/src/vxworks/arm.rs similarity index 100% rename from libc-0.2.185/src/vxworks/arm.rs rename to libc-0.2.186/src/vxworks/arm.rs diff --git a/libc-0.2.185/src/vxworks/mod.rs b/libc-0.2.186/src/vxworks/mod.rs similarity index 100% rename from libc-0.2.185/src/vxworks/mod.rs rename to libc-0.2.186/src/vxworks/mod.rs diff --git a/libc-0.2.185/src/vxworks/powerpc.rs b/libc-0.2.186/src/vxworks/powerpc.rs similarity index 100% rename from libc-0.2.185/src/vxworks/powerpc.rs rename to libc-0.2.186/src/vxworks/powerpc.rs diff --git a/libc-0.2.185/src/vxworks/powerpc64.rs b/libc-0.2.186/src/vxworks/powerpc64.rs similarity index 100% rename from libc-0.2.185/src/vxworks/powerpc64.rs rename to libc-0.2.186/src/vxworks/powerpc64.rs diff --git a/libc-0.2.185/src/vxworks/riscv32.rs b/libc-0.2.186/src/vxworks/riscv32.rs similarity index 100% rename from libc-0.2.185/src/vxworks/riscv32.rs rename to libc-0.2.186/src/vxworks/riscv32.rs diff --git a/libc-0.2.185/src/vxworks/riscv64.rs b/libc-0.2.186/src/vxworks/riscv64.rs similarity index 100% rename from libc-0.2.185/src/vxworks/riscv64.rs rename to libc-0.2.186/src/vxworks/riscv64.rs diff --git a/libc-0.2.185/src/vxworks/x86.rs b/libc-0.2.186/src/vxworks/x86.rs similarity index 100% rename from libc-0.2.185/src/vxworks/x86.rs rename to libc-0.2.186/src/vxworks/x86.rs diff --git a/libc-0.2.185/src/vxworks/x86_64.rs b/libc-0.2.186/src/vxworks/x86_64.rs similarity index 100% rename from libc-0.2.185/src/vxworks/x86_64.rs rename to libc-0.2.186/src/vxworks/x86_64.rs diff --git a/libc-0.2.185/src/wasi/mod.rs b/libc-0.2.186/src/wasi/mod.rs similarity index 100% rename from libc-0.2.185/src/wasi/mod.rs rename to libc-0.2.186/src/wasi/mod.rs diff --git a/libc-0.2.185/src/wasi/p2.rs b/libc-0.2.186/src/wasi/p2.rs similarity index 100% rename from libc-0.2.185/src/wasi/p2.rs rename to libc-0.2.186/src/wasi/p2.rs diff --git a/libc-0.2.185/src/windows/gnu/mod.rs b/libc-0.2.186/src/windows/gnu/mod.rs similarity index 100% rename from libc-0.2.185/src/windows/gnu/mod.rs rename to libc-0.2.186/src/windows/gnu/mod.rs diff --git a/libc-0.2.185/src/windows/mod.rs b/libc-0.2.186/src/windows/mod.rs similarity index 100% rename from libc-0.2.185/src/windows/mod.rs rename to libc-0.2.186/src/windows/mod.rs diff --git a/libc-0.2.185/src/windows/msvc/mod.rs b/libc-0.2.186/src/windows/msvc/mod.rs similarity index 100% rename from libc-0.2.185/src/windows/msvc/mod.rs rename to libc-0.2.186/src/windows/msvc/mod.rs diff --git a/libc-0.2.185/src/xous.rs b/libc-0.2.186/src/xous.rs similarity index 100% rename from libc-0.2.185/src/xous.rs rename to libc-0.2.186/src/xous.rs diff --git a/libc-0.2.185/tests/const_fn.rs b/libc-0.2.186/tests/const_fn.rs similarity index 100% rename from libc-0.2.185/tests/const_fn.rs rename to libc-0.2.186/tests/const_fn.rs diff --git a/nibble_vec-0.1.0/.cargo-checksum.json b/nibble_vec-0.1.0/.cargo-checksum.json new file mode 100644 index 0000000000..96d5e70618 --- /dev/null +++ b/nibble_vec-0.1.0/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"d69c6735e3998ee4ada7786a87d61d720868f79cc6de069b6e9f3d3ab217bd56",".travis.yml":"8247684a3c4939a0a60aa319d338b2033fae4ddf4fe8fe11ff1f7f6c40ba841e","CHANGELOG.md":"479ecc970a05b376560b258933f10250e620b41add0be0c36be1163107778c1c","Cargo.lock":"ecd8fe29060490b49a9c755c755a2e1bd3c067648b9ea60a8b6ec46c90d7038d","Cargo.toml":"22caa2f8dd06a1cb902ce807dc9b67996c947422190b7ae96aec1e799e28058f","Cargo.toml.orig":"8bba3eb56dfe5b4c9f0aec4a64323ada2ccf91574b64fc08aac7731a4bf92823","LICENSE":"e4e06f4bee6b18fbe6ab33b26331739a0b2bda0c1037cfa869e7d97512e9fcf7","README.md":"cbc998295ee8d7d6c5ab51c113df05a97d354aff79d690cc92b8019300961e0f","benches/nib_bench.rs":"e532ccb6a5c7d2a9bd6030dd18cef9c30ee7b765cde674236b4d3e93460f50ea","examples/debug.rs":"97f2c42913e8aa1a33fb60b9a930f5d6b190658484f3fe83f0f6cc56976ad30c","src/lib.rs":"c020c9ae28accc69d86f856e9a4973858b4e46e5951856ce4550d057fad6eed6","src/test.rs":"758b48af39226cb18b3da62a79da03ab0fed321d5d2012c35c2aa95b5dedf960"},"package":"77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43"} \ No newline at end of file diff --git a/nibble_vec-0.1.0/.cargo_vcs_info.json b/nibble_vec-0.1.0/.cargo_vcs_info.json new file mode 100644 index 0000000000..440768ec47 --- /dev/null +++ b/nibble_vec-0.1.0/.cargo_vcs_info.json @@ -0,0 +1,5 @@ +{ + "git": { + "sha1": "7b8ab556683ee134e5f1d6e41ae681cb51afa54b" + } +} diff --git a/nibble_vec-0.1.0/.travis.yml b/nibble_vec-0.1.0/.travis.yml new file mode 100644 index 0000000000..eb59e26995 --- /dev/null +++ b/nibble_vec-0.1.0/.travis.yml @@ -0,0 +1,9 @@ +language: rust +os: + - linux +before_script: + - rustup component add rustfmt +script: + - cargo fmt --all -- --check + - cargo test --verbose + - cargo doc --no-deps diff --git a/nibble_vec-0.1.0/CHANGELOG.md b/nibble_vec-0.1.0/CHANGELOG.md new file mode 100644 index 0000000000..1064c86cd3 --- /dev/null +++ b/nibble_vec-0.1.0/CHANGELOG.md @@ -0,0 +1,15 @@ +Changelog +==== + +0.1.0: + * Semver-corrected re-release of 0.0.5 + * Released 28/06/2020 + +0.0.5 (YANKED): + * Yanked 28/06/2020 due to semver-incompatible version change + * Released 27/06/2020 + * Optimise implementation by using `SmallVec` (thanks @DevinR528) + +0.0.4: + * Released 07/11/2017 + * Implement `From` and `Into` conversion traits diff --git a/nibble_vec-0.1.0/Cargo.lock b/nibble_vec-0.1.0/Cargo.lock new file mode 100644 index 0000000000..8b5f934eda --- /dev/null +++ b/nibble_vec-0.1.0/Cargo.lock @@ -0,0 +1,601 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bstr" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-automata 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bumpalo" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cast" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "clap" +version = "2.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "criterion" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion-plot 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "oorandom 11.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "plotters 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)", + "tinytemplate 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "criterion-plot" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "csv" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bstr 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "either" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hermit-abi" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "js-sys" +version = "0.3.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wasm-bindgen 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.71" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memoffset" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +dependencies = [ + "criterion 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "oorandom" +version = "11.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "plotters" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "js-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon-core" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "1.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-automata" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde_derive" +version = "1.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "smallvec" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "syn" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tinytemplate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-width" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bumpalo 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.63" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "web-sys" +version = "0.3.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "js-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum bstr 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" +"checksum bumpalo 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +"checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" +"checksum criterion 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "63f696897c88b57f4ffe3c69d8e1a0613c7d0e6c4833363c8560fbde9c47b966" +"checksum criterion-plot 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ddeaf7989f00f2e1d871a26a110f3ed713632feac17f65f03ca938c542618b60" +"checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +"checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +"checksum crossbeam-queue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +"checksum csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +"checksum csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +"checksum hermit-abi 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "b9586eedd4ce6b3c498bc3b4dd92fc9f11166aa908a914071953768066c67909" +"checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +"checksum itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +"checksum js-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "ce10c23ad2ea25ceca0093bd3192229da4c5b3c0f2de499c1ecac0d98d452177" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)" = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" +"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +"checksum memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" +"checksum num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +"checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +"checksum oorandom 11.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a170cebd8021a008ea92e4db85a72f80b35df514ec664b296fdcbb654eac0b2c" +"checksum plotters 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d1685fbe7beba33de0330629da9d955ac75bd54f33d7b79f9a895590124f6bb" +"checksum proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" +"checksum quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +"checksum rayon 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "62f02856753d04e03e26929f820d0a0a337ebe71f849801eea335d464b349080" +"checksum rayon-core 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e92e15d89083484e11353891f1af602cc661426deb9564c298b270c726973280" +"checksum regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +"checksum regex-automata 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +"checksum regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)" = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum serde 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)" = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" +"checksum serde_derive 1.0.114 (registry+https://github.com/rust-lang/crates.io-index)" = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" +"checksum serde_json 1.0.55 (registry+https://github.com/rust-lang/crates.io-index)" = "ec2c5d7e739bc07a3e73381a39d61fdb5f671c60c1df26a130690665803d8226" +"checksum smallvec 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" +"checksum syn 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)" = "e8d5d96e8cbb005d6959f119f773bfaebb5684296108fb32600c00cde305b2cd" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum tinytemplate 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d3dc76004a03cec1c5932bca4cdc2e39aaa798e3f82363dd94f9adf6098c12f" +"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" +"checksum unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +"checksum wasm-bindgen 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)" = "4c2dc4aa152834bc334f506c1a06b866416a8b6697d5c9f75b9a689c8486def0" +"checksum wasm-bindgen-backend 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)" = "ded84f06e0ed21499f6184df0e0cb3494727b0c5da89534e0fcc55c51d812101" +"checksum wasm-bindgen-macro 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)" = "838e423688dac18d73e31edce74ddfac468e37b1506ad163ffaf0a46f703ffe3" +"checksum wasm-bindgen-macro-support 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)" = "3156052d8ec77142051a533cdd686cba889537b213f948cd1d20869926e68e92" +"checksum wasm-bindgen-shared 0.2.63 (registry+https://github.com/rust-lang/crates.io-index)" = "c9ba19973a58daf4db6f352eda73dc0e289493cd29fb2632eb172085b6521acd" +"checksum web-sys 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "7b72fe77fd39e4bd3eaa4412fd299a0be6b3dfe9d2597e2f1c20beb968f41d17" +"checksum winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/nibble_vec-0.1.0/Cargo.toml b/nibble_vec-0.1.0/Cargo.toml new file mode 100644 index 0000000000..34ef22680f --- /dev/null +++ b/nibble_vec-0.1.0/Cargo.toml @@ -0,0 +1,40 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +edition = "2018" +name = "nibble_vec" +version = "0.1.0" +authors = ["Michael Sproul "] +description = "Vector data-structure for half-byte values." +documentation = "https://docs.rs/rust_nibble_vec" +readme = "README.md" +keywords = ["vector", "nibble", "slice", "data-structure", "collection"] +categories = ["data-structures"] +license = "MIT" +repository = "https://github.com/michaelsproul/rust_nibble_vec" + +[lib] +bench = false + +[[bench]] +name = "nib_bench" +harness = false +[dependencies.smallvec] +version = "1.0" +[dev-dependencies.criterion] +version = "0.3" +[badges.maintenance] +status = "as-is" + +[badges.travis-ci] +repository = "michaelsproul/rust_nibble_vec" diff --git a/nibble_vec-0.1.0/Cargo.toml.orig b/nibble_vec-0.1.0/Cargo.toml.orig new file mode 100644 index 0000000000..fd8132563d --- /dev/null +++ b/nibble_vec-0.1.0/Cargo.toml.orig @@ -0,0 +1,33 @@ +[package] + +name = "nibble_vec" +version = "0.1.0" +description = "Vector data-structure for half-byte values." + +license = "MIT" +authors = ["Michael Sproul "] + +repository = "https://github.com/michaelsproul/rust_nibble_vec" +documentation = "https://docs.rs/rust_nibble_vec" +readme = "README.md" + +keywords = ["vector", "nibble", "slice", "data-structure", "collection"] +categories = ["data-structures"] +edition = "2018" + +[dependencies] +smallvec = "1.0" + +[dev-dependencies] +criterion = "0.3" + +[[bench]] +name = "nib_bench" +harness = false + +[lib] +bench = false + +[badges] +travis-ci = { repository = "michaelsproul/rust_nibble_vec" } +maintenance = { status = "as-is" } diff --git a/nibble_vec-0.1.0/LICENSE b/nibble_vec-0.1.0/LICENSE new file mode 100644 index 0000000000..12ca847896 --- /dev/null +++ b/nibble_vec-0.1.0/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Michael Sproul + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/nibble_vec-0.1.0/README.md b/nibble_vec-0.1.0/README.md new file mode 100644 index 0000000000..7bef87c0f3 --- /dev/null +++ b/nibble_vec-0.1.0/README.md @@ -0,0 +1,42 @@ +NibbleVec +==== + +[![Build Status](https://travis-ci.org/michaelsproul/rust_nibble_vec.svg)](https://travis-ci.org/michaelsproul/rust_nibble_vec) + +Data-structure for storing a sequence of half-bytes. + +Wraps a `Vec`, providing safe and memory-efficient storage of 4-bit values. + +In terms of supported operations, the structure behaves kind of like a fixed length array, in that insertions into the middle of the vector are difficult (and unimplemented at present). + +## Usage + +This code is available on the Rust package host: + +https://crates.io/crates/nibble_vec + +You can use it in your own projects by adding `nibble_vec` as a dependency in your `Cargo.toml`. + +```toml +[dependencies] +nibble_vec = "0.0.5" +``` + +## Documentation + +API documentation is available here: + +https://docs.rs/nibble_vec + +## Contributors + +Made by: + +* Alexander Andreev ([@andreevlex](https://github.com/andreevlex)) +* Devin Ragotzy ([@DevinR528](https://github.com/DevinR528)) +* Michael Sproul ([@michaelsproul](https://github.com/michaelsproul)) +* Vinzent Steinberg ([@vks](https://github.com/vks)) + +## License + +MIT License. Copyright © Michael Sproul and contributors 2015-present. diff --git a/nibble_vec-0.1.0/benches/nib_bench.rs b/nibble_vec-0.1.0/benches/nib_bench.rs new file mode 100644 index 0000000000..3494870c89 --- /dev/null +++ b/nibble_vec-0.1.0/benches/nib_bench.rs @@ -0,0 +1,99 @@ +use criterion::{criterion_group, criterion_main, Criterion}; +use nibble_vec::Nibblet; + +fn even_8to5() -> Nibblet { + Nibblet::from_byte_vec(vec![8 << 4 | 7, 6 << 4 | 5]) +} + +fn odd_11to9() -> Nibblet { + let mut result = Nibblet::from_byte_vec(vec![11 << 4 | 10]); + result.push(9); + result +} + +fn split_test(nibble_vec: &Nibblet, idx: usize) { + let mut init = nibble_vec.clone(); + let _tail = init.split(idx); +} + +fn nib_split_even_bench(b: &mut Criterion) { + let even_length = even_8to5(); + b.bench_function("nibvec split even", |b| { + b.iter(|| { + split_test(&even_length, 1); + split_test(&even_length, 2); + }) + }); +} + +fn nib_make_split_bench(b: &mut Criterion) { + b.bench_function("nibvec split odd", |b| { + let odd_length = odd_11to9(); + b.iter(|| { + split_test(&odd_length, 0); + split_test(&odd_length, 1); + }) + }); +} + +fn nib_get_bench(b: &mut Criterion) { + b.bench_function("nib get on vec of 9 elements", |b| { + let v = vec![243, 2, 3, 251, 5, 6, 7, 8, 255]; + let nv = Nibblet::from(v.clone()); + b.iter(|| { + for (i, _) in v.iter().enumerate() { + nv.get(i); + } + }) + }); +} + +fn join_test(vec1: &Nibblet, vec2: &Nibblet) { + let _joined = vec1.clone().join(vec2); +} + +fn nib_join_bench(b: &mut Criterion) { + b.bench_function("join even nibvec to odd nib", |b| { + b.iter(|| { + let v1 = even_8to5(); + let v2 = odd_11to9(); + join_test(&v1, &v2); + join_test(&v1, &v1); + }); + }); +} + +fn nib_from_into_bench(b: &mut Criterion) { + b.bench_function("nib from vec and into vec", |b| { + b.iter(|| { + let x = vec![10, 11, 12, 13, 14, 15, 16]; + let nv = Nibblet::from_byte_vec(x); + let v: Vec = nv.into(); + let _nv2 = Nibblet::from(v); + }); + }); +} + +fn nib_cmp_bench(b: &mut Criterion) { + b.bench_function("bench eq and not eq", |b| { + let nv = Nibblet::from_byte_vec(vec![10, 11, 12, 13, 14, 15, 16]); + let nv_eq = Nibblet::from_byte_vec(vec![10, 11, 12, 13, 14, 15, 16]); + let nv_not_eq = Nibblet::from_byte_vec(vec![1, 1, 2, 3, 4, 5, 6]); + b.iter(|| { + let _a = nv == nv_eq; + let _b = nv == nv_not_eq; + let _c = nv_eq != nv_not_eq; + }); + }); +} + +criterion_group!( + benches, + nib_split_even_bench, + nib_make_split_bench, + nib_join_bench, + nib_get_bench, + nib_from_into_bench, + nib_cmp_bench +); +criterion_main!(benches); diff --git a/nibble_vec-0.1.0/examples/debug.rs b/nibble_vec-0.1.0/examples/debug.rs new file mode 100644 index 0000000000..c709828bbb --- /dev/null +++ b/nibble_vec-0.1.0/examples/debug.rs @@ -0,0 +1,9 @@ +extern crate nibble_vec; + +use nibble_vec::Nibblet; + +fn main() { + let mut v = Nibblet::from_byte_vec(vec![1 << 4 | 11, 2 << 4 | 12, 3 << 4 | 13]); + v.push(4); + println!("{:?}", v); +} diff --git a/nibble_vec-0.1.0/src/lib.rs b/nibble_vec-0.1.0/src/lib.rs new file mode 100644 index 0000000000..9c824ef3a2 --- /dev/null +++ b/nibble_vec-0.1.0/src/lib.rs @@ -0,0 +1,334 @@ +#[cfg(test)] +mod test; + +use smallvec::{Array, SmallVec}; + +use std::convert::{From, Into}; +use std::fmt::{self, Debug, Formatter}; +use std::iter::FromIterator; + +/// A `NibbleVec` backed by a `SmallVec` with 64 inline element slots. +/// This will not allocate until more than 64 elements are added. +pub type Nibblet = NibbleVec<[u8; 64]>; + +/// A data-structure for storing a sequence of 4-bit values. +/// +/// Values are stored in a `Vec`, with two values per byte. +/// +/// Values at even indices are stored in the most-significant half of their byte, +/// while values at odd indices are stored in the least-significant half. +/// +/// Imagine a vector of [MSB][msb-wiki] first bytes, and you'll be right. +/// +/// n = [_ _ | _ _ | _ _] +/// +/// [msb-wiki]: http://en.wikipedia.org/wiki/Most_significant_bit +#[derive(Clone, Default)] +pub struct NibbleVec> { + length: usize, + data: SmallVec, +} + +impl> NibbleVec { + /// Create an empty nibble vector. + pub fn new() -> NibbleVec { + NibbleVec { + length: 0, + data: SmallVec::new(), + } + } + + /// Create a nibble vector from a vector of bytes. + /// + /// Each byte is split into two 4-bit entries (MSB, LSB). + #[inline] + pub fn from_byte_vec(vec: Vec) -> NibbleVec { + let length = 2 * vec.len(); + NibbleVec { + length, + data: SmallVec::from_iter(vec), + } + } + + /// Returns a byte slice of the nibble vector's contents. + #[inline] + pub fn as_bytes(&self) -> &[u8] { + &self.data[..] + } + + /// Converts a nibble vector into a byte vector. + /// + /// This consumes the nibble vector, so we do not need to copy its contents. + #[inline] + pub fn into_bytes(self) -> Vec { + self.data.to_vec() + } + + /// Get the number of elements stored in the vector. + #[inline] + pub fn len(&self) -> usize { + self.length + } + + /// Returns `true` if the nibble vector has a length of 0. + #[inline] + pub fn is_empty(&self) -> bool { + self.data.is_empty() + } + + /// Fetch a single entry from the vector. + /// + /// Guaranteed to be a value in the interval [0, 15]. + /// + /// **Panics** if `idx >= self.len()`. + #[inline] + pub fn get(&self, idx: usize) -> u8 { + if idx >= self.length { + panic!( + "NibbleVec index out of bounds: len is {}, index is {}", + self.length, idx + ); + } + let vec_idx = idx / 2; + match idx % 2 { + // If the index is even, take the first (most significant) half of the stored byte. + 0 => self.data[vec_idx] >> 4, + // If the index is odd, take the second (least significant) half. + _ => self.data[vec_idx] & 0x0F, + } + } + + /// Add a single nibble to the vector. + /// + /// Only the 4 least-significant bits of the value are used. + #[inline] + pub fn push(&mut self, val: u8) { + if self.length % 2 == 0 { + self.data.push(val << 4); + } else { + let vec_len = self.data.len(); + + // Zero the second half of the last byte just to be safe. + self.data[vec_len - 1] &= 0xF0; + + // Write the new value. + self.data[vec_len - 1] |= val & 0x0F; + } + self.length += 1; + } + + /// Split the vector into two parts. + /// + /// All elements at or following the given index are returned in a new `NibbleVec`, + /// with exactly `idx` elements remaining in this vector. + /// + /// **Panics** if `idx > self.len()`. + pub fn split(&mut self, idx: usize) -> NibbleVec { + // assert! is a few percent slower surprisingly + if idx > self.length { + panic!( + "attempted to split past vector end. len is {}, index is {}", + self.length, idx + ); + } else if idx == self.length { + NibbleVec::new() + } else if idx % 2 == 0 { + self.split_even(idx) + } else { + self.split_odd(idx) + } + } + + /// Split function for odd *indices*. + #[inline] + fn split_odd(&mut self, idx: usize) -> NibbleVec { + let mut tail = NibbleVec::new(); + + // Perform an overlap copy, copying the last nibble of the original vector only if + // the length of the new tail is *odd*. + let tail_length = self.length - idx; + let take_last = tail_length % 2 == 1; + self.overlap_copy( + idx / 2, + self.data.len(), + &mut tail.data, + &mut tail.length, + take_last, + ); + + // Remove the copied bytes, being careful to skip the idx byte. + for _ in (idx / 2 + 1)..self.data.len() { + self.data.pop(); + } + + // Zero the second half of the index byte so as to maintain the last-nibble invariant. + self.data[idx / 2] &= 0xF0; + + // Update the length of the first NibbleVec. + self.length = idx; + + tail + } + + /// Split function for even *indices*. + #[inline] + fn split_even(&mut self, idx: usize) -> NibbleVec { + // Avoid allocating a temporary vector by copying all the bytes in order, then popping them. + + // Possible to prove: l_d - ⌊i / 2⌋ = ⌊(l_v - i + 1) / 2⌋ + // where l_d = self.data.len() + // l_v = self.length + + let half_idx = idx / 2; + let mut tail = NibbleVec::new(); + + // Copy the bytes. + for i in half_idx..self.data.len() { + tail.data.push(self.data[i]); + } + + // Pop the same bytes. + for _ in half_idx..self.data.len() { + self.data.pop(); + } + + // Update lengths. + tail.length = self.length - idx; + self.length = idx; + + tail + } + + /// Copy data between the second half of self.data[start] and + /// self.data[end - 1]. The second half of the last entry is included + /// if include_last is true. + #[inline] + fn overlap_copy( + &self, + start: usize, + end: usize, + vec: &mut SmallVec, + length: &mut usize, + include_last: bool, + ) { + // Copy up to the first half of the last byte. + for i in start..(end - 1) { + // The first half is the second half of the old entry. + let first_half = self.data[i] & 0x0f; + + // The second half is the first half of the next entry. + let second_half = self.data[i + 1] >> 4; + + vec.push((first_half << 4) | second_half); + *length += 2; + } + + if include_last { + let last = self.data[end - 1] & 0x0f; + vec.push(last << 4); + *length += 1; + } + } + + /// Append another nibble vector whilst consuming this vector. + #[inline] + pub fn join(mut self, other: &NibbleVec) -> NibbleVec { + // If the length is even, we can append directly. + if self.length % 2 == 0 { + self.length += other.length; + self.data.extend_from_slice(&other.data); + return self; + } + + // If the other vector is empty, bail out. + if other.is_empty() { + return self; + } + + // If the length is odd, we have to perform an overlap copy. + // Copy the first half of the first element, to make the vector an even length. + self.push(other.get(0)); + + // Copy the rest of the vector using an overlap copy. + let take_last = other.len() % 2 == 0; + other.overlap_copy( + 0, + other.data.len(), + &mut self.data, + &mut self.length, + take_last, + ); + + self + } +} + +impl> PartialEq> for NibbleVec { + #[inline] + fn eq(&self, other: &NibbleVec) -> bool { + self.length == other.length && self.data == other.data + } +} + +impl> Eq for NibbleVec {} + +/// Compare a `NibbleVec` and a slice of bytes *element-by-element*. +/// Bytes are **not** interpreted as two `NibbleVec` entries. +impl> PartialEq<[u8]> for NibbleVec { + #[inline] + fn eq(&self, other: &[u8]) -> bool { + if other.len() != self.len() { + return false; + } + + for (i, x) in other.iter().enumerate() { + if self.get(i) != *x { + return false; + } + } + true + } +} + +impl> Debug for NibbleVec { + fn fmt(&self, fmt: &mut Formatter) -> fmt::Result { + write!(fmt, "NibbleVec [")?; + + if !self.is_empty() { + write!(fmt, "{}", self.get(0))?; + } + + for i in 1..self.len() { + write!(fmt, ", {}", self.get(i))?; + } + write!(fmt, "]") + } +} + +impl> From> for NibbleVec { + #[inline] + fn from(v: Vec) -> NibbleVec { + NibbleVec::from_byte_vec(v) + } +} + +impl<'a, A: Array> From<&'a [u8]> for NibbleVec { + #[inline] + fn from(v: &[u8]) -> NibbleVec { + NibbleVec::from_byte_vec(v.into()) + } +} + +impl> Into> for NibbleVec { + #[inline] + fn into(self) -> Vec { + self.data.to_vec() + } +} + +impl<'a, A: Array> Into> for &'a NibbleVec { + #[inline] + fn into(self) -> Vec { + self.data.to_vec() + } +} diff --git a/nibble_vec-0.1.0/src/test.rs b/nibble_vec-0.1.0/src/test.rs new file mode 100644 index 0000000000..e906e21f2d --- /dev/null +++ b/nibble_vec-0.1.0/src/test.rs @@ -0,0 +1,144 @@ +use crate::{NibbleVec, Nibblet}; + +fn v8_7_6_5() -> Nibblet { + NibbleVec::from_byte_vec(vec![8 << 4 | 7, 6 << 4 | 5]) +} + +fn v11_10_9() -> Nibblet { + let mut result = Nibblet::from_byte_vec(vec![11 << 4 | 10]); + result.push(9); + result +} + +#[test] +fn get() { + let nv = Nibblet::from_byte_vec(vec![3 << 4 | 7]); + assert_eq!(nv.get(0), 3u8); + assert_eq!(nv.get(1), 7u8); +} + +#[test] +fn push() { + let mut nv = Nibblet::new(); + let data = vec![0, 1, 3, 5, 7, 9, 11, 15]; + for val in data.iter() { + nv.push(*val); + } + + for (i, val) in data.iter().enumerate() { + assert_eq!(nv.get(i), *val); + } +} + +fn split_test(nibble_vec: &Nibblet, idx: usize, first: Vec, second: Vec) { + let mut init = nibble_vec.clone(); + let tail = init.split(idx); + assert!(init == first[..]); + assert!(tail == second[..]); +} + +#[test] +fn split_even_length() { + let even_length = v8_7_6_5(); + split_test(&even_length, 0, vec![], vec![8, 7, 6, 5]); + split_test(&even_length, 1, vec![8], vec![7, 6, 5]); + split_test(&even_length, 2, vec![8, 7], vec![6, 5]); + split_test(&even_length, 4, vec![8, 7, 6, 5], vec![]); +} + +#[test] +fn split_odd_length() { + let odd_length = v11_10_9(); + split_test(&odd_length, 0, vec![], vec![11, 10, 9]); + split_test(&odd_length, 1, vec![11], vec![10, 9]); + split_test(&odd_length, 2, vec![11, 10], vec![9]); + split_test(&odd_length, 3, vec![11, 10, 9], vec![]); +} + +/// Join vec2 onto vec1 and ensure that the results matches the one expected. +fn join_test(vec1: &Nibblet, vec2: &Nibblet, result: Vec) { + let joined = vec1.clone().join(vec2); + assert!(joined == result[..]); +} + +#[test] +fn join_even_length() { + let v1 = v8_7_6_5(); + let v2 = v11_10_9(); + join_test(&v1, &v2, vec![8, 7, 6, 5, 11, 10, 9]); + join_test(&v1, &v1, vec![8, 7, 6, 5, 8, 7, 6, 5]); + join_test(&v1, &Nibblet::new(), vec![8, 7, 6, 5]); + join_test(&Nibblet::new(), &v1, vec![8, 7, 6, 5]); +} + +#[test] +fn join_odd_length() { + let v1 = v8_7_6_5(); + let v2 = v11_10_9(); + join_test(&v2, &v1, vec![11, 10, 9, 8, 7, 6, 5]); + join_test(&v2, &v2, vec![11, 10, 9, 11, 10, 9]); + join_test(&v2, &Nibblet::new(), vec![11, 10, 9]); +} + +#[test] +fn clone() { + #[allow(clippy::redundant_clone)] + let v1 = v8_7_6_5().clone(); + assert_eq!(v1.len(), 4); +} + +/// Ensure that the last nibble is zeroed before reuse. +#[test] +fn memory_reuse() { + let mut vec = Nibblet::new(); + vec.push(10); + vec.push(1); + // Pushing. + vec.split(1); + vec.push(2); + assert_eq!(vec.get(1), 2); + + // Joining. + vec.split(1); + vec = vec.join(&Nibblet::from_byte_vec(vec![1 << 4 | 3, 5 << 4])); + assert_eq!(vec.get(1), 1); +} + +#[test] +fn from() { + let v = vec![243, 2, 3, 251, 5, 6, 7, 8, 255]; + let n = Nibblet::from_byte_vec(v.clone()); + let n2 = Nibblet::from(&v[..]); + assert_eq!(n, n2); + let n3 = Nibblet::from(v); + assert_eq!(n, n3); +} + +#[test] +fn into() { + let v = vec![243, 2, 3, 251, 5, 6, 7, 8, 255]; + { + let n = Nibblet::from_byte_vec(v.clone()); + let v2: Vec = n.into(); + assert_eq!(v, v2); + } + { + let n = Nibblet::from_byte_vec(v.clone()); + let v2: Vec = (&n).into(); + assert_eq!(v, v2); + } +} + +#[test] +fn as_bytes() { + let v = vec![243, 2, 3, 251, 5, 6, 7, 8, 255]; + let n = Nibblet::from(&v[..]); + assert_eq!(&v[..], n.as_bytes()); +} + +#[test] +fn into_bytes() { + let v = vec![243, 2, 3, 251, 5, 6, 7, 8, 255]; + let n = Nibblet::from(&v[..]); + assert_eq!(v, n.into_bytes()); +} diff --git a/num-conv-0.2.2/.cargo-checksum.json b/num-conv-0.2.2/.cargo-checksum.json new file mode 100644 index 0000000000..14cd6b2318 --- /dev/null +++ b/num-conv-0.2.2/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"d6796518ecb4a22c4fa88353e4fa621353f944a0a79a61152c419bdc0b8a1ab1","Cargo.lock":"5e8bc520f9f81d5820f9e46d46f1abf22a6d402ba29a74292eb422aa3f5f7194","Cargo.toml":"ecd9eaa1fb85eb5c739bce95bf50387e018e3b3f0d109e97416111acbb190028","Cargo.toml.orig":"59aa824bbf80cc75cd8c3056f67c1ca43b9452130831d53d907c967790128531","LICENSE-Apache":"0d542e0c8804e39aa7f37eb00da5a762149dc682d7829451287e11b938e94594","LICENSE-MIT":"e2e245f2b566d0bfafb0f6a04c16b82d710c4e6e7d799e39bb4ef6e541b85b98","README.md":"b06b19b8a6dec1dfa913e035ba9f99e04fd6a1a170a86fa03d9d3b9fb03c7de0","src/lib.rs":"3d341469c5f036f5b7aca71752a24cfd3d834ecfab1c570b26eb6a2676a8e388"},"package":"521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"} \ No newline at end of file diff --git a/num-conv-0.2.2/.cargo_vcs_info.json b/num-conv-0.2.2/.cargo_vcs_info.json new file mode 100644 index 0000000000..1e10874f1e --- /dev/null +++ b/num-conv-0.2.2/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "b022fe87ac3ad5b0d7606ea7465549eaa92efe97" + }, + "path_in_vcs": "" +} \ No newline at end of file diff --git a/num-conv-0.2.2/Cargo.lock b/num-conv-0.2.2/Cargo.lock new file mode 100644 index 0000000000..9cf559c1ad --- /dev/null +++ b/num-conv-0.2.2/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "num-conv" +version = "0.2.2" diff --git a/num-conv-0.2.2/Cargo.toml b/num-conv-0.2.2/Cargo.toml new file mode 100644 index 0000000000..0d3b6dd29b --- /dev/null +++ b/num-conv-0.2.2/Cargo.toml @@ -0,0 +1,65 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2021" +rust-version = "1.57.0" +name = "num-conv" +version = "0.2.2" +authors = ["Jacob Pratt "] +build = false +include = [ + "src/**/*", + "LICENSE-*", +] +autolib = false +autobins = false +autoexamples = false +autotests = false +autobenches = false +description = """ +`num_conv` is a crate to convert between integer types without using `as` casts. This provides +better certainty when refactoring, makes the exact behavior of code more explicit, and allows using +turbofish syntax. +""" +readme = "README.md" +keywords = [ + "cast", + "extend", + "truncate", + "convert", + "integer", +] +categories = [ + "no-std", + "no-std::no-alloc", + "rust-patterns", +] +license = "MIT OR Apache-2.0" +repository = "https://github.com/jhpratt/num-conv" + +[package.metadata.docs.rs] +rustdoc-args = ["--generate-link-to-definition"] + +[features] + +[lib] +name = "num_conv" +path = "src/lib.rs" + +[lints.clippy] +alloc-instead-of-core = "deny" +std-instead-of-core = "deny" + +[lints.rust] +missing-docs = "warn" +unreachable-pub = "warn" +unused = "warn" diff --git a/num-conv-0.2.2/Cargo.toml.orig b/num-conv-0.2.2/Cargo.toml.orig new file mode 100644 index 0000000000..ac0228cb8b --- /dev/null +++ b/num-conv-0.2.2/Cargo.toml.orig @@ -0,0 +1,31 @@ +[package] +name = "num-conv" +version = "0.2.2" +authors = ["Jacob Pratt "] +edition = "2021" +rust-version = "1.57.0" +repository = "https://github.com/jhpratt/num-conv" +keywords = ["cast", "extend", "truncate", "convert", "integer"] +categories = ["no-std", "no-std::no-alloc", "rust-patterns"] +readme = "README.md" +license = "MIT OR Apache-2.0" +description = """ +`num_conv` is a crate to convert between integer types without using `as` casts. This provides +better certainty when refactoring, makes the exact behavior of code more explicit, and allows using +turbofish syntax. +""" +include = ["src/**/*", "LICENSE-*"] + +[package.metadata.docs.rs] +rustdoc-args = ["--generate-link-to-definition"] + +[features] + +[lints.rust] +missing-docs = "warn" +unreachable-pub = "warn" +unused = "warn" + +[lints.clippy] +alloc-instead-of-core = "deny" +std-instead-of-core = "deny" diff --git a/num-conv-0.2.2/LICENSE-Apache b/num-conv-0.2.2/LICENSE-Apache new file mode 100644 index 0000000000..f433b1a53f --- /dev/null +++ b/num-conv-0.2.2/LICENSE-Apache @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/num-conv-0.2.2/LICENSE-MIT b/num-conv-0.2.2/LICENSE-MIT new file mode 100644 index 0000000000..3738d287a7 --- /dev/null +++ b/num-conv-0.2.2/LICENSE-MIT @@ -0,0 +1,19 @@ +Copyright (c) Jacob Pratt + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/num-conv-0.2.2/README.md b/num-conv-0.2.2/README.md new file mode 100644 index 0000000000..97d5c8fd98 --- /dev/null +++ b/num-conv-0.2.2/README.md @@ -0,0 +1,6 @@ +# num-conv + +`num_conv` is a crate to convert between integer types without using `as` casts. This provides +better certainty when refactoring, makes the exact behavior of code more explicit, and allows using +turbofish syntax. The crate is currently in the process of being uplifted into the standard library; +see [rust-lang/rust#154330](https://github.com/rust-lang/rust/issues/154330) for details. diff --git a/num-conv-0.2.2/src/lib.rs b/num-conv-0.2.2/src/lib.rs new file mode 100644 index 0000000000..fbcac4c4c4 --- /dev/null +++ b/num-conv-0.2.2/src/lib.rs @@ -0,0 +1,354 @@ +//! `num_conv` is a crate to convert between integer types without using `as` casts. This provides +//! better certainty when refactoring, makes the exact behavior of code more explicit, and allows +//! using turbofish syntax. The crate is currently in the process of being uplifted into the +//! standard library; see [rust-lang/rust#154330](https://github.com/rust-lang/rust/issues/154330) +//! for details. + +#![no_std] + +/// Anonymously import all extension traits. +/// +/// This allows you to use the methods without worrying about polluting the namespace or importing +/// them individually. +/// +/// ```rust +/// use num_conv::prelude::*; +/// ``` +pub mod prelude { + #[allow(deprecated)] + pub use crate::{Extend as _, Truncate as _, Widen as _}; +} + +mod sealed { + pub trait Integer {} + + macro_rules! impl_integer { + ($($t:ty)*) => {$( + impl Integer for $t {} + )*}; + } + + impl_integer! { + u8 u16 u32 u64 u128 usize + i8 i16 i32 i64 i128 isize + } + + #[deprecated(since = "0.2.2", note = "use `WidenTargetSealed` instead")] + pub trait ExtendTargetSealed { + #[deprecated(since = "0.2.2", note = "use `widen` instead")] + fn extend(self) -> T; + } + + pub trait WidenTargetSealed { + fn widen(self) -> T; + } + + pub trait TruncateTargetSealed { + fn truncate(self) -> T; + fn saturating_truncate(self) -> T; + fn checked_truncate(self) -> Option; + } +} + +/// A type that can be used with turbofish syntax in [`Extend::extend`]. +/// +/// It is unlikely that you will want to use this trait directly. You are probably looking for the +/// [`Extend`] trait. +#[deprecated(since = "0.2.2", note = "use `WidenTarget` instead")] +#[allow(deprecated)] +pub trait ExtendTarget: sealed::ExtendTargetSealed {} + +/// A type that can be used with turbofish syntax in [`Widen::widen`]. +/// +/// It is unlikely that you will want to use this trait directly. You are probably looking for the +/// [`Widen`] trait. +pub trait WidenTarget: sealed::WidenTargetSealed {} + +/// A type that can be used with turbofish syntax in [`Truncate::truncate`]. +/// +/// It is unlikely that you will want to use this trait directly. You are probably looking for the +/// [`Truncate`] trait. +pub trait TruncateTarget: sealed::TruncateTargetSealed {} + +/// Widen to an integer of the same size or larger, preserving its value. +/// +/// ```rust +/// # use num_conv::Widen; +/// assert_eq!(0_u8.widen::(), 0_u16); +/// assert_eq!(0_u16.widen::(), 0_u32); +/// assert_eq!(0_u32.widen::(), 0_u64); +/// assert_eq!(0_u64.widen::(), 0_u128); +/// ``` +/// +/// ```rust +/// # use num_conv::Widen; +/// assert_eq!((-1_i8).widen::(), -1_i16); +/// assert_eq!((-1_i16).widen::(), -1_i32); +/// assert_eq!((-1_i32).widen::(), -1_i64); +/// assert_eq!((-1_i64).widen::(), -1_i128); +/// ``` +pub trait Widen: sealed::Integer { + /// Widen an integer to an integer of the same size or larger, preserving its value. + fn widen(self) -> T + where + Self: WidenTarget; +} + +impl Widen for T { + fn widen(self) -> U + where + T: WidenTarget, + { + sealed::WidenTargetSealed::widen(self) + } +} + +/// Extend to an integer of the same size or larger, preserving its value. +/// +/// ```rust +/// # use num_conv::Extend; +/// assert_eq!(0_u8.extend::(), 0_u16); +/// assert_eq!(0_u16.extend::(), 0_u32); +/// assert_eq!(0_u32.extend::(), 0_u64); +/// assert_eq!(0_u64.extend::(), 0_u128); +/// ``` +/// +/// ```rust +/// # use num_conv::Extend; +/// assert_eq!((-1_i8).extend::(), -1_i16); +/// assert_eq!((-1_i16).extend::(), -1_i32); +/// assert_eq!((-1_i32).extend::(), -1_i64); +/// assert_eq!((-1_i64).extend::(), -1_i128); +/// ``` +#[deprecated(since = "0.2.2", note = "use `Widen` instead")] +#[allow(deprecated)] +pub trait Extend: sealed::Integer { + /// Extend an integer to an integer of the same size or larger, preserving its value. + fn extend(self) -> T + where + Self: ExtendTarget; +} + +#[allow(deprecated)] +impl Extend for T { + fn extend(self) -> U + where + T: ExtendTarget, + { + sealed::ExtendTargetSealed::extend(self) + } +} + +/// Truncate to an integer of the same size or smaller. +/// +/// Preserve the least significant bits with `.truncate()`: +/// +/// ```rust +/// # use num_conv::Truncate; +/// assert_eq!(u16::MAX.truncate::(), u8::MAX); +/// assert_eq!(u32::MAX.truncate::(), u16::MAX); +/// assert_eq!(u64::MAX.truncate::(), u32::MAX); +/// assert_eq!(u128::MAX.truncate::(), u64::MAX); +/// ``` +/// +/// ```rust +/// # use num_conv::Truncate; +/// assert_eq!((-1_i16).truncate::(), -1_i8); +/// assert_eq!((-1_i32).truncate::(), -1_i16); +/// assert_eq!((-1_i64).truncate::(), -1_i32); +/// assert_eq!((-1_i128).truncate::(), -1_i64); +/// ``` +/// +/// Saturate to the numeric bounds with `.saturating_truncate()`: +/// +/// ```rust +/// # use num_conv::Truncate; +/// assert_eq!(500_u16.saturating_truncate::(), u8::MAX); +/// assert_eq!(u32::MAX.saturating_truncate::(), u16::MAX); +/// assert_eq!(u64::MAX.saturating_truncate::(), u32::MAX); +/// assert_eq!(u128::MAX.saturating_truncate::(), u64::MAX); +/// ``` +/// +/// ```rust +/// # use num_conv::Truncate; +/// assert_eq!((-500_i16).saturating_truncate::(), i8::MIN); +/// assert_eq!(i32::MIN.saturating_truncate::(), i16::MIN); +/// assert_eq!(i64::MIN.saturating_truncate::(), i32::MIN); +/// assert_eq!(i128::MIN.saturating_truncate::(), i64::MIN); +/// ``` +/// +/// Checked with `.checked_truncate()`, returning `None` if the value is out of range: +/// +/// ```rust +/// # use num_conv::Truncate; +/// assert_eq!(u16::MAX.checked_truncate::(), None); +/// assert_eq!(u32::MAX.checked_truncate::(), None); +/// assert_eq!(u64::MAX.checked_truncate::(), None); +/// assert_eq!(u128::MAX.checked_truncate::(), None); +/// ``` +/// +/// ```rust +/// # use num_conv::Truncate; +/// assert_eq!(i16::MIN.checked_truncate::(), None); +/// assert_eq!(i32::MIN.checked_truncate::(), None); +/// assert_eq!(i64::MIN.checked_truncate::(), None); +/// assert_eq!(i128::MIN.checked_truncate::(), None); +/// ``` +pub trait Truncate: sealed::Integer { + /// Truncate an integer to an integer of the same size or smaller, preserving the least + /// significant bits. + fn truncate(self) -> T + where + Self: TruncateTarget; + + /// Truncate an integer to an integer of the same size or smaller, saturating to the numeric + /// bounds instead of wrapping. + fn saturating_truncate(self) -> T + where + Self: TruncateTarget; + + /// Truncate an integer to an integer of the same size or smaller, returning `None` if the value + /// is out of range. + fn checked_truncate(self) -> Option + where + Self: TruncateTarget; +} + +impl Truncate for T { + fn truncate(self) -> U + where + T: TruncateTarget, + { + sealed::TruncateTargetSealed::truncate(self) + } + + fn saturating_truncate(self) -> U + where + T: TruncateTarget, + { + sealed::TruncateTargetSealed::saturating_truncate(self) + } + + fn checked_truncate(self) -> Option + where + T: TruncateTarget, + { + sealed::TruncateTargetSealed::checked_truncate(self) + } +} + +macro_rules! impl_widen { + ($($from:ty => $($to:ty),+;)*) => {$($( + const _: () = assert!( + core::mem::size_of::<$from>() <= core::mem::size_of::<$to>(), + concat!( + "cannot widen ", + stringify!($from), + " to ", + stringify!($to), + " because ", + stringify!($from), + " is larger than ", + stringify!($to) + ) + ); + + #[allow(deprecated)] + impl sealed::ExtendTargetSealed<$to> for $from { + #[inline] + fn extend(self) -> $to { + self as _ + } + } + + impl sealed::WidenTargetSealed<$to> for $from { + #[inline] + fn widen(self) -> $to { + self as _ + } + } + + #[allow(deprecated)] + impl ExtendTarget<$to> for $from {} + impl WidenTarget<$to> for $from {} + )+)*}; +} + +macro_rules! impl_truncate { + ($($($from:ty),+ => $to:ty;)*) => {$($( + const _: () = assert!( + core::mem::size_of::<$from>() >= core::mem::size_of::<$to>(), + concat!( + "cannot truncate ", + stringify!($from), + " to ", + stringify!($to), + " because ", + stringify!($from), + " is smaller than ", + stringify!($to) + ) + ); + + impl sealed::TruncateTargetSealed<$to> for $from { + #[inline] + fn truncate(self) -> $to { + self as _ + } + + #[inline] + fn saturating_truncate(self) -> $to { + if self > <$to>::MAX as _ { + <$to>::MAX + } else if self < <$to>::MIN as _ { + <$to>::MIN + } else { + self as _ + } + } + + #[inline] + fn checked_truncate(self) -> Option<$to> { + if self > <$to>::MAX as _ || self < <$to>::MIN as _ { + None + } else { + Some(self as _) + } + } + } + + impl TruncateTarget<$to> for $from {} + )+)*}; +} + +impl_widen! { + u8 => u8, u16, u32, u64, u128, usize; + u16 => u16, u32, u64, u128, usize; + u32 => u32, u64, u128; + u64 => u64, u128; + u128 => u128; + usize => usize; + + i8 => i8, i16, i32, i64, i128, isize; + i16 => i16, i32, i64, i128, isize; + i32 => i32, i64, i128; + i64 => i64, i128; + i128 => i128; + isize => isize; +} + +impl_truncate! { + u8, u16, u32, u64, u128, usize => u8; + u16, u32, u64, u128, usize => u16; + u32, u64, u128 => u32; + u64, u128 => u64; + u128 => u128; + usize => usize; + + i8, i16, i32, i64, i128, isize => i8; + i16, i32, i64, i128, isize => i16; + i32, i64, i128 => i32; + i64, i128 => i64; + i128 => i128; + isize => isize; +} diff --git a/prqlc-0.13.11/.cargo_vcs_info.json b/prqlc-0.13.11/.cargo_vcs_info.json deleted file mode 100644 index 581b55e5db..0000000000 --- a/prqlc-0.13.11/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "ea92e66c4a53d814477c45fe6d228c69c08a6bcd" - }, - "path_in_vcs": "prqlc/prqlc" -} \ No newline at end of file diff --git a/prqlc-0.13.11/.cargo-checksum.json b/prqlc-0.13.12/.cargo-checksum.json similarity index 79% rename from prqlc-0.13.11/.cargo-checksum.json rename to prqlc-0.13.12/.cargo-checksum.json index 577124ec5f..6ec5871072 100644 --- a/prqlc-0.13.11/.cargo-checksum.json +++ b/prqlc-0.13.12/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo_vcs_info.json":"c728ce835ce3d0993405ccdcbdc4fd12be6091fb2ebb7e6cd08848080c45a4cf","ARCHITECTURE.md":"29e3f72594797cd5a48e9ae2168873aef230c081397c4e0a4de9459bf7f81b20","Cargo.lock":"99df9d54f10de57f5e631b459f0a31e690613275e4e74c79af0f714c8e1e18d2","Cargo.toml":"1f28f639da24c036ffe511618b3cfafb0c91fa401215f108b2b4ca8afff1f061","Cargo.toml.orig":"8107e0684802ddeb49e8c4bf267b00069533493cfac74e9eaa8b3932329bfa3a","README.md":"55bb525c9e85f241099bca472b1c3bd12064cbfed6de155c8cf9fa2e09f578c1","benches/bench.rs":"8621d5c8bbdd6ef858c96426d9f62ec798188a0f4d53541f2b05d0e5138deadf","benches/bench_impl.rs":"710956d364d9c3c5f443315a41790e47ad61b8d2c13793d7b46377c767ab1feb","build.rs":"81e615d273932e59bdb3614a332f1af08853a88d6c998ffec8c039d0be9185d7","src/cli/docs_generator.rs":"ceeeda5ae8f3f38603b798140576ae3f326106dfd0e734d82440400063d948fe","src/cli/highlight.rs":"7e746122b6d84467662f7e2a6725a7c6d820eb8aacff18e9d4a5bf566ab82c01","src/cli/jinja.rs":"d20c04c912cf0a9fce5d4b442932a61a11dc6a862c3574f3641de7bf29a5cb6f","src/cli/lsp.rs":"b6ebece79cf70ebb68f1d1675b3205eb1aad1ce15bf6e628ba709752ede67d6b","src/cli/mod.rs":"526842fa6be50ebab809405cb88309003d8c3e6d4ef3288c8ea45e8f2e7b66e8","src/cli/snapshots/prqlc__cli__test__shell_completion-2.snap":"2ef83310923f5dc6d873720bc35da8dfac7490390e905805377310d12132a586","src/cli/snapshots/prqlc__cli__test__shell_completion-3.snap":"e56fb5a945dfe27f4c6de291d11241b9c19ab325e21b5f6c983b7b10ea0e7415","src/cli/snapshots/prqlc__cli__test__shell_completion-4.snap":"acf6d816bca50c546ac4949375599de13a6b29e582eb3c0943f5ec040fb7dd0b","src/cli/snapshots/prqlc__cli__test__shell_completion.snap":"bcbea3fa78a7fcfcbd826f4244bb8f2c7901643695265b4bf8015ee9e6b64503","src/cli/test.rs":"0c598e4aeac4f2787984e6ff17f02089026675dc8260261ea3d072fdcda5c7cd","src/cli/watch.rs":"f6ed50ee0dbf49beee4e7c9dfc01f714828f9177fdefc78e3bb369a69af12e52","src/codegen/ast.rs":"eae8b62725f54f2982a8c1291902ac9579aa8b117a636c9cd12e039bcb020c2c","src/codegen/mod.rs":"3632ab29e3b05ffa01877caf56cf87aa685a2fac16e9feb2a8d6841c23dd1e83","src/codegen/types.rs":"37c574417dbe176292780d31d65e1129bf7c06ad78ce50390944fe6861cf2921","src/debug/log.rs":"08f8b44c1d711e06d567f6c9d953f3e651551da36330afcd9a1923169c026200","src/debug/messages.rs":"fbd7a0fce7d90cdfc2427cb3ed58b6c21a848fca410300e6501ea4aaf3a333b1","src/debug/mod.rs":"b5c75608fa21ee088599c3803922736a3dbb74fd61a7bf2aef2172912ebc607e","src/debug/render_html.rs":"f20765591e1bc9ebbab79e528e32b48917dd93ba1cc8ec6c9136cd9a356ec54a","src/error_message.rs":"03b22b7e96a38937647f249e7b9afd3585c9651d5e6303046ecad7679c48d426","src/ir/decl.rs":"7156132d4b1f007a2bbc770de674a8cd19c39e2249b334741fda31da9747cd56","src/ir/generic.rs":"bcfd33d0faae6a2efaf79f4e7be2ce61c0676aee1c47947b87a895aa79d7618b","src/ir/mod.rs":"4a83c1df8f30f52ae8230304ea0defe7e669cf1c0060e638e8c0ec0989613571","src/ir/pl/expr.rs":"d3b1415a18ca6eadfafb560f65862632394df60b5379e31bda3d8d732c20167a","src/ir/pl/extra.rs":"98bbd48b65cae005e4d249918560cf85d86a4da9f6b66761f1607cac45ca5600","src/ir/pl/fold.rs":"f201556a8c2c1038b79897a386320121fb6d2990ebbfab2295cf7b7fb43972ff","src/ir/pl/lineage.rs":"a88bf0aef91878869a65480d55919560eea71c86976945f1128fbb228361bb9c","src/ir/pl/mod.rs":"df20046a24477a0d89d3f90a97e072b3142fed00b82c2ecbf2ae986de6a7aad8","src/ir/pl/stmt.rs":"022dc6dacc6e7b32a027411b42550a9a4d2c7ff6054efa44c628014555528b4c","src/ir/pl/utils.rs":"91e19b9741cf09c9529c8735258b0feb95231cb7e8963dc8cfcf29c7d6b78833","src/ir/rq/expr.rs":"1ddfa39798567c129db08854cd2ce7552c0b1cc9693327ef9ac6cbddd117fd20","src/ir/rq/fold.rs":"8af3b208bd80f85f7f0adbb43944b276f0f04b5d853c0da85e6833e5fb21b9bb","src/ir/rq/ids.rs":"0ae037816398a1e5d09471d1b153e2bdcf43760f4555fc26b0673eb4b0f32cad","src/ir/rq/mod.rs":"cf827d61a9e312f26562308f13fe3aa5ad95065ed22906926d63714e32f18a03","src/ir/rq/transform.rs":"90d6390a315bf802184dc5e47c86e24a97491a6cc7c4e0f211ee49768affc082","src/ir/rq/utils.rs":"a370f49c53e903cd7192ba4e1ed49ace99010d34f48abb0951a39621903260d5","src/lib.rs":"c10fc4596eebdfa6908153db7314d2cd7f975783dfaaec40dcb293288247440c","src/main.rs":"11c3be6045bbcdb0858b9c23726ae8eedce2a3fe942d408ffd461bc0f217e766","src/parser.rs":"ad6d3d0a0b6434e5784af17b7b78e8b3ea5ebff6e0a73f00e5e0ef988eb1ffc0","src/semantic/ast_expand.rs":"424cf628a92321e20583d81588ba3a0dd20e81c35bb48338219882216fee7c1b","src/semantic/lowering.rs":"7c844ab9894ea063a7a6c2e2864db27dd7adda9d24d6556d6995b40791fa56ca","src/semantic/mod.rs":"9e38af45fa915a0067614ac25788e232176739452994c050dc0b4fc20a83efc4","src/semantic/module.rs":"0dadc347428da2609189975de3b8ffd69cd84bb916225ce4ad291eb70555884a","src/semantic/reporting.rs":"4c68fb7b54760690944c437da0367d3ecc4e63c26193af59d512b75fc6982690","src/semantic/resolver/expr.rs":"5d004c5ba527e180d9a9bce72376a037e85cd04b9934a650081bdc673c1fd92a","src/semantic/resolver/flatten.rs":"29b900bc960902a6e6dc980392d1deab02983ab2a4970a1f27b2ee50b2849946","src/semantic/resolver/functions.rs":"11618af0cd64bf1ecc46f7780d3484b1f9e76a4b32b95c14b933f8b389fd37af","src/semantic/resolver/inference.rs":"52f4fda12e215e12683267d3e80bd23824ca2b201e77b5b45be5eb648b39eef5","src/semantic/resolver/mod.rs":"a8af2a0bc07d3a130ee98a3be173c462b12764ea00bce2b2f28c8a658932165a","src/semantic/resolver/names.rs":"777a37329d063eb0e1999442f0524996298e8750c5ce0018369c6b73446b2457","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap":"aabf289f55833533ce000ceb15a84daf817c826f0fa251e68bb00c1641269f79","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap":"24c3ad86f0abad139cd28a311c894135075dcfbf96e77f39c160cd25cc302e59","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap":"1709f8f5afbb5ee85a904f2c33c30a39b2e3fe391bcba895fb74a24185e5f452","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap":"7fed0f941eee3b94bee85d8de8d7522ee08006e6ec6ac627747b77e674f8ab60","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_1.snap":"cae80b205d8b3b4588e0683695fd6376afcdd51797e1b33c0f81e8cd6a420563","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_nested.snap":"149898913602c077f3322d0dc4f6ede862a218dac7be4ea1010b8528ee8f6890","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline-2.snap":"ba6ad917d827b5acffa69607926fe75bd59f66fd882b4708458877d02d2ea590","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline.snap":"a4719d326f9c73139c87b755f2b6937835dfe85187e842286395295d01054e75","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__named_args.snap":"cfdec057a2cc767d31346a5973c33cc9a804b769c896581a36e69fce965cd466","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__variables_1.snap":"938ef140e8976a5cfc0088ea0aeea252149c6347aa4a3cba2cf8b6ac9dc705e1","src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap":"49b90ac4f1304077d8a2d9f4f6f6a81db11ce69d8154b017ed641f55c354d7d7","src/semantic/resolver/static_eval.rs":"43ef18ddf6dd393e9326830714429f69f631774035e390364646f5385cc15900","src/semantic/resolver/stmt.rs":"125226630e80f17e5942f56208ecd794886e7de35b862c0758aa501e2491b1a1","src/semantic/resolver/transforms.rs":"daef45b1d39b959d85d6599d908337aa7d99bd0d2551dc18f2baeadd5695d3ad","src/semantic/resolver/types.rs":"4ee100adbf46806da0025307eee864573a4b1bd5ed90a85b451b836b3166b9ea","src/semantic/std.prql":"6d905461f0ed5149ab626f18ffc1bb27f61d701089a4a2d8d5e61787b670e90d","src/sql/dialect.rs":"99a259edd2f8ac464e0d3a0553a66343491be688aaf05a0048717ebacb92f94b","src/sql/gen_expr.rs":"df433eae3470135a8d1c5b41affcb829e1822ee2d42dea1012722da04dca17ea","src/sql/gen_projection.rs":"708abafe7a28d5e0854e2bc82d228adc9a86b17d632347077ecf2e6e60096a92","src/sql/gen_query.rs":"1bd5fbdf953a979330651dbc7f3d62f030f49c677cbe0174915e059af21732b4","src/sql/keywords.rs":"b830e84b26cb3b7a399933f1622f0f1bd391beb0b4ec5efacd992a4bc0e39e59","src/sql/mod.rs":"56eae605d041f82a51a9fa56a076930502b13c164664bda4e8d564c423c7191e","src/sql/operators.rs":"415ff31f2ae4e16c41a9ed21cb1ac07c57d78ef8a9e7fa149329bb5c60851b43","src/sql/pq/anchor.rs":"b7fded82f6b077cb5df202e2b7c2cf4ecacdae87ea7b24060d7321ce944bfbc0","src/sql/pq/ast.rs":"e4b90ec4f9446ed651e5c290be6bf005d72b38a8c41ea1ad05b2c19a2fb4f90d","src/sql/pq/context.rs":"53ba4b4eff3ad846a69984af04864a3fe3152078b9eef31aa331d907fc3ac668","src/sql/pq/gen_query.rs":"a5b10ce11ec4c3e9c7331564b26352ddad865126996944e7640dcf76569e09df","src/sql/pq/mod.rs":"9586631558e0b0571cb1d6578679bdd10908ed304561607b2590d49d02540d8e","src/sql/pq/positional_mapping.rs":"f46e56a6ac44664467643f59be15edde388d1be613c976966a9dba7d3d352e55","src/sql/pq/postprocess.rs":"1e2abe7fe52e13a20517aea1473124c688477974d9eb561417e6d22a24f1a00d","src/sql/pq/preprocess.rs":"104dc276756ac3accf298b9e2d3c5a6e3616fe2f52b8011d9e919e6e67d9c2b6","src/sql/std.sql.prql":"bd6f70ed185ad6eab90d66675eb1b7d89426c01a18210ae529793717637e361b","src/utils/id_gen.rs":"49056ef60d060357250c896650edcdffd84a312845f05b8cc59d6b2506af371a","src/utils/mod.rs":"ce8ed7337bbc825a0307d708d849515156728cafaeafdd8d7cc4f794868d14d8","src/utils/toposort.rs":"614042aa8e44a5541abe6de98af8e371d04fa0ecab41eb23642d1f9ff390470b","tests/CLAUDE.md":"66514a59d2f8a1403e06780ca14bf11639676553804d47f6ed308fd60813d413","tests/integration/bad_error_messages.rs":"577b57f5cb28e51030a194002eee0d7aa1dee9e6693f8481ce1a787ed4a29de8","tests/integration/data/chinook/albums.csv":"36386f9907eaec70a8f51bf6f36fc698bc2a5fe797be5b86f2743612b5164be8","tests/integration/data/chinook/artists.csv":"fb38e91f992a97816840d1b90b6dda8877377fbc01dbdd4bc24c1c39642fbda5","tests/integration/data/chinook/customers.csv":"065a991c1d7a9e01033ada04e76a3a0380b061fe4689770496f76ff9cf1df009","tests/integration/data/chinook/employees.csv":"3261cf3ede4cf5c1d0dddaf414c32de24f851b9ac5fbf3a49846cf7ee116b1ec","tests/integration/data/chinook/genres.csv":"a0e3d69c447ec0aa39718551fbcd7571ae36f7d084995dd8dc30ba159a0c91ad","tests/integration/data/chinook/invoice_items.csv":"42a9e26568ff3de18fe77f591545abcf620de5efa3e94d315cf584c5c075cbcb","tests/integration/data/chinook/invoices.csv":"4e3e5699b3fd37e3912f6db93558fc79ee0bb392b4dafbf2c2c02e345cea52e0","tests/integration/data/chinook/media_types.csv":"f6143c7ae051c8505ce857816fd52315ba9b87a2cdf2061fb45173af0d2df907","tests/integration/data/chinook/media_types.json":"caa83ff6318cdca9c78316e64ab15c1cfe801a854da4079bf275998069348e8b","tests/integration/data/chinook/playlist_track.csv":"cf30ff63de3d805a3d31e5c28766183f5df9690206635aa4769a6c3a7ebaeae5","tests/integration/data/chinook/playlists.csv":"947c4be6d972a41e8595babe6a50f580aac79235c5ae907817ecca65fe18a91c","tests/integration/data/chinook/schema.sql":"1b42532ca20a96edc881b972820fe3389f40d53a60f78cc098c2b3d7f7f8e35b","tests/integration/data/chinook/tracks.csv":"3a8cd199849ea9f36a1529d06cb83af49c4f8aa6377f19fe45a1cb6f0882c7f0","tests/integration/dbs/README.md":"f0d69c96a4364defaa1d7eaf83825b4713fa1bbfa67eaa5e964234178330b3e1","tests/integration/dbs/docker-compose.yaml":"88d9b8e73cfca3d13547a9fa7b0a2fab466439234368e1874c858c483340d3be","tests/integration/dbs/dockerfiles/glaredb.Dockerfile":"e0b62509a47cf31d6eed08595109c60e8b56791b14f055298dbf39dbf8414955","tests/integration/dbs/mod.rs":"cc7b18cb0dceecbbe82ecd60ef9f82597729433e24d066bdb9f395f828431dfd","tests/integration/dbs/protocol.rs":"3dd81abd13903468b48379f4cc435b696072c3327ecd0979f5a5504920737cfe","tests/integration/dbs/runner.rs":"e15ba054013aa7d04b2ae047f7ee3c4992ebe98dea4f2b1d3ad5811f3afdc93f","tests/integration/error_messages.rs":"a3130f305e9eee99a9debfb357d83fc445ef88300ec71b812e21d11e08df8f85","tests/integration/main.rs":"1ba589d65d84eff41a704f71489772e32d42ffa1e45bd24581080e370cf277ac","tests/integration/project/Project.prql":"1b10b8bd1fc57d952bfb077347a04b9ac70483a046c359b8d45aa4b6a1ffe683","tests/integration/project/artists.prql":"ff589527096caa1433a24e0659706fc76c2eec70aeb5d7c2b4e185bad5b316f3","tests/integration/queries.rs":"b6fec4ad19a57fbc854ca65eea39fc7b6293083421540899cc1f5d9dda3e9797","tests/integration/queries/aggregation.prql":"3dd1dada462a25605f8f51a28fbf00b4de10c2a02db00f94cd9d7ec24daa8e3f","tests/integration/queries/append_select.prql":"2aacdaab81c68635f73d4bb8f617b9f7aa42117e78db0d3d8308ba9d5c7fe929","tests/integration/queries/append_select_compute.prql":"e6732afe92fdacb7857bfcec6d7802363a070c9b79fef89347358c7b862276a6","tests/integration/queries/append_select_multiple_with_null.prql":"50868ae0fa062ac513714dd2f1eedd4a3ada23a1a9f7fb6fd360004e905e1208","tests/integration/queries/append_select_nulls.prql":"c9c5b581927c454f2bcbf97bda2092d60fdfec7df075aac33aea6e4fb8dea7be","tests/integration/queries/append_select_simple.prql":"cbcd0fefcf945ad1a75cc9d05fd9939039cd69d23b2bd99dbca1b75ebdea7b51","tests/integration/queries/arithmetic.prql":"cfae453c0657241f5afd380a95626b6eaf1e61765f072056630a47c373b4cfe5","tests/integration/queries/cast.prql":"8ef8a323be1fd45bcc1fea3621f2320c440f54da9c714ca6540e9fed5d00184e","tests/integration/queries/constants_only.prql":"651f34faa559e7c8a02265d4ff40d76a71d018a39baaba31f6d4858367777ffa","tests/integration/queries/date_to_text.prql":"6fa0144e3954653541f935704fda9802b4cbc882c9a4bcd851196debeb496724","tests/integration/queries/distinct.prql":"186ea006eb25456b77c76ef9eee3b29ad180271d1bbe871dfaeb57f6d4dcac54","tests/integration/queries/distinct_on.prql":"4e9578fda1867bbe80e83b3cc316ac77f1b6a370056b300343b006b13ef16c58","tests/integration/queries/genre_counts.prql":"7adda24c90a0c49aa108f798e3605c1a9556e94d4fbd3593daab3b4bddfbde83","tests/integration/queries/group_all.prql":"22c0d2123ea800b26e04d65e963dd0972285a4a322756beedb4668432aef568e","tests/integration/queries/group_sort.prql":"a3a545a83abb22de65be31637004ab8e7f10b6cb7b7a3179626fad9801da8998","tests/integration/queries/group_sort_derive_select_join.prql":"053ccf433faf9e6337a9d3f0a40f42dd371a685cf1d6ff547f74b37e1c44136a","tests/integration/queries/group_sort_filter_derive_select_join.prql":"768f49aa44cd1bed01f3f2ec0defc8800b62bab1c1e6a32b602df5ea07730a85","tests/integration/queries/group_sort_limit_take.prql":"eef5ecbf1bbb355723d70824022f9b1bc6a0b38315bad3a0e1422e9159a0e934","tests/integration/queries/invoice_totals.prql":"2326fd37e0bc4790da3ad8220f896e258592511856b4eda74822c404efccdb32","tests/integration/queries/loop_01.prql":"b7d12dad6b4e70783f45a22c17b746ac1586ed7cddb7668438fe1e2f69e3cc88","tests/integration/queries/math_module.prql":"d54d6e51013eb2d8605893471481f0d43265a3268e9d3d1dd14fe9b2a43bd332","tests/integration/queries/pipelines.prql":"925dc4540e08e79c1b3601ff28c592ff00fe9fd5f32a40d346f13e4528181849","tests/integration/queries/read_csv.prql":"610d19a0c778f643cdd698aa6203905d84f26d4b3b8512174ccdbc8f85eccaff","tests/integration/queries/set_ops_remove.prql":"e4739e2b9a5b210ab3c0f55c6dfc7279940aae6c75ec32913d6467a00d66d370","tests/integration/queries/sort.prql":"2ba3447e17b2704612dea9cb5a8262d695d1d18d69ef3c076c482c0713ec47f6","tests/integration/queries/sort_2.prql":"a15ee427291261c10c0fcea26191bf1a36d24a9f08593720017a419fae3b8a4c","tests/integration/queries/sort_3.prql":"d563410e670378d13ecf83804fb235bf698eef1d8979d5c81b22be62e963cfa5","tests/integration/queries/switch.prql":"80cf00bd6dc34ef672a5979718746bf80c95f69533c9c1b74ce3de0582e569a9","tests/integration/queries/take.prql":"10c859f2c43b001cc984eece564325cbb1b3dd467a9e84416246c083eefefdcc","tests/integration/queries/text_module.prql":"44301ba5d6932e1673038958d3f9354015642796d9b3a173f9ef56f75d3c9393","tests/integration/queries/window.prql":"269f99899a0915eb116c49286d1664e4210b09e0b79768dd11bcc2a687c15958","tests/integration/snapshots/integration__queries__compile__aggregation.snap":"60a3b3353bf73c6b0f58010d7ec5d06edae86c7860c6a8c8537dc5f35d7089bb","tests/integration/snapshots/integration__queries__compile__append_select.snap":"751d1581b5c228ad518bb4e65572d814309eff6526def7e9412daf45a0a4fc79","tests/integration/snapshots/integration__queries__compile__append_select_compute.snap":"145d735111258d232e163b28f47c2be14c67ab7af6ad36b078909693f5136f3a","tests/integration/snapshots/integration__queries__compile__append_select_multiple_with_null.snap":"c0d18b17cef029055340ae1a7c8bff72e753736e56dde22503e778f85040dad0","tests/integration/snapshots/integration__queries__compile__append_select_nulls.snap":"93eddfaaa888c59d4c4a8e1186d182304267866f30b658aadb95175996a4d221","tests/integration/snapshots/integration__queries__compile__append_select_simple.snap":"0be768482b1dea595bb586ba92ee3f0ae51d7d52eaea2e99d83cf8a6b68fee52","tests/integration/snapshots/integration__queries__compile__arithmetic.snap":"89ac226f33e669974df2fce1066bec391161b72c9dda558c1a0601ffc43f7ad2","tests/integration/snapshots/integration__queries__compile__cast.snap":"8801612a83adbded148448c5f9a433fd26a6a9dd0a0c8a95ffbfc563e86eb5a2","tests/integration/snapshots/integration__queries__compile__constants_only.snap":"f193fa72460dc85aa9e3df4ceccaea3937f6477db50beffd5ba863b7806472e8","tests/integration/snapshots/integration__queries__compile__distinct.snap":"cc4cfe653e03237f2625b4af5ef4216a16ae360ba5692d7b63fa59c320c150ff","tests/integration/snapshots/integration__queries__compile__distinct_on.snap":"b4c69b1a0a54c6004ef91dd6bb9ab632bb6b77d376d6c22183dbc607b2d01f01","tests/integration/snapshots/integration__queries__compile__genre_counts.snap":"b4149473d2d4e0049c4e67f05af07b89d2677c196d9f2e522024b11bd1a0d358","tests/integration/snapshots/integration__queries__compile__group_all.snap":"25b3095614f187967e3b9ddffb94cf24f09445c8f753527543255bdccba3f3c1","tests/integration/snapshots/integration__queries__compile__group_sort.snap":"087f547c9b3a9bf9aa22e9805f807ca2db6f4895702dd145c224e1bfcb7da6a9","tests/integration/snapshots/integration__queries__compile__group_sort_derive_select_join.snap":"dfd47ca3565ebcd5a154c10655c699b1e9c38a658d47558736dec0adcebdfd44","tests/integration/snapshots/integration__queries__compile__group_sort_filter_derive_select_join.snap":"3895ca6656a2f6bb66a004bba57a61c06fdf64ca90029f7e2cde96bc18acfa78","tests/integration/snapshots/integration__queries__compile__group_sort_limit_take.snap":"5c9ce0a6d745bdf66fad6c0a41439f86beb9f9d6d698084afce43e148d752de5","tests/integration/snapshots/integration__queries__compile__invoice_totals.snap":"01a3b8e799d81433b45e37eedd0993eacc56de2c6cb41ae96d63c548ee06c90a","tests/integration/snapshots/integration__queries__compile__loop_01.snap":"02584dab42b83e08c250dabddfc99fcea7553a67e1a05249cc44221f5c0511d3","tests/integration/snapshots/integration__queries__compile__math_module.snap":"c0d3a8d0f8542f4818ed1821760783d33616670b0eb9e72774b105c2dda6f0e7","tests/integration/snapshots/integration__queries__compile__pipelines.snap":"0f93eec8918f4b0343d01db028ec3cd0298e8fc3536a1fc81806ffe34c449335","tests/integration/snapshots/integration__queries__compile__read_csv.snap":"407bee16f47e625729d3c7b477b6adfc3902e8045c7925cb5d1609757db9e72f","tests/integration/snapshots/integration__queries__compile__set_ops_remove.snap":"6f8213b55e361136b8943fcb846d9ffab0be514e3bf874ef6dff13b1b0fbe458","tests/integration/snapshots/integration__queries__compile__sort.snap":"c6b6bcbae03fbd8331a1246b78122fbeda5f65c973c1452a91388b9d86b01ff0","tests/integration/snapshots/integration__queries__compile__sort_2.snap":"f4599b19c48d5a405ac60cee8a784e14343bfec1d72c71e7a38fc40227602104","tests/integration/snapshots/integration__queries__compile__sort_3.snap":"38d2ed5cc6c70863d7a88777507dbdfd47edaec7f59d3d9655ba12d6dd69a1fe","tests/integration/snapshots/integration__queries__compile__switch.snap":"e86ebcc37f78b9a9f7c5db44b8ccf95b9b71ddc11544f89f20654e40ef822002","tests/integration/snapshots/integration__queries__compile__take.snap":"58f7de8afbeb48753db6f3d3ea8a37eb37059b323030f04ea8c70c520ced753a","tests/integration/snapshots/integration__queries__compile__text_module.snap":"898016384fdf7b6d0f892313c4a6ca290a0c47a3905130d1893cee01cb2d17fd","tests/integration/snapshots/integration__queries__compile__window.snap":"37097f921fc47f1887cd0b7ff573a694f5c8a119c2554a9140c0458692d23b30","tests/integration/snapshots/integration__queries__compileall__aggregation.snap":"89083ded8f1e2ea94d46d62b8d5f0013426ddab65b250eef06fdfa320b2d7603","tests/integration/snapshots/integration__queries__compileall__append_select.snap":"e9c9caf9ed94588a683e978eff235e115de91ea717bc7e206e5f345c27a796e7","tests/integration/snapshots/integration__queries__compileall__append_select_compute.snap":"697ba8b42f9f61fb2de7cacda986168320ed5f977b241de6b12191cc65ffdd5c","tests/integration/snapshots/integration__queries__compileall__append_select_multiple_with_null.snap":"48acc047d78bda559784d09858e7cbb794ce8403a4a86701314cdf3b8c526f77","tests/integration/snapshots/integration__queries__compileall__append_select_nulls.snap":"19ebd4fd38356dad27f107d72a009d9c1d84346112dc067e3b9a262f61e66b1f","tests/integration/snapshots/integration__queries__compileall__append_select_simple.snap":"3c1e96a28d1687254f118dd759f1b868d2fe51dea4fd5ae058801e3865d0e257","tests/integration/snapshots/integration__queries__compileall__arithmetic.snap":"bf1c9c24a9805afef78d25bc7b13507692851e7c4a80fbacba05ec6a612abef3","tests/integration/snapshots/integration__queries__compileall__cast.snap":"7778f61aa91d12e6d6ebe0d76796d75b56173886ce2ab02d7636337bcde52ca1","tests/integration/snapshots/integration__queries__compileall__constants_only.snap":"2a440caa0908509a700d032faba89eb4737eaa356bf50139dc93429170ca9f0c","tests/integration/snapshots/integration__queries__compileall__distinct.snap":"c7bd11bcbc3368c39b1f3c8399a0f06a7114a9f7ac736cb4b0e92f6d9ffbacd7","tests/integration/snapshots/integration__queries__compileall__distinct_on.snap":"9a851dffd13b4fe532120e7f6cece253277365c364166ba17620b63284ef7a43","tests/integration/snapshots/integration__queries__compileall__genre_counts.snap":"2ee5d1c3db1ce2a97e9d03600c52efeb15a22483e8eef275c4f53c3b13a7015f","tests/integration/snapshots/integration__queries__compileall__group_all.snap":"1fa0c8174c067345e61c1d8100d68ba3076909e428c654b300ca8ffad3ad573d","tests/integration/snapshots/integration__queries__compileall__group_sort.snap":"48609f619ec0f07e555bf30e695f34d45789b8c0eb2f4fd813060caf5f006f2b","tests/integration/snapshots/integration__queries__compileall__group_sort_derive_select_join.snap":"3a6571354b4987eb57ef6ffa91f774cd548196c93885c7001ba967c223cfb242","tests/integration/snapshots/integration__queries__compileall__group_sort_filter_derive_select_join.snap":"f6b4e6e2f6ed796cc2c0ca8a971797fe94a02b451bda20456979a20abb05be8b","tests/integration/snapshots/integration__queries__compileall__group_sort_limit_take.snap":"225bb45d29b03ae3998d371e2cd6ee5c5ea6b162481a807d0853936318912432","tests/integration/snapshots/integration__queries__compileall__invoice_totals.snap":"90a4b3f43c0a5521a8eac5e88cd7e2426a96eebfed564cb053c7be8994e24a3f","tests/integration/snapshots/integration__queries__compileall__loop_01.snap":"ffa362fcce88618413c5693d586429578b5033d7883d716ae69035d2e60ba747","tests/integration/snapshots/integration__queries__compileall__math_module.snap":"672a5b45c3447fb9d96dc5ea4d6da2f30fa799b07ca8d44e5546c2900a389c16","tests/integration/snapshots/integration__queries__compileall__pipelines.snap":"5b64adaaca5821a343e716fafacdb412a2c51f781fdd8866d2afb7afcec47aad","tests/integration/snapshots/integration__queries__compileall__read_csv.snap":"149509d261db98c18d37049e6bdcfc6c0011d3713a853996c0e6274451a66dba","tests/integration/snapshots/integration__queries__compileall__set_ops_remove.snap":"fcf1f5d78eae6c954c1df822e718e2de4d1b1b04dd4acc7802d3d45b409060c1","tests/integration/snapshots/integration__queries__compileall__sort.snap":"5cb02f7fa8fc7c6e1221d6b1158f93c27eab0a652ccf093e9a9f3beb3dc16c50","tests/integration/snapshots/integration__queries__compileall__sort_2.snap":"e8fe1e6bd3a5cd7c043f69c264d6452b0e340bb62bf2f7dd30b8b53e1c761f7c","tests/integration/snapshots/integration__queries__compileall__sort_3.snap":"766f275f503b4e4c928a0c133f5434b55aedc976aee645b5463b3379c696836b","tests/integration/snapshots/integration__queries__compileall__switch.snap":"344551accad3ede6f8878c8ee5b3d36d0f68b0d827c0badb8b345c2019525c71","tests/integration/snapshots/integration__queries__compileall__take.snap":"6a7fea53e457ea86223050de50b1717169373aaabd97e82b0f15c0a0f888fc42","tests/integration/snapshots/integration__queries__compileall__text_module.snap":"fc7ff962edffc2dedb772d4ae7e5d7685b9181c60772fe8f99244850936ff6e2","tests/integration/snapshots/integration__queries__compileall__window.snap":"dbe1b13d66a5a65820d20e3c2dec9ea7a4bfc1548b9e324e5fc8c66ea9166273","tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap":"0c19eb65d5662088d8717368277b892ddd959285222d7f2d8967e34d5ce318bd","tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap":"bf51d6f9a326158fa1d01ca02c89ec8573635054a828ee4d441420a625bdfbfa","tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap":"24bc39a568746c7d12b5ea2a09cbee0d4e05e8a4663f0a7bbd9baed8723c9d40","tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap":"e9f779dbb86be58add4bdc18a28037a01490d27b53643ba3d54247b23a0b4b35","tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap":"8e15af61bb9a47573bf9c05d6fe4452b4c579b6186e335b0bfcae1a8eca548d9","tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap":"16ec090735a10caa6975c2f7acc4466ed8a14fb58f359864c163f1dab684bc3b","tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap":"50d3ee4323ee6db8cf3ff2c8628fb14b9df2e5c0c6f270b36c2f0a416a9ce374","tests/integration/snapshots/integration__queries__debug_lineage__cast.snap":"e5eb0dfe3ad3c4d3d16037895198145a7fdf17d3cc4b8e6f1f3c0945009ce25a","tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap":"5d56cfd774b1a7cc9ba9a905744dad18905b036f964f5bfa00adeacb7ccb7511","tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap":"7a6d911117125fe071fcea14deba3a1266953b01384fb6128f82f1e1ec2c71c8","tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap":"69b20a3126d5360df78bdcc87299ec048dbbe950a5e25f4c0a2a9c40e5b645a3","tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap":"d3385e547e90c19f456fba168096feaf0c6982ce6e1df1df0abd2489cea9e1bb","tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap":"f5390ee3ae0aed136613234ca5c25edb2884360a1e26a2f8374408fbb63d252a","tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap":"bce330c67b77d062a006ab1a8c9771f78501556d32923bbe5e34010f5bd374c8","tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap":"22960d8458a28e6e1deeb56d940c8468d21ef8e424c7a9fe6443e0c5f249a7f7","tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap":"c2ec3191b9351112e24500e4b869bb6a02c7cf7bee0a365894eb526cb6264130","tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap":"9b7e621f1a0a1603f83918a426dad0529bf01a811b7dec7a178b6b7e87b2a037","tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap":"1a8761f4b356fd4bfffa0c67846ddaace2ce79067546e693fbf44350215ba4d3","tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap":"e869b32b1dc3908df2d4de1ded542e35825bbe9956329e05370b8a88872eb80e","tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap":"fb232123f697513679b6f5c80a787616e68c3e19becd0207d19fd3676b8238a1","tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap":"660fb69c069fd0b5a41802e59a903071b594a629b72328d7d34dd618a7c9ee91","tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap":"b88183f90233cf912e535fbb51b8a7c32fa889e4a1c0145e501c6fe6b0d3089f","tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap":"065fccfc44fb3e7f9b3ed3ff9288c7ff0f3987034961888b5c1cc5ce8d48edd2","tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap":"c0340b2279864daf13108e16ff127b7ddc381dc4a94b129c6d1fb03b65e03d61","tests/integration/snapshots/integration__queries__debug_lineage__sort.snap":"d200c1df1d636c2a86a9d5b4e55c913a73136fb769b89b735fc2a7b295868d4f","tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap":"27a8d31754993ecbac0b3a2faf445fa0a6456905adfef4eeb3f3e76e8329bcda","tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap":"b4cfca24637ad5be52317e9ee458a6d139fb43579ee64bf2d3c021d6c887017a","tests/integration/snapshots/integration__queries__debug_lineage__switch.snap":"7b1ad88d59c063c865217059ea26845652cfe78faf0932a9f227a9513a47941b","tests/integration/snapshots/integration__queries__debug_lineage__take.snap":"958f97a66f7337b7b8675ecf9d383d7b89b03915a00b1a78b89e151c32ff33a6","tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap":"7cdcf3565d5faa4ea15ecedc1c73058e1dc946fc7cbcad3703be6b6581c14fc6","tests/integration/snapshots/integration__queries__debug_lineage__window.snap":"95d2d463a5b7676537cb625005de75b998cbf73b3291aed207559e3b9ba9c347","tests/integration/snapshots/integration__queries__fmt__aggregation.snap":"d36eba345aeefce8f297b2c45a5300446bb310959dc738f95fca7c0aa2500e68","tests/integration/snapshots/integration__queries__fmt__append_select.snap":"789d7fa0234b24f8f0d4058c0c7d505785c99e2a18c8d6b40e8476541c26db2b","tests/integration/snapshots/integration__queries__fmt__append_select_compute.snap":"41f608542edcc127389ac33fbd1873e66e5f6da35c7ba6df21969eea579c7c2b","tests/integration/snapshots/integration__queries__fmt__append_select_multiple_with_null.snap":"237278d6209726072fe0f84a99a45e6c2fb3c271332e7d96c89f521e6f2e4135","tests/integration/snapshots/integration__queries__fmt__append_select_nulls.snap":"79e269ba2fdd91738e3ed1dfdc49916bdb6477d607b024b4dfa28231e7e954c5","tests/integration/snapshots/integration__queries__fmt__append_select_simple.snap":"485b9ee4b6cdb975e672aeb595b621e209601abd2c26a3a8847660518bfd03f0","tests/integration/snapshots/integration__queries__fmt__arithmetic.snap":"df30301d7b22e6660df6a3088a0e1c932ba490ac1b7ca8c45a890e673e11f142","tests/integration/snapshots/integration__queries__fmt__cast.snap":"42360ebe40e16dd4abf941aec8c092607ea595d13bb595520fcbb48540ba5995","tests/integration/snapshots/integration__queries__fmt__constants_only.snap":"ea47bd98f9ca7b36971cf9fa339c617b19685c7cedbcb105775e993816f3860c","tests/integration/snapshots/integration__queries__fmt__date_to_text.snap":"6bbd760a84bb4bac275c41b6a27f29cdc9ea9d9fcf9c54bbf8e524125409a806","tests/integration/snapshots/integration__queries__fmt__distinct.snap":"f1f25d5a3492c214b47c5d1fc28b0008014c790cdeceea9772a2395847b10cf5","tests/integration/snapshots/integration__queries__fmt__distinct_on.snap":"998344fe8adaa26c9d473070f6dfdcb4239e4d95c02c25cf6ef755108d64f093","tests/integration/snapshots/integration__queries__fmt__genre_counts.snap":"b3cce7d8c93b6821a21a29aa367e22f38457dff8a56833cd878e07870ebedef6","tests/integration/snapshots/integration__queries__fmt__group_all.snap":"a3409b7da6211eccb6bf77796c09afba7e2f21d9f08b7b3a08e4ade09e0d0929","tests/integration/snapshots/integration__queries__fmt__group_sort.snap":"4635a0ac7872bfd28b0a8c3d9bda169e732ee95d8d7b9c82cfbd16c77a3c205b","tests/integration/snapshots/integration__queries__fmt__group_sort_derive_select_join.snap":"f0af4704eae605daef511a08d63dfe553d760d1df48220f9fa1de34acc457488","tests/integration/snapshots/integration__queries__fmt__group_sort_filter_derive_select_join.snap":"1748bbf8711c95c41620ce6d93d059fc1b0a8d77e39f10c38538b8bbf181ac68","tests/integration/snapshots/integration__queries__fmt__group_sort_limit_take.snap":"2e5ef48a3f771857e1e24d9600bfaff549b4c1be5b5f66d550ac37f243d2326c","tests/integration/snapshots/integration__queries__fmt__invoice_totals.snap":"79e5c3143f8cd8d94fb80d07c48a74dee90e11e1776158f2687393ad8698bfed","tests/integration/snapshots/integration__queries__fmt__loop_01.snap":"e14a982f7b08325d56a22e3c2d8ce9f85886a636762184c74e9b0413aca6fc16","tests/integration/snapshots/integration__queries__fmt__math_module.snap":"82bd92e4365d583da9a0fd1f82ba391791b60f82f671cf3037c1adee69609048","tests/integration/snapshots/integration__queries__fmt__pipelines.snap":"e10fa2a3f9f9654953e2c873e8346e7b21054c65fa0ce2b7169d379c15441783","tests/integration/snapshots/integration__queries__fmt__read_csv.snap":"e1e93c9f3c12abc24a2fe50f7f398eec4c79fcbc2fe56a807596386af04bfe1d","tests/integration/snapshots/integration__queries__fmt__set_ops_remove.snap":"49928ad3ac3fdeaf58ad8260f314fc2ee1b71d6069057c4ec575bc9cb65e90bc","tests/integration/snapshots/integration__queries__fmt__sort.snap":"1cdd18a49a4808f98447e424ebf1b72e31a2b8191ab459943e545519025f6bfa","tests/integration/snapshots/integration__queries__fmt__sort_2.snap":"6efcefa10029588a2bf39e0e0255259264458f325f37683c33e55873f5b1b5f8","tests/integration/snapshots/integration__queries__fmt__sort_3.snap":"a38c92663b6cb11893992ea0addee33a95ecae144fa4e9f5954ceba89ccea8b7","tests/integration/snapshots/integration__queries__fmt__switch.snap":"1217f4eaf2a337a49e6b24e62c5886dd1b679437ccebf7a16fa6fca2c559f7c4","tests/integration/snapshots/integration__queries__fmt__take.snap":"6db657b28c66d24f8fbe8a73f39267757375629c92b33260ab14be1b488d6932","tests/integration/snapshots/integration__queries__fmt__text_module.snap":"6ca6d2364e58daf886ffaf08ed2ed67b39ec6d64e26c29e5686a14aab195b3cc","tests/integration/snapshots/integration__queries__fmt__window.snap":"9496f85ad1d339bebdc13294781df653350d488accbba82e6067f2d712733ec3","tests/integration/snapshots/integration__queries__lex__aggregation.snap":"cb713533b768349ad2194e0a18b8f332c6fafa29846bc791f0a9f505adfeee9c","tests/integration/snapshots/integration__queries__lex__append_select.snap":"f4b1157adbdb269ccb5ece747e52d7cee84d5bf30384370c2c7628973f03f3a2","tests/integration/snapshots/integration__queries__lex__append_select_compute.snap":"36b791f3399143ad6379bc20e2b080144e6913f11db0263a928fc7b04fcec67c","tests/integration/snapshots/integration__queries__lex__append_select_multiple_with_null.snap":"244ca3d20620c9d42da60aee0e487eb56666fe415a2443a9cc98d8adc2a0245a","tests/integration/snapshots/integration__queries__lex__append_select_nulls.snap":"fa6aa192c45a697fa446509215b9378b3a93bff175b16d34e19f2041efdd45e1","tests/integration/snapshots/integration__queries__lex__append_select_simple.snap":"f3e57b8a46ddcf222245c196e880e24d05f7f501558b61bdc30647faf207785e","tests/integration/snapshots/integration__queries__lex__arithmetic.snap":"3b20fc8e3dd5ab835c159dcafc997231d4bb6b68da0db3b315f780181eea48e8","tests/integration/snapshots/integration__queries__lex__cast.snap":"dc6755d1c056cb514c6ccaa913879dbb331642a8bb5f1098148c5368b2b4ce89","tests/integration/snapshots/integration__queries__lex__constants_only.snap":"ab5033790a4f8502b41a1d58342beff818c28a00c816d251dfef76f5d32dbcba","tests/integration/snapshots/integration__queries__lex__date_to_text.snap":"d85a67ee9111e518556e8da94488766f63f522296bb4b0c7dff2cf77b386073a","tests/integration/snapshots/integration__queries__lex__distinct.snap":"ccf2903f30d4c93e0d5343d4e4983a6d1111e12743c977853deca6c701201a26","tests/integration/snapshots/integration__queries__lex__distinct_on.snap":"59db3d07e6e508321e3e8cd2f1fbe22db5aa9b238bfbd4c7a42a9abe71732ad8","tests/integration/snapshots/integration__queries__lex__genre_counts.snap":"e5f8742f3c8c240edbc363d59eeb1c00bc8e50ec135df1cdc8a5309c931f25ec","tests/integration/snapshots/integration__queries__lex__group_all.snap":"24e3ec4e8aed436e4287fa98c2509aed7d6ec2748de97ab9ad67b17ffcb3edaa","tests/integration/snapshots/integration__queries__lex__group_sort.snap":"5a64557f64b843dc610dc206281ac54a29138084b7e383507ca8a442b265f987","tests/integration/snapshots/integration__queries__lex__group_sort_derive_select_join.snap":"41ae5d3c6f81cd26a086cc923b9702082d832fbcee3e2775f673e5c812e55e28","tests/integration/snapshots/integration__queries__lex__group_sort_filter_derive_select_join.snap":"23470a981f2c1cc52e92b72d41d2e9a837da2252b1ff2e6b559cc8c04b984d1b","tests/integration/snapshots/integration__queries__lex__group_sort_limit_take.snap":"60ead9d00fee5b953e5f722dfbc344d349d3ec342c24b009ebe10eb284b5f51f","tests/integration/snapshots/integration__queries__lex__invoice_totals.snap":"4c3d670693cc0e532b02685772740ad865daa582c5d13ff57d56b64f4955a40c","tests/integration/snapshots/integration__queries__lex__loop_01.snap":"47f78f5f02916d2ca664c698c6579380c7ee204c6fb3f80a0cda29d5a27d49df","tests/integration/snapshots/integration__queries__lex__math_module.snap":"631d09739454b40129879fdd9f431459d8fd6c2372e914844865d09ae95a1a95","tests/integration/snapshots/integration__queries__lex__pipelines.snap":"b87baf2e02fb9ec0e364d158969d42494707bb8e62f26e8d7e7a745147953e38","tests/integration/snapshots/integration__queries__lex__read_csv.snap":"14bba58bf4fd4198d84867ca00961d8aec4f532f01c0ccba8295194bc31503e3","tests/integration/snapshots/integration__queries__lex__set_ops_remove.snap":"da3297a240a08bd1e06ee5404159dfd7dab80aeb8b1983739a1101fdcffb2fb8","tests/integration/snapshots/integration__queries__lex__sort.snap":"e689fac3695d80be9bc425af5772eedde7fe0597c9afc479ca3431ac7f757c16","tests/integration/snapshots/integration__queries__lex__sort_2.snap":"721f368c37f9f82322eb4c453feb46dfffa10788ef89fb191f9dabc669e4eaf6","tests/integration/snapshots/integration__queries__lex__sort_3.snap":"6026d04246cd514760320caaef1d0d0cca4e617476782988d4dfb0ce915917a6","tests/integration/snapshots/integration__queries__lex__switch.snap":"c3393e60cad54e8fbdadd67bb1ce8bbbeb12a827435e0e22af8527c0c4b09931","tests/integration/snapshots/integration__queries__lex__take.snap":"3071602ecff06f87c009ba6b74bd37667de0d5eaf87ae0a334bacd2ab646eae1","tests/integration/snapshots/integration__queries__lex__text_module.snap":"ec18275d3cccdbce093859abd766d09e56ab87b960328e811f0b483ede5c2384","tests/integration/snapshots/integration__queries__lex__window.snap":"f43ede7dae9c2979abaa53a41b095438cfb2ef70bf07538603c1ec923c4161f0","tests/integration/snapshots/integration__queries__results__aggregation.snap":"f0d0774b82f3ba6967d28a3cdfa16c4c32a17b965a6122ba5532338e0430a335","tests/integration/snapshots/integration__queries__results__append_select.snap":"30f4ba43c590fb7f323d7bd904a52b97d40a403db79d6e445b965a225c5df18a","tests/integration/snapshots/integration__queries__results__append_select_compute.snap":"cee7379b0a4ce6f61b3dfb78607a2b41da1ec147184056124d1a148204cb260e","tests/integration/snapshots/integration__queries__results__append_select_multiple_with_null.snap":"14e6c9c09bea2e0b568f6ff883722518d56cb4e37329ee80be99ab05efcb521d","tests/integration/snapshots/integration__queries__results__append_select_nulls.snap":"bc46d0dc681b2a922ca6121523136b7fccf3feb08123217763da52000f0591bc","tests/integration/snapshots/integration__queries__results__append_select_simple.snap":"d8533e90c2ad8a3d50059ddd729aa2f8e09907f24211415f7062014e3e94c22d","tests/integration/snapshots/integration__queries__results__arithmetic.snap":"6e3cdac428dc9de760f46f3f0ff56d47e7593bbef82d0d3e8ca20153ef89d966","tests/integration/snapshots/integration__queries__results__cast.snap":"330c6f1c6529904d2b6232db35f9bcc9f33d3b00f5ac5428add39677a5bdcf47","tests/integration/snapshots/integration__queries__results__constants_only.snap":"376d7c1c1584d3f9e2522320c6675d8d2a6c66be343b2e6461468cfb7500d43c","tests/integration/snapshots/integration__queries__results__date_to_text.snap":"25f3a603e98e9a2924e6440d0ad3f0103f4c1a3e977be39b10316581f9e551a0","tests/integration/snapshots/integration__queries__results__distinct.snap":"5f375f988d61cacad06780768d681f12243513bd7faa36f2bceff233d8c9439c","tests/integration/snapshots/integration__queries__results__distinct_on.snap":"d2226f2eb7679d858c55b24bf0f9023d64f2a730e0d48516bb4ab94ac9882db9","tests/integration/snapshots/integration__queries__results__genre_counts.snap":"f072e11a36b7721bca52b0f337239f84ce3ce7068a9cf3cb8158ee812305879e","tests/integration/snapshots/integration__queries__results__group_all.snap":"3d312bad837ac209e3b22cb126414d28c03f8f01878b3cba58cba748c184fbe5","tests/integration/snapshots/integration__queries__results__group_sort.snap":"74ef5ab97d731e0abebe7da0f4d3e74448e04c1e4cb16a8992f85903418ce35e","tests/integration/snapshots/integration__queries__results__group_sort_derive_select_join.snap":"60bddf968783538e347a876fdbc8dddcbc8493616c05963479bb55e6e5737ec9","tests/integration/snapshots/integration__queries__results__group_sort_filter_derive_select_join.snap":"0441e7a34b34fbe1f5ec19e0e3ef6aec95e9b01db3eab2d25ae04808c06dad7b","tests/integration/snapshots/integration__queries__results__group_sort_limit_take.snap":"5359de385256f87aceb72322026baea7d67b1d9002394c74d471bd0b994292fe","tests/integration/snapshots/integration__queries__results__invoice_totals.snap":"b8b9739509f84aae00ca6763ba84dd03419029c559b5bebf059904c5cbaeb952","tests/integration/snapshots/integration__queries__results__loop_01.snap":"666b8a9661a203523c877686b3722c3fc2e29308bcdb03e45ec3f1597660892c","tests/integration/snapshots/integration__queries__results__math_module.snap":"d6fc2e209d1e922b878686bedb9d0d213127503e3dcb20af82269bfab7dfcdba","tests/integration/snapshots/integration__queries__results__pipelines.snap":"4c2352d7e34e17b81150a91097791002a46cc6def21719919b21374ace2332e3","tests/integration/snapshots/integration__queries__results__read_csv.snap":"0ad4705d738efe2594e45d6dd2a51e66ddf8775e64ec2c6a07b533e7fc333fb7","tests/integration/snapshots/integration__queries__results__set_ops_remove.snap":"1766979b1375df6164f1c54f6a171089e19aa90e63e17a06d2324466cd4766d3","tests/integration/snapshots/integration__queries__results__sort.snap":"e761a1512982d3de150c0c00e0edb3f2bbc0f925bb0b738fb96dbaa156b46c01","tests/integration/snapshots/integration__queries__results__sort_2.snap":"207acde3c240364d857ad947d983f3bbe810f6e654cfac76cad4b203d21edd9d","tests/integration/snapshots/integration__queries__results__sort_3.snap":"5466803cec819d3b20d9d973476c1370037af6a22a67822319421db3110b3aa3","tests/integration/snapshots/integration__queries__results__switch.snap":"e532eb6d441395d792d5b0f89c26c5e38240e4df2853457f7f96a8b17932a68b","tests/integration/snapshots/integration__queries__results__take.snap":"6d0c08017c73f2d6f889e1fb8f080d5d39dbea44236fb3047036487b1369f44d","tests/integration/snapshots/integration__queries__results__text_module.snap":"d4c27f4bd32063cfc5170442d4982e94098019b872f567a48b0615d8980604b9","tests/integration/snapshots/integration__queries__results__window.snap":"e8e683ba0d0daaeebc8e5cdc9906d156f1d71db6885af49a4cbbcf5e5f739374","tests/integration/sql.rs":"73538c4383d60fb5a44929cec820abddf6f409189fae0caa01756dbc0a65e61f"},"package":"c76b2c675a77ac8eb7eef17105ee38fc9f007fd05ba5f26f9a7fa0f113e82235"} \ No newline at end of file +{"files":{".cargo_vcs_info.json":"69f9d3fe90be79d88c0017e724b3580de4f5f80052d23d1bf9e2f47e1365b11e","ARCHITECTURE.md":"29e3f72594797cd5a48e9ae2168873aef230c081397c4e0a4de9459bf7f81b20","Cargo.lock":"f83983615590a14915f6dced8ff1dd59bd6f7134c5efb5101cbeba7dbf2bc885","Cargo.toml":"8f53ce898902bf68ad754c357fbbe2f5f33afcd3c8980f04c7b82fa98c2fdd20","Cargo.toml.orig":"18f85add97cd9da2d866c3b69e8b6c09f58c897917447f425515f9d4634b88d5","README.md":"ed8f17dd4a58a2155ee36a8db7dbfea2c5254dcfa862e4572cb15fd3ac4c0976","benches/bench.rs":"8621d5c8bbdd6ef858c96426d9f62ec798188a0f4d53541f2b05d0e5138deadf","benches/bench_impl.rs":"710956d364d9c3c5f443315a41790e47ad61b8d2c13793d7b46377c767ab1feb","build.rs":"81e615d273932e59bdb3614a332f1af08853a88d6c998ffec8c039d0be9185d7","src/cli/docs_generator.rs":"90991c326e9dd347a86e89953fca143a046636b58efba0450be643b7bec8dcf9","src/cli/highlight.rs":"7e746122b6d84467662f7e2a6725a7c6d820eb8aacff18e9d4a5bf566ab82c01","src/cli/jinja.rs":"d20c04c912cf0a9fce5d4b442932a61a11dc6a862c3574f3641de7bf29a5cb6f","src/cli/lsp.rs":"b6ebece79cf70ebb68f1d1675b3205eb1aad1ce15bf6e628ba709752ede67d6b","src/cli/mod.rs":"526842fa6be50ebab809405cb88309003d8c3e6d4ef3288c8ea45e8f2e7b66e8","src/cli/snapshots/prqlc__cli__test__shell_completion-2.snap":"2ef83310923f5dc6d873720bc35da8dfac7490390e905805377310d12132a586","src/cli/snapshots/prqlc__cli__test__shell_completion-3.snap":"e56fb5a945dfe27f4c6de291d11241b9c19ab325e21b5f6c983b7b10ea0e7415","src/cli/snapshots/prqlc__cli__test__shell_completion-4.snap":"acf6d816bca50c546ac4949375599de13a6b29e582eb3c0943f5ec040fb7dd0b","src/cli/snapshots/prqlc__cli__test__shell_completion.snap":"bcbea3fa78a7fcfcbd826f4244bb8f2c7901643695265b4bf8015ee9e6b64503","src/cli/test.rs":"5c027bf2cf691166ce19e68fbefda1fe131b07c70a673856e8672d4c50f85ede","src/cli/watch.rs":"f6ed50ee0dbf49beee4e7c9dfc01f714828f9177fdefc78e3bb369a69af12e52","src/codegen/ast.rs":"3850ff29c1e4cb740398c8582b82e4df9c20afd3cfea4aa886225db20e3f43c8","src/codegen/mod.rs":"b77ab8814c7bc3cfa18282c3c708192f036aa56960773e620c0bd768ed76e81d","src/codegen/types.rs":"37c574417dbe176292780d31d65e1129bf7c06ad78ce50390944fe6861cf2921","src/debug/log.rs":"08f8b44c1d711e06d567f6c9d953f3e651551da36330afcd9a1923169c026200","src/debug/messages.rs":"fbd7a0fce7d90cdfc2427cb3ed58b6c21a848fca410300e6501ea4aaf3a333b1","src/debug/mod.rs":"b5c75608fa21ee088599c3803922736a3dbb74fd61a7bf2aef2172912ebc607e","src/debug/render_html.rs":"f20765591e1bc9ebbab79e528e32b48917dd93ba1cc8ec6c9136cd9a356ec54a","src/error_message.rs":"03b22b7e96a38937647f249e7b9afd3585c9651d5e6303046ecad7679c48d426","src/ir/decl.rs":"7156132d4b1f007a2bbc770de674a8cd19c39e2249b334741fda31da9747cd56","src/ir/generic.rs":"bcfd33d0faae6a2efaf79f4e7be2ce61c0676aee1c47947b87a895aa79d7618b","src/ir/mod.rs":"4a83c1df8f30f52ae8230304ea0defe7e669cf1c0060e638e8c0ec0989613571","src/ir/pl/expr.rs":"d3b1415a18ca6eadfafb560f65862632394df60b5379e31bda3d8d732c20167a","src/ir/pl/extra.rs":"98bbd48b65cae005e4d249918560cf85d86a4da9f6b66761f1607cac45ca5600","src/ir/pl/fold.rs":"f201556a8c2c1038b79897a386320121fb6d2990ebbfab2295cf7b7fb43972ff","src/ir/pl/lineage.rs":"a88bf0aef91878869a65480d55919560eea71c86976945f1128fbb228361bb9c","src/ir/pl/mod.rs":"df20046a24477a0d89d3f90a97e072b3142fed00b82c2ecbf2ae986de6a7aad8","src/ir/pl/stmt.rs":"022dc6dacc6e7b32a027411b42550a9a4d2c7ff6054efa44c628014555528b4c","src/ir/pl/utils.rs":"91e19b9741cf09c9529c8735258b0feb95231cb7e8963dc8cfcf29c7d6b78833","src/ir/rq/expr.rs":"1ddfa39798567c129db08854cd2ce7552c0b1cc9693327ef9ac6cbddd117fd20","src/ir/rq/fold.rs":"8af3b208bd80f85f7f0adbb43944b276f0f04b5d853c0da85e6833e5fb21b9bb","src/ir/rq/ids.rs":"0ae037816398a1e5d09471d1b153e2bdcf43760f4555fc26b0673eb4b0f32cad","src/ir/rq/mod.rs":"cf827d61a9e312f26562308f13fe3aa5ad95065ed22906926d63714e32f18a03","src/ir/rq/transform.rs":"90d6390a315bf802184dc5e47c86e24a97491a6cc7c4e0f211ee49768affc082","src/ir/rq/utils.rs":"a370f49c53e903cd7192ba4e1ed49ace99010d34f48abb0951a39621903260d5","src/lib.rs":"c10fc4596eebdfa6908153db7314d2cd7f975783dfaaec40dcb293288247440c","src/main.rs":"11c3be6045bbcdb0858b9c23726ae8eedce2a3fe942d408ffd461bc0f217e766","src/parser.rs":"ad6d3d0a0b6434e5784af17b7b78e8b3ea5ebff6e0a73f00e5e0ef988eb1ffc0","src/semantic/ast_expand.rs":"424cf628a92321e20583d81588ba3a0dd20e81c35bb48338219882216fee7c1b","src/semantic/lowering.rs":"7c844ab9894ea063a7a6c2e2864db27dd7adda9d24d6556d6995b40791fa56ca","src/semantic/mod.rs":"9e38af45fa915a0067614ac25788e232176739452994c050dc0b4fc20a83efc4","src/semantic/module.rs":"0dadc347428da2609189975de3b8ffd69cd84bb916225ce4ad291eb70555884a","src/semantic/reporting.rs":"4c68fb7b54760690944c437da0367d3ecc4e63c26193af59d512b75fc6982690","src/semantic/resolver/expr.rs":"5d004c5ba527e180d9a9bce72376a037e85cd04b9934a650081bdc673c1fd92a","src/semantic/resolver/flatten.rs":"29b900bc960902a6e6dc980392d1deab02983ab2a4970a1f27b2ee50b2849946","src/semantic/resolver/functions.rs":"11618af0cd64bf1ecc46f7780d3484b1f9e76a4b32b95c14b933f8b389fd37af","src/semantic/resolver/inference.rs":"52f4fda12e215e12683267d3e80bd23824ca2b201e77b5b45be5eb648b39eef5","src/semantic/resolver/mod.rs":"a8af2a0bc07d3a130ee98a3be173c462b12764ea00bce2b2f28c8a658932165a","src/semantic/resolver/names.rs":"777a37329d063eb0e1999442f0524996298e8750c5ce0018369c6b73446b2457","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap":"75fb0b9f357cbe2b5cdbdc440105c7b383ff2c6bee380e78b9f26ec04ba8d559","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap":"83093bff82d79a7e36d1a6653ef82abc64e9b908997eca424f4abc5c3c33df62","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap":"2686e2f195abddbca3d6fe059adfe632b60646fc887479693288c03835ae5d0c","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap":"05462c0deae3d012a7370505eb1558b35ade0d7e9312ca33b324623e3a28ffd3","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_1.snap":"cae80b205d8b3b4588e0683695fd6376afcdd51797e1b33c0f81e8cd6a420563","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_nested.snap":"149898913602c077f3322d0dc4f6ede862a218dac7be4ea1010b8528ee8f6890","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline-2.snap":"ba6ad917d827b5acffa69607926fe75bd59f66fd882b4708458877d02d2ea590","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline.snap":"a4719d326f9c73139c87b755f2b6937835dfe85187e842286395295d01054e75","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__named_args.snap":"cfdec057a2cc767d31346a5973c33cc9a804b769c896581a36e69fce965cd466","src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__variables_1.snap":"938ef140e8976a5cfc0088ea0aeea252149c6347aa4a3cba2cf8b6ac9dc705e1","src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap":"cdd50bddea1eb976a28c227c0f5beceb3281903875db6dbdf8da2d35c93e219c","src/semantic/resolver/static_eval.rs":"43ef18ddf6dd393e9326830714429f69f631774035e390364646f5385cc15900","src/semantic/resolver/stmt.rs":"125226630e80f17e5942f56208ecd794886e7de35b862c0758aa501e2491b1a1","src/semantic/resolver/transforms.rs":"daef45b1d39b959d85d6599d908337aa7d99bd0d2551dc18f2baeadd5695d3ad","src/semantic/resolver/types.rs":"4ee100adbf46806da0025307eee864573a4b1bd5ed90a85b451b836b3166b9ea","src/semantic/std.prql":"cd2b86cf192f4ec677cf81c0171733aea1a91c9681a576160fae12f20c5f0c38","src/sql/dialect.rs":"c231f2034479c5d2e6d1fd0dc0b8e033bedfd79a5778765f1600e5e3fce80ab3","src/sql/gen_expr.rs":"46dda9c6efc65340c3448211ffb7f41fb435cef5256e0e14de4a2584b5f8e4e0","src/sql/gen_projection.rs":"80c0e54784baceaf56fc97d2f8ed4a92d1edc1e0bd3dbd68361091ed3fc366cc","src/sql/gen_query.rs":"1bd5fbdf953a979330651dbc7f3d62f030f49c677cbe0174915e059af21732b4","src/sql/keywords.rs":"b830e84b26cb3b7a399933f1622f0f1bd391beb0b4ec5efacd992a4bc0e39e59","src/sql/mod.rs":"56eae605d041f82a51a9fa56a076930502b13c164664bda4e8d564c423c7191e","src/sql/operators.rs":"415ff31f2ae4e16c41a9ed21cb1ac07c57d78ef8a9e7fa149329bb5c60851b43","src/sql/pq/anchor.rs":"b7fded82f6b077cb5df202e2b7c2cf4ecacdae87ea7b24060d7321ce944bfbc0","src/sql/pq/ast.rs":"e4b90ec4f9446ed651e5c290be6bf005d72b38a8c41ea1ad05b2c19a2fb4f90d","src/sql/pq/context.rs":"53ba4b4eff3ad846a69984af04864a3fe3152078b9eef31aa331d907fc3ac668","src/sql/pq/gen_query.rs":"a5b10ce11ec4c3e9c7331564b26352ddad865126996944e7640dcf76569e09df","src/sql/pq/mod.rs":"9586631558e0b0571cb1d6578679bdd10908ed304561607b2590d49d02540d8e","src/sql/pq/positional_mapping.rs":"fdb86acaf16c97d1bf85a4d9295d81dc61796d07bafe16d7c463794b61360f81","src/sql/pq/postprocess.rs":"1e2abe7fe52e13a20517aea1473124c688477974d9eb561417e6d22a24f1a00d","src/sql/pq/preprocess.rs":"104dc276756ac3accf298b9e2d3c5a6e3616fe2f52b8011d9e919e6e67d9c2b6","src/sql/std.sql.prql":"86b54e75be427eadf1d58fd5e96d202b4e2580215c0d976ee46a25ba18d05b19","src/utils/id_gen.rs":"49056ef60d060357250c896650edcdffd84a312845f05b8cc59d6b2506af371a","src/utils/mod.rs":"ce8ed7337bbc825a0307d708d849515156728cafaeafdd8d7cc4f794868d14d8","src/utils/toposort.rs":"614042aa8e44a5541abe6de98af8e371d04fa0ecab41eb23642d1f9ff390470b","tests/CLAUDE.md":"66514a59d2f8a1403e06780ca14bf11639676553804d47f6ed308fd60813d413","tests/integration/bad_error_messages.rs":"c50097b5291f90e0ba76612e32c1f239932468a14fb8dc4fcb18fefda8bc753a","tests/integration/data/chinook/albums.csv":"36386f9907eaec70a8f51bf6f36fc698bc2a5fe797be5b86f2743612b5164be8","tests/integration/data/chinook/artists.csv":"fb38e91f992a97816840d1b90b6dda8877377fbc01dbdd4bc24c1c39642fbda5","tests/integration/data/chinook/customers.csv":"065a991c1d7a9e01033ada04e76a3a0380b061fe4689770496f76ff9cf1df009","tests/integration/data/chinook/employees.csv":"3261cf3ede4cf5c1d0dddaf414c32de24f851b9ac5fbf3a49846cf7ee116b1ec","tests/integration/data/chinook/genres.csv":"a0e3d69c447ec0aa39718551fbcd7571ae36f7d084995dd8dc30ba159a0c91ad","tests/integration/data/chinook/invoice_items.csv":"42a9e26568ff3de18fe77f591545abcf620de5efa3e94d315cf584c5c075cbcb","tests/integration/data/chinook/invoices.csv":"4e3e5699b3fd37e3912f6db93558fc79ee0bb392b4dafbf2c2c02e345cea52e0","tests/integration/data/chinook/media_types.csv":"f6143c7ae051c8505ce857816fd52315ba9b87a2cdf2061fb45173af0d2df907","tests/integration/data/chinook/media_types.json":"caa83ff6318cdca9c78316e64ab15c1cfe801a854da4079bf275998069348e8b","tests/integration/data/chinook/playlist_track.csv":"cf30ff63de3d805a3d31e5c28766183f5df9690206635aa4769a6c3a7ebaeae5","tests/integration/data/chinook/playlists.csv":"947c4be6d972a41e8595babe6a50f580aac79235c5ae907817ecca65fe18a91c","tests/integration/data/chinook/schema.sql":"1b42532ca20a96edc881b972820fe3389f40d53a60f78cc098c2b3d7f7f8e35b","tests/integration/data/chinook/tracks.csv":"3a8cd199849ea9f36a1529d06cb83af49c4f8aa6377f19fe45a1cb6f0882c7f0","tests/integration/dbs/README.md":"f0d69c96a4364defaa1d7eaf83825b4713fa1bbfa67eaa5e964234178330b3e1","tests/integration/dbs/docker-compose.yaml":"88d9b8e73cfca3d13547a9fa7b0a2fab466439234368e1874c858c483340d3be","tests/integration/dbs/dockerfiles/glaredb.Dockerfile":"e0b62509a47cf31d6eed08595109c60e8b56791b14f055298dbf39dbf8414955","tests/integration/dbs/mod.rs":"cc7b18cb0dceecbbe82ecd60ef9f82597729433e24d066bdb9f395f828431dfd","tests/integration/dbs/protocol.rs":"3dd81abd13903468b48379f4cc435b696072c3327ecd0979f5a5504920737cfe","tests/integration/dbs/runner.rs":"e15ba054013aa7d04b2ae047f7ee3c4992ebe98dea4f2b1d3ad5811f3afdc93f","tests/integration/error_messages.rs":"60b1d216e5673561d08952da09c2a26c91c544c82cdc9da160a11a6c06df3a71","tests/integration/main.rs":"1ba589d65d84eff41a704f71489772e32d42ffa1e45bd24581080e370cf277ac","tests/integration/project/Project.prql":"1b10b8bd1fc57d952bfb077347a04b9ac70483a046c359b8d45aa4b6a1ffe683","tests/integration/project/artists.prql":"ff589527096caa1433a24e0659706fc76c2eec70aeb5d7c2b4e185bad5b316f3","tests/integration/queries.rs":"42abf67f61a92511e65d36fe426838be801dc4ba3d57e5aea42ea82394674d66","tests/integration/queries/aggregation.prql":"3dd1dada462a25605f8f51a28fbf00b4de10c2a02db00f94cd9d7ec24daa8e3f","tests/integration/queries/append_select.prql":"2aacdaab81c68635f73d4bb8f617b9f7aa42117e78db0d3d8308ba9d5c7fe929","tests/integration/queries/append_select_compute.prql":"e6732afe92fdacb7857bfcec6d7802363a070c9b79fef89347358c7b862276a6","tests/integration/queries/append_select_multiple_with_null.prql":"50868ae0fa062ac513714dd2f1eedd4a3ada23a1a9f7fb6fd360004e905e1208","tests/integration/queries/append_select_nulls.prql":"c9c5b581927c454f2bcbf97bda2092d60fdfec7df075aac33aea6e4fb8dea7be","tests/integration/queries/append_select_simple.prql":"cbcd0fefcf945ad1a75cc9d05fd9939039cd69d23b2bd99dbca1b75ebdea7b51","tests/integration/queries/arithmetic.prql":"cfae453c0657241f5afd380a95626b6eaf1e61765f072056630a47c373b4cfe5","tests/integration/queries/cast.prql":"8ef8a323be1fd45bcc1fea3621f2320c440f54da9c714ca6540e9fed5d00184e","tests/integration/queries/constants_only.prql":"651f34faa559e7c8a02265d4ff40d76a71d018a39baaba31f6d4858367777ffa","tests/integration/queries/date_to_text.prql":"6fa0144e3954653541f935704fda9802b4cbc882c9a4bcd851196debeb496724","tests/integration/queries/distinct.prql":"186ea006eb25456b77c76ef9eee3b29ad180271d1bbe871dfaeb57f6d4dcac54","tests/integration/queries/distinct_on.prql":"4e9578fda1867bbe80e83b3cc316ac77f1b6a370056b300343b006b13ef16c58","tests/integration/queries/genre_counts.prql":"7adda24c90a0c49aa108f798e3605c1a9556e94d4fbd3593daab3b4bddfbde83","tests/integration/queries/group_all.prql":"22c0d2123ea800b26e04d65e963dd0972285a4a322756beedb4668432aef568e","tests/integration/queries/group_sort.prql":"a3a545a83abb22de65be31637004ab8e7f10b6cb7b7a3179626fad9801da8998","tests/integration/queries/group_sort_derive_select_join.prql":"053ccf433faf9e6337a9d3f0a40f42dd371a685cf1d6ff547f74b37e1c44136a","tests/integration/queries/group_sort_filter_derive_select_join.prql":"768f49aa44cd1bed01f3f2ec0defc8800b62bab1c1e6a32b602df5ea07730a85","tests/integration/queries/group_sort_limit_take.prql":"eef5ecbf1bbb355723d70824022f9b1bc6a0b38315bad3a0e1422e9159a0e934","tests/integration/queries/invoice_totals.prql":"2326fd37e0bc4790da3ad8220f896e258592511856b4eda74822c404efccdb32","tests/integration/queries/loop_01.prql":"b7d12dad6b4e70783f45a22c17b746ac1586ed7cddb7668438fe1e2f69e3cc88","tests/integration/queries/math_module.prql":"d54d6e51013eb2d8605893471481f0d43265a3268e9d3d1dd14fe9b2a43bd332","tests/integration/queries/pipelines.prql":"925dc4540e08e79c1b3601ff28c592ff00fe9fd5f32a40d346f13e4528181849","tests/integration/queries/read_csv.prql":"610d19a0c778f643cdd698aa6203905d84f26d4b3b8512174ccdbc8f85eccaff","tests/integration/queries/set_ops_remove.prql":"e4739e2b9a5b210ab3c0f55c6dfc7279940aae6c75ec32913d6467a00d66d370","tests/integration/queries/sort.prql":"2ba3447e17b2704612dea9cb5a8262d695d1d18d69ef3c076c482c0713ec47f6","tests/integration/queries/sort_2.prql":"a15ee427291261c10c0fcea26191bf1a36d24a9f08593720017a419fae3b8a4c","tests/integration/queries/sort_3.prql":"d563410e670378d13ecf83804fb235bf698eef1d8979d5c81b22be62e963cfa5","tests/integration/queries/switch.prql":"80cf00bd6dc34ef672a5979718746bf80c95f69533c9c1b74ce3de0582e569a9","tests/integration/queries/take.prql":"10c859f2c43b001cc984eece564325cbb1b3dd467a9e84416246c083eefefdcc","tests/integration/queries/text_module.prql":"44301ba5d6932e1673038958d3f9354015642796d9b3a173f9ef56f75d3c9393","tests/integration/queries/window.prql":"269f99899a0915eb116c49286d1664e4210b09e0b79768dd11bcc2a687c15958","tests/integration/snapshots/integration__queries__compile__aggregation.snap":"60a3b3353bf73c6b0f58010d7ec5d06edae86c7860c6a8c8537dc5f35d7089bb","tests/integration/snapshots/integration__queries__compile__append_select.snap":"1d6b7030cc5850e2ec1007fc39d5798d8848804088f60c2f0a34f29d581d0a06","tests/integration/snapshots/integration__queries__compile__append_select_compute.snap":"1ad29c029b998cb4cb50662e8c1e019f9aad29554aa29f96a5d8a31f24d2270f","tests/integration/snapshots/integration__queries__compile__append_select_multiple_with_null.snap":"e17523c8a071a4e35a19bb3e36dc8bfc239616a3b72988f13c759cace0ca9b24","tests/integration/snapshots/integration__queries__compile__append_select_nulls.snap":"247ce1acc1d36e320128ccf258aa60638f32ed35477c68102c6701c4c89f7cf3","tests/integration/snapshots/integration__queries__compile__append_select_simple.snap":"0be768482b1dea595bb586ba92ee3f0ae51d7d52eaea2e99d83cf8a6b68fee52","tests/integration/snapshots/integration__queries__compile__arithmetic.snap":"89ac226f33e669974df2fce1066bec391161b72c9dda558c1a0601ffc43f7ad2","tests/integration/snapshots/integration__queries__compile__cast.snap":"8801612a83adbded148448c5f9a433fd26a6a9dd0a0c8a95ffbfc563e86eb5a2","tests/integration/snapshots/integration__queries__compile__constants_only.snap":"f193fa72460dc85aa9e3df4ceccaea3937f6477db50beffd5ba863b7806472e8","tests/integration/snapshots/integration__queries__compile__distinct.snap":"cc4cfe653e03237f2625b4af5ef4216a16ae360ba5692d7b63fa59c320c150ff","tests/integration/snapshots/integration__queries__compile__distinct_on.snap":"b4c69b1a0a54c6004ef91dd6bb9ab632bb6b77d376d6c22183dbc607b2d01f01","tests/integration/snapshots/integration__queries__compile__genre_counts.snap":"b4149473d2d4e0049c4e67f05af07b89d2677c196d9f2e522024b11bd1a0d358","tests/integration/snapshots/integration__queries__compile__group_all.snap":"25b3095614f187967e3b9ddffb94cf24f09445c8f753527543255bdccba3f3c1","tests/integration/snapshots/integration__queries__compile__group_sort.snap":"087f547c9b3a9bf9aa22e9805f807ca2db6f4895702dd145c224e1bfcb7da6a9","tests/integration/snapshots/integration__queries__compile__group_sort_derive_select_join.snap":"dfd47ca3565ebcd5a154c10655c699b1e9c38a658d47558736dec0adcebdfd44","tests/integration/snapshots/integration__queries__compile__group_sort_filter_derive_select_join.snap":"3895ca6656a2f6bb66a004bba57a61c06fdf64ca90029f7e2cde96bc18acfa78","tests/integration/snapshots/integration__queries__compile__group_sort_limit_take.snap":"5c9ce0a6d745bdf66fad6c0a41439f86beb9f9d6d698084afce43e148d752de5","tests/integration/snapshots/integration__queries__compile__invoice_totals.snap":"01a3b8e799d81433b45e37eedd0993eacc56de2c6cb41ae96d63c548ee06c90a","tests/integration/snapshots/integration__queries__compile__loop_01.snap":"02584dab42b83e08c250dabddfc99fcea7553a67e1a05249cc44221f5c0511d3","tests/integration/snapshots/integration__queries__compile__math_module.snap":"c0d3a8d0f8542f4818ed1821760783d33616670b0eb9e72774b105c2dda6f0e7","tests/integration/snapshots/integration__queries__compile__pipelines.snap":"0f93eec8918f4b0343d01db028ec3cd0298e8fc3536a1fc81806ffe34c449335","tests/integration/snapshots/integration__queries__compile__read_csv.snap":"407bee16f47e625729d3c7b477b6adfc3902e8045c7925cb5d1609757db9e72f","tests/integration/snapshots/integration__queries__compile__set_ops_remove.snap":"6f8213b55e361136b8943fcb846d9ffab0be514e3bf874ef6dff13b1b0fbe458","tests/integration/snapshots/integration__queries__compile__sort.snap":"c6b6bcbae03fbd8331a1246b78122fbeda5f65c973c1452a91388b9d86b01ff0","tests/integration/snapshots/integration__queries__compile__sort_2.snap":"f4599b19c48d5a405ac60cee8a784e14343bfec1d72c71e7a38fc40227602104","tests/integration/snapshots/integration__queries__compile__sort_3.snap":"38d2ed5cc6c70863d7a88777507dbdfd47edaec7f59d3d9655ba12d6dd69a1fe","tests/integration/snapshots/integration__queries__compile__switch.snap":"e86ebcc37f78b9a9f7c5db44b8ccf95b9b71ddc11544f89f20654e40ef822002","tests/integration/snapshots/integration__queries__compile__take.snap":"58f7de8afbeb48753db6f3d3ea8a37eb37059b323030f04ea8c70c520ced753a","tests/integration/snapshots/integration__queries__compile__text_module.snap":"898016384fdf7b6d0f892313c4a6ca290a0c47a3905130d1893cee01cb2d17fd","tests/integration/snapshots/integration__queries__compile__window.snap":"37097f921fc47f1887cd0b7ff573a694f5c8a119c2554a9140c0458692d23b30","tests/integration/snapshots/integration__queries__compileall__aggregation.snap":"89083ded8f1e2ea94d46d62b8d5f0013426ddab65b250eef06fdfa320b2d7603","tests/integration/snapshots/integration__queries__compileall__append_select.snap":"4bf16631b1aa816c6f70a90b23947174a0f39f9d14ccc58c33dd27be3ed1edb4","tests/integration/snapshots/integration__queries__compileall__append_select_compute.snap":"bafcd4ca18be3769ccfcd94c6ecb1026c5fb88ba1dae068aa3a58b13b17b6cb2","tests/integration/snapshots/integration__queries__compileall__append_select_multiple_with_null.snap":"7ccf1eb99c6d158731b46654ab91e4c8c7d448237ed2b47f698d8d6e78f37591","tests/integration/snapshots/integration__queries__compileall__append_select_nulls.snap":"19ebd4fd38356dad27f107d72a009d9c1d84346112dc067e3b9a262f61e66b1f","tests/integration/snapshots/integration__queries__compileall__append_select_simple.snap":"3c1e96a28d1687254f118dd759f1b868d2fe51dea4fd5ae058801e3865d0e257","tests/integration/snapshots/integration__queries__compileall__arithmetic.snap":"729d3b6f7a23909ba7a596c7c0cc5004c689fb47bbd591ed846b603bf3ae398a","tests/integration/snapshots/integration__queries__compileall__cast.snap":"7778f61aa91d12e6d6ebe0d76796d75b56173886ce2ab02d7636337bcde52ca1","tests/integration/snapshots/integration__queries__compileall__constants_only.snap":"2a440caa0908509a700d032faba89eb4737eaa356bf50139dc93429170ca9f0c","tests/integration/snapshots/integration__queries__compileall__distinct.snap":"c7bd11bcbc3368c39b1f3c8399a0f06a7114a9f7ac736cb4b0e92f6d9ffbacd7","tests/integration/snapshots/integration__queries__compileall__distinct_on.snap":"dada9a8eeec3b6ec025bc913f9868ce06616055d03c5950bf1ad87c132dd2b16","tests/integration/snapshots/integration__queries__compileall__genre_counts.snap":"2ee5d1c3db1ce2a97e9d03600c52efeb15a22483e8eef275c4f53c3b13a7015f","tests/integration/snapshots/integration__queries__compileall__group_all.snap":"79117fd261e2357c63fe634744ea7fd544362007243a580f64f7b725b08a90bc","tests/integration/snapshots/integration__queries__compileall__group_sort.snap":"48609f619ec0f07e555bf30e695f34d45789b8c0eb2f4fd813060caf5f006f2b","tests/integration/snapshots/integration__queries__compileall__group_sort_derive_select_join.snap":"3a6571354b4987eb57ef6ffa91f774cd548196c93885c7001ba967c223cfb242","tests/integration/snapshots/integration__queries__compileall__group_sort_filter_derive_select_join.snap":"f6b4e6e2f6ed796cc2c0ca8a971797fe94a02b451bda20456979a20abb05be8b","tests/integration/snapshots/integration__queries__compileall__group_sort_limit_take.snap":"225bb45d29b03ae3998d371e2cd6ee5c5ea6b162481a807d0853936318912432","tests/integration/snapshots/integration__queries__compileall__invoice_totals.snap":"90a4b3f43c0a5521a8eac5e88cd7e2426a96eebfed564cb053c7be8994e24a3f","tests/integration/snapshots/integration__queries__compileall__loop_01.snap":"ffa362fcce88618413c5693d586429578b5033d7883d716ae69035d2e60ba747","tests/integration/snapshots/integration__queries__compileall__math_module.snap":"9b49370fa8660bd79fa309e94f79567b257632695273cbd1d521a5a0489782fe","tests/integration/snapshots/integration__queries__compileall__pipelines.snap":"4ce828a79f09f66ad6c59f6dc3dadd703a8426ade51b8784bdd2e5fb7f70c20f","tests/integration/snapshots/integration__queries__compileall__read_csv.snap":"487e69c5ebab20b1476bb4d8ab0f2c3b62beb13ff40d0156d79c04a470cef34e","tests/integration/snapshots/integration__queries__compileall__set_ops_remove.snap":"3c2701f63beac7e1ce5a8e8762f807ce41222f98d4f84baf76cc4cfcfa9a68e8","tests/integration/snapshots/integration__queries__compileall__sort.snap":"5cb02f7fa8fc7c6e1221d6b1158f93c27eab0a652ccf093e9a9f3beb3dc16c50","tests/integration/snapshots/integration__queries__compileall__sort_2.snap":"9237ecdaf8f337cb8aa517880c008ef6f85dc946616487afdf84cc73641b697d","tests/integration/snapshots/integration__queries__compileall__sort_3.snap":"fe6c59bc9d8896438a323891b8d4073dbfd82af9be0e7da4018e84eacf0b2814","tests/integration/snapshots/integration__queries__compileall__switch.snap":"344551accad3ede6f8878c8ee5b3d36d0f68b0d827c0badb8b345c2019525c71","tests/integration/snapshots/integration__queries__compileall__take.snap":"6a7fea53e457ea86223050de50b1717169373aaabd97e82b0f15c0a0f888fc42","tests/integration/snapshots/integration__queries__compileall__text_module.snap":"a02d1a87390041a088eee7e4871672bbf91d9fc4feeb2f96053c79e741b492b8","tests/integration/snapshots/integration__queries__compileall__window.snap":"dbe1b13d66a5a65820d20e3c2dec9ea7a4bfc1548b9e324e5fc8c66ea9166273","tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap":"7a6dacddb198496064f01f8b3ca1ec74396e913a61cabe8576b7220a186aa5f5","tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap":"cb9b0165c7fcd73e36ff8cc1e186b1f1333a29e060ab3d96e0cbed83af4511e5","tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap":"0885ea73050248ad48472dc50a038f0fc41fbf2fcc4a66ebe4ddc264157a61f5","tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap":"9a3fa024bc87d07fa3f024b4130216d8202c51d9425687144da7900ef4b2d4bc","tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap":"fd6b90bb8b2d983ac3ae8097dea448ac2b4e71d54d6485e2bab3e646811ccb50","tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap":"ee000bb25101b997f11b5cbe075901af56943d58605d330cbe8c246a26f4f0ed","tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap":"d1364882751ad8b40dc13c7a3d9ecdaf4b84638d9427d720d9ca81b6ce7b1ebf","tests/integration/snapshots/integration__queries__debug_lineage__cast.snap":"6d53cf6269712e557055a467ead3dec53ae544805d29cf485b6b2ad82c2b8dff","tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap":"ab9bf357a57f05dc7236948522d4e5ee5192bb9953e66b52ec7b7b28a8adec65","tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap":"4ff6401742a03fb0c3f253f7d18a57ea48d1bd26f1d4553dd100a3d9b539eb6c","tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap":"0e855875d8669836ba69edf8075440e5008b4a7024a9e18146a4588b6f70d6bc","tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap":"f60a717ef9cdaa4dee3ee451666f2b9186d41774bbb6ee5eab8506d05152868c","tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap":"6ff2d0156a6f154e7594aaa27825b541e02a4cccc8d16dd8ffb2cab95ce4a535","tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap":"9fade401949000a0ed87cff4b4e816073df5061c33bf225851dd51b5b1b7307e","tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap":"d6a872effb2fd0f01a7e5f4058e81a82019269da1be7a858e106f3069b87e154","tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap":"16b5aba87b2781a3edb09dc78562908e094a20d523f86eb56cecedab2f8a9a38","tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap":"5e29afd4dd19b1cd03000f22d5c873aa5c3cc75b8ac6e9e28534b30d407560c0","tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap":"ca5bb8b34eccd080081a8e30b3e6371915874d57beb0ba263ee8b96a3fbc97ea","tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap":"40baa8ad1d0f1b9f80147e08f7f74e5c21a515891e34c17fbdf9bce3fe80447a","tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap":"ead5f26a32ece7813c8943a5b47be2af18b26095ccf6b53c9f69a483058dae34","tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap":"ea210ba10d2f5203b00821ee7674131274ceb11ec8cc5fcf12c99beb57084d62","tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap":"34e5c68068dbf425be68adf9bb06b66ed4a9fb2afac4c3601711942d8bbdf713","tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap":"dbd42b8e066f49b65bad06cee1e7f306e4111df454465c1ce92e7e759e7fd89f","tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap":"1f576bf9554b724df80d8db259b33946c78bf8e544c4b91e8051501fc1a5c9bc","tests/integration/snapshots/integration__queries__debug_lineage__sort.snap":"21454dd7f03b0e4a6fa3627d4ea82b1ac4fb3a0d83a4d63e621e22892b256128","tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap":"993f89abc297954d57d7bd52995a267c0e6bb8cedf2c98b67c2a1f2b9d925b06","tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap":"42fb25f1dfed854f438b2fd0868a31b7332b73d9bfd68ce188ae789c09027315","tests/integration/snapshots/integration__queries__debug_lineage__switch.snap":"9e48d1bf0d8646a68f82cd66da820fee3b0e32ef77b38c94acb6c94daed32af1","tests/integration/snapshots/integration__queries__debug_lineage__take.snap":"d2eb8f472924ffd82a96841b9340b7d26228fb5a2673963f8de7cd16c66da8eb","tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap":"0172dca58167e5a254a9aa04c2b858577505eb5a840b30425202e019162a72ec","tests/integration/snapshots/integration__queries__debug_lineage__window.snap":"4139ca9326407e9514986f2c23cae8385ab36a5ce8db99e905c512bd9bcc1e81","tests/integration/snapshots/integration__queries__fmt__aggregation.snap":"d36eba345aeefce8f297b2c45a5300446bb310959dc738f95fca7c0aa2500e68","tests/integration/snapshots/integration__queries__fmt__append_select.snap":"789d7fa0234b24f8f0d4058c0c7d505785c99e2a18c8d6b40e8476541c26db2b","tests/integration/snapshots/integration__queries__fmt__append_select_compute.snap":"41f608542edcc127389ac33fbd1873e66e5f6da35c7ba6df21969eea579c7c2b","tests/integration/snapshots/integration__queries__fmt__append_select_multiple_with_null.snap":"237278d6209726072fe0f84a99a45e6c2fb3c271332e7d96c89f521e6f2e4135","tests/integration/snapshots/integration__queries__fmt__append_select_nulls.snap":"de66b30f42f4734f6f1bae1e6fc61baa8c20cd8f72afc48d1effb92ad3013d1d","tests/integration/snapshots/integration__queries__fmt__append_select_simple.snap":"485b9ee4b6cdb975e672aeb595b621e209601abd2c26a3a8847660518bfd03f0","tests/integration/snapshots/integration__queries__fmt__arithmetic.snap":"df30301d7b22e6660df6a3088a0e1c932ba490ac1b7ca8c45a890e673e11f142","tests/integration/snapshots/integration__queries__fmt__cast.snap":"42360ebe40e16dd4abf941aec8c092607ea595d13bb595520fcbb48540ba5995","tests/integration/snapshots/integration__queries__fmt__constants_only.snap":"ea47bd98f9ca7b36971cf9fa339c617b19685c7cedbcb105775e993816f3860c","tests/integration/snapshots/integration__queries__fmt__date_to_text.snap":"6bbd760a84bb4bac275c41b6a27f29cdc9ea9d9fcf9c54bbf8e524125409a806","tests/integration/snapshots/integration__queries__fmt__distinct.snap":"f1f25d5a3492c214b47c5d1fc28b0008014c790cdeceea9772a2395847b10cf5","tests/integration/snapshots/integration__queries__fmt__distinct_on.snap":"998344fe8adaa26c9d473070f6dfdcb4239e4d95c02c25cf6ef755108d64f093","tests/integration/snapshots/integration__queries__fmt__genre_counts.snap":"b3cce7d8c93b6821a21a29aa367e22f38457dff8a56833cd878e07870ebedef6","tests/integration/snapshots/integration__queries__fmt__group_all.snap":"a3409b7da6211eccb6bf77796c09afba7e2f21d9f08b7b3a08e4ade09e0d0929","tests/integration/snapshots/integration__queries__fmt__group_sort.snap":"4635a0ac7872bfd28b0a8c3d9bda169e732ee95d8d7b9c82cfbd16c77a3c205b","tests/integration/snapshots/integration__queries__fmt__group_sort_derive_select_join.snap":"f0af4704eae605daef511a08d63dfe553d760d1df48220f9fa1de34acc457488","tests/integration/snapshots/integration__queries__fmt__group_sort_filter_derive_select_join.snap":"1748bbf8711c95c41620ce6d93d059fc1b0a8d77e39f10c38538b8bbf181ac68","tests/integration/snapshots/integration__queries__fmt__group_sort_limit_take.snap":"2e5ef48a3f771857e1e24d9600bfaff549b4c1be5b5f66d550ac37f243d2326c","tests/integration/snapshots/integration__queries__fmt__invoice_totals.snap":"79e5c3143f8cd8d94fb80d07c48a74dee90e11e1776158f2687393ad8698bfed","tests/integration/snapshots/integration__queries__fmt__loop_01.snap":"e14a982f7b08325d56a22e3c2d8ce9f85886a636762184c74e9b0413aca6fc16","tests/integration/snapshots/integration__queries__fmt__math_module.snap":"82bd92e4365d583da9a0fd1f82ba391791b60f82f671cf3037c1adee69609048","tests/integration/snapshots/integration__queries__fmt__pipelines.snap":"e10fa2a3f9f9654953e2c873e8346e7b21054c65fa0ce2b7169d379c15441783","tests/integration/snapshots/integration__queries__fmt__read_csv.snap":"e1e93c9f3c12abc24a2fe50f7f398eec4c79fcbc2fe56a807596386af04bfe1d","tests/integration/snapshots/integration__queries__fmt__set_ops_remove.snap":"49928ad3ac3fdeaf58ad8260f314fc2ee1b71d6069057c4ec575bc9cb65e90bc","tests/integration/snapshots/integration__queries__fmt__sort.snap":"1cdd18a49a4808f98447e424ebf1b72e31a2b8191ab459943e545519025f6bfa","tests/integration/snapshots/integration__queries__fmt__sort_2.snap":"6efcefa10029588a2bf39e0e0255259264458f325f37683c33e55873f5b1b5f8","tests/integration/snapshots/integration__queries__fmt__sort_3.snap":"a38c92663b6cb11893992ea0addee33a95ecae144fa4e9f5954ceba89ccea8b7","tests/integration/snapshots/integration__queries__fmt__switch.snap":"1217f4eaf2a337a49e6b24e62c5886dd1b679437ccebf7a16fa6fca2c559f7c4","tests/integration/snapshots/integration__queries__fmt__take.snap":"6db657b28c66d24f8fbe8a73f39267757375629c92b33260ab14be1b488d6932","tests/integration/snapshots/integration__queries__fmt__text_module.snap":"6ca6d2364e58daf886ffaf08ed2ed67b39ec6d64e26c29e5686a14aab195b3cc","tests/integration/snapshots/integration__queries__fmt__window.snap":"9496f85ad1d339bebdc13294781df653350d488accbba82e6067f2d712733ec3","tests/integration/snapshots/integration__queries__lex__aggregation.snap":"cb713533b768349ad2194e0a18b8f332c6fafa29846bc791f0a9f505adfeee9c","tests/integration/snapshots/integration__queries__lex__append_select.snap":"f4b1157adbdb269ccb5ece747e52d7cee84d5bf30384370c2c7628973f03f3a2","tests/integration/snapshots/integration__queries__lex__append_select_compute.snap":"36b791f3399143ad6379bc20e2b080144e6913f11db0263a928fc7b04fcec67c","tests/integration/snapshots/integration__queries__lex__append_select_multiple_with_null.snap":"244ca3d20620c9d42da60aee0e487eb56666fe415a2443a9cc98d8adc2a0245a","tests/integration/snapshots/integration__queries__lex__append_select_nulls.snap":"fa6aa192c45a697fa446509215b9378b3a93bff175b16d34e19f2041efdd45e1","tests/integration/snapshots/integration__queries__lex__append_select_simple.snap":"f3e57b8a46ddcf222245c196e880e24d05f7f501558b61bdc30647faf207785e","tests/integration/snapshots/integration__queries__lex__arithmetic.snap":"3b20fc8e3dd5ab835c159dcafc997231d4bb6b68da0db3b315f780181eea48e8","tests/integration/snapshots/integration__queries__lex__cast.snap":"dc6755d1c056cb514c6ccaa913879dbb331642a8bb5f1098148c5368b2b4ce89","tests/integration/snapshots/integration__queries__lex__constants_only.snap":"ab5033790a4f8502b41a1d58342beff818c28a00c816d251dfef76f5d32dbcba","tests/integration/snapshots/integration__queries__lex__date_to_text.snap":"d85a67ee9111e518556e8da94488766f63f522296bb4b0c7dff2cf77b386073a","tests/integration/snapshots/integration__queries__lex__distinct.snap":"ccf2903f30d4c93e0d5343d4e4983a6d1111e12743c977853deca6c701201a26","tests/integration/snapshots/integration__queries__lex__distinct_on.snap":"59db3d07e6e508321e3e8cd2f1fbe22db5aa9b238bfbd4c7a42a9abe71732ad8","tests/integration/snapshots/integration__queries__lex__genre_counts.snap":"e5f8742f3c8c240edbc363d59eeb1c00bc8e50ec135df1cdc8a5309c931f25ec","tests/integration/snapshots/integration__queries__lex__group_all.snap":"24e3ec4e8aed436e4287fa98c2509aed7d6ec2748de97ab9ad67b17ffcb3edaa","tests/integration/snapshots/integration__queries__lex__group_sort.snap":"5a64557f64b843dc610dc206281ac54a29138084b7e383507ca8a442b265f987","tests/integration/snapshots/integration__queries__lex__group_sort_derive_select_join.snap":"41ae5d3c6f81cd26a086cc923b9702082d832fbcee3e2775f673e5c812e55e28","tests/integration/snapshots/integration__queries__lex__group_sort_filter_derive_select_join.snap":"23470a981f2c1cc52e92b72d41d2e9a837da2252b1ff2e6b559cc8c04b984d1b","tests/integration/snapshots/integration__queries__lex__group_sort_limit_take.snap":"60ead9d00fee5b953e5f722dfbc344d349d3ec342c24b009ebe10eb284b5f51f","tests/integration/snapshots/integration__queries__lex__invoice_totals.snap":"4c3d670693cc0e532b02685772740ad865daa582c5d13ff57d56b64f4955a40c","tests/integration/snapshots/integration__queries__lex__loop_01.snap":"47f78f5f02916d2ca664c698c6579380c7ee204c6fb3f80a0cda29d5a27d49df","tests/integration/snapshots/integration__queries__lex__math_module.snap":"631d09739454b40129879fdd9f431459d8fd6c2372e914844865d09ae95a1a95","tests/integration/snapshots/integration__queries__lex__pipelines.snap":"b87baf2e02fb9ec0e364d158969d42494707bb8e62f26e8d7e7a745147953e38","tests/integration/snapshots/integration__queries__lex__read_csv.snap":"14bba58bf4fd4198d84867ca00961d8aec4f532f01c0ccba8295194bc31503e3","tests/integration/snapshots/integration__queries__lex__set_ops_remove.snap":"da3297a240a08bd1e06ee5404159dfd7dab80aeb8b1983739a1101fdcffb2fb8","tests/integration/snapshots/integration__queries__lex__sort.snap":"e689fac3695d80be9bc425af5772eedde7fe0597c9afc479ca3431ac7f757c16","tests/integration/snapshots/integration__queries__lex__sort_2.snap":"721f368c37f9f82322eb4c453feb46dfffa10788ef89fb191f9dabc669e4eaf6","tests/integration/snapshots/integration__queries__lex__sort_3.snap":"6026d04246cd514760320caaef1d0d0cca4e617476782988d4dfb0ce915917a6","tests/integration/snapshots/integration__queries__lex__switch.snap":"c3393e60cad54e8fbdadd67bb1ce8bbbeb12a827435e0e22af8527c0c4b09931","tests/integration/snapshots/integration__queries__lex__take.snap":"3071602ecff06f87c009ba6b74bd37667de0d5eaf87ae0a334bacd2ab646eae1","tests/integration/snapshots/integration__queries__lex__text_module.snap":"ec18275d3cccdbce093859abd766d09e56ab87b960328e811f0b483ede5c2384","tests/integration/snapshots/integration__queries__lex__window.snap":"f43ede7dae9c2979abaa53a41b095438cfb2ef70bf07538603c1ec923c4161f0","tests/integration/snapshots/integration__queries__results__aggregation.snap":"f0d0774b82f3ba6967d28a3cdfa16c4c32a17b965a6122ba5532338e0430a335","tests/integration/snapshots/integration__queries__results__append_select.snap":"30f4ba43c590fb7f323d7bd904a52b97d40a403db79d6e445b965a225c5df18a","tests/integration/snapshots/integration__queries__results__append_select_compute.snap":"cee7379b0a4ce6f61b3dfb78607a2b41da1ec147184056124d1a148204cb260e","tests/integration/snapshots/integration__queries__results__append_select_multiple_with_null.snap":"14e6c9c09bea2e0b568f6ff883722518d56cb4e37329ee80be99ab05efcb521d","tests/integration/snapshots/integration__queries__results__append_select_nulls.snap":"bc46d0dc681b2a922ca6121523136b7fccf3feb08123217763da52000f0591bc","tests/integration/snapshots/integration__queries__results__append_select_simple.snap":"d8533e90c2ad8a3d50059ddd729aa2f8e09907f24211415f7062014e3e94c22d","tests/integration/snapshots/integration__queries__results__arithmetic.snap":"6e3cdac428dc9de760f46f3f0ff56d47e7593bbef82d0d3e8ca20153ef89d966","tests/integration/snapshots/integration__queries__results__cast.snap":"330c6f1c6529904d2b6232db35f9bcc9f33d3b00f5ac5428add39677a5bdcf47","tests/integration/snapshots/integration__queries__results__constants_only.snap":"376d7c1c1584d3f9e2522320c6675d8d2a6c66be343b2e6461468cfb7500d43c","tests/integration/snapshots/integration__queries__results__date_to_text.snap":"25f3a603e98e9a2924e6440d0ad3f0103f4c1a3e977be39b10316581f9e551a0","tests/integration/snapshots/integration__queries__results__distinct.snap":"5f375f988d61cacad06780768d681f12243513bd7faa36f2bceff233d8c9439c","tests/integration/snapshots/integration__queries__results__distinct_on.snap":"d2226f2eb7679d858c55b24bf0f9023d64f2a730e0d48516bb4ab94ac9882db9","tests/integration/snapshots/integration__queries__results__genre_counts.snap":"f072e11a36b7721bca52b0f337239f84ce3ce7068a9cf3cb8158ee812305879e","tests/integration/snapshots/integration__queries__results__group_all.snap":"3d312bad837ac209e3b22cb126414d28c03f8f01878b3cba58cba748c184fbe5","tests/integration/snapshots/integration__queries__results__group_sort.snap":"74ef5ab97d731e0abebe7da0f4d3e74448e04c1e4cb16a8992f85903418ce35e","tests/integration/snapshots/integration__queries__results__group_sort_derive_select_join.snap":"60bddf968783538e347a876fdbc8dddcbc8493616c05963479bb55e6e5737ec9","tests/integration/snapshots/integration__queries__results__group_sort_filter_derive_select_join.snap":"0441e7a34b34fbe1f5ec19e0e3ef6aec95e9b01db3eab2d25ae04808c06dad7b","tests/integration/snapshots/integration__queries__results__group_sort_limit_take.snap":"5359de385256f87aceb72322026baea7d67b1d9002394c74d471bd0b994292fe","tests/integration/snapshots/integration__queries__results__invoice_totals.snap":"b8b9739509f84aae00ca6763ba84dd03419029c559b5bebf059904c5cbaeb952","tests/integration/snapshots/integration__queries__results__loop_01.snap":"666b8a9661a203523c877686b3722c3fc2e29308bcdb03e45ec3f1597660892c","tests/integration/snapshots/integration__queries__results__math_module.snap":"d6fc2e209d1e922b878686bedb9d0d213127503e3dcb20af82269bfab7dfcdba","tests/integration/snapshots/integration__queries__results__pipelines.snap":"4c2352d7e34e17b81150a91097791002a46cc6def21719919b21374ace2332e3","tests/integration/snapshots/integration__queries__results__read_csv.snap":"0ad4705d738efe2594e45d6dd2a51e66ddf8775e64ec2c6a07b533e7fc333fb7","tests/integration/snapshots/integration__queries__results__set_ops_remove.snap":"1766979b1375df6164f1c54f6a171089e19aa90e63e17a06d2324466cd4766d3","tests/integration/snapshots/integration__queries__results__sort.snap":"e761a1512982d3de150c0c00e0edb3f2bbc0f925bb0b738fb96dbaa156b46c01","tests/integration/snapshots/integration__queries__results__sort_2.snap":"207acde3c240364d857ad947d983f3bbe810f6e654cfac76cad4b203d21edd9d","tests/integration/snapshots/integration__queries__results__sort_3.snap":"5466803cec819d3b20d9d973476c1370037af6a22a67822319421db3110b3aa3","tests/integration/snapshots/integration__queries__results__switch.snap":"e532eb6d441395d792d5b0f89c26c5e38240e4df2853457f7f96a8b17932a68b","tests/integration/snapshots/integration__queries__results__take.snap":"6d0c08017c73f2d6f889e1fb8f080d5d39dbea44236fb3047036487b1369f44d","tests/integration/snapshots/integration__queries__results__text_module.snap":"d4c27f4bd32063cfc5170442d4982e94098019b872f567a48b0615d8980604b9","tests/integration/snapshots/integration__queries__results__window.snap":"e8e683ba0d0daaeebc8e5cdc9906d156f1d71db6885af49a4cbbcf5e5f739374","tests/integration/sql.rs":"0a42c29d75960cf12df351c2918ddd3f2f7555a6cad6a258d57960686c9258e8"},"package":"aef6995c7491eb36b5e8db7680fcfb5dd19bfc2759af68e791e2f41fee3fb29e"} \ No newline at end of file diff --git a/prqlc-0.13.12/.cargo_vcs_info.json b/prqlc-0.13.12/.cargo_vcs_info.json new file mode 100644 index 0000000000..2cdf51776c --- /dev/null +++ b/prqlc-0.13.12/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "ec18eb8990825ba195e1e8b37e32050efa9baf45" + }, + "path_in_vcs": "prqlc/prqlc" +} \ No newline at end of file diff --git a/prqlc-0.13.11/ARCHITECTURE.md b/prqlc-0.13.12/ARCHITECTURE.md similarity index 100% rename from prqlc-0.13.11/ARCHITECTURE.md rename to prqlc-0.13.12/ARCHITECTURE.md diff --git a/prqlc-0.13.11/Cargo.lock b/prqlc-0.13.12/Cargo.lock similarity index 96% rename from prqlc-0.13.11/Cargo.lock rename to prqlc-0.13.12/Cargo.lock index 0bee50f65c..421cd81033 100644 --- a/prqlc-0.13.11/Cargo.lock +++ b/prqlc-0.13.12/Cargo.lock @@ -81,21 +81,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" -[[package]] -name = "anstream" -version = "0.6.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" -dependencies = [ - "anstyle", - "anstyle-parse 0.2.7", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - [[package]] name = "anstream" version = "1.0.0" @@ -103,7 +88,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", - "anstyle-parse 1.0.0", + "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", @@ -117,15 +102,6 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - [[package]] name = "anstyle-parse" version = "1.0.0" @@ -188,9 +164,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "arrow" -version = "56.2.0" +version = "58.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e833808ff2d94ed40d9379848a950d995043c7fb3e81a30b383f4c6033821cc" +checksum = "d441fdda254b65f3e9025910eb2c2066b6295d9c8ed409522b8d2ace1ff8574c" dependencies = [ "arrow-arith", "arrow-array", @@ -206,23 +182,23 @@ dependencies = [ [[package]] name = "arrow-arith" -version = "56.2.0" +version = "58.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad08897b81588f60ba983e3ca39bda2b179bdd84dced378e7df81a5313802ef8" +checksum = "ced5406f8b720cc0bc3aa9cf5758f93e8593cda5490677aa194e4b4b383f9a59" dependencies = [ "arrow-array", "arrow-buffer", "arrow-data", "arrow-schema", "chrono", - "num", + "num-traits", ] [[package]] name = "arrow-array" -version = "56.2.0" +version = "58.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8548ca7c070d8db9ce7aa43f37393e4bfcf3f2d3681df278490772fd1673d08d" +checksum = "772bd34cacdda8baec9418d80d23d0fb4d50ef0735685bd45158b83dfeb6e62d" dependencies = [ "ahash 0.8.12", "arrow-buffer", @@ -231,29 +207,33 @@ dependencies = [ "chrono", "half", "hashbrown 0.16.1", - "num", + "num-complex", + "num-integer", + "num-traits", ] [[package]] name = "arrow-buffer" -version = "56.2.0" +version = "58.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e003216336f70446457e280807a73899dd822feaf02087d31febca1363e2fccc" +checksum = "898f4cf1e9598fdb77f356fdf2134feedfd0ee8d5a4e0a5f573e7d0aec16baa4" dependencies = [ "bytes", "half", - "num", + "num-bigint", + "num-traits", ] [[package]] name = "arrow-cast" -version = "56.2.0" +version = "58.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919418a0681298d3a77d1a315f625916cb5678ad0d74b9c60108eb15fd083023" +checksum = "b0127816c96533d20fc938729f48c52d3e48f99717e7a0b5ade77d742510736d" dependencies = [ "arrow-array", "arrow-buffer", "arrow-data", + "arrow-ord", "arrow-schema", "arrow-select", "atoi", @@ -262,27 +242,28 @@ dependencies = [ "comfy-table", "half", "lexical-core", - "num", + "num-traits", "ryu", ] [[package]] name = "arrow-data" -version = "56.2.0" +version = "58.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5c64fff1d142f833d78897a772f2e5b55b36cb3e6320376f0961ab0db7bd6d0" +checksum = "42d10beeab2b1c3bb0b53a00f7c944a178b622173a5c7bcabc3cb45d90238df4" dependencies = [ "arrow-buffer", "arrow-schema", "half", - "num", + "num-integer", + "num-traits", ] [[package]] name = "arrow-ord" -version = "56.2.0" +version = "58.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c8f82583eb4f8d84d4ee55fd1cb306720cddead7596edce95b50ee418edf66f" +checksum = "763a7ba279b20b52dad300e68cfc37c17efa65e68623169076855b3a9e941ca5" dependencies = [ "arrow-array", "arrow-buffer", @@ -293,9 +274,9 @@ dependencies = [ [[package]] name = "arrow-row" -version = "56.2.0" +version = "58.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d07ba24522229d9085031df6b94605e0f4b26e099fb7cdeec37abd941a73753" +checksum = "e14fe367802f16d7668163ff647830258e6e0aeea9a4d79aaedf273af3bdcd3e" dependencies = [ "arrow-array", "arrow-buffer", @@ -306,32 +287,32 @@ dependencies = [ [[package]] name = "arrow-schema" -version = "56.2.0" +version = "58.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3aa9e59c611ebc291c28582077ef25c97f1975383f1479b12f3b9ffee2ffabe" +checksum = "c30a1365d7a7dc50cc847e54154e6af49e4c4b0fddc9f607b687f29212082743" dependencies = [ "bitflags 2.11.0", ] [[package]] name = "arrow-select" -version = "56.2.0" +version = "58.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c41dbbd1e97bfcaee4fcb30e29105fb2c75e4d82ae4de70b792a5d3f66b2e7a" +checksum = "78694888660a9e8ac949853db393af2a8b8fc82c19ce333132dfa2e72cc1a7fe" dependencies = [ "ahash 0.8.12", "arrow-array", "arrow-buffer", "arrow-data", "arrow-schema", - "num", + "num-traits", ] [[package]] name = "arrow-string" -version = "56.2.0" +version = "58.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53f5183c150fbc619eede22b861ea7c0eebed8eaac0333eaa7f6da5205fd504d" +checksum = "61e04a01f8bb73ce54437514c5fd3ee2aa3e8abe4c777ee5cc55853b1652f79e" dependencies = [ "arrow-array", "arrow-buffer", @@ -339,7 +320,7 @@ dependencies = [ "arrow-schema", "arrow-select", "memchr", - "num", + "num-traits", "regex", "regex-syntax 0.8.10", ] @@ -634,9 +615,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.60" +version = "4.5.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" +checksum = "52fa72306bb30daf11bc97773431628e5b4916e97aaa74b7d3f625d4d495da02" dependencies = [ "clap_builder", "clap_derive", @@ -644,11 +625,11 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.60" +version = "4.5.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" +checksum = "2071365c5c56eae7d77414029dde2f4f4ba151cf68d5a3261c9a40de428ace93" dependencies = [ - "anstream 0.6.21", + "anstream", "anstyle", "clap_lex", "strsim", @@ -698,9 +679,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.55" +version = "4.5.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" +checksum = "dec5be1eea072311774b7b84ded287adbd9f293f9d23456817605c6042f4f5e0" dependencies = [ "heck", "proc-macro2", @@ -791,9 +772,9 @@ checksum = "510ca239cf13b7f8d16a2b48f263de7b4f8c566f0af58d901031473c76afb1e3" [[package]] name = "connector_arrow" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe26854010e9f59dba89218b455fbcb03ad8126c7efedb86013952d5ca86594a" +checksum = "6d8abdae1403f6dccc11eaa6b46aee10ee7f1a1cdeba957f69cceea7ef07f291" dependencies = [ "arrow", "byteorder", @@ -833,6 +814,17 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "console" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87" +dependencies = [ + "encode_unicode", + "libc", + "windows-sys 0.61.2", +] + [[package]] name = "const-random" version = "0.1.18" @@ -1102,9 +1094,9 @@ dependencies = [ [[package]] name = "duckdb" -version = "1.4.4" +version = "1.10501.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8685352ce688883098b61a361e86e87df66fc8c444f4a2411e884c16d5243a65" +checksum = "f13bc6d6487032fc2825a62ef8b4924b2378a2eb3166e132e5f3141ae9dd633f" dependencies = [ "arrow", "cast", @@ -1642,7 +1634,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.6.2", + "socket2 0.6.3", "tokio", "tower-service", "tracing", @@ -1855,11 +1847,11 @@ dependencies = [ [[package]] name = "insta" -version = "1.46.3" +version = "1.47.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82db8c87c7f1ccecb34ce0c24399b8a73081427f3c7c50a5d597925356115e4" +checksum = "7b4a6248eb93a4401ed2f37dfe8ea592d3cf05b7cf4f8efa867b6895af7e094e" dependencies = [ - "console", + "console 0.16.3", "globset", "once_cell", "regex", @@ -2060,15 +2052,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.183" +version = "0.2.185" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" +checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" [[package]] name = "libduckdb-sys" -version = "1.4.4" +version = "1.10501.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78bacb8933586cee3b550c39b610d314f9b7a48701ac7a914a046165a4ad8da" +checksum = "12096c1694924782b3fe21e790630b77bacb4fcb7ad9d7ee0fec626f985bf248" dependencies = [ "cc", "flate2", @@ -2100,9 +2092,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b4103cffefa72eb8428cb6b47d6627161e51c2739fc5e3b734584157bc642a" +checksum = "b1f111c8c41e7c61a49cd34e44c7619462967221a6443b0ec299e0ac30cfb9b1" dependencies = [ "cc", "pkg-config", @@ -2201,12 +2193,19 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" +[[package]] +name = "memo-map" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d1115007560874e373613744c6fba374c17688327a71c1476d1a5954cc857b" + [[package]] name = "minijinja" -version = "2.16.0" +version = "2.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c54f3bcc034dd74496b5ca929fd0b710186672d5ff0b0f255a9ceb259042ece" +checksum = "805bfd7352166bae857ee569628b52bcd85a1cecf7810861ebceb1686b72b75d" dependencies = [ + "memo-map", "serde", ] @@ -2222,9 +2221,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" dependencies = [ "libc", "log", @@ -2234,9 +2233,9 @@ dependencies = [ [[package]] name = "mysql" -version = "27.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090068bc0a24762663338da78414148333d1ee246a7293c10a517ddf1548b291" +checksum = "4a732193888328fc060ab901c0ed1355521267a51ffbfd9a0b3786434c6b8e7f" dependencies = [ "bufstream", "bytes", @@ -2250,7 +2249,7 @@ dependencies = [ "named_pipe", "pem", "percent-encoding", - "socket2 0.6.2", + "socket2 0.6.3", "twox-hash", "url", ] @@ -2275,9 +2274,9 @@ dependencies = [ [[package]] name = "mysql_common" -version = "0.36.2" +version = "0.37.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20e7f6a15265801679ddf1ddb38fd74b4555a677a78378d4561fbe5f0b1d4d72" +checksum = "bffc2127d4035fa5a614935c663a15a4468e64e798473e0cc21c8df40a607588" dependencies = [ "base64 0.22.1", "bitflags 2.11.0", @@ -2337,20 +2336,6 @@ dependencies = [ "instant", ] -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -2385,28 +2370,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -2666,9 +2629,9 @@ dependencies = [ [[package]] name = "prqlc" -version = "0.13.11" +version = "0.13.12" dependencies = [ - "anstream 1.0.0", + "anstream", "anyhow", "ariadne", "chrono", @@ -2721,9 +2684,9 @@ dependencies = [ [[package]] name = "prqlc-parser" -version = "0.13.11" +version = "0.13.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3530d0fa478ab1b28989cc48946366ce193ede73c4b94e3d23e6be967391a6d7" +checksum = "9b4885cff41ab8b651cec30a7925a5595e00277ea626a03688ae0751171ecbe6" dependencies = [ "chumsky", "enum-as-inner", @@ -2769,7 +2732,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls 0.23.37", - "socket2 0.6.2", + "socket2 0.6.3", "thiserror 2.0.18", "tokio", "tracing", @@ -2806,16 +2769,16 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.6.2", + "socket2 0.6.3", "tracing", "windows-sys 0.60.2", ] [[package]] name = "quote" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] @@ -2834,9 +2797,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rand" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" dependencies = [ "libc", "rand_chacha 0.3.1", @@ -3114,9 +3077,9 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1c93dd1c9683b438c392c492109cb702b8090b2bfc8fed6f6e4eb4523f17af3" +checksum = "a0d2b0146dd9661bf67bb107c0bb2a55064d556eeb3fc314151b957f313bcd4e" dependencies = [ "bitflags 2.11.0", "csv", @@ -3138,7 +3101,7 @@ dependencies = [ "borsh", "bytes", "num-traits", - "rand 0.8.5", + "rand 0.8.6", "rkyv", "serde", "serde_json", @@ -3364,9 +3327,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" dependencies = [ "serde", "serde_core", @@ -3537,7 +3500,7 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5b441962c817e33508847a22bd82f03a30cff43642dc2fae8b050566121eb9a" dependencies = [ - "console", + "console 0.15.11", "similar", ] @@ -3571,12 +3534,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -3751,9 +3714,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973" dependencies = [ "filetime", "libc", @@ -3962,9 +3925,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.50.0" +version = "1.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" +checksum = "f66bf9585cda4b724d3e78ab34b73fb2bbaba9011b9bfdf69dc836382ea13b8c" dependencies = [ "bytes", "libc", @@ -3972,16 +3935,16 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.6.2", + "socket2 0.6.3", "tokio-macros", "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", diff --git a/prqlc-0.13.11/Cargo.toml b/prqlc-0.13.12/Cargo.toml similarity index 96% rename from prqlc-0.13.11/Cargo.toml rename to prqlc-0.13.12/Cargo.toml index 3879a3f105..1614049e3f 100644 --- a/prqlc-0.13.11/Cargo.toml +++ b/prqlc-0.13.12/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.75.0" name = "prqlc" -version = "0.13.11" +version = "0.13.12" build = "build.rs" autolib = false autobins = false @@ -140,7 +140,7 @@ features = ["auto"] version = "0.5.1" [dependencies.chrono] -version = "0.4.44" +version = "0.4" [dependencies.csv] version = "1.4.0" @@ -163,7 +163,7 @@ version = "0.97.0" optional = true [dependencies.prqlc-parser] -version = "0.13.11" +version = "0.13.12" [dependencies.regex] version = "1.12.3" @@ -172,7 +172,7 @@ version = "1.12.3" version = "1.2.1" [dependencies.semver] -version = "1.0.27" +version = "1.0.28" features = ["serde"] [dependencies.serde] @@ -208,7 +208,7 @@ version = "0.28.0" version = "0.3.3" [dev-dependencies.insta] -version = "1.46.3" +version = "1.47.2" features = [ "colors", "glob", @@ -248,7 +248,7 @@ features = ["backtrace"] optional = true [target.'cfg(not(target_family="wasm"))'.dependencies.clap] -version = "4.5.53" +version = "4.5.61" features = [ "derive", "env", @@ -274,11 +274,11 @@ version = "1.0.0" optional = true [target.'cfg(not(target_family="wasm"))'.dependencies.connector_arrow] -version = "0.10.0" +version = "0.11.0" optional = true [target.'cfg(not(target_family="wasm"))'.dependencies.duckdb] -version = "1.4.4" +version = "1.10501.0" features = [ "bundled", "chrono", @@ -294,12 +294,12 @@ version = "0.4.17" optional = true [target.'cfg(not(target_family="wasm"))'.dependencies.minijinja] -version = "2.15.1" +version = "2.19.0" features = ["unstable_machinery"] optional = true [target.'cfg(not(target_family="wasm"))'.dependencies.mysql] -version = "27" +version = "28" optional = true [target.'cfg(not(target_family="wasm"))'.dependencies.notify] @@ -311,7 +311,7 @@ version = "0.19.10" optional = true [target.'cfg(not(target_family="wasm"))'.dependencies.rusqlite] -version = "0.38.0" +version = "0.39.0" features = [ "bundled", "csvtab", @@ -331,7 +331,7 @@ optional = true default-features = false [target.'cfg(not(target_family="wasm"))'.dependencies.tokio] -version = "1.50.0" +version = "1.51.1" features = ["full"] optional = true diff --git a/prqlc-0.13.11/Cargo.toml.orig b/prqlc-0.13.12/Cargo.toml.orig similarity index 92% rename from prqlc-0.13.11/Cargo.toml.orig rename to prqlc-0.13.12/Cargo.toml.orig index d51705389e..287a68c653 100644 --- a/prqlc-0.13.11/Cargo.toml.orig +++ b/prqlc-0.13.12/Cargo.toml.orig @@ -54,11 +54,11 @@ test-dbs-external = [ ] [dependencies] -prqlc-parser = { path = "../prqlc-parser", version = "0.13.11" } +prqlc-parser = { path = "../prqlc-parser", version = "0.13.12" } anstream = { version = "1.0.0", features = ["auto"] } ariadne = "0.5.1" -chrono = "0.4.44" +chrono = "0.4" csv = "1.4.0" enum-as-inner = { workspace = true } itertools = { workspace = true } @@ -89,7 +89,7 @@ vergen-gitcl = { version = "1.0.0", features = ["build"] } # unique dependencies from the CLI, marked as optional and included in the 'cli' # feature anyhow = { version = "1.0.102", features = ["backtrace"], optional = true } -clap = { version = "4.5.53", features = [ +clap = { version = "4.5.61", features = [ "derive", "env", "wrap_help", @@ -104,22 +104,22 @@ walkdir = { version = "2.5.0", optional = true } # We use minijinja just for the Jinja lexer, which is not part of the # public interface which is covered by semver guarantees. -minijinja = { version = "2.15.1", features = [ +minijinja = { version = "2.19.0", features = [ "unstable_machinery", ], optional = true } # For integration tests. These are gated by the `test-dbs` and `test-dbs-external` features, # rather than dev-dependencies, because dev-dependencies can't be optional. -connector_arrow = { version = "0.10.0", optional = true } -duckdb = { version = "1.4.4", optional = true, features = [ +connector_arrow = { version = "0.11.0", optional = true } +duckdb = { version = "1.10501.0", optional = true, features = [ "bundled", "chrono", ] } futures = { version = "0.3.32", optional = true } -mysql = { version = "27", optional = true } +mysql = { version = "28", optional = true } postgres = { version = "0.19.10", optional = true } -rusqlite = { version = "0.38.0", optional = true, features = [ +rusqlite = { version = "0.39.0", optional = true, features = [ "bundled", "csvtab", ] } @@ -130,7 +130,7 @@ tiberius = { version = "0.12.3", optional = true, default-features = false, feat "rustls", "tds73", ] } -tokio = { version = "1.50.0", optional = true, features = ["full"] } +tokio = { version = "1.51.1", optional = true, features = ["full"] } tokio-util = { version = "0.7.18", optional = true, features = ["compat"] } [dev-dependencies] diff --git a/prqlc-0.13.11/README.md b/prqlc-0.13.12/README.md similarity index 98% rename from prqlc-0.13.11/README.md rename to prqlc-0.13.12/README.md index 7ac0856553..6c60e19133 100644 --- a/prqlc-0.13.11/README.md +++ b/prqlc-0.13.12/README.md @@ -46,7 +46,7 @@ $ echo 'from `albums.csv` | take 3' | prqlc compile | duckdb Executing this command without any argument will start interactive mode, allowing a PRQL query to be written interactively. In this mode, after writing -PRQL and press `Ctrl-d` (Linux, macOS) or `Ctrl-z` (Windows) to display the +PRQL, press `Ctrl-d` (Linux, macOS) or `Ctrl-z` (Windows) to display the compiled SQL. ```sh diff --git a/prqlc-0.13.11/benches/bench.rs b/prqlc-0.13.12/benches/bench.rs similarity index 100% rename from prqlc-0.13.11/benches/bench.rs rename to prqlc-0.13.12/benches/bench.rs diff --git a/prqlc-0.13.11/benches/bench_impl.rs b/prqlc-0.13.12/benches/bench_impl.rs similarity index 100% rename from prqlc-0.13.11/benches/bench_impl.rs rename to prqlc-0.13.12/benches/bench_impl.rs diff --git a/prqlc-0.13.11/build.rs b/prqlc-0.13.12/build.rs similarity index 100% rename from prqlc-0.13.11/build.rs rename to prqlc-0.13.12/build.rs diff --git a/prqlc-0.13.11/src/cli/docs_generator.rs b/prqlc-0.13.12/src/cli/docs_generator.rs similarity index 98% rename from prqlc-0.13.11/src/cli/docs_generator.rs rename to prqlc-0.13.12/src/cli/docs_generator.rs index f5565fe2cc..a30aae5cc9 100644 --- a/prqlc-0.13.11/src/cli/docs_generator.rs +++ b/prqlc-0.13.12/src/cli/docs_generator.rs @@ -343,7 +343,7 @@ mod tests { - + PRQL Docs @@ -421,7 +421,7 @@ mod tests { @@ -448,7 +448,7 @@ mod tests { type user_id = int "; - assert_cmd_snapshot!(prqlc_command().args(["experimental", "doc"]).pass_stdin(input), @r" + assert_cmd_snapshot!(prqlc_command().args(["experimental", "doc"]).pass_stdin(input), @" success: true exit_code: 0 ----- stdout ----- @@ -503,7 +503,7 @@ mod tests { - Generated with [prqlc](https://prql-lang.org/) 0.13.11. + Generated with [prqlc](https://prql-lang.org/) 0.13.12. ----- stderr ----- "); diff --git a/prqlc-0.13.11/src/cli/highlight.rs b/prqlc-0.13.12/src/cli/highlight.rs similarity index 100% rename from prqlc-0.13.11/src/cli/highlight.rs rename to prqlc-0.13.12/src/cli/highlight.rs diff --git a/prqlc-0.13.11/src/cli/jinja.rs b/prqlc-0.13.12/src/cli/jinja.rs similarity index 100% rename from prqlc-0.13.11/src/cli/jinja.rs rename to prqlc-0.13.12/src/cli/jinja.rs diff --git a/prqlc-0.13.11/src/cli/lsp.rs b/prqlc-0.13.12/src/cli/lsp.rs similarity index 100% rename from prqlc-0.13.11/src/cli/lsp.rs rename to prqlc-0.13.12/src/cli/lsp.rs diff --git a/prqlc-0.13.11/src/cli/mod.rs b/prqlc-0.13.12/src/cli/mod.rs similarity index 100% rename from prqlc-0.13.11/src/cli/mod.rs rename to prqlc-0.13.12/src/cli/mod.rs diff --git a/prqlc-0.13.11/src/cli/snapshots/prqlc__cli__test__shell_completion-2.snap b/prqlc-0.13.12/src/cli/snapshots/prqlc__cli__test__shell_completion-2.snap similarity index 100% rename from prqlc-0.13.11/src/cli/snapshots/prqlc__cli__test__shell_completion-2.snap rename to prqlc-0.13.12/src/cli/snapshots/prqlc__cli__test__shell_completion-2.snap diff --git a/prqlc-0.13.11/src/cli/snapshots/prqlc__cli__test__shell_completion-3.snap b/prqlc-0.13.12/src/cli/snapshots/prqlc__cli__test__shell_completion-3.snap similarity index 100% rename from prqlc-0.13.11/src/cli/snapshots/prqlc__cli__test__shell_completion-3.snap rename to prqlc-0.13.12/src/cli/snapshots/prqlc__cli__test__shell_completion-3.snap diff --git a/prqlc-0.13.11/src/cli/snapshots/prqlc__cli__test__shell_completion-4.snap b/prqlc-0.13.12/src/cli/snapshots/prqlc__cli__test__shell_completion-4.snap similarity index 100% rename from prqlc-0.13.11/src/cli/snapshots/prqlc__cli__test__shell_completion-4.snap rename to prqlc-0.13.12/src/cli/snapshots/prqlc__cli__test__shell_completion-4.snap diff --git a/prqlc-0.13.11/src/cli/snapshots/prqlc__cli__test__shell_completion.snap b/prqlc-0.13.12/src/cli/snapshots/prqlc__cli__test__shell_completion.snap similarity index 100% rename from prqlc-0.13.11/src/cli/snapshots/prqlc__cli__test__shell_completion.snap rename to prqlc-0.13.12/src/cli/snapshots/prqlc__cli__test__shell_completion.snap diff --git a/prqlc-0.13.11/src/cli/test.rs b/prqlc-0.13.12/src/cli/test.rs similarity index 98% rename from prqlc-0.13.11/src/cli/test.rs rename to prqlc-0.13.12/src/cli/test.rs index d084b4f5ac..88f11b61f3 100644 --- a/prqlc-0.13.11/src/cli/test.rs +++ b/prqlc-0.13.12/src/cli/test.rs @@ -86,6 +86,7 @@ fn get_targets() { sql.glaredb sql.mssql sql.mysql + sql.oracle sql.postgres sql.redshift sql.sqlite @@ -423,7 +424,7 @@ fn compare_directories(dir1: &Path, dir2: &Path) { fn debug() { assert_cmd_snapshot!(prqlc_command() .args(["debug", "lineage"]) - .pass_stdin("from tracks | select {artist, album}"), @r" + .pass_stdin("from tracks | select {artist, album}"), @" success: true exit_code: 0 ----- stdout ----- @@ -434,29 +435,29 @@ fn debug() { name: - tracks - artist - target_id: 118 + target_id: 120 target_name: null - !Single name: - tracks - album - target_id: 119 + target_id: 121 target_name: null inputs: - - id: 116 + - id: 118 name: tracks table: - default_db - tracks nodes: - - id: 116 + - id: 118 kind: Ident span: 1:0-11 ident: !Ident - default_db - tracks - parent: 121 - - id: 118 + parent: 123 + - id: 120 kind: Ident span: 1:22-28 ident: !Ident @@ -464,9 +465,9 @@ fn debug() { - tracks - artist targets: - - 116 - parent: 120 - - id: 119 + - 118 + parent: 122 + - id: 121 kind: Ident span: 1:30-35 ident: !Ident @@ -474,21 +475,21 @@ fn debug() { - tracks - album targets: - - 116 - parent: 120 - - id: 120 + - 118 + parent: 122 + - id: 122 kind: Tuple span: 1:21-36 children: - - 118 - - 119 - parent: 121 - - id: 121 + - 120 + - 121 + parent: 123 + - id: 123 kind: 'TransformCall: Select' span: 1:14-36 children: - - 116 - - 120 + - 118 + - 122 ast: name: Project stmts: diff --git a/prqlc-0.13.11/src/cli/watch.rs b/prqlc-0.13.12/src/cli/watch.rs similarity index 100% rename from prqlc-0.13.11/src/cli/watch.rs rename to prqlc-0.13.12/src/cli/watch.rs diff --git a/prqlc-0.13.11/src/codegen/ast.rs b/prqlc-0.13.12/src/codegen/ast.rs similarity index 99% rename from prqlc-0.13.11/src/codegen/ast.rs rename to prqlc-0.13.12/src/codegen/ast.rs index 64aea84c8f..86d4728b6a 100644 --- a/prqlc-0.13.11/src/codegen/ast.rs +++ b/prqlc-0.13.12/src/codegen/ast.rs @@ -61,8 +61,8 @@ fn needs_parenthesis(this: &pr::Expr, opt: &WriteOpt) -> bool { } if opt.context_strength < binding_strength { - // parent has higher binding strength, which means it would "steal" operand of this expr - // => parenthesis are needed + // parent has lower binding strength, so it won't "steal" operand of this expr + // => no parenthesis needed return false; } @@ -277,7 +277,6 @@ fn binding_strength(expr: &pr::ExprKind) -> u8 { // Weaker than a child assign, since `select x = 1` // Weaker than a binary operator, since `filter x == 1` pr::ExprKind::FuncCall(_) => 10, - // ExprKind::FuncCall(_) if !is_parent => 2, pr::ExprKind::Func(_) => 7, // other nodes should not contain any inner exprs diff --git a/prqlc-0.13.11/src/codegen/mod.rs b/prqlc-0.13.12/src/codegen/mod.rs similarity index 98% rename from prqlc-0.13.11/src/codegen/mod.rs rename to prqlc-0.13.12/src/codegen/mod.rs index b69d349498..85eca1c6c9 100644 --- a/prqlc-0.13.11/src/codegen/mod.rs +++ b/prqlc-0.13.12/src/codegen/mod.rs @@ -194,7 +194,7 @@ impl SeparatedExprs<'_, T> { exprs.push(expr); } - let separators = self.inline.len() * (exprs.len().checked_sub(1).unwrap_or_default()); + let separators = self.inline.len() * exprs.len().saturating_sub(1); opt.consume_width(separators as u16)?; Some(exprs.join(self.inline)) diff --git a/prqlc-0.13.11/src/codegen/types.rs b/prqlc-0.13.12/src/codegen/types.rs similarity index 100% rename from prqlc-0.13.11/src/codegen/types.rs rename to prqlc-0.13.12/src/codegen/types.rs diff --git a/prqlc-0.13.11/src/debug/log.rs b/prqlc-0.13.12/src/debug/log.rs similarity index 100% rename from prqlc-0.13.11/src/debug/log.rs rename to prqlc-0.13.12/src/debug/log.rs diff --git a/prqlc-0.13.11/src/debug/messages.rs b/prqlc-0.13.12/src/debug/messages.rs similarity index 100% rename from prqlc-0.13.11/src/debug/messages.rs rename to prqlc-0.13.12/src/debug/messages.rs diff --git a/prqlc-0.13.11/src/debug/mod.rs b/prqlc-0.13.12/src/debug/mod.rs similarity index 100% rename from prqlc-0.13.11/src/debug/mod.rs rename to prqlc-0.13.12/src/debug/mod.rs diff --git a/prqlc-0.13.11/src/debug/render_html.rs b/prqlc-0.13.12/src/debug/render_html.rs similarity index 100% rename from prqlc-0.13.11/src/debug/render_html.rs rename to prqlc-0.13.12/src/debug/render_html.rs diff --git a/prqlc-0.13.11/src/error_message.rs b/prqlc-0.13.12/src/error_message.rs similarity index 100% rename from prqlc-0.13.11/src/error_message.rs rename to prqlc-0.13.12/src/error_message.rs diff --git a/prqlc-0.13.11/src/ir/decl.rs b/prqlc-0.13.12/src/ir/decl.rs similarity index 100% rename from prqlc-0.13.11/src/ir/decl.rs rename to prqlc-0.13.12/src/ir/decl.rs diff --git a/prqlc-0.13.11/src/ir/generic.rs b/prqlc-0.13.12/src/ir/generic.rs similarity index 100% rename from prqlc-0.13.11/src/ir/generic.rs rename to prqlc-0.13.12/src/ir/generic.rs diff --git a/prqlc-0.13.11/src/ir/mod.rs b/prqlc-0.13.12/src/ir/mod.rs similarity index 100% rename from prqlc-0.13.11/src/ir/mod.rs rename to prqlc-0.13.12/src/ir/mod.rs diff --git a/prqlc-0.13.11/src/ir/pl/expr.rs b/prqlc-0.13.12/src/ir/pl/expr.rs similarity index 100% rename from prqlc-0.13.11/src/ir/pl/expr.rs rename to prqlc-0.13.12/src/ir/pl/expr.rs diff --git a/prqlc-0.13.11/src/ir/pl/extra.rs b/prqlc-0.13.12/src/ir/pl/extra.rs similarity index 100% rename from prqlc-0.13.11/src/ir/pl/extra.rs rename to prqlc-0.13.12/src/ir/pl/extra.rs diff --git a/prqlc-0.13.11/src/ir/pl/fold.rs b/prqlc-0.13.12/src/ir/pl/fold.rs similarity index 100% rename from prqlc-0.13.11/src/ir/pl/fold.rs rename to prqlc-0.13.12/src/ir/pl/fold.rs diff --git a/prqlc-0.13.11/src/ir/pl/lineage.rs b/prqlc-0.13.12/src/ir/pl/lineage.rs similarity index 100% rename from prqlc-0.13.11/src/ir/pl/lineage.rs rename to prqlc-0.13.12/src/ir/pl/lineage.rs diff --git a/prqlc-0.13.11/src/ir/pl/mod.rs b/prqlc-0.13.12/src/ir/pl/mod.rs similarity index 100% rename from prqlc-0.13.11/src/ir/pl/mod.rs rename to prqlc-0.13.12/src/ir/pl/mod.rs diff --git a/prqlc-0.13.11/src/ir/pl/stmt.rs b/prqlc-0.13.12/src/ir/pl/stmt.rs similarity index 100% rename from prqlc-0.13.11/src/ir/pl/stmt.rs rename to prqlc-0.13.12/src/ir/pl/stmt.rs diff --git a/prqlc-0.13.11/src/ir/pl/utils.rs b/prqlc-0.13.12/src/ir/pl/utils.rs similarity index 100% rename from prqlc-0.13.11/src/ir/pl/utils.rs rename to prqlc-0.13.12/src/ir/pl/utils.rs diff --git a/prqlc-0.13.11/src/ir/rq/expr.rs b/prqlc-0.13.12/src/ir/rq/expr.rs similarity index 100% rename from prqlc-0.13.11/src/ir/rq/expr.rs rename to prqlc-0.13.12/src/ir/rq/expr.rs diff --git a/prqlc-0.13.11/src/ir/rq/fold.rs b/prqlc-0.13.12/src/ir/rq/fold.rs similarity index 100% rename from prqlc-0.13.11/src/ir/rq/fold.rs rename to prqlc-0.13.12/src/ir/rq/fold.rs diff --git a/prqlc-0.13.11/src/ir/rq/ids.rs b/prqlc-0.13.12/src/ir/rq/ids.rs similarity index 100% rename from prqlc-0.13.11/src/ir/rq/ids.rs rename to prqlc-0.13.12/src/ir/rq/ids.rs diff --git a/prqlc-0.13.11/src/ir/rq/mod.rs b/prqlc-0.13.12/src/ir/rq/mod.rs similarity index 100% rename from prqlc-0.13.11/src/ir/rq/mod.rs rename to prqlc-0.13.12/src/ir/rq/mod.rs diff --git a/prqlc-0.13.11/src/ir/rq/transform.rs b/prqlc-0.13.12/src/ir/rq/transform.rs similarity index 100% rename from prqlc-0.13.11/src/ir/rq/transform.rs rename to prqlc-0.13.12/src/ir/rq/transform.rs diff --git a/prqlc-0.13.11/src/ir/rq/utils.rs b/prqlc-0.13.12/src/ir/rq/utils.rs similarity index 100% rename from prqlc-0.13.11/src/ir/rq/utils.rs rename to prqlc-0.13.12/src/ir/rq/utils.rs diff --git a/prqlc-0.13.11/src/lib.rs b/prqlc-0.13.12/src/lib.rs similarity index 100% rename from prqlc-0.13.11/src/lib.rs rename to prqlc-0.13.12/src/lib.rs diff --git a/prqlc-0.13.11/src/main.rs b/prqlc-0.13.12/src/main.rs similarity index 100% rename from prqlc-0.13.11/src/main.rs rename to prqlc-0.13.12/src/main.rs diff --git a/prqlc-0.13.11/src/parser.rs b/prqlc-0.13.12/src/parser.rs similarity index 100% rename from prqlc-0.13.11/src/parser.rs rename to prqlc-0.13.12/src/parser.rs diff --git a/prqlc-0.13.11/src/semantic/ast_expand.rs b/prqlc-0.13.12/src/semantic/ast_expand.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/ast_expand.rs rename to prqlc-0.13.12/src/semantic/ast_expand.rs diff --git a/prqlc-0.13.11/src/semantic/lowering.rs b/prqlc-0.13.12/src/semantic/lowering.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/lowering.rs rename to prqlc-0.13.12/src/semantic/lowering.rs diff --git a/prqlc-0.13.11/src/semantic/mod.rs b/prqlc-0.13.12/src/semantic/mod.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/mod.rs rename to prqlc-0.13.12/src/semantic/mod.rs diff --git a/prqlc-0.13.11/src/semantic/module.rs b/prqlc-0.13.12/src/semantic/module.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/module.rs rename to prqlc-0.13.12/src/semantic/module.rs diff --git a/prqlc-0.13.11/src/semantic/reporting.rs b/prqlc-0.13.12/src/semantic/reporting.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/reporting.rs rename to prqlc-0.13.12/src/semantic/reporting.rs diff --git a/prqlc-0.13.11/src/semantic/resolver/expr.rs b/prqlc-0.13.12/src/semantic/resolver/expr.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/expr.rs rename to prqlc-0.13.12/src/semantic/resolver/expr.rs diff --git a/prqlc-0.13.11/src/semantic/resolver/flatten.rs b/prqlc-0.13.12/src/semantic/resolver/flatten.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/flatten.rs rename to prqlc-0.13.12/src/semantic/resolver/flatten.rs diff --git a/prqlc-0.13.11/src/semantic/resolver/functions.rs b/prqlc-0.13.12/src/semantic/resolver/functions.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/functions.rs rename to prqlc-0.13.12/src/semantic/resolver/functions.rs diff --git a/prqlc-0.13.11/src/semantic/resolver/inference.rs b/prqlc-0.13.12/src/semantic/resolver/inference.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/inference.rs rename to prqlc-0.13.12/src/semantic/resolver/inference.rs diff --git a/prqlc-0.13.11/src/semantic/resolver/mod.rs b/prqlc-0.13.12/src/semantic/resolver/mod.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/mod.rs rename to prqlc-0.13.12/src/semantic/resolver/mod.rs diff --git a/prqlc-0.13.11/src/semantic/resolver/names.rs b/prqlc-0.13.12/src/semantic/resolver/names.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/names.rs rename to prqlc-0.13.12/src/semantic/resolver/names.rs diff --git a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap similarity index 85% rename from prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap rename to prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap index cefcc31e4b..4a4a7c96be 100644 --- a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap +++ b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__append_union_different_tables.snap @@ -7,21 +7,21 @@ columns: name: - employees - name - target_id: 132 + target_id: 134 target_name: ~ - Single: name: - employees - salary - target_id: 133 + target_id: 135 target_name: ~ inputs: - - id: 130 + - id: 132 name: employees table: - default_db - employees - - id: 119 + - id: 121 name: managers table: - default_db diff --git a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap similarity index 85% rename from prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap rename to prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap index 24b5e6c8c9..d12c3c8104 100644 --- a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap +++ b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-2.snap @@ -4,18 +4,18 @@ expression: "resolve_lineage(r#\"\n from table_1\n join cu --- columns: - All: - input_id: 117 + input_id: 119 except: [] - All: - input_id: 114 + input_id: 116 except: [] inputs: - - id: 117 + - id: 119 name: table_1 table: - default_db - table_1 - - id: 114 + - id: 116 name: customers table: - default_db diff --git a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap similarity index 89% rename from prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap rename to prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap index 138b017189..804e9f9966 100644 --- a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap +++ b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names-3.snap @@ -7,26 +7,26 @@ columns: name: - e - emp_no - target_id: 127 + target_id: 129 target_name: ~ - Single: name: - e - gender - target_id: 128 + target_id: 130 target_name: ~ - Single: name: - emp_salary - target_id: 146 + target_id: 148 target_name: ~ inputs: - - id: 120 + - id: 122 name: e table: - default_db - employees - - id: 117 + - id: 119 name: salaries table: - default_db diff --git a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap similarity index 92% rename from prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap rename to prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap index 1ce7f65461..e1d5c30ad0 100644 --- a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap +++ b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__frames_and_names.snap @@ -7,26 +7,26 @@ columns: name: - orders - customer_no - target_id: 121 + target_id: 123 target_name: ~ - Single: name: - orders - gross - target_id: 122 + target_id: 124 target_name: ~ - Single: name: - orders - tax - target_id: 123 + target_id: 125 target_name: ~ - Single: name: ~ - target_id: 124 + target_id: 126 target_name: ~ inputs: - - id: 119 + - id: 121 name: orders table: - default_db diff --git a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_1.snap b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_1.snap similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_1.snap rename to prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_1.snap diff --git a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_nested.snap b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_nested.snap similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_nested.snap rename to prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_nested.snap diff --git a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline-2.snap b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline-2.snap similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline-2.snap rename to prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline-2.snap diff --git a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline.snap b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline.snap similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline.snap rename to prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__functions_pipeline.snap diff --git a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__named_args.snap b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__named_args.snap similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__named_args.snap rename to prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__named_args.snap diff --git a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__variables_1.snap b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__variables_1.snap similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__variables_1.snap rename to prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__test__variables_1.snap diff --git a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap similarity index 94% rename from prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap rename to prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap index 69ce91dd83..b69b52fe7a 100644 --- a/prqlc-0.13.11/src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap +++ b/prqlc-0.13.12/src/semantic/resolver/snapshots/prqlc__semantic__resolver__transforms__tests__aggregate_positional_arg-2.snap @@ -21,10 +21,10 @@ TransformCall: lineage: columns: - All: - input_id: 116 + input_id: 118 except: [] inputs: - - id: 116 + - id: 118 name: c_invoice table: - default_db @@ -94,14 +94,14 @@ lineage: name: - c_invoice - issued_at - target_id: 118 + target_id: 120 target_name: ~ - Single: name: ~ - target_id: 134 + target_id: 136 target_name: ~ inputs: - - id: 116 + - id: 118 name: c_invoice table: - default_db diff --git a/prqlc-0.13.11/src/semantic/resolver/static_eval.rs b/prqlc-0.13.12/src/semantic/resolver/static_eval.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/static_eval.rs rename to prqlc-0.13.12/src/semantic/resolver/static_eval.rs diff --git a/prqlc-0.13.11/src/semantic/resolver/stmt.rs b/prqlc-0.13.12/src/semantic/resolver/stmt.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/stmt.rs rename to prqlc-0.13.12/src/semantic/resolver/stmt.rs diff --git a/prqlc-0.13.11/src/semantic/resolver/transforms.rs b/prqlc-0.13.12/src/semantic/resolver/transforms.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/transforms.rs rename to prqlc-0.13.12/src/semantic/resolver/transforms.rs diff --git a/prqlc-0.13.11/src/semantic/resolver/types.rs b/prqlc-0.13.12/src/semantic/resolver/types.rs similarity index 100% rename from prqlc-0.13.11/src/semantic/resolver/types.rs rename to prqlc-0.13.12/src/semantic/resolver/types.rs diff --git a/prqlc-0.13.11/src/semantic/std.prql b/prqlc-0.13.12/src/semantic/std.prql similarity index 96% rename from prqlc-0.13.11/src/semantic/std.prql rename to prqlc-0.13.12/src/semantic/std.prql index 8171f7848d..51a51f5552 100644 --- a/prqlc-0.13.11/src/semantic/std.prql +++ b/prqlc-0.13.12/src/semantic/std.prql @@ -224,8 +224,13 @@ module text { } ## Date functions + module date { + # Returns the current date and time as a timestamp. + let now = -> internal std.date.now let to_text = format column -> internal std.date.to_text + let diff = `noresolve.unit` start end -> internal std.date.diff + let trunc = unit column -> internal std.date.trunc } ## File-reading functions, primarily for DuckDB @@ -244,6 +249,3 @@ let read_json = source -> internal std.read_json module `prql` { let version = -> internal prql_version } - -# Deprecated, will be removed in 0.12.0 -let prql_version = -> internal prql_version diff --git a/prqlc-0.13.11/src/sql/dialect.rs b/prqlc-0.13.12/src/sql/dialect.rs similarity index 98% rename from prqlc-0.13.11/src/sql/dialect.rs rename to prqlc-0.13.12/src/sql/dialect.rs index 6255016c37..7f3f17e8fa 100644 --- a/prqlc-0.13.11/src/sql/dialect.rs +++ b/prqlc-0.13.12/src/sql/dialect.rs @@ -89,6 +89,7 @@ pub enum Dialect { GlareDb, MsSql, MySql, + Oracle, Postgres, Redshift, SQLite, @@ -112,6 +113,7 @@ impl Dialect { Dialect::Postgres => Box::new(PostgresDialect), Dialect::Redshift => Box::new(RedshiftDialect), Dialect::GlareDb => Box::new(GlareDbDialect), + Dialect::Oracle => Box::new(OracleDialect), Dialect::Ansi | Dialect::Generic => Box::new(GenericDialect), } } @@ -126,9 +128,11 @@ impl Dialect { | Dialect::Generic | Dialect::GlareDb | Dialect::ClickHouse => SupportLevel::Supported, - Dialect::MsSql | Dialect::Ansi | Dialect::BigQuery | Dialect::Snowflake => { - SupportLevel::Unsupported - } + Dialect::MsSql + | Dialect::Ansi + | Dialect::BigQuery + | Dialect::Snowflake + | Dialect::Oracle => SupportLevel::Unsupported, } } @@ -166,6 +170,8 @@ pub struct PostgresDialect; pub struct RedshiftDialect; #[derive(Debug)] pub struct GlareDbDialect; +#[derive(Debug)] +pub struct OracleDialect; pub(super) enum ColumnExclude { Exclude, @@ -736,6 +742,14 @@ impl DialectHandler for DuckDbDialect { } } +impl DialectHandler for OracleDialect { + fn ident_quoting_style(&self) -> IdentQuotingStyle { + // Due to oraclesql identifier casing rules, identifiers are always quoted + // https://docs.oracle.com/en/database/oracle/oracle-database/26/sqlrf/Database-Object-Names-and-Qualifiers.html + IdentQuotingStyle::AlwaysQuoted + } +} + #[cfg(test)] mod tests { use std::str::FromStr; diff --git a/prqlc-0.13.11/src/sql/gen_expr.rs b/prqlc-0.13.12/src/sql/gen_expr.rs similarity index 91% rename from prqlc-0.13.11/src/sql/gen_expr.rs rename to prqlc-0.13.12/src/sql/gen_expr.rs index 21af752bae..2fe0786b16 100644 --- a/prqlc-0.13.11/src/sql/gen_expr.rs +++ b/prqlc-0.13.12/src/sql/gen_expr.rs @@ -108,6 +108,7 @@ pub(super) fn translate_expr(expr: rq::Expr, ctx: &mut Context) -> Result { return Ok(process_date_to_text(&expr, name, args, ctx)?.into()) } + "std.date.trunc" => return Ok(process_date_trunc(&expr, name, args, ctx)?.into()), _ => match try_into_between(expr.clone(), ctx)? { Some(between_expr) => return Ok(between_expr.into()), None => { @@ -208,6 +209,92 @@ fn process_array_in( } } +/// Translates PRQL date truncation to dialect-specific SQL. +/// BigQuery uses unquoted uppercase date_part after the column: DATE_TRUNC(col, DAY) +/// MSSQL uses unquoted lowercase datepart before the column: DATETRUNC(day, col) +/// All other dialects use: DATE_TRUNC('unit', col) +fn process_date_trunc( + expr: &rq::Expr, + op_name: &str, + args: &[rq::Expr], + ctx: &mut Context, +) -> Result { + if let [unit_expr @ rq::Expr { + kind: rq::ExprKind::Literal(Literal::String(unit)), + .. + }, col_expr] = args + { + use crate::sql::dialect::{BigQueryDialect, MsSqlDialect}; + + if ctx.dialect.is::() { + // BigQuery: DATE_TRUNC(col, DAY) — unit is an unquoted uppercase keyword + let col = translate_expr(col_expr.clone(), ctx)?.into_ast(); + let unit_upper = unit.to_uppercase(); + return Ok(sql_ast::Expr::Function(Function { + name: ObjectName(vec![sqlparser::ast::ObjectNamePart::Identifier( + sql_ast::Ident::new("DATE_TRUNC"), + )]), + args: sql_ast::FunctionArguments::List(FunctionArgumentList { + args: vec![ + FunctionArg::Unnamed(FunctionArgExpr::Expr(col)), + FunctionArg::Unnamed(FunctionArgExpr::Expr(sql_ast::Expr::Identifier( + sql_ast::Ident::new(unit_upper), + ))), + ], + clauses: vec![], + duplicate_treatment: None, + }), + over: None, + filter: None, + null_treatment: None, + within_group: vec![], + parameters: sql_ast::FunctionArguments::None, + uses_odbc_syntax: false, + })); + } else if ctx.dialect.is::() { + // MSSQL: DATETRUNC(day, col) — unit is an unquoted lowercase keyword (SQL Server 2022+) + let col = translate_expr(col_expr.clone(), ctx)?.into_ast(); + let unit_lower = unit.to_lowercase(); + return Ok(sql_ast::Expr::Function(Function { + name: ObjectName(vec![sqlparser::ast::ObjectNamePart::Identifier( + sql_ast::Ident::new("DATETRUNC"), + )]), + args: sql_ast::FunctionArguments::List(FunctionArgumentList { + args: vec![ + FunctionArg::Unnamed(FunctionArgExpr::Expr(sql_ast::Expr::Identifier( + sql_ast::Ident::new(unit_lower), + ))), + FunctionArg::Unnamed(FunctionArgExpr::Expr(col)), + ], + clauses: vec![], + duplicate_treatment: None, + }), + over: None, + filter: None, + null_treatment: None, + within_group: vec![], + parameters: sql_ast::FunctionArguments::None, + uses_odbc_syntax: false, + })); + } + + // All other dialects: DATE_TRUNC('unit', col) via the s-string in std.sql.prql + let expr = rq::Expr { + kind: rq::ExprKind::Operator { + name: op_name.to_string(), + args: vec![unit_expr.clone(), col_expr.clone()], + }, + ..expr.clone() + }; + Ok(super::operators::translate_operator_expr(expr, ctx)?.into_ast()) + } else { + Err( + Error::new_simple("`std.date.trunc` only supports a string literal as unit") + .with_span(expr.span), + ) + } +} + /// Translates PRQL date format (based on `chrono` crate) to dialect specific date format /// For now only date format as string literal is supported fn process_date_to_text( diff --git a/prqlc-0.13.11/src/sql/gen_projection.rs b/prqlc-0.13.12/src/sql/gen_projection.rs similarity index 99% rename from prqlc-0.13.11/src/sql/gen_projection.rs rename to prqlc-0.13.12/src/sql/gen_projection.rs index 67be9c45a6..b4ec68536a 100644 --- a/prqlc-0.13.11/src/sql/gen_projection.rs +++ b/prqlc-0.13.12/src/sql/gen_projection.rs @@ -40,7 +40,7 @@ pub(super) fn try_into_exprs( if let Some(excluded) = excluded.get(&cid) { if !excluded.is_empty() { return Err( - Error::new_simple("Excluding columns not supported as this position") + Error::new_simple("Excluding columns not supported in this position") .with_span(span), ); } diff --git a/prqlc-0.13.11/src/sql/gen_query.rs b/prqlc-0.13.12/src/sql/gen_query.rs similarity index 100% rename from prqlc-0.13.11/src/sql/gen_query.rs rename to prqlc-0.13.12/src/sql/gen_query.rs diff --git a/prqlc-0.13.11/src/sql/keywords.rs b/prqlc-0.13.12/src/sql/keywords.rs similarity index 100% rename from prqlc-0.13.11/src/sql/keywords.rs rename to prqlc-0.13.12/src/sql/keywords.rs diff --git a/prqlc-0.13.11/src/sql/mod.rs b/prqlc-0.13.12/src/sql/mod.rs similarity index 100% rename from prqlc-0.13.11/src/sql/mod.rs rename to prqlc-0.13.12/src/sql/mod.rs diff --git a/prqlc-0.13.11/src/sql/operators.rs b/prqlc-0.13.12/src/sql/operators.rs similarity index 100% rename from prqlc-0.13.11/src/sql/operators.rs rename to prqlc-0.13.12/src/sql/operators.rs diff --git a/prqlc-0.13.11/src/sql/pq/anchor.rs b/prqlc-0.13.12/src/sql/pq/anchor.rs similarity index 100% rename from prqlc-0.13.11/src/sql/pq/anchor.rs rename to prqlc-0.13.12/src/sql/pq/anchor.rs diff --git a/prqlc-0.13.11/src/sql/pq/ast.rs b/prqlc-0.13.12/src/sql/pq/ast.rs similarity index 100% rename from prqlc-0.13.11/src/sql/pq/ast.rs rename to prqlc-0.13.12/src/sql/pq/ast.rs diff --git a/prqlc-0.13.11/src/sql/pq/context.rs b/prqlc-0.13.12/src/sql/pq/context.rs similarity index 100% rename from prqlc-0.13.11/src/sql/pq/context.rs rename to prqlc-0.13.12/src/sql/pq/context.rs diff --git a/prqlc-0.13.11/src/sql/pq/gen_query.rs b/prqlc-0.13.12/src/sql/pq/gen_query.rs similarity index 100% rename from prqlc-0.13.11/src/sql/pq/gen_query.rs rename to prqlc-0.13.12/src/sql/pq/gen_query.rs diff --git a/prqlc-0.13.11/src/sql/pq/mod.rs b/prqlc-0.13.12/src/sql/pq/mod.rs similarity index 100% rename from prqlc-0.13.11/src/sql/pq/mod.rs rename to prqlc-0.13.12/src/sql/pq/mod.rs diff --git a/prqlc-0.13.11/src/sql/pq/positional_mapping.rs b/prqlc-0.13.12/src/sql/pq/positional_mapping.rs similarity index 98% rename from prqlc-0.13.11/src/sql/pq/positional_mapping.rs rename to prqlc-0.13.12/src/sql/pq/positional_mapping.rs index 181629e1fc..db0bfdf818 100644 --- a/prqlc-0.13.11/src/sql/pq/positional_mapping.rs +++ b/prqlc-0.13.12/src/sql/pq/positional_mapping.rs @@ -84,7 +84,7 @@ pub fn compute_positional_mappings( log::trace!("traversing pipeline to obtain positional mapping:"); - // Only process selected columns to avoid surnumerary one + // Only process selected columns to avoid supernumerary ones let add_columns = |columns: &mut Vec, cids: &[CId]| { if let Some(requirements) = requirements { columns.extend(cids.iter().filter(|cid| requirements.is_selected(cid))); diff --git a/prqlc-0.13.11/src/sql/pq/postprocess.rs b/prqlc-0.13.12/src/sql/pq/postprocess.rs similarity index 100% rename from prqlc-0.13.11/src/sql/pq/postprocess.rs rename to prqlc-0.13.12/src/sql/pq/postprocess.rs diff --git a/prqlc-0.13.11/src/sql/pq/preprocess.rs b/prqlc-0.13.12/src/sql/pq/preprocess.rs similarity index 100% rename from prqlc-0.13.11/src/sql/pq/preprocess.rs rename to prqlc-0.13.12/src/sql/pq/preprocess.rs diff --git a/prqlc-0.13.11/src/sql/std.sql.prql b/prqlc-0.13.12/src/sql/std.sql.prql similarity index 81% rename from prqlc-0.13.11/src/sql/std.sql.prql rename to prqlc-0.13.12/src/sql/std.sql.prql index 79c96e2118..e11e2e9062 100644 --- a/prqlc-0.13.11/src/sql/std.sql.prql +++ b/prqlc-0.13.12/src/sql/std.sql.prql @@ -120,6 +120,30 @@ module text { let ends_with = suffix column -> s"{column:0} LIKE CONCAT('%', {suffix:0})" } +# Date functions +module date { + # ClickHouse: https://clickhouse.com/docs/en/sql-reference/functions/date-time-functions + # DuckDB: https://duckdb.org/docs/sql/functions/date + # MariaDB: https://mariadb.com/kb/en/datediff/ + # MySQL: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html + # MSSQL: https://learn.microsoft.com/en-us/sql/t-sql/functions/datediff-transact-sql + # Snowflake: https://docs.snowflake.com/en/sql-reference/functions/datediff + # Redshift: https://docs.aws.amazon.com/redshift/latest/dg/r_DATEDIFF_function.html + let diff = unit start end -> s"DATEDIFF({unit:0}, {start:0}, {end:0})" + # CURRENT_TIMESTAMP is ANSI SQL standard; dialects may override. + let now = -> s"CURRENT_TIMESTAMP" + # Clickhouse: https://clickhouse.com/docs/en/sql-reference/functions/date-time-functions#date_trunc + # DuckDB: https://duckdb.org/docs/sql/functions/timestamp#date_truncdate_part-timestamp + # MariaDB: https://mariadb.com/kb/en/date_format/ + # MySQL: https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html#function_date-trunc + # Postgres: https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC + # SQLite: https://www.sqlite.org/lang_datefunc.html + # MSSQL: https://learn.microsoft.com/en-us/sql/t-sql/functions/datetrunc-transact-sql + # BigQuery: https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_trunc + # Snowflake: https://docs.snowflake.com/en/sql-reference/functions/date_trunc + let trunc = unit column -> s"DATE_TRUNC({unit:0}, {column:0})" +} + # Source-reading functions, primarily for DuckDB let read_parquet = binary_as_string file_row_number hive_partitioning union_by_name source -> s"read_parquet({source:0})" let read_csv = source -> s"read_csv({source:0})" @@ -201,6 +225,10 @@ module bigquery { module date { let to_text = format column -> s"FORMAT_TIMESTAMP({format:0}, CAST({column:0} AS TIMESTAMP))" + # https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_diff + let diff = unit start end -> s"DATE_DIFF({end:0}, {start:0}, {unit:0})" + # BigQuery requires parentheses for CURRENT_TIMESTAMP + let now = -> s"CURRENT_TIMESTAMP()" } let regex_search = text pattern -> s"REGEXP_CONTAINS({text:0}, {pattern:0})" @@ -218,6 +246,10 @@ module clickhouse { module date { # https://clickhouse.com/docs/en/sql-reference/functions/date-time-functions let to_text = format column -> s"formatDateTimeInJodaSyntax({column:0}, {format:0})" + # https://clickhouse.com/docs/en/sql-reference/functions/date-time-functions#dateDiff + let diff = unit start end -> s"dateDiff('{unit:0}', {start:0}, {end:0})" + # Clickhouse uses now() for current timestamp + let now = -> s"now()" } let regex_search = text pattern -> s"match({text:0}, {pattern:0})" @@ -244,6 +276,8 @@ module duckdb { module date { # https://duckdb.org/docs/sql/functions/dateformat let to_text = format column -> s"strftime({column:0}, {format:0})" + # https://duckdb.org/docs/sql/functions/date + let diff = unit start end -> s"datediff('{unit:0}', {start:0}, {end:0})" } let regex_search = text pattern -> s"REGEXP_MATCHES({text:0}, {pattern:0})" @@ -294,6 +328,12 @@ module mysql { module date { # https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html let to_text = format column -> s"DATE_FORMAT({column:0}, {format:0})" + # https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_timestampdiff + let diff = unit start end -> s"TIMESTAMPDIFF({unit:0}, {start:0}, {end:0})" + # MySQL uses NOW() function + let now = -> s"NOW()" + # https://dev.mysql.com/doc/refman/8.4/en/date-and-time-functions.html#function_date-trunc + let trunc = unit column -> s"DATE_TRUNC({unit:0}, {column:0})" } # 'c' for case-sensitive @@ -324,6 +364,8 @@ module postgres { module date { # https://www.postgresql.org/docs/current/functions-formatting.html let to_text = format column -> s"TO_CHAR({column:0}, {format:0})" + # PostgreSQL has no built-in DATEDIFF equivalent + let diff = unit start end -> null } @{binding_strength=9} @@ -377,7 +419,7 @@ module sqlite { let div_f = l r -> s"({l} * 1.0 / {r:12})" @{binding_strength=100} - let div_i = l r -> s"ROUND(ABS({l:11} / {r:12}) - 0.5) * SIGN({l:0}) * SIGN({r:0})" + let div_i = l r -> s"CAST(ABS({l:11} * 1.0 / {r:12}) AS INTEGER) * SIGN({l:0}) * SIGN({r:0})" # Text functions module text { @@ -388,6 +430,13 @@ module sqlite { let ends_with = suffix column -> s"{column:0} LIKE '%' || {suffix:0}" } + # Date functions + module date { + # SQLite has no built-in date diff function + let diff = unit start end -> null + let trunc = unit column -> null + } + @{binding_strength=9} let regex_search = text pattern -> s"{text} REGEXP {pattern}" } diff --git a/prqlc-0.13.11/src/utils/id_gen.rs b/prqlc-0.13.12/src/utils/id_gen.rs similarity index 100% rename from prqlc-0.13.11/src/utils/id_gen.rs rename to prqlc-0.13.12/src/utils/id_gen.rs diff --git a/prqlc-0.13.11/src/utils/mod.rs b/prqlc-0.13.12/src/utils/mod.rs similarity index 100% rename from prqlc-0.13.11/src/utils/mod.rs rename to prqlc-0.13.12/src/utils/mod.rs diff --git a/prqlc-0.13.11/src/utils/toposort.rs b/prqlc-0.13.12/src/utils/toposort.rs similarity index 100% rename from prqlc-0.13.11/src/utils/toposort.rs rename to prqlc-0.13.12/src/utils/toposort.rs diff --git a/prqlc-0.13.11/tests/CLAUDE.md b/prqlc-0.13.12/tests/CLAUDE.md similarity index 100% rename from prqlc-0.13.11/tests/CLAUDE.md rename to prqlc-0.13.12/tests/CLAUDE.md diff --git a/prqlc-0.13.11/tests/integration/bad_error_messages.rs b/prqlc-0.13.12/tests/integration/bad_error_messages.rs similarity index 96% rename from prqlc-0.13.11/tests/integration/bad_error_messages.rs rename to prqlc-0.13.12/tests/integration/bad_error_messages.rs index 6ba0f88bcb..8ceaa09b37 100644 --- a/prqlc-0.13.11/tests/integration/bad_error_messages.rs +++ b/prqlc-0.13.12/tests/integration/bad_error_messages.rs @@ -24,7 +24,7 @@ fn test_bad_error_messages() { assert_snapshot!(compile(r###" from film group - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :3:5 ] │ @@ -44,7 +44,7 @@ fn test_bad_error_messages() { from employees filter f location - "#).unwrap_err(), @r" + "#).unwrap_err(), @" Error: ╭─[ :5:14 ] │ @@ -58,7 +58,7 @@ fn test_bad_error_messages() { assert_snapshot!(compile(r###" select tracks from artists - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :3:5 ] │ @@ -136,7 +136,7 @@ fn misplaced_type_error() { let foo = 123 from t select (true && foo) - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :2:15 ] │ @@ -152,7 +152,7 @@ fn test_hint_missing_args() { assert_snapshot!(compile(r###" from film select {film_id, lag film_id} - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :3:22 ] │ @@ -169,7 +169,7 @@ fn test_hint_missing_args() { fn test_relation_literal_contains_literals() { assert_snapshot!(compile(r###" [{a=(1+1)}] - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :2:9 ] │ @@ -196,7 +196,7 @@ fn nested_groups() { } ) ) - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :9:9 ] │ @@ -213,7 +213,7 @@ fn nested_groups() { fn just_std() { assert_snapshot!(compile(r###" std - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :1:1 ] │ diff --git a/prqlc-0.13.11/tests/integration/data/chinook/albums.csv b/prqlc-0.13.12/tests/integration/data/chinook/albums.csv similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/albums.csv rename to prqlc-0.13.12/tests/integration/data/chinook/albums.csv diff --git a/prqlc-0.13.11/tests/integration/data/chinook/artists.csv b/prqlc-0.13.12/tests/integration/data/chinook/artists.csv similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/artists.csv rename to prqlc-0.13.12/tests/integration/data/chinook/artists.csv diff --git a/prqlc-0.13.11/tests/integration/data/chinook/customers.csv b/prqlc-0.13.12/tests/integration/data/chinook/customers.csv similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/customers.csv rename to prqlc-0.13.12/tests/integration/data/chinook/customers.csv diff --git a/prqlc-0.13.11/tests/integration/data/chinook/employees.csv b/prqlc-0.13.12/tests/integration/data/chinook/employees.csv similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/employees.csv rename to prqlc-0.13.12/tests/integration/data/chinook/employees.csv diff --git a/prqlc-0.13.11/tests/integration/data/chinook/genres.csv b/prqlc-0.13.12/tests/integration/data/chinook/genres.csv similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/genres.csv rename to prqlc-0.13.12/tests/integration/data/chinook/genres.csv diff --git a/prqlc-0.13.11/tests/integration/data/chinook/invoice_items.csv b/prqlc-0.13.12/tests/integration/data/chinook/invoice_items.csv similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/invoice_items.csv rename to prqlc-0.13.12/tests/integration/data/chinook/invoice_items.csv diff --git a/prqlc-0.13.11/tests/integration/data/chinook/invoices.csv b/prqlc-0.13.12/tests/integration/data/chinook/invoices.csv similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/invoices.csv rename to prqlc-0.13.12/tests/integration/data/chinook/invoices.csv diff --git a/prqlc-0.13.11/tests/integration/data/chinook/media_types.csv b/prqlc-0.13.12/tests/integration/data/chinook/media_types.csv similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/media_types.csv rename to prqlc-0.13.12/tests/integration/data/chinook/media_types.csv diff --git a/prqlc-0.13.11/tests/integration/data/chinook/media_types.json b/prqlc-0.13.12/tests/integration/data/chinook/media_types.json similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/media_types.json rename to prqlc-0.13.12/tests/integration/data/chinook/media_types.json diff --git a/prqlc-0.13.11/tests/integration/data/chinook/playlist_track.csv b/prqlc-0.13.12/tests/integration/data/chinook/playlist_track.csv similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/playlist_track.csv rename to prqlc-0.13.12/tests/integration/data/chinook/playlist_track.csv diff --git a/prqlc-0.13.11/tests/integration/data/chinook/playlists.csv b/prqlc-0.13.12/tests/integration/data/chinook/playlists.csv similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/playlists.csv rename to prqlc-0.13.12/tests/integration/data/chinook/playlists.csv diff --git a/prqlc-0.13.11/tests/integration/data/chinook/schema.sql b/prqlc-0.13.12/tests/integration/data/chinook/schema.sql similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/schema.sql rename to prqlc-0.13.12/tests/integration/data/chinook/schema.sql diff --git a/prqlc-0.13.11/tests/integration/data/chinook/tracks.csv b/prqlc-0.13.12/tests/integration/data/chinook/tracks.csv similarity index 100% rename from prqlc-0.13.11/tests/integration/data/chinook/tracks.csv rename to prqlc-0.13.12/tests/integration/data/chinook/tracks.csv diff --git a/prqlc-0.13.11/tests/integration/dbs/README.md b/prqlc-0.13.12/tests/integration/dbs/README.md similarity index 100% rename from prqlc-0.13.11/tests/integration/dbs/README.md rename to prqlc-0.13.12/tests/integration/dbs/README.md diff --git a/prqlc-0.13.11/tests/integration/dbs/docker-compose.yaml b/prqlc-0.13.12/tests/integration/dbs/docker-compose.yaml similarity index 100% rename from prqlc-0.13.11/tests/integration/dbs/docker-compose.yaml rename to prqlc-0.13.12/tests/integration/dbs/docker-compose.yaml diff --git a/prqlc-0.13.11/tests/integration/dbs/dockerfiles/glaredb.Dockerfile b/prqlc-0.13.12/tests/integration/dbs/dockerfiles/glaredb.Dockerfile similarity index 100% rename from prqlc-0.13.11/tests/integration/dbs/dockerfiles/glaredb.Dockerfile rename to prqlc-0.13.12/tests/integration/dbs/dockerfiles/glaredb.Dockerfile diff --git a/prqlc-0.13.11/tests/integration/dbs/mod.rs b/prqlc-0.13.12/tests/integration/dbs/mod.rs similarity index 100% rename from prqlc-0.13.11/tests/integration/dbs/mod.rs rename to prqlc-0.13.12/tests/integration/dbs/mod.rs diff --git a/prqlc-0.13.11/tests/integration/dbs/protocol.rs b/prqlc-0.13.12/tests/integration/dbs/protocol.rs similarity index 100% rename from prqlc-0.13.11/tests/integration/dbs/protocol.rs rename to prqlc-0.13.12/tests/integration/dbs/protocol.rs diff --git a/prqlc-0.13.11/tests/integration/dbs/runner.rs b/prqlc-0.13.12/tests/integration/dbs/runner.rs similarity index 100% rename from prqlc-0.13.11/tests/integration/dbs/runner.rs rename to prqlc-0.13.12/tests/integration/dbs/runner.rs diff --git a/prqlc-0.13.11/tests/integration/error_messages.rs b/prqlc-0.13.12/tests/integration/error_messages.rs similarity index 89% rename from prqlc-0.13.11/tests/integration/error_messages.rs rename to prqlc-0.13.12/tests/integration/error_messages.rs index c12482ea0d..84ba354d0f 100644 --- a/prqlc-0.13.11/tests/integration/error_messages.rs +++ b/prqlc-0.13.12/tests/integration/error_messages.rs @@ -14,7 +14,7 @@ fn test_errors() { from x derive y = (addadd 4 5 6) "###).unwrap_err(), - @r" + @" Error: ╭─[ :5:17 ] │ @@ -27,7 +27,7 @@ fn test_errors() { assert_snapshot!(compile(r###" from a select b "###).unwrap_err(), - @r" + @" Error: ╭─[ :2:5 ] │ @@ -42,7 +42,7 @@ fn test_errors() { select a select b "###).unwrap_err(), - @r" + @" Error: ╭─[ :4:12 ] │ @@ -58,7 +58,7 @@ fn test_errors() { from employees take 1.8 "###).unwrap_err(), - @r" + @" Error: ╭─[ :3:10 ] │ @@ -88,7 +88,7 @@ fn test_errors() { "#); // PARSER output (full compilation error): - assert_snapshot!(compile(mississippi).unwrap_err(), @r" + assert_snapshot!(compile(mississippi).unwrap_err(), @" Error: ╭─[ :1:23 ] │ @@ -98,7 +98,7 @@ fn test_errors() { ───╯ "); - assert_snapshot!(compile("Answer: T-H-A-T!").unwrap_err(), @r" + assert_snapshot!(compile("Answer: T-H-A-T!").unwrap_err(), @" Error: ╭─[ :1:16 ] │ @@ -117,7 +117,7 @@ fn test_union_all_sqlite() { from film remove film2 - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: The dialect SQLiteDialect does not support EXCEPT ALL ↳ Hint: providing more column information will allow the query to be translated to an anti-join. ") @@ -129,7 +129,7 @@ fn test_regex_dialect() { prql target:sql.mssql from foo filter bar ~= 'love' - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :4:12 ] │ @@ -147,7 +147,7 @@ fn test_bad_function_type() { group foo (take) "###, ) - .unwrap_err(), @r" + .unwrap_err(), @" Error: ╭─[ :3:16 ] │ @@ -187,7 +187,7 @@ fn test_ambiguous() { derive date = x select date "#) - .unwrap_err(), @r" + .unwrap_err(), @" Error: ╭─[ :4:12 ] │ @@ -210,7 +210,7 @@ fn test_ambiguous_join() { join (from b | select {x}) true select x "#) - .unwrap_err(), @r" + .unwrap_err(), @" Error: ╭─[ :5:12 ] │ @@ -232,7 +232,7 @@ fn test_ambiguous_inference() { join b(==b_id) select x "#) - .unwrap_err(), @r" + .unwrap_err(), @" Error: ╭─[ :4:12 ] │ @@ -268,7 +268,7 @@ fn date_to_text_with_column_format() { from dates_to_display select {my_date, my_format} select {std.date.to_text my_date my_format} - "#).unwrap_err(), @r" + "#).unwrap_err(), @" Error: ╭─[ :4:11 ] │ @@ -279,6 +279,23 @@ fn date_to_text_with_column_format() { "); } +#[test] +fn date_trunc_with_column_unit() { + assert_snapshot!(compile(r#" + from dates_to_display + select {my_date, my_unit} + select {std.date.trunc my_unit my_date} + "#).unwrap_err(), @" + Error: + ╭─[ :4:11 ] + │ + 4 │ select {std.date.trunc my_unit my_date} + │ ───────────────┬────────────── + │ ╰──────────────── `std.date.trunc` only supports a string literal as unit + ───╯ + "); +} + #[test] fn date_to_text_unsupported_chrono_item() { assert_snapshot!(compile(r#" @@ -304,7 +321,7 @@ fn available_columns() { from invoices select foo select bar - "#).unwrap_err(), @r" + "#).unwrap_err(), @" Error: ╭─[ :4:12 ] │ @@ -333,20 +350,16 @@ fn empty_interpolations() { #[test] fn no_query_entered() { // Empty query - assert_snapshot!(compile("").unwrap_err(), @r" - [E0001] Error: No PRQL query entered - "); + assert_snapshot!(compile("").unwrap_err(), @"[E0001] Error: No PRQL query entered"); // Comment-only query - assert_snapshot!(compile("# just a comment").unwrap_err(), @r" - [E0001] Error: No PRQL query entered - "); + assert_snapshot!(compile("# just a comment").unwrap_err(), @"[E0001] Error: No PRQL query entered"); } #[test] fn query_must_begin_with_from() { // Query with declaration but no 'from' - assert_snapshot!(compile("let x = 5").unwrap_err(), @r" + assert_snapshot!(compile("let x = 5").unwrap_err(), @" [E0001] Error: PRQL queries must begin with 'from' ↳ Hint: A query must start with a 'from' statement to define the main pipeline "); @@ -355,7 +368,7 @@ fn query_must_begin_with_from() { assert_snapshot!(compile(r#" let x = 5 let y = 10 - "#).unwrap_err(), @r" + "#).unwrap_err(), @" [E0001] Error: PRQL queries must begin with 'from' ↳ Hint: A query must start with a 'from' statement to define the main pipeline "); @@ -367,7 +380,7 @@ fn negative_number_in_transform() { assert_snapshot!(compile(r###" from artists sort -name - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: expected a pipeline that resolves to a table, but found `internal std.sub` ↳ Hint: wrap negative numbers in parentheses, e.g. `sort (-column_name)` "); @@ -375,7 +388,7 @@ fn negative_number_in_transform() { assert_snapshot!(compile(r###" from pets take -10 - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: expected a pipeline that resolves to a table, but found `internal std.sub` ↳ Hint: wrap negative numbers in parentheses, e.g. `sort (-column_name)` "); @@ -385,7 +398,7 @@ fn negative_number_in_transform() { group id ( sort -val ) - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: expected a pipeline that resolves to a table, but found `internal std.sub` ↳ Hint: wrap negative numbers in parentheses, e.g. `sort (-column_name)` "); @@ -395,7 +408,7 @@ fn negative_number_in_transform() { fn empty_tuple_or_array_from() { assert_snapshot!(compile(r###" from {} - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :2:10 ] │ @@ -407,7 +420,7 @@ fn empty_tuple_or_array_from() { assert_snapshot!(compile(r###" from [] - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :2:10 ] │ @@ -420,7 +433,7 @@ fn empty_tuple_or_array_from() { assert_snapshot!(compile(r###" from {} select a - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :2:10 ] │ @@ -437,7 +450,7 @@ fn window_rows_expects_range() { assert_snapshot!(compile(r###" from t group sid (window rows:2 (sid)) - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :3:28 ] │ @@ -450,7 +463,7 @@ fn window_rows_expects_range() { assert_snapshot!(compile(r###" from t group sid (window range:2 (sid)) - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :3:29 ] │ @@ -467,7 +480,7 @@ fn bare_lambda_expression() { // a clear error, not a confusing internal message. assert_snapshot!(compile(r###" x -> y - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :2:5 ] │ diff --git a/prqlc-0.13.11/tests/integration/main.rs b/prqlc-0.13.12/tests/integration/main.rs similarity index 100% rename from prqlc-0.13.11/tests/integration/main.rs rename to prqlc-0.13.12/tests/integration/main.rs diff --git a/prqlc-0.13.11/tests/integration/project/Project.prql b/prqlc-0.13.12/tests/integration/project/Project.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/project/Project.prql rename to prqlc-0.13.12/tests/integration/project/Project.prql diff --git a/prqlc-0.13.11/tests/integration/project/artists.prql b/prqlc-0.13.12/tests/integration/project/artists.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/project/artists.prql rename to prqlc-0.13.12/tests/integration/project/artists.prql diff --git a/prqlc-0.13.11/tests/integration/queries.rs b/prqlc-0.13.12/tests/integration/queries.rs similarity index 94% rename from prqlc-0.13.11/tests/integration/queries.rs rename to prqlc-0.13.12/tests/integration/queries.rs index e2e7c874ce..ab4aef8197 100644 --- a/prqlc-0.13.11/tests/integration/queries.rs +++ b/prqlc-0.13.12/tests/integration/queries.rs @@ -82,7 +82,7 @@ mod compileall { let generic_sql = prqlc::compile(&prql, &options).unwrap(); // next compile with each dialect - let mut diffsnap = "".to_owned(); + let mut diffs = Vec::new(); for dialect in Dialect::iter() { if !should_run_query(dialect, &prql) { continue; @@ -96,13 +96,16 @@ mod compileall { let dialect_sql = prqlc::compile(&prql, &dialect_options).unwrap(); let diff = TextDiff::from_lines(&generic_sql, &dialect_sql); - diffsnap = format!( - "{diffsnap}\n{}", - diff.unified_diff() - .context_radius(10) - .header("generic", &dialect.to_string()) - ); + let udiff = diff + .unified_diff() + .context_radius(10) + .header("generic", &dialect.to_string()) + .to_string(); + if !udiff.is_empty() { + diffs.push(udiff); + } } + let diffsnap = diffs.join("\n"); with_settings!({ input_file => prql_path }, { assert_snapshot!(test_name, diffsnap, &prql) }); diff --git a/prqlc-0.13.11/tests/integration/queries/aggregation.prql b/prqlc-0.13.12/tests/integration/queries/aggregation.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/aggregation.prql rename to prqlc-0.13.12/tests/integration/queries/aggregation.prql diff --git a/prqlc-0.13.11/tests/integration/queries/append_select.prql b/prqlc-0.13.12/tests/integration/queries/append_select.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/append_select.prql rename to prqlc-0.13.12/tests/integration/queries/append_select.prql diff --git a/prqlc-0.13.11/tests/integration/queries/append_select_compute.prql b/prqlc-0.13.12/tests/integration/queries/append_select_compute.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/append_select_compute.prql rename to prqlc-0.13.12/tests/integration/queries/append_select_compute.prql diff --git a/prqlc-0.13.11/tests/integration/queries/append_select_multiple_with_null.prql b/prqlc-0.13.12/tests/integration/queries/append_select_multiple_with_null.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/append_select_multiple_with_null.prql rename to prqlc-0.13.12/tests/integration/queries/append_select_multiple_with_null.prql diff --git a/prqlc-0.13.11/tests/integration/queries/append_select_nulls.prql b/prqlc-0.13.12/tests/integration/queries/append_select_nulls.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/append_select_nulls.prql rename to prqlc-0.13.12/tests/integration/queries/append_select_nulls.prql diff --git a/prqlc-0.13.11/tests/integration/queries/append_select_simple.prql b/prqlc-0.13.12/tests/integration/queries/append_select_simple.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/append_select_simple.prql rename to prqlc-0.13.12/tests/integration/queries/append_select_simple.prql diff --git a/prqlc-0.13.11/tests/integration/queries/arithmetic.prql b/prqlc-0.13.12/tests/integration/queries/arithmetic.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/arithmetic.prql rename to prqlc-0.13.12/tests/integration/queries/arithmetic.prql diff --git a/prqlc-0.13.11/tests/integration/queries/cast.prql b/prqlc-0.13.12/tests/integration/queries/cast.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/cast.prql rename to prqlc-0.13.12/tests/integration/queries/cast.prql diff --git a/prqlc-0.13.11/tests/integration/queries/constants_only.prql b/prqlc-0.13.12/tests/integration/queries/constants_only.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/constants_only.prql rename to prqlc-0.13.12/tests/integration/queries/constants_only.prql diff --git a/prqlc-0.13.11/tests/integration/queries/date_to_text.prql b/prqlc-0.13.12/tests/integration/queries/date_to_text.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/date_to_text.prql rename to prqlc-0.13.12/tests/integration/queries/date_to_text.prql diff --git a/prqlc-0.13.11/tests/integration/queries/distinct.prql b/prqlc-0.13.12/tests/integration/queries/distinct.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/distinct.prql rename to prqlc-0.13.12/tests/integration/queries/distinct.prql diff --git a/prqlc-0.13.11/tests/integration/queries/distinct_on.prql b/prqlc-0.13.12/tests/integration/queries/distinct_on.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/distinct_on.prql rename to prqlc-0.13.12/tests/integration/queries/distinct_on.prql diff --git a/prqlc-0.13.11/tests/integration/queries/genre_counts.prql b/prqlc-0.13.12/tests/integration/queries/genre_counts.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/genre_counts.prql rename to prqlc-0.13.12/tests/integration/queries/genre_counts.prql diff --git a/prqlc-0.13.11/tests/integration/queries/group_all.prql b/prqlc-0.13.12/tests/integration/queries/group_all.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/group_all.prql rename to prqlc-0.13.12/tests/integration/queries/group_all.prql diff --git a/prqlc-0.13.11/tests/integration/queries/group_sort.prql b/prqlc-0.13.12/tests/integration/queries/group_sort.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/group_sort.prql rename to prqlc-0.13.12/tests/integration/queries/group_sort.prql diff --git a/prqlc-0.13.11/tests/integration/queries/group_sort_derive_select_join.prql b/prqlc-0.13.12/tests/integration/queries/group_sort_derive_select_join.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/group_sort_derive_select_join.prql rename to prqlc-0.13.12/tests/integration/queries/group_sort_derive_select_join.prql diff --git a/prqlc-0.13.11/tests/integration/queries/group_sort_filter_derive_select_join.prql b/prqlc-0.13.12/tests/integration/queries/group_sort_filter_derive_select_join.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/group_sort_filter_derive_select_join.prql rename to prqlc-0.13.12/tests/integration/queries/group_sort_filter_derive_select_join.prql diff --git a/prqlc-0.13.11/tests/integration/queries/group_sort_limit_take.prql b/prqlc-0.13.12/tests/integration/queries/group_sort_limit_take.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/group_sort_limit_take.prql rename to prqlc-0.13.12/tests/integration/queries/group_sort_limit_take.prql diff --git a/prqlc-0.13.11/tests/integration/queries/invoice_totals.prql b/prqlc-0.13.12/tests/integration/queries/invoice_totals.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/invoice_totals.prql rename to prqlc-0.13.12/tests/integration/queries/invoice_totals.prql diff --git a/prqlc-0.13.11/tests/integration/queries/loop_01.prql b/prqlc-0.13.12/tests/integration/queries/loop_01.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/loop_01.prql rename to prqlc-0.13.12/tests/integration/queries/loop_01.prql diff --git a/prqlc-0.13.11/tests/integration/queries/math_module.prql b/prqlc-0.13.12/tests/integration/queries/math_module.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/math_module.prql rename to prqlc-0.13.12/tests/integration/queries/math_module.prql diff --git a/prqlc-0.13.11/tests/integration/queries/pipelines.prql b/prqlc-0.13.12/tests/integration/queries/pipelines.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/pipelines.prql rename to prqlc-0.13.12/tests/integration/queries/pipelines.prql diff --git a/prqlc-0.13.11/tests/integration/queries/read_csv.prql b/prqlc-0.13.12/tests/integration/queries/read_csv.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/read_csv.prql rename to prqlc-0.13.12/tests/integration/queries/read_csv.prql diff --git a/prqlc-0.13.11/tests/integration/queries/set_ops_remove.prql b/prqlc-0.13.12/tests/integration/queries/set_ops_remove.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/set_ops_remove.prql rename to prqlc-0.13.12/tests/integration/queries/set_ops_remove.prql diff --git a/prqlc-0.13.11/tests/integration/queries/sort.prql b/prqlc-0.13.12/tests/integration/queries/sort.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/sort.prql rename to prqlc-0.13.12/tests/integration/queries/sort.prql diff --git a/prqlc-0.13.11/tests/integration/queries/sort_2.prql b/prqlc-0.13.12/tests/integration/queries/sort_2.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/sort_2.prql rename to prqlc-0.13.12/tests/integration/queries/sort_2.prql diff --git a/prqlc-0.13.11/tests/integration/queries/sort_3.prql b/prqlc-0.13.12/tests/integration/queries/sort_3.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/sort_3.prql rename to prqlc-0.13.12/tests/integration/queries/sort_3.prql diff --git a/prqlc-0.13.11/tests/integration/queries/switch.prql b/prqlc-0.13.12/tests/integration/queries/switch.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/switch.prql rename to prqlc-0.13.12/tests/integration/queries/switch.prql diff --git a/prqlc-0.13.11/tests/integration/queries/take.prql b/prqlc-0.13.12/tests/integration/queries/take.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/take.prql rename to prqlc-0.13.12/tests/integration/queries/take.prql diff --git a/prqlc-0.13.11/tests/integration/queries/text_module.prql b/prqlc-0.13.12/tests/integration/queries/text_module.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/text_module.prql rename to prqlc-0.13.12/tests/integration/queries/text_module.prql diff --git a/prqlc-0.13.11/tests/integration/queries/window.prql b/prqlc-0.13.12/tests/integration/queries/window.prql similarity index 100% rename from prqlc-0.13.11/tests/integration/queries/window.prql rename to prqlc-0.13.12/tests/integration/queries/window.prql diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__aggregation.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__aggregation.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__aggregation.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__aggregation.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select.snap similarity index 97% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select.snap index 8dfc7501dc..88f876b5d3 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select.snap @@ -2,7 +2,6 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: "from invoices\nselect { customer_id, invoice_id, billing_country }\ntake 10..15\nappend (\n from invoices\n select { customer_id, invoice_id, billing_country }\n take 40..45\n)\nselect { billing_country, invoice_id }\n" input_file: prqlc/prqlc/tests/integration/queries/append_select.prql -snapshot_kind: text --- SELECT * diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select_compute.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select_compute.snap similarity index 98% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select_compute.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select_compute.snap index c9df446690..63ecf95c65 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select_compute.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select_compute.snap @@ -2,7 +2,6 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: "from invoices\nderive total = case [total < 10 => total * 2, true => total]\nselect { customer_id, invoice_id, total }\ntake 5\nappend (\n from invoice_items\n derive unit_price = case [unit_price < 1 => unit_price * 2, true => unit_price]\n select { invoice_line_id, invoice_id, unit_price }\n take 5\n)\nselect { a = customer_id * 2, b = math.round 1 (invoice_id * total) }\n" input_file: prqlc/prqlc/tests/integration/queries/append_select_compute.prql -snapshot_kind: text --- WITH table_1 AS ( SELECT diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select_multiple_with_null.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select_multiple_with_null.snap similarity index 97% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select_multiple_with_null.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select_multiple_with_null.snap index e69f23f285..c8765731da 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select_multiple_with_null.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select_multiple_with_null.snap @@ -2,7 +2,6 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: "from invoices\nselect { customer_id, invoice_id, billing_country }\ntake 5\nappend (\n from employees\n select { employee_id, employee_id, country }\n take 5\n)\nappend (\n from invoice_items\n select { invoice_line_id, invoice_id, null }\n take 5\n)\nselect { billing_country, invoice_id }\n" input_file: prqlc/prqlc/tests/integration/queries/append_select_multiple_with_null.prql -snapshot_kind: text --- SELECT * diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select_nulls.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select_nulls.snap similarity index 67% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select_nulls.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select_nulls.snap index 3f39d95669..74d5e0688c 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select_nulls.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select_nulls.snap @@ -1,6 +1,6 @@ --- source: prqlc/prqlc/tests/integration/queries.rs -expression: "# duckdb:skip\n# postgres:skip\n\nfrom invoices\nselect {an_id = invoice_id, name = null}\ntake 2\nappend (\n from employees\n select {an_id = null, name = first_name}\n take 2\n)\n" +expression: "from invoices\nselect {an_id = invoice_id, name = null}\ntake 2\nappend (\n from employees\n select {an_id = null, name = first_name}\n take 2\n)\n" input_file: prqlc/prqlc/tests/integration/queries/append_select_nulls.prql --- SELECT diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select_simple.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select_simple.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__append_select_simple.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__append_select_simple.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__arithmetic.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__arithmetic.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__arithmetic.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__arithmetic.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__cast.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__cast.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__cast.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__cast.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__constants_only.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__constants_only.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__constants_only.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__constants_only.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__distinct.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__distinct.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__distinct.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__distinct.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__distinct_on.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__distinct_on.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__distinct_on.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__distinct_on.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__genre_counts.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__genre_counts.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__genre_counts.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__genre_counts.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__group_all.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__group_all.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__group_all.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__group_all.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__group_sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__group_sort.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__group_sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__group_sort.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__group_sort_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__group_sort_derive_select_join.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__group_sort_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__group_sort_derive_select_join.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__group_sort_filter_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__group_sort_filter_derive_select_join.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__group_sort_filter_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__group_sort_filter_derive_select_join.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__group_sort_limit_take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__group_sort_limit_take.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__group_sort_limit_take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__group_sort_limit_take.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__invoice_totals.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__invoice_totals.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__invoice_totals.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__invoice_totals.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__loop_01.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__loop_01.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__loop_01.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__loop_01.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__math_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__math_module.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__math_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__math_module.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__pipelines.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__pipelines.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__pipelines.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__pipelines.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__read_csv.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__read_csv.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__read_csv.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__read_csv.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__set_ops_remove.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__set_ops_remove.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__set_ops_remove.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__set_ops_remove.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__sort.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__sort.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__sort_2.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__sort_2.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__sort_2.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__sort_2.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__sort_3.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__sort_3.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__sort_3.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__sort_3.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__switch.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__switch.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__switch.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__switch.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__take.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__take.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__text_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__text_module.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__text_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__text_module.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__window.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__window.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compile__window.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compile__window.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__aggregation.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__aggregation.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__aggregation.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__aggregation.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select.snap similarity index 98% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select.snap index 7b997aacd7..2128fd2a81 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select.snap @@ -2,7 +2,6 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: "from invoices\nselect { customer_id, invoice_id, billing_country }\ntake 10..15\nappend (\n from invoices\n select { customer_id, invoice_id, billing_country }\n take 40..45\n)\nselect { billing_country, invoice_id }\n" input_file: prqlc/prqlc/tests/integration/queries/append_select.prql -snapshot_kind: text --- --- generic +++ postgres diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select_compute.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select_compute.snap similarity index 99% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select_compute.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select_compute.snap index 6aa00af03a..b86238a967 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select_compute.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select_compute.snap @@ -2,7 +2,6 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: "from invoices\nderive total = case [total < 10 => total * 2, true => total]\nselect { customer_id, invoice_id, total }\ntake 5\nappend (\n from invoice_items\n derive unit_price = case [unit_price < 1 => unit_price * 2, true => unit_price]\n select { invoice_line_id, invoice_id, unit_price }\n take 5\n)\nselect { a = customer_id * 2, b = math.round 1 (invoice_id * total) }\n" input_file: prqlc/prqlc/tests/integration/queries/append_select_compute.prql -snapshot_kind: text --- --- generic +++ glaredb @@ -22,7 +21,6 @@ snapshot_kind: text FROM table_1 - --- generic +++ postgres @@ -1,41 +1,34 @@ diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select_multiple_with_null.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select_multiple_with_null.snap similarity index 98% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select_multiple_with_null.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select_multiple_with_null.snap index ad4e030924..d8e8128e49 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select_multiple_with_null.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select_multiple_with_null.snap @@ -2,7 +2,6 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: "from invoices\nselect { customer_id, invoice_id, billing_country }\ntake 5\nappend (\n from employees\n select { employee_id, employee_id, country }\n take 5\n)\nappend (\n from invoice_items\n select { invoice_line_id, invoice_id, null }\n take 5\n)\nselect { billing_country, invoice_id }\n" input_file: prqlc/prqlc/tests/integration/queries/append_select_multiple_with_null.prql -snapshot_kind: text --- --- generic +++ postgres diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select_nulls.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select_nulls.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select_nulls.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select_nulls.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select_simple.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select_simple.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__append_select_simple.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__append_select_simple.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__arithmetic.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__arithmetic.snap similarity index 94% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__arithmetic.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__arithmetic.snap index 78312fd7bd..a180e7fe3b 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__arithmetic.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__arithmetic.snap @@ -2,7 +2,6 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: "# mssql:test\nfrom [\n { id = 1, x_int = 13, x_float = 13.0, k_int = 5, k_float = 5.0 },\n { id = 2, x_int = -13, x_float = -13.0, k_int = 5, k_float = 5.0 },\n { id = 3, x_int = 13, x_float = 13.0, k_int = -5, k_float = -5.0 },\n { id = 4, x_int = -13, x_float = -13.0, k_int = -5, k_float = -5.0 },\n]\nselect {\n id,\n\n x_int / k_int,\n x_int / k_float,\n x_float / k_int,\n x_float / k_float,\n\n q_ii = x_int // k_int,\n q_if = x_int // k_float,\n q_fi = x_float // k_int,\n q_ff = x_float // k_float,\n\n r_ii = x_int % k_int,\n r_if = x_int % k_float,\n r_fi = x_float % k_int,\n r_ff = x_float % k_float,\n\n (q_ii * k_int + r_ii | math.round 0),\n (q_if * k_float + r_if | math.round 0),\n (q_fi * k_int + r_fi | math.round 0),\n (q_ff * k_float + r_ff | math.round 0),\n}\nsort id\n" input_file: prqlc/prqlc/tests/integration/queries/arithmetic.prql -snapshot_kind: text --- --- generic +++ clickhouse @@ -120,7 +119,6 @@ snapshot_kind: text ORDER BY id - --- generic +++ glaredb @@ -25,42 +25,46 @@ @@ -396,32 +394,32 @@ snapshot_kind: text + (x_int * 1.0 / k_float), + (x_float * 1.0 / k_int), + (x_float * 1.0 / k_float), -+ ROUND(ABS(x_int / k_int) - 0.5) * SIGN(x_int) * SIGN(k_int) AS q_ii, -+ ROUND(ABS(x_int / k_float) - 0.5) * SIGN(x_int) * SIGN(k_float) AS q_if, -+ ROUND(ABS(x_float / k_int) - 0.5) * SIGN(x_float) * SIGN(k_int) AS q_fi, -+ ROUND(ABS(x_float / k_float) - 0.5) * SIGN(x_float) * SIGN(k_float) AS q_ff, ++ CAST(ABS(x_int * 1.0 / k_int) AS INTEGER) * SIGN(x_int) * SIGN(k_int) AS q_ii, ++ CAST(ABS(x_int * 1.0 / k_float) AS INTEGER) * SIGN(x_int) * SIGN(k_float) AS q_if, ++ CAST(ABS(x_float * 1.0 / k_int) AS INTEGER) * SIGN(x_float) * SIGN(k_int) AS q_fi, ++ CAST(ABS(x_float * 1.0 / k_float) AS INTEGER) * SIGN(x_float) * SIGN(k_float) AS q_ff, x_int % k_int AS r_ii, x_int % k_float AS r_if, x_float % k_int AS r_fi, x_float % k_float AS r_ff, ROUND( - FLOOR(ABS(x_int / k_int)) * SIGN(x_int) * SIGN(k_int) * k_int + x_int % k_int, -+ ROUND(ABS(x_int / k_int) - 0.5) * SIGN(x_int) * SIGN(k_int) * k_int + x_int % k_int, ++ CAST(ABS(x_int * 1.0 / k_int) AS INTEGER) * SIGN(x_int) * SIGN(k_int) * k_int + x_int % k_int, 0 ), ROUND( - FLOOR(ABS(x_int / k_float)) * SIGN(x_int) * SIGN(k_float) * k_float + x_int % k_float, -+ ROUND(ABS(x_int / k_float) - 0.5) * SIGN(x_int) * SIGN(k_float) * k_float + x_int % k_float, ++ CAST(ABS(x_int * 1.0 / k_float) AS INTEGER) * SIGN(x_int) * SIGN(k_float) * k_float + x_int % k_float, 0 ), ROUND( - FLOOR(ABS(x_float / k_int)) * SIGN(x_float) * SIGN(k_int) * k_int + x_float % k_int, -+ ROUND(ABS(x_float / k_int) - 0.5) * SIGN(x_float) * SIGN(k_int) * k_int + x_float % k_int, ++ CAST(ABS(x_float * 1.0 / k_int) AS INTEGER) * SIGN(x_float) * SIGN(k_int) * k_int + x_float % k_int, 0 ), ROUND( - FLOOR(ABS(x_float / k_float)) * SIGN(x_float) * SIGN(k_float) * k_float + x_float % k_float, -+ ROUND(ABS(x_float / k_float) - 0.5) * SIGN(x_float) * SIGN(k_float) * k_float + x_float % k_float, ++ CAST(ABS(x_float * 1.0 / k_float) AS INTEGER) * SIGN(x_float) * SIGN(k_float) * k_float + x_float % k_float, 0 ) FROM diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__cast.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__cast.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__cast.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__cast.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__constants_only.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__constants_only.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__constants_only.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__constants_only.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__distinct.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__distinct.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__distinct.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__distinct.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__distinct_on.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__distinct_on.snap similarity index 99% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__distinct_on.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__distinct_on.snap index e4821e3c27..7621a94a1a 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__distinct_on.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__distinct_on.snap @@ -73,10 +73,6 @@ input_file: prqlc/prqlc/tests/integration/queries/distinct_on.prql genre_id DESC, media_type_id - - - - --- generic +++ postgres @@ -1,25 +1,21 @@ diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__genre_counts.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__genre_counts.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__genre_counts.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__genre_counts.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__group_all.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__group_all.snap similarity index 99% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__group_all.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__group_all.snap index c12a3166b1..643dd33026 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__group_all.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__group_all.snap @@ -59,7 +59,6 @@ input_file: prqlc/prqlc/tests/integration/queries/group_all.prql GROUP BY table_0.album_id, - --- generic +++ postgres @@ -3,19 +3,22 @@ diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__group_sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__group_sort.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__group_sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__group_sort.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__group_sort_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__group_sort_derive_select_join.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__group_sort_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__group_sort_derive_select_join.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__group_sort_filter_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__group_sort_filter_derive_select_join.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__group_sort_filter_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__group_sort_filter_derive_select_join.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__group_sort_limit_take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__group_sort_limit_take.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__group_sort_limit_take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__group_sort_limit_take.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__invoice_totals.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__invoice_totals.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__invoice_totals.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__invoice_totals.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__loop_01.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__loop_01.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__loop_01.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__loop_01.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__math_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__math_module.snap similarity index 99% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__math_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__math_module.snap index c6ecc42741..7da6de05b7 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__math_module.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__math_module.snap @@ -72,7 +72,6 @@ input_file: prqlc/prqlc/tests/integration/queries/math_module.prql +FETCH FIRST + 5 ROWS ONLY - --- generic +++ postgres @@ -1,19 +1,19 @@ diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__pipelines.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__pipelines.snap similarity index 99% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__pipelines.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__pipelines.snap index 1cf8fa17fd..d6fd7cdc22 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__pipelines.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__pipelines.snap @@ -2,7 +2,6 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: "# sqlite:skip (Only works on Sqlite implementations which have the extension\n# installed\n# https://stackoverflow.com/questions/24037982/how-to-use-regexp-in-sqlite)\n\nfrom tracks\n\nfilter (name ~= \"Love\")\nfilter ((milliseconds / 1000 / 60) | in 3..4)\nsort track_id\ntake 1..15\nselect {name, composer}\n" input_file: prqlc/prqlc/tests/integration/queries/pipelines.prql -snapshot_kind: text --- --- generic +++ clickhouse @@ -56,7 +55,6 @@ snapshot_kind: text FROM table_0 - --- generic +++ glaredb @@ -1,20 +1,20 @@ diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__read_csv.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__read_csv.snap similarity index 99% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__read_csv.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__read_csv.snap index e577b889c8..6d24995f30 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__read_csv.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__read_csv.snap @@ -63,7 +63,6 @@ input_file: prqlc/prqlc/tests/integration/queries/read_csv.prql ORDER BY media_type_id - --- generic +++ glaredb @@ -1,15 +1,15 @@ diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__set_ops_remove.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__set_ops_remove.snap similarity index 97% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__set_ops_remove.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__set_ops_remove.snap index 02fac13986..d9a7f784c0 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__set_ops_remove.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__set_ops_remove.snap @@ -2,7 +2,6 @@ source: prqlc/prqlc/tests/integration/queries.rs expression: "# mssql:test\nlet distinct = rel -> (from t = _param.rel | group {t.*} (take 1))\n\nfrom_text format:json '{ \"columns\": [\"a\"], \"data\": [[1], [2], [2], [3]] }'\ndistinct\nremove (from_text format:json '{ \"columns\": [\"a\"], \"data\": [[1], [2]] }')\nsort a\n" input_file: prqlc/prqlc/tests/integration/queries/set_ops_remove.prql -snapshot_kind: text --- --- generic +++ mssql @@ -29,9 +28,6 @@ snapshot_kind: text table_2 ORDER BY - - - --- generic +++ sqlite @@ -21,21 +21,20 @@ diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__sort.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__sort.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__sort_2.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__sort_2.snap similarity index 99% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__sort_2.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__sort_2.snap index 844b2b3adc..f6fc0e5a09 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__sort_2.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__sort_2.snap @@ -37,9 +37,6 @@ input_file: prqlc/prqlc/tests/integration/queries/sort_2.prql - table_0."AA" + table_0.`AA` - - - --- generic +++ mysql @@ -1,25 +1,25 @@ diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__sort_3.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__sort_3.snap similarity index 99% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__sort_3.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__sort_3.snap index 6f00fa61ea..e6790aa51f 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__sort_3.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__sort_3.snap @@ -69,9 +69,6 @@ input_file: prqlc/prqlc/tests/integration/queries/sort_3.prql - table_3."AA" + table_3.`AA` - - - --- generic +++ mysql @@ -1,52 +1,52 @@ diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__switch.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__switch.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__switch.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__switch.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__take.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__take.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__text_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__text_module.snap similarity index 99% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__text_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__text_module.snap index 8b40f69299..f5047295d7 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__text_module.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__text_module.snap @@ -67,7 +67,6 @@ input_file: prqlc/prqlc/tests/integration/queries/text_module.prql low, up, - --- generic +++ mssql @@ -1,20 +1,20 @@ diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__window.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__window.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__compileall__window.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__compileall__window.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap similarity index 91% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap index 76a6a1655d..d89effb1f5 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__aggregation.snap @@ -7,10 +7,10 @@ frames: - - 1:101-123 - columns: - !All - input_id: 122 + input_id: 124 except: [] inputs: - - id: 122 + - id: 124 name: tracks table: - default_db @@ -18,15 +18,15 @@ frames: - - 1:124-154 - columns: - !All - input_id: 122 + input_id: 124 except: [] - !Single name: - empty_name - target_id: 129 + target_id: 131 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db @@ -35,42 +35,42 @@ frames: - columns: - !Single name: null - target_id: 135 + target_id: 137 target_name: null - !Single name: null - target_id: 138 + target_id: 140 target_name: null - !Single name: null - target_id: 141 + target_id: 143 target_name: null - !Single name: null - target_id: 144 + target_id: 146 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db - tracks nodes: -- id: 122 +- id: 124 kind: Ident span: 1:89-100 ident: !Ident - default_db - tracks - parent: 128 -- id: 124 + parent: 130 +- id: 126 kind: RqOperator span: 1:108-123 targets: - - 126 - - 127 - parent: 128 -- id: 126 + - 128 + - 129 + parent: 130 +- id: 128 kind: Ident span: 1:108-116 ident: !Ident @@ -78,26 +78,26 @@ nodes: - tracks - genre_id targets: - - 122 -- id: 127 + - 124 +- id: 129 kind: Literal span: 1:120-123 -- id: 128 +- id: 130 kind: 'TransformCall: Filter' span: 1:101-123 children: - - 122 - 124 - parent: 134 -- id: 129 + - 126 + parent: 136 +- id: 131 kind: RqOperator span: 1:144-154 alias: empty_name targets: - - 131 - - 132 - parent: 133 -- id: 131 + - 133 + - 134 + parent: 135 +- id: 133 kind: Ident span: 1:144-148 ident: !Ident @@ -105,30 +105,30 @@ nodes: - tracks - name targets: - - 122 -- id: 132 + - 124 +- id: 134 kind: Literal span: 1:152-154 -- id: 133 +- id: 135 kind: Tuple span: 1:144-154 children: - - 129 - parent: 134 -- id: 134 + - 131 + parent: 136 +- id: 136 kind: 'TransformCall: Derive' span: 1:124-154 children: - - 128 - - 133 - parent: 148 -- id: 135 + - 130 + - 135 + parent: 150 +- id: 137 kind: RqOperator span: 1:166-178 targets: - - 137 - parent: 147 -- id: 137 + - 139 + parent: 149 +- id: 139 kind: Ident span: 1:170-178 ident: !Ident @@ -136,14 +136,14 @@ nodes: - tracks - track_id targets: - - 122 -- id: 138 + - 124 +- id: 140 kind: RqOperator span: 1:180-197 targets: - - 140 - parent: 147 -- id: 140 + - 142 + parent: 149 +- id: 142 kind: Ident span: 1:193-197 ident: !Ident @@ -151,50 +151,50 @@ nodes: - tracks - name targets: - - 122 -- id: 141 + - 124 +- id: 143 kind: RqOperator span: 1:199-213 targets: - - 143 - parent: 147 -- id: 143 + - 145 + parent: 149 +- id: 145 kind: Ident span: 1:203-213 ident: !Ident - this - empty_name targets: - - 129 -- id: 144 + - 131 +- id: 146 kind: RqOperator span: 1:215-229 targets: - - 146 - parent: 147 -- id: 146 + - 148 + parent: 149 +- id: 148 kind: Ident span: 1:219-229 ident: !Ident - this - empty_name targets: - - 129 -- id: 147 + - 131 +- id: 149 kind: Tuple span: 1:165-230 children: - - 135 - - 138 - - 141 - - 144 - parent: 148 -- id: 148 + - 137 + - 140 + - 143 + - 146 + parent: 150 +- id: 150 kind: 'TransformCall: Aggregate' span: 1:155-230 children: - - 134 - - 147 + - 136 + - 149 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap similarity index 90% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap index 902e8eeb85..dcdeb7ead0 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select.snap @@ -10,22 +10,22 @@ frames: name: - invoices - customer_id - target_id: 146 + target_id: 148 target_name: null - !Single name: - invoices - invoice_id - target_id: 147 + target_id: 149 target_name: null - !Single name: - invoices - billing_country - target_id: 148 + target_id: 150 target_name: null inputs: - - id: 144 + - id: 146 name: invoices table: - default_db @@ -36,22 +36,22 @@ frames: name: - invoices - customer_id - target_id: 146 + target_id: 148 target_name: null - !Single name: - invoices - invoice_id - target_id: 147 + target_id: 149 target_name: null - !Single name: - invoices - billing_country - target_id: 148 + target_id: 150 target_name: null inputs: - - id: 144 + - id: 146 name: invoices table: - default_db @@ -62,22 +62,22 @@ frames: name: - invoices - customer_id - target_id: 127 + target_id: 129 target_name: null - !Single name: - invoices - invoice_id - target_id: 128 + target_id: 130 target_name: null - !Single name: - invoices - billing_country - target_id: 129 + target_id: 131 target_name: null inputs: - - id: 125 + - id: 127 name: invoices table: - default_db @@ -88,22 +88,22 @@ frames: name: - invoices - customer_id - target_id: 127 + target_id: 129 target_name: null - !Single name: - invoices - invoice_id - target_id: 128 + target_id: 130 target_name: null - !Single name: - invoices - billing_country - target_id: 129 + target_id: 131 target_name: null inputs: - - id: 125 + - id: 127 name: invoices table: - default_db @@ -114,27 +114,27 @@ frames: name: - invoices - customer_id - target_id: 146 + target_id: 148 target_name: null - !Single name: - invoices - invoice_id - target_id: 147 + target_id: 149 target_name: null - !Single name: - invoices - billing_country - target_id: 148 + target_id: 150 target_name: null inputs: - - id: 144 + - id: 146 name: invoices table: - default_db - invoices - - id: 125 + - id: 127 name: invoices table: - default_db @@ -145,34 +145,34 @@ frames: name: - invoices - billing_country - target_id: 156 + target_id: 158 target_name: null - !Single name: - invoices - invoice_id - target_id: 157 + target_id: 159 target_name: null inputs: - - id: 144 + - id: 146 name: invoices table: - default_db - invoices - - id: 125 + - id: 127 name: invoices table: - default_db - invoices nodes: -- id: 125 +- id: 127 kind: Ident span: 1:89-102 ident: !Ident - default_db - invoices - parent: 131 -- id: 127 + parent: 133 +- id: 129 kind: Ident span: 1:114-125 ident: !Ident @@ -180,9 +180,9 @@ nodes: - invoices - customer_id targets: - - 125 - parent: 130 -- id: 128 + - 127 + parent: 132 +- id: 130 kind: Ident span: 1:127-137 ident: !Ident @@ -190,9 +190,9 @@ nodes: - invoices - invoice_id targets: - - 125 - parent: 130 -- id: 129 + - 127 + parent: 132 +- id: 131 kind: Ident span: 1:139-154 ident: !Ident @@ -200,49 +200,49 @@ nodes: - invoices - billing_country targets: - - 125 - parent: 130 -- id: 130 + - 127 + parent: 132 +- id: 132 kind: Tuple span: 1:112-156 children: - - 127 - - 128 - 129 - parent: 131 -- id: 131 + - 130 + - 131 + parent: 133 +- id: 133 kind: 'TransformCall: Select' span: 1:105-156 children: - - 125 - - 130 - parent: 135 -- id: 132 + - 127 + - 132 + parent: 137 +- id: 134 kind: Literal span: 1:164-166 alias: start - parent: 135 -- id: 133 + parent: 137 +- id: 135 kind: Literal span: 1:168-170 alias: end - parent: 135 -- id: 135 + parent: 137 +- id: 137 kind: 'TransformCall: Take' span: 1:159-170 children: - - 131 - - 132 - 133 - parent: 155 -- id: 144 + - 134 + - 135 + parent: 157 +- id: 146 kind: Ident span: 1:0-13 ident: !Ident - default_db - invoices - parent: 150 -- id: 146 + parent: 152 +- id: 148 kind: Ident span: 1:23-34 ident: !Ident @@ -250,9 +250,9 @@ nodes: - invoices - customer_id targets: - - 144 - parent: 149 -- id: 147 + - 146 + parent: 151 +- id: 149 kind: Ident span: 1:36-46 ident: !Ident @@ -260,9 +260,9 @@ nodes: - invoices - invoice_id targets: - - 144 - parent: 149 -- id: 148 + - 146 + parent: 151 +- id: 150 kind: Ident span: 1:48-63 ident: !Ident @@ -270,49 +270,49 @@ nodes: - invoices - billing_country targets: - - 144 - parent: 149 -- id: 149 + - 146 + parent: 151 +- id: 151 kind: Tuple span: 1:21-65 children: - - 146 - - 147 - 148 - parent: 150 -- id: 150 + - 149 + - 150 + parent: 152 +- id: 152 kind: 'TransformCall: Select' span: 1:14-65 children: - - 144 - - 149 - parent: 154 -- id: 151 + - 146 + - 151 + parent: 156 +- id: 153 kind: Literal span: 1:71-73 alias: start - parent: 154 -- id: 152 + parent: 156 +- id: 154 kind: Literal span: 1:75-77 alias: end - parent: 154 -- id: 154 + parent: 156 +- id: 156 kind: 'TransformCall: Take' span: 1:66-77 children: - - 150 - - 151 - 152 - parent: 155 -- id: 155 + - 153 + - 154 + parent: 157 +- id: 157 kind: 'TransformCall: Append' span: 1:78-172 children: - - 154 - - 135 - parent: 159 -- id: 156 + - 156 + - 137 + parent: 161 +- id: 158 kind: Ident span: 1:182-197 ident: !Ident @@ -320,9 +320,9 @@ nodes: - invoices - billing_country targets: - - 148 - parent: 158 -- id: 157 + - 150 + parent: 160 +- id: 159 kind: Ident span: 1:199-209 ident: !Ident @@ -330,21 +330,21 @@ nodes: - invoices - invoice_id targets: - - 147 - parent: 158 -- id: 158 + - 149 + parent: 160 +- id: 160 kind: Tuple span: 1:180-211 children: - - 156 - - 157 - parent: 159 -- id: 159 + - 158 + - 159 + parent: 161 +- id: 161 kind: 'TransformCall: Select' span: 1:173-211 children: - - 155 - - 158 + - 157 + - 160 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap similarity index 92% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap index 9d1e3ce654..7ae27c2200 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_compute.snap @@ -7,15 +7,15 @@ frames: - - 1:14-74 - columns: - !All - input_id: 162 + input_id: 164 except: [] - !Single name: - total - target_id: 164 + target_id: 166 target_name: null inputs: - - id: 162 + - id: 164 name: invoices table: - default_db @@ -26,21 +26,21 @@ frames: name: - invoices - customer_id - target_id: 177 + target_id: 179 target_name: null - !Single name: - invoices - invoice_id - target_id: 178 + target_id: 180 target_name: null - !Single name: - total - target_id: 179 + target_id: 181 target_name: null inputs: - - id: 162 + - id: 164 name: invoices table: - default_db @@ -51,21 +51,21 @@ frames: name: - invoices - customer_id - target_id: 177 + target_id: 179 target_name: null - !Single name: - invoices - invoice_id - target_id: 178 + target_id: 180 target_name: null - !Single name: - total - target_id: 179 + target_id: 181 target_name: null inputs: - - id: 162 + - id: 164 name: invoices table: - default_db @@ -73,15 +73,15 @@ frames: - - 1:156-235 - columns: - !All - input_id: 128 + input_id: 130 except: [] - !Single name: - unit_price - target_id: 130 + target_id: 132 target_name: null inputs: - - id: 128 + - id: 130 name: invoice_items table: - default_db @@ -92,21 +92,21 @@ frames: name: - invoice_items - invoice_line_id - target_id: 143 + target_id: 145 target_name: null - !Single name: - invoice_items - invoice_id - target_id: 144 + target_id: 146 target_name: null - !Single name: - unit_price - target_id: 145 + target_id: 147 target_name: null inputs: - - id: 128 + - id: 130 name: invoice_items table: - default_db @@ -117,21 +117,21 @@ frames: name: - invoice_items - invoice_line_id - target_id: 143 + target_id: 145 target_name: null - !Single name: - invoice_items - invoice_id - target_id: 144 + target_id: 146 target_name: null - !Single name: - unit_price - target_id: 145 + target_id: 147 target_name: null inputs: - - id: 128 + - id: 130 name: invoice_items table: - default_db @@ -142,26 +142,26 @@ frames: name: - invoices - customer_id - target_id: 177 + target_id: 179 target_name: null - !Single name: - invoices - invoice_id - target_id: 178 + target_id: 180 target_name: null - !Single name: - total - target_id: 179 + target_id: 181 target_name: null inputs: - - id: 162 + - id: 164 name: invoices table: - default_db - invoices - - id: 128 + - id: 130 name: invoice_items table: - default_db @@ -171,49 +171,49 @@ frames: - !Single name: - a - target_id: 186 + target_id: 188 target_name: null - !Single name: - b - target_id: 190 + target_id: 192 target_name: null inputs: - - id: 162 + - id: 164 name: invoices table: - default_db - invoices - - id: 128 + - id: 130 name: invoice_items table: - default_db - invoice_items nodes: -- id: 128 +- id: 130 kind: Ident span: 1:135-153 ident: !Ident - default_db - invoice_items - parent: 142 -- id: 130 + parent: 144 +- id: 132 kind: Case span: 1:176-235 alias: unit_price targets: - - 131 - - 135 - - 139 - - 140 - parent: 141 -- id: 131 + - 133 + - 137 + - 141 + - 142 + parent: 143 +- id: 133 kind: RqOperator span: 1:182-196 targets: - - 133 - - 134 -- id: 133 + - 135 + - 136 +- id: 135 kind: Ident span: 1:182-192 ident: !Ident @@ -221,17 +221,17 @@ nodes: - invoice_items - unit_price targets: - - 128 -- id: 134 + - 130 +- id: 136 kind: Literal span: 1:195-196 -- id: 135 +- id: 137 kind: RqOperator span: 1:200-214 targets: - - 137 - - 138 -- id: 137 + - 139 + - 140 +- id: 139 kind: Ident span: 1:200-210 ident: !Ident @@ -239,14 +239,14 @@ nodes: - invoice_items - unit_price targets: - - 128 -- id: 138 + - 130 +- id: 140 kind: Literal span: 1:213-214 -- id: 139 +- id: 141 kind: Literal span: 1:216-220 -- id: 140 +- id: 142 kind: Ident span: 1:224-234 ident: !Ident @@ -254,21 +254,21 @@ nodes: - invoice_items - unit_price targets: - - 128 -- id: 141 + - 130 +- id: 143 kind: Tuple span: 1:176-235 children: - - 130 - parent: 142 -- id: 142 + - 132 + parent: 144 +- id: 144 kind: 'TransformCall: Derive' span: 1:156-235 children: - - 128 - - 141 - parent: 147 -- id: 143 + - 130 + - 143 + parent: 149 +- id: 145 kind: Ident span: 1:247-262 ident: !Ident @@ -276,9 +276,9 @@ nodes: - invoice_items - invoice_line_id targets: - - 128 - parent: 146 -- id: 144 + - 130 + parent: 148 +- id: 146 kind: Ident span: 1:264-274 ident: !Ident @@ -286,66 +286,66 @@ nodes: - invoice_items - invoice_id targets: - - 128 - parent: 146 -- id: 145 + - 130 + parent: 148 +- id: 147 kind: Ident span: 1:276-286 ident: !Ident - this - unit_price targets: - - 130 - parent: 146 -- id: 146 + - 132 + parent: 148 +- id: 148 kind: Tuple span: 1:245-288 children: - - 143 - - 144 - 145 - parent: 147 -- id: 147 - kind: 'TransformCall: Select' - span: 1:238-288 - children: - - 142 - 146 + - 147 parent: 149 - id: 149 + kind: 'TransformCall: Select' + span: 1:238-288 + children: + - 144 + - 148 + parent: 151 +- id: 151 kind: 'TransformCall: Take' span: 1:291-297 children: - - 147 - - 150 - parent: 185 -- id: 150 + - 149 + - 152 + parent: 187 +- id: 152 kind: Literal - parent: 149 -- id: 162 + parent: 151 +- id: 164 kind: Ident span: 1:0-13 ident: !Ident - default_db - invoices - parent: 176 -- id: 164 + parent: 178 +- id: 166 kind: Case span: 1:29-74 alias: total targets: - - 165 - - 169 - - 173 - - 174 - parent: 175 -- id: 165 + - 167 + - 171 + - 175 + - 176 + parent: 177 +- id: 167 kind: RqOperator span: 1:35-45 targets: - - 167 - - 168 -- id: 167 + - 169 + - 170 +- id: 169 kind: Ident span: 1:35-40 ident: !Ident @@ -353,17 +353,17 @@ nodes: - invoices - total targets: - - 162 -- id: 168 + - 164 +- id: 170 kind: Literal span: 1:43-45 -- id: 169 +- id: 171 kind: RqOperator span: 1:49-58 targets: - - 171 - - 172 -- id: 171 + - 173 + - 174 +- id: 173 kind: Ident span: 1:49-54 ident: !Ident @@ -371,14 +371,14 @@ nodes: - invoices - total targets: - - 162 -- id: 172 + - 164 +- id: 174 kind: Literal span: 1:57-58 -- id: 173 +- id: 175 kind: Literal span: 1:60-64 -- id: 174 +- id: 176 kind: Ident span: 1:68-73 ident: !Ident @@ -386,21 +386,21 @@ nodes: - invoices - total targets: - - 162 -- id: 175 + - 164 +- id: 177 kind: Tuple span: 1:29-74 children: - - 164 - parent: 176 -- id: 176 + - 166 + parent: 178 +- id: 178 kind: 'TransformCall: Derive' span: 1:14-74 children: - - 162 - - 175 - parent: 181 -- id: 177 + - 164 + - 177 + parent: 183 +- id: 179 kind: Ident span: 1:84-95 ident: !Ident @@ -408,9 +408,9 @@ nodes: - invoices - customer_id targets: - - 162 - parent: 180 -- id: 178 + - 164 + parent: 182 +- id: 180 kind: Ident span: 1:97-107 ident: !Ident @@ -418,58 +418,58 @@ nodes: - invoices - invoice_id targets: - - 162 - parent: 180 -- id: 179 + - 164 + parent: 182 +- id: 181 kind: Ident span: 1:109-114 ident: !Ident - this - total targets: - - 164 - parent: 180 -- id: 180 + - 166 + parent: 182 +- id: 182 kind: Tuple span: 1:82-116 children: - - 177 - - 178 - 179 - parent: 181 -- id: 181 - kind: 'TransformCall: Select' - span: 1:75-116 - children: - - 176 - 180 + - 181 parent: 183 - id: 183 + kind: 'TransformCall: Select' + span: 1:75-116 + children: + - 178 + - 182 + parent: 185 +- id: 185 kind: 'TransformCall: Take' span: 1:117-123 children: - - 181 - - 184 - parent: 185 -- id: 184 + - 183 + - 186 + parent: 187 +- id: 186 kind: Literal - parent: 183 -- id: 185 + parent: 185 +- id: 187 kind: 'TransformCall: Append' span: 1:124-299 children: - - 183 - - 149 - parent: 198 -- id: 186 + - 185 + - 151 + parent: 200 +- id: 188 kind: RqOperator span: 1:313-328 alias: a targets: - - 188 - - 189 - parent: 197 -- id: 188 + - 190 + - 191 + parent: 199 +- id: 190 kind: Ident span: 1:313-324 ident: !Ident @@ -477,28 +477,28 @@ nodes: - invoices - customer_id targets: - - 177 -- id: 189 + - 179 +- id: 191 kind: Literal span: 1:327-328 -- id: 190 +- id: 192 kind: RqOperator span: 1:334-367 alias: b targets: - - 192 - - 193 - parent: 197 -- id: 192 + - 194 + - 195 + parent: 199 +- id: 194 kind: Literal span: 1:345-346 -- id: 193 +- id: 195 kind: RqOperator span: 1:348-366 targets: - - 195 - - 196 -- id: 195 + - 197 + - 198 +- id: 197 kind: Ident span: 1:348-358 ident: !Ident @@ -506,28 +506,28 @@ nodes: - invoices - invoice_id targets: - - 178 -- id: 196 + - 180 +- id: 198 kind: Ident span: 1:361-366 ident: !Ident - this - total targets: - - 179 -- id: 197 + - 181 +- id: 199 kind: Tuple span: 1:307-369 children: - - 186 - - 190 - parent: 198 -- id: 198 + - 188 + - 192 + parent: 200 +- id: 200 kind: 'TransformCall: Select' span: 1:300-369 children: - - 185 - - 197 + - 187 + - 199 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap similarity index 91% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap index 96578c01c2..feb63ea110 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_multiple_with_null.snap @@ -10,22 +10,22 @@ frames: name: - invoices - customer_id - target_id: 166 + target_id: 168 target_name: null - !Single name: - invoices - invoice_id - target_id: 167 + target_id: 169 target_name: null - !Single name: - invoices - billing_country - target_id: 168 + target_id: 170 target_name: null inputs: - - id: 164 + - id: 166 name: invoices table: - default_db @@ -36,22 +36,22 @@ frames: name: - invoices - customer_id - target_id: 166 + target_id: 168 target_name: null - !Single name: - invoices - invoice_id - target_id: 167 + target_id: 169 target_name: null - !Single name: - invoices - billing_country - target_id: 168 + target_id: 170 target_name: null inputs: - - id: 164 + - id: 166 name: invoices table: - default_db @@ -60,22 +60,22 @@ frames: - columns: - !Single name: null - target_id: 148 + target_id: 150 target_name: null - !Single name: - employees - employee_id - target_id: 149 + target_id: 151 target_name: null - !Single name: - employees - country - target_id: 150 + target_id: 152 target_name: null inputs: - - id: 146 + - id: 148 name: employees table: - default_db @@ -84,22 +84,22 @@ frames: - columns: - !Single name: null - target_id: 148 + target_id: 150 target_name: null - !Single name: - employees - employee_id - target_id: 149 + target_id: 151 target_name: null - !Single name: - employees - country - target_id: 150 + target_id: 152 target_name: null inputs: - - id: 146 + - id: 148 name: employees table: - default_db @@ -110,27 +110,27 @@ frames: name: - invoices - customer_id - target_id: 166 + target_id: 168 target_name: null - !Single name: - invoices - invoice_id - target_id: 167 + target_id: 169 target_name: null - !Single name: - invoices - billing_country - target_id: 168 + target_id: 170 target_name: null inputs: - - id: 164 + - id: 166 name: invoices table: - default_db - invoices - - id: 146 + - id: 148 name: employees table: - default_db @@ -141,20 +141,20 @@ frames: name: - invoice_items - invoice_line_id - target_id: 127 + target_id: 129 target_name: null - !Single name: - invoice_items - invoice_id - target_id: 128 + target_id: 130 target_name: null - !Single name: null - target_id: 129 + target_id: 131 target_name: null inputs: - - id: 125 + - id: 127 name: invoice_items table: - default_db @@ -165,20 +165,20 @@ frames: name: - invoice_items - invoice_line_id - target_id: 127 + target_id: 129 target_name: null - !Single name: - invoice_items - invoice_id - target_id: 128 + target_id: 130 target_name: null - !Single name: null - target_id: 129 + target_id: 131 target_name: null inputs: - - id: 125 + - id: 127 name: invoice_items table: - default_db @@ -189,32 +189,32 @@ frames: name: - invoices - customer_id - target_id: 166 + target_id: 168 target_name: null - !Single name: - invoices - invoice_id - target_id: 167 + target_id: 169 target_name: null - !Single name: - invoices - billing_country - target_id: 168 + target_id: 170 target_name: null inputs: - - id: 164 + - id: 166 name: invoices table: - default_db - invoices - - id: 146 + - id: 148 name: employees table: - default_db - employees - - id: 125 + - id: 127 name: invoice_items table: - default_db @@ -225,39 +225,39 @@ frames: name: - invoices - billing_country - target_id: 176 + target_id: 178 target_name: null - !Single name: - invoices - invoice_id - target_id: 177 + target_id: 179 target_name: null inputs: - - id: 164 + - id: 166 name: invoices table: - default_db - invoices - - id: 146 + - id: 148 name: employees table: - default_db - employees - - id: 125 + - id: 127 name: invoice_items table: - default_db - invoice_items nodes: -- id: 125 +- id: 127 kind: Ident span: 1:168-186 ident: !Ident - default_db - invoice_items - parent: 131 -- id: 127 + parent: 133 +- id: 129 kind: Ident span: 1:198-213 ident: !Ident @@ -265,9 +265,9 @@ nodes: - invoice_items - invoice_line_id targets: - - 125 - parent: 130 -- id: 128 + - 127 + parent: 132 +- id: 130 kind: Ident span: 1:215-225 ident: !Ident @@ -275,45 +275,45 @@ nodes: - invoice_items - invoice_id targets: - - 125 - parent: 130 -- id: 129 + - 127 + parent: 132 +- id: 131 kind: Literal span: 1:227-231 - parent: 130 -- id: 130 + parent: 132 +- id: 132 kind: Tuple span: 1:196-233 children: - - 127 - - 128 - 129 - parent: 131 -- id: 131 - kind: 'TransformCall: Select' - span: 1:189-233 - children: - - 125 - 130 + - 131 parent: 133 - id: 133 + kind: 'TransformCall: Select' + span: 1:189-233 + children: + - 127 + - 132 + parent: 135 +- id: 135 kind: 'TransformCall: Take' span: 1:236-242 children: - - 131 - - 134 - parent: 175 -- id: 134 + - 133 + - 136 + parent: 177 +- id: 136 kind: Literal - parent: 133 -- id: 146 + parent: 135 +- id: 148 kind: Ident span: 1:84-98 ident: !Ident - default_db - employees - parent: 152 -- id: 148 + parent: 154 +- id: 150 kind: Ident span: 1:110-121 ident: !Ident @@ -321,9 +321,9 @@ nodes: - employees - employee_id targets: - - 146 - parent: 151 -- id: 149 + - 148 + parent: 153 +- id: 151 kind: Ident span: 1:123-134 ident: !Ident @@ -331,9 +331,9 @@ nodes: - employees - employee_id targets: - - 146 - parent: 151 -- id: 150 + - 148 + parent: 153 +- id: 152 kind: Ident span: 1:136-143 ident: !Ident @@ -341,41 +341,41 @@ nodes: - employees - country targets: - - 146 - parent: 151 -- id: 151 + - 148 + parent: 153 +- id: 153 kind: Tuple span: 1:108-145 children: - - 148 - - 149 - 150 - parent: 152 -- id: 152 - kind: 'TransformCall: Select' - span: 1:101-145 - children: - - 146 - 151 + - 152 parent: 154 - id: 154 + kind: 'TransformCall: Select' + span: 1:101-145 + children: + - 148 + - 153 + parent: 156 +- id: 156 kind: 'TransformCall: Take' span: 1:148-154 children: - - 152 - - 155 - parent: 174 -- id: 155 + - 154 + - 157 + parent: 176 +- id: 157 kind: Literal - parent: 154 -- id: 164 + parent: 156 +- id: 166 kind: Ident span: 1:0-13 ident: !Ident - default_db - invoices - parent: 170 -- id: 166 + parent: 172 +- id: 168 kind: Ident span: 1:23-34 ident: !Ident @@ -383,9 +383,9 @@ nodes: - invoices - customer_id targets: - - 164 - parent: 169 -- id: 167 + - 166 + parent: 171 +- id: 169 kind: Ident span: 1:36-46 ident: !Ident @@ -393,9 +393,9 @@ nodes: - invoices - invoice_id targets: - - 164 - parent: 169 -- id: 168 + - 166 + parent: 171 +- id: 170 kind: Ident span: 1:48-63 ident: !Ident @@ -403,48 +403,48 @@ nodes: - invoices - billing_country targets: - - 164 - parent: 169 -- id: 169 + - 166 + parent: 171 +- id: 171 kind: Tuple span: 1:21-65 children: - - 166 - - 167 - 168 - parent: 170 -- id: 170 - kind: 'TransformCall: Select' - span: 1:14-65 - children: - - 164 - 169 + - 170 parent: 172 - id: 172 + kind: 'TransformCall: Select' + span: 1:14-65 + children: + - 166 + - 171 + parent: 174 +- id: 174 kind: 'TransformCall: Take' span: 1:66-72 children: - - 170 - - 173 - parent: 174 -- id: 173 + - 172 + - 175 + parent: 176 +- id: 175 kind: Literal - parent: 172 -- id: 174 + parent: 174 +- id: 176 kind: 'TransformCall: Append' span: 1:73-156 children: - - 172 - - 154 - parent: 175 -- id: 175 + - 174 + - 156 + parent: 177 +- id: 177 kind: 'TransformCall: Append' span: 1:157-244 children: - - 174 - - 133 - parent: 179 -- id: 176 + - 176 + - 135 + parent: 181 +- id: 178 kind: Ident span: 1:254-269 ident: !Ident @@ -452,9 +452,9 @@ nodes: - invoices - billing_country targets: - - 168 - parent: 178 -- id: 177 + - 170 + parent: 180 +- id: 179 kind: Ident span: 1:271-281 ident: !Ident @@ -462,21 +462,21 @@ nodes: - invoices - invoice_id targets: - - 167 - parent: 178 -- id: 178 + - 169 + parent: 180 +- id: 180 kind: Tuple span: 1:252-283 children: - - 176 - - 177 - parent: 179 -- id: 179 + - 178 + - 179 + parent: 181 +- id: 181 kind: 'TransformCall: Select' span: 1:245-283 children: - - 175 - - 178 + - 177 + - 180 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap similarity index 90% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap index df802f8f9c..3b99f97e1c 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_nulls.snap @@ -9,15 +9,15 @@ frames: - !Single name: - an_id - target_id: 141 + target_id: 143 target_name: null - !Single name: - name - target_id: 142 + target_id: 144 target_name: null inputs: - - id: 139 + - id: 141 name: invoices table: - default_db @@ -27,15 +27,15 @@ frames: - !Single name: - an_id - target_id: 141 + target_id: 143 target_name: null - !Single name: - name - target_id: 142 + target_id: 144 target_name: null inputs: - - id: 139 + - id: 141 name: invoices table: - default_db @@ -45,15 +45,15 @@ frames: - !Single name: - an_id - target_id: 124 + target_id: 126 target_name: null - !Single name: - name - target_id: 125 + target_id: 127 target_name: null inputs: - - id: 122 + - id: 124 name: employees table: - default_db @@ -63,15 +63,15 @@ frames: - !Single name: - an_id - target_id: 124 + target_id: 126 target_name: null - !Single name: - name - target_id: 125 + target_id: 127 target_name: null inputs: - - id: 122 + - id: 124 name: employees table: - default_db @@ -81,38 +81,38 @@ frames: - !Single name: - an_id - target_id: 141 + target_id: 143 target_name: null - !Single name: - name - target_id: 142 + target_id: 144 target_name: null inputs: - - id: 139 + - id: 141 name: invoices table: - default_db - invoices - - id: 122 + - id: 124 name: employees table: - default_db - employees nodes: -- id: 122 +- id: 124 kind: Ident span: 1:73-87 ident: !Ident - default_db - employees - parent: 127 -- id: 124 + parent: 129 +- id: 126 kind: Literal span: 1:106-110 alias: an_id - parent: 126 -- id: 125 + parent: 128 +- id: 127 kind: Ident span: 1:119-129 alias: name @@ -121,40 +121,40 @@ nodes: - employees - first_name targets: - - 122 - parent: 126 -- id: 126 + - 124 + parent: 128 +- id: 128 kind: Tuple span: 1:97-130 children: - - 124 - - 125 - parent: 127 -- id: 127 - kind: 'TransformCall: Select' - span: 1:90-130 - children: - - 122 - 126 + - 127 parent: 129 - id: 129 + kind: 'TransformCall: Select' + span: 1:90-130 + children: + - 124 + - 128 + parent: 131 +- id: 131 kind: 'TransformCall: Take' span: 1:133-139 children: - - 127 - - 130 - parent: 148 -- id: 130 + - 129 + - 132 + parent: 150 +- id: 132 kind: Literal - parent: 129 -- id: 139 + parent: 131 +- id: 141 kind: Ident span: 1:0-13 ident: !Ident - default_db - invoices - parent: 144 -- id: 141 + parent: 146 +- id: 143 kind: Ident span: 1:30-40 alias: an_id @@ -163,43 +163,43 @@ nodes: - invoices - invoice_id targets: - - 139 - parent: 143 -- id: 142 + - 141 + parent: 145 +- id: 144 kind: Literal span: 1:49-53 alias: name - parent: 143 -- id: 143 + parent: 145 +- id: 145 kind: Tuple span: 1:21-54 children: - - 141 - - 142 - parent: 144 -- id: 144 - kind: 'TransformCall: Select' - span: 1:14-54 - children: - - 139 - 143 + - 144 parent: 146 - id: 146 + kind: 'TransformCall: Select' + span: 1:14-54 + children: + - 141 + - 145 + parent: 148 +- id: 148 kind: 'TransformCall: Take' span: 1:55-61 children: - - 144 - - 147 - parent: 148 -- id: 147 + - 146 + - 149 + parent: 150 +- id: 149 kind: Literal - parent: 146 -- id: 148 + parent: 148 +- id: 150 kind: 'TransformCall: Append' span: 1:62-141 children: - - 146 - - 129 + - 148 + - 131 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap similarity index 91% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap index 58976495a8..bbd4f0cf16 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__append_select_simple.snap @@ -10,16 +10,16 @@ frames: name: - invoices - invoice_id - target_id: 138 + target_id: 140 target_name: null - !Single name: - invoices - billing_country - target_id: 139 + target_id: 141 target_name: null inputs: - - id: 136 + - id: 138 name: invoices table: - default_db @@ -29,16 +29,16 @@ frames: - !Single name: - invoice_id - target_id: 124 + target_id: 126 target_name: null - !Single name: - invoices - billing_country - target_id: 128 + target_id: 130 target_name: null inputs: - - id: 122 + - id: 124 name: invoices table: - default_db @@ -49,21 +49,21 @@ frames: name: - invoices - invoice_id - target_id: 138 + target_id: 140 target_name: null - !Single name: - invoices - billing_country - target_id: 139 + target_id: 141 target_name: null inputs: - - id: 136 + - id: 138 name: invoices table: - default_db - invoices - - id: 122 + - id: 124 name: invoices table: - default_db @@ -74,42 +74,42 @@ frames: name: - invoices - invoice_id - target_id: 138 + target_id: 140 target_name: null - !Single name: - invoices - billing_country - target_id: 139 + target_id: 141 target_name: null inputs: - - id: 136 + - id: 138 name: invoices table: - default_db - invoices - - id: 122 + - id: 124 name: invoices table: - default_db - invoices nodes: -- id: 122 +- id: 124 kind: Ident span: 1:64-77 ident: !Ident - default_db - invoices - parent: 130 -- id: 124 + parent: 132 +- id: 126 kind: RqOperator span: 1:102-120 alias: invoice_id targets: - - 126 - - 127 - parent: 129 -- id: 126 + - 128 + - 129 + parent: 131 +- id: 128 kind: Ident span: 1:102-114 ident: !Ident @@ -117,11 +117,11 @@ nodes: - invoices - invoice_id targets: - - 122 -- id: 127 + - 124 +- id: 129 kind: Literal span: 1:117-120 -- id: 128 +- id: 130 kind: Ident span: 1:122-137 ident: !Ident @@ -129,30 +129,30 @@ nodes: - invoices - billing_country targets: - - 122 - parent: 129 -- id: 129 + - 124 + parent: 131 +- id: 131 kind: Tuple span: 1:87-139 children: - - 124 - - 128 - parent: 130 -- id: 130 + - 126 + - 130 + parent: 132 +- id: 132 kind: 'TransformCall: Select' span: 1:80-139 children: - - 122 - - 129 - parent: 142 -- id: 136 + - 124 + - 131 + parent: 144 +- id: 138 kind: Ident span: 1:0-13 ident: !Ident - default_db - invoices - parent: 141 -- id: 138 + parent: 143 +- id: 140 kind: Ident span: 1:23-33 ident: !Ident @@ -160,9 +160,9 @@ nodes: - invoices - invoice_id targets: - - 136 - parent: 140 -- id: 139 + - 138 + parent: 142 +- id: 141 kind: Ident span: 1:35-50 ident: !Ident @@ -170,40 +170,40 @@ nodes: - invoices - billing_country targets: - - 136 - parent: 140 -- id: 140 + - 138 + parent: 142 +- id: 142 kind: Tuple span: 1:21-52 children: - - 138 - - 139 - parent: 141 -- id: 141 + - 140 + - 141 + parent: 143 +- id: 143 kind: 'TransformCall: Select' span: 1:14-52 children: - - 136 - - 140 - parent: 142 -- id: 142 + - 138 + - 142 + parent: 144 +- id: 144 kind: 'TransformCall: Append' span: 1:53-141 children: - - 141 - - 130 - parent: 148 -- id: 143 + - 143 + - 132 + parent: 150 +- id: 145 kind: RqOperator span: 1:168-189 targets: - - 146 - - 147 - parent: 148 -- id: 146 + - 148 + - 149 + parent: 150 +- id: 148 kind: Literal span: 1:185-188 -- id: 147 +- id: 149 kind: Ident span: 1:150-165 ident: !Ident @@ -211,13 +211,13 @@ nodes: - invoices - billing_country targets: - - 139 -- id: 148 + - 141 +- id: 150 kind: 'TransformCall: Filter' span: 1:142-190 children: - - 142 - - 143 + - 144 + - 145 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap similarity index 88% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap index a9d413b0ea..c4254d6fc7 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__arithmetic.snap @@ -8,875 +8,875 @@ frames: - columns: - !Single name: - - _literal_119 + - _literal_121 - id - target_id: 161 + target_id: 163 target_name: null - !Single name: null - target_id: 162 + target_id: 164 target_name: null - !Single name: null - target_id: 166 + target_id: 168 target_name: null - !Single name: null - target_id: 170 + target_id: 172 target_name: null - !Single name: null - target_id: 174 + target_id: 176 target_name: null - !Single name: - q_ii - target_id: 178 + target_id: 180 target_name: null - !Single name: - q_if - target_id: 182 + target_id: 184 target_name: null - !Single name: - q_fi - target_id: 186 + target_id: 188 target_name: null - !Single name: - q_ff - target_id: 190 + target_id: 192 target_name: null - !Single name: - r_ii - target_id: 194 + target_id: 196 target_name: null - !Single name: - r_if - target_id: 198 + target_id: 200 target_name: null - !Single name: - r_fi - target_id: 202 + target_id: 204 target_name: null - !Single name: - r_ff - target_id: 206 + target_id: 208 target_name: null - !Single name: null - target_id: 210 + target_id: 212 target_name: null - !Single name: null - target_id: 221 + target_id: 223 target_name: null - !Single name: null - target_id: 232 + target_id: 234 target_name: null - !Single name: null - target_id: 243 + target_id: 245 target_name: null inputs: - - id: 119 - name: _literal_119 + - id: 121 + name: _literal_121 table: - default_db - - _literal_119 + - _literal_121 - - 1:825-832 - columns: - !Single name: - - _literal_119 + - _literal_121 - id - target_id: 161 + target_id: 163 target_name: null - !Single name: null - target_id: 162 + target_id: 164 target_name: null - !Single name: null - target_id: 166 + target_id: 168 target_name: null - !Single name: null - target_id: 170 + target_id: 172 target_name: null - !Single name: null - target_id: 174 + target_id: 176 target_name: null - !Single name: - q_ii - target_id: 178 + target_id: 180 target_name: null - !Single name: - q_if - target_id: 182 + target_id: 184 target_name: null - !Single name: - q_fi - target_id: 186 + target_id: 188 target_name: null - !Single name: - q_ff - target_id: 190 + target_id: 192 target_name: null - !Single name: - r_ii - target_id: 194 + target_id: 196 target_name: null - !Single name: - r_if - target_id: 198 + target_id: 200 target_name: null - !Single name: - r_fi - target_id: 202 + target_id: 204 target_name: null - !Single name: - r_ff - target_id: 206 + target_id: 208 target_name: null - !Single name: null - target_id: 210 + target_id: 212 target_name: null - !Single name: null - target_id: 221 + target_id: 223 target_name: null - !Single name: null - target_id: 232 + target_id: 234 target_name: null - !Single name: null - target_id: 243 + target_id: 245 target_name: null inputs: - - id: 119 - name: _literal_119 + - id: 121 + name: _literal_121 table: - default_db - - _literal_119 + - _literal_121 nodes: -- id: 119 +- id: 121 kind: Array span: 1:13-317 children: - - 120 - - 126 - - 136 - - 146 - parent: 255 -- id: 120 + - 122 + - 128 + - 138 + - 148 + parent: 257 +- id: 122 kind: Tuple span: 1:24-92 children: - - 121 - - 122 - 123 - 124 - 125 - parent: 119 -- id: 121 + - 126 + - 127 + parent: 121 +- id: 123 kind: Literal span: 1:31-32 alias: id - parent: 120 -- id: 122 + parent: 122 +- id: 124 kind: Literal span: 1:43-45 alias: x_int - parent: 120 -- id: 123 + parent: 122 +- id: 125 kind: Literal span: 1:58-62 alias: x_float - parent: 120 -- id: 124 + parent: 122 +- id: 126 kind: Literal span: 1:73-74 alias: k_int - parent: 120 -- id: 125 + parent: 122 +- id: 127 kind: Literal span: 1:87-90 alias: k_float - parent: 120 -- id: 126 + parent: 122 +- id: 128 kind: Tuple span: 1:98-166 children: - - 127 - - 128 - - 131 - - 134 - - 135 - parent: 119 -- id: 127 + - 129 + - 130 + - 133 + - 136 + - 137 + parent: 121 +- id: 129 kind: Literal span: 1:105-106 alias: id - parent: 126 -- id: 128 + parent: 128 +- id: 130 kind: Literal span: 1:116-119 alias: x_int - parent: 126 -- id: 131 + parent: 128 +- id: 133 kind: Literal span: 1:131-136 alias: x_float - parent: 126 -- id: 134 + parent: 128 +- id: 136 kind: Literal span: 1:147-148 alias: k_int - parent: 126 -- id: 135 + parent: 128 +- id: 137 kind: Literal span: 1:161-164 alias: k_float - parent: 126 -- id: 136 + parent: 128 +- id: 138 kind: Tuple span: 1:172-240 children: - - 137 - - 138 - 139 - 140 - - 143 - parent: 119 -- id: 137 + - 141 + - 142 + - 145 + parent: 121 +- id: 139 kind: Literal span: 1:179-180 alias: id - parent: 136 -- id: 138 + parent: 138 +- id: 140 kind: Literal span: 1:191-193 alias: x_int - parent: 136 -- id: 139 + parent: 138 +- id: 141 kind: Literal span: 1:206-210 alias: x_float - parent: 136 -- id: 140 + parent: 138 +- id: 142 kind: Literal span: 1:220-222 alias: k_int - parent: 136 -- id: 143 + parent: 138 +- id: 145 kind: Literal span: 1:234-238 alias: k_float - parent: 136 -- id: 146 + parent: 138 +- id: 148 kind: Tuple span: 1:246-314 children: - - 147 - - 148 - - 151 - - 154 - - 157 - parent: 119 -- id: 147 + - 149 + - 150 + - 153 + - 156 + - 159 + parent: 121 +- id: 149 kind: Literal span: 1:253-254 alias: id - parent: 146 -- id: 148 + parent: 148 +- id: 150 kind: Literal span: 1:264-267 alias: x_int - parent: 146 -- id: 151 + parent: 148 +- id: 153 kind: Literal span: 1:279-284 alias: x_float - parent: 146 -- id: 154 + parent: 148 +- id: 156 kind: Literal span: 1:294-296 alias: k_int - parent: 146 -- id: 157 + parent: 148 +- id: 159 kind: Literal span: 1:308-312 alias: k_float - parent: 146 -- id: 161 + parent: 148 +- id: 163 kind: Ident span: 1:331-333 ident: !Ident - this - - _literal_119 + - _literal_121 - id targets: - - 119 - parent: 254 -- id: 162 + - 121 + parent: 256 +- id: 164 kind: RqOperator span: 1:340-353 targets: - - 164 - - 165 - parent: 254 -- id: 164 + - 166 + - 167 + parent: 256 +- id: 166 kind: Ident span: 1:340-345 ident: !Ident - this - - _literal_119 + - _literal_121 - x_int targets: - - 119 -- id: 165 + - 121 +- id: 167 kind: Ident span: 1:348-353 ident: !Ident - this - - _literal_119 + - _literal_121 - k_int targets: - - 119 -- id: 166 + - 121 +- id: 168 kind: RqOperator span: 1:359-374 targets: - - 168 - - 169 - parent: 254 -- id: 168 + - 170 + - 171 + parent: 256 +- id: 170 kind: Ident span: 1:359-364 ident: !Ident - this - - _literal_119 + - _literal_121 - x_int targets: - - 119 -- id: 169 + - 121 +- id: 171 kind: Ident span: 1:367-374 ident: !Ident - this - - _literal_119 + - _literal_121 - k_float targets: - - 119 -- id: 170 + - 121 +- id: 172 kind: RqOperator span: 1:380-395 targets: - - 172 - - 173 - parent: 254 -- id: 172 + - 174 + - 175 + parent: 256 +- id: 174 kind: Ident span: 1:380-387 ident: !Ident - this - - _literal_119 + - _literal_121 - x_float targets: - - 119 -- id: 173 + - 121 +- id: 175 kind: Ident span: 1:390-395 ident: !Ident - this - - _literal_119 + - _literal_121 - k_int targets: - - 119 -- id: 174 + - 121 +- id: 176 kind: RqOperator span: 1:401-418 targets: - - 176 - - 177 - parent: 254 -- id: 176 + - 178 + - 179 + parent: 256 +- id: 178 kind: Ident span: 1:401-408 ident: !Ident - this - - _literal_119 + - _literal_121 - x_float targets: - - 119 -- id: 177 + - 121 +- id: 179 kind: Ident span: 1:411-418 ident: !Ident - this - - _literal_119 + - _literal_121 - k_float targets: - - 119 -- id: 178 + - 121 +- id: 180 kind: RqOperator span: 1:432-446 alias: q_ii targets: - - 180 - - 181 - parent: 254 -- id: 180 + - 182 + - 183 + parent: 256 +- id: 182 kind: Ident span: 1:432-437 ident: !Ident - this - - _literal_119 + - _literal_121 - x_int targets: - - 119 -- id: 181 + - 121 +- id: 183 kind: Ident span: 1:441-446 ident: !Ident - this - - _literal_119 + - _literal_121 - k_int targets: - - 119 -- id: 182 + - 121 +- id: 184 kind: RqOperator span: 1:459-475 alias: q_if targets: - - 184 - - 185 - parent: 254 -- id: 184 + - 186 + - 187 + parent: 256 +- id: 186 kind: Ident span: 1:459-464 ident: !Ident - this - - _literal_119 + - _literal_121 - x_int targets: - - 119 -- id: 185 + - 121 +- id: 187 kind: Ident span: 1:468-475 ident: !Ident - this - - _literal_119 + - _literal_121 - k_float targets: - - 119 -- id: 186 + - 121 +- id: 188 kind: RqOperator span: 1:488-504 alias: q_fi targets: - - 188 - - 189 - parent: 254 -- id: 188 + - 190 + - 191 + parent: 256 +- id: 190 kind: Ident span: 1:488-495 ident: !Ident - this - - _literal_119 + - _literal_121 - x_float targets: - - 119 -- id: 189 + - 121 +- id: 191 kind: Ident span: 1:499-504 ident: !Ident - this - - _literal_119 + - _literal_121 - k_int targets: - - 119 -- id: 190 + - 121 +- id: 192 kind: RqOperator span: 1:517-535 alias: q_ff targets: - - 192 - - 193 - parent: 254 -- id: 192 + - 194 + - 195 + parent: 256 +- id: 194 kind: Ident span: 1:517-524 ident: !Ident - this - - _literal_119 + - _literal_121 - x_float targets: - - 119 -- id: 193 + - 121 +- id: 195 kind: Ident span: 1:528-535 ident: !Ident - this - - _literal_119 + - _literal_121 - k_float targets: - - 119 -- id: 194 + - 121 +- id: 196 kind: RqOperator span: 1:549-562 alias: r_ii targets: - - 196 - - 197 - parent: 254 -- id: 196 + - 198 + - 199 + parent: 256 +- id: 198 kind: Ident span: 1:549-554 ident: !Ident - this - - _literal_119 + - _literal_121 - x_int targets: - - 119 -- id: 197 + - 121 +- id: 199 kind: Ident span: 1:557-562 ident: !Ident - this - - _literal_119 + - _literal_121 - k_int targets: - - 119 -- id: 198 + - 121 +- id: 200 kind: RqOperator span: 1:575-590 alias: r_if targets: - - 200 - - 201 - parent: 254 -- id: 200 + - 202 + - 203 + parent: 256 +- id: 202 kind: Ident span: 1:575-580 ident: !Ident - this - - _literal_119 + - _literal_121 - x_int targets: - - 119 -- id: 201 + - 121 +- id: 203 kind: Ident span: 1:583-590 ident: !Ident - this - - _literal_119 + - _literal_121 - k_float targets: - - 119 -- id: 202 + - 121 +- id: 204 kind: RqOperator span: 1:603-618 alias: r_fi targets: - - 204 - - 205 - parent: 254 -- id: 204 + - 206 + - 207 + parent: 256 +- id: 206 kind: Ident span: 1:603-610 ident: !Ident - this - - _literal_119 + - _literal_121 - x_float targets: - - 119 -- id: 205 + - 121 +- id: 207 kind: Ident span: 1:613-618 ident: !Ident - this - - _literal_119 + - _literal_121 - k_int targets: - - 119 -- id: 206 + - 121 +- id: 208 kind: RqOperator span: 1:631-648 alias: r_ff targets: - - 208 - - 209 - parent: 254 -- id: 208 + - 210 + - 211 + parent: 256 +- id: 210 kind: Ident span: 1:631-638 ident: !Ident - this - - _literal_119 + - _literal_121 - x_float targets: - - 119 -- id: 209 + - 121 +- id: 211 kind: Ident span: 1:641-648 ident: !Ident - this - - _literal_119 + - _literal_121 - k_float targets: - - 119 -- id: 210 + - 121 +- id: 212 kind: RqOperator span: 1:678-690 targets: - - 213 - - 214 - parent: 254 -- id: 213 + - 215 + - 216 + parent: 256 +- id: 215 kind: Literal span: 1:689-690 -- id: 214 +- id: 216 kind: RqOperator span: 1:656-675 targets: - - 216 - - 220 -- id: 216 + - 218 + - 222 +- id: 218 kind: RqOperator span: 1:656-668 targets: - - 218 - - 219 -- id: 218 + - 220 + - 221 +- id: 220 kind: Ident span: 1:656-660 ident: !Ident - this - q_ii targets: - - 178 -- id: 219 + - 180 +- id: 221 kind: Ident span: 1:663-668 ident: !Ident - this - - _literal_119 + - _literal_121 - k_int targets: - - 119 -- id: 220 + - 121 +- id: 222 kind: Ident span: 1:671-675 ident: !Ident - this - r_ii targets: - - 194 -- id: 221 + - 196 +- id: 223 kind: RqOperator span: 1:722-734 targets: - - 224 - - 225 - parent: 254 -- id: 224 + - 226 + - 227 + parent: 256 +- id: 226 kind: Literal span: 1:733-734 -- id: 225 +- id: 227 kind: RqOperator span: 1:698-719 targets: - - 227 - - 231 -- id: 227 + - 229 + - 233 +- id: 229 kind: RqOperator span: 1:698-712 targets: - - 229 - - 230 -- id: 229 + - 231 + - 232 +- id: 231 kind: Ident span: 1:698-702 ident: !Ident - this - q_if targets: - - 182 -- id: 230 + - 184 +- id: 232 kind: Ident span: 1:705-712 ident: !Ident - this - - _literal_119 + - _literal_121 - k_float targets: - - 119 -- id: 231 + - 121 +- id: 233 kind: Ident span: 1:715-719 ident: !Ident - this - r_if targets: - - 198 -- id: 232 + - 200 +- id: 234 kind: RqOperator span: 1:764-776 targets: - - 235 - - 236 - parent: 254 -- id: 235 + - 237 + - 238 + parent: 256 +- id: 237 kind: Literal span: 1:775-776 -- id: 236 +- id: 238 kind: RqOperator span: 1:742-761 targets: - - 238 - - 242 -- id: 238 + - 240 + - 244 +- id: 240 kind: RqOperator span: 1:742-754 targets: - - 240 - - 241 -- id: 240 + - 242 + - 243 +- id: 242 kind: Ident span: 1:742-746 ident: !Ident - this - q_fi targets: - - 186 -- id: 241 + - 188 +- id: 243 kind: Ident span: 1:749-754 ident: !Ident - this - - _literal_119 + - _literal_121 - k_int targets: - - 119 -- id: 242 + - 121 +- id: 244 kind: Ident span: 1:757-761 ident: !Ident - this - r_fi targets: - - 202 -- id: 243 + - 204 +- id: 245 kind: RqOperator span: 1:808-820 targets: - - 246 - - 247 - parent: 254 -- id: 246 + - 248 + - 249 + parent: 256 +- id: 248 kind: Literal span: 1:819-820 -- id: 247 +- id: 249 kind: RqOperator span: 1:784-805 targets: - - 249 - - 253 -- id: 249 + - 251 + - 255 +- id: 251 kind: RqOperator span: 1:784-798 targets: - - 251 - - 252 -- id: 251 + - 253 + - 254 +- id: 253 kind: Ident span: 1:784-788 ident: !Ident - this - q_ff targets: - - 190 -- id: 252 + - 192 +- id: 254 kind: Ident span: 1:791-798 ident: !Ident - this - - _literal_119 + - _literal_121 - k_float targets: - - 119 -- id: 253 + - 121 +- id: 255 kind: Ident span: 1:801-805 ident: !Ident - this - r_ff targets: - - 206 -- id: 254 + - 208 +- id: 256 kind: Tuple span: 1:325-824 children: - - 161 - - 162 - - 166 - - 170 - - 174 - - 178 - - 182 - - 186 - - 190 - - 194 - - 198 - - 202 - - 206 - - 210 - - 221 - - 232 - - 243 - parent: 255 -- id: 255 + - 163 + - 164 + - 168 + - 172 + - 176 + - 180 + - 184 + - 188 + - 192 + - 196 + - 200 + - 204 + - 208 + - 212 + - 223 + - 234 + - 245 + parent: 257 +- id: 257 kind: 'TransformCall: Select' span: 1:318-824 children: - - 119 - - 254 - parent: 258 -- id: 256 + - 121 + - 256 + parent: 260 +- id: 258 kind: Ident span: 1:830-832 ident: !Ident - this - - _literal_119 + - _literal_121 - id targets: - - 161 - parent: 258 -- id: 258 + - 163 + parent: 260 +- id: 260 kind: 'TransformCall: Sort' span: 1:825-832 children: - - 255 - - 256 + - 257 + - 258 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__cast.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__cast.snap similarity index 91% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__cast.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__cast.snap index bad8c67308..4b4b7e6a1c 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__cast.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__cast.snap @@ -7,10 +7,10 @@ frames: - - 1:25-38 - columns: - !All - input_id: 122 + input_id: 124 except: [] inputs: - - id: 122 + - id: 124 name: tracks table: - default_db @@ -21,15 +21,15 @@ frames: name: - tracks - name - target_id: 129 + target_id: 131 target_name: null - !Single name: - bin - target_id: 130 + target_id: 132 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db @@ -40,28 +40,28 @@ frames: name: - tracks - name - target_id: 129 + target_id: 131 target_name: null - !Single name: - bin - target_id: 130 + target_id: 132 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db - tracks nodes: -- id: 122 +- id: 124 kind: Ident span: 1:13-24 ident: !Ident - default_db - tracks - parent: 128 -- id: 126 + parent: 130 +- id: 128 kind: Ident span: 1:32-37 ident: !Ident @@ -69,16 +69,16 @@ nodes: - tracks - bytes targets: - - 122 - parent: 128 -- id: 128 + - 124 + parent: 130 +- id: 130 kind: 'TransformCall: Sort' span: 1:25-38 children: - - 122 - - 126 - parent: 138 -- id: 129 + - 124 + - 128 + parent: 140 +- id: 131 kind: Ident span: 1:52-56 ident: !Ident @@ -86,22 +86,22 @@ nodes: - tracks - name targets: - - 122 - parent: 137 -- id: 130 + - 124 + parent: 139 +- id: 132 kind: RqOperator span: 1:68-95 alias: bin targets: - - 132 - - 136 - parent: 137 -- id: 132 + - 134 + - 138 + parent: 139 +- id: 134 kind: RqOperator span: 1:81-88 targets: - - 135 -- id: 135 + - 137 +- id: 137 kind: Ident span: 1:70-78 ident: !Ident @@ -109,33 +109,33 @@ nodes: - tracks - album_id targets: - - 122 -- id: 136 + - 124 +- id: 138 kind: Literal span: 1:92-94 -- id: 137 +- id: 139 kind: Tuple span: 1:46-97 children: - - 129 - - 130 - parent: 138 -- id: 138 + - 131 + - 132 + parent: 140 +- id: 140 kind: 'TransformCall: Select' span: 1:39-97 children: - - 128 - - 137 - parent: 140 -- id: 140 + - 130 + - 139 + parent: 142 +- id: 142 kind: 'TransformCall: Take' span: 1:98-105 children: - - 138 - - 141 -- id: 141 + - 140 + - 143 +- id: 143 kind: Literal - parent: 140 + parent: 142 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap similarity index 90% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap index af0e3c50b1..29b0129956 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__constants_only.snap @@ -7,10 +7,10 @@ frames: - - 1:12-19 - columns: - !All - input_id: 128 + input_id: 130 except: [] inputs: - - id: 128 + - id: 130 name: genres table: - default_db @@ -18,10 +18,10 @@ frames: - - 1:20-31 - columns: - !All - input_id: 128 + input_id: 130 except: [] inputs: - - id: 128 + - id: 130 name: genres table: - default_db @@ -29,10 +29,10 @@ frames: - - 1:32-39 - columns: - !All - input_id: 128 + input_id: 130 except: [] inputs: - - id: 128 + - id: 130 name: genres table: - default_db @@ -40,10 +40,10 @@ frames: - - 1:40-51 - columns: - !All - input_id: 128 + input_id: 130 except: [] inputs: - - id: 128 + - id: 130 name: genres table: - default_db @@ -53,81 +53,81 @@ frames: - !Single name: - d - target_id: 140 + target_id: 142 target_name: null inputs: - - id: 128 + - id: 130 name: genres table: - default_db - genres nodes: -- id: 128 +- id: 130 kind: Ident span: 1:0-11 ident: !Ident - default_db - genres - parent: 131 -- id: 131 + parent: 133 +- id: 133 kind: 'TransformCall: Take' span: 1:12-19 children: - - 128 - - 132 - parent: 134 -- id: 132 + - 130 + - 134 + parent: 136 +- id: 134 kind: Literal - parent: 131 -- id: 133 + parent: 133 +- id: 135 kind: Literal span: 1:27-31 - parent: 134 -- id: 134 + parent: 136 +- id: 136 kind: 'TransformCall: Filter' span: 1:20-31 children: - - 131 - 133 - parent: 136 -- id: 136 + - 135 + parent: 138 +- id: 138 kind: 'TransformCall: Take' span: 1:32-39 children: - - 134 - - 137 - parent: 139 -- id: 137 + - 136 + - 139 + parent: 141 +- id: 139 kind: Literal - parent: 136 -- id: 138 + parent: 138 +- id: 140 kind: Literal span: 1:47-51 - parent: 139 -- id: 139 + parent: 141 +- id: 141 kind: 'TransformCall: Filter' span: 1:40-51 children: - - 136 - 138 - parent: 142 -- id: 140 + - 140 + parent: 144 +- id: 142 kind: Literal span: 1:63-65 alias: d - parent: 141 -- id: 141 + parent: 143 +- id: 143 kind: Tuple span: 1:63-65 children: - - 140 - parent: 142 -- id: 142 + - 142 + parent: 144 +- id: 144 kind: 'TransformCall: Select' span: 1:52-65 children: - - 139 - 141 + - 143 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap similarity index 92% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap index fcc0d8c508..108921396c 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__date_to_text.snap @@ -7,10 +7,10 @@ frames: - - 1:71-78 - columns: - !All - input_id: 119 + input_id: 121 except: [] inputs: - - id: 119 + - id: 121 name: invoices table: - default_db @@ -20,99 +20,99 @@ frames: - !Single name: - d1 - target_id: 124 + target_id: 126 target_name: null - !Single name: - d2 - target_id: 129 + target_id: 131 target_name: null - !Single name: - d3 - target_id: 134 + target_id: 136 target_name: null - !Single name: - d4 - target_id: 139 + target_id: 141 target_name: null - !Single name: - d5 - target_id: 144 + target_id: 146 target_name: null - !Single name: - d6 - target_id: 149 + target_id: 151 target_name: null - !Single name: - d7 - target_id: 154 + target_id: 156 target_name: null - !Single name: - d8 - target_id: 159 + target_id: 161 target_name: null - !Single name: - d9 - target_id: 164 + target_id: 166 target_name: null - !Single name: - d10 - target_id: 169 + target_id: 171 target_name: null - !Single name: - d11 - target_id: 174 + target_id: 176 target_name: null - !Single name: - d12 - target_id: 179 + target_id: 181 target_name: null inputs: - - id: 119 + - id: 121 name: invoices table: - default_db - invoices nodes: -- id: 119 +- id: 121 kind: Ident span: 1:57-70 ident: !Ident - default_db - invoices - parent: 122 -- id: 122 + parent: 124 +- id: 124 kind: 'TransformCall: Take' span: 1:71-78 children: - - 119 - - 123 - parent: 185 -- id: 123 + - 121 + - 125 + parent: 187 +- id: 125 kind: Literal - parent: 122 -- id: 124 + parent: 124 +- id: 126 kind: RqOperator span: 1:113-136 alias: d1 targets: - - 127 - - 128 - parent: 184 -- id: 127 + - 129 + - 130 + parent: 186 +- id: 129 kind: Literal span: 1:126-136 -- id: 128 +- id: 130 kind: Ident span: 1:98-110 ident: !Ident @@ -120,19 +120,19 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 129 + - 121 +- id: 131 kind: RqOperator span: 1:164-181 alias: d2 targets: - - 132 - - 133 - parent: 184 -- id: 132 + - 134 + - 135 + parent: 186 +- id: 134 kind: Literal span: 1:177-181 -- id: 133 +- id: 135 kind: Ident span: 1:149-161 ident: !Ident @@ -140,19 +140,19 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 134 + - 121 +- id: 136 kind: RqOperator span: 1:209-226 alias: d3 targets: - - 137 - - 138 - parent: 184 -- id: 137 + - 139 + - 140 + parent: 186 +- id: 139 kind: Literal span: 1:222-226 -- id: 138 +- id: 140 kind: Ident span: 1:194-206 ident: !Ident @@ -160,19 +160,19 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 139 + - 121 +- id: 141 kind: RqOperator span: 1:254-280 alias: d4 targets: - - 142 - - 143 - parent: 184 -- id: 142 + - 144 + - 145 + parent: 186 +- id: 144 kind: Literal span: 1:267-280 -- id: 143 +- id: 145 kind: Ident span: 1:239-251 ident: !Ident @@ -180,19 +180,19 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 144 + - 121 +- id: 146 kind: RqOperator span: 1:308-325 alias: d5 targets: - - 147 - - 148 - parent: 184 -- id: 147 + - 149 + - 150 + parent: 186 +- id: 149 kind: Literal span: 1:321-325 -- id: 148 +- id: 150 kind: Ident span: 1:293-305 ident: !Ident @@ -200,19 +200,19 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 149 + - 121 +- id: 151 kind: RqOperator span: 1:353-380 alias: d6 targets: - - 152 - - 153 - parent: 184 -- id: 152 + - 154 + - 155 + parent: 186 +- id: 154 kind: Literal span: 1:366-380 -- id: 153 +- id: 155 kind: Ident span: 1:338-350 ident: !Ident @@ -220,19 +220,19 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 154 + - 121 +- id: 156 kind: RqOperator span: 1:408-451 alias: d7 targets: - - 157 - - 158 - parent: 184 -- id: 157 + - 159 + - 160 + parent: 186 +- id: 159 kind: Literal span: 1:421-451 -- id: 158 +- id: 160 kind: Ident span: 1:393-405 ident: !Ident @@ -240,19 +240,19 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 159 + - 121 +- id: 161 kind: RqOperator span: 1:479-496 alias: d8 targets: - - 162 - - 163 - parent: 184 -- id: 162 + - 164 + - 165 + parent: 186 +- id: 164 kind: Literal span: 1:492-496 -- id: 163 +- id: 165 kind: Ident span: 1:464-476 ident: !Ident @@ -260,19 +260,19 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 164 + - 121 +- id: 166 kind: RqOperator span: 1:524-549 alias: d9 targets: - - 167 - - 168 - parent: 184 -- id: 167 + - 169 + - 170 + parent: 186 +- id: 169 kind: Literal span: 1:537-549 -- id: 168 +- id: 170 kind: Ident span: 1:509-521 ident: !Ident @@ -280,19 +280,19 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 169 + - 121 +- id: 171 kind: RqOperator span: 1:578-603 alias: d10 targets: - - 172 - - 173 - parent: 184 -- id: 172 + - 174 + - 175 + parent: 186 +- id: 174 kind: Literal span: 1:591-603 -- id: 173 +- id: 175 kind: Ident span: 1:563-575 ident: !Ident @@ -300,19 +300,19 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 174 + - 121 +- id: 176 kind: RqOperator span: 1:632-654 alias: d11 targets: - - 177 - - 178 - parent: 184 -- id: 177 + - 179 + - 180 + parent: 186 +- id: 179 kind: Literal span: 1:645-654 -- id: 178 +- id: 180 kind: Ident span: 1:617-629 ident: !Ident @@ -320,19 +320,19 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 179 + - 121 +- id: 181 kind: RqOperator span: 1:683-714 alias: d12 targets: - - 182 - - 183 - parent: 184 -- id: 182 + - 184 + - 185 + parent: 186 +- id: 184 kind: Literal span: 1:696-714 -- id: 183 +- id: 185 kind: Ident span: 1:668-680 ident: !Ident @@ -340,30 +340,30 @@ nodes: - invoices - invoice_date targets: - - 119 -- id: 184 + - 121 +- id: 186 kind: Tuple span: 1:86-718 children: - - 124 - - 129 - - 134 - - 139 - - 144 - - 149 - - 154 - - 159 - - 164 - - 169 - - 174 - - 179 - parent: 185 -- id: 185 + - 126 + - 131 + - 136 + - 141 + - 146 + - 151 + - 156 + - 161 + - 166 + - 171 + - 176 + - 181 + parent: 187 +- id: 187 kind: 'TransformCall: Select' span: 1:79-718 children: - - 122 - - 184 + - 124 + - 186 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap similarity index 88% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap index 4d3195ac19..795c7558fc 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__distinct.snap @@ -10,16 +10,16 @@ frames: name: - tracks - album_id - target_id: 124 + target_id: 126 target_name: null - !Single name: - tracks - genre_id - target_id: 125 + target_id: 127 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db @@ -30,16 +30,16 @@ frames: name: - tracks - album_id - target_id: 129 + target_id: 131 target_name: null - !Single name: - tracks - genre_id - target_id: 130 + target_id: 132 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db @@ -50,29 +50,29 @@ frames: name: - tracks - album_id - target_id: 129 + target_id: 131 target_name: null - !Single name: - tracks - genre_id - target_id: 130 + target_id: 132 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db - tracks nodes: -- id: 122 +- id: 124 kind: Ident span: 1:13-24 ident: !Ident - default_db - tracks - parent: 127 -- id: 124 + parent: 129 +- id: 126 kind: Ident span: 1:33-41 ident: !Ident @@ -80,9 +80,9 @@ nodes: - tracks - album_id targets: - - 122 - parent: 126 -- id: 125 + - 124 + parent: 128 +- id: 127 kind: Ident span: 1:43-51 ident: !Ident @@ -90,81 +90,81 @@ nodes: - tracks - genre_id targets: - - 122 - parent: 126 -- id: 126 + - 124 + parent: 128 +- id: 128 kind: Tuple span: 1:32-52 children: - - 124 - - 125 - parent: 127 -- id: 127 + - 126 + - 127 + parent: 129 +- id: 129 kind: 'TransformCall: Select' span: 1:25-52 children: - - 122 - - 126 - parent: 148 -- id: 129 + - 124 + - 128 + parent: 150 +- id: 131 kind: Ident ident: !Ident - this - tracks - album_id targets: - - 124 - parent: 131 -- id: 130 + - 126 + parent: 133 +- id: 132 kind: Ident ident: !Ident - this - tracks - genre_id targets: - - 125 - parent: 131 -- id: 131 + - 127 + parent: 133 +- id: 133 kind: Tuple span: 1:59-67 children: - - 129 - - 130 -- id: 148 + - 131 + - 132 +- id: 150 kind: 'TransformCall: Take' span: 1:69-75 children: - - 127 - - 149 - parent: 156 -- id: 149 + - 129 + - 151 + parent: 158 +- id: 151 kind: Literal - parent: 148 -- id: 153 + parent: 150 +- id: 155 kind: Ident ident: !Ident - this - tracks - album_id targets: - - 129 - parent: 156 -- id: 154 + - 131 + parent: 158 +- id: 156 kind: Ident ident: !Ident - this - tracks - genre_id targets: - - 130 - parent: 156 -- id: 156 + - 132 + parent: 158 +- id: 158 kind: 'TransformCall: Sort' span: 1:77-90 children: - - 148 - - 153 - - 154 + - 150 + - 155 + - 156 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap similarity index 90% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap index 9d65a3a794..4d76751e45 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__distinct_on.snap @@ -10,22 +10,22 @@ frames: name: - tracks - genre_id - target_id: 124 + target_id: 126 target_name: null - !Single name: - tracks - media_type_id - target_id: 125 + target_id: 127 target_name: null - !Single name: - tracks - album_id - target_id: 126 + target_id: 128 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db @@ -36,22 +36,22 @@ frames: name: - tracks - genre_id - target_id: 129 + target_id: 131 target_name: null - !Single name: - tracks - media_type_id - target_id: 130 + target_id: 132 target_name: null - !Single name: - tracks - album_id - target_id: 126 + target_id: 128 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db @@ -62,35 +62,35 @@ frames: name: - tracks - genre_id - target_id: 129 + target_id: 131 target_name: null - !Single name: - tracks - media_type_id - target_id: 130 + target_id: 132 target_name: null - !Single name: - tracks - album_id - target_id: 126 + target_id: 128 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db - tracks nodes: -- id: 122 +- id: 124 kind: Ident span: 1:13-24 ident: !Ident - default_db - tracks - parent: 128 -- id: 124 + parent: 130 +- id: 126 kind: Ident span: 1:33-41 ident: !Ident @@ -98,9 +98,9 @@ nodes: - tracks - genre_id targets: - - 122 - parent: 127 -- id: 125 + - 124 + parent: 129 +- id: 127 kind: Ident span: 1:43-56 ident: !Ident @@ -108,9 +108,9 @@ nodes: - tracks - media_type_id targets: - - 122 - parent: 127 -- id: 126 + - 124 + parent: 129 +- id: 128 kind: Ident span: 1:58-66 ident: !Ident @@ -118,24 +118,24 @@ nodes: - tracks - album_id targets: - - 122 - parent: 127 -- id: 127 + - 124 + parent: 129 +- id: 129 kind: Tuple span: 1:32-67 children: - - 124 - - 125 - 126 - parent: 128 -- id: 128 + - 127 + - 128 + parent: 130 +- id: 130 kind: 'TransformCall: Select' span: 1:25-67 children: - - 122 - - 127 - parent: 160 -- id: 129 + - 124 + - 129 + parent: 162 +- id: 131 kind: Ident span: 1:75-83 ident: !Ident @@ -143,9 +143,9 @@ nodes: - tracks - genre_id targets: - - 124 - parent: 131 -- id: 130 + - 126 + parent: 133 +- id: 132 kind: Ident span: 1:85-98 ident: !Ident @@ -153,15 +153,15 @@ nodes: - tracks - media_type_id targets: - - 125 - parent: 131 -- id: 131 + - 127 + parent: 133 +- id: 133 kind: Tuple span: 1:74-99 children: - - 129 - - 130 -- id: 156 + - 131 + - 132 +- id: 158 kind: Ident span: 1:108-116 ident: !Ident @@ -169,18 +169,18 @@ nodes: - tracks - album_id targets: - - 126 -- id: 160 + - 128 +- id: 162 kind: 'TransformCall: Take' span: 1:120-126 children: - - 128 - - 161 - parent: 169 -- id: 161 + - 130 + - 163 + parent: 171 +- id: 163 kind: Literal - parent: 160 -- id: 166 + parent: 162 +- id: 168 kind: Ident span: 1:135-143 ident: !Ident @@ -188,9 +188,9 @@ nodes: - tracks - genre_id targets: - - 129 - parent: 169 -- id: 167 + - 131 + parent: 171 +- id: 169 kind: Ident span: 1:145-158 ident: !Ident @@ -198,15 +198,15 @@ nodes: - tracks - media_type_id targets: - - 130 - parent: 169 -- id: 169 + - 132 + parent: 171 +- id: 171 kind: 'TransformCall: Sort' span: 1:128-159 children: - - 160 - - 166 - - 167 + - 162 + - 168 + - 169 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap similarity index 94% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap index 3bdb5a107f..573296b35c 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__genre_counts.snap @@ -10,10 +10,10 @@ frames: name: - genre_count - a - target_id: 134 + target_id: 136 target_name: a inputs: - - id: 134 + - id: 136 name: genre_count table: - default_db @@ -23,29 +23,29 @@ frames: - !Single name: - a - target_id: 141 + target_id: 143 target_name: null inputs: - - id: 134 + - id: 136 name: genre_count table: - default_db - genres nodes: -- id: 134 +- id: 136 kind: Ident span: 1:187-203 ident: !Ident - genre_count - parent: 140 -- id: 136 + parent: 142 +- id: 138 kind: RqOperator span: 1:211-216 targets: - - 138 - - 139 - parent: 140 -- id: 138 + - 140 + - 141 + parent: 142 +- id: 140 kind: Ident span: 1:211-212 ident: !Ident @@ -53,25 +53,25 @@ nodes: - genre_count - a targets: - - 134 -- id: 139 + - 136 +- id: 141 kind: Literal span: 1:215-216 -- id: 140 +- id: 142 kind: 'TransformCall: Filter' span: 1:204-216 children: - - 134 - 136 - parent: 145 -- id: 141 + - 138 + parent: 147 +- id: 143 kind: RqOperator span: 1:228-230 alias: a targets: - - 143 - parent: 144 -- id: 143 + - 145 + parent: 146 +- id: 145 kind: Ident span: 1:229-230 ident: !Ident @@ -79,19 +79,19 @@ nodes: - genre_count - a targets: - - 134 -- id: 144 + - 136 +- id: 146 kind: Tuple span: 1:228-230 children: - - 141 - parent: 145 -- id: 145 + - 143 + parent: 147 +- id: 147 kind: 'TransformCall: Select' span: 1:217-230 children: - - 140 - - 144 + - 142 + - 146 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap similarity index 89% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap index 0627f25117..3f2cf5e44e 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_all.snap @@ -7,10 +7,10 @@ frames: - - 1:27-34 - columns: - !All - input_id: 126 + input_id: 128 except: [] inputs: - - id: 126 + - id: 128 name: a table: - default_db @@ -18,18 +18,18 @@ frames: - - 1:35-59 - columns: - !All - input_id: 126 + input_id: 128 except: [] - !All - input_id: 120 + input_id: 122 except: [] inputs: - - id: 126 + - id: 128 name: a table: - default_db - albums - - id: 120 + - id: 122 name: tracks table: - default_db @@ -40,26 +40,26 @@ frames: name: - a - album_id - target_id: 136 + target_id: 138 target_name: null - !Single name: - a - title - target_id: 137 + target_id: 139 target_name: null - !Single name: - price - target_id: 155 + target_id: 157 target_name: null inputs: - - id: 126 + - id: 128 name: a table: - default_db - albums - - id: 120 + - id: 122 name: tracks table: - default_db @@ -70,63 +70,63 @@ frames: name: - a - album_id - target_id: 136 + target_id: 138 target_name: null - !Single name: - a - title - target_id: 137 + target_id: 139 target_name: null - !Single name: - price - target_id: 155 + target_id: 157 target_name: null inputs: - - id: 126 + - id: 128 name: a table: - default_db - albums - - id: 120 + - id: 122 name: tracks table: - default_db - tracks nodes: -- id: 120 +- id: 122 kind: Ident span: 1:40-46 ident: !Ident - default_db - tracks - parent: 135 -- id: 126 + parent: 137 +- id: 128 kind: Ident span: 1:13-26 ident: !Ident - default_db - albums - parent: 129 -- id: 129 + parent: 131 +- id: 131 kind: 'TransformCall: Take' span: 1:27-34 children: - - 126 - - 130 - parent: 135 -- id: 130 + - 128 + - 132 + parent: 137 +- id: 132 kind: Literal - parent: 129 -- id: 131 + parent: 131 +- id: 133 kind: RqOperator span: 1:48-58 targets: - - 133 - - 134 - parent: 135 -- id: 133 + - 135 + - 136 + parent: 137 +- id: 135 kind: Ident span: 1:50-58 ident: !Ident @@ -134,8 +134,8 @@ nodes: - a - album_id targets: - - 126 -- id: 134 + - 128 +- id: 136 kind: Ident span: 1:50-58 ident: !Ident @@ -143,16 +143,16 @@ nodes: - tracks - album_id targets: - - 120 -- id: 135 + - 122 +- id: 137 kind: 'TransformCall: Join' span: 1:35-59 children: - - 129 - - 120 - 131 - parent: 163 -- id: 136 + - 122 + - 133 + parent: 165 +- id: 138 kind: Ident span: 1:67-77 ident: !Ident @@ -160,9 +160,9 @@ nodes: - a - album_id targets: - - 126 - parent: 138 -- id: 137 + - 128 + parent: 140 +- id: 139 kind: Ident span: 1:79-86 ident: !Ident @@ -170,32 +170,32 @@ nodes: - a - title targets: - - 126 - parent: 138 -- id: 138 + - 128 + parent: 140 +- id: 140 kind: Tuple span: 1:66-87 children: - - 136 - - 137 - parent: 163 -- id: 155 + - 138 + - 139 + parent: 165 +- id: 157 kind: RqOperator span: 1:132-144 alias: price targets: - - 158 - - 159 - parent: 162 -- id: 158 + - 160 + - 161 + parent: 164 +- id: 160 kind: Literal span: 1:143-144 -- id: 159 +- id: 161 kind: RqOperator span: 1:108-129 targets: - - 161 -- id: 161 + - 163 +- id: 163 kind: Ident span: 1:112-129 ident: !Ident @@ -203,22 +203,22 @@ nodes: - tracks - unit_price targets: - - 120 -- id: 162 + - 122 +- id: 164 kind: Tuple span: 1:132-144 children: - - 155 - parent: 163 -- id: 163 + - 157 + parent: 165 +- id: 165 kind: 'TransformCall: Aggregate' span: 1:89-145 children: - - 135 - - 162 - - 138 - parent: 168 -- id: 166 + - 137 + - 164 + - 140 + parent: 170 +- id: 168 kind: Ident span: 1:152-160 ident: !Ident @@ -226,14 +226,14 @@ nodes: - a - album_id targets: - - 136 - parent: 168 -- id: 168 + - 138 + parent: 170 +- id: 170 kind: 'TransformCall: Sort' span: 1:147-160 children: - - 163 - - 166 + - 165 + - 168 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap similarity index 89% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap index 40397974f7..36318b3b7d 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort.snap @@ -7,15 +7,15 @@ frames: - - 1:25-48 - columns: - !All - input_id: 128 + input_id: 130 except: [] - !Single name: - d - target_id: 130 + target_id: 132 target_name: null inputs: - - id: 128 + - id: 130 name: tracks table: - default_db @@ -25,15 +25,15 @@ frames: - !Single name: - d - target_id: 136 + target_id: 138 target_name: null - !Single name: - n1 - target_id: 153 + target_id: 155 target_name: null inputs: - - id: 128 + - id: 130 name: tracks table: - default_db @@ -43,15 +43,15 @@ frames: - !Single name: - d - target_id: 136 + target_id: 138 target_name: null - !Single name: - n1 - target_id: 153 + target_id: 155 target_name: null inputs: - - id: 128 + - id: 130 name: tracks table: - default_db @@ -61,15 +61,15 @@ frames: - !Single name: - d - target_id: 136 + target_id: 138 target_name: null - !Single name: - n1 - target_id: 153 + target_id: 155 target_name: null inputs: - - id: 128 + - id: 130 name: tracks table: - default_db @@ -79,36 +79,36 @@ frames: - !Single name: - d1 - target_id: 166 + target_id: 168 target_name: null - !Single name: - n1 - target_id: 167 + target_id: 169 target_name: null inputs: - - id: 128 + - id: 130 name: tracks table: - default_db - tracks nodes: -- id: 128 +- id: 130 kind: Ident span: 1:13-24 ident: !Ident - default_db - tracks - parent: 135 -- id: 130 + parent: 137 +- id: 132 kind: RqOperator span: 1:36-48 alias: d targets: - - 132 - - 133 - parent: 134 -- id: 132 + - 134 + - 135 + parent: 136 +- id: 134 kind: Ident span: 1:36-44 ident: !Ident @@ -116,46 +116,46 @@ nodes: - tracks - album_id targets: - - 128 -- id: 133 + - 130 +- id: 135 kind: Literal span: 1:47-48 -- id: 134 +- id: 136 kind: Tuple span: 1:36-48 children: - - 130 - parent: 135 -- id: 135 + - 132 + parent: 137 +- id: 137 kind: 'TransformCall: Derive' span: 1:25-48 children: - - 128 - - 134 - parent: 157 -- id: 136 + - 130 + - 136 + parent: 159 +- id: 138 kind: Ident span: 1:55-56 ident: !Ident - this - d targets: - - 130 - parent: 139 -- id: 139 + - 132 + parent: 141 +- id: 141 kind: Tuple span: 1:55-56 children: - - 136 - parent: 157 -- id: 153 + - 138 + parent: 159 +- id: 155 kind: RqOperator span: 1:100-103 alias: n1 targets: - - 155 - parent: 156 -- id: 155 + - 157 + parent: 158 +- id: 157 kind: Ident span: 1:89-97 ident: !Ident @@ -163,48 +163,48 @@ nodes: - tracks - track_id targets: - - 128 -- id: 156 + - 130 +- id: 158 kind: Tuple span: 1:73-111 children: - - 153 - parent: 157 -- id: 157 + - 155 + parent: 159 +- id: 159 kind: 'TransformCall: Aggregate' span: 1:63-111 children: - - 135 - - 156 - - 139 - parent: 162 -- id: 160 + - 137 + - 158 + - 141 + parent: 164 +- id: 162 kind: Ident span: 1:119-120 ident: !Ident - this - d targets: - - 136 - parent: 162 -- id: 162 + - 138 + parent: 164 +- id: 164 kind: 'TransformCall: Sort' span: 1:114-120 children: - - 157 - - 160 - parent: 164 -- id: 164 + - 159 + - 162 + parent: 166 +- id: 166 kind: 'TransformCall: Take' span: 1:121-128 children: - - 162 - - 165 - parent: 169 -- id: 165 + - 164 + - 167 + parent: 171 +- id: 167 kind: Literal - parent: 164 -- id: 166 + parent: 166 +- id: 168 kind: Ident span: 1:143-144 alias: d1 @@ -212,30 +212,30 @@ nodes: - this - d targets: - - 136 - parent: 168 -- id: 167 + - 138 + parent: 170 +- id: 169 kind: Ident span: 1:146-148 ident: !Ident - this - n1 targets: - - 153 - parent: 168 -- id: 168 + - 155 + parent: 170 +- id: 170 kind: Tuple span: 1:136-150 children: - - 166 - - 167 - parent: 169 -- id: 169 + - 168 + - 169 + parent: 171 +- id: 171 kind: 'TransformCall: Select' span: 1:129-150 children: - - 164 - - 168 + - 166 + - 170 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap similarity index 84% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap index 4e86fdab75..3481618172 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_derive_select_join.snap @@ -8,186 +8,186 @@ frames: - columns: - !Single name: - - _literal_127 + - _literal_129 - artist_id - target_id: 128 + target_id: 130 target_name: null - !Single name: - album_title_count - target_id: 147 + target_id: 149 target_name: null inputs: - - id: 127 - name: _literal_127 + - id: 129 + name: _literal_129 table: - default_db - - _literal_127 + - _literal_129 - - 1:119-164 - columns: - !Single name: - - _literal_127 + - _literal_129 - artist_id - target_id: 128 + target_id: 130 target_name: null - !Single name: - album_title_count - target_id: 147 + target_id: 149 target_name: null inputs: - - id: 127 - name: _literal_127 + - id: 129 + name: _literal_129 table: - default_db - - _literal_127 + - _literal_129 - - 1:165-214 - columns: - !Single name: - - _literal_127 + - _literal_129 - artist_id - target_id: 128 + target_id: 130 target_name: null - !Single name: - album_title_count - target_id: 147 + target_id: 149 target_name: null - !Single name: - new_album_count - target_id: 157 + target_id: 159 target_name: null inputs: - - id: 127 - name: _literal_127 + - id: 129 + name: _literal_129 table: - default_db - - _literal_127 + - _literal_129 - - 1:215-260 - columns: - !Single name: - - _literal_127 + - _literal_129 - artist_id - target_id: 160 + target_id: 162 target_name: null - !Single name: - new_album_count - target_id: 161 + target_id: 163 target_name: null inputs: - - id: 127 - name: _literal_127 + - id: 129 + name: _literal_129 table: - default_db - - _literal_127 + - _literal_129 - - 1:261-367 - columns: - !Single name: - - _literal_127 + - _literal_129 - artist_id - target_id: 160 + target_id: 162 target_name: null - !Single name: - new_album_count - target_id: 161 + target_id: 163 target_name: null - !All - input_id: 114 + input_id: 116 except: [] inputs: - - id: 127 - name: _literal_127 + - id: 129 + name: _literal_129 table: - default_db - - _literal_127 - - id: 114 - name: _literal_114 + - _literal_129 + - id: 116 + name: _literal_116 table: - default_db - - _literal_114 + - _literal_116 nodes: -- id: 114 +- id: 116 kind: SString span: 1:278-330 - parent: 168 -- id: 127 + parent: 170 +- id: 129 kind: SString span: 1:0-46 - parent: 150 -- id: 128 + parent: 152 +- id: 130 kind: Ident span: 1:54-63 ident: !Ident - this - - _literal_127 + - _literal_129 - artist_id targets: - - 127 - parent: 129 -- id: 129 + - 129 + parent: 131 +- id: 131 kind: Tuple span: 1:53-64 children: - - 128 - parent: 150 -- id: 147 + - 130 + parent: 152 +- id: 149 kind: RqOperator span: 1:98-116 alias: album_title_count targets: - - 148 - parent: 149 -- id: 148 + - 150 + parent: 151 +- id: 150 kind: Literal -- id: 149 +- id: 151 kind: Tuple span: 1:76-117 children: - - 147 - parent: 150 -- id: 150 + - 149 + parent: 152 +- id: 152 kind: 'TransformCall: Aggregate' span: 1:66-117 children: - - 127 - - 149 - 129 - parent: 156 -- id: 153 + - 151 + - 131 + parent: 158 +- id: 155 kind: Ident span: 1:125-139 ident: !Ident - this - - _literal_127 + - _literal_129 - artist_id targets: - - 128 - parent: 156 -- id: 154 + - 130 + parent: 158 +- id: 156 kind: Ident span: 1:141-163 ident: !Ident - this - album_title_count targets: - - 147 - parent: 156 -- id: 156 + - 149 + parent: 158 +- id: 158 kind: 'TransformCall: Sort' span: 1:119-164 children: - - 150 - - 153 - - 154 - parent: 159 -- id: 157 + - 152 + - 155 + - 156 + parent: 161 +- id: 159 kind: Ident span: 1:191-213 alias: new_album_count @@ -195,86 +195,86 @@ nodes: - this - album_title_count targets: - - 147 - parent: 158 -- id: 158 + - 149 + parent: 160 +- id: 160 kind: Tuple span: 1:172-214 children: - - 157 - parent: 159 -- id: 159 + - 159 + parent: 161 +- id: 161 kind: 'TransformCall: Derive' span: 1:165-214 children: - - 156 - 158 - parent: 163 -- id: 160 + - 160 + parent: 165 +- id: 162 kind: Ident span: 1:223-237 ident: !Ident - this - - _literal_127 + - _literal_129 - artist_id targets: - - 128 - parent: 162 -- id: 161 + - 130 + parent: 164 +- id: 163 kind: Ident span: 1:239-259 ident: !Ident - this - new_album_count targets: - - 157 - parent: 162 -- id: 162 + - 159 + parent: 164 +- id: 164 kind: Tuple span: 1:222-260 children: - - 160 - - 161 - parent: 163 -- id: 163 + - 162 + - 163 + parent: 165 +- id: 165 kind: 'TransformCall: Select' span: 1:215-260 children: - - 159 - - 162 - parent: 168 -- id: 164 + - 161 + - 164 + parent: 170 +- id: 166 kind: RqOperator span: 1:334-366 targets: - - 166 - - 167 - parent: 168 -- id: 166 + - 168 + - 169 + parent: 170 +- id: 168 kind: Ident span: 1:334-348 ident: !Ident - this - - _literal_127 + - _literal_129 - artist_id targets: - - 160 -- id: 167 + - 162 +- id: 169 kind: Ident span: 1:352-366 ident: !Ident - that - - _literal_114 + - _literal_116 - artist_id targets: - - 114 -- id: 168 + - 116 +- id: 170 kind: 'TransformCall: Join' span: 1:261-367 children: - - 163 - - 114 - - 164 + - 165 + - 116 + - 166 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap similarity index 84% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap index e1e429ef96..355d52efdb 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_filter_derive_select_join.snap @@ -8,230 +8,230 @@ frames: - columns: - !Single name: - - _literal_130 + - _literal_132 - artist_id - target_id: 131 + target_id: 133 target_name: null - !Single name: - album_title_count - target_id: 150 + target_id: 152 target_name: null inputs: - - id: 130 - name: _literal_130 + - id: 132 + name: _literal_132 table: - default_db - - _literal_130 + - _literal_132 - - 1:119-164 - columns: - !Single name: - - _literal_130 + - _literal_132 - artist_id - target_id: 131 + target_id: 133 target_name: null - !Single name: - album_title_count - target_id: 150 + target_id: 152 target_name: null inputs: - - id: 130 - name: _literal_130 + - id: 132 + name: _literal_132 table: - default_db - - _literal_130 + - _literal_132 - - 1:165-201 - columns: - !Single name: - - _literal_130 + - _literal_132 - artist_id - target_id: 131 + target_id: 133 target_name: null - !Single name: - album_title_count - target_id: 150 + target_id: 152 target_name: null inputs: - - id: 130 - name: _literal_130 + - id: 132 + name: _literal_132 table: - default_db - - _literal_130 + - _literal_132 - - 1:202-251 - columns: - !Single name: - - _literal_130 + - _literal_132 - artist_id - target_id: 131 + target_id: 133 target_name: null - !Single name: - album_title_count - target_id: 150 + target_id: 152 target_name: null - !Single name: - new_album_count - target_id: 165 + target_id: 167 target_name: null inputs: - - id: 130 - name: _literal_130 + - id: 132 + name: _literal_132 table: - default_db - - _literal_130 + - _literal_132 - - 1:252-297 - columns: - !Single name: - - _literal_130 + - _literal_132 - artist_id - target_id: 168 + target_id: 170 target_name: null - !Single name: - new_album_count - target_id: 169 + target_id: 171 target_name: null inputs: - - id: 130 - name: _literal_130 + - id: 132 + name: _literal_132 table: - default_db - - _literal_130 + - _literal_132 - - 1:298-404 - columns: - !Single name: - - _literal_130 + - _literal_132 - artist_id - target_id: 168 + target_id: 170 target_name: null - !Single name: - new_album_count - target_id: 169 + target_id: 171 target_name: null - !All - input_id: 114 + input_id: 116 except: [] inputs: - - id: 130 - name: _literal_130 + - id: 132 + name: _literal_132 table: - default_db - - _literal_130 - - id: 114 - name: _literal_114 + - _literal_132 + - id: 116 + name: _literal_116 table: - default_db - - _literal_114 + - _literal_116 nodes: -- id: 114 +- id: 116 kind: SString span: 1:315-367 - parent: 176 -- id: 130 + parent: 178 +- id: 132 kind: SString span: 1:0-46 - parent: 153 -- id: 131 + parent: 155 +- id: 133 kind: Ident span: 1:54-63 ident: !Ident - this - - _literal_130 + - _literal_132 - artist_id targets: - - 130 - parent: 132 -- id: 132 + - 132 + parent: 134 +- id: 134 kind: Tuple span: 1:53-64 children: - - 131 - parent: 153 -- id: 150 + - 133 + parent: 155 +- id: 152 kind: RqOperator span: 1:98-116 alias: album_title_count targets: - - 151 - parent: 152 -- id: 151 + - 153 + parent: 154 +- id: 153 kind: Literal -- id: 152 +- id: 154 kind: Tuple span: 1:76-117 children: - - 150 - parent: 153 -- id: 153 + - 152 + parent: 155 +- id: 155 kind: 'TransformCall: Aggregate' span: 1:66-117 children: - - 130 - - 152 - 132 - parent: 159 -- id: 156 + - 154 + - 134 + parent: 161 +- id: 158 kind: Ident span: 1:125-139 ident: !Ident - this - - _literal_130 + - _literal_132 - artist_id targets: - - 131 - parent: 159 -- id: 157 + - 133 + parent: 161 +- id: 159 kind: Ident span: 1:141-163 ident: !Ident - this - album_title_count targets: - - 150 - parent: 159 -- id: 159 + - 152 + parent: 161 +- id: 161 kind: 'TransformCall: Sort' span: 1:119-164 children: - - 153 - - 156 - - 157 - parent: 164 -- id: 160 + - 155 + - 158 + - 159 + parent: 166 +- id: 162 kind: RqOperator span: 1:172-201 targets: - - 162 - - 163 - parent: 164 -- id: 162 + - 164 + - 165 + parent: 166 +- id: 164 kind: Ident span: 1:173-195 ident: !Ident - this - album_title_count targets: - - 150 -- id: 163 + - 152 +- id: 165 kind: Literal span: 1:199-201 -- id: 164 +- id: 166 kind: 'TransformCall: Filter' span: 1:165-201 children: - - 159 - - 160 - parent: 167 -- id: 165 + - 161 + - 162 + parent: 169 +- id: 167 kind: Ident span: 1:228-250 alias: new_album_count @@ -239,86 +239,86 @@ nodes: - this - album_title_count targets: - - 150 - parent: 166 -- id: 166 + - 152 + parent: 168 +- id: 168 kind: Tuple span: 1:209-251 children: - - 165 - parent: 167 -- id: 167 + - 167 + parent: 169 +- id: 169 kind: 'TransformCall: Derive' span: 1:202-251 children: - - 164 - 166 - parent: 171 -- id: 168 + - 168 + parent: 173 +- id: 170 kind: Ident span: 1:260-274 ident: !Ident - this - - _literal_130 + - _literal_132 - artist_id targets: - - 131 - parent: 170 -- id: 169 + - 133 + parent: 172 +- id: 171 kind: Ident span: 1:276-296 ident: !Ident - this - new_album_count targets: - - 165 - parent: 170 -- id: 170 + - 167 + parent: 172 +- id: 172 kind: Tuple span: 1:259-297 children: - - 168 - - 169 - parent: 171 -- id: 171 + - 170 + - 171 + parent: 173 +- id: 173 kind: 'TransformCall: Select' span: 1:252-297 children: - - 167 - - 170 - parent: 176 -- id: 172 + - 169 + - 172 + parent: 178 +- id: 174 kind: RqOperator span: 1:371-403 targets: - - 174 - - 175 - parent: 176 -- id: 174 + - 176 + - 177 + parent: 178 +- id: 176 kind: Ident span: 1:371-385 ident: !Ident - this - - _literal_130 + - _literal_132 - artist_id targets: - - 168 -- id: 175 + - 170 +- id: 177 kind: Ident span: 1:389-403 ident: !Ident - that - - _literal_114 + - _literal_116 - artist_id targets: - - 114 -- id: 176 + - 116 +- id: 178 kind: 'TransformCall: Join' span: 1:298-404 children: - - 171 - - 114 - - 172 + - 173 + - 116 + - 174 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap similarity index 90% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap index 1e80ae35d3..5214f60b55 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__group_sort_limit_take.snap @@ -10,16 +10,16 @@ frames: name: - tracks - genre_id - target_id: 131 + target_id: 133 target_name: null - !Single name: - tracks - milliseconds - target_id: 132 + target_id: 134 target_name: null inputs: - - id: 129 + - id: 131 name: tracks table: - default_db @@ -30,16 +30,16 @@ frames: name: - tracks - genre_id - target_id: 135 + target_id: 137 target_name: null - !Single name: - tracks - milliseconds - target_id: 132 + target_id: 134 target_name: null inputs: - - id: 129 + - id: 131 name: tracks table: - default_db @@ -50,24 +50,24 @@ frames: name: - tracks - genre_id - target_id: 135 + target_id: 137 target_name: null - !Single name: - tracks - milliseconds - target_id: 132 + target_id: 134 target_name: null - !All - input_id: 120 + input_id: 122 except: [] inputs: - - id: 129 + - id: 131 name: tracks table: - default_db - tracks - - id: 120 + - id: 122 name: genres table: - default_db @@ -78,21 +78,21 @@ frames: name: - genres - name - target_id: 173 + target_id: 175 target_name: null - !Single name: - tracks - milliseconds - target_id: 174 + target_id: 176 target_name: null inputs: - - id: 129 + - id: 131 name: tracks table: - default_db - tracks - - id: 120 + - id: 122 name: genres table: - default_db @@ -103,41 +103,41 @@ frames: name: - genres - name - target_id: 173 + target_id: 175 target_name: null - !Single name: - tracks - milliseconds - target_id: 174 + target_id: 176 target_name: null inputs: - - id: 129 + - id: 131 name: tracks table: - default_db - tracks - - id: 120 + - id: 122 name: genres table: - default_db - genres nodes: -- id: 120 +- id: 122 kind: Ident span: 1:177-183 ident: !Ident - default_db - genres - parent: 172 -- id: 129 + parent: 174 +- id: 131 kind: Ident span: 1:76-87 ident: !Ident - default_db - tracks - parent: 134 -- id: 131 + parent: 136 +- id: 133 kind: Ident span: 1:96-104 ident: !Ident @@ -145,9 +145,9 @@ nodes: - tracks - genre_id targets: - - 129 - parent: 133 -- id: 132 + - 131 + parent: 135 +- id: 134 kind: Ident span: 1:105-117 ident: !Ident @@ -155,23 +155,23 @@ nodes: - tracks - milliseconds targets: - - 129 - parent: 133 -- id: 133 + - 131 + parent: 135 +- id: 135 kind: Tuple span: 1:95-118 children: - - 131 - - 132 - parent: 134 -- id: 134 + - 133 + - 134 + parent: 136 +- id: 136 kind: 'TransformCall: Select' span: 1:88-118 children: - - 129 - - 133 - parent: 164 -- id: 135 + - 131 + - 135 + parent: 166 +- id: 137 kind: Ident span: 1:126-134 ident: !Ident @@ -179,14 +179,14 @@ nodes: - tracks - genre_id targets: - - 131 - parent: 136 -- id: 136 + - 133 + parent: 138 +- id: 138 kind: Tuple span: 1:125-135 children: - - 135 -- id: 160 + - 137 +- id: 162 kind: Ident span: 1:147-159 ident: !Ident @@ -194,25 +194,25 @@ nodes: - tracks - milliseconds targets: - - 132 -- id: 164 + - 134 +- id: 166 kind: 'TransformCall: Take' span: 1:163-169 children: - - 134 - - 165 - parent: 172 -- id: 165 + - 136 + - 167 + parent: 174 +- id: 167 kind: Literal - parent: 164 -- id: 168 + parent: 166 +- id: 170 kind: RqOperator span: 1:185-195 targets: - - 170 - - 171 - parent: 172 -- id: 170 + - 172 + - 173 + parent: 174 +- id: 172 kind: Ident span: 1:187-195 ident: !Ident @@ -220,8 +220,8 @@ nodes: - tracks - genre_id targets: - - 135 -- id: 171 + - 137 +- id: 173 kind: Ident span: 1:187-195 ident: !Ident @@ -229,16 +229,16 @@ nodes: - genres - genre_id targets: - - 120 -- id: 172 + - 122 +- id: 174 kind: 'TransformCall: Join' span: 1:172-196 children: - - 164 - - 120 - - 168 - parent: 176 -- id: 173 + - 166 + - 122 + - 170 + parent: 178 +- id: 175 kind: Ident span: 1:205-209 ident: !Ident @@ -246,9 +246,9 @@ nodes: - genres - name targets: - - 120 - parent: 175 -- id: 174 + - 122 + parent: 177 +- id: 176 kind: Ident span: 1:211-223 ident: !Ident @@ -256,23 +256,23 @@ nodes: - tracks - milliseconds targets: - - 132 - parent: 175 -- id: 175 + - 134 + parent: 177 +- id: 177 kind: Tuple span: 1:204-224 children: - - 173 - - 174 - parent: 176 -- id: 176 + - 175 + - 176 + parent: 178 +- id: 178 kind: 'TransformCall: Select' span: 1:197-224 children: - - 172 - - 175 - parent: 182 -- id: 177 + - 174 + - 177 + parent: 184 +- id: 179 kind: Ident span: 1:231-236 ident: !Ident @@ -280,9 +280,9 @@ nodes: - genres - name targets: - - 173 - parent: 182 -- id: 180 + - 175 + parent: 184 +- id: 182 kind: Ident span: 1:238-250 ident: !Ident @@ -290,15 +290,15 @@ nodes: - tracks - milliseconds targets: - - 174 - parent: 182 -- id: 182 + - 176 + parent: 184 +- id: 184 kind: 'TransformCall: Sort' span: 1:225-251 children: - - 176 - - 177 - - 180 + - 178 + - 179 + - 182 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap similarity index 90% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap index 17babc3580..ee23a13653 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__invoice_totals.snap @@ -7,18 +7,18 @@ frames: - - 1:147-183 - columns: - !All - input_id: 138 + input_id: 140 except: [] - !All - input_id: 135 + input_id: 137 except: [] inputs: - - id: 138 + - id: 140 name: i table: - default_db - invoices - - id: 135 + - id: 137 name: ii table: - default_db @@ -26,28 +26,28 @@ frames: - - 1:184-253 - columns: - !All - input_id: 138 + input_id: 140 except: [] - !All - input_id: 135 + input_id: 137 except: [] - !Single name: - city - target_id: 145 + target_id: 147 target_name: null - !Single name: - street - target_id: 146 + target_id: 148 target_name: null inputs: - - id: 138 + - id: 140 name: i table: - default_db - invoices - - id: 135 + - id: 137 name: ii table: - default_db @@ -55,23 +55,23 @@ frames: - - 1:281-323 - columns: - !All - input_id: 138 + input_id: 140 except: [] - !All - input_id: 135 + input_id: 137 except: [] - !Single name: - total - target_id: 176 + target_id: 178 target_name: null inputs: - - id: 138 + - id: 140 name: i table: - default_db - invoices - - id: 135 + - id: 137 name: ii table: - default_db @@ -81,35 +81,35 @@ frames: - !Single name: - city - target_id: 149 + target_id: 151 target_name: null - !Single name: - street - target_id: 150 + target_id: 152 target_name: null - !Single name: - num_orders - target_id: 182 + target_id: 184 target_name: null - !Single name: - num_tracks - target_id: 185 + target_id: 187 target_name: null - !Single name: - total_price - target_id: 188 + target_id: 190 target_name: null inputs: - - id: 138 + - id: 140 name: i table: - default_db - invoices - - id: 135 + - id: 137 name: ii table: - default_db @@ -119,40 +119,40 @@ frames: - !Single name: - city - target_id: 195 + target_id: 197 target_name: null - !Single name: - street - target_id: 150 + target_id: 152 target_name: null - !Single name: - num_orders - target_id: 182 + target_id: 184 target_name: null - !Single name: - num_tracks - target_id: 185 + target_id: 187 target_name: null - !Single name: - total_price - target_id: 188 + target_id: 190 target_name: null - !Single name: - running_total_num_tracks - target_id: 241 + target_id: 243 target_name: null inputs: - - id: 138 + - id: 140 name: i table: - default_db - invoices - - id: 135 + - id: 137 name: ii table: - default_db @@ -162,40 +162,40 @@ frames: - !Single name: - city - target_id: 195 + target_id: 197 target_name: null - !Single name: - street - target_id: 150 + target_id: 152 target_name: null - !Single name: - num_orders - target_id: 182 + target_id: 184 target_name: null - !Single name: - num_tracks - target_id: 185 + target_id: 187 target_name: null - !Single name: - total_price - target_id: 188 + target_id: 190 target_name: null - !Single name: - running_total_num_tracks - target_id: 241 + target_id: 243 target_name: null inputs: - - id: 138 + - id: 140 name: i table: - default_db - invoices - - id: 135 + - id: 137 name: ii table: - default_db @@ -205,45 +205,45 @@ frames: - !Single name: - city - target_id: 195 + target_id: 197 target_name: null - !Single name: - street - target_id: 150 + target_id: 152 target_name: null - !Single name: - num_orders - target_id: 182 + target_id: 184 target_name: null - !Single name: - num_tracks - target_id: 185 + target_id: 187 target_name: null - !Single name: - total_price - target_id: 188 + target_id: 190 target_name: null - !Single name: - running_total_num_tracks - target_id: 241 + target_id: 243 target_name: null - !Single name: - num_tracks_last_week - target_id: 255 + target_id: 257 target_name: null inputs: - - id: 138 + - id: 140 name: i table: - default_db - invoices - - id: 135 + - id: 137 name: ii table: - default_db @@ -253,40 +253,40 @@ frames: - !Single name: - city - target_id: 261 + target_id: 263 target_name: null - !Single name: - street - target_id: 262 + target_id: 264 target_name: null - !Single name: - num_orders - target_id: 263 + target_id: 265 target_name: null - !Single name: - num_tracks - target_id: 264 + target_id: 266 target_name: null - !Single name: - running_total_num_tracks - target_id: 265 + target_id: 267 target_name: null - !Single name: - num_tracks_last_week - target_id: 266 + target_id: 268 target_name: null inputs: - - id: 138 + - id: 140 name: i table: - default_db - invoices - - id: 135 + - id: 137 name: ii table: - default_db @@ -296,67 +296,67 @@ frames: - !Single name: - city - target_id: 261 + target_id: 263 target_name: null - !Single name: - street - target_id: 262 + target_id: 264 target_name: null - !Single name: - num_orders - target_id: 263 + target_id: 265 target_name: null - !Single name: - num_tracks - target_id: 264 + target_id: 266 target_name: null - !Single name: - running_total_num_tracks - target_id: 265 + target_id: 267 target_name: null - !Single name: - num_tracks_last_week - target_id: 266 + target_id: 268 target_name: null inputs: - - id: 138 + - id: 140 name: i table: - default_db - invoices - - id: 135 + - id: 137 name: ii table: - default_db - invoice_items nodes: -- id: 135 +- id: 137 kind: Ident span: 1:155-168 ident: !Ident - default_db - invoice_items - parent: 144 -- id: 138 + parent: 146 +- id: 140 kind: Ident span: 1:131-146 ident: !Ident - default_db - invoices - parent: 144 -- id: 140 + parent: 146 +- id: 142 kind: RqOperator span: 1:170-182 targets: - - 142 - - 143 - parent: 144 -- id: 142 + - 144 + - 145 + parent: 146 +- id: 144 kind: Ident span: 1:172-182 ident: !Ident @@ -364,8 +364,8 @@ nodes: - i - invoice_id targets: - - 138 -- id: 143 + - 140 +- id: 145 kind: Ident span: 1:172-182 ident: !Ident @@ -373,16 +373,16 @@ nodes: - ii - invoice_id targets: - - 135 -- id: 144 + - 137 +- id: 146 kind: 'TransformCall: Join' span: 1:147-183 children: - - 138 - - 135 - 140 - parent: 148 -- id: 145 + - 137 + - 142 + parent: 150 +- id: 147 kind: Ident span: 1:204-218 alias: city @@ -391,9 +391,9 @@ nodes: - i - billing_city targets: - - 138 - parent: 147 -- id: 146 + - 140 + parent: 149 +- id: 148 kind: Ident span: 1:233-250 alias: street @@ -402,56 +402,56 @@ nodes: - i - billing_address targets: - - 138 - parent: 147 -- id: 147 + - 140 + parent: 149 +- id: 149 kind: Tuple span: 1:191-253 children: - - 145 - - 146 - parent: 148 -- id: 148 + - 147 + - 148 + parent: 150 +- id: 150 kind: 'TransformCall: Derive' span: 1:184-253 children: - - 144 - - 147 - parent: 181 -- id: 149 + - 146 + - 149 + parent: 183 +- id: 151 kind: Ident span: 1:261-265 ident: !Ident - this - city targets: - - 145 - parent: 151 -- id: 150 + - 147 + parent: 153 +- id: 152 kind: Ident span: 1:267-273 ident: !Ident - this - street targets: - - 146 - parent: 151 -- id: 151 + - 148 + parent: 153 +- id: 153 kind: Tuple span: 1:260-274 children: - - 149 - - 150 - parent: 192 -- id: 176 + - 151 + - 152 + parent: 194 +- id: 178 kind: RqOperator span: 1:296-323 alias: total targets: - - 178 - - 179 - parent: 180 -- id: 178 + - 180 + - 181 + parent: 182 +- id: 180 kind: Ident span: 1:296-309 ident: !Ident @@ -459,8 +459,8 @@ nodes: - ii - unit_price targets: - - 135 -- id: 179 + - 137 +- id: 181 kind: Ident span: 1:312-323 ident: !Ident @@ -468,28 +468,28 @@ nodes: - ii - quantity targets: - - 135 -- id: 180 + - 137 +- id: 182 kind: Tuple span: 1:296-323 children: - - 176 - parent: 181 -- id: 181 + - 178 + parent: 183 +- id: 183 kind: 'TransformCall: Derive' span: 1:281-323 children: - - 148 - - 180 - parent: 192 -- id: 182 + - 150 + - 182 + parent: 194 +- id: 184 kind: RqOperator span: 1:361-388 alias: num_orders targets: - - 184 - parent: 191 -- id: 184 + - 186 + parent: 193 +- id: 186 kind: Ident span: 1:376-388 ident: !Ident @@ -497,15 +497,15 @@ nodes: - i - invoice_id targets: - - 138 -- id: 185 + - 140 +- id: 187 kind: RqOperator span: 1:411-426 alias: num_tracks targets: - - 187 - parent: 191 -- id: 187 + - 189 + parent: 193 +- id: 189 kind: Ident span: 1:415-426 ident: !Ident @@ -513,229 +513,229 @@ nodes: - ii - quantity targets: - - 135 -- id: 188 + - 137 +- id: 190 kind: RqOperator span: 1:450-459 alias: total_price targets: - - 190 - parent: 191 -- id: 190 + - 192 + parent: 193 +- id: 192 kind: Ident span: 1:454-459 ident: !Ident - this - total targets: - - 176 -- id: 191 + - 178 +- id: 193 kind: Tuple span: 1:338-466 children: - - 182 - - 185 - - 188 - parent: 192 -- id: 192 + - 184 + - 187 + - 190 + parent: 194 +- id: 194 kind: 'TransformCall: Aggregate' span: 1:328-466 children: - - 181 - - 191 - - 151 - parent: 245 -- id: 195 + - 183 + - 193 + - 153 + parent: 247 +- id: 197 kind: Ident span: 1:476-480 ident: !Ident - this - city targets: - - 149 - parent: 196 -- id: 196 + - 151 + parent: 198 +- id: 198 kind: Tuple span: 1:475-481 children: - - 195 -- id: 220 + - 197 +- id: 222 kind: Ident span: 1:493-499 ident: !Ident - this - street targets: - - 150 -- id: 241 + - 152 +- id: 243 kind: RqOperator span: 1:571-585 alias: running_total_num_tracks targets: - - 243 - parent: 244 -- id: 243 + - 245 + parent: 246 +- id: 245 kind: Ident span: 1:575-585 ident: !Ident - this - num_tracks targets: - - 185 -- id: 244 + - 187 +- id: 246 kind: Tuple span: 1:543-586 children: - - 241 - parent: 245 -- id: 245 + - 243 + parent: 247 +- id: 247 kind: 'TransformCall: Derive' span: 1:536-586 children: - - 192 - - 244 - parent: 254 -- id: 247 + - 194 + - 246 + parent: 256 +- id: 249 kind: Literal -- id: 251 +- id: 253 kind: Ident span: 1:601-605 ident: !Ident - this - city targets: - - 195 - parent: 254 -- id: 252 + - 197 + parent: 256 +- id: 254 kind: Ident span: 1:607-613 ident: !Ident - this - street targets: - - 150 - parent: 254 -- id: 254 + - 152 + parent: 256 +- id: 256 kind: 'TransformCall: Sort' span: 1:595-614 children: - - 245 - - 251 - - 252 - parent: 260 -- id: 255 + - 247 + - 253 + - 254 + parent: 262 +- id: 257 kind: RqOperator span: 1:646-662 alias: num_tracks_last_week targets: - - 257 - - 258 - parent: 259 -- id: 257 + - 259 + - 260 + parent: 261 +- id: 259 kind: Literal span: 1:650-651 -- id: 258 +- id: 260 kind: Ident span: 1:652-662 ident: !Ident - this - num_tracks targets: - - 185 -- id: 259 + - 187 +- id: 261 kind: Tuple span: 1:622-663 children: - - 255 - parent: 260 -- id: 260 + - 257 + parent: 262 +- id: 262 kind: 'TransformCall: Derive' span: 1:615-663 children: - - 254 - - 259 - parent: 268 -- id: 261 + - 256 + - 261 + parent: 270 +- id: 263 kind: Ident span: 1:677-681 ident: !Ident - this - city targets: - - 195 - parent: 267 -- id: 262 + - 197 + parent: 269 +- id: 264 kind: Ident span: 1:687-693 ident: !Ident - this - street targets: - - 150 - parent: 267 -- id: 263 + - 152 + parent: 269 +- id: 265 kind: Ident span: 1:699-709 ident: !Ident - this - num_orders targets: - - 182 - parent: 267 -- id: 264 + - 184 + parent: 269 +- id: 266 kind: Ident span: 1:715-725 ident: !Ident - this - num_tracks targets: - - 185 - parent: 267 -- id: 265 + - 187 + parent: 269 +- id: 267 kind: Ident span: 1:731-755 ident: !Ident - this - running_total_num_tracks targets: - - 241 - parent: 267 -- id: 266 + - 243 + parent: 269 +- id: 268 kind: Ident span: 1:761-781 ident: !Ident - this - num_tracks_last_week targets: - - 255 - parent: 267 -- id: 267 + - 257 + parent: 269 +- id: 269 kind: Tuple span: 1:671-783 children: - - 261 - - 262 - 263 - 264 - 265 - 266 - parent: 268 -- id: 268 - kind: 'TransformCall: Select' - span: 1:664-783 - children: - - 260 - 267 + - 268 parent: 270 - id: 270 + kind: 'TransformCall: Select' + span: 1:664-783 + children: + - 262 + - 269 + parent: 272 +- id: 272 kind: 'TransformCall: Take' span: 1:784-791 children: - - 268 - - 271 -- id: 271 + - 270 + - 273 +- id: 273 kind: Literal - parent: 270 + parent: 272 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap similarity index 87% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap index ac0d444fd6..36fedb6b3d 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__loop_01.snap @@ -9,252 +9,252 @@ frames: - !Single name: - n - target_id: 129 + target_id: 131 target_name: null inputs: - - id: 125 - name: _literal_125 + - id: 127 + name: _literal_127 table: - default_db - - _literal_125 + - _literal_127 - - 1:200-212 - columns: - !Single name: - n - target_id: 129 + target_id: 131 target_name: null inputs: - - id: 125 - name: _literal_125 + - id: 127 + name: _literal_127 table: - default_db - - _literal_125 + - _literal_127 - - 1:215-231 - columns: - !Single name: - n - target_id: 152 + target_id: 154 target_name: null inputs: - - id: 125 - name: _literal_125 + - id: 127 + name: _literal_127 table: - default_db - - _literal_125 + - _literal_127 - - 1:194-232 - columns: - !Single name: - n - target_id: 129 + target_id: 131 target_name: null inputs: - - id: 125 - name: _literal_125 + - id: 127 + name: _literal_127 table: - default_db - - _literal_125 + - _literal_127 - - 1:233-249 - columns: - !Single name: - n - target_id: 160 + target_id: 162 target_name: null inputs: - - id: 125 - name: _literal_125 + - id: 127 + name: _literal_127 table: - default_db - - _literal_125 + - _literal_127 - - 1:250-256 - columns: - !Single name: - n - target_id: 160 + target_id: 162 target_name: null inputs: - - id: 125 - name: _literal_125 + - id: 127 + name: _literal_127 table: - default_db - - _literal_125 + - _literal_127 nodes: -- id: 125 +- id: 127 kind: Array span: 1:162-176 children: - - 126 - parent: 134 -- id: 126 + - 128 + parent: 136 +- id: 128 kind: Tuple span: 1:168-175 children: - - 127 - parent: 125 -- id: 127 + - 129 + parent: 127 +- id: 129 kind: Literal span: 1:173-174 alias: n - parent: 126 -- id: 129 + parent: 128 +- id: 131 kind: RqOperator span: 1:188-193 alias: n targets: - - 131 - - 132 - parent: 133 -- id: 131 + - 133 + - 134 + parent: 135 +- id: 133 kind: Ident span: 1:188-189 ident: !Ident - this - - _literal_125 + - _literal_127 - n targets: - - 125 -- id: 132 + - 127 +- id: 134 kind: Literal span: 1:192-193 -- id: 133 +- id: 135 kind: Tuple span: 1:188-193 children: - - 129 - parent: 134 -- id: 134 + - 131 + parent: 136 +- id: 136 kind: 'TransformCall: Select' span: 1:177-193 children: - - 125 - - 133 - parent: 158 -- id: 143 + - 127 + - 135 + parent: 160 +- id: 145 kind: Ident ident: !Ident - _param - _tbl targets: - - 140 - parent: 151 -- id: 147 + - 142 + parent: 153 +- id: 149 kind: RqOperator span: 1:207-212 targets: - - 149 - - 150 - parent: 151 -- id: 149 + - 151 + - 152 + parent: 153 +- id: 151 kind: Ident span: 1:207-208 ident: !Ident - this - n targets: - - 129 -- id: 150 + - 131 +- id: 152 kind: Literal span: 1:211-212 -- id: 151 +- id: 153 kind: 'TransformCall: Filter' span: 1:200-212 children: - - 143 - - 147 - parent: 157 -- id: 152 + - 145 + - 149 + parent: 159 +- id: 154 kind: RqOperator span: 1:226-231 alias: n targets: - - 154 - - 155 - parent: 156 -- id: 154 + - 156 + - 157 + parent: 158 +- id: 156 kind: Ident span: 1:226-227 ident: !Ident - this - n targets: - - 129 -- id: 155 + - 131 +- id: 157 kind: Literal span: 1:230-231 -- id: 156 +- id: 158 kind: Tuple span: 1:226-231 children: - - 152 - parent: 157 -- id: 157 + - 154 + parent: 159 +- id: 159 kind: 'TransformCall: Select' span: 1:215-231 children: - - 151 - - 156 -- id: 158 + - 153 + - 158 +- id: 160 kind: 'TransformCall: Loop' span: 1:194-232 children: - - 134 - - 159 - parent: 165 -- id: 159 + - 136 + - 161 + parent: 167 +- id: 161 kind: Func span: 1:215-231 - parent: 158 -- id: 160 + parent: 160 +- id: 162 kind: RqOperator span: 1:244-249 alias: n targets: - - 162 - - 163 - parent: 164 -- id: 162 + - 164 + - 165 + parent: 166 +- id: 164 kind: Ident span: 1:244-245 ident: !Ident - this - n targets: - - 129 -- id: 163 + - 131 +- id: 165 kind: Literal span: 1:248-249 -- id: 164 +- id: 166 kind: Tuple span: 1:244-249 children: - - 160 - parent: 165 -- id: 165 + - 162 + parent: 167 +- id: 167 kind: 'TransformCall: Select' span: 1:233-249 children: - - 158 - - 164 - parent: 168 -- id: 166 + - 160 + - 166 + parent: 170 +- id: 168 kind: Ident span: 1:255-256 ident: !Ident - this - n targets: - - 160 - parent: 168 -- id: 168 + - 162 + parent: 170 +- id: 170 kind: 'TransformCall: Sort' span: 1:250-256 children: - - 165 - - 166 + - 167 + - 168 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap similarity index 93% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap index 6134c27672..cf552c40ab 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__math_module.snap @@ -7,10 +7,10 @@ frames: - - 1:96-102 - columns: - !All - input_id: 119 + input_id: 121 except: [] inputs: - - id: 119 + - id: 121 name: invoices table: - default_db @@ -20,109 +20,109 @@ frames: - !Single name: - total_original - target_id: 124 + target_id: 126 target_name: null - !Single name: - total_x - target_id: 129 + target_id: 131 target_name: null - !Single name: - total_floor - target_id: 140 + target_id: 142 target_name: null - !Single name: - total_ceil - target_id: 143 + target_id: 145 target_name: null - !Single name: - total_log10 - target_id: 146 + target_id: 148 target_name: null - !Single name: - total_log2 - target_id: 153 + target_id: 155 target_name: null - !Single name: - total_sqrt - target_id: 161 + target_id: 163 target_name: null - !Single name: - total_ln - target_id: 168 + target_id: 170 target_name: null - !Single name: - total_cos - target_id: 177 + target_id: 179 target_name: null - !Single name: - total_sin - target_id: 186 + target_id: 188 target_name: null - !Single name: - total_tan - target_id: 195 + target_id: 197 target_name: null - !Single name: - total_deg - target_id: 204 + target_id: 206 target_name: null - !Single name: - total_square - target_id: 213 + target_id: 215 target_name: null - !Single name: - total_square_op - target_id: 222 + target_id: 224 target_name: null inputs: - - id: 119 + - id: 121 name: invoices table: - default_db - invoices nodes: -- id: 119 +- id: 121 kind: Ident span: 1:82-95 ident: !Ident - default_db - invoices - parent: 122 -- id: 122 + parent: 124 +- id: 124 kind: 'TransformCall: Take' span: 1:96-102 children: - - 119 - - 123 - parent: 231 -- id: 123 + - 121 + - 125 + parent: 233 +- id: 125 kind: Literal - parent: 122 -- id: 124 + parent: 124 +- id: 126 kind: RqOperator span: 1:142-154 alias: total_original targets: - - 127 - - 128 - parent: 230 -- id: 127 + - 129 + - 130 + parent: 232 +- id: 129 kind: Literal span: 1:153-154 -- id: 128 +- id: 130 kind: Ident span: 1:134-139 ident: !Ident @@ -130,33 +130,33 @@ nodes: - invoices - total targets: - - 119 -- id: 129 + - 121 +- id: 131 kind: RqOperator span: 1:205-213 alias: total_x targets: - - 131 - parent: 230 -- id: 131 + - 133 + parent: 232 +- id: 133 kind: RqOperator span: 1:190-202 targets: - - 134 - - 135 -- id: 134 + - 136 + - 137 +- id: 136 kind: Literal span: 1:201-202 -- id: 135 +- id: 137 kind: RqOperator span: 1:172-187 targets: - - 138 - - 139 -- id: 138 + - 140 + - 141 +- id: 140 kind: RqOperator span: 1:172-179 -- id: 139 +- id: 141 kind: Ident span: 1:182-187 ident: !Ident @@ -164,15 +164,15 @@ nodes: - invoices - total targets: - - 119 -- id: 140 + - 121 +- id: 142 kind: RqOperator span: 1:234-252 alias: total_floor targets: - - 142 - parent: 230 -- id: 142 + - 144 + parent: 232 +- id: 144 kind: Ident span: 1:246-251 ident: !Ident @@ -180,15 +180,15 @@ nodes: - invoices - total targets: - - 119 -- id: 143 + - 121 +- id: 145 kind: RqOperator span: 1:271-288 alias: total_ceil targets: - - 145 - parent: 230 -- id: 145 + - 147 + parent: 232 +- id: 147 kind: Ident span: 1:282-287 ident: !Ident @@ -196,24 +196,24 @@ nodes: - invoices - total targets: - - 119 -- id: 146 + - 121 +- id: 148 kind: RqOperator span: 1:328-340 alias: total_log10 targets: - - 149 - - 150 - parent: 230 -- id: 149 + - 151 + - 152 + parent: 232 +- id: 151 kind: Literal span: 1:339-340 -- id: 150 +- id: 152 kind: RqOperator span: 1:309-325 targets: - - 152 -- id: 152 + - 154 +- id: 154 kind: Ident span: 1:320-325 ident: !Ident @@ -221,28 +221,28 @@ nodes: - invoices - total targets: - - 119 -- id: 153 + - 121 +- id: 155 kind: RqOperator span: 1:380-392 alias: total_log2 targets: - - 156 - - 157 - parent: 230 -- id: 156 + - 158 + - 159 + parent: 232 +- id: 158 kind: Literal span: 1:391-392 -- id: 157 +- id: 159 kind: RqOperator span: 1:361-377 targets: - - 159 - - 160 -- id: 159 + - 161 + - 162 +- id: 161 kind: Literal span: 1:370-371 -- id: 160 +- id: 162 kind: Ident span: 1:372-377 ident: !Ident @@ -250,24 +250,24 @@ nodes: - invoices - total targets: - - 119 -- id: 161 + - 121 +- id: 163 kind: RqOperator span: 1:431-443 alias: total_sqrt targets: - - 164 - - 165 - parent: 230 -- id: 164 + - 166 + - 167 + parent: 232 +- id: 166 kind: Literal span: 1:442-443 -- id: 165 +- id: 167 kind: RqOperator span: 1:413-428 targets: - - 167 -- id: 167 + - 169 +- id: 169 kind: Ident span: 1:423-428 ident: !Ident @@ -275,29 +275,29 @@ nodes: - invoices - total targets: - - 119 -- id: 168 + - 121 +- id: 170 kind: RqOperator span: 1:489-501 alias: total_ln targets: - - 171 - - 172 - parent: 230 -- id: 171 + - 173 + - 174 + parent: 232 +- id: 173 kind: Literal span: 1:500-501 -- id: 172 +- id: 174 kind: RqOperator span: 1:478-486 targets: - - 174 -- id: 174 + - 176 +- id: 176 kind: RqOperator span: 1:462-475 targets: - - 176 -- id: 176 + - 178 +- id: 178 kind: Ident span: 1:470-475 ident: !Ident @@ -305,29 +305,29 @@ nodes: - invoices - total targets: - - 119 -- id: 177 + - 121 +- id: 179 kind: RqOperator span: 1:550-562 alias: total_cos targets: - - 180 - - 181 - parent: 230 -- id: 180 + - 182 + - 183 + parent: 232 +- id: 182 kind: Literal span: 1:561-562 -- id: 181 +- id: 183 kind: RqOperator span: 1:538-547 targets: - - 183 -- id: 183 + - 185 +- id: 185 kind: RqOperator span: 1:521-535 targets: - - 185 -- id: 185 + - 187 +- id: 187 kind: Ident span: 1:530-535 ident: !Ident @@ -335,29 +335,29 @@ nodes: - invoices - total targets: - - 119 -- id: 186 + - 121 +- id: 188 kind: RqOperator span: 1:611-623 alias: total_sin targets: - - 189 - - 190 - parent: 230 -- id: 189 + - 191 + - 192 + parent: 232 +- id: 191 kind: Literal span: 1:622-623 -- id: 190 +- id: 192 kind: RqOperator span: 1:599-608 targets: - - 192 -- id: 192 + - 194 +- id: 194 kind: RqOperator span: 1:582-596 targets: - - 194 -- id: 194 + - 196 +- id: 196 kind: Ident span: 1:591-596 ident: !Ident @@ -365,29 +365,29 @@ nodes: - invoices - total targets: - - 119 -- id: 195 + - 121 +- id: 197 kind: RqOperator span: 1:672-684 alias: total_tan targets: - - 198 - - 199 - parent: 230 -- id: 198 + - 200 + - 201 + parent: 232 +- id: 200 kind: Literal span: 1:683-684 -- id: 199 +- id: 201 kind: RqOperator span: 1:660-669 targets: - - 201 -- id: 201 + - 203 +- id: 203 kind: RqOperator span: 1:643-657 targets: - - 203 -- id: 203 + - 205 +- id: 205 kind: Ident span: 1:652-657 ident: !Ident @@ -395,29 +395,29 @@ nodes: - invoices - total targets: - - 119 -- id: 204 + - 121 +- id: 206 kind: RqOperator span: 1:742-754 alias: total_deg targets: - - 207 - - 208 - parent: 230 -- id: 207 + - 209 + - 210 + parent: 232 +- id: 209 kind: Literal span: 1:753-754 -- id: 208 +- id: 210 kind: RqOperator span: 1:727-739 targets: - - 210 -- id: 210 + - 212 +- id: 212 kind: RqOperator span: 1:712-724 targets: - - 212 -- id: 212 + - 214 +- id: 214 kind: Ident span: 1:704-709 ident: !Ident @@ -425,28 +425,28 @@ nodes: - invoices - total targets: - - 119 -- id: 213 + - 121 +- id: 215 kind: RqOperator span: 1:798-810 alias: total_square targets: - - 216 - - 217 - parent: 230 -- id: 216 + - 218 + - 219 + parent: 232 +- id: 218 kind: Literal span: 1:809-810 -- id: 217 +- id: 219 kind: RqOperator span: 1:785-795 targets: - - 220 - - 221 -- id: 220 + - 222 + - 223 +- id: 222 kind: Literal span: 1:794-795 -- id: 221 +- id: 223 kind: Ident span: 1:777-782 ident: !Ident @@ -454,28 +454,28 @@ nodes: - invoices - total targets: - - 119 -- id: 222 + - 121 +- id: 224 kind: RqOperator span: 1:851-863 alias: total_square_op targets: - - 225 - - 226 - parent: 230 -- id: 225 + - 227 + - 228 + parent: 232 +- id: 227 kind: Literal span: 1:862-863 -- id: 226 +- id: 228 kind: RqOperator span: 1:836-848 targets: - - 228 - - 229 -- id: 228 + - 230 + - 231 +- id: 230 kind: Literal span: 1:846-847 -- id: 229 +- id: 231 kind: Ident span: 1:837-842 ident: !Ident @@ -483,32 +483,32 @@ nodes: - invoices - total targets: - - 119 -- id: 230 + - 121 +- id: 232 kind: Tuple span: 1:110-867 children: - - 124 - - 129 - - 140 - - 143 - - 146 - - 153 - - 161 - - 168 - - 177 - - 186 - - 195 - - 204 - - 213 - - 222 - parent: 231 -- id: 231 + - 126 + - 131 + - 142 + - 145 + - 148 + - 155 + - 163 + - 170 + - 179 + - 188 + - 197 + - 206 + - 215 + - 224 + parent: 233 +- id: 233 kind: 'TransformCall: Select' span: 1:103-867 children: - - 122 - - 230 + - 124 + - 232 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap similarity index 92% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap index 7fc19ad571..e76b2258b5 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__pipelines.snap @@ -7,10 +7,10 @@ frames: - - 1:179-202 - columns: - !All - input_id: 128 + input_id: 130 except: [] inputs: - - id: 128 + - id: 130 name: tracks table: - default_db @@ -18,10 +18,10 @@ frames: - - 1:203-248 - columns: - !All - input_id: 128 + input_id: 130 except: [] inputs: - - id: 128 + - id: 130 name: tracks table: - default_db @@ -29,10 +29,10 @@ frames: - - 1:249-262 - columns: - !All - input_id: 128 + input_id: 130 except: [] inputs: - - id: 128 + - id: 130 name: tracks table: - default_db @@ -40,10 +40,10 @@ frames: - - 1:263-273 - columns: - !All - input_id: 128 + input_id: 130 except: [] inputs: - - id: 128 + - id: 130 name: tracks table: - default_db @@ -54,36 +54,36 @@ frames: name: - tracks - name - target_id: 162 + target_id: 164 target_name: null - !Single name: - tracks - composer - target_id: 163 + target_id: 165 target_name: null inputs: - - id: 128 + - id: 130 name: tracks table: - default_db - tracks nodes: -- id: 128 +- id: 130 kind: Ident span: 1:166-177 ident: !Ident - default_db - tracks - parent: 134 -- id: 130 + parent: 136 +- id: 132 kind: RqOperator span: 1:187-201 targets: - - 132 - - 133 - parent: 134 -- id: 132 + - 134 + - 135 + parent: 136 +- id: 134 kind: Ident span: 1:187-191 ident: !Ident @@ -91,38 +91,38 @@ nodes: - tracks - name targets: - - 128 -- id: 133 + - 130 +- id: 135 kind: Literal span: 1:195-201 -- id: 134 +- id: 136 kind: 'TransformCall: Filter' span: 1:179-202 children: - - 128 - 130 - parent: 154 -- id: 138 + - 132 + parent: 156 +- id: 140 kind: Literal span: 1:243-244 alias: start -- id: 139 +- id: 141 kind: Literal span: 1:246-247 alias: end -- id: 141 +- id: 143 kind: RqOperator span: 1:211-237 targets: - - 143 - - 147 -- id: 143 + - 145 + - 149 +- id: 145 kind: RqOperator span: 1:212-231 targets: - - 145 - - 146 -- id: 145 + - 147 + - 148 +- id: 147 kind: Ident span: 1:212-224 ident: !Ident @@ -130,38 +130,38 @@ nodes: - tracks - milliseconds targets: - - 128 -- id: 146 + - 130 +- id: 148 kind: Literal span: 1:227-231 -- id: 147 +- id: 149 kind: Literal span: 1:234-236 -- id: 148 +- id: 150 kind: RqOperator span: 1:240-247 targets: - - 150 - 152 - parent: 154 -- id: 150 + - 154 + parent: 156 +- id: 152 kind: RqOperator targets: - - 141 - - 138 -- id: 152 + - 143 + - 140 +- id: 154 kind: RqOperator targets: + - 143 - 141 - - 139 -- id: 154 +- id: 156 kind: 'TransformCall: Filter' span: 1:203-248 children: - - 134 - - 148 - parent: 157 -- id: 155 + - 136 + - 150 + parent: 159 +- id: 157 kind: Ident span: 1:254-262 ident: !Ident @@ -169,34 +169,34 @@ nodes: - tracks - track_id targets: - - 128 - parent: 157 -- id: 157 + - 130 + parent: 159 +- id: 159 kind: 'TransformCall: Sort' span: 1:249-262 children: - - 154 - - 155 - parent: 161 -- id: 158 + - 156 + - 157 + parent: 163 +- id: 160 kind: Literal span: 1:268-269 alias: start - parent: 161 -- id: 159 + parent: 163 +- id: 161 kind: Literal span: 1:271-273 alias: end - parent: 161 -- id: 161 + parent: 163 +- id: 163 kind: 'TransformCall: Take' span: 1:263-273 children: - - 157 - - 158 - 159 - parent: 165 -- id: 162 + - 160 + - 161 + parent: 167 +- id: 164 kind: Ident span: 1:282-286 ident: !Ident @@ -204,9 +204,9 @@ nodes: - tracks - name targets: - - 128 - parent: 164 -- id: 163 + - 130 + parent: 166 +- id: 165 kind: Ident span: 1:288-296 ident: !Ident @@ -214,21 +214,21 @@ nodes: - tracks - composer targets: - - 128 - parent: 164 -- id: 164 + - 130 + parent: 166 +- id: 166 kind: Tuple span: 1:281-297 children: - - 162 - - 163 - parent: 165 -- id: 165 + - 164 + - 165 + parent: 167 +- id: 167 kind: 'TransformCall: Select' span: 1:274-297 children: - - 161 - - 164 + - 163 + - 166 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap similarity index 85% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap index 1818ef91dc..d5fc9bfbbd 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__read_csv.snap @@ -7,77 +7,77 @@ frames: - - 1:92-144 - columns: - !All - input_id: 122 + input_id: 124 except: [] inputs: - - id: 122 - name: _literal_122 + - id: 124 + name: _literal_124 table: - default_db - - _literal_122 - - id: 117 - name: _literal_117 + - _literal_124 + - id: 119 + name: _literal_119 table: - default_db - - _literal_117 + - _literal_119 - - 1:145-163 - columns: - !All - input_id: 122 + input_id: 124 except: [] inputs: - - id: 122 - name: _literal_122 + - id: 124 + name: _literal_124 table: - default_db - - _literal_122 - - id: 117 - name: _literal_117 + - _literal_124 + - id: 119 + name: _literal_119 table: - default_db - - _literal_117 + - _literal_119 nodes: -- id: 117 +- id: 119 kind: RqOperator span: 1:100-143 targets: - - 119 - parent: 126 -- id: 119 + - 121 + parent: 128 +- id: 121 kind: Literal span: 1:110-143 -- id: 122 +- id: 124 kind: RqOperator span: 1:43-91 targets: - - 124 - parent: 126 -- id: 124 + - 126 + parent: 128 +- id: 126 kind: Literal span: 1:58-90 -- id: 126 +- id: 128 kind: 'TransformCall: Append' span: 1:92-144 children: - - 122 - - 117 - parent: 129 -- id: 127 + - 124 + - 119 + parent: 131 +- id: 129 kind: Ident span: 1:150-163 ident: !Ident - this - - _literal_122 + - _literal_124 - media_type_id targets: - - 122 - parent: 129 -- id: 129 + - 124 + parent: 131 +- id: 131 kind: 'TransformCall: Sort' span: 1:145-163 children: - - 126 - - 127 + - 128 + - 129 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap similarity index 85% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap index f3d84f25d3..b1b336caf6 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__set_ops_remove.snap @@ -10,167 +10,167 @@ frames: name: - t - a - target_id: 134 + target_id: 136 target_name: null inputs: - - id: 125 + - id: 127 name: t table: - default_db - - _literal_125 + - _literal_127 - - 0:3163-3240 - columns: - !Single name: - t - a - target_id: 134 + target_id: 136 target_name: null - !Single name: - b - a - target_id: 120 + target_id: 122 target_name: a inputs: - - id: 125 + - id: 127 name: t table: - default_db - - _literal_125 - - id: 120 + - _literal_127 + - id: 122 name: b table: - default_db - - _literal_120 + - _literal_122 - - 0:3243-3288 - columns: - !Single name: - t - a - target_id: 134 + target_id: 136 target_name: null - !Single name: - b - a - target_id: 120 + target_id: 122 target_name: a inputs: - - id: 125 + - id: 127 name: t table: - default_db - - _literal_125 - - id: 120 + - _literal_127 + - id: 122 name: b table: - default_db - - _literal_120 + - _literal_122 - - 1:165-238 - columns: - !Single name: - t - a - target_id: 205 + target_id: 207 target_name: null inputs: - - id: 125 + - id: 127 name: t table: - default_db - - _literal_125 - - id: 120 + - _literal_127 + - id: 122 name: b table: - default_db - - _literal_120 + - _literal_122 - - 1:239-245 - columns: - !Single name: - t - a - target_id: 205 + target_id: 207 target_name: null inputs: - - id: 125 + - id: 127 name: t table: - default_db - - _literal_125 - - id: 120 + - _literal_127 + - id: 122 name: b table: - default_db - - _literal_120 + - _literal_122 nodes: -- id: 120 +- id: 122 kind: Array span: 1:173-237 - parent: 187 -- id: 125 + parent: 189 +- id: 127 kind: Array span: 1:36-55 - parent: 152 -- id: 134 + parent: 154 +- id: 136 kind: Ident ident: !Ident - this - t - a targets: - - 125 - parent: 136 -- id: 136 + - 127 + parent: 138 +- id: 138 kind: Tuple span: 1:64-69 children: - - 134 -- id: 152 + - 136 +- id: 154 kind: 'TransformCall: Take' span: 1:71-77 children: - - 125 - - 153 - parent: 187 -- id: 153 + - 127 + - 155 + parent: 189 +- id: 155 kind: Literal - parent: 152 -- id: 176 + parent: 154 +- id: 178 kind: Ident ident: !Ident - this - t - a targets: - - 134 -- id: 179 + - 136 +- id: 181 kind: Ident ident: !Ident - that - b - a targets: - - 120 -- id: 185 + - 122 +- id: 187 kind: RqOperator span: 0:3192-3239 targets: - - 176 - - 179 - parent: 187 -- id: 187 + - 178 + - 181 + parent: 189 +- id: 189 kind: 'TransformCall: Join' span: 0:3163-3240 children: - - 152 - - 120 - - 185 - parent: 203 -- id: 195 + - 154 + - 122 + - 187 + parent: 205 +- id: 197 kind: Ident span: 0:5981-5989 ident: !Ident @@ -178,47 +178,47 @@ nodes: - b - a targets: - - 120 -- id: 199 + - 122 +- id: 201 kind: RqOperator span: 0:3251-3287 targets: - - 195 - - 202 - parent: 203 -- id: 202 + - 197 + - 204 + parent: 205 +- id: 204 kind: Literal span: 0:5993-5997 -- id: 203 +- id: 205 kind: 'TransformCall: Filter' span: 0:3243-3288 children: - - 187 - - 199 - parent: 207 -- id: 205 + - 189 + - 201 + parent: 209 +- id: 207 kind: Ident ident: !Ident - this - t - a targets: - - 134 - parent: 206 -- id: 206 + - 136 + parent: 208 +- id: 208 kind: Tuple span: 0:3298-3301 children: - - 205 - parent: 207 -- id: 207 + - 207 + parent: 209 +- id: 209 kind: 'TransformCall: Select' span: 1:165-238 children: - - 203 - - 206 - parent: 210 -- id: 208 + - 205 + - 208 + parent: 212 +- id: 210 kind: Ident span: 1:244-245 ident: !Ident @@ -226,14 +226,14 @@ nodes: - t - a targets: - - 205 - parent: 210 -- id: 210 + - 207 + parent: 212 +- id: 212 kind: 'TransformCall: Sort' span: 1:239-245 children: - - 207 - - 208 + - 209 + - 210 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__sort.snap similarity index 91% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__sort.snap index e036a7109a..db7de1ae67 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__sort.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__sort.snap @@ -7,10 +7,10 @@ frames: - - 1:30-61 - columns: - !All - input_id: 126 + input_id: 128 except: [] inputs: - - id: 126 + - id: 128 name: e table: - default_db @@ -18,10 +18,10 @@ frames: - - 1:62-90 - columns: - !All - input_id: 126 + input_id: 128 except: [] inputs: - - id: 126 + - id: 128 name: e table: - default_db @@ -29,18 +29,18 @@ frames: - - 1:145-215 - columns: - !All - input_id: 126 + input_id: 128 except: [] - !All - input_id: 117 + input_id: 119 except: [] inputs: - - id: 126 + - id: 128 name: e table: - default_db - employees - - id: 117 + - id: 119 name: manager table: - default_db @@ -49,54 +49,54 @@ frames: - columns: - !Single name: null - target_id: 142 + target_id: 144 target_name: null - !Single name: - e - last_name - target_id: 143 + target_id: 145 target_name: null - !Single name: - manager - first_name - target_id: 144 + target_id: 146 target_name: null inputs: - - id: 126 + - id: 128 name: e table: - default_db - employees - - id: 117 + - id: 119 name: manager table: - default_db - employees nodes: -- id: 117 +- id: 119 kind: Ident span: 1:158-167 ident: !Ident - default_db - employees - parent: 141 -- id: 126 + parent: 143 +- id: 128 kind: Ident span: 1:13-29 ident: !Ident - default_db - employees - parent: 132 -- id: 128 + parent: 134 +- id: 130 kind: RqOperator span: 1:37-61 targets: - - 130 - - 131 - parent: 132 -- id: 130 + - 132 + - 133 + parent: 134 +- id: 132 kind: Ident span: 1:37-47 ident: !Ident @@ -104,18 +104,18 @@ nodes: - e - first_name targets: - - 126 -- id: 131 + - 128 +- id: 133 kind: Literal span: 1:51-61 -- id: 132 +- id: 134 kind: 'TransformCall: Filter' span: 1:30-61 children: - - 126 - 128 - parent: 136 -- id: 133 + - 130 + parent: 138 +- id: 135 kind: Ident span: 1:68-78 ident: !Ident @@ -123,9 +123,9 @@ nodes: - e - first_name targets: - - 126 - parent: 136 -- id: 134 + - 128 + parent: 138 +- id: 136 kind: Ident span: 1:80-89 ident: !Ident @@ -133,24 +133,24 @@ nodes: - e - last_name targets: - - 126 - parent: 136 -- id: 136 + - 128 + parent: 138 +- id: 138 kind: 'TransformCall: Sort' span: 1:62-90 children: - - 132 - - 133 - 134 - parent: 141 -- id: 137 + - 135 + - 136 + parent: 143 +- id: 139 kind: RqOperator span: 1:179-214 targets: - - 139 - - 140 - parent: 141 -- id: 139 + - 141 + - 142 + parent: 143 +- id: 141 kind: Ident span: 1:179-191 ident: !Ident @@ -158,8 +158,8 @@ nodes: - e - reports_to targets: - - 126 -- id: 140 + - 128 +- id: 142 kind: Ident span: 1:195-214 ident: !Ident @@ -167,16 +167,16 @@ nodes: - manager - employee_id targets: - - 117 -- id: 141 + - 119 +- id: 143 kind: 'TransformCall: Join' span: 1:145-215 children: - - 136 - - 117 - - 137 - parent: 146 -- id: 142 + - 138 + - 119 + - 139 + parent: 148 +- id: 144 kind: Ident span: 1:225-237 ident: !Ident @@ -184,9 +184,9 @@ nodes: - e - first_name targets: - - 126 - parent: 145 -- id: 143 + - 128 + parent: 147 +- id: 145 kind: Ident span: 1:239-250 ident: !Ident @@ -194,9 +194,9 @@ nodes: - e - last_name targets: - - 126 - parent: 145 -- id: 144 + - 128 + parent: 147 +- id: 146 kind: Ident span: 1:252-270 ident: !Ident @@ -204,22 +204,22 @@ nodes: - manager - first_name targets: - - 117 - parent: 145 -- id: 145 + - 119 + parent: 147 +- id: 147 kind: Tuple span: 1:224-271 children: - - 142 - - 143 - 144 - parent: 146 -- id: 146 + - 145 + - 146 + parent: 148 +- id: 148 kind: 'TransformCall: Select' span: 1:217-271 children: - - 141 - - 145 + - 143 + - 147 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap similarity index 89% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap index 88d00fc5bf..b49dc06cb3 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__sort_2.snap @@ -9,16 +9,16 @@ frames: - !Single name: - AA - target_id: 128 + target_id: 130 target_name: null - !Single name: - albums - artist_id - target_id: 129 + target_id: 131 target_name: null inputs: - - id: 126 + - id: 128 name: albums table: - default_db @@ -28,16 +28,16 @@ frames: - !Single name: - AA - target_id: 128 + target_id: 130 target_name: null - !Single name: - albums - artist_id - target_id: 129 + target_id: 131 target_name: null inputs: - - id: 126 + - id: 128 name: albums table: - default_db @@ -47,16 +47,16 @@ frames: - !Single name: - AA - target_id: 128 + target_id: 130 target_name: null - !Single name: - albums - artist_id - target_id: 129 + target_id: 131 target_name: null inputs: - - id: 126 + - id: 128 name: albums table: - default_db @@ -66,44 +66,44 @@ frames: - !Single name: - AA - target_id: 128 + target_id: 130 target_name: null - !Single name: - albums - artist_id - target_id: 129 + target_id: 131 target_name: null - !All - input_id: 114 + input_id: 116 except: [] inputs: - - id: 126 + - id: 128 name: albums table: - default_db - albums - - id: 114 + - id: 116 name: artists table: - default_db - artists nodes: -- id: 114 +- id: 116 kind: Ident span: 1:75-82 ident: !Ident - default_db - artists - parent: 144 -- id: 126 + parent: 146 +- id: 128 kind: Ident span: 1:0-11 ident: !Ident - default_db - albums - parent: 131 -- id: 128 + parent: 133 +- id: 130 kind: Ident span: 1:24-32 alias: AA @@ -112,9 +112,9 @@ nodes: - albums - album_id targets: - - 126 - parent: 130 -- id: 129 + - 128 + parent: 132 +- id: 131 kind: Ident span: 1:34-43 ident: !Ident @@ -122,71 +122,71 @@ nodes: - albums - artist_id targets: - - 126 - parent: 130 -- id: 130 + - 128 + parent: 132 +- id: 132 kind: Tuple span: 1:19-45 children: - - 128 - - 129 - parent: 131 -- id: 131 + - 130 + - 131 + parent: 133 +- id: 133 kind: 'TransformCall: Select' span: 1:12-45 children: - - 126 - - 130 - parent: 134 -- id: 132 + - 128 + - 132 + parent: 136 +- id: 134 kind: Ident span: 1:51-53 ident: !Ident - this - AA targets: - - 128 - parent: 134 -- id: 134 + - 130 + parent: 136 +- id: 136 kind: 'TransformCall: Sort' span: 1:46-53 children: - - 131 - - 132 - parent: 139 -- id: 135 + - 133 + - 134 + parent: 141 +- id: 137 kind: RqOperator span: 1:61-69 targets: - - 137 - - 138 - parent: 139 -- id: 137 + - 139 + - 140 + parent: 141 +- id: 139 kind: Ident span: 1:61-63 ident: !Ident - this - AA targets: - - 128 -- id: 138 + - 130 +- id: 140 kind: Literal span: 1:67-69 -- id: 139 +- id: 141 kind: 'TransformCall: Filter' span: 1:54-69 children: - - 134 - - 135 - parent: 144 -- id: 140 + - 136 + - 137 + parent: 146 +- id: 142 kind: RqOperator span: 1:84-95 targets: - - 142 - - 143 - parent: 144 -- id: 142 + - 144 + - 145 + parent: 146 +- id: 144 kind: Ident span: 1:86-95 ident: !Ident @@ -194,8 +194,8 @@ nodes: - albums - artist_id targets: - - 129 -- id: 143 + - 131 +- id: 145 kind: Ident span: 1:86-95 ident: !Ident @@ -203,14 +203,14 @@ nodes: - artists - artist_id targets: - - 114 -- id: 144 + - 116 +- id: 146 kind: 'TransformCall: Join' span: 1:70-96 children: - - 139 - - 114 - - 140 + - 141 + - 116 + - 142 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap similarity index 81% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap index 6ff5a13d84..3b4465152e 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__sort_3.snap @@ -9,565 +9,565 @@ frames: - !Single name: - AA - target_id: 148 + target_id: 150 target_name: null - !Single name: - - _literal_142 + - _literal_144 - album_id - target_id: 149 + target_id: 151 target_name: null - !Single name: - - _literal_142 + - _literal_144 - genre_id - target_id: 150 + target_id: 152 target_name: null inputs: - - id: 142 - name: _literal_142 + - id: 144 + name: _literal_144 table: - default_db - - _literal_142 + - _literal_144 - - 1:87-94 - columns: - !Single name: - AA - target_id: 148 + target_id: 150 target_name: null - !Single name: - - _literal_142 + - _literal_144 - album_id - target_id: 149 + target_id: 151 target_name: null - !Single name: - - _literal_142 + - _literal_144 - genre_id - target_id: 150 + target_id: 152 target_name: null inputs: - - id: 142 - name: _literal_142 + - id: 144 + name: _literal_144 table: - default_db - - _literal_142 + - _literal_144 - - 1:95-158 - columns: - !Single name: - AA - target_id: 148 + target_id: 150 target_name: null - !Single name: - - _literal_142 + - _literal_144 - album_id - target_id: 149 + target_id: 151 target_name: null - !Single name: - - _literal_142 + - _literal_144 - genre_id - target_id: 150 + target_id: 152 target_name: null - !Single name: - - _literal_130 + - _literal_132 - album_id - target_id: 130 + target_id: 132 target_name: album_id - !Single name: - - _literal_130 + - _literal_132 - album_title - target_id: 130 + target_id: 132 target_name: album_title inputs: - - id: 142 - name: _literal_142 + - id: 144 + name: _literal_144 table: - default_db - - _literal_142 - - id: 130 - name: _literal_130 + - _literal_144 + - id: 132 + name: _literal_132 table: - default_db - - _literal_130 + - _literal_132 - - 1:159-213 - columns: - !Single name: - AA - target_id: 161 + target_id: 163 target_name: null - !Single name: - AT - target_id: 162 + target_id: 164 target_name: null - !Single name: - - _literal_142 + - _literal_144 - genre_id - target_id: 166 + target_id: 168 target_name: null inputs: - - id: 142 - name: _literal_142 + - id: 144 + name: _literal_144 table: - default_db - - _literal_142 - - id: 130 - name: _literal_130 + - _literal_144 + - id: 132 + name: _literal_132 table: - default_db - - _literal_130 + - _literal_132 - - 1:214-228 - columns: - !Single name: - AA - target_id: 161 + target_id: 163 target_name: null - !Single name: - AT - target_id: 162 + target_id: 164 target_name: null - !Single name: - - _literal_142 + - _literal_144 - genre_id - target_id: 166 + target_id: 168 target_name: null inputs: - - id: 142 - name: _literal_142 + - id: 144 + name: _literal_144 table: - default_db - - _literal_142 - - id: 130 - name: _literal_130 + - _literal_144 + - id: 132 + name: _literal_132 table: - default_db - - _literal_130 + - _literal_132 - - 1:229-291 - columns: - !Single name: - AA - target_id: 161 + target_id: 163 target_name: null - !Single name: - AT - target_id: 162 + target_id: 164 target_name: null - !Single name: - - _literal_142 + - _literal_144 - genre_id - target_id: 166 + target_id: 168 target_name: null - !Single name: - - _literal_117 + - _literal_119 - genre_id - target_id: 117 + target_id: 119 target_name: genre_id - !Single name: - - _literal_117 + - _literal_119 - genre_title - target_id: 117 + target_id: 119 target_name: genre_title inputs: - - id: 142 - name: _literal_142 + - id: 144 + name: _literal_144 table: - default_db - - _literal_142 - - id: 130 - name: _literal_130 + - _literal_144 + - id: 132 + name: _literal_132 table: - default_db - - _literal_130 - - id: 117 - name: _literal_117 + - _literal_132 + - id: 119 + name: _literal_119 table: - default_db - - _literal_117 + - _literal_119 - - 1:292-340 - columns: - !Single name: - AA - target_id: 179 + target_id: 181 target_name: null - !Single name: - AT - target_id: 180 + target_id: 182 target_name: null - !Single name: - GT - target_id: 181 + target_id: 183 target_name: null inputs: - - id: 142 - name: _literal_142 + - id: 144 + name: _literal_144 table: - default_db - - _literal_142 - - id: 130 - name: _literal_130 + - _literal_144 + - id: 132 + name: _literal_132 table: - default_db - - _literal_130 - - id: 117 - name: _literal_117 + - _literal_132 + - id: 119 + name: _literal_119 table: - default_db - - _literal_117 + - _literal_119 nodes: -- id: 117 +- id: 119 kind: Array span: 1:244-278 children: - - 118 - parent: 178 -- id: 118 + - 120 + parent: 180 +- id: 120 kind: Tuple span: 1:245-277 children: - - 119 - - 120 - parent: 117 -- id: 119 + - 121 + - 122 + parent: 119 +- id: 121 kind: Literal span: 1:255-256 alias: genre_id - parent: 118 -- id: 120 + parent: 120 +- id: 122 kind: Literal span: 1:270-276 alias: genre_title - parent: 118 -- id: 130 + parent: 120 +- id: 132 kind: Array span: 1:110-145 children: - - 131 - parent: 160 -- id: 131 + - 133 + parent: 162 +- id: 133 kind: Tuple span: 1:111-144 children: - - 132 - - 133 - parent: 130 -- id: 132 + - 134 + - 135 + parent: 132 +- id: 134 kind: Literal span: 1:121-122 alias: album_id - parent: 131 -- id: 133 + parent: 133 +- id: 135 kind: Literal span: 1:136-143 alias: album_title - parent: 131 -- id: 142 + parent: 133 +- id: 144 kind: Array span: 1:0-43 children: - - 143 - parent: 152 -- id: 143 + - 145 + parent: 154 +- id: 145 kind: Tuple span: 1:6-42 children: - - 144 - - 145 - 146 - parent: 142 -- id: 144 + - 147 + - 148 + parent: 144 +- id: 146 kind: Literal span: 1:16-17 alias: track_id - parent: 143 -- id: 145 + parent: 145 +- id: 147 kind: Literal span: 1:28-29 alias: album_id - parent: 143 -- id: 146 + parent: 145 +- id: 148 kind: Literal span: 1:40-41 alias: genre_id - parent: 143 -- id: 148 + parent: 145 +- id: 150 kind: Ident span: 1:56-64 alias: AA ident: !Ident - this - - _literal_142 + - _literal_144 - track_id targets: - - 142 - parent: 151 -- id: 149 + - 144 + parent: 153 +- id: 151 kind: Ident span: 1:66-74 ident: !Ident - this - - _literal_142 + - _literal_144 - album_id targets: - - 142 - parent: 151 -- id: 150 + - 144 + parent: 153 +- id: 152 kind: Ident span: 1:76-84 ident: !Ident - this - - _literal_142 + - _literal_144 - genre_id targets: - - 142 - parent: 151 -- id: 151 + - 144 + parent: 153 +- id: 153 kind: Tuple span: 1:51-86 children: - - 148 - - 149 - 150 - parent: 152 -- id: 152 + - 151 + - 152 + parent: 154 +- id: 154 kind: 'TransformCall: Select' span: 1:44-86 children: - - 142 - - 151 - parent: 155 -- id: 153 + - 144 + - 153 + parent: 157 +- id: 155 kind: Ident span: 1:92-94 ident: !Ident - this - AA targets: - - 148 - parent: 155 -- id: 155 + - 150 + parent: 157 +- id: 157 kind: 'TransformCall: Sort' span: 1:87-94 children: - - 152 - - 153 - parent: 160 -- id: 156 + - 154 + - 155 + parent: 162 +- id: 158 kind: RqOperator span: 1:147-157 targets: - - 158 - - 159 - parent: 160 -- id: 158 + - 160 + - 161 + parent: 162 +- id: 160 kind: Ident span: 1:149-157 ident: !Ident - this - - _literal_142 + - _literal_144 - album_id targets: - - 149 -- id: 159 + - 151 +- id: 161 kind: Ident span: 1:149-157 ident: !Ident - that - - _literal_130 + - _literal_132 - album_id targets: - - 130 -- id: 160 + - 132 +- id: 162 kind: 'TransformCall: Join' span: 1:95-158 children: - - 155 - - 130 - - 156 - parent: 168 -- id: 161 + - 157 + - 132 + - 158 + parent: 170 +- id: 163 kind: Ident span: 1:168-170 ident: !Ident - this - AA targets: - - 148 - parent: 167 -- id: 162 + - 150 + parent: 169 +- id: 164 kind: RqOperator span: 1:177-201 alias: AT targets: - - 164 - - 165 - parent: 167 -- id: 164 + - 166 + - 167 + parent: 169 +- id: 166 kind: Ident span: 1:177-188 ident: !Ident - this - - _literal_130 + - _literal_132 - album_title targets: - - 130 -- id: 165 + - 132 +- id: 167 kind: Literal span: 1:192-201 -- id: 166 +- id: 168 kind: Ident span: 1:203-211 ident: !Ident - this - - _literal_142 + - _literal_144 - genre_id targets: - - 150 - parent: 167 -- id: 167 + - 152 + parent: 169 +- id: 169 kind: Tuple span: 1:166-213 children: - - 161 - - 162 - - 166 - parent: 168 -- id: 168 + - 163 + - 164 + - 168 + parent: 170 +- id: 170 kind: 'TransformCall: Select' span: 1:159-213 children: - - 160 - - 167 - parent: 173 -- id: 169 + - 162 + - 169 + parent: 175 +- id: 171 kind: RqOperator span: 1:221-228 targets: - - 171 - - 172 - parent: 173 -- id: 171 + - 173 + - 174 + parent: 175 +- id: 173 kind: Ident span: 1:221-223 ident: !Ident - this - AA targets: - - 161 -- id: 172 + - 163 +- id: 174 kind: Literal span: 1:226-228 -- id: 173 +- id: 175 kind: 'TransformCall: Filter' span: 1:214-228 children: - - 168 - - 169 - parent: 178 -- id: 174 + - 170 + - 171 + parent: 180 +- id: 176 kind: RqOperator span: 1:280-290 targets: - - 176 - - 177 - parent: 178 -- id: 176 + - 178 + - 179 + parent: 180 +- id: 178 kind: Ident span: 1:282-290 ident: !Ident - this - - _literal_142 + - _literal_144 - genre_id targets: - - 166 -- id: 177 + - 168 +- id: 179 kind: Ident span: 1:282-290 ident: !Ident - that - - _literal_117 + - _literal_119 - genre_id targets: - - 117 -- id: 178 + - 119 +- id: 180 kind: 'TransformCall: Join' span: 1:229-291 children: - - 173 - - 117 - - 174 - parent: 186 -- id: 179 + - 175 + - 119 + - 176 + parent: 188 +- id: 181 kind: Ident span: 1:301-303 ident: !Ident - this - AA targets: - - 161 - parent: 185 -- id: 180 + - 163 + parent: 187 +- id: 182 kind: Ident span: 1:305-307 ident: !Ident - this - AT targets: - - 162 - parent: 185 -- id: 181 + - 164 + parent: 187 +- id: 183 kind: RqOperator span: 1:314-338 alias: GT targets: - - 183 - - 184 - parent: 185 -- id: 183 + - 185 + - 186 + parent: 187 +- id: 185 kind: Ident span: 1:314-325 ident: !Ident - this - - _literal_117 + - _literal_119 - genre_title targets: - - 117 -- id: 184 + - 119 +- id: 186 kind: Literal span: 1:329-338 -- id: 185 +- id: 187 kind: Tuple span: 1:299-340 children: - - 179 - - 180 - 181 - parent: 186 -- id: 186 + - 182 + - 183 + parent: 188 +- id: 188 kind: 'TransformCall: Select' span: 1:292-340 children: - - 178 - - 185 + - 180 + - 187 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__switch.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__switch.snap similarity index 93% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__switch.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__switch.snap index 2c09ec1d95..45387d65e7 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__switch.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__switch.snap @@ -7,10 +7,10 @@ frames: - - 1:101-118 - columns: - !All - input_id: 122 + input_id: 124 except: [] inputs: - - id: 122 + - id: 124 name: tracks table: - default_db @@ -20,10 +20,10 @@ frames: - !Single name: - display - target_id: 127 + target_id: 129 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db @@ -33,23 +33,23 @@ frames: - !Single name: - display - target_id: 127 + target_id: 129 target_name: null inputs: - - id: 122 + - id: 124 name: tracks table: - default_db - tracks nodes: -- id: 122 +- id: 124 kind: Ident span: 1:89-100 ident: !Ident - default_db - tracks - parent: 126 -- id: 124 + parent: 128 +- id: 126 kind: Ident span: 1:106-118 ident: !Ident @@ -57,34 +57,34 @@ nodes: - tracks - milliseconds targets: - - 122 - parent: 126 -- id: 126 + - 124 + parent: 128 +- id: 128 kind: 'TransformCall: Sort' span: 1:101-118 children: - - 122 - 124 - parent: 141 -- id: 127 + - 126 + parent: 143 +- id: 129 kind: Case span: 1:136-246 alias: display targets: - - 128 - - 132 - - 133 - - 137 - - 138 + - 130 + - 134 + - 135 - 139 - parent: 140 -- id: 128 + - 140 + - 141 + parent: 142 +- id: 130 kind: RqOperator span: 1:147-163 targets: - - 130 - - 131 -- id: 130 + - 132 + - 133 +- id: 132 kind: Ident span: 1:147-155 ident: !Ident @@ -92,11 +92,11 @@ nodes: - tracks - composer targets: - - 122 -- id: 131 + - 124 +- id: 133 kind: Literal span: 1:159-163 -- id: 132 +- id: 134 kind: Ident span: 1:167-175 ident: !Ident @@ -104,14 +104,14 @@ nodes: - tracks - composer targets: - - 122 -- id: 133 + - 124 +- id: 135 kind: RqOperator span: 1:181-194 targets: - - 135 - - 136 -- id: 135 + - 137 + - 138 +- id: 137 kind: Ident span: 1:181-189 ident: !Ident @@ -119,41 +119,41 @@ nodes: - tracks - genre_id targets: - - 122 -- id: 136 + - 124 +- id: 138 kind: Literal span: 1:192-194 -- id: 137 +- id: 139 kind: Literal span: 1:198-211 -- id: 138 +- id: 140 kind: Literal span: 1:217-221 -- id: 139 +- id: 141 kind: FString span: 1:225-244 -- id: 140 +- id: 142 kind: Tuple span: 1:136-246 children: - - 127 - parent: 141 -- id: 141 + - 129 + parent: 143 +- id: 143 kind: 'TransformCall: Select' span: 1:119-246 children: - - 126 - - 140 - parent: 143 -- id: 143 + - 128 + - 142 + parent: 145 +- id: 145 kind: 'TransformCall: Take' span: 1:247-254 children: - - 141 - - 144 -- id: 144 + - 143 + - 146 +- id: 146 kind: Literal - parent: 143 + parent: 145 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__take.snap similarity index 92% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__take.snap index 24281fa76f..3155ca37ba 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__take.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__take.snap @@ -7,10 +7,10 @@ frames: - - 1:25-41 - columns: - !All - input_id: 119 + input_id: 121 except: [] inputs: - - id: 119 + - id: 121 name: tracks table: - default_db @@ -18,23 +18,23 @@ frames: - - 1:42-51 - columns: - !All - input_id: 119 + input_id: 121 except: [] inputs: - - id: 119 + - id: 121 name: tracks table: - default_db - tracks nodes: -- id: 119 +- id: 121 kind: Ident span: 1:13-24 ident: !Ident - default_db - tracks - parent: 123 -- id: 121 + parent: 125 +- id: 123 kind: Ident span: 1:31-40 ident: !Ident @@ -42,32 +42,32 @@ nodes: - tracks - track_id targets: - - 119 - parent: 123 -- id: 123 + - 121 + parent: 125 +- id: 125 kind: 'TransformCall: Sort' span: 1:25-41 children: - - 119 - 121 - parent: 127 -- id: 124 + - 123 + parent: 129 +- id: 126 kind: Literal span: 1:47-48 alias: start - parent: 127 -- id: 125 + parent: 129 +- id: 127 kind: Literal span: 1:50-51 alias: end - parent: 127 -- id: 127 + parent: 129 +- id: 129 kind: 'TransformCall: Take' span: 1:42-51 children: - - 123 - - 124 - 125 + - 126 + - 127 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap similarity index 91% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap index 6b34a409e5..d9a041d7f7 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__text_module.snap @@ -10,55 +10,55 @@ frames: name: - albums - title - target_id: 124 + target_id: 126 target_name: null - !Single name: - title_and_spaces - target_id: 125 + target_id: 127 target_name: null - !Single name: - low - target_id: 127 + target_id: 129 target_name: null - !Single name: - up - target_id: 130 + target_id: 132 target_name: null - !Single name: - ltrimmed - target_id: 133 + target_id: 135 target_name: null - !Single name: - rtrimmed - target_id: 136 + target_id: 138 target_name: null - !Single name: - trimmed - target_id: 139 + target_id: 141 target_name: null - !Single name: - len - target_id: 142 + target_id: 144 target_name: null - !Single name: - subs - target_id: 145 + target_id: 147 target_name: null - !Single name: - replace - target_id: 151 + target_id: 153 target_name: null inputs: - - id: 122 + - id: 124 name: albums table: - default_db @@ -69,55 +69,55 @@ frames: name: - albums - title - target_id: 124 + target_id: 126 target_name: null - !Single name: - title_and_spaces - target_id: 125 + target_id: 127 target_name: null - !Single name: - low - target_id: 127 + target_id: 129 target_name: null - !Single name: - up - target_id: 130 + target_id: 132 target_name: null - !Single name: - ltrimmed - target_id: 133 + target_id: 135 target_name: null - !Single name: - rtrimmed - target_id: 136 + target_id: 138 target_name: null - !Single name: - trimmed - target_id: 139 + target_id: 141 target_name: null - !Single name: - len - target_id: 142 + target_id: 144 target_name: null - !Single name: - subs - target_id: 145 + target_id: 147 target_name: null - !Single name: - replace - target_id: 151 + target_id: 153 target_name: null inputs: - - id: 122 + - id: 124 name: albums table: - default_db @@ -128,68 +128,68 @@ frames: name: - albums - title - target_id: 124 + target_id: 126 target_name: null - !Single name: - title_and_spaces - target_id: 125 + target_id: 127 target_name: null - !Single name: - low - target_id: 127 + target_id: 129 target_name: null - !Single name: - up - target_id: 130 + target_id: 132 target_name: null - !Single name: - ltrimmed - target_id: 133 + target_id: 135 target_name: null - !Single name: - rtrimmed - target_id: 136 + target_id: 138 target_name: null - !Single name: - trimmed - target_id: 139 + target_id: 141 target_name: null - !Single name: - len - target_id: 142 + target_id: 144 target_name: null - !Single name: - subs - target_id: 145 + target_id: 147 target_name: null - !Single name: - replace - target_id: 151 + target_id: 153 target_name: null inputs: - - id: 122 + - id: 124 name: albums table: - default_db - albums nodes: -- id: 122 +- id: 124 kind: Ident span: 1:115-126 ident: !Ident - default_db - albums - parent: 158 -- id: 124 + parent: 160 +- id: 126 kind: Ident span: 1:140-145 ident: !Ident @@ -197,16 +197,16 @@ nodes: - albums - title targets: - - 122 - parent: 157 -- id: 125 + - 124 + parent: 159 +- id: 127 kind: FString span: 1:170-184 alias: title_and_spaces targets: - - 126 - parent: 157 -- id: 126 + - 128 + parent: 159 +- id: 128 kind: Ident span: 1:175-180 ident: !Ident @@ -214,15 +214,15 @@ nodes: - albums - title targets: - - 122 -- id: 127 + - 124 +- id: 129 kind: RqOperator span: 1:205-215 alias: low targets: - - 129 - parent: 157 -- id: 129 + - 131 + parent: 159 +- id: 131 kind: Ident span: 1:197-202 ident: !Ident @@ -230,15 +230,15 @@ nodes: - albums - title targets: - - 122 -- id: 130 + - 124 +- id: 132 kind: RqOperator span: 1:236-246 alias: up targets: - - 132 - parent: 157 -- id: 132 + - 134 + parent: 159 +- id: 134 kind: Ident span: 1:228-233 ident: !Ident @@ -246,15 +246,15 @@ nodes: - albums - title targets: - - 122 -- id: 133 + - 124 +- id: 135 kind: RqOperator span: 1:273-283 alias: ltrimmed targets: - - 135 - parent: 157 -- id: 135 + - 137 + parent: 159 +- id: 137 kind: Ident span: 1:265-270 ident: !Ident @@ -262,15 +262,15 @@ nodes: - albums - title targets: - - 122 -- id: 136 + - 124 +- id: 138 kind: RqOperator span: 1:310-320 alias: rtrimmed targets: - - 138 - parent: 157 -- id: 138 + - 140 + parent: 159 +- id: 140 kind: Ident span: 1:302-307 ident: !Ident @@ -278,15 +278,15 @@ nodes: - albums - title targets: - - 122 -- id: 139 + - 124 +- id: 141 kind: RqOperator span: 1:346-355 alias: trimmed targets: - - 141 - parent: 157 -- id: 141 + - 143 + parent: 159 +- id: 143 kind: Ident span: 1:338-343 ident: !Ident @@ -294,15 +294,15 @@ nodes: - albums - title targets: - - 122 -- id: 142 + - 124 +- id: 144 kind: RqOperator span: 1:377-388 alias: len targets: - - 144 - parent: 157 -- id: 144 + - 146 + parent: 159 +- id: 146 kind: Ident span: 1:369-374 ident: !Ident @@ -310,23 +310,23 @@ nodes: - albums - title targets: - - 122 -- id: 145 + - 124 +- id: 147 kind: RqOperator span: 1:411-427 alias: subs targets: - - 148 - - 149 - 150 - parent: 157 -- id: 148 + - 151 + - 152 + parent: 159 +- id: 150 kind: Literal span: 1:424-425 -- id: 149 +- id: 151 kind: Literal span: 1:426-427 -- id: 150 +- id: 152 kind: Ident span: 1:403-408 ident: !Ident @@ -334,23 +334,23 @@ nodes: - albums - title targets: - - 122 -- id: 151 + - 124 +- id: 153 kind: RqOperator span: 1:453-477 alias: replace targets: - - 154 - - 155 - 156 - parent: 157 -- id: 154 + - 157 + - 158 + parent: 159 +- id: 156 kind: Literal span: 1:466-470 -- id: 155 +- id: 157 kind: Literal span: 1:471-477 -- id: 156 +- id: 158 kind: Ident span: 1:445-450 ident: !Ident @@ -358,30 +358,30 @@ nodes: - albums - title targets: - - 122 -- id: 157 + - 124 +- id: 159 kind: Tuple span: 1:134-481 children: - - 124 - - 125 + - 126 - 127 - - 130 - - 133 - - 136 - - 139 - - 142 - - 145 - - 151 - parent: 158 -- id: 158 + - 129 + - 132 + - 135 + - 138 + - 141 + - 144 + - 147 + - 153 + parent: 160 +- id: 160 kind: 'TransformCall: Select' span: 1:127-481 children: - - 122 - - 157 - parent: 161 -- id: 159 + - 124 + - 159 + parent: 163 +- id: 161 kind: Ident span: 1:488-493 ident: !Ident @@ -389,38 +389,38 @@ nodes: - albums - title targets: - - 124 - parent: 161 -- id: 161 + - 126 + parent: 163 +- id: 163 kind: 'TransformCall: Sort' span: 1:482-494 children: - - 158 - - 159 - parent: 181 -- id: 162 + - 160 + - 161 + parent: 183 +- id: 164 kind: RqOperator span: 1:502-606 targets: - - 164 - - 176 - parent: 181 -- id: 164 + - 166 + - 178 + parent: 183 +- id: 166 kind: RqOperator span: 1:502-573 targets: - - 166 - - 171 -- id: 166 + - 168 + - 173 +- id: 168 kind: RqOperator span: 1:511-535 targets: - - 169 - - 170 -- id: 169 + - 171 + - 172 +- id: 171 kind: Literal span: 1:528-535 -- id: 170 +- id: 172 kind: Ident span: 1:503-508 ident: !Ident @@ -428,17 +428,17 @@ nodes: - albums - title targets: - - 124 -- id: 171 + - 126 +- id: 173 kind: RqOperator span: 1:549-572 targets: - - 174 - - 175 -- id: 174 + - 176 + - 177 +- id: 176 kind: Literal span: 1:563-572 -- id: 175 +- id: 177 kind: Ident span: 1:541-546 ident: !Ident @@ -446,17 +446,17 @@ nodes: - albums - title targets: - - 124 -- id: 176 + - 126 +- id: 178 kind: RqOperator span: 1:586-605 targets: - - 179 - - 180 -- id: 179 + - 181 + - 182 +- id: 181 kind: Literal span: 1:601-605 -- id: 180 +- id: 182 kind: Ident span: 1:578-583 ident: !Ident @@ -464,13 +464,13 @@ nodes: - albums - title targets: - - 124 -- id: 181 + - 126 +- id: 183 kind: 'TransformCall: Filter' span: 1:495-606 children: - - 161 - - 162 + - 163 + - 164 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__window.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__window.snap similarity index 91% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__window.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__window.snap index 7ebcfbaade..fe50146de1 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__debug_lineage__window.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__debug_lineage__window.snap @@ -7,26 +7,26 @@ frames: - - 1:521-614 - columns: - !All - input_id: 125 + input_id: 127 except: - genre_id - !Single name: - num - target_id: 163 + target_id: 165 target_name: null - !Single name: - total - target_id: 171 + target_id: 173 target_name: null - !Single name: - last_val - target_id: 173 + target_id: 175 target_name: null inputs: - - id: 125 + - id: 127 name: tracks table: - default_db @@ -37,29 +37,29 @@ frames: name: - tracks - genre_id - target_id: 127 + target_id: 129 target_name: null - !All - input_id: 125 + input_id: 127 except: - genre_id - !Single name: - num - target_id: 163 + target_id: 165 target_name: null - !Single name: - total - target_id: 171 + target_id: 173 target_name: null - !Single name: - last_val - target_id: 173 + target_id: 175 target_name: null inputs: - - id: 125 + - id: 127 name: tracks table: - default_db @@ -70,29 +70,29 @@ frames: name: - tracks - genre_id - target_id: 127 + target_id: 129 target_name: null - !All - input_id: 125 + input_id: 127 except: - genre_id - !Single name: - num - target_id: 163 + target_id: 165 target_name: null - !Single name: - total - target_id: 171 + target_id: 173 target_name: null - !Single name: - last_val - target_id: 173 + target_id: 175 target_name: null inputs: - - id: 125 + - id: 127 name: tracks table: - default_db @@ -103,31 +103,31 @@ frames: name: - tracks - track_id - target_id: 187 + target_id: 189 target_name: null - !Single name: - tracks - genre_id - target_id: 188 + target_id: 190 target_name: null - !Single name: - num - target_id: 189 + target_id: 191 target_name: null - !Single name: - total - target_id: 190 + target_id: 192 target_name: null - !Single name: - last_val - target_id: 191 + target_id: 193 target_name: null inputs: - - id: 125 + - id: 127 name: tracks table: - default_db @@ -138,44 +138,44 @@ frames: name: - tracks - track_id - target_id: 187 + target_id: 189 target_name: null - !Single name: - tracks - genre_id - target_id: 188 + target_id: 190 target_name: null - !Single name: - num - target_id: 189 + target_id: 191 target_name: null - !Single name: - total - target_id: 190 + target_id: 192 target_name: null - !Single name: - last_val - target_id: 191 + target_id: 193 target_name: null inputs: - - id: 125 + - id: 127 name: tracks table: - default_db - tracks nodes: -- id: 125 +- id: 127 kind: Ident span: 1:470-481 ident: !Ident - default_db - tracks - parent: 177 -- id: 127 + parent: 179 +- id: 129 kind: Ident span: 1:488-496 ident: !Ident @@ -183,14 +183,14 @@ nodes: - tracks - genre_id targets: - - 125 - parent: 136 -- id: 136 + - 127 + parent: 138 +- id: 138 kind: Tuple span: 1:488-496 children: - - 127 -- id: 155 + - 129 +- id: 157 kind: Ident span: 1:506-518 ident: !Ident @@ -198,33 +198,33 @@ nodes: - tracks - milliseconds targets: - - 125 -- id: 163 + - 127 +- id: 165 kind: RqOperator span: 1:540-555 alias: num targets: - - 164 - parent: 176 -- id: 164 + - 166 + parent: 178 +- id: 166 kind: Literal -- id: 171 +- id: 173 kind: RqOperator span: 1:569-579 alias: total targets: - - 172 - parent: 176 -- id: 172 + - 174 + parent: 178 +- id: 174 kind: Literal -- id: 173 +- id: 175 kind: RqOperator span: 1:596-609 alias: last_val targets: - - 175 - parent: 176 -- id: 175 + - 177 + parent: 178 +- id: 177 kind: Ident span: 1:601-609 ident: !Ident @@ -232,33 +232,33 @@ nodes: - tracks - track_id targets: - - 125 -- id: 176 + - 127 +- id: 178 kind: Tuple span: 1:528-614 children: - - 163 - - 171 + - 165 - 173 - parent: 177 -- id: 177 + - 175 + parent: 179 +- id: 179 kind: 'TransformCall: Derive' span: 1:521-614 children: - - 125 - - 176 - parent: 179 -- id: 179 + - 127 + - 178 + parent: 181 +- id: 181 kind: 'TransformCall: Take' span: 1:617-624 children: - - 177 - - 180 - parent: 186 -- id: 180 + - 179 + - 182 + parent: 188 +- id: 182 kind: Literal - parent: 179 -- id: 183 + parent: 181 +- id: 185 kind: Ident span: 1:633-641 ident: !Ident @@ -266,9 +266,9 @@ nodes: - tracks - genre_id targets: - - 127 - parent: 186 -- id: 184 + - 129 + parent: 188 +- id: 186 kind: Ident span: 1:643-655 ident: !Ident @@ -276,17 +276,17 @@ nodes: - tracks - milliseconds targets: - - 125 - parent: 186 -- id: 186 + - 127 + parent: 188 +- id: 188 kind: 'TransformCall: Sort' span: 1:627-656 children: - - 179 - - 183 - - 184 - parent: 193 -- id: 187 + - 181 + - 185 + - 186 + parent: 195 +- id: 189 kind: Ident span: 1:665-673 ident: !Ident @@ -294,9 +294,9 @@ nodes: - tracks - track_id targets: - - 125 - parent: 192 -- id: 188 + - 127 + parent: 194 +- id: 190 kind: Ident span: 1:675-683 ident: !Ident @@ -304,60 +304,60 @@ nodes: - tracks - genre_id targets: - - 127 - parent: 192 -- id: 189 + - 129 + parent: 194 +- id: 191 kind: Ident span: 1:685-688 ident: !Ident - this - num targets: - - 163 - parent: 192 -- id: 190 + - 165 + parent: 194 +- id: 192 kind: Ident span: 1:690-695 ident: !Ident - this - total targets: - - 171 - parent: 192 -- id: 191 + - 173 + parent: 194 +- id: 193 kind: Ident span: 1:697-705 ident: !Ident - this - last_val targets: - - 173 - parent: 192 -- id: 192 + - 175 + parent: 194 +- id: 194 kind: Tuple span: 1:664-706 children: - - 187 - - 188 - 189 - 190 - 191 - parent: 193 -- id: 193 + - 192 + - 193 + parent: 195 +- id: 195 kind: 'TransformCall: Select' span: 1:657-706 children: - - 186 - - 192 - parent: 198 -- id: 194 + - 188 + - 194 + parent: 200 +- id: 196 kind: RqOperator span: 1:714-728 targets: - - 196 - - 197 - parent: 198 -- id: 196 + - 198 + - 199 + parent: 200 +- id: 198 kind: Ident span: 1:714-722 ident: !Ident @@ -365,16 +365,16 @@ nodes: - tracks - genre_id targets: - - 188 -- id: 197 + - 190 +- id: 199 kind: Literal span: 1:726-728 -- id: 198 +- id: 200 kind: 'TransformCall: Filter' span: 1:707-728 children: - - 193 - - 194 + - 195 + - 196 ast: name: Project stmts: diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__aggregation.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__aggregation.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__aggregation.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__aggregation.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__append_select.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__append_select.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__append_select.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__append_select.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__append_select_compute.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__append_select_compute.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__append_select_compute.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__append_select_compute.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__append_select_multiple_with_null.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__append_select_multiple_with_null.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__append_select_multiple_with_null.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__append_select_multiple_with_null.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__append_select_nulls.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__append_select_nulls.snap similarity index 57% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__append_select_nulls.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__append_select_nulls.snap index 93ba65005e..9509e33fd5 100644 --- a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__append_select_nulls.snap +++ b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__append_select_nulls.snap @@ -1,6 +1,6 @@ --- source: prqlc/prqlc/tests/integration/queries.rs -expression: "# duckdb:skip\n# postgres:skip\n\nfrom invoices\nselect {an_id = invoice_id, name = null}\ntake 2\nappend (\n from employees\n select {an_id = null, name = first_name}\n take 2\n)\n" +expression: "from invoices\nselect {an_id = invoice_id, name = null}\ntake 2\nappend (\n from employees\n select {an_id = null, name = first_name}\n take 2\n)\n" input_file: prqlc/prqlc/tests/integration/queries/append_select_nulls.prql --- from invoices diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__append_select_simple.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__append_select_simple.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__append_select_simple.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__append_select_simple.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__arithmetic.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__arithmetic.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__arithmetic.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__arithmetic.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__cast.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__cast.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__cast.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__cast.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__constants_only.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__constants_only.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__constants_only.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__constants_only.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__date_to_text.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__date_to_text.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__date_to_text.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__date_to_text.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__distinct.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__distinct.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__distinct.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__distinct.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__distinct_on.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__distinct_on.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__distinct_on.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__distinct_on.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__genre_counts.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__genre_counts.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__genre_counts.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__genre_counts.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__group_all.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__group_all.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__group_all.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__group_all.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__group_sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__group_sort.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__group_sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__group_sort.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__group_sort_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__group_sort_derive_select_join.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__group_sort_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__group_sort_derive_select_join.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__group_sort_filter_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__group_sort_filter_derive_select_join.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__group_sort_filter_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__group_sort_filter_derive_select_join.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__group_sort_limit_take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__group_sort_limit_take.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__group_sort_limit_take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__group_sort_limit_take.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__invoice_totals.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__invoice_totals.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__invoice_totals.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__invoice_totals.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__loop_01.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__loop_01.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__loop_01.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__loop_01.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__math_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__math_module.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__math_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__math_module.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__pipelines.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__pipelines.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__pipelines.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__pipelines.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__read_csv.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__read_csv.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__read_csv.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__read_csv.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__set_ops_remove.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__set_ops_remove.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__set_ops_remove.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__set_ops_remove.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__sort.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__sort.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__sort_2.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__sort_2.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__sort_2.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__sort_2.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__sort_3.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__sort_3.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__sort_3.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__sort_3.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__switch.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__switch.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__switch.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__switch.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__take.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__take.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__text_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__text_module.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__text_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__text_module.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__window.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__window.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__fmt__window.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__fmt__window.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__aggregation.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__aggregation.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__aggregation.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__aggregation.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__append_select.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__append_select.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__append_select.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__append_select.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__append_select_compute.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__append_select_compute.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__append_select_compute.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__append_select_compute.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__append_select_multiple_with_null.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__append_select_multiple_with_null.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__append_select_multiple_with_null.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__append_select_multiple_with_null.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__append_select_nulls.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__append_select_nulls.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__append_select_nulls.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__append_select_nulls.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__append_select_simple.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__append_select_simple.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__append_select_simple.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__append_select_simple.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__arithmetic.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__arithmetic.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__arithmetic.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__arithmetic.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__cast.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__cast.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__cast.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__cast.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__constants_only.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__constants_only.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__constants_only.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__constants_only.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__date_to_text.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__date_to_text.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__date_to_text.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__date_to_text.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__distinct.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__distinct.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__distinct.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__distinct.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__distinct_on.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__distinct_on.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__distinct_on.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__distinct_on.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__genre_counts.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__genre_counts.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__genre_counts.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__genre_counts.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__group_all.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__group_all.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__group_all.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__group_all.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__group_sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__group_sort.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__group_sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__group_sort.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__group_sort_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__group_sort_derive_select_join.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__group_sort_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__group_sort_derive_select_join.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__group_sort_filter_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__group_sort_filter_derive_select_join.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__group_sort_filter_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__group_sort_filter_derive_select_join.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__group_sort_limit_take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__group_sort_limit_take.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__group_sort_limit_take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__group_sort_limit_take.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__invoice_totals.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__invoice_totals.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__invoice_totals.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__invoice_totals.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__loop_01.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__loop_01.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__loop_01.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__loop_01.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__math_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__math_module.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__math_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__math_module.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__pipelines.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__pipelines.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__pipelines.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__pipelines.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__read_csv.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__read_csv.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__read_csv.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__read_csv.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__set_ops_remove.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__set_ops_remove.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__set_ops_remove.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__set_ops_remove.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__sort.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__sort.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__sort_2.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__sort_2.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__sort_2.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__sort_2.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__sort_3.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__sort_3.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__sort_3.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__sort_3.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__switch.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__switch.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__switch.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__switch.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__take.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__take.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__text_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__text_module.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__text_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__text_module.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__window.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__window.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__lex__window.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__lex__window.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__aggregation.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__aggregation.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__aggregation.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__aggregation.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__append_select.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__append_select.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__append_select.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__append_select.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__append_select_compute.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__append_select_compute.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__append_select_compute.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__append_select_compute.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__append_select_multiple_with_null.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__append_select_multiple_with_null.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__append_select_multiple_with_null.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__append_select_multiple_with_null.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__append_select_nulls.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__append_select_nulls.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__append_select_nulls.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__append_select_nulls.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__append_select_simple.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__append_select_simple.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__append_select_simple.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__append_select_simple.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__arithmetic.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__arithmetic.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__arithmetic.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__arithmetic.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__cast.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__cast.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__cast.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__cast.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__constants_only.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__constants_only.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__constants_only.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__constants_only.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__date_to_text.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__date_to_text.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__date_to_text.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__date_to_text.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__distinct.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__distinct.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__distinct.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__distinct.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__distinct_on.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__distinct_on.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__distinct_on.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__distinct_on.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__genre_counts.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__genre_counts.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__genre_counts.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__genre_counts.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__group_all.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__group_all.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__group_all.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__group_all.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__group_sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__group_sort.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__group_sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__group_sort.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__group_sort_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__group_sort_derive_select_join.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__group_sort_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__group_sort_derive_select_join.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__group_sort_filter_derive_select_join.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__group_sort_filter_derive_select_join.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__group_sort_filter_derive_select_join.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__group_sort_filter_derive_select_join.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__group_sort_limit_take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__group_sort_limit_take.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__group_sort_limit_take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__group_sort_limit_take.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__invoice_totals.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__invoice_totals.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__invoice_totals.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__invoice_totals.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__loop_01.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__loop_01.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__loop_01.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__loop_01.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__math_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__math_module.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__math_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__math_module.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__pipelines.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__pipelines.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__pipelines.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__pipelines.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__read_csv.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__read_csv.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__read_csv.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__read_csv.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__set_ops_remove.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__set_ops_remove.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__set_ops_remove.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__set_ops_remove.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__sort.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__sort.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__sort.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__sort.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__sort_2.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__sort_2.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__sort_2.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__sort_2.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__sort_3.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__sort_3.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__sort_3.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__sort_3.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__switch.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__switch.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__switch.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__switch.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__take.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__take.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__take.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__take.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__text_module.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__text_module.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__text_module.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__text_module.snap diff --git a/prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__window.snap b/prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__window.snap similarity index 100% rename from prqlc-0.13.11/tests/integration/snapshots/integration__queries__results__window.snap rename to prqlc-0.13.12/tests/integration/snapshots/integration__queries__results__window.snap diff --git a/prqlc-0.13.11/tests/integration/sql.rs b/prqlc-0.13.12/tests/integration/sql.rs similarity index 93% rename from prqlc-0.13.11/tests/integration/sql.rs rename to prqlc-0.13.12/tests/integration/sql.rs index b46ba96460..d40bc4ff56 100644 --- a/prqlc-0.13.11/tests/integration/sql.rs +++ b/prqlc-0.13.12/tests/integration/sql.rs @@ -30,7 +30,7 @@ fn test_stdlib() { {salary_usd = min salary} ) "###).unwrap(), - @r" + @" SELECT MIN(salary) AS salary_usd FROM @@ -44,7 +44,7 @@ fn test_stdlib() { {salary_usd = (math.round 2 salary)} ) "###).unwrap(), - @r" + @" SELECT ROUND(salary, 2) AS salary_usd FROM @@ -78,7 +78,7 @@ fn test_stdlib_math_module() { salary_pow = (salary | math.pow 2), salary_pow_op = salary ** 2, } - "#).unwrap(), @r" + "#).unwrap(), @" SELECT ABS(salary) AS salary_abs, FLOOR(salary) AS salary_floor, @@ -131,7 +131,7 @@ fn test_stdlib_math_module_mssql() { salary_atan = math.atan salary, salary_pow = (salary | math.pow 2), } - "#).unwrap(), @r" + "#).unwrap(), @" SELECT ABS(salary) AS salary_abs, FLOOR(salary) AS salary_floor, @@ -174,7 +174,7 @@ fn test_stdlib_text_module() { name_contains = (name | text.contains "pika"), name_ends_with = (name | text.ends_with "pika"), } - "#).unwrap(), @r" + "#).unwrap(), @" SELECT LOWER(name) AS name_lower, UPPER(name) AS name_upper, @@ -240,6 +240,17 @@ FROM "employees" "# )] +#[case::oracle( + sql::Dialect::Oracle, + r#" +SELECT + "a", + "b", + "col space" +FROM + "employees" +"# +)] fn test_quoting_style(#[case] dialect: sql::Dialect, #[case] expected_sql: &'static str) { let query = r#" from employees @@ -288,6 +299,88 @@ FROM ) } +#[rstest] +#[case::generic(sql::Dialect::Generic, "DATEDIFF(day, date_col, date_col2)")] +#[case::duckdb(sql::Dialect::DuckDb, "datediff('day', date_col, date_col2)")] +#[case::mssql(sql::Dialect::MsSql, "DATEDIFF(day, date_col, date_col2)")] +#[case::mysql(sql::Dialect::MySql, "TIMESTAMPDIFF(day, date_col, date_col2)")] +#[case::clickhouse(sql::Dialect::ClickHouse, "dateDiff('day', date_col, date_col2)")] +#[case::bigquery(sql::Dialect::BigQuery, "DATE_DIFF(date_col2, date_col, day)")] +fn date_diff_operator(#[case] dialect: sql::Dialect, #[case] expected_date_diff: &'static str) { + let query = r#" + from t + select { + d = (date.diff day date_col date_col2) + }"#; + let expected = format!( + r#" +SELECT + {expected_date_diff} AS d +FROM + t +"# + ); + assert_eq!( + compile_with_sql_dialect(query, dialect).unwrap(), + expected.trim_start() + ) +} + +#[test] +fn date_diff_snowflake() { + // Snowflake quotes all identifiers + assert_snapshot!(compile_with_sql_dialect(r#" + from t + select { d = (date.diff day date_col date_col2) } + "#, sql::Dialect::Snowflake).unwrap(), @r#" + SELECT + DATEDIFF(day, "date_col", "date_col2") AS "d" + FROM + "t" + "#); +} + +#[test] +fn date_diff_literals() { + // date.diff with literal date values + assert_snapshot!(compile(r#" + from t + derive { diff = date.diff month @2021-01-01 @2021-06-30 } + "#).unwrap(), @" + SELECT + *, + DATEDIFF(month, DATE '2021-01-01', DATE '2021-06-30') AS diff + FROM + t + "); +} + +#[test] +fn date_diff_unsupported_dialects() { + // PostgreSQL has no standard DATEDIFF function + assert!(compile_with_sql_dialect( + "from t | derive { d = date.diff day date_a date_b }", + sql::Dialect::Postgres + ) + .is_err()); + // SQLite has no built-in date diff function + assert!(compile_with_sql_dialect( + "from t | derive { d = date.diff day date_a date_b }", + sql::Dialect::SQLite + ) + .is_err()); +} + +#[test] +fn date_trunc_unsupported_dialects() { + // SQLite has no DATE_TRUNC function + assert!(compile_with_sql_dialect( + r#"from events | select (event_time | date.trunc "day")"#, + sql::Dialect::SQLite + ) + .is_err()); +} + #[test] fn date_to_text_bigquery_rfc3339() { assert_snapshot!(compile(r#" @@ -309,6 +402,32 @@ fn date_to_text_bigquery_rfc3339() { "); } +#[rstest] +#[case::duckdb(sql::Dialect::DuckDb, "DATE_TRUNC('day', event_time)")] +#[case::postgres(sql::Dialect::Postgres, "DATE_TRUNC('day', event_time)")] +#[case::mssql(sql::Dialect::MsSql, "DATETRUNC(day, event_time)")] +#[case::mysql(sql::Dialect::MySql, "DATE_TRUNC('day', event_time)")] +#[case::bigquery(sql::Dialect::BigQuery, "DATE_TRUNC(event_time, DAY)")] +fn date_trunc_operator(#[case] dialect: sql::Dialect, #[case] expected_date_trunc: &'static str) { + let query = r#" + from events + select { + trunc_day = (event_time | date.trunc "day") + }"#; + let expected = format!( + r#" +SELECT + {expected_date_trunc} AS trunc_day +FROM + events +"# + ); + assert_eq!( + compile_with_sql_dialect(query, dialect).unwrap(), + expected.trim_start() + ) +} + #[test] fn json_of_test() { let pl = prqlc::prql_to_pl("from employees | take 10").unwrap(); @@ -330,7 +449,7 @@ fn test_precedence_division() { p3 = x / (y / z), # needs parentheses np4 = (x / y) / z, # doesn't need parentheses } - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, a - (b + c) AS p1, @@ -343,6 +462,24 @@ fn test_precedence_division() { "); } +#[test] +fn test_sqlite_integer_division() { + // Regression test: SQLite div_i formula must produce correct results + // when |dividend| < |divisor| (result should be 0). + // The old formula ROUND(ABS(l/r) - 0.5) * SIGN(l) * SIGN(r) was wrong + // because SQLite integer division gives 0 for |l| < |r|, and + // ROUND(ABS(0) - 0.5) = ROUND(-0.5) = -1 in SQLite. + assert_snapshot!(compile_with_sql_dialect(r#" + from t + select { x = a // b } + "#, sql::Dialect::SQLite).unwrap(), @" + SELECT + CAST(ABS(a * 1.0 / b) AS INTEGER) * SIGN(a) * SIGN(b) AS x + FROM + t + "); +} + #[test] fn test_precedence_01() { assert_snapshot!((compile(r###" @@ -353,7 +490,7 @@ fn test_precedence_01() { np1 = a + (b - c), # no parentheses np2 = (a + b) - c, # no parentheses } - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, a - (b + c) AS p1, @@ -374,7 +511,7 @@ fn test_precedence_02() { temp_f = temp_c * 9/5, temp_z = temp_x + 9 - 5, } - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, (temp_f - 32) / 1.8 AS temp_c, @@ -398,7 +535,7 @@ fn test_precedence_03() { result = c * sum_1 + sum_2, a * g } - "###).unwrap()), @r" + "###).unwrap()), @" SELECT c * (a + b) + a + b AS result, a * - a @@ -422,7 +559,7 @@ fn test_precedence_04() { is_not_null = !(a == null), (a + b) == null, } - "###).unwrap()), @r" + "###).unwrap()), @" SELECT a > 0 AS gtz, NOT a > 0 AS ltz, @@ -458,7 +595,7 @@ fn test_precedence_05() { -x, } "### - ).unwrap(), @r" + ).unwrap(), @" SELECT c - (a + b), c + a - b, @@ -499,7 +636,7 @@ fn test_append() { assert_snapshot!(compile(r###" from employees append managers - "###).unwrap(), @r" + "###).unwrap(), @" SELECT * FROM @@ -521,7 +658,7 @@ fn test_append() { select {name, cost = salary + bonuses} take 10 ) - "###).unwrap(), @r" + "###).unwrap(), @" SELECT * FROM @@ -556,7 +693,7 @@ fn test_append() { from employees union (from managers) - "###).unwrap(), @r" + "###).unwrap(), @" SELECT * FROM @@ -576,7 +713,7 @@ fn test_append() { from employees append managers union all_employees_of_some_other_company - "###).unwrap(), @r" + "###).unwrap(), @" SELECT * FROM @@ -602,7 +739,7 @@ fn test_remove_01() { from albums remove artists "#).unwrap(), - @r" + @" SELECT * FROM @@ -626,7 +763,7 @@ fn test_remove_02() { from artist | select artist_id ) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT artist_id @@ -656,7 +793,7 @@ fn test_remove_03() { from artist | select artist_id ) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT artist_id @@ -683,7 +820,7 @@ fn test_remove_04() { from album remove artist "#).unwrap_err(), - @r" + @" Error: The dialect SQLiteDialect does not support EXCEPT ALL ↳ Hint: providing more column information will allow the query to be translated to an anti-join. " @@ -702,7 +839,7 @@ fn test_remove_05() { select {artist_id, title} except (from artist | select {artist_id, name}) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT artist_id, @@ -735,7 +872,7 @@ fn test_remove_06() { from album except artist "#).unwrap(), - @r" + @" SELECT * FROM @@ -755,7 +892,7 @@ fn test_intersect_01() { from album intersect artist "#).unwrap(), - @r" + @" SELECT * FROM @@ -779,7 +916,7 @@ fn test_intersect_02() { from artist | select artist_id ) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT artist_id @@ -813,7 +950,7 @@ fn test_intersect_03() { ) distinct "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT artist_id @@ -852,7 +989,7 @@ fn test_intersect_04() { ) distinct "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT artist_id @@ -891,7 +1028,7 @@ fn test_intersect_05() { from artist | select artist_id ) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT artist_id @@ -920,7 +1057,7 @@ fn test_intersect_06() { from album intersect artist "#).unwrap_err(), - @r" + @" Error: The dialect SQLiteDialect does not support INTERSECT ALL ↳ Hint: providing more column information will allow the query to be translated to an anti-join. " @@ -934,7 +1071,7 @@ fn test_intersect_07() { join side:inner ds1 = bar.t2 (ds2.idx==ds1.idx) aggregate { count this } "#).unwrap(), - @r" + @" SELECT COUNT(*) FROM @@ -993,7 +1130,7 @@ fn test_sort_in_nested_join_with_extra_derive_and_select() { select {this.my_new_col, this.new_name, this.other_new_name} ) (this.id == that.my_new_col) "#).unwrap(), - @r" + @" WITH table_1 AS ( SELECT CONCAT('artist: ', name) AS my_new_col, @@ -1047,7 +1184,7 @@ fn test_sort_in_nested_append() { take 2 ) "#).unwrap(), - @r" + @" SELECT * FROM @@ -1097,7 +1234,7 @@ fn test_sort_select_redundant_cte() { ) from b "# - ).unwrap()), @r" + ).unwrap()), @" WITH a AS ( SELECT foo @@ -1127,7 +1264,7 @@ join side:left ( s"SELECT id, name FROM `artists`" ) (this.artist_id == that.id) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT album_id, @@ -1151,7 +1288,7 @@ join side:left ( FROM table_0 LEFT OUTER JOIN table_1 ON table_0.artist_id = table_1.id - " + " ) } @@ -1166,7 +1303,7 @@ fn test_rn_ids_are_unique() { group {x_id} ( take 3 ) - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_1 AS ( SELECT *, @@ -1242,7 +1379,7 @@ fn test_quoting_03() { from `schema.table` join `schema.table2` (==id) join c = `schema.t-able` (`schema.table`.id == c.id) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT `schema.table`.*, `schema.table2`.*, @@ -1288,7 +1425,7 @@ from `some_dataset.demo` select {`hash`} "; - assert_snapshot!(compile(prql).unwrap(), @r" + assert_snapshot!(compile(prql).unwrap(), @" SELECT `hash` FROM @@ -1302,7 +1439,7 @@ fn test_sorts_01() { from invoices sort {issued_at, -amount, +num_of_articles} "### - ).unwrap()), @r" + ).unwrap()), @" SELECT * FROM @@ -1319,7 +1456,7 @@ fn test_sorts_01() { sort {somefield} select {renamed = somefield} "# - ).unwrap()), @r" + ).unwrap()), @" WITH table_0 AS ( SELECT 'something' AS renamed, @@ -1382,7 +1519,7 @@ fn test_sorts_03() { select !{a.col} take 5 "# - ).unwrap()), @r" + ).unwrap()), @" WITH table_0 AS ( SELECT a.*, @@ -1412,7 +1549,7 @@ fn test_sort_before_aggregate() { sort a.col aggregate { result = sum a.col_to_agg } "# - ).unwrap()), @r" + ).unwrap()), @" SELECT COALESCE(SUM(col_to_agg), 0) AS result FROM @@ -1433,7 +1570,7 @@ fn test_numbers() { } "###; - assert_snapshot!((compile(query).unwrap()), @r" + assert_snapshot!((compile(query).unwrap()), @" SELECT 5.0000001 AS v, 5000 AS w, @@ -1455,7 +1592,7 @@ fn test_ranges() { far = (distance | in 100..), (country_founding | in @1776-07-04..@1787-09-17) } - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, distance <= 50 AS close, @@ -1475,7 +1612,7 @@ fn test_in_values_01() { filter (employee_id | in [1, 2, 5]) filter (f"{emp_group}.{role}" | in ["sales_ne.mgr", "sales_mw.mgr"]) filter (s"{metadata} ->> '$.location'" | in ["Northeast", "Midwest"]) - "#).unwrap()), @r" + "#).unwrap()), @" SELECT * FROM @@ -1533,7 +1670,7 @@ fn test_not_in_values() { assert_snapshot!((compile(r#" from employees filter !(title | in ["Sales Manager", "Sales Support Agent"]) - "#).unwrap()), @r" + "#).unwrap()), @" SELECT * FROM @@ -1548,7 +1685,7 @@ fn test_in_no_values() { assert_snapshot!((compile(r#" from employees filter (title | in []) - "#).unwrap()), @r" + "#).unwrap()), @" SELECT * FROM @@ -1563,7 +1700,7 @@ fn test_in_values_err_01() { assert_snapshot!((compile(r###" from employees derive { ng = ([1, 2] | in [3, 4]) } - "###).unwrap_err()), @r" + "###).unwrap_err()), @" Error: ╭─[ :3:29 ] │ @@ -1642,7 +1779,7 @@ fn test_dates() { time = @14:00, # datetime = @2011-02-01T10:00, } - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, DATE '2011-02-01' AS date, @@ -1660,7 +1797,7 @@ fn test_window_functions_00() { group last_name ( derive {count first_name} ) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, COUNT(*) OVER (PARTITION BY last_name) @@ -1695,7 +1832,7 @@ fn test_window_functions_02() { derive {num_books_last_week = lag 7 num_books} "#; - assert_snapshot!((compile(query).unwrap()), @r" + assert_snapshot!((compile(query).unwrap()), @" WITH table_0 AS ( SELECT TO_CHAR(co.order_date, '%Y-%m') AS order_month, @@ -1746,7 +1883,7 @@ fn test_window_functions_03() { ) "###; - assert_snapshot!((compile(query).unwrap()), @r" + assert_snapshot!((compile(query).unwrap()), @" SELECT *, LAG(num_orders, 7) OVER () AS last_week, @@ -1768,7 +1905,7 @@ fn test_window_functions_04() { derive {last_week = lag 7 num_orders} "###; - assert_snapshot!((compile(query).unwrap()), @r" + assert_snapshot!((compile(query).unwrap()), @" SELECT *, RANK() OVER (PARTITION BY month) AS total_month, @@ -1787,7 +1924,7 @@ fn test_window_functions_05() { group month (sort num_orders | window expanding:true (derive {rank day})) derive {num_orders_last_week = lag 7 num_orders} "###; - assert_snapshot!((compile(query).unwrap()), @r" + assert_snapshot!((compile(query).unwrap()), @" SELECT *, RANK() OVER ( @@ -1810,7 +1947,7 @@ fn test_window_functions_06() { group c ( derive {d = sum b} ) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, SUM(b) OVER () AS a, @@ -1827,7 +1964,7 @@ fn test_window_functions_07() { window expanding:true ( derive {running_total = sum b} ) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, SUM(b) OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS running_total @@ -1843,7 +1980,7 @@ fn test_window_functions_08() { window rolling:3 ( derive {last_three = sum b} ) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, SUM(b) OVER (ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) AS last_three @@ -1859,7 +1996,7 @@ fn test_window_functions_09() { window rows:0..4 ( derive {next_four_rows = sum b} ) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, SUM(b) OVER ( @@ -1879,7 +2016,7 @@ fn test_window_functions_10() { window range:-4..4 ( derive {next_four_days = sum b} ) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, SUM(b) OVER ( @@ -1899,7 +2036,7 @@ fn test_window_functions_11() { from employees sort age derive {num = row_number this} - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, ROW_NUMBER() OVER ( @@ -1924,7 +2061,7 @@ fn test_window_functions_12() { sort b derive {c = lag 1 a} ) - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT *, @@ -1950,7 +2087,7 @@ fn test_window_functions_12() { group b ( derive {c = lag 1 a} ) - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT LAG(a, 1) OVER () AS b, @@ -1978,7 +2115,7 @@ fn test_window_functions_13() { group {grp} ( window (derive {count = row_number this}) ) - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT *, @@ -2005,7 +2142,7 @@ fn test_window_single_item_range() { last_user = min user_id } ) - "###).unwrap(), @r" + "###).unwrap(), @" SELECT *, MIN(user_id) OVER ( @@ -2026,7 +2163,7 @@ fn test_name_resolving() { derive x = 5 select {y = 6, z = x + y + a} "###; - assert_snapshot!((compile(query).unwrap()), @r" + assert_snapshot!((compile(query).unwrap()), @" SELECT 6 AS y, 5 + 6 + a AS z @@ -2082,7 +2219,7 @@ fn test_filter() { assert_snapshot!((compile(r###" from employees filter age > 25 && age < 40 - "###).unwrap()), @r" + "###).unwrap()), @" SELECT * FROM @@ -2096,7 +2233,7 @@ fn test_filter() { from employees filter age > 25 filter age < 40 - "###).unwrap()), @r" + "###).unwrap()), @" SELECT * FROM @@ -2112,7 +2249,7 @@ fn test_nulls_01() { assert_snapshot!((compile(r###" from employees select amount = null - "###).unwrap()), @r" + "###).unwrap()), @" SELECT NULL AS amount FROM @@ -2126,7 +2263,7 @@ fn test_nulls_02() { assert_snapshot!((compile(r###" from employees derive amount = amount + 2 ?? 3 * 5 - "###).unwrap()), @r" + "###).unwrap()), @" SELECT *, COALESCE(amount + 2, 3 * 5) AS amount @@ -2141,7 +2278,7 @@ fn test_nulls_03() { assert_snapshot!((compile(r###" from employees filter first_name == null && null == last_name - "###).unwrap()), @r" + "###).unwrap()), @" SELECT * FROM @@ -2158,7 +2295,7 @@ fn test_nulls_04() { assert_snapshot!((compile(r###" from employees filter first_name != null && null != last_name - "###).unwrap()), @r" + "###).unwrap()), @" SELECT * FROM @@ -2174,7 +2311,7 @@ fn test_take_01() { assert_snapshot!((compile(r###" from employees take ..10 - "###).unwrap()), @r" + "###).unwrap()), @" SELECT * FROM @@ -2189,7 +2326,7 @@ fn test_take_02() { assert_snapshot!((compile(r###" from employees take 5..10 - "###).unwrap()), @r" + "###).unwrap()), @" SELECT * FROM @@ -2204,7 +2341,7 @@ fn test_take_03() { assert_snapshot!((compile(r###" from employees take 5.. - "###).unwrap()), @r" + "###).unwrap()), @" SELECT * FROM @@ -2217,7 +2354,7 @@ fn test_take_04() { assert_snapshot!((compile(r###" from employees take 5..5 - "###).unwrap()), @r" + "###).unwrap()), @" SELECT * FROM @@ -2234,7 +2371,7 @@ fn test_take_05() { from employees take 11..20 take 1..5 - "###).unwrap()), @r" + "###).unwrap()), @" SELECT * FROM @@ -2252,7 +2389,7 @@ fn test_take_06() { take 11..20 sort name take 1..5 - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT * @@ -2277,7 +2414,7 @@ fn test_take_07() { assert_snapshot!((compile(r###" from employees take 0..1 - "###).unwrap_err()), @r" + "###).unwrap_err()), @" Error: ╭─[ :3:5 ] │ @@ -2293,7 +2430,7 @@ fn test_take_08() { assert_snapshot!((compile(r###" from employees take (-1..) - "###).unwrap_err()), @r" + "###).unwrap_err()), @" Error: ╭─[ :3:5 ] │ @@ -2310,7 +2447,7 @@ fn test_take_09() { from employees select a take 5..5.6 - "###).unwrap_err()), @r" + "###).unwrap_err()), @" Error: ╭─[ :4:5 ] │ @@ -2326,7 +2463,7 @@ fn test_take_10() { assert_snapshot!((compile(r###" from employees take (-1) - "###).unwrap_err()), @r" + "###).unwrap_err()), @" Error: ╭─[ :3:5 ] │ @@ -2344,7 +2481,7 @@ fn test_take_mssql() { from tracks take 3..5 - "#).unwrap()), @r" + "#).unwrap()), @" SELECT * FROM @@ -2363,7 +2500,7 @@ fn test_take_mssql() { from tracks take ..5 - "#).unwrap()), @r" + "#).unwrap()), @" SELECT * FROM @@ -2382,7 +2519,7 @@ fn test_take_mssql() { from tracks take 3.. - "#).unwrap()), @r" + "#).unwrap()), @" SELECT * FROM @@ -2403,7 +2540,7 @@ fn test_mssql_distinct_fetch() { take 100 group {this.`District`} (take 1) select {this.`District`} - "#).unwrap()), @r###" + "#).unwrap()), @r#" SELECT DISTINCT "District" FROM @@ -2412,7 +2549,7 @@ fn test_mssql_distinct_fetch() { "District" OFFSET 0 ROWS FETCH FIRST 100 ROWS ONLY - "###); + "#); // Case 2: ExprWithAlias - uses the alias for ORDER BY assert_snapshot!((compile(r#" @@ -2422,7 +2559,7 @@ fn test_mssql_distinct_fetch() { take 100 group {d = this.`District`} (take 1) select {d} - "#).unwrap()), @r###" + "#).unwrap()), @r#" SELECT DISTINCT "District" AS d FROM @@ -2431,7 +2568,7 @@ fn test_mssql_distinct_fetch() { d OFFSET 0 ROWS FETCH FIRST 100 ROWS ONLY - "###); + "#); // Case 3: Multiple columns - uses first column for ORDER BY assert_snapshot!((compile(r#" @@ -2441,7 +2578,7 @@ fn test_mssql_distinct_fetch() { take 100 group {this.`A`, this.`B`} (take 1) select {this.`A`, this.`B`} - "#).unwrap()), @r###" + "#).unwrap()), @r#" SELECT DISTINCT "A", "B" @@ -2451,7 +2588,7 @@ fn test_mssql_distinct_fetch() { "A" OFFSET 0 ROWS FETCH FIRST 100 ROWS ONLY - "###); + "#); } #[test] @@ -2461,7 +2598,7 @@ fn test_distinct_01() { from employees derive {rn = row_number id} filter rn > 2 - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT *, @@ -2485,7 +2622,7 @@ fn test_distinct_02() { from employees select first_name group first_name (take 1) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT DISTINCT first_name FROM @@ -2500,7 +2637,7 @@ fn test_distinct_03() { from employees select {first_name, last_name} group {first_name, last_name} (take 1) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT DISTINCT first_name, last_name @@ -2515,7 +2652,7 @@ fn test_distinct_04() { assert_snapshot!((compile(r###" from employees group {first_name, last_name} (take 1) - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT *, @@ -2546,7 +2683,7 @@ fn test_distinct_06() { assert_snapshot!((compile(r###" from employees group department (take 3) - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT *, @@ -2567,7 +2704,7 @@ fn test_distinct_07() { assert_snapshot!((compile(r###" from employees group department (sort salary | take 2..3) - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT *, @@ -2592,7 +2729,7 @@ fn test_distinct_08() { assert_snapshot!((compile(r###" from employees group department (sort salary | take 4..4) - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT *, @@ -2622,7 +2759,7 @@ fn test_distinct_09() { take 1 ) sort billing_city - ").unwrap(), @r" + ").unwrap(), @" WITH table_0 AS ( SELECT billing_city, @@ -2653,7 +2790,7 @@ fn test_distinct_on_01() { sort age take 1 ) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT DISTINCT ON (department) * FROM @@ -2672,7 +2809,7 @@ fn test_distinct_on_02() { from x select {class, begins} group {begins} (take 1) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT DISTINCT ON (begins) begins, class @@ -2692,7 +2829,7 @@ fn test_distinct_on_03() { ) derive foo = 1 select foo - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT DISTINCT ON (col1) * @@ -2718,7 +2855,7 @@ fn test_distinct_on_04() { take 1 ) select {a.id, b.y} - "###).unwrap()), @r" + "###).unwrap()), @" SELECT DISTINCT ON (a.id) a.id, b.y @@ -2741,7 +2878,7 @@ fn test_group_take_n_01() { sort age take 2 ) - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT *, @@ -2772,7 +2909,7 @@ fn test_group_take_n_02() { sort age take 2.. ) - "###).unwrap()), @r" + "###).unwrap()), @" WITH table_0 AS ( SELECT *, @@ -2798,7 +2935,7 @@ fn test_join() { assert_snapshot!((compile(r###" from x join y (==id) - "###).unwrap()), @r" + "###).unwrap()), @" SELECT x.*, y.* @@ -2817,7 +2954,7 @@ fn test_join_side_literal() { from x join y (==id) side:my_side - "###).unwrap()), @r" + "###).unwrap()), @" SELECT x.*, y.* @@ -2834,7 +2971,7 @@ fn test_join_side_literal_err() { from x join y (==id) side:my_side - "###).unwrap_err()), @r" + "###).unwrap_err()), @" Error: ╭─[ :5:24 ] │ @@ -2854,7 +2991,7 @@ fn test_join_side_literal_via_func() { from x my_join default_db.y this.id s:"left" - "###).unwrap()), @r" + "###).unwrap()), @" SELECT x.*, y.* @@ -2904,7 +3041,7 @@ fn test_join_with_param_name_collision() { select { event_id = a.event_id, } - "###).unwrap()), @r" + "###).unwrap()), @" WITH a AS ( SELECT event_id, @@ -2977,7 +3114,7 @@ fn test_f_string() { assert_snapshot!( compile(query).unwrap(), - @r" + @" SELECT CONCAT( 'Hello my name is ', @@ -3000,7 +3137,7 @@ fn test_f_string() { .with_target(Target::Sql(Some(sql::Dialect::SQLite))) ).unwrap(), - @r" + @" SELECT 'Hello my name is ' || prefix || first_name || ' ' || last_name, 'and I am ' || year_born - now() || ' years old.' @@ -3024,7 +3161,7 @@ fn test_sql_of_ast_1() { let sql = compile(query).unwrap(); assert_snapshot!(sql, - @r" + @" SELECT title, country, @@ -3050,7 +3187,7 @@ fn test_sql_of_ast_02() { from employees aggregate sum_salary = s"sum({salary})" filter sum_salary > 100 - "#).unwrap(), @r" + "#).unwrap(), @" SELECT sum(salary) AS sum_salary FROM @@ -3075,7 +3212,7 @@ fn test_bare_s_string() { let sql = compile(query).unwrap(); assert_snapshot!(sql, - @r" + @" WITH table_0 AS ( SELECT SUM(a) @@ -3099,7 +3236,7 @@ fn test_bare_s_string_01() { let a = s"select insensitive from rude" from a "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT insensitive @@ -3121,7 +3258,7 @@ fn test_bare_s_string_02() { let a = s"sElEcT insensitive from rude" from a "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT insensitive @@ -3147,7 +3284,7 @@ fn test_bare_s_string_03() { bar" from a - "#).unwrap(), @r" + "#).unwrap(), @" WITH table_0 AS ( SELECT foo @@ -3165,7 +3302,7 @@ fn test_bare_s_string_03() { fn test_bare_s_string_04() { assert_snapshot!(compile(r#" s"SELECTTfoo" - "#).unwrap_err(), @r" + "#).unwrap_err(), @" Error: s-strings representing a table must start with `SELECT ` ↳ Hint: this is a limitation by current compiler implementation "); @@ -3181,7 +3318,7 @@ fn test_table_definition_with_expr_call() { let sql = compile(query).unwrap(); assert_snapshot!(sql, - @r" + @" WITH e AS ( SELECT * @@ -3206,7 +3343,7 @@ fn test_prql_to_sql_1() { count salary, sum salary, } - "#).unwrap(), @r" + "#).unwrap(), @" SELECT COUNT(*), COALESCE(SUM(salary), 0) @@ -3222,7 +3359,7 @@ fn test_prql_to_sql_1() { skill_width = count_distinct specialty, } ) - "#).unwrap(), @r" + "#).unwrap(), @" SELECT team, COUNT(DISTINCT specialty) AS skill_width @@ -3376,7 +3513,7 @@ fn test_nonatomic() { sort sum_gross_cost "#; - assert_snapshot!((compile(query).unwrap()), @r" + assert_snapshot!((compile(query).unwrap()), @" WITH table_1 AS ( SELECT title, @@ -3424,7 +3561,7 @@ fn test_nonatomic() { filter sum_gross_cost > 0 "###; - assert_snapshot!((compile(query).unwrap()), @r" + assert_snapshot!((compile(query).unwrap()), @" SELECT title, country, @@ -3456,7 +3593,7 @@ fn test_nonatomic_table() { select {name, salary, average_country_salary} "#; - assert_snapshot!((compile(query).unwrap()), @r" + assert_snapshot!((compile(query).unwrap()), @" WITH table_0 AS ( SELECT country @@ -3492,7 +3629,7 @@ fn test_table_names_between_splits_01() { derive emp_no = employees.emp_no join s = salaries (==emp_no) select {employees.emp_no, d.name, s.salary} - "###).unwrap(), @r" + "###).unwrap(), @" WITH table_0 AS ( SELECT employees.emp_no, @@ -3520,7 +3657,7 @@ fn test_table_names_between_splits_02() { take 10 join salaries (==emp_no) select {e.*, salaries.salary} - "###).unwrap(), @r" + "###).unwrap(), @" WITH table_0 AS ( SELECT * @@ -3549,7 +3686,7 @@ fn test_table_alias_01() { } ) select {emp_no, emp_salary} - "###).unwrap()), @r" + "###).unwrap()), @" SELECT e.emp_no, AVG(salaries.salary) AS emp_salary @@ -3567,7 +3704,7 @@ fn test_table_alias_02() { from e = employees select e.first_name filter e.first_name == "Fred" - "#).unwrap()), @r" + "#).unwrap()), @" SELECT first_name FROM @@ -3628,7 +3765,7 @@ fn test_targets() { take 3 "###; - assert_snapshot!((compile(query).unwrap()), @r" + assert_snapshot!((compile(query).unwrap()), @" SELECT `FirstName`, `last name` @@ -3648,7 +3785,7 @@ fn test_target_clickhouse() { derive {event_type_dotted = `event.type`} "###; - assert_snapshot!((compile(query).unwrap()), @r" + assert_snapshot!((compile(query).unwrap()), @" SELECT *, `event.type` AS event_type_dotted @@ -3701,7 +3838,7 @@ fn test_literal() { let sql = compile(query).unwrap(); assert_snapshot!(sql, - @r" + @" SELECT *, true AS always_true @@ -3730,7 +3867,7 @@ join y (foo == only_in_x) "###; assert_snapshot!(compile(query).unwrap(), - @r" + @" WITH x AS ( SELECT foo AS only_in_x @@ -3780,7 +3917,7 @@ fn test_double_aggregate() { } ) "###).unwrap(), - @r" + @" SELECT type, COALESCE(SUM(amount), 0) AS total_amt, @@ -3806,7 +3943,7 @@ fn test_window_function_coalesce() { } ) "###).unwrap(), - @r" + @" SELECT SUM(a) OVER () AS cumsum_a, SUM(a) OVER () AS cumsum_b @@ -3828,7 +3965,7 @@ fn test_casting() { e = (a | as float) / 10, } "###).unwrap(), - @r" + @" SELECT a, CAST(a AS int) + 10 AS b, @@ -3856,7 +3993,7 @@ fn test_toposort() { from b "###).unwrap(), - @r" + @" WITH b AS ( SELECT * @@ -3880,7 +4017,7 @@ fn test_inline_tables() { ) join s = (from salaries | select {emp_id, salary}) (==emp_id) "###).unwrap(), - @r" + @" WITH table_0 AS ( SELECT emp_id, @@ -3912,7 +4049,7 @@ fn test_filter_and_select_unchanged_alias() { filter account.name != null select {name = account.name} "###).unwrap(), - @r" + @" SELECT name FROM @@ -3931,7 +4068,7 @@ fn test_filter_and_select_changed_alias() { filter account.name != null select {renamed_name = account.name} "###).unwrap(), - @r" + @" SELECT name AS renamed_name FROM @@ -3947,7 +4084,7 @@ fn test_filter_and_select_changed_alias() { filter name != "Bob" select name = name ?? "Default" "#).unwrap(), - @r" + @" SELECT COALESCE(name, 'Default') AS name FROM @@ -3964,7 +4101,7 @@ fn test_unused_alias() { assert_snapshot!(compile(r###" from account select n = {account.name} - "###).unwrap_err(), @r" + "###).unwrap_err(), @" Error: ╭─[ :3:16 ] │ @@ -3982,7 +4119,7 @@ fn test_table_s_string_01() { assert_snapshot!(compile(r#" let main = s"SELECT DISTINCT ON first_name, age FROM employees ORDER BY age ASC" "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT DISTINCT ON first_name, @@ -4007,7 +4144,7 @@ fn test_table_s_string_02() { """ join s = s"SELECT * FROM salaries" (==id) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT DISTINCT ON first_name, @@ -4039,7 +4176,7 @@ fn test_table_s_string_03() { s"""SELECT * FROM employees""" filter country == "USA" "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT * @@ -4062,7 +4199,7 @@ fn test_table_s_string_04() { select {e = this} filter e.country == "USA" "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT * @@ -4086,7 +4223,7 @@ fn test_table_s_string_05() { weeks_between @2022-06-03 (current_week + 4) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT generate_series( @@ -4107,7 +4244,7 @@ fn test_table_s_string_06() { assert_snapshot!(compile(r#" s"SELECT * FROM {default_db.x}" "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT * @@ -4148,7 +4285,7 @@ fn test_direct_table_references() { select x "###, ) - .unwrap(), @r" + .unwrap(), @" SELECT * FROM @@ -4167,7 +4304,7 @@ fn test_table_variable_in_scalar_context() { filter actor_id == mod_id "#, ) - .unwrap_err(), @r#" + .unwrap_err(), @" Error: ╭─[ :5:24 ] │ @@ -4177,7 +4314,7 @@ fn test_table_variable_in_scalar_context() { │ │ Help: use a join instead, or inline the subquery ───╯ - "#); + "); } #[test] @@ -4187,7 +4324,7 @@ fn test_name_shadowing() { from x select {a, a, a = a + 1} "###).unwrap(), - @r" + @" SELECT a AS _expr_0, a + 1 AS a @@ -4204,7 +4341,7 @@ fn test_name_shadowing() { derive a = a + 1 derive a = a + 2 "###).unwrap(), - @r" + @" SELECT a AS _expr_0, a + 1, @@ -4229,7 +4366,7 @@ fn test_group_all() { r###" from e=albums group !{genre_id} (aggregate {count this}) - "###).unwrap_err(), @"Error: Excluding columns not supported as this position"); + "###).unwrap_err(), @"Error: Excluding columns not supported in this position"); } #[test] @@ -4241,7 +4378,7 @@ fn test_output_column_deduplication() { derive r = s"RANK() OVER ()" filter r == 1 "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT *, @@ -4269,7 +4406,7 @@ fn test_case_01() { true => f'{first_name} {last_name}' ] "###).unwrap(), - @r" + @" SELECT *, CASE @@ -4292,7 +4429,7 @@ fn test_case_02() { first_name != null => f'{first_name} {last_name}' ] "###).unwrap(), - @r" + @" SELECT *, CASE @@ -4316,7 +4453,7 @@ fn test_case_03() { ] group category (aggregate {count this}) "###).unwrap(), - @r" + @" WITH table_0 AS ( SELECT CASE @@ -4374,7 +4511,7 @@ fn test_static_analysis() { ], } "###).unwrap(), - @r" + @" SELECT 3 AS a, false AS b, @@ -4403,7 +4540,7 @@ fn test_closures_and_pipelines() { arg "citrus" ) "#).unwrap(), - @r" + @" SELECT 'apples' || 'bananas' || 'citrus' AS x FROM @@ -4421,7 +4558,7 @@ fn test_basic_agg() { count this, } "#).unwrap(), - @r" + @" SELECT COUNT(*), COUNT(*) @@ -4438,7 +4575,7 @@ fn test_exclude_columns_01() { select {track_id, title, composer, bytes} select !{title, composer} "#).unwrap(), - @r" + @" SELECT track_id, bytes @@ -4455,7 +4592,7 @@ fn test_exclude_columns_02() { select {track_id, title, composer, bytes} group !{title, composer} (aggregate {count this}) "#).unwrap(), - @r" + @" SELECT track_id, bytes, @@ -4476,7 +4613,7 @@ fn test_exclude_columns_03() { derive nick = name select !{artists.*} "#).unwrap(), - @r" + @" SELECT name AS nick FROM @@ -4492,7 +4629,7 @@ fn test_exclude_columns_04() { from tracks select !{milliseconds,bytes} "#).unwrap(), - @r" + @" SELECT * EXCEPT (milliseconds, bytes) FROM @@ -4524,7 +4661,7 @@ fn test_exclude_columns_06() { from tracks select !{milliseconds,bytes} "#).unwrap(), - @r" + @" SELECT * EXCLUDE (milliseconds, bytes) FROM @@ -4540,7 +4677,7 @@ fn test_exclude_columns_07() { from s"SELECT * FROM foo" select !{bar} "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT * @@ -4567,7 +4704,7 @@ fn test_custom_transforms() { my_transform take 3 "#).unwrap(), - @r" + @" SELECT *, single * 2 AS double @@ -4588,7 +4725,7 @@ fn test_name_inference() { select {artist_id + album_id} # nothing inferred infer "#).unwrap(), - @r" + @" SELECT artist_id + album_id FROM @@ -4616,7 +4753,7 @@ fn test_name_inference() { assert_snapshot!( sql1, - @r" + @" SELECT artist_id FROM @@ -4635,7 +4772,7 @@ a,b,c """ select {b, c} "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT '1' AS a, @@ -4665,7 +4802,7 @@ fn test_from_text_02() { ''' select {b, c} "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT 1 AS a, @@ -4699,7 +4836,7 @@ fn test_from_text_03() { }''' select {b, c} "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT 1 AS a, @@ -4726,7 +4863,7 @@ fn test_from_text_04() { assert_snapshot!(compile(r#" std.from_text 'a,b' "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT NULL AS a, @@ -4748,7 +4885,7 @@ fn test_from_text_05() { assert_snapshot!(compile(r#" std.from_text format:json '''{"columns": ["a", "b", "c"], "data": []}''' "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT NULL AS a, @@ -4772,7 +4909,7 @@ fn test_from_text_06() { assert_snapshot!(compile(r#" std.from_text '' "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT NULL @@ -4792,7 +4929,7 @@ fn test_from_text_07() { assert_snapshot!(compile(r#" std.from_text format:json '''{"columns": [], "data": [[], []]}''' "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT UNION @@ -4822,7 +4959,7 @@ fn test_header() { from a take 5 - "#).as_str()).unwrap(),@r" + "#).as_str()).unwrap(),@" SELECT * FROM @@ -4859,7 +4996,7 @@ fn test_header_target_error() { assert_snapshot!(compile(r#" prql dialect:foo.bar from a - "#).unwrap_err(),@r" + "#).unwrap_err(),@" Error: ╭─[ :1:1 ] │ @@ -4876,7 +5013,7 @@ fn shortest_prql_version() { let mut escape_version = insta::Settings::new(); escape_version.add_filter(r"'.*'", "[VERSION]"); escape_version.bind(|| { - assert_snapshot!(compile(r#"[{version = prql.version}]"#).unwrap(),@r" + assert_snapshot!(compile(r#"[{version = prql.version}]"#).unwrap(),@" WITH table_0 AS ( SELECT [VERSION] AS version @@ -4890,7 +5027,7 @@ fn shortest_prql_version() { assert_snapshot!(compile(r#" from x derive y = std.prql.version - "#).unwrap(),@r" + "#).unwrap(),@" SELECT *, [VERSION] AS y @@ -4912,7 +5049,7 @@ fn test_loop() { select n = n * 2 take 4 "#).unwrap(), - @r" + @" WITH RECURSIVE table_0 AS ( SELECT 1 AS n @@ -4956,7 +5093,7 @@ fn test_loop_2() { select manager.* ) "#).unwrap(), - @r" + @" WITH RECURSIVE table_0 AS ( SELECT * @@ -4998,7 +5135,7 @@ fn test_params() { } filter i.total > $3 "#).unwrap(), - @r" + @" SELECT id, total @@ -5024,7 +5161,7 @@ fn test_datetime() { assert_snapshot!( compile(query).unwrap(), - @r" + @" SELECT DATE '2022-12-31' AS date, TIME '08:30' AS time, @@ -5053,7 +5190,7 @@ fn test_datetime_sqlite() { timestamp3 = @2021-03-14T03:05+08:00, } "#).unwrap(), - @r" + @" SELECT DATE('2022-12-31') AS date, TIME('08:30') AS time, @@ -5074,7 +5211,7 @@ fn test_datetime_parsing() { from test_tables select {date = @2022-12-31, time = @08:30, timestamp = @2020-01-01T13:19:55-0800} "#).unwrap(), - @r" + @" SELECT DATE '2022-12-31' AS date, TIME '08:30' AS time, @@ -5085,13 +5222,66 @@ fn test_datetime_parsing() { ); } +#[test] +fn test_now() { + assert_snapshot!(compile(r#" + from test_tables + filter test_time < date.now + "#).unwrap(), @" + SELECT + * + FROM + test_tables + WHERE + test_time < CURRENT_TIMESTAMP + "); + // MySQL uses NOW() + assert_snapshot!(compile(r#" + prql target:sql.mysql + from test_tables + filter test_time < date.now + "#).unwrap(), @" + SELECT + * + FROM + test_tables + WHERE + test_time < NOW() + "); + // BigQuery uses CURRENT_TIMESTAMP() + assert_snapshot!(compile(r#" + prql target:sql.bigquery + from test_tables + filter test_time < date.now + "#).unwrap(), @" + SELECT + * + FROM + test_tables + WHERE + test_time < CURRENT_TIMESTAMP() + "); + // Clickhouse uses now() + assert_snapshot!(compile(r#" + prql target:sql.clickhouse + from test_tables + filter test_time < date.now + "#).unwrap(), @" + SELECT + * + FROM + test_tables + WHERE + test_time < now() + "); +} #[test] fn test_lower() { assert_snapshot!(compile(r#" from test_tables derive {lower_name = (name | text.lower)} "#).unwrap(), - @r" + @" SELECT *, LOWER(name) AS lower_name @@ -5108,7 +5298,7 @@ fn test_upper() { derive {upper_name = text.upper name} select {upper_name} "#).unwrap(), - @r" + @" SELECT UPPER(name) AS upper_name FROM @@ -5122,7 +5312,7 @@ fn test_1535() { assert_snapshot!(compile(r#" from x.y.z "#).unwrap(), - @r" + @" SELECT * FROM @@ -5137,7 +5327,7 @@ fn test_read_parquet_duckdb() { std.read_parquet 'x.parquet' join (std.read_parquet "y.parquet") (==foo) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT * @@ -5167,7 +5357,7 @@ fn test_read_parquet_with_named_args() { assert_snapshot!(compile_with_sql_dialect(r#" std.read_parquet 'data.parquet' union_by_name:true "#, sql::Dialect::DuckDb).unwrap(), - @r" + @" WITH table_0 AS ( SELECT * @@ -5190,7 +5380,7 @@ fn test_read_parquet_with_named_args() { assert_snapshot!(compile_with_sql_dialect(r#" std.read_parquet 'data.parquet' union_by_name:true binary_as_string:true "#, sql::Dialect::DuckDb).unwrap(), - @r" + @" WITH table_0 AS ( SELECT * @@ -5216,7 +5406,7 @@ fn test_read_json_duckdb() { assert_snapshot!(compile_with_sql_dialect(r#" from (read_json 'data.json') "#, sql::Dialect::DuckDb).unwrap(), - @r" + @" WITH table_0 AS ( SELECT * @@ -5236,7 +5426,7 @@ fn test_read_json_clickhouse() { assert_snapshot!(compile_with_sql_dialect(r#" from (read_json 'data.json') "#, sql::Dialect::ClickHouse).unwrap(), - @r" + @" WITH table_0 AS ( SELECT * @@ -5256,7 +5446,7 @@ fn test_read_json_generic() { assert_snapshot!(compile(r#" from (read_json 'data.json') "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT * @@ -5280,7 +5470,7 @@ fn test_excess_columns() { sort d select {title} "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT title, @@ -5320,7 +5510,7 @@ fn test_intervals() { from foo select dt = 1years + 1months + 1weeks + 1days + 1hours + 1minutes + 1seconds + 1milliseconds + 1microseconds "#).unwrap(), - @r" + @" SELECT INTERVAL 1 YEAR + INTERVAL 1 MONTH + INTERVAL 1 WEEK + INTERVAL 1 DAY + INTERVAL 1 HOUR + INTERVAL 1 MINUTE + INTERVAL 1 SECOND + INTERVAL 1 MILLISECOND + INTERVAL 1 MICROSECOND AS dt FROM @@ -5338,7 +5528,7 @@ fn test_into() { from table_a select {x, y} "#).unwrap(), - @r" + @" WITH table_a AS ( SELECT * @@ -5373,7 +5563,7 @@ fn test_array_01() { let main = (my_relation | filter b) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT 3 AS a, @@ -5418,7 +5608,7 @@ fn test_array_02() { passing_as_arg = x [1,2,3], nested = ['a', ['b']] } - "###).unwrap(), @r" + "###).unwrap(), @" WITH table_0 AS ( SELECT NULL AS a @@ -5449,7 +5639,7 @@ fn test_array_03() { from employees select {e = this} select [e.first_name, e.last_name] - "###).unwrap(), @r" + "###).unwrap(), @" SELECT [first_name, last_name] FROM @@ -5465,7 +5655,7 @@ fn test_double_stars() { take 5 filter (tb2.c3 < 100) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT tb1.*, @@ -5493,7 +5683,7 @@ fn test_double_stars() { take 5 filter (tb2.c3 < 100) "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT tb1.*, @@ -5526,7 +5716,7 @@ fn test_lineage() { """ derive a = a "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT ' 1' AS a @@ -5554,7 +5744,7 @@ fn test_lineage() { }""" derive a = a + 1 "#).unwrap(), - @r" + @" WITH table_0 AS ( SELECT 1 AS a @@ -5579,7 +5769,7 @@ fn test_type_as_column_name() { from foo f"#) - .unwrap(), @r" + .unwrap(), @" SELECT date FROM @@ -5637,7 +5827,7 @@ fn test_returning_constants_only() { select {d = 10} "###, ) - .unwrap(), @r" + .unwrap(), @" WITH table_0 AS ( SELECT 10 AS d, @@ -5663,7 +5853,7 @@ fn test_returning_constants_only() { select d = 10 "###, ) - .unwrap(), @r" + .unwrap(), @" WITH table_1 AS ( SELECT NULL @@ -5705,7 +5895,7 @@ fn test_conflicting_names_at_split() { } "#, ) - .unwrap(), @r" + .unwrap(), @" WITH table_0 AS ( SELECT wp.id, @@ -5762,7 +5952,7 @@ fn test_relation_var_name_clashes_01() { filter x > 0 "###, ) - .unwrap(), @r" + .unwrap(), @" WITH table_0 AS ( SELECT * @@ -5795,7 +5985,7 @@ fn test_relation_var_name_clashes_02() { join t (==x) "###, ) - .unwrap(), @r" + .unwrap(), @" SELECT t.*, table_0.* @@ -5859,7 +6049,7 @@ fn test_select_repeated_and_derived() { derive {cccc8 = 0,cccc9 = 0,cccc10 = 0} "###, ) - .unwrap(), @r###" + .unwrap(), @" WITH table_0 AS ( SELECT c2 AS _expr_0 @@ -5881,7 +6071,7 @@ fn test_select_repeated_and_derived() { 0 AS cccc10 FROM table_0 - "###); + "); } #[test] @@ -5893,7 +6083,7 @@ fn test_group_exclude() { group {a} (derive c = a + 1) "###, ) - .unwrap_err(), @r" + .unwrap_err(), @" Error: ╭─[ :4:27 ] │ @@ -5936,7 +6126,7 @@ fn test_table_declarations() { from my_schema.my_table | join another_table (==id) | take 10 "###, ) - .unwrap(), @r" + .unwrap(), @" SELECT my_table.id, my_table.a, @@ -5959,7 +6149,7 @@ fn test_param_declarations() { from x | filter b == a "###, ) - .unwrap(), @r" + .unwrap(), @" SELECT * FROM @@ -5976,7 +6166,7 @@ fn test_relation_aliasing() { from x | select {y = this} | select {y.hello} "###, ) - .unwrap(), @r" + .unwrap(), @" SELECT hello FROM @@ -5997,7 +6187,7 @@ fn test_import() { from x | select a "###, ) - .unwrap(), @r" + .unwrap(), @" SELECT 1 FROM @@ -6027,7 +6217,7 @@ derive { d = c } select !{ c } group { d } ( aggregate { b = sum b } ) -sort { d }"###).unwrap(), @r" +sort { d }"###).unwrap(), @" WITH table_1 AS ( SELECT b @@ -6062,7 +6252,7 @@ fn test_type_error_placement() { let foo = x -> (x | as integer) from t select (true && (foo y)) - "###).unwrap(), @r" + "###).unwrap(), @" SELECT true AND CAST(y AS integer) @@ -6087,7 +6277,7 @@ fn test_missing_columns_group_complex_compute() { select {this.`year_label`} "#, ) - .unwrap(), @r" + .unwrap(), @" SELECT DISTINCT ON ( EXTRACT( @@ -6131,7 +6321,7 @@ fn test_append_select_compute() { take 5 ) select { a = customer_id * 2, b = math.round 1 (invoice_id * total) } - "###).unwrap(), @r" + "###).unwrap(), @" WITH table_1 AS ( SELECT * @@ -6284,7 +6474,7 @@ fn test_append_with_cte() { from employees_wrap derive { source = "employees" } ) - "###).unwrap(), @r" + "###).unwrap(), @" WITH invoices_wrap AS ( SELECT invoice_id, @@ -6632,7 +6822,7 @@ fn test_redshift_uses_double_pipe_over_concat() { concatenated = f"{col_one} + {col_two}" } "###, sql::Dialect::Redshift - ).unwrap(), @r" + ).unwrap(), @" SELECT *, col_one || ' + ' || col_two AS concatenated @@ -6670,7 +6860,7 @@ fn test_redshift_text_contains_uses_double_pipe() { has_substring = (name | text.contains "pika") } "###, sql::Dialect::Redshift - ).unwrap(), @r" + ).unwrap(), @" SELECT name, name LIKE '%' || 'pika' || '%' AS has_substring @@ -6763,7 +6953,7 @@ fn test_group_with_only_sort() { group { a.department } ( sort a.salary ) - "###).unwrap(), @r" + "###).unwrap(), @" SELECT * FROM @@ -6780,7 +6970,7 @@ fn test_group_empty_preserves_sort() { sort a take 1 ) - "###).unwrap(), @r" + "###).unwrap(), @" SELECT * FROM @@ -7028,7 +7218,7 @@ fn test_partial_application_of_transform() { assert_snapshot!(compile(r#" let foo = a -> take a from invoices | foo 10 - "#).unwrap(), @r" + "#).unwrap(), @" SELECT * FROM @@ -7041,7 +7231,7 @@ fn test_partial_application_of_transform() { assert_snapshot!(compile(r#" let foo = a r -> take a r from invoices | foo 10 - "#).unwrap(), @r" + "#).unwrap(), @" SELECT * FROM diff --git a/prqlc-parser-0.13.11/.cargo-checksum.json b/prqlc-parser-0.13.12/.cargo-checksum.json similarity index 83% rename from prqlc-parser-0.13.11/.cargo-checksum.json rename to prqlc-parser-0.13.12/.cargo-checksum.json index df5179d5f1..08c0a76879 100644 --- a/prqlc-parser-0.13.11/.cargo-checksum.json +++ b/prqlc-parser-0.13.12/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo_vcs_info.json":"c38485ae694acd44dc1226f96a865b2be81bd4a0e4a7e9259d9f464921e30e5a","Cargo.lock":"f54134193d13419a293a4f479a4e5b170434b9942882ef3bf37e87003f3a3f07","Cargo.toml":"ed226f6729e937ac6309122020f2d9203e20d7493358551aa39530c6ee6d16da","Cargo.toml.orig":"a41d0151df15b22d92a48acfbc4264ab26b0deaf007ba5f5ba986050e611d2ae","src/error.rs":"84eae0247c71d597269615057a9c03afde3ffa131a846371a24bcf3bbbc489c7","src/generic.rs":"a1cd1713fdbf96e445db4d8bf8dc8a666cbd7937e94424471be43da5bc35539d","src/lexer/lr.rs":"bd9c8894bef78c4886d3f66c815b4f1bb2926497b8cc177ba27106ea190513c3","src/lexer/mod.rs":"3441943625fab1d76f561daebc6cb4836936f6db59a39e094bee3f4f0a059ff3","src/lexer/test.rs":"d15469ea276e69a34774cd1ee72e7ad82ca35ceb85e8b9416e4900b02ba4d34a","src/lib.rs":"1788bfcb897b6e9b46fa263d2a8c38ab66bcea498f2b56271cecbd2eda7de6fc","src/parser/expr.rs":"053a127f8dff955380792a2805397a19836e0d432198f2faf085c8f721211102","src/parser/interpolation.rs":"e8b5329612816fda2640aa064147c839aeed1dd70a2acec660c6eabe505d5c93","src/parser/mod.rs":"a3299c13024e712d3d2d088274b383b8b5ec9914c68e6572d517e13fe119b365","src/parser/perror.rs":"c2e11957316839b1752341e6013f1adc54e37e9fd5bba3cfb147e1b5c2d3a0ad","src/parser/pr/expr.rs":"15b404012f68df1212bc5b97542eb8728e2526229c6fa1d22ddd5a465e72eff8","src/parser/pr/ident.rs":"aa2b53a703eeff4a57b00e02ed70966dd8df5332fce1fec6a8ffff48e8abd3b1","src/parser/pr/mod.rs":"fc7b1c2c0e49a243c457c556e0112051a7623549684d92e2cc23644c4df5770b","src/parser/pr/ops.rs":"e82b13468a38bfa0957213498c3df75e9ffd87fca9ebf2f84cad6db5a9bdd5c7","src/parser/pr/stmt.rs":"505d356b599268f17978bddbe3b10599f4c5ee7402add9973cf671ec25c282f4","src/parser/pr/types.rs":"7cd7160d95751f597bd09edeed40b1ce54fbef9fcb362f97c353adc706c6fac4","src/parser/stmt.rs":"c68ef16d5d63104fb29f65ab689b1173b218e38f89e39b6f87b992212223e73f","src/parser/test.rs":"ee59d2d235610a05d9de6a27af097dfc16680eaf52a9e32840a081343d012797","src/parser/types.rs":"3a0f0aff0491cb17f772f72b2527b0671da674bdb65a6bd854d84a52ab41abb7","src/snapshots/prqlc_parser__test__pipeline_parse_tree.snap":"d3dd2765551b4f94042b5098b98a0b24fea79c2f07735e0cc8de81653609883b","src/span.rs":"1a6831ab1cc0f7ac7f53e82eda55c06406f47eac98bfbad38d6e0c8fb0d8b2da","src/test.rs":"d9053b02e5da167636c237c8d86f23df5269438b99a1b3556d4d9c8cf68c2f1c"},"package":"3530d0fa478ab1b28989cc48946366ce193ede73c4b94e3d23e6be967391a6d7"} \ No newline at end of file +{"files":{".cargo_vcs_info.json":"12e86a0bd4ea4f816cb72447a970714f2be3623daad1c122eb01a37fe11ff744","Cargo.lock":"426cc50de2f1a7a2fde59d063b7023d70275bbcee7576fc6355474a0139f8d15","Cargo.toml":"6e318b31434e9a9a810d735ea5f85c99ad45939ec3e33c24164d118639e2d4c7","Cargo.toml.orig":"a41d0151df15b22d92a48acfbc4264ab26b0deaf007ba5f5ba986050e611d2ae","src/error.rs":"84eae0247c71d597269615057a9c03afde3ffa131a846371a24bcf3bbbc489c7","src/generic.rs":"a1cd1713fdbf96e445db4d8bf8dc8a666cbd7937e94424471be43da5bc35539d","src/lexer/lr.rs":"bd9c8894bef78c4886d3f66c815b4f1bb2926497b8cc177ba27106ea190513c3","src/lexer/mod.rs":"3441943625fab1d76f561daebc6cb4836936f6db59a39e094bee3f4f0a059ff3","src/lexer/test.rs":"d15469ea276e69a34774cd1ee72e7ad82ca35ceb85e8b9416e4900b02ba4d34a","src/lib.rs":"1788bfcb897b6e9b46fa263d2a8c38ab66bcea498f2b56271cecbd2eda7de6fc","src/parser/expr.rs":"053a127f8dff955380792a2805397a19836e0d432198f2faf085c8f721211102","src/parser/interpolation.rs":"e8b5329612816fda2640aa064147c839aeed1dd70a2acec660c6eabe505d5c93","src/parser/mod.rs":"a3299c13024e712d3d2d088274b383b8b5ec9914c68e6572d517e13fe119b365","src/parser/perror.rs":"c2e11957316839b1752341e6013f1adc54e37e9fd5bba3cfb147e1b5c2d3a0ad","src/parser/pr/expr.rs":"15b404012f68df1212bc5b97542eb8728e2526229c6fa1d22ddd5a465e72eff8","src/parser/pr/ident.rs":"aa2b53a703eeff4a57b00e02ed70966dd8df5332fce1fec6a8ffff48e8abd3b1","src/parser/pr/mod.rs":"fc7b1c2c0e49a243c457c556e0112051a7623549684d92e2cc23644c4df5770b","src/parser/pr/ops.rs":"e82b13468a38bfa0957213498c3df75e9ffd87fca9ebf2f84cad6db5a9bdd5c7","src/parser/pr/stmt.rs":"505d356b599268f17978bddbe3b10599f4c5ee7402add9973cf671ec25c282f4","src/parser/pr/types.rs":"7cd7160d95751f597bd09edeed40b1ce54fbef9fcb362f97c353adc706c6fac4","src/parser/stmt.rs":"c68ef16d5d63104fb29f65ab689b1173b218e38f89e39b6f87b992212223e73f","src/parser/test.rs":"ee59d2d235610a05d9de6a27af097dfc16680eaf52a9e32840a081343d012797","src/parser/types.rs":"3a0f0aff0491cb17f772f72b2527b0671da674bdb65a6bd854d84a52ab41abb7","src/snapshots/prqlc_parser__test__pipeline_parse_tree.snap":"d3dd2765551b4f94042b5098b98a0b24fea79c2f07735e0cc8de81653609883b","src/span.rs":"1a6831ab1cc0f7ac7f53e82eda55c06406f47eac98bfbad38d6e0c8fb0d8b2da","src/test.rs":"d9053b02e5da167636c237c8d86f23df5269438b99a1b3556d4d9c8cf68c2f1c"},"package":"9b4885cff41ab8b651cec30a7925a5595e00277ea626a03688ae0751171ecbe6"} \ No newline at end of file diff --git a/prqlc-parser-0.13.11/.cargo_vcs_info.json b/prqlc-parser-0.13.12/.cargo_vcs_info.json similarity index 50% rename from prqlc-parser-0.13.11/.cargo_vcs_info.json rename to prqlc-parser-0.13.12/.cargo_vcs_info.json index 3c1661bf7e..aa9441848d 100644 --- a/prqlc-parser-0.13.11/.cargo_vcs_info.json +++ b/prqlc-parser-0.13.12/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "ea92e66c4a53d814477c45fe6d228c69c08a6bcd" + "sha1": "ec18eb8990825ba195e1e8b37e32050efa9baf45" }, "path_in_vcs": "prqlc/prqlc-parser" } \ No newline at end of file diff --git a/prqlc-parser-0.13.11/Cargo.lock b/prqlc-parser-0.13.12/Cargo.lock similarity index 83% rename from prqlc-parser-0.13.11/Cargo.lock rename to prqlc-parser-0.13.12/Cargo.lock index 8c0e2ade97..8a0ea10824 100644 --- a/prqlc-parser-0.13.11/Cargo.lock +++ b/prqlc-parser-0.13.12/Cargo.lock @@ -54,14 +54,13 @@ dependencies = [ [[package]] name = "console" -version = "0.15.11" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +checksum = "d64e8af5551369d19cf50138de61f1c42074ab970f74e99be916646777f8fc87" dependencies = [ "encode_unicode", "libc", - "once_cell", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -107,7 +106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -182,9 +181,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.46.3" +version = "1.47.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82db8c87c7f1ccecb34ce0c24399b8a73081427f3c7c50a5d597925356115e4" +checksum = "7b4a6248eb93a4401ed2f37dfe8ea592d3cf05b7cf4f8efa867b6895af7e094e" dependencies = [ "console", "globset", @@ -213,9 +212,9 @@ checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "libc" -version = "0.2.183" +version = "0.2.185" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" +checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" [[package]] name = "linux-raw-sys" @@ -252,7 +251,7 @@ dependencies = [ [[package]] name = "prqlc-parser" -version = "0.13.11" +version = "0.13.12" dependencies = [ "chumsky", "enum-as-inner", @@ -269,9 +268,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.44" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] @@ -358,7 +357,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -403,9 +402,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" dependencies = [ "serde", "serde_core", @@ -526,7 +525,7 @@ dependencies = [ "getrandom", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -572,7 +571,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys", ] [[package]] @@ -581,15 +580,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.61.2" @@ -599,70 +589,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - [[package]] name = "wit-bindgen" version = "0.51.0" diff --git a/prqlc-parser-0.13.11/Cargo.toml b/prqlc-parser-0.13.12/Cargo.toml similarity index 96% rename from prqlc-parser-0.13.11/Cargo.toml rename to prqlc-parser-0.13.12/Cargo.toml index 4bbdad659b..8978836264 100644 --- a/prqlc-parser-0.13.11/Cargo.toml +++ b/prqlc-parser-0.13.12/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.75.0" name = "prqlc-parser" -version = "0.13.11" +version = "0.13.12" build = false autolib = false autobins = false @@ -52,7 +52,7 @@ version = "0.4.29" version = "1.2.1" [dependencies.semver] -version = "1.0.27" +version = "1.0.28" features = ["serde"] [dependencies.serde] @@ -71,7 +71,7 @@ features = [ ] [dev-dependencies.insta] -version = "1.46.3" +version = "1.47.2" features = [ "colors", "glob", diff --git a/prqlc-parser-0.13.11/Cargo.toml.orig b/prqlc-parser-0.13.12/Cargo.toml.orig similarity index 100% rename from prqlc-parser-0.13.11/Cargo.toml.orig rename to prqlc-parser-0.13.12/Cargo.toml.orig diff --git a/prqlc-parser-0.13.11/src/error.rs b/prqlc-parser-0.13.12/src/error.rs similarity index 100% rename from prqlc-parser-0.13.11/src/error.rs rename to prqlc-parser-0.13.12/src/error.rs diff --git a/prqlc-parser-0.13.11/src/generic.rs b/prqlc-parser-0.13.12/src/generic.rs similarity index 100% rename from prqlc-parser-0.13.11/src/generic.rs rename to prqlc-parser-0.13.12/src/generic.rs diff --git a/prqlc-parser-0.13.11/src/lexer/lr.rs b/prqlc-parser-0.13.12/src/lexer/lr.rs similarity index 100% rename from prqlc-parser-0.13.11/src/lexer/lr.rs rename to prqlc-parser-0.13.12/src/lexer/lr.rs diff --git a/prqlc-parser-0.13.11/src/lexer/mod.rs b/prqlc-parser-0.13.12/src/lexer/mod.rs similarity index 100% rename from prqlc-parser-0.13.11/src/lexer/mod.rs rename to prqlc-parser-0.13.12/src/lexer/mod.rs diff --git a/prqlc-parser-0.13.11/src/lexer/test.rs b/prqlc-parser-0.13.12/src/lexer/test.rs similarity index 100% rename from prqlc-parser-0.13.11/src/lexer/test.rs rename to prqlc-parser-0.13.12/src/lexer/test.rs diff --git a/prqlc-parser-0.13.11/src/lib.rs b/prqlc-parser-0.13.12/src/lib.rs similarity index 100% rename from prqlc-parser-0.13.11/src/lib.rs rename to prqlc-parser-0.13.12/src/lib.rs diff --git a/prqlc-parser-0.13.11/src/parser/expr.rs b/prqlc-parser-0.13.12/src/parser/expr.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/expr.rs rename to prqlc-parser-0.13.12/src/parser/expr.rs diff --git a/prqlc-parser-0.13.11/src/parser/interpolation.rs b/prqlc-parser-0.13.12/src/parser/interpolation.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/interpolation.rs rename to prqlc-parser-0.13.12/src/parser/interpolation.rs diff --git a/prqlc-parser-0.13.11/src/parser/mod.rs b/prqlc-parser-0.13.12/src/parser/mod.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/mod.rs rename to prqlc-parser-0.13.12/src/parser/mod.rs diff --git a/prqlc-parser-0.13.11/src/parser/perror.rs b/prqlc-parser-0.13.12/src/parser/perror.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/perror.rs rename to prqlc-parser-0.13.12/src/parser/perror.rs diff --git a/prqlc-parser-0.13.11/src/parser/pr/expr.rs b/prqlc-parser-0.13.12/src/parser/pr/expr.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/pr/expr.rs rename to prqlc-parser-0.13.12/src/parser/pr/expr.rs diff --git a/prqlc-parser-0.13.11/src/parser/pr/ident.rs b/prqlc-parser-0.13.12/src/parser/pr/ident.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/pr/ident.rs rename to prqlc-parser-0.13.12/src/parser/pr/ident.rs diff --git a/prqlc-parser-0.13.11/src/parser/pr/mod.rs b/prqlc-parser-0.13.12/src/parser/pr/mod.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/pr/mod.rs rename to prqlc-parser-0.13.12/src/parser/pr/mod.rs diff --git a/prqlc-parser-0.13.11/src/parser/pr/ops.rs b/prqlc-parser-0.13.12/src/parser/pr/ops.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/pr/ops.rs rename to prqlc-parser-0.13.12/src/parser/pr/ops.rs diff --git a/prqlc-parser-0.13.11/src/parser/pr/stmt.rs b/prqlc-parser-0.13.12/src/parser/pr/stmt.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/pr/stmt.rs rename to prqlc-parser-0.13.12/src/parser/pr/stmt.rs diff --git a/prqlc-parser-0.13.11/src/parser/pr/types.rs b/prqlc-parser-0.13.12/src/parser/pr/types.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/pr/types.rs rename to prqlc-parser-0.13.12/src/parser/pr/types.rs diff --git a/prqlc-parser-0.13.11/src/parser/stmt.rs b/prqlc-parser-0.13.12/src/parser/stmt.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/stmt.rs rename to prqlc-parser-0.13.12/src/parser/stmt.rs diff --git a/prqlc-parser-0.13.11/src/parser/test.rs b/prqlc-parser-0.13.12/src/parser/test.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/test.rs rename to prqlc-parser-0.13.12/src/parser/test.rs diff --git a/prqlc-parser-0.13.11/src/parser/types.rs b/prqlc-parser-0.13.12/src/parser/types.rs similarity index 100% rename from prqlc-parser-0.13.11/src/parser/types.rs rename to prqlc-parser-0.13.12/src/parser/types.rs diff --git a/prqlc-parser-0.13.11/src/snapshots/prqlc_parser__test__pipeline_parse_tree.snap b/prqlc-parser-0.13.12/src/snapshots/prqlc_parser__test__pipeline_parse_tree.snap similarity index 100% rename from prqlc-parser-0.13.11/src/snapshots/prqlc_parser__test__pipeline_parse_tree.snap rename to prqlc-parser-0.13.12/src/snapshots/prqlc_parser__test__pipeline_parse_tree.snap diff --git a/prqlc-parser-0.13.11/src/span.rs b/prqlc-parser-0.13.12/src/span.rs similarity index 100% rename from prqlc-parser-0.13.11/src/span.rs rename to prqlc-parser-0.13.12/src/span.rs diff --git a/prqlc-parser-0.13.11/src/test.rs b/prqlc-parser-0.13.12/src/test.rs similarity index 100% rename from prqlc-parser-0.13.11/src/test.rs rename to prqlc-parser-0.13.12/src/test.rs diff --git a/pulldown-cmark-0.13.3/.cargo_vcs_info.json b/pulldown-cmark-0.13.3/.cargo_vcs_info.json deleted file mode 100644 index e9a18e5cb1..0000000000 --- a/pulldown-cmark-0.13.3/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "ed2ee591b4df92ee6824f81bba07f473420f2320" - }, - "path_in_vcs": "pulldown-cmark" -} \ No newline at end of file diff --git a/pulldown-cmark-0.13.3/.cargo-checksum.json b/pulldown-cmark-0.13.4/.cargo-checksum.json similarity index 86% rename from pulldown-cmark-0.13.3/.cargo-checksum.json rename to pulldown-cmark-0.13.4/.cargo-checksum.json index 3585ddaf3d..43542e9408 100644 --- a/pulldown-cmark-0.13.3/.cargo-checksum.json +++ b/pulldown-cmark-0.13.4/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo_vcs_info.json":"d04c0924eeab9fb30ac2d196eb9174115434e901e10b5bff9093f32171547f54","Cargo.lock":"101365451f1726923850fd5d4fad90b52e7e31e0fc0ad4eccc9f1f4c4702cdfc","Cargo.toml":"a8329a39bf4d6edd8d3df1e1d3baca2f6fdff14d342f3b411caa20f15e044409","Cargo.toml.orig":"2b158c423a436296479aace3fb7637a356c58d86a2f287c099b15120222090d9","LICENSE":"c4f10f55904bdb9f27d3fbf94c354926d6cfe8b982276e556238c258941b243b","README.md":"83c86a8d5c92c4d033667da29bc16288cdf6ba855cb8368f296bd35d49eb163d","build.rs":"f21fbde26b144bd5c6c54aad655242ecbbac85fdbe567da8f1241492f7c83ece","examples/broken-link-callbacks.rs":"f98d7092004a338a0f86879b3e30270be28b19d2c1bd250380610f84b84eef4a","examples/event-filter.rs":"2e297d9a6117969cb5f690375122d2306a697bf09aee108ddaecb213f29c8c62","examples/events.rs":"6dcdfda734581a220806aafa58f4aab6de225dfa665f5861e575c05c1f69e9e1","examples/footnote-rewrite.rs":"789772c69ebcc60c879c6a1c71b7d4e9980bc1499467dd734dee566906da92e1","examples/normalize-wikilink.rs":"6c6ac7842db9c69ad70ca66a154110845f4f00757a5bfcb9c4b3a0c8bc7b3abc","examples/parser-map-event-print.rs":"b35fab7747364e0357f6793c7cab30181d5b6cfd1ee95cd247f688c4fe550e8e","examples/parser-map-tag-print.rs":"cdaa3b0d578f754207e229c2614f4ace95c995d172ca91cde67c9c7a67830fcc","examples/string-to-string.rs":"33cfc2ccee93637db64a18135fedb5bbf2950dcb8c72bed50eed067ec3758f57","src/entities.rs":"1602f3c4d22c0b0e3a4a08467a50bf9d0c27aadf2e5661b15a2cda20da0895a9","src/firstpass.rs":"e66397b39ab0996ca6197d9476eb5db833f92672acdbdb855241f33346048917","src/html.rs":"853b3b211276555ffc66fd583a3e071f61ee8fad0f2864c428947b7bd36a2fa3","src/lib.rs":"f916b7bf0c3035776d6d5f8f62c4619855b291ba245b0ee1f46f980c59ce3919","src/linklabel.rs":"6793cd0a2b1df6423d7cc8587b74a8e86261d5f7be9a8869cb69eda140b03501","src/main.rs":"570babf9ab7dc14d7e687f46a0baa089214a864b7615a16ff379dc88bb693561","src/parse.rs":"8234bec79a085ece090cd45f4a3978b0cf0d13021d5ef6a47bb0f5ec90d175be","src/puncttable.rs":"b591c2b353ba60b88661597f853b4986df87bee6b53045ab94ae562848457be4","src/scanners.rs":"2cdcb3cc76bc3d6947eec066eefe4582b660dd52da71d048f6dc515665291840","src/strings.rs":"3204335caa3eb6be8b86ec5a21f7ff25b2ab34a364facb86b451e178b4992684","src/tree.rs":"d40c3406404ab9a179aba35d37f248a88b43e9c93060d462a4f83bef8d714418","src/utils.rs":"bbe32779232463ae8a82badab6b7fe201df59bd01b4db9f272a5840423973af9","tests/errors.rs":"2f8166be75a794d2c04362b4ed3209ba2f625e81cefd1ec41739010dd4dbf7b8","tests/html.rs":"d4dc41b10880449d2c241223171e5c5f9f0e56141ef16c71b6d1c08e538e564f","tests/lib.rs":"1a386244cb43259386684c82731e3bd55f1c92ac3277642c273680daf2bb1911","tests/serde.rs":"bc38923455eb8f4dcdf4883d2d8d1331628466d903c9cc78345d09ae00e4d2a0","tests/suite/blockquotes_tags.rs":"e6f92759a58d3083c46aee9793f11a2148fa0838c3e2cee3e70116fda3a6bb6f","tests/suite/definition_lists.rs":"fd1b1364e220248c1ecb1deffa573cc775767832853c8f83d7bb8680aa0defc6","tests/suite/footnotes.rs":"5464c15cdf280ff8dd3cbb84394be62bad029645ba470516a44115e9aea461a6","tests/suite/gfm_strikethrough.rs":"f92a17ec4f132a362914f54f9132eb02015e16b6b969781a4f0e67456e5f8bc0","tests/suite/gfm_table.rs":"8db667d0f5358fb9e181ae948ec45361c5b1c9b2ea0f31561b64f7ff204e85d8","tests/suite/gfm_tasklist.rs":"e7abc90500545dd86159952561f99d195a412c0623436cb02db685d67b660502","tests/suite/heading_attrs.rs":"0bdcd54b602da14b11e3d34bfd7242d6697337359b8f166d6c6a2d890f461371","tests/suite/math.rs":"fc167f270b54e238de247807cb6d9d7876d1485d4422a60790d4ad67423d73d9","tests/suite/metadata_blocks.rs":"2a8f92f432d63f038a3ba5ce9b48e58d8023801e8edc0b27cd0ade2603e11f38","tests/suite/mod.rs":"19e53648f8b9ba9558914d39d50188ad1243659c0984cd634b9ee732b9fe39b5","tests/suite/old_footnotes.rs":"8f2e9ce054eb4fd5011df1a57c70e9b0f997f80308ddfdfce0155f549224d2af","tests/suite/regression.rs":"57af1507e8d420a5ddc577d55c3c2624dd8b00283aba3117295afa6e4d7a63b3","tests/suite/smart_punct.rs":"6af7051f9c9fc587af974e86a3ed3f30cc47d07b84f0411f42a22317639b4792","tests/suite/spec.rs":"93365116e35b956498103e20360b661f97d4df796f290597a59270ea513638fe","tests/suite/strikethrough.rs":"5b0749d91038e5525a2c8de0e7c061693c71b4bab3f50ac4833e65e0ed4298cc","tests/suite/super_sub.rs":"65a76360980358434eef40ec31f89a18d08e8b5b39383fefcdb219545743c0ef","tests/suite/table.rs":"e1e8c815b5c4f659ad091d4a781438e5b96f1bf6923a88779c9e8fc881f19e59","tests/suite/wikilinks.rs":"acfb54417d4437c8bb7ce57aeecd7c060e69fae66d5783a4bd44a4cd4130090c"},"package":"7c3a14896dfa883796f1cb410461aef38810ea05f2b2c33c5aded3649095fdad"} \ No newline at end of file +{"files":{".cargo_vcs_info.json":"b2f072c7ef609ef30fad777d9fef73e832b412db98e4e61301ac345d2ed5ce7f","Cargo.lock":"3788c5b142fb4b12c10ac0563e79fda95f0fe4134fff670bb5f20b863c4c39c1","Cargo.toml":"631421b4c7f58856cd6ec45a1e27da28b70154f69b268a62d70587c2068927d0","Cargo.toml.orig":"7ca7e734e197c67428b8114657e628f173164814f5f90742b3cacd4f2459e17d","LICENSE":"c4f10f55904bdb9f27d3fbf94c354926d6cfe8b982276e556238c258941b243b","README.md":"83c86a8d5c92c4d033667da29bc16288cdf6ba855cb8368f296bd35d49eb163d","build.rs":"f21fbde26b144bd5c6c54aad655242ecbbac85fdbe567da8f1241492f7c83ece","examples/broken-link-callbacks.rs":"f98d7092004a338a0f86879b3e30270be28b19d2c1bd250380610f84b84eef4a","examples/event-filter.rs":"2e297d9a6117969cb5f690375122d2306a697bf09aee108ddaecb213f29c8c62","examples/events.rs":"6dcdfda734581a220806aafa58f4aab6de225dfa665f5861e575c05c1f69e9e1","examples/footnote-rewrite.rs":"789772c69ebcc60c879c6a1c71b7d4e9980bc1499467dd734dee566906da92e1","examples/normalize-wikilink.rs":"6c6ac7842db9c69ad70ca66a154110845f4f00757a5bfcb9c4b3a0c8bc7b3abc","examples/parser-map-event-print.rs":"b35fab7747364e0357f6793c7cab30181d5b6cfd1ee95cd247f688c4fe550e8e","examples/parser-map-tag-print.rs":"cdaa3b0d578f754207e229c2614f4ace95c995d172ca91cde67c9c7a67830fcc","examples/string-to-string.rs":"33cfc2ccee93637db64a18135fedb5bbf2950dcb8c72bed50eed067ec3758f57","src/entities.rs":"1602f3c4d22c0b0e3a4a08467a50bf9d0c27aadf2e5661b15a2cda20da0895a9","src/firstpass.rs":"e66397b39ab0996ca6197d9476eb5db833f92672acdbdb855241f33346048917","src/html.rs":"853b3b211276555ffc66fd583a3e071f61ee8fad0f2864c428947b7bd36a2fa3","src/lib.rs":"f916b7bf0c3035776d6d5f8f62c4619855b291ba245b0ee1f46f980c59ce3919","src/linklabel.rs":"6793cd0a2b1df6423d7cc8587b74a8e86261d5f7be9a8869cb69eda140b03501","src/main.rs":"570babf9ab7dc14d7e687f46a0baa089214a864b7615a16ff379dc88bb693561","src/parse.rs":"76fca0f94731d660cf022e948ff119daed1bdf446e813e4a86faa742700483a5","src/puncttable.rs":"b591c2b353ba60b88661597f853b4986df87bee6b53045ab94ae562848457be4","src/scanners.rs":"2cdcb3cc76bc3d6947eec066eefe4582b660dd52da71d048f6dc515665291840","src/strings.rs":"3204335caa3eb6be8b86ec5a21f7ff25b2ab34a364facb86b451e178b4992684","src/tree.rs":"d40c3406404ab9a179aba35d37f248a88b43e9c93060d462a4f83bef8d714418","src/utils.rs":"bbe32779232463ae8a82badab6b7fe201df59bd01b4db9f272a5840423973af9","tests/errors.rs":"2f8166be75a794d2c04362b4ed3209ba2f625e81cefd1ec41739010dd4dbf7b8","tests/html.rs":"d4dc41b10880449d2c241223171e5c5f9f0e56141ef16c71b6d1c08e538e564f","tests/lib.rs":"1a386244cb43259386684c82731e3bd55f1c92ac3277642c273680daf2bb1911","tests/serde.rs":"bc38923455eb8f4dcdf4883d2d8d1331628466d903c9cc78345d09ae00e4d2a0","tests/suite/blockquotes_tags.rs":"e6f92759a58d3083c46aee9793f11a2148fa0838c3e2cee3e70116fda3a6bb6f","tests/suite/definition_lists.rs":"fd1b1364e220248c1ecb1deffa573cc775767832853c8f83d7bb8680aa0defc6","tests/suite/footnotes.rs":"5464c15cdf280ff8dd3cbb84394be62bad029645ba470516a44115e9aea461a6","tests/suite/gfm_strikethrough.rs":"f92a17ec4f132a362914f54f9132eb02015e16b6b969781a4f0e67456e5f8bc0","tests/suite/gfm_table.rs":"8db667d0f5358fb9e181ae948ec45361c5b1c9b2ea0f31561b64f7ff204e85d8","tests/suite/gfm_tasklist.rs":"e7abc90500545dd86159952561f99d195a412c0623436cb02db685d67b660502","tests/suite/heading_attrs.rs":"0bdcd54b602da14b11e3d34bfd7242d6697337359b8f166d6c6a2d890f461371","tests/suite/math.rs":"fc167f270b54e238de247807cb6d9d7876d1485d4422a60790d4ad67423d73d9","tests/suite/metadata_blocks.rs":"2a8f92f432d63f038a3ba5ce9b48e58d8023801e8edc0b27cd0ade2603e11f38","tests/suite/mod.rs":"19e53648f8b9ba9558914d39d50188ad1243659c0984cd634b9ee732b9fe39b5","tests/suite/old_footnotes.rs":"8f2e9ce054eb4fd5011df1a57c70e9b0f997f80308ddfdfce0155f549224d2af","tests/suite/regression.rs":"57af1507e8d420a5ddc577d55c3c2624dd8b00283aba3117295afa6e4d7a63b3","tests/suite/smart_punct.rs":"6af7051f9c9fc587af974e86a3ed3f30cc47d07b84f0411f42a22317639b4792","tests/suite/spec.rs":"93365116e35b956498103e20360b661f97d4df796f290597a59270ea513638fe","tests/suite/strikethrough.rs":"5b0749d91038e5525a2c8de0e7c061693c71b4bab3f50ac4833e65e0ed4298cc","tests/suite/super_sub.rs":"65a76360980358434eef40ec31f89a18d08e8b5b39383fefcdb219545743c0ef","tests/suite/table.rs":"e1e8c815b5c4f659ad091d4a781438e5b96f1bf6923a88779c9e8fc881f19e59","tests/suite/wikilinks.rs":"acfb54417d4437c8bb7ce57aeecd7c060e69fae66d5783a4bd44a4cd4130090c"},"package":"e9f068eba8e7071c5f9511831b44f32c740d5adf574e990f946ddb53db2f314e"} \ No newline at end of file diff --git a/pulldown-cmark-0.13.4/.cargo_vcs_info.json b/pulldown-cmark-0.13.4/.cargo_vcs_info.json new file mode 100644 index 0000000000..7535b01584 --- /dev/null +++ b/pulldown-cmark-0.13.4/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "38e4d08f14ec4bd9783270e9623db7681ebed968" + }, + "path_in_vcs": "pulldown-cmark" +} \ No newline at end of file diff --git a/pulldown-cmark-0.13.3/Cargo.lock b/pulldown-cmark-0.13.4/Cargo.lock similarity index 97% rename from pulldown-cmark-0.13.3/Cargo.lock rename to pulldown-cmark-0.13.4/Cargo.lock index 2d08394bde..17d764ec91 100644 --- a/pulldown-cmark-0.13.3/Cargo.lock +++ b/pulldown-cmark-0.13.4/Cargo.lock @@ -22,9 +22,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" [[package]] name = "getopts" @@ -64,7 +64,7 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.13.3" +version = "0.13.4" dependencies = [ "bincode", "bitflags", diff --git a/pulldown-cmark-0.13.3/Cargo.toml b/pulldown-cmark-0.13.4/Cargo.toml similarity index 99% rename from pulldown-cmark-0.13.3/Cargo.toml rename to pulldown-cmark-0.13.4/Cargo.toml index 6d3750918e..7e8028116f 100644 --- a/pulldown-cmark-0.13.3/Cargo.toml +++ b/pulldown-cmark-0.13.4/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.71.1" name = "pulldown-cmark" -version = "0.13.3" +version = "0.13.4" authors = [ "Raph Levien ", "Marcus Klaas de Vries ", diff --git a/pulldown-cmark-0.13.3/Cargo.toml.orig b/pulldown-cmark-0.13.4/Cargo.toml.orig similarity index 99% rename from pulldown-cmark-0.13.3/Cargo.toml.orig rename to pulldown-cmark-0.13.4/Cargo.toml.orig index 1c657e60ec..13c86f0160 100644 --- a/pulldown-cmark-0.13.3/Cargo.toml.orig +++ b/pulldown-cmark-0.13.4/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "pulldown-cmark" -version = "0.13.3" +version = "0.13.4" authors = [ "Raph Levien ", "Marcus Klaas de Vries ", diff --git a/pulldown-cmark-0.13.3/LICENSE b/pulldown-cmark-0.13.4/LICENSE similarity index 100% rename from pulldown-cmark-0.13.3/LICENSE rename to pulldown-cmark-0.13.4/LICENSE diff --git a/pulldown-cmark-0.13.3/README.md b/pulldown-cmark-0.13.4/README.md similarity index 100% rename from pulldown-cmark-0.13.3/README.md rename to pulldown-cmark-0.13.4/README.md diff --git a/pulldown-cmark-0.13.3/build.rs b/pulldown-cmark-0.13.4/build.rs similarity index 100% rename from pulldown-cmark-0.13.3/build.rs rename to pulldown-cmark-0.13.4/build.rs diff --git a/pulldown-cmark-0.13.3/examples/broken-link-callbacks.rs b/pulldown-cmark-0.13.4/examples/broken-link-callbacks.rs similarity index 100% rename from pulldown-cmark-0.13.3/examples/broken-link-callbacks.rs rename to pulldown-cmark-0.13.4/examples/broken-link-callbacks.rs diff --git a/pulldown-cmark-0.13.3/examples/event-filter.rs b/pulldown-cmark-0.13.4/examples/event-filter.rs similarity index 100% rename from pulldown-cmark-0.13.3/examples/event-filter.rs rename to pulldown-cmark-0.13.4/examples/event-filter.rs diff --git a/pulldown-cmark-0.13.3/examples/events.rs b/pulldown-cmark-0.13.4/examples/events.rs similarity index 100% rename from pulldown-cmark-0.13.3/examples/events.rs rename to pulldown-cmark-0.13.4/examples/events.rs diff --git a/pulldown-cmark-0.13.3/examples/footnote-rewrite.rs b/pulldown-cmark-0.13.4/examples/footnote-rewrite.rs similarity index 100% rename from pulldown-cmark-0.13.3/examples/footnote-rewrite.rs rename to pulldown-cmark-0.13.4/examples/footnote-rewrite.rs diff --git a/pulldown-cmark-0.13.3/examples/normalize-wikilink.rs b/pulldown-cmark-0.13.4/examples/normalize-wikilink.rs similarity index 100% rename from pulldown-cmark-0.13.3/examples/normalize-wikilink.rs rename to pulldown-cmark-0.13.4/examples/normalize-wikilink.rs diff --git a/pulldown-cmark-0.13.3/examples/parser-map-event-print.rs b/pulldown-cmark-0.13.4/examples/parser-map-event-print.rs similarity index 100% rename from pulldown-cmark-0.13.3/examples/parser-map-event-print.rs rename to pulldown-cmark-0.13.4/examples/parser-map-event-print.rs diff --git a/pulldown-cmark-0.13.3/examples/parser-map-tag-print.rs b/pulldown-cmark-0.13.4/examples/parser-map-tag-print.rs similarity index 100% rename from pulldown-cmark-0.13.3/examples/parser-map-tag-print.rs rename to pulldown-cmark-0.13.4/examples/parser-map-tag-print.rs diff --git a/pulldown-cmark-0.13.3/examples/string-to-string.rs b/pulldown-cmark-0.13.4/examples/string-to-string.rs similarity index 100% rename from pulldown-cmark-0.13.3/examples/string-to-string.rs rename to pulldown-cmark-0.13.4/examples/string-to-string.rs diff --git a/pulldown-cmark-0.13.3/src/entities.rs b/pulldown-cmark-0.13.4/src/entities.rs similarity index 100% rename from pulldown-cmark-0.13.3/src/entities.rs rename to pulldown-cmark-0.13.4/src/entities.rs diff --git a/pulldown-cmark-0.13.3/src/firstpass.rs b/pulldown-cmark-0.13.4/src/firstpass.rs similarity index 100% rename from pulldown-cmark-0.13.3/src/firstpass.rs rename to pulldown-cmark-0.13.4/src/firstpass.rs diff --git a/pulldown-cmark-0.13.3/src/html.rs b/pulldown-cmark-0.13.4/src/html.rs similarity index 100% rename from pulldown-cmark-0.13.3/src/html.rs rename to pulldown-cmark-0.13.4/src/html.rs diff --git a/pulldown-cmark-0.13.3/src/lib.rs b/pulldown-cmark-0.13.4/src/lib.rs similarity index 100% rename from pulldown-cmark-0.13.3/src/lib.rs rename to pulldown-cmark-0.13.4/src/lib.rs diff --git a/pulldown-cmark-0.13.3/src/linklabel.rs b/pulldown-cmark-0.13.4/src/linklabel.rs similarity index 100% rename from pulldown-cmark-0.13.3/src/linklabel.rs rename to pulldown-cmark-0.13.4/src/linklabel.rs diff --git a/pulldown-cmark-0.13.3/src/main.rs b/pulldown-cmark-0.13.4/src/main.rs similarity index 100% rename from pulldown-cmark-0.13.3/src/main.rs rename to pulldown-cmark-0.13.4/src/main.rs diff --git a/pulldown-cmark-0.13.3/src/parse.rs b/pulldown-cmark-0.13.4/src/parse.rs similarity index 98% rename from pulldown-cmark-0.13.3/src/parse.rs rename to pulldown-cmark-0.13.4/src/parse.rs index 46eeea6e53..317d05b25f 100644 --- a/pulldown-cmark-0.13.3/src/parse.rs +++ b/pulldown-cmark-0.13.4/src/parse.rs @@ -2361,26 +2361,31 @@ impl<'a, F: BrokenLinkCallback<'a>> Iterator for Parser<'a, F> { Some(Event::End(tag_end)) } Some(cur_ix) => { - let cur_ix = if matches!(self.tree[cur_ix].item.body, ItemBody::TightParagraph) { - // tight paragraphs emit nothing - self.tree.push(); - self.tree.cur().unwrap() - } else { - cur_ix - }; - if self.tree[cur_ix].item.body.is_maybe_inline() { - self.handle_inline(); - } + let maybe_cur_ix = + if matches!(self.tree[cur_ix].item.body, ItemBody::TightParagraph) { + // tight paragraphs emit nothing + self.tree.push(); + self.tree.cur() + } else { + Some(cur_ix) + }; + if let Some(cur_ix) = maybe_cur_ix { + if self.tree[cur_ix].item.body.is_maybe_inline() { + self.handle_inline(); + } - let node = self.tree[cur_ix]; - let item = node.item; - let event = item_to_event(item, self.text, &mut self.allocs); - if let Event::Start(ref _tag) = event { - self.tree.push(); + let node = self.tree[cur_ix]; + let item = node.item; + let event = item_to_event(item, self.text, &mut self.allocs); + if let Event::Start(ref _tag) = event { + self.tree.push(); + } else { + self.tree.next_sibling(cur_ix); + } + Some(event) } else { - self.tree.next_sibling(cur_ix); + None } - Some(event) } } } @@ -2440,6 +2445,13 @@ mod test { Parser::new("\\\r\r\\.\\\\\r\r\\.\\").count(); } + #[test] + fn issue_1095() { + let s = "- [n]:Z\r\n\t\t"; + let parser = Parser::new_ext(s, Options::all()); + for _ in parser {} + } + #[test] fn issue_1030() { let mut opts = Options::empty(); diff --git a/pulldown-cmark-0.13.3/src/puncttable.rs b/pulldown-cmark-0.13.4/src/puncttable.rs similarity index 100% rename from pulldown-cmark-0.13.3/src/puncttable.rs rename to pulldown-cmark-0.13.4/src/puncttable.rs diff --git a/pulldown-cmark-0.13.3/src/scanners.rs b/pulldown-cmark-0.13.4/src/scanners.rs similarity index 100% rename from pulldown-cmark-0.13.3/src/scanners.rs rename to pulldown-cmark-0.13.4/src/scanners.rs diff --git a/pulldown-cmark-0.13.3/src/strings.rs b/pulldown-cmark-0.13.4/src/strings.rs similarity index 100% rename from pulldown-cmark-0.13.3/src/strings.rs rename to pulldown-cmark-0.13.4/src/strings.rs diff --git a/pulldown-cmark-0.13.3/src/tree.rs b/pulldown-cmark-0.13.4/src/tree.rs similarity index 100% rename from pulldown-cmark-0.13.3/src/tree.rs rename to pulldown-cmark-0.13.4/src/tree.rs diff --git a/pulldown-cmark-0.13.3/src/utils.rs b/pulldown-cmark-0.13.4/src/utils.rs similarity index 100% rename from pulldown-cmark-0.13.3/src/utils.rs rename to pulldown-cmark-0.13.4/src/utils.rs diff --git a/pulldown-cmark-0.13.3/tests/errors.rs b/pulldown-cmark-0.13.4/tests/errors.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/errors.rs rename to pulldown-cmark-0.13.4/tests/errors.rs diff --git a/pulldown-cmark-0.13.3/tests/html.rs b/pulldown-cmark-0.13.4/tests/html.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/html.rs rename to pulldown-cmark-0.13.4/tests/html.rs diff --git a/pulldown-cmark-0.13.3/tests/lib.rs b/pulldown-cmark-0.13.4/tests/lib.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/lib.rs rename to pulldown-cmark-0.13.4/tests/lib.rs diff --git a/pulldown-cmark-0.13.3/tests/serde.rs b/pulldown-cmark-0.13.4/tests/serde.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/serde.rs rename to pulldown-cmark-0.13.4/tests/serde.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/blockquotes_tags.rs b/pulldown-cmark-0.13.4/tests/suite/blockquotes_tags.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/blockquotes_tags.rs rename to pulldown-cmark-0.13.4/tests/suite/blockquotes_tags.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/definition_lists.rs b/pulldown-cmark-0.13.4/tests/suite/definition_lists.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/definition_lists.rs rename to pulldown-cmark-0.13.4/tests/suite/definition_lists.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/footnotes.rs b/pulldown-cmark-0.13.4/tests/suite/footnotes.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/footnotes.rs rename to pulldown-cmark-0.13.4/tests/suite/footnotes.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/gfm_strikethrough.rs b/pulldown-cmark-0.13.4/tests/suite/gfm_strikethrough.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/gfm_strikethrough.rs rename to pulldown-cmark-0.13.4/tests/suite/gfm_strikethrough.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/gfm_table.rs b/pulldown-cmark-0.13.4/tests/suite/gfm_table.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/gfm_table.rs rename to pulldown-cmark-0.13.4/tests/suite/gfm_table.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/gfm_tasklist.rs b/pulldown-cmark-0.13.4/tests/suite/gfm_tasklist.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/gfm_tasklist.rs rename to pulldown-cmark-0.13.4/tests/suite/gfm_tasklist.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/heading_attrs.rs b/pulldown-cmark-0.13.4/tests/suite/heading_attrs.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/heading_attrs.rs rename to pulldown-cmark-0.13.4/tests/suite/heading_attrs.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/math.rs b/pulldown-cmark-0.13.4/tests/suite/math.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/math.rs rename to pulldown-cmark-0.13.4/tests/suite/math.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/metadata_blocks.rs b/pulldown-cmark-0.13.4/tests/suite/metadata_blocks.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/metadata_blocks.rs rename to pulldown-cmark-0.13.4/tests/suite/metadata_blocks.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/mod.rs b/pulldown-cmark-0.13.4/tests/suite/mod.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/mod.rs rename to pulldown-cmark-0.13.4/tests/suite/mod.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/old_footnotes.rs b/pulldown-cmark-0.13.4/tests/suite/old_footnotes.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/old_footnotes.rs rename to pulldown-cmark-0.13.4/tests/suite/old_footnotes.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/regression.rs b/pulldown-cmark-0.13.4/tests/suite/regression.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/regression.rs rename to pulldown-cmark-0.13.4/tests/suite/regression.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/smart_punct.rs b/pulldown-cmark-0.13.4/tests/suite/smart_punct.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/smart_punct.rs rename to pulldown-cmark-0.13.4/tests/suite/smart_punct.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/spec.rs b/pulldown-cmark-0.13.4/tests/suite/spec.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/spec.rs rename to pulldown-cmark-0.13.4/tests/suite/spec.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/strikethrough.rs b/pulldown-cmark-0.13.4/tests/suite/strikethrough.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/strikethrough.rs rename to pulldown-cmark-0.13.4/tests/suite/strikethrough.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/super_sub.rs b/pulldown-cmark-0.13.4/tests/suite/super_sub.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/super_sub.rs rename to pulldown-cmark-0.13.4/tests/suite/super_sub.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/table.rs b/pulldown-cmark-0.13.4/tests/suite/table.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/table.rs rename to pulldown-cmark-0.13.4/tests/suite/table.rs diff --git a/pulldown-cmark-0.13.3/tests/suite/wikilinks.rs b/pulldown-cmark-0.13.4/tests/suite/wikilinks.rs similarity index 100% rename from pulldown-cmark-0.13.3/tests/suite/wikilinks.rs rename to pulldown-cmark-0.13.4/tests/suite/wikilinks.rs diff --git a/radix_trie-0.2.1/.cargo-checksum.json b/radix_trie-0.2.1/.cargo-checksum.json new file mode 100644 index 0000000000..07d32a5276 --- /dev/null +++ b/radix_trie-0.2.1/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"e14952c661462055cffac222c882aa0f6e9e1251e2d5f8b20298716067772bd5",".travis.yml":"fd85e5a6cd4b09174276ff4afb3a23e4f94c1b64eaad5ccf462570494d94e47b","CHANGELOG.md":"2a89014d519221cd3bfe6bf0d78b045269dc35889ffcfb870964d8991c8f9c16","Cargo.lock":"5e4caa00f5c50769c3106e3300190bf184f9e10fd03cc7c4c937d6c48f9c4b5f","Cargo.toml":"d0af1a96de60cadef7e1b874596252deca981e0afa74788a01972f2b22786086","Cargo.toml.orig":"14773e7d555301f9f05792be8a7bec7d6e14d3bdb2febb395b2c9c5aacbd450c","LICENSE":"e4e06f4bee6b18fbe6ab33b26331739a0b2bda0c1037cfa869e7d97512e9fcf7","README.md":"9681f672123fbbebee6537497eafafa6ef677863612aa3406148cc2474f84156","appveyor.yml":"205525693e8d1fc75bef3c35d263cfa8285ef06f3f8c35e98fb924474245707a","benches/trie_benches.rs":"db9a502094ab59af8e6d01e248b2914c062c710d28a25d41325e78fc7a2379f0","data/1984.txt":"13254cc3a6dc231c6422a201eff8d74ba6dff2cda264b96ec7148e652486b831","data/sun-rising.txt":"cdb56c996e378638f836872c7d140191e659b36a3e3f1ecc48e0f62e4792f046","examples/child_iter.rs":"2597bf71b23d1977bb591e6df6fecacf932c26ce7d1b2c4b6e6ec8e19331ed0e","examples/debug.rs":"1a595f559fcb808544f32710c7ccbd2ff6e4208b384b61296b8b930f43e4e63e","examples/opt.rs":"dd23dec30b407968f8083f66e7cdaf7b0472e27fadfa453270d9dbc695b40fdf","examples/string_frequency.rs":"8099e992c71dd0652faad5d1eba73333f87f3441bfdc83ef79fdd7896923e584","src/iter.rs":"b3dc3c6b9f7cecbf5aa25b038dda14b5193534987b5fc5bd0df401ae9c7019b0","src/keys.rs":"7c243454e8d1a4aea467e3438fd44c972cf15cc0b9e7f077d4d2593342ed6d46","src/lib.rs":"1a9c7f8a4cddb5b6bc8dce6287d4af32ca4cb62b1eb3973ae1c159f774dae8f9","src/macros.rs":"2078b161482a71896f93b9b6fbb8f29b21b78bea2f4646b4b494271536beaac2","src/qc_test.rs":"f528725b31e505e0ea0f266a9f6055b042d78126754d65c6ea166086a9de44a1","src/serde.rs":"1ce5db1507cd0b384526be3bf39c0b309cd63acc472a2e20e24d8a3ecd2b2843","src/subtrie.rs":"b0d11b82803a558f82135297b887b95720cbf7747f0c9a9b9aa33e207be2ecf6","src/test.rs":"56f8181ced4e774fa6115dd63156a0734b374612cc7dbab8a69a76776c8f2220","src/traversal.rs":"266db6012f9dab3303c70006060056ebd228597c1975853a394214005229bb0d","src/trie.rs":"7055b94dc750eddb476af22fef4c3116c8fcbfca0ca9fd49a242ddb290d7e9a2","src/trie_common.rs":"00b3034af74a14d056378330909b3a6accf6e08aed2b0fd077190c5bc3995962","src/trie_node.rs":"5e555589dd6a412260b6255823c6de5db31ddbe277aab2170c4658b0d358c2a1"},"package":"c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd"} \ No newline at end of file diff --git a/radix_trie-0.2.1/.cargo_vcs_info.json b/radix_trie-0.2.1/.cargo_vcs_info.json new file mode 100644 index 0000000000..48841b91f0 --- /dev/null +++ b/radix_trie-0.2.1/.cargo_vcs_info.json @@ -0,0 +1,5 @@ +{ + "git": { + "sha1": "21446ae3ef3c7b9916aadf195f630daa1da25874" + } +} diff --git a/radix_trie-0.2.1/.travis.yml b/radix_trie-0.2.1/.travis.yml new file mode 100644 index 0000000000..ab0fdd65e6 --- /dev/null +++ b/radix_trie-0.2.1/.travis.yml @@ -0,0 +1,9 @@ +language: rust +os: + - linux +before_script: + - rustup component add rustfmt-preview +script: + - cargo test --verbose --features serde + - cargo doc --no-deps --features serde + - cargo fmt --all -- --check diff --git a/radix_trie-0.2.1/CHANGELOG.md b/radix_trie-0.2.1/CHANGELOG.md new file mode 100644 index 0000000000..6cefb7ae35 --- /dev/null +++ b/radix_trie-0.2.1/CHANGELOG.md @@ -0,0 +1,36 @@ +Changelog +==== + +0.2.1: + * Implement `TrieKey` for vectors of integers (#63) + * Released 22/10/2020 + +0.2.0: + * Update `nibble_vec` to v0.1.0: faster and uses less memory! + * Released 28/06/2020 + +0.1.6: + +* Update to Rust 2018, add benchmarking code (#52) +* Appveyor CI for Windows (#42) +* No API changes or bugfixes + +0.1.5: + +* Fix another bug related to the removal of non-existent keys (#50) +* Implement `Clone` for `Trie` + +0.1.4: + +* Fix a panic that occurred when removing non-existent keys (#40) +* Reformat the code using the latest `rustfmt` + +0.1.3: + +* Add `prefix()` method for fetching the `NibbleVec` of a trie or subtrie +* Update `nibble_vec` to v0.0.4 +* Make better use of lifetime elision (type signatures will look different, but are the same) + +0.1.2: + +* Display README on crates.io (no code changes) diff --git a/radix_trie-0.2.1/Cargo.lock b/radix_trie-0.2.1/Cargo.lock new file mode 100644 index 0000000000..dfec94e956 --- /dev/null +++ b/radix_trie-0.2.1/Cargo.lock @@ -0,0 +1,819 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "aho-corasick" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.79 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bstr" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-automata 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bumpalo" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cast" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "clap" +version = "2.33.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "const_fn" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "criterion" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)", + "criterion-plot 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "oorandom 11.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "plotters 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_cbor 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "tinytemplate 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "criterion-plot" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-epoch 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "const_fn 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "const_fn 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "csv" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bstr 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "csv-core" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "env_logger" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "half" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hermit-abi" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.79 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itertools" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "js-sys" +version = "0.3.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wasm-bindgen 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.79" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "log" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "memchr" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.79 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "memchr" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "smallvec 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.79 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "oorandom" +version = "11.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "plotters" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "js-sys 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quickcheck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +dependencies = [ + "criterion 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "endian-type 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "nibble_vec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quickcheck 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_test 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.79 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.79 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rayon" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon-core" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-channel 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "regex-syntax 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-automata" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "regex-syntax" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde_cbor" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "half 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_test" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "smallvec" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "syn" +version = "1.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread-id" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.79 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread_local" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tinytemplate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-width" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "utf8-ranges" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bumpalo 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.68" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "web-sys" +version = "0.3.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "js-sys 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +"checksum autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum bstr 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf" +"checksum bumpalo 3.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +"checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +"checksum clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)" = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +"checksum const_fn 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2" +"checksum criterion 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "70daa7ceec6cf143990669a04c7df13391d55fb27bd4079d252fca774ba244d8" +"checksum criterion-plot 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e022feadec601fba1649cfa83586381a4ad31c6bf3a9ab7d408118b05dd9889d" +"checksum crossbeam-channel 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +"checksum crossbeam-deque 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" +"checksum crossbeam-epoch 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f" +"checksum crossbeam-utils 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5" +"checksum csv 1.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +"checksum csv-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" +"checksum either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +"checksum endian-type 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" +"checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum half 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" +"checksum hermit-abi 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +"checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" +"checksum itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +"checksum js-sys 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" +"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum libc 0.2.79 (registry+https://github.com/rust-lang/crates.io-index)" = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743" +"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +"checksum log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" +"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +"checksum memoffset 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +"checksum nibble_vec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +"checksum num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +"checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +"checksum oorandom 11.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a170cebd8021a008ea92e4db85a72f80b35df514ec664b296fdcbb654eac0b2c" +"checksum plotters 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d1685fbe7beba33de0330629da9d955ac75bd54f33d7b79f9a895590124f6bb" +"checksum proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +"checksum quickcheck 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "02c2411d418cea2364325b18a205664f9ef8252e06b2e911db97c0b0d98b1406" +"checksum quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rayon 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" +"checksum rayon-core 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" +"checksum regex 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b" +"checksum regex-automata 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" +"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" +"checksum regex-syntax 0.6.20 (registry+https://github.com/rust-lang/crates.io-index)" = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)" = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" +"checksum serde_cbor 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" +"checksum serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)" = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" +"checksum serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)" = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" +"checksum serde_test 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)" = "d9a49e2f787c0fddfd5e758cbbd3cbf81c3a8d12ef091283c52d9e9b4d417d3c" +"checksum smallvec 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" +"checksum syn 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad5de3220ea04da322618ded2c42233d02baca219d6f160a3e9c87cda16c942" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" +"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" +"checksum tinytemplate 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d3dc76004a03cec1c5932bca4cdc2e39aaa798e3f82363dd94f9adf6098c12f" +"checksum unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +"checksum unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" +"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +"checksum wasm-bindgen 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" +"checksum wasm-bindgen-backend 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68" +"checksum wasm-bindgen-macro 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038" +"checksum wasm-bindgen-macro-support 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe" +"checksum wasm-bindgen-shared 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" +"checksum web-sys 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +"checksum winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/radix_trie-0.2.1/Cargo.toml b/radix_trie-0.2.1/Cargo.toml new file mode 100644 index 0000000000..444d07872d --- /dev/null +++ b/radix_trie-0.2.1/Cargo.toml @@ -0,0 +1,59 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies +# +# If you believe there's an error in this file please file an +# issue against the rust-lang/cargo repository. If you're +# editing this file be aware that the upstream Cargo.toml +# will likely look very different (and much more reasonable) + +[package] +edition = "2018" +name = "radix_trie" +version = "0.2.1" +authors = ["Michael Sproul "] +description = "Generic radix trie data-structure." +documentation = "https://docs.rs/radix_trie/" +readme = "README.md" +keywords = ["trie", "patricia", "collection", "generic", "prefix"] +categories = ["data-structures", "text-processing"] +license = "MIT" +repository = "https://github.com/michaelsproul/rust_radix_trie" + +[lib] +bench = false + +[[bench]] +name = "trie_benches" +harness = false +[dependencies.endian-type] +version = "0.1.2" + +[dependencies.nibble_vec] +version = "0.1" + +[dependencies.serde] +version = "1.0" +optional = true +[dev-dependencies.criterion] +version = "0.3" + +[dev-dependencies.quickcheck] +version = "0.4" + +[dev-dependencies.rand] +version = "0.3" + +[dev-dependencies.serde_test] +version = "1.0" +[badges.appveyor] +repository = "michaelsproul/rust_radix_trie" + +[badges.maintenance] +status = "as-is" + +[badges.travis-ci] +repository = "michaelsproul/rust_radix_trie" diff --git a/radix_trie-0.2.1/Cargo.toml.orig b/radix_trie-0.2.1/Cargo.toml.orig new file mode 100644 index 0000000000..0e76b3ebea --- /dev/null +++ b/radix_trie-0.2.1/Cargo.toml.orig @@ -0,0 +1,37 @@ +[package] +name = "radix_trie" +version = "0.2.1" +description = "Generic radix trie data-structure." +edition = "2018" +license = "MIT" +authors = ["Michael Sproul "] + +repository = "https://github.com/michaelsproul/rust_radix_trie" +documentation = "https://docs.rs/radix_trie/" +readme = "README.md" + +keywords = ["trie", "patricia", "collection", "generic", "prefix"] +categories = ["data-structures", "text-processing"] + +[dependencies] +nibble_vec = "0.1" +endian-type = "0.1.2" +serde = { version = "1.0", optional = true } + +[dev-dependencies] +criterion = "0.3" +quickcheck = "0.4" +rand = "0.3" +serde_test = "1.0" + +[[bench]] +name = "trie_benches" +harness = false + +[lib] +bench = false + +[badges] +travis-ci = { repository = "michaelsproul/rust_radix_trie" } +appveyor = { repository = "michaelsproul/rust_radix_trie" } +maintenance = { status = "as-is" } diff --git a/radix_trie-0.2.1/LICENSE b/radix_trie-0.2.1/LICENSE new file mode 100644 index 0000000000..12ca847896 --- /dev/null +++ b/radix_trie-0.2.1/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Michael Sproul + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/radix_trie-0.2.1/README.md b/radix_trie-0.2.1/README.md new file mode 100644 index 0000000000..c726acd679 --- /dev/null +++ b/radix_trie-0.2.1/README.md @@ -0,0 +1,58 @@ +Rust Radix Trie +==== + +[![Unix Build Status](https://travis-ci.org/michaelsproul/rust_radix_trie.svg?branch=master)](https://travis-ci.org/michaelsproul/rust_radix_trie) +[![Windows Build Status](https://ci.appveyor.com/api/projects/status/d2voj1te0m7agfne/branch/master?svg=true)](https://ci.appveyor.com/project/michaelsproul/rust-radix-trie/branch/master) + +This is a [Radix Trie][radix-wiki] implementation in Rust, building on the lessons learnt from `TrieMap` and [Sequence Trie][seq-trie]. You can read about my experience implementing this data structure [here][radix-paper]. + +# Help Wanted, Enquire Within + +*Since writing this code I haven't used it in anger (or production) so it is no doubt in need of some maintenance, testing and optimisation love. If you would like to help out, try solving an open issue, optimise something, or just have a poke around! Thanks :)* + +# Features + +* Compressed nodes. Common key prefixes are stored only once. +* Trie-specific methods to look-up closest ancestors and descendants. +* Key Generic. Any type that can be serialised as a vector of bytes can be used as a key. +* Safe - no unsafe code. + +# Documentation + +https://docs.rs/radix_trie/ + +# Usage + +Available on [Crates.io][] as [`radix_trie`][radix-crate]. + +Just add `radix_trie` to the dependencies section of your `Cargo.toml`, like so: + +```toml +radix_trie = "0.2" +``` + +# Contributors + +Made by: + +* Allan Simon ([@allan-simon](https://github.com/allan-simon)) +* Andrew Smith ([@andrewcsmith](https://github.com/andrewcsmith)) +* Arthur Carcano ([@NougatRillettes](https://github.com/NougatRillettes)) +* Devin Ragotzy ([@DevinR528](https://github.com/DevinR528)) +* [@hanabi1224](https://github.com/hanabi1224) +* Jakob Dalsgaard ([@jakobdalsgaard](https://github.com/jakobdalsgaard)) +* Michael Sproul ([@michaelsproul](https://github.com/michaelsproul)) +* Robin Lambertz ([@roblabla](https://github.com/roblabla)) +* Sergey ([@Albibek](https://github.com/Albibek)) +* Stuart Hinson ([@stuarth](https://github.com/stuarth)) +* Vinzent Steinberg ([@vks](https://github.com/vks)) + +# License + +MIT License. Copyright © Michael Sproul and contributors 2015-present. + +[radix-wiki]: http://en.wikipedia.org/wiki/Radix_tree +[seq-trie]: https://github.com/michaelsproul/rust_sequence_trie +[radix-paper]: https://michaelsproul.github.io/rust_radix_paper/ +[crates.io]: https://crates.io/ +[radix-crate]: https://crates.io/crates/radix_trie diff --git a/radix_trie-0.2.1/appveyor.yml b/radix_trie-0.2.1/appveyor.yml new file mode 100644 index 0000000000..f14ae44c73 --- /dev/null +++ b/radix_trie-0.2.1/appveyor.yml @@ -0,0 +1,33 @@ +image: + - Visual Studio 2017 +environment: + matrix: + - RUST_TOOL_CHAIN: stable + - RUST_TOOL_CHAIN: nightly +before_build: + - rustc -V + - cargo -V + - rustup component add rustfmt-preview +build_script: + - cargo build --release +test_script: + - cargo test --release --verbose --features serde + - cargo doc --no-deps --features serde + - cargo fmt --all -- --check +branches: + only: + - master +pull_requests: + do_not_increment_build_number: true +matrix: + fast_finish: true +for: + - + matrix: + only: + - image: Visual Studio 2017 + install: + - ps: iex (new-object net.webclient).downloadstring('https://get.scoop.sh') + - scoop install rustup + - refreshenv + - rustup default %RUST_TOOL_CHAIN% diff --git a/radix_trie-0.2.1/benches/trie_benches.rs b/radix_trie-0.2.1/benches/trie_benches.rs new file mode 100644 index 0000000000..6c5e7444cb --- /dev/null +++ b/radix_trie-0.2.1/benches/trie_benches.rs @@ -0,0 +1,60 @@ +use criterion::{criterion_group, criterion_main, Criterion}; +use radix_trie::Trie; + +fn get_text() -> Vec { + use std::fs::File; + use std::io::Read; + const DATA: &[&str] = &["data/1984.txt", "data/sun-rising.txt"]; + let mut contents = String::new(); + File::open(&DATA[1]) + .unwrap() + .read_to_string(&mut contents) + .unwrap(); + contents + .split(|c: char| c.is_whitespace()) + .map(|s| s.to_string()) + .collect() +} + +fn make_trie(words: &[String]) -> Trie<&str, usize> { + let mut trie = Trie::new(); + for w in words { + trie.insert(&w[..], w.len()); + } + trie +} + +fn trie_insert(b: &mut Criterion) { + let words = get_text(); + b.bench_function("trie insert", |b| b.iter(|| make_trie(&words))); +} + +fn trie_get(b: &mut Criterion) { + let words = get_text(); + let trie = make_trie(&words); + b.bench_function("trie get", |b| { + b.iter(|| { + words + .iter() + .map(|w| trie.get(&&w[..])) + .collect::>>() + }) + }); +} + +fn trie_insert_remove(b: &mut Criterion) { + let words = get_text(); + + b.bench_function("trie remove", |b| { + b.iter(|| { + let mut trie = make_trie(&words); + for w in &words { + trie.remove(&&w[..]); + } + }); + }); +} + +criterion_group!(benches, trie_insert, trie_get, trie_insert_remove); + +criterion_main!(benches); diff --git a/radix_trie-0.2.1/data/1984.txt b/radix_trie-0.2.1/data/1984.txt new file mode 100644 index 0000000000..c4dc2339de --- /dev/null +++ b/radix_trie-0.2.1/data/1984.txt @@ -0,0 +1,10281 @@ +PART ONE + + + +Chapter 1 + + + +It was a bright cold day in April, and the clocks were striking thirteen. +Winston Smith, his chin nuzzled into his breast in an effort to escape the +vile wind, slipped quickly through the glass doors of Victory Mansions, +though not quickly enough to prevent a swirl of gritty dust from entering +along with him. + +The hallway smelt of boiled cabbage and old rag mats. At one end of it a +coloured poster, too large for indoor display, had been tacked to the wall. +It depicted simply an enormous face, more than a metre wide: the face of a +man of about forty-five, with a heavy black moustache and ruggedly handsome +features. Winston made for the stairs. It was no use trying the lift. Even +at the best of times it was seldom working, and at present the electric +current was cut off during daylight hours. It was part of the economy drive +in preparation for Hate Week. The flat was seven flights up, and Winston, +who was thirty-nine and had a varicose ulcer above his right ankle, went +slowly, resting several times on the way. On each landing, opposite the +lift-shaft, the poster with the enormous face gazed from the wall. It was +one of those pictures which are so contrived that the eyes follow you about +when you move. BIG BROTHER IS WATCHING YOU, the caption beneath it ran. + +Inside the flat a fruity voice was reading out a list of figures which had +something to do with the production of pig-iron. The voice came from an +oblong metal plaque like a dulled mirror which formed part of the surface +of the right-hand wall. Winston turned a switch and the voice sank +somewhat, though the words were still distinguishable. The instrument +(the telescreen, it was called) could be dimmed, but there was no way of +shutting it off completely. He moved over to the window: a smallish, frail +figure, the meagreness of his body merely emphasized by the blue overalls +which were the uniform of the party. His hair was very fair, his face +naturally sanguine, his skin roughened by coarse soap and blunt razor +blades and the cold of the winter that had just ended. + +Outside, even through the shut window-pane, the world looked cold. Down in +the street little eddies of wind were whirling dust and torn paper into +spirals, and though the sun was shining and the sky a harsh blue, there +seemed to be no colour in anything, except the posters that were plastered +everywhere. The black-moustachio'd face gazed down from every commanding +corner. There was one on the house-front immediately opposite. BIG BROTHER +IS WATCHING YOU, the caption said, while the dark eyes looked deep into +Winston's own. Down at street level another poster, torn at one corner, +flapped fitfully in the wind, alternately covering and uncovering the +single word INGSOC. In the far distance a helicopter skimmed down between +the roofs, hovered for an instant like a bluebottle, and darted away again +with a curving flight. It was the police patrol, snooping into people's +windows. The patrols did not matter, however. Only the Thought Police +mattered. + +Behind Winston's back the voice from the telescreen was still babbling away +about pig-iron and the overfulfilment of the Ninth Three-Year Plan. The +telescreen received and transmitted simultaneously. Any sound that Winston +made, above the level of a very low whisper, would be picked up by it, +moreover, so long as he remained within the field of vision which the metal +plaque commanded, he could be seen as well as heard. There was of course +no way of knowing whether you were being watched at any given moment. How +often, or on what system, the Thought Police plugged in on any individual +wire was guesswork. It was even conceivable that they watched everybody all +the time. But at any rate they could plug in your wire whenever they wanted +to. You had to live--did live, from habit that became instinct--in the +assumption that every sound you made was overheard, and, except in +darkness, every movement scrutinized. + +Winston kept his back turned to the telescreen. It was safer; though, as he +well knew, even a back can be revealing. A kilometre away the Ministry of +Truth, his place of work, towered vast and white above the grimy landscape. +This, he thought with a sort of vague distaste--this was London, chief +city of Airstrip One, itself the third most populous of the provinces of +Oceania. He tried to squeeze out some childhood memory that should tell him +whether London had always been quite like this. Were there always these +vistas of rotting nineteenth-century houses, their sides shored up with +baulks of timber, their windows patched with cardboard and their roofs +with corrugated iron, their crazy garden walls sagging in all directions? +And the bombed sites where the plaster dust swirled in the air and the +willow-herb straggled over the heaps of rubble; and the places where the +bombs had cleared a larger patch and there had sprung up sordid colonies +of wooden dwellings like chicken-houses? But it was no use, he could not +remember: nothing remained of his childhood except a series of bright-lit +tableaux occurring against no background and mostly unintelligible. + +The Ministry of Truth--Minitrue, in Newspeak [Newspeak was the official +language of Oceania. For an account of its structure and etymology see +Appendix.]--was startlingly different from any other object in sight. It +was an enormous pyramidal structure of glittering white concrete, soaring +up, terrace after terrace, 300 metres into the air. From where Winston +stood it was just possible to read, picked out on its white face in +elegant lettering, the three slogans of the Party: + + + WAR IS PEACE + FREEDOM IS SLAVERY + IGNORANCE IS STRENGTH + + +The Ministry of Truth contained, it was said, three thousand rooms above +ground level, and corresponding ramifications below. Scattered about London +there were just three other buildings of similar appearance and size. So +completely did they dwarf the surrounding architecture that from the roof +of Victory Mansions you could see all four of them simultaneously. They +were the homes of the four Ministries between which the entire apparatus +of government was divided. The Ministry of Truth, which concerned itself +with news, entertainment, education, and the fine arts. The Ministry of +Peace, which concerned itself with war. The Ministry of Love, which +maintained law and order. And the Ministry of Plenty, which was responsible +for economic affairs. Their names, in Newspeak: Minitrue, Minipax, Miniluv, +and Miniplenty. + +The Ministry of Love was the really frightening one. There were no windows +in it at all. Winston had never been inside the Ministry of Love, nor +within half a kilometre of it. It was a place impossible to enter except +on official business, and then only by penetrating through a maze of +barbed-wire entanglements, steel doors, and hidden machine-gun nests. Even +the streets leading up to its outer barriers were roamed by gorilla-faced +guards in black uniforms, armed with jointed truncheons. + +Winston turned round abruptly. He had set his features into the +expression of quiet optimism which it was advisable to wear when facing +the telescreen. He crossed the room into the tiny kitchen. By leaving +the Ministry at this time of day he had sacrificed his lunch in the +canteen, and he was aware that there was no food in the kitchen except +a hunk of dark-coloured bread which had got to be saved for tomorrow's +breakfast. He took down from the shelf a bottle of colourless liquid +with a plain white label marked VICTORY GIN. It gave off a sickly, oily +smell, as of Chinese rice-spirit. Winston poured out nearly a teacupful, +nerved himself for a shock, and gulped it down like a dose of medicine. + +Instantly his face turned scarlet and the water ran out of his eyes. The +stuff was like nitric acid, and moreover, in swallowing it one had the +sensation of being hit on the back of the head with a rubber club. The +next moment, however, the burning in his belly died down and the world +began to look more cheerful. He took a cigarette from a crumpled packet +marked VICTORY CIGARETTES and incautiously held it upright, whereupon the +tobacco fell out on to the floor. With the next he was more successful. +He went back to the living-room and sat down at a small table that stood +to the left of the telescreen. From the table drawer he took out a +penholder, a bottle of ink, and a thick, quarto-sized blank book with a +red back and a marbled cover. + +For some reason the telescreen in the living-room was in an unusual +position. Instead of being placed, as was normal, in the end wall, where +it could command the whole room, it was in the longer wall, opposite the +window. To one side of it there was a shallow alcove in which Winston +was now sitting, and which, when the flats were built, had probably been +intended to hold bookshelves. By sitting in the alcove, and keeping well +back, Winston was able to remain outside the range of the telescreen, so +far as sight went. He could be heard, of course, but so long as he stayed +in his present position he could not be seen. It was partly the unusual +geography of the room that had suggested to him the thing that he was now +about to do. + +But it had also been suggested by the book that he had just taken out of +the drawer. It was a peculiarly beautiful book. Its smooth creamy paper, +a little yellowed by age, was of a kind that had not been manufactured for +at least forty years past. He could guess, however, that the book was much +older than that. He had seen it lying in the window of a frowsy little +junk-shop in a slummy quarter of the town (just what quarter he did not +now remember) and had been stricken immediately by an overwhelming desire +to possess it. Party members were supposed not to go into ordinary shops +('dealing on the free market', it was called), but the rule was not +strictly kept, because there were various things, such as shoelaces and +razor blades, which it was impossible to get hold of in any other way. He +had given a quick glance up and down the street and then had slipped inside +and bought the book for two dollars fifty. At the time he was not conscious +of wanting it for any particular purpose. He had carried it guiltily home +in his briefcase. Even with nothing written in it, it was a compromising +possession. + +The thing that he was about to do was to open a diary. This was not illegal +(nothing was illegal, since there were no longer any laws), but if detected +it was reasonably certain that it would be punished by death, or at least +by twenty-five years in a forced-labour camp. Winston fitted a nib into +the penholder and sucked it to get the grease off. The pen was an archaic +instrument, seldom used even for signatures, and he had procured one, +furtively and with some difficulty, simply because of a feeling that the +beautiful creamy paper deserved to be written on with a real nib instead +of being scratched with an ink-pencil. Actually he was not used to writing +by hand. Apart from very short notes, it was usual to dictate everything +into the speak-write which was of course impossible for his present +purpose. He dipped the pen into the ink and then faltered for just a +second. A tremor had gone through his bowels. To mark the paper was the +decisive act. In small clumsy letters he wrote: + + + April 4th, 1984. + + +He sat back. A sense of complete helplessness had descended upon him. To +begin with, he did not know with any certainty that this was 1984. It +must be round about that date, since he was fairly sure that his age was +thirty-nine, and he believed that he had been born in 1944 or 1945; but +it was never possible nowadays to pin down any date within a year or two. + +For whom, it suddenly occurred to him to wonder, was he writing this diary? +For the future, for the unborn. His mind hovered for a moment round the +doubtful date on the page, and then fetched up with a bump against the +Newspeak word DOUBLETHINK. For the first time the magnitude of what he had +undertaken came home to him. How could you communicate with the future? It +was of its nature impossible. Either the future would resemble the present, +in which case it would not listen to him: or it would be different from it, +and his predicament would be meaningless. + +For some time he sat gazing stupidly at the paper. The telescreen had +changed over to strident military music. It was curious that he seemed +not merely to have lost the power of expressing himself, but even to have +forgotten what it was that he had originally intended to say. For weeks +past he had been making ready for this moment, and it had never crossed +his mind that anything would be needed except courage. The actual writing +would be easy. All he had to do was to transfer to paper the interminable +restless monologue that had been running inside his head, literally for +years. At this moment, however, even the monologue had dried up. Moreover +his varicose ulcer had begun itching unbearably. He dared not scratch it, +because if he did so it always became inflamed. The seconds were ticking +by. He was conscious of nothing except the blankness of the page in front +of him, the itching of the skin above his ankle, the blaring of the music, +and a slight booziness caused by the gin. + +Suddenly he began writing in sheer panic, only imperfectly aware of what +he was setting down. His small but childish handwriting straggled up and +down the page, shedding first its capital letters and finally even its +full stops: + + + April 4th, 1984. Last night to the flicks. All war films. One very good +one of a ship full of refugees being bombed somewhere in the Mediterranean. +Audience much amused by shots of a great huge fat man trying to swim away +with a helicopter after him, first you saw him wallowing along in the +water like a porpoise, then you saw him through the helicopters gunsights, +then he was full of holes and the sea round him turned pink and he sank as +suddenly as though the holes had let in the water, audience shouting with +laughter when he sank. then you saw a lifeboat full of children with a +helicopter hovering over it. there was a middle-aged woman might have been +a jewess sitting up in the bow with a little boy about three years old in +her arms. little boy screaming with fright and hiding his head between her +breasts as if he was trying to burrow right into her and the woman putting +her arms round him and comforting him although she was blue with fright +herself, all the time covering him up as much as possible as if she thought +her arms could keep the bullets off him. then the helicopter planted a 20 +kilo bomb in among them terrific flash and the boat went all to matchwood. +then there was a wonderful shot of a child's arm going up up up right up +into the air a helicopter with a camera in its nose must have followed it +up and there was a lot of applause from the party seats but a woman down in +the prole part of the house suddenly started kicking up a fuss and shouting +they didnt oughter of showed it not in front of kids they didnt it aint +right not in front of kids it aint until the police turned her turned her +out i dont suppose anything happened to her nobody cares what the proles +say typical prole reaction they never---- + + +Winston stopped writing, partly because he was suffering from cramp. He did +not know what had made him pour out this stream of rubbish. But the curious +thing was that while he was doing so a totally different memory had +clarified itself in his mind, to the point where he almost felt equal to +writing it down. It was, he now realized, because of this other incident +that he had suddenly decided to come home and begin the diary today. + +It had happened that morning at the Ministry, if anything so nebulous could +be said to happen. + +It was nearly eleven hundred, and in the Records Department, where Winston +worked, they were dragging the chairs out of the cubicles and grouping them +in the centre of the hall opposite the big telescreen, in preparation for +the Two Minutes Hate. Winston was just taking his place in one of the +middle rows when two people whom he knew by sight, but had never spoken +to, came unexpectedly into the room. One of them was a girl whom he often +passed in the corridors. He did not know her name, but he knew that she +worked in the Fiction Department. Presumably--since he had sometimes seen +her with oily hands and carrying a spanner--she had some mechanical job +on one of the novel-writing machines. She was a bold-looking girl, of +about twenty-seven, with thick hair, a freckled face, and swift, athletic +movements. A narrow scarlet sash, emblem of the Junior Anti-Sex League, was +wound several times round the waist of her overalls, just tightly enough to +bring out the shapeliness of her hips. Winston had disliked her from the +very first moment of seeing her. He knew the reason. It was because of the +atmosphere of hockey-fields and cold baths and community hikes and general +clean-mindedness which she managed to carry about with her. He disliked +nearly all women, and especially the young and pretty ones. It was always +the women, and above all the young ones, who were the most bigoted +adherents of the Party, the swallowers of slogans, the amateur spies and +nosers-out of unorthodoxy. But this particular girl gave him the impression +of being more dangerous than most. Once when they passed in the corridor +she gave him a quick sidelong glance which seemed to pierce right into +him and for a moment had filled him with black terror. The idea had even +crossed his mind that she might be an agent of the Thought Police. That, +it was true, was very unlikely. Still, he continued to feel a peculiar +uneasiness, which had fear mixed up in it as well as hostility, whenever +she was anywhere near him. + +The other person was a man named O'Brien, a member of the Inner Party and +holder of some post so important and remote that Winston had only a dim +idea of its nature. A momentary hush passed over the group of people +round the chairs as they saw the black overalls of an Inner Party member +approaching. O'Brien was a large, burly man with a thick neck and a coarse, +humorous, brutal face. In spite of his formidable appearance he had a +certain charm of manner. He had a trick of resettling his spectacles on +his nose which was curiously disarming--in some indefinable way, curiously +civilized. It was a gesture which, if anyone had still thought in such +terms, might have recalled an eighteenth-century nobleman offering his +snuffbox. Winston had seen O'Brien perhaps a dozen times in almost as many +years. He felt deeply drawn to him, and not solely because he was intrigued +by the contrast between O'Brien's urbane manner and his prize-fighter's +physique. Much more it was because of a secretly held belief--or perhaps +not even a belief, merely a hope--that O'Brien's political orthodoxy was +not perfect. Something in his face suggested it irresistibly. And again, +perhaps it was not even unorthodoxy that was written in his face, but +simply intelligence. But at any rate he had the appearance of being a +person that you could talk to if somehow you could cheat the telescreen and +get him alone. Winston had never made the smallest effort to verify this +guess: indeed, there was no way of doing so. At this moment O'Brien glanced +at his wrist-watch, saw that it was nearly eleven hundred, and evidently +decided to stay in the Records Department until the Two Minutes Hate was +over. He took a chair in the same row as Winston, a couple of places away. +A small, sandy-haired woman who worked in the next cubicle to Winston was +between them. The girl with dark hair was sitting immediately behind. + +The next moment a hideous, grinding speech, as of some monstrous machine +running without oil, burst from the big telescreen at the end of the room. +It was a noise that set one's teeth on edge and bristled the hair at the +back of one's neck. The Hate had started. + +As usual, the face of Emmanuel Goldstein, the Enemy of the People, had +flashed on to the screen. There were hisses here and there among the +audience. The little sandy-haired woman gave a squeak of mingled fear and +disgust. Goldstein was the renegade and backslider who once, long ago +(how long ago, nobody quite remembered), had been one of the leading +figures of the Party, almost on a level with Big Brother himself, and +then had engaged in counter-revolutionary activities, had been condemned +to death, and had mysteriously escaped and disappeared. The programmes +of the Two Minutes Hate varied from day to day, but there was none in +which Goldstein was not the principal figure. He was the primal traitor, +the earliest defiler of the Party's purity. All subsequent crimes against +the Party, all treacheries, acts of sabotage, heresies, deviations, +sprang directly out of his teaching. Somewhere or other he was still +alive and hatching his conspiracies: perhaps somewhere beyond the sea, +under the protection of his foreign paymasters, perhaps even--so it was +occasionally rumoured--in some hiding-place in Oceania itself. + +Winston's diaphragm was constricted. He could never see the face of +Goldstein without a painful mixture of emotions. It was a lean Jewish face, +with a great fuzzy aureole of white hair and a small goatee beard--a +clever face, and yet somehow inherently despicable, with a kind of senile +silliness in the long thin nose, near the end of which a pair of spectacles +was perched. It resembled the face of a sheep, and the voice, too, had a +sheep-like quality. Goldstein was delivering his usual venomous attack +upon the doctrines of the Party--an attack so exaggerated and perverse that +a child should have been able to see through it, and yet just plausible +enough to fill one with an alarmed feeling that other people, less +level-headed than oneself, might be taken in by it. He was abusing Big +Brother, he was denouncing the dictatorship of the Party, he was demanding +the immediate conclusion of peace with Eurasia, he was advocating freedom +of speech, freedom of the Press, freedom of assembly, freedom of thought, +he was crying hysterically that the revolution had been betrayed--and all +this in rapid polysyllabic speech which was a sort of parody of the +habitual style of the orators of the Party, and even contained Newspeak +words: more Newspeak words, indeed, than any Party member would normally +use in real life. And all the while, lest one should be in any doubt as to +the reality which Goldstein's specious claptrap covered, behind his head on +the telescreen there marched the endless columns of the Eurasian army--row +after row of solid-looking men with expressionless Asiatic faces, who swam +up to the surface of the screen and vanished, to be replaced by others +exactly similar. The dull rhythmic tramp of the soldiers' boots formed the +background to Goldstein's bleating voice. + +Before the Hate had proceeded for thirty seconds, uncontrollable +exclamations of rage were breaking out from half the people in the room. +The self-satisfied sheep-like face on the screen, and the terrifying power +of the Eurasian army behind it, were too much to be borne: besides, +the sight or even the thought of Goldstein produced fear and anger +automatically. He was an object of hatred more constant than either Eurasia +or Eastasia, since when Oceania was at war with one of these Powers it was +generally at peace with the other. But what was strange was that although +Goldstein was hated and despised by everybody, although every day and a +thousand times a day, on platforms, on the telescreen, in newspapers, +in books, his theories were refuted, smashed, ridiculed, held up to the +general gaze for the pitiful rubbish that they were--in spite of all this, +his influence never seemed to grow less. Always there were fresh dupes +waiting to be seduced by him. A day never passed when spies and saboteurs +acting under his directions were not unmasked by the Thought Police. +He was the commander of a vast shadowy army, an underground network of +conspirators dedicated to the overthrow of the State. The Brotherhood, its +name was supposed to be. There were also whispered stories of a terrible +book, a compendium of all the heresies, of which Goldstein was the author +and which circulated clandestinely here and there. It was a book without a +title. People referred to it, if at all, simply as THE BOOK. But one knew +of such things only through vague rumours. Neither the Brotherhood nor +THE BOOK was a subject that any ordinary Party member would mention if +there was a way of avoiding it. + +In its second minute the Hate rose to a frenzy. People were leaping up and +down in their places and shouting at the tops of their voices in an effort +to drown the maddening bleating voice that came from the screen. The little +sandy-haired woman had turned bright pink, and her mouth was opening and +shutting like that of a landed fish. Even O'Brien's heavy face was flushed. +He was sitting very straight in his chair, his powerful chest swelling and +quivering as though he were standing up to the assault of a wave. The +dark-haired girl behind Winston had begun crying out 'Swine! Swine! Swine!' +and suddenly she picked up a heavy Newspeak dictionary and flung it at the +screen. It struck Goldstein's nose and bounced off; the voice continued +inexorably. In a lucid moment Winston found that he was shouting with the +others and kicking his heel violently against the rung of his chair. The +horrible thing about the Two Minutes Hate was not that one was obliged to +act a part, but, on the contrary, that it was impossible to avoid joining +in. Within thirty seconds any pretence was always unnecessary. A hideous +ecstasy of fear and vindictiveness, a desire to kill, to torture, to smash +faces in with a sledge-hammer, seemed to flow through the whole group of +people like an electric current, turning one even against one's will into +a grimacing, screaming lunatic. And yet the rage that one felt was an +abstract, undirected emotion which could be switched from one object to +another like the flame of a blowlamp. Thus, at one moment Winston's hatred +was not turned against Goldstein at all, but, on the contrary, against +Big Brother, the Party, and the Thought Police; and at such moments his +heart went out to the lonely, derided heretic on the screen, sole guardian +of truth and sanity in a world of lies. And yet the very next instant he +was at one with the people about him, and all that was said of Goldstein +seemed to him to be true. At those moments his secret loathing of Big +Brother changed into adoration, and Big Brother seemed to tower up, an +invincible, fearless protector, standing like a rock against the hordes +of Asia, and Goldstein, in spite of his isolation, his helplessness, and +the doubt that hung about his very existence, seemed like some sinister +enchanter, capable by the mere power of his voice of wrecking the structure +of civilization. + +It was even possible, at moments, to switch one's hatred this way or that +by a voluntary act. Suddenly, by the sort of violent effort with which one +wrenches one's head away from the pillow in a nightmare, Winston succeeded +in transferring his hatred from the face on the screen to the dark-haired +girl behind him. Vivid, beautiful hallucinations flashed through his mind. +He would flog her to death with a rubber truncheon. He would tie her naked +to a stake and shoot her full of arrows like Saint Sebastian. He would +ravish her and cut her throat at the moment of climax. Better than before, +moreover, he realized WHY it was that he hated her. He hated her because +she was young and pretty and sexless, because he wanted to go to bed with +her and would never do so, because round her sweet supple waist, which +seemed to ask you to encircle it with your arm, there was only the odious +scarlet sash, aggressive symbol of chastity. + +The Hate rose to its climax. The voice of Goldstein had become an actual +sheep's bleat, and for an instant the face changed into that of a sheep. +Then the sheep-face melted into the figure of a Eurasian soldier who seemed +to be advancing, huge and terrible, his sub-machine gun roaring, and +seeming to spring out of the surface of the screen, so that some of the +people in the front row actually flinched backwards in their seats. But +in the same moment, drawing a deep sigh of relief from everybody, the +hostile figure melted into the face of Big Brother, black-haired, +black-moustachio'd, full of power and mysterious calm, and so vast that +it almost filled up the screen. Nobody heard what Big Brother was saying. +It was merely a few words of encouragement, the sort of words that are +uttered in the din of battle, not distinguishable individually but +restoring confidence by the fact of being spoken. Then the face of Big +Brother faded away again, and instead the three slogans of the Party stood +out in bold capitals: + + + WAR IS PEACE + FREEDOM IS SLAVERY + IGNORANCE IS STRENGTH + + +But the face of Big Brother seemed to persist for several seconds on the +screen, as though the impact that it had made on everyone's eyeballs was +too vivid to wear off immediately. The little sandy-haired woman had flung +herself forward over the back of the chair in front of her. With a +tremulous murmur that sounded like 'My Saviour!' she extended her arms +towards the screen. Then she buried her face in her hands. It was apparent +that she was uttering a prayer. + +At this moment the entire group of people broke into a deep, slow, +rhythmical chant of 'B-B!...B-B!'--over and over again, very slowly, with a +long pause between the first 'B' and the second--a heavy, murmurous sound, +somehow curiously savage, in the background of which one seemed to hear the +stamp of naked feet and the throbbing of tom-toms. For perhaps as much as +thirty seconds they kept it up. It was a refrain that was often heard in +moments of overwhelming emotion. Partly it was a sort of hymn to the wisdom +and majesty of Big Brother, but still more it was an act of self-hypnosis, +a deliberate drowning of consciousness by means of rhythmic noise. +Winston's entrails seemed to grow cold. In the Two Minutes Hate he could +not help sharing in the general delirium, but this sub-human chanting of +'B-B!...B-B!' always filled him with horror. Of course he chanted with the +rest: it was impossible to do otherwise. To dissemble your feelings, to +control your face, to do what everyone else was doing, was an instinctive +reaction. But there was a space of a couple of seconds during which the +expression of his eyes might conceivably have betrayed him. And it was +exactly at this moment that the significant thing happened--if, indeed, +it did happen. + +Momentarily he caught O'Brien's eye. O'Brien had stood up. He had taken +off his spectacles and was in the act of resettling them on his nose with +his characteristic gesture. But there was a fraction of a second when +their eyes met, and for as long as it took to happen Winston knew--yes, he +KNEW!--that O'Brien was thinking the same thing as himself. An unmistakable +message had passed. It was as though their two minds had opened and the +thoughts were flowing from one into the other through their eyes. 'I am +with you,' O'Brien seemed to be saying to him. 'I know precisely what you +are feeling. I know all about your contempt, your hatred, your disgust. +But don't worry, I am on your side!' And then the flash of intelligence +was gone, and O'Brien's face was as inscrutable as everybody else's. + +That was all, and he was already uncertain whether it had happened. Such +incidents never had any sequel. All that they did was to keep alive in him +the belief, or hope, that others besides himself were the enemies of the +Party. Perhaps the rumours of vast underground conspiracies were true after +all--perhaps the Brotherhood really existed! It was impossible, in spite +of the endless arrests and confessions and executions, to be sure that the +Brotherhood was not simply a myth. Some days he believed in it, some days +not. There was no evidence, only fleeting glimpses that might mean anything +or nothing: snatches of overheard conversation, faint scribbles on lavatory +walls--once, even, when two strangers met, a small movement of the hand +which had looked as though it might be a signal of recognition. It was all +guesswork: very likely he had imagined everything. He had gone back to his +cubicle without looking at O'Brien again. The idea of following up their +momentary contact hardly crossed his mind. It would have been inconceivably +dangerous even if he had known how to set about doing it. For a second, two +seconds, they had exchanged an equivocal glance, and that was the end of +the story. But even that was a memorable event, in the locked loneliness in +which one had to live. + +Winston roused himself and sat up straighter. He let out a belch. The gin +was rising from his stomach. + +His eyes re-focused on the page. He discovered that while he sat helplessly +musing he had also been writing, as though by automatic action. And it was +no longer the same cramped, awkward handwriting as before. His pen had slid +voluptuously over the smooth paper, printing in large neat capitals-- + + + DOWN WITH BIG BROTHER + DOWN WITH BIG BROTHER + DOWN WITH BIG BROTHER + DOWN WITH BIG BROTHER + DOWN WITH BIG BROTHER + + +over and over again, filling half a page. + +He could not help feeling a twinge of panic. It was absurd, since the +writing of those particular words was not more dangerous than the initial +act of opening the diary, but for a moment he was tempted to tear out the +spoiled pages and abandon the enterprise altogether. + +He did not do so, however, because he knew that it was useless. Whether he +wrote DOWN WITH BIG BROTHER, or whether he refrained from writing it, made +no difference. Whether he went on with the diary, or whether he did not go +on with it, made no difference. The Thought Police would get him just the +same. He had committed--would still have committed, even if he had never +set pen to paper--the essential crime that contained all others in itself. +Thoughtcrime, they called it. Thoughtcrime was not a thing that could be +concealed for ever. You might dodge successfully for a while, even for +years, but sooner or later they were bound to get you. + +It was always at night--the arrests invariably happened at night. The +sudden jerk out of sleep, the rough hand shaking your shoulder, the lights +glaring in your eyes, the ring of hard faces round the bed. In the vast +majority of cases there was no trial, no report of the arrest. People +simply disappeared, always during the night. Your name was removed from the +registers, every record of everything you had ever done was wiped out, your +one-time existence was denied and then forgotten. You were abolished, +annihilated: VAPORIZED was the usual word. + +For a moment he was seized by a kind of hysteria. He began writing in a +hurried untidy scrawl: + + + theyll shoot me i don't care theyll shoot me in the back of the neck i +dont care down with big brother they always shoot you in the back of the +neck i dont care down with big brother---- + + +He sat back in his chair, slightly ashamed of himself, and laid down +the pen. The next moment he started violently. There was a knocking at +the door. + +Already! He sat as still as a mouse, in the futile hope that whoever it was +might go away after a single attempt. But no, the knocking was repeated. +The worst thing of all would be to delay. His heart was thumping like a +drum, but his face, from long habit, was probably expressionless. He got +up and moved heavily towards the door. + + + + +Chapter 2 + + + +As he put his hand to the door-knob Winston saw that he had left the +diary open on the table. DOWN WITH BIG BROTHER was written all over it, +in letters almost big enough to be legible across the room. It was an +inconceivably stupid thing to have done. But, he realized, even in his +panic he had not wanted to smudge the creamy paper by shutting the book +while the ink was wet. + +He drew in his breath and opened the door. Instantly a warm wave of relief +flowed through him. A colourless, crushed-looking woman, with wispy hair +and a lined face, was standing outside. + +'Oh, comrade,' she began in a dreary, whining sort of voice, 'I thought I +heard you come in. Do you think you could come across and have a look at +our kitchen sink? It's got blocked up and----' + +It was Mrs Parsons, the wife of a neighbour on the same floor. ('Mrs' was +a word somewhat discountenanced by the Party--you were supposed to call +everyone 'comrade'--but with some women one used it instinctively.) She was +a woman of about thirty, but looking much older. One had the impression +that there was dust in the creases of her face. Winston followed her down +the passage. These amateur repair jobs were an almost daily irritation. +Victory Mansions were old flats, built in 1930 or thereabouts, and were +falling to pieces. The plaster flaked constantly from ceilings and walls, +the pipes burst in every hard frost, the roof leaked whenever there was +snow, the heating system was usually running at half steam when it was not +closed down altogether from motives of economy. Repairs, except what you +could do for yourself, had to be sanctioned by remote committees which +were liable to hold up even the mending of a window-pane for two years. + +'Of course it's only because Tom isn't home,' said Mrs Parsons vaguely. + +The Parsons' flat was bigger than Winston's, and dingy in a different +way. Everything had a battered, trampled-on look, as though the +place had just been visited by some large violent animal. Games +impedimenta--hockey-sticks, boxing-gloves, a burst football, a pair of +sweaty shorts turned inside out--lay all over the floor, and on the +table there was a litter of dirty dishes and dog-eared exercise-books. +On the walls were scarlet banners of the Youth League and the Spies, and +a full-sized poster of Big Brother. There was the usual boiled-cabbage +smell, common to the whole building, but it was shot through by a sharper +reek of sweat, which--one knew this at the first sniff, though it was +hard to say how--was the sweat of some person not present at the moment. +In another room someone with a comb and a piece of toilet paper was +trying to keep tune with the military music which was still issuing +from the telescreen. + +'It's the children,' said Mrs Parsons, casting a half-apprehensive glance +at the door. 'They haven't been out today. And of course----' + +She had a habit of breaking off her sentences in the middle. The kitchen +sink was full nearly to the brim with filthy greenish water which smelt +worse than ever of cabbage. Winston knelt down and examined the angle-joint +of the pipe. He hated using his hands, and he hated bending down, which was +always liable to start him coughing. Mrs Parsons looked on helplessly. + +'Of course if Tom was home he'd put it right in a moment,' she said. +'He loves anything like that. He's ever so good with his hands, Tom is.' + +Parsons was Winston's fellow-employee at the Ministry of Truth. He was +a fattish but active man of paralysing stupidity, a mass of imbecile +enthusiasms--one of those completely unquestioning, devoted drudges on +whom, more even than on the Thought Police, the stability of the Party +depended. At thirty-five he had just been unwillingly evicted from the +Youth League, and before graduating into the Youth League he had managed to +stay on in the Spies for a year beyond the statutory age. At the Ministry +he was employed in some subordinate post for which intelligence was not +required, but on the other hand he was a leading figure on the Sports +Committee and all the other committees engaged in organizing community +hikes, spontaneous demonstrations, savings campaigns, and voluntary +activities generally. He would inform you with quiet pride, between whiffs +of his pipe, that he had put in an appearance at the Community Centre every +evening for the past four years. An overpowering smell of sweat, a sort of +unconscious testimony to the strenuousness of his life, followed him about +wherever he went, and even remained behind him after he had gone. + +'Have you got a spanner?' said Winston, fiddling with the nut on the +angle-joint. + +'A spanner,' said Mrs Parsons, immediately becoming invertebrate. 'I don't +know, I'm sure. Perhaps the children----' + +There was a trampling of boots and another blast on the comb as the +children charged into the living-room. Mrs Parsons brought the spanner. +Winston let out the water and disgustedly removed the clot of human hair +that had blocked up the pipe. He cleaned his fingers as best he could in +the cold water from the tap and went back into the other room. + +'Up with your hands!' yelled a savage voice. + +A handsome, tough-looking boy of nine had popped up from behind the table +and was menacing him with a toy automatic pistol, while his small sister, +about two years younger, made the same gesture with a fragment of wood. +Both of them were dressed in the blue shorts, grey shirts, and red +neckerchiefs which were the uniform of the Spies. Winston raised his hands +above his head, but with an uneasy feeling, so vicious was the boy's +demeanour, that it was not altogether a game. + +'You're a traitor!' yelled the boy. 'You're a thought-criminal! You're a +Eurasian spy! I'll shoot you, I'll vaporize you, I'll send you to the salt +mines!' + +Suddenly they were both leaping round him, shouting 'Traitor!' and +'Thought-criminal!' the little girl imitating her brother in every +movement. It was somehow slightly frightening, like the gambolling of +tiger cubs which will soon grow up into man-eaters. There was a sort of +calculating ferocity in the boy's eye, a quite evident desire to hit or +kick Winston and a consciousness of being very nearly big enough to do so. +It was a good job it was not a real pistol he was holding, Winston thought. + +Mrs Parsons' eyes flitted nervously from Winston to the children, and back +again. In the better light of the living-room he noticed with interest +that there actually was dust in the creases of her face. + +'They do get so noisy,' she said. 'They're disappointed because they +couldn't go to see the hanging, that's what it is. I'm too busy to take +them. and Tom won't be back from work in time.' + +'Why can't we go and see the hanging?' roared the boy in his huge voice. + +'Want to see the hanging! Want to see the hanging!' chanted the little +girl, still capering round. + +Some Eurasian prisoners, guilty of war crimes, were to be hanged in the +Park that evening, Winston remembered. This happened about once a month, +and was a popular spectacle. Children always clamoured to be taken to see +it. He took his leave of Mrs Parsons and made for the door. But he had not +gone six steps down the passage when something hit the back of his neck an +agonizingly painful blow. It was as though a red-hot wire had been jabbed +into him. He spun round just in time to see Mrs Parsons dragging her son +back into the doorway while the boy pocketed a catapult. + +'Goldstein!' bellowed the boy as the door closed on him. But what most +struck Winston was the look of helpless fright on the woman's greyish face. + +Back in the flat he stepped quickly past the telescreen and sat down at the +table again, still rubbing his neck. The music from the telescreen had +stopped. Instead, a clipped military voice was reading out, with a sort of +brutal relish, a description of the armaments of the new Floating Fortress +which had just been anchored between Iceland and the Faroe Islands. + +With those children, he thought, that wretched woman must lead a life of +terror. Another year, two years, and they would be watching her night +and day for symptoms of unorthodoxy. Nearly all children nowadays were +horrible. What was worst of all was that by means of such organizations as +the Spies they were systematically turned into ungovernable little savages, +and yet this produced in them no tendency whatever to rebel against the +discipline of the Party. On the contrary, they adored the Party and +everything connected with it. The songs, the processions, the banners, the +hiking, the drilling with dummy rifles, the yelling of slogans, the worship +of Big Brother--it was all a sort of glorious game to them. All their +ferocity was turned outwards, against the enemies of the State, against +foreigners, traitors, saboteurs, thought-criminals. It was almost normal +for people over thirty to be frightened of their own children. And with +good reason, for hardly a week passed in which 'The Times' did not carry +a paragraph describing how some eavesdropping little sneak--'child hero' +was the phrase generally used--had overheard some compromising remark +and denounced its parents to the Thought Police. + +The sting of the catapult bullet had worn off. He picked up his pen +half-heartedly, wondering whether he could find something more to write +in the diary. Suddenly he began thinking of O'Brien again. + +Years ago--how long was it? Seven years it must be--he had dreamed that he +was walking through a pitch-dark room. And someone sitting to one side of +him had said as he passed: 'We shall meet in the place where there is no +darkness.' It was said very quietly, almost casually--a statement, not a +command. He had walked on without pausing. What was curious was that at the +time, in the dream, the words had not made much impression on him. It was +only later and by degrees that they had seemed to take on significance. He +could not now remember whether it was before or after having the dream that +he had seen O'Brien for the first time, nor could he remember when he had +first identified the voice as O'Brien's. But at any rate the identification +existed. It was O'Brien who had spoken to him out of the dark. + +Winston had never been able to feel sure--even after this morning's flash +of the eyes it was still impossible to be sure whether O'Brien was a friend +or an enemy. Nor did it even seem to matter greatly. There was a link of +understanding between them, more important than affection or partisanship. +'We shall meet in the place where there is no darkness,' he had said. +Winston did not know what it meant, only that in some way or another it +would come true. + +The voice from the telescreen paused. A trumpet call, clear and beautiful, +floated into the stagnant air. The voice continued raspingly: + +'Attention! Your attention, please! A newsflash has this moment arrived +from the Malabar front. Our forces in South India have won a glorious +victory. I am authorized to say that the action we are now reporting may +well bring the war within measurable distance of its end. Here is the +newsflash----' + +Bad news coming, thought Winston. And sure enough, following on a gory +description of the annihilation of a Eurasian army, with stupendous figures +of killed and prisoners, came the announcement that, as from next week, +the chocolate ration would be reduced from thirty grammes to twenty. + +Winston belched again. The gin was wearing off, leaving a deflated feeling. +The telescreen--perhaps to celebrate the victory, perhaps to drown the +memory of the lost chocolate--crashed into 'Oceania, 'tis for thee'. You +were supposed to stand to attention. However, in his present position he +was invisible. + +'Oceania, 'tis for thee' gave way to lighter music. Winston walked over to +the window, keeping his back to the telescreen. The day was still cold and +clear. Somewhere far away a rocket bomb exploded with a dull, reverberating +roar. About twenty or thirty of them a week were falling on London at +present. + +Down in the street the wind flapped the torn poster to and fro, and the +word INGSOC fitfully appeared and vanished. Ingsoc. The sacred principles +of Ingsoc. Newspeak, doublethink, the mutability of the past. He felt as +though he were wandering in the forests of the sea bottom, lost in a +monstrous world where he himself was the monster. He was alone. The past +was dead, the future was unimaginable. What certainty had he that a single +human creature now living was on his side? And what way of knowing that the +dominion of the Party would not endure FOR EVER? Like an answer, the three +slogans on the white face of the Ministry of Truth came back to him: + + + WAR IS PEACE + FREEDOM IS SLAVERY + IGNORANCE IS STRENGTH + + +He took a twenty-five cent piece out of his pocket. There, too, in tiny +clear lettering, the same slogans were inscribed, and on the other face of +the coin the head of Big Brother. Even from the coin the eyes pursued you. +On coins, on stamps, on the covers of books, on banners, on posters, and on +the wrappings of a cigarette packet--everywhere. Always the eyes watching +you and the voice enveloping you. Asleep or awake, working or eating, +indoors or out of doors, in the bath or in bed--no escape. Nothing was your +own except the few cubic centimetres inside your skull. + +The sun had shifted round, and the myriad windows of the Ministry of Truth, +with the light no longer shining on them, looked grim as the loopholes of a +fortress. His heart quailed before the enormous pyramidal shape. It was too +strong, it could not be stormed. A thousand rocket bombs would not batter +it down. He wondered again for whom he was writing the diary. For the +future, for the past--for an age that might be imaginary. And in front of +him there lay not death but annihilation. The diary would be reduced to +ashes and himself to vapour. Only the Thought Police would read what he had +written, before they wiped it out of existence and out of memory. How could +you make appeal to the future when not a trace of you, not even an +anonymous word scribbled on a piece of paper, could physically survive? + +The telescreen struck fourteen. He must leave in ten minutes. He had to be +back at work by fourteen-thirty. + +Curiously, the chiming of the hour seemed to have put new heart into him. +He was a lonely ghost uttering a truth that nobody would ever hear. But so +long as he uttered it, in some obscure way the continuity was not broken. +It was not by making yourself heard but by staying sane that you carried on +the human heritage. He went back to the table, dipped his pen, and wrote: + + + To the future or to the past, to a time when thought is free, when men +are different from one another and do not live alone--to a time when truth +exists and what is done cannot be undone: + From the age of uniformity, from the age of solitude, from the age of +Big Brother, from the age of doublethink--greetings! + + +He was already dead, he reflected. It seemed to him that it was only now, +when he had begun to be able to formulate his thoughts, that he had taken +the decisive step. The consequences of every act are included in the act +itself. He wrote: + + + Thoughtcrime does not entail death: thoughtcrime IS death. + + +Now he had recognized himself as a dead man it became important to stay +alive as long as possible. Two fingers of his right hand were inkstained. +It was exactly the kind of detail that might betray you. Some nosing zealot +in the Ministry (a woman, probably: someone like the little sandy-haired +woman or the dark-haired girl from the Fiction Department) might start +wondering why he had been writing during the lunch interval, why he had +used an old-fashioned pen, WHAT he had been writing--and then drop a hint +in the appropriate quarter. He went to the bathroom and carefully scrubbed +the ink away with the gritty dark-brown soap which rasped your skin like +sandpaper and was therefore well adapted for this purpose. + +He put the diary away in the drawer. It was quite useless to think of +hiding it, but he could at least make sure whether or not its existence had +been discovered. A hair laid across the page-ends was too obvious. With the +tip of his finger he picked up an identifiable grain of whitish dust and +deposited it on the corner of the cover, where it was bound to be shaken +off if the book was moved. + + + + +Chapter 3 + + + +Winston was dreaming of his mother. + +He must, he thought, have been ten or eleven years old when his mother had +disappeared. She was a tall, statuesque, rather silent woman with slow +movements and magnificent fair hair. His father he remembered more vaguely +as dark and thin, dressed always in neat dark clothes (Winston remembered +especially the very thin soles of his father's shoes) and wearing +spectacles. The two of them must evidently have been swallowed up in one +of the first great purges of the fifties. + +At this moment his mother was sitting in some place deep down beneath him, +with his young sister in her arms. He did not remember his sister at all, +except as a tiny, feeble baby, always silent, with large, watchful eyes. +Both of them were looking up at him. They were down in some subterranean +place--the bottom of a well, for instance, or a very deep grave--but it +was a place which, already far below him, was itself moving downwards. +They were in the saloon of a sinking ship, looking up at him through the +darkening water. There was still air in the saloon, they could still see +him and he them, but all the while they were sinking down, down into the +green waters which in another moment must hide them from sight for ever. +He was out in the light and air while they were being sucked down to death, +and they were down there because he was up here. He knew it and they knew +it, and he could see the knowledge in their faces. There was no reproach +either in their faces or in their hearts, only the knowledge that they +must die in order that he might remain alive, and that this was part of +the unavoidable order of things. + +He could not remember what had happened, but he knew in his dream that in +some way the lives of his mother and his sister had been sacrificed to his +own. It was one of those dreams which, while retaining the characteristic +dream scenery, are a continuation of one's intellectual life, and in which +one becomes aware of facts and ideas which still seem new and valuable +after one is awake. The thing that now suddenly struck Winston was that his +mother's death, nearly thirty years ago, had been tragic and sorrowful in +a way that was no longer possible. Tragedy, he perceived, belonged to the +ancient time, to a time when there was still privacy, love, and friendship, +and when the members of a family stood by one another without needing to +know the reason. His mother's memory tore at his heart because she had died +loving him, when he was too young and selfish to love her in return, and +because somehow, he did not remember how, she had sacrificed herself to a +conception of loyalty that was private and unalterable. Such things, he +saw, could not happen today. Today there were fear, hatred, and pain, but +no dignity of emotion, no deep or complex sorrows. All this he seemed to +see in the large eyes of his mother and his sister, looking up at him +through the green water, hundreds of fathoms down and still sinking. + +Suddenly he was standing on short springy turf, on a summer evening when +the slanting rays of the sun gilded the ground. The landscape that he was +looking at recurred so often in his dreams that he was never fully certain +whether or not he had seen it in the real world. In his waking thoughts he +called it the Golden Country. It was an old, rabbit-bitten pasture, with a +foot-track wandering across it and a molehill here and there. In the ragged +hedge on the opposite side of the field the boughs of the elm trees were +swaying very faintly in the breeze, their leaves just stirring in dense +masses like women's hair. Somewhere near at hand, though out of sight, +there was a clear, slow-moving stream where dace were swimming in the +pools under the willow trees. + +The girl with dark hair was coming towards them across the field. With +what seemed a single movement she tore off her clothes and flung them +disdainfully aside. Her body was white and smooth, but it aroused no desire +in him, indeed he barely looked at it. What overwhelmed him in that instant +was admiration for the gesture with which she had thrown her clothes aside. +With its grace and carelessness it seemed to annihilate a whole culture, +a whole system of thought, as though Big Brother and the Party and the +Thought Police could all be swept into nothingness by a single splendid +movement of the arm. That too was a gesture belonging to the ancient time. +Winston woke up with the word 'Shakespeare' on his lips. + +The telescreen was giving forth an ear-splitting whistle which continued on +the same note for thirty seconds. It was nought seven fifteen, getting-up +time for office workers. Winston wrenched his body out of bed--naked, for +a member of the Outer Party received only 3,000 clothing coupons annually, +and a suit of pyjamas was 600--and seized a dingy singlet and a pair of +shorts that were lying across a chair. The Physical Jerks would begin in +three minutes. The next moment he was doubled up by a violent coughing fit +which nearly always attacked him soon after waking up. It emptied his lungs +so completely that he could only begin breathing again by lying on his back +and taking a series of deep gasps. His veins had swelled with the effort of +the cough, and the varicose ulcer had started itching. + +'Thirty to forty group!' yapped a piercing female voice. 'Thirty to forty +group! Take your places, please. Thirties to forties!' + +Winston sprang to attention in front of the telescreen, upon which the +image of a youngish woman, scrawny but muscular, dressed in tunic and +gym-shoes, had already appeared. + +'Arms bending and stretching!' she rapped out. 'Take your time by me. ONE, +two, three, four! ONE, two, three, four! Come on, comrades, put a bit of +life into it! ONE, two, three four! ONE two, three, four!...' + +The pain of the coughing fit had not quite driven out of Winston's mind the +impression made by his dream, and the rhythmic movements of the exercise +restored it somewhat. As he mechanically shot his arms back and forth, +wearing on his face the look of grim enjoyment which was considered proper +during the Physical Jerks, he was struggling to think his way backward into +the dim period of his early childhood. It was extraordinarily difficult. +Beyond the late fifties everything faded. When there were no external +records that you could refer to, even the outline of your own life lost +its sharpness. You remembered huge events which had quite probably not +happened, you remembered the detail of incidents without being able to +recapture their atmosphere, and there were long blank periods to which you +could assign nothing. Everything had been different then. Even the names of +countries, and their shapes on the map, had been different. Airstrip One, +for instance, had not been so called in those days: it had been called +England or Britain, though London, he felt fairly certain, had always been +called London. + +Winston could not definitely remember a time when his country had not been +at war, but it was evident that there had been a fairly long interval of +peace during his childhood, because one of his early memories was of an air +raid which appeared to take everyone by surprise. Perhaps it was the time +when the atomic bomb had fallen on Colchester. He did not remember the raid +itself, but he did remember his father's hand clutching his own as they +hurried down, down, down into some place deep in the earth, round and round +a spiral staircase which rang under his feet and which finally so wearied +his legs that he began whimpering and they had to stop and rest. His +mother, in her slow, dreamy way, was following a long way behind them. She +was carrying his baby sister--or perhaps it was only a bundle of blankets +that she was carrying: he was not certain whether his sister had been born +then. Finally they had emerged into a noisy, crowded place which he had +realized to be a Tube station. + +There were people sitting all over the stone-flagged floor, and other +people, packed tightly together, were sitting on metal bunks, one above +the other. Winston and his mother and father found themselves a place on +the floor, and near them an old man and an old woman were sitting side by +side on a bunk. The old man had on a decent dark suit and a black cloth cap +pushed back from very white hair: his face was scarlet and his eyes were +blue and full of tears. He reeked of gin. It seemed to breathe out of his +skin in place of sweat, and one could have fancied that the tears welling +from his eyes were pure gin. But though slightly drunk he was also +suffering under some grief that was genuine and unbearable. In his childish +way Winston grasped that some terrible thing, something that was beyond +forgiveness and could never be remedied, had just happened. It also seemed +to him that he knew what it was. Someone whom the old man loved--a little +granddaughter, perhaps--had been killed. Every few minutes the old man kept +repeating: + +'We didn't ought to 'ave trusted 'em. I said so, Ma, didn't I? That's what +comes of trusting 'em. I said so all along. We didn't ought to 'ave trusted +the buggers.' + +But which buggers they didn't ought to have trusted Winston could not now +remember. + +Since about that time, war had been literally continuous, though strictly +speaking it had not always been the same war. For several months during his +childhood there had been confused street fighting in London itself, some +of which he remembered vividly. But to trace out the history of the whole +period, to say who was fighting whom at any given moment, would have been +utterly impossible, since no written record, and no spoken word, ever made +mention of any other alignment than the existing one. At this moment, for +example, in 1984 (if it was 1984), Oceania was at war with Eurasia and +in alliance with Eastasia. In no public or private utterance was it ever +admitted that the three powers had at any time been grouped along different +lines. Actually, as Winston well knew, it was only four years since Oceania +had been at war with Eastasia and in alliance with Eurasia. But that was +merely a piece of furtive knowledge which he happened to possess because +his memory was not satisfactorily under control. Officially the change of +partners had never happened. Oceania was at war with Eurasia: therefore +Oceania had always been at war with Eurasia. The enemy of the moment always +represented absolute evil, and it followed that any past or future +agreement with him was impossible. + +The frightening thing, he reflected for the ten thousandth time as he +forced his shoulders painfully backward (with hands on hips, they were +gyrating their bodies from the waist, an exercise that was supposed to be +good for the back muscles)--the frightening thing was that it might all be +true. If the Party could thrust its hand into the past and say of this or +that event, IT NEVER HAPPENED--that, surely, was more terrifying than mere +torture and death? + +The Party said that Oceania had never been in alliance with Eurasia. He, +Winston Smith, knew that Oceania had been in alliance with Eurasia as short +a time as four years ago. But where did that knowledge exist? Only in his +own consciousness, which in any case must soon be annihilated. And if all +others accepted the lie which the Party imposed--if all records told the +same tale--then the lie passed into history and became truth. 'Who controls +the past,' ran the Party slogan, 'controls the future: who controls the +present controls the past.' And yet the past, though of its nature +alterable, never had been altered. Whatever was true now was true from +everlasting to everlasting. It was quite simple. All that was needed was +an unending series of victories over your own memory. 'Reality control', +they called it: in Newspeak, 'doublethink'. + +'Stand easy!' barked the instructress, a little more genially. + +Winston sank his arms to his sides and slowly refilled his lungs with air. +His mind slid away into the labyrinthine world of doublethink. To know +and not to know, to be conscious of complete truthfulness while telling +carefully constructed lies, to hold simultaneously two opinions which +cancelled out, knowing them to be contradictory and believing in both of +them, to use logic against logic, to repudiate morality while laying claim +to it, to believe that democracy was impossible and that the Party was the +guardian of democracy, to forget whatever it was necessary to forget, then +to draw it back into memory again at the moment when it was needed, and +then promptly to forget it again: and above all, to apply the same process +to the process itself. That was the ultimate subtlety: consciously to +induce unconsciousness, and then, once again, to become unconscious of +the act of hypnosis you had just performed. Even to understand the word +'doublethink' involved the use of doublethink. + +The instructress had called them to attention again. 'And now let's see +which of us can touch our toes!' she said enthusiastically. 'Right over +from the hips, please, comrades. ONE-two! ONE-two!...' + +Winston loathed this exercise, which sent shooting pains all the way from +his heels to his buttocks and often ended by bringing on another coughing +fit. The half-pleasant quality went out of his meditations. The past, he +reflected, had not merely been altered, it had been actually destroyed. For +how could you establish even the most obvious fact when there existed no +record outside your own memory? He tried to remember in what year he had +first heard mention of Big Brother. He thought it must have been at some +time in the sixties, but it was impossible to be certain. In the Party +histories, of course, Big Brother figured as the leader and guardian of the +Revolution since its very earliest days. His exploits had been gradually +pushed backwards in time until already they extended into the fabulous +world of the forties and the thirties, when the capitalists in their +strange cylindrical hats still rode through the streets of London in great +gleaming motor-cars or horse carriages with glass sides. There was no +knowing how much of this legend was true and how much invented. Winston +could not even remember at what date the Party itself had come into +existence. He did not believe he had ever heard the word Ingsoc before +1960, but it was possible that in its Oldspeak form--'English Socialism', +that is to say--it had been current earlier. Everything melted into mist. +Sometimes, indeed, you could put your finger on a definite lie. It was not +true, for example, as was claimed in the Party history books, that the +Party had invented aeroplanes. He remembered aeroplanes since his earliest +childhood. But you could prove nothing. There was never any evidence. Just +once in his whole life he had held in his hands unmistakable documentary +proof of the falsification of an historical fact. And on that occasion---- + +'Smith!' screamed the shrewish voice from the telescreen. '6079 Smith W.! +Yes, YOU! Bend lower, please! You can do better than that. You're not +trying. Lower, please! THAT'S better, comrade. Now stand at ease, the +whole squad, and watch me.' + +A sudden hot sweat had broken out all over Winston's body. His face +remained completely inscrutable. Never show dismay! Never show resentment! +A single flicker of the eyes could give you away. He stood watching while +the instructress raised her arms above her head and--one could not say +gracefully, but with remarkable neatness and efficiency--bent over and +tucked the first joint of her fingers under her toes. + +'THERE, comrades! THAT'S how I want to see you doing it. Watch me again. +I'm thirty-nine and I've had four children. Now look.' She bent over again. +'You see MY knees aren't bent. You can all do it if you want to,' she added +as she straightened herself up. 'Anyone under forty-five is perfectly +capable of touching his toes. We don't all have the privilege of fighting +in the front line, but at least we can all keep fit. Remember our boys on +the Malabar front! And the sailors in the Floating Fortresses! Just think +what THEY have to put up with. Now try again. That's better, comrade, +that's MUCH better,' she added encouragingly as Winston, with a violent +lunge, succeeded in touching his toes with knees unbent, for the first +time in several years. + + + + +Chapter 4 + + + +With the deep, unconscious sigh which not even the nearness of the +telescreen could prevent him from uttering when his day's work started, +Winston pulled the speakwrite towards him, blew the dust from its +mouthpiece, and put on his spectacles. Then he unrolled and clipped +together four small cylinders of paper which had already flopped out of +the pneumatic tube on the right-hand side of his desk. + +In the walls of the cubicle there were three orifices. To the right of the +speakwrite, a small pneumatic tube for written messages, to the left, a +larger one for newspapers; and in the side wall, within easy reach of +Winston's arm, a large oblong slit protected by a wire grating. This last +was for the disposal of waste paper. Similar slits existed in thousands or +tens of thousands throughout the building, not only in every room but at +short intervals in every corridor. For some reason they were nicknamed +memory holes. When one knew that any document was due for destruction, or +even when one saw a scrap of waste paper lying about, it was an automatic +action to lift the flap of the nearest memory hole and drop it in, +whereupon it would be whirled away on a current of warm air to the enormous +furnaces which were hidden somewhere in the recesses of the building. + +Winston examined the four slips of paper which he had unrolled. Each +contained a message of only one or two lines, in the abbreviated +jargon--not actually Newspeak, but consisting +largely of Newspeak words--which was used in the Ministry for internal +purposes. They ran: + + +times 17.3.84 bb speech malreported africa rectify + +times 19.12.83 forecasts 3 yp 4th quarter 83 misprints verify current issue + +times 14.2.84 miniplenty malquoted chocolate rectify + +times 3.12.83 reporting bb dayorder doubleplusungood refs unpersons rewrite +fullwise upsub antefiling + + +With a faint feeling of satisfaction Winston laid the fourth message aside. +It was an intricate and responsible job and had better be dealt with last. +The other three were routine matters, though the second one would probably +mean some tedious wading through lists of figures. + +Winston dialled 'back numbers' on the telescreen and called for the +appropriate issues of 'The Times', which slid out of the pneumatic tube +after only a few minutes' delay. The messages he had received referred to +articles or news items which for one reason or another it was thought +necessary to alter, or, as the official phrase had it, to rectify. For +example, it appeared from 'The Times' of the seventeenth of March that Big +Brother, in his speech of the previous day, had predicted that the South +Indian front would remain quiet but that a Eurasian offensive would shortly +be launched in North Africa. As it happened, the Eurasian Higher Command +had launched its offensive in South India and left North Africa alone. It +was therefore necessary to rewrite a paragraph of Big Brother's speech, in +such a way as to make him predict the thing that had actually happened. Or +again, 'The Times' of the nineteenth of December had published the official +forecasts of the output of various classes of consumption goods in the +fourth quarter of 1983, which was also the sixth quarter of the Ninth +Three-Year Plan. Today's issue contained a statement of the actual output, +from which it appeared that the forecasts were in every instance grossly +wrong. Winston's job was to rectify the original figures by making them +agree with the later ones. As for the third message, it referred to a very +simple error which could be set right in a couple of minutes. As short +a time ago as February, the Ministry of Plenty had issued a promise +(a 'categorical pledge' were the official words) that there would be +no reduction of the chocolate ration during 1984. Actually, as Winston +was aware, the chocolate ration was to be reduced from thirty grammes +to twenty at the end of the present week. All that was needed was to +substitute for the original promise a warning that it would probably be +necessary to reduce the ration at some time in April. + +As soon as Winston had dealt with each of the messages, he clipped his +speakwritten corrections to the appropriate copy of 'The Times' and pushed +them into the pneumatic tube. Then, with a movement which was as nearly as +possible unconscious, he crumpled up the original message and any notes +that he himself had made, and dropped them into the memory hole to be +devoured by the flames. + +What happened in the unseen labyrinth to which the pneumatic tubes led, he +did not know in detail, but he did know in general terms. As soon as all +the corrections which happened to be necessary in any particular number +of 'The Times' had been assembled and collated, that number would be +reprinted, the original copy destroyed, and the corrected copy placed on +the files in its stead. This process of continuous alteration was applied +not only to newspapers, but to books, periodicals, pamphlets, posters, +leaflets, films, sound-tracks, cartoons, photographs--to every kind of +literature or documentation which might conceivably hold any political or +ideological significance. Day by day and almost minute by minute the past +was brought up to date. In this way every prediction made by the Party +could be shown by documentary evidence to have been correct, nor was any +item of news, or any expression of opinion, which conflicted with the +needs of the moment, ever allowed to remain on record. All history was +a palimpsest, scraped clean and reinscribed exactly as often as was +necessary. In no case would it have been possible, once the deed was done, +to prove that any falsification had taken place. The largest section of +the Records Department, far larger than the one on which Winston worked, +consisted simply of persons whose duty it was to track down and collect all +copies of books, newspapers, and other documents which had been superseded +and were due for destruction. A number of 'The Times' which might, because +of changes in political alignment, or mistaken prophecies uttered by Big +Brother, have been rewritten a dozen times still stood on the files bearing +its original date, and no other copy existed to contradict it. Books, also, +were recalled and rewritten again and again, and were invariably reissued +without any admission that any alteration had been made. Even the written +instructions which Winston received, and which he invariably got rid of +as soon as he had dealt with them, never stated or implied that an act of +forgery was to be committed: always the reference was to slips, errors, +misprints, or misquotations which it was necessary to put right in the +interests of accuracy. + +But actually, he thought as he re-adjusted the Ministry of Plenty's +figures, it was not even forgery. It was merely the substitution of one +piece of nonsense for another. Most of the material that you were dealing +with had no connexion with anything in the real world, not even the kind of +connexion that is contained in a direct lie. Statistics were just as much +a fantasy in their original version as in their rectified version. A great +deal of the time you were expected to make them up out of your head. For +example, the Ministry of Plenty's forecast had estimated the output of +boots for the quarter at 145 million pairs. The actual output was given as +sixty-two millions. Winston, however, in rewriting the forecast, marked +the figure down to fifty-seven millions, so as to allow for the usual claim +that the quota had been overfulfilled. In any case, sixty-two millions was +no nearer the truth than fifty-seven millions, or than 145 millions. Very +likely no boots had been produced at all. Likelier still, nobody knew +how many had been produced, much less cared. All one knew was that every +quarter astronomical numbers of boots were produced on paper, while perhaps +half the population of Oceania went barefoot. And so it was with every +class of recorded fact, great or small. Everything faded away into a +shadow-world in which, finally, even the date of the year had become +uncertain. + +Winston glanced across the hall. In the corresponding cubicle on the other +side a small, precise-looking, dark-chinned man named Tillotson was working +steadily away, with a folded newspaper on his knee and his mouth very close +to the mouthpiece of the speakwrite. He had the air of trying to keep what +he was saying a secret between himself and the telescreen. He looked up, +and his spectacles darted a hostile flash in Winston's direction. + +Winston hardly knew Tillotson, and had no idea what work he was employed +on. People in the Records Department did not readily talk about their jobs. +In the long, windowless hall, with its double row of cubicles and its +endless rustle of papers and hum of voices murmuring into speakwrites, +there were quite a dozen people whom Winston did not even know by name, +though he daily saw them hurrying to and fro in the corridors or +gesticulating in the Two Minutes Hate. He knew that in the cubicle next +to him the little woman with sandy hair toiled day in day out, simply at +tracking down and deleting from the Press the names of people who had been +vaporized and were therefore considered never to have existed. There was a +certain fitness in this, since her own husband had been vaporized a couple +of years earlier. And a few cubicles away a mild, ineffectual, dreamy +creature named Ampleforth, with very hairy ears and a surprising talent +for juggling with rhymes and metres, was engaged in producing garbled +versions--definitive texts, they were called--of poems which had become +ideologically offensive, but which for one reason or another were to be +retained in the anthologies. And this hall, with its fifty workers or +thereabouts, was only one sub-section, a single cell, as it were, in the +huge complexity of the Records Department. Beyond, above, below, were other +swarms of workers engaged in an unimaginable multitude of jobs. There were +the huge printing-shops with their sub-editors, their typography experts, +and their elaborately equipped studios for the faking of photographs. There +was the tele-programmes section with its engineers, its producers, and its +teams of actors specially chosen for their skill in imitating voices. There +were the armies of reference clerks whose job was simply to draw up lists +of books and periodicals which were due for recall. There were the vast +repositories where the corrected documents were stored, and the hidden +furnaces where the original copies were destroyed. And somewhere or other, +quite anonymous, there were the directing brains who co-ordinated the whole +effort and laid down the lines of policy which made it necessary that this +fragment of the past should be preserved, that one falsified, and the other +rubbed out of existence. + +And the Records Department, after all, was itself only a single branch of +the Ministry of Truth, whose primary job was not to reconstruct the past +but to supply the citizens of Oceania with newspapers, films, textbooks, +telescreen programmes, plays, novels--with every conceivable kind of +information, instruction, or entertainment, from a statue to a slogan, +from a lyric poem to a biological treatise, and from a child's +spelling-book to a Newspeak dictionary. And the Ministry had not only to +supply the multifarious needs of the party, but also to repeat the whole +operation at a lower level for the benefit of the proletariat. There +was a whole chain of separate departments dealing with proletarian +literature, music, drama, and entertainment generally. Here were produced +rubbishy newspapers containing almost nothing except sport, crime and +astrology, sensational five-cent novelettes, films oozing with sex, and +sentimental songs which were composed entirely by mechanical means on a +special kind of kaleidoscope known as a versificator. There was even +a whole sub-section--Pornosec, it was called in Newspeak--engaged in +producing the lowest kind of pornography, which was sent out in sealed +packets and which no Party member, other than those who worked on it, +was permitted to look at. + +Three messages had slid out of the pneumatic tube while Winston was +working, but they were simple matters, and he had disposed of them before +the Two Minutes Hate interrupted him. When the Hate was over he returned +to his cubicle, took the Newspeak dictionary from the shelf, pushed the +speakwrite to one side, cleaned his spectacles, and settled down to his +main job of the morning. + +Winston's greatest pleasure in life was in his work. Most of it was a +tedious routine, but included in it there were also jobs so difficult and +intricate that you could lose yourself in them as in the depths of a +mathematical problem--delicate pieces of forgery in which you had nothing +to guide you except your knowledge of the principles of Ingsoc and your +estimate of what the Party wanted you to say. Winston was good at this kind +of thing. On occasion he had even been entrusted with the rectification of +'The Times' leading articles, which were written entirely in Newspeak. +He unrolled the message that he had set aside earlier. It ran: + + + times 3.12.83 reporting bb dayorder doubleplusungood refs unpersons +rewrite fullwise upsub antefiling + + +In Oldspeak (or standard English) this might be rendered: + + +The reporting of Big Brother's Order for the Day in 'The Times' of December +3rd 1983 is extremely unsatisfactory and makes references to non-existent +persons. Rewrite it in full and submit your draft to higher authority +before filing. + + +Winston read through the offending article. Big Brother's Order for the +Day, it seemed, had been chiefly devoted to praising the work of an +organization known as FFCC, which supplied cigarettes and other comforts +to the sailors in the Floating Fortresses. A certain Comrade Withers, a +prominent member of the Inner Party, had been singled out for special +mention and awarded a decoration, the Order of Conspicuous Merit, Second +Class. + +Three months later FFCC had suddenly been dissolved with no reasons given. +One could assume that Withers and his associates were now in disgrace, but +there had been no report of the matter in the Press or on the telescreen. +That was to be expected, since it was unusual for political offenders to +be put on trial or even publicly denounced. The great purges involving +thousands of people, with public trials of traitors and thought-criminals +who made abject confession of their crimes and were afterwards executed, +were special show-pieces not occurring oftener than once in a couple of +years. More commonly, people who had incurred the displeasure of the +Party simply disappeared and were never heard of again. One never had the +smallest clue as to what had happened to them. In some cases they might +not even be dead. Perhaps thirty people personally known to Winston, not +counting his parents, had disappeared at one time or another. + +Winston stroked his nose gently with a paper-clip. In the cubicle +across the way Comrade Tillotson was still crouching secretively over +his speakwrite. He raised his head for a moment: again the hostile +spectacle-flash. Winston wondered whether Comrade Tillotson was engaged +on the same job as himself. It was perfectly possible. So tricky a piece +of work would never be entrusted to a single person: on the other hand, +to turn it over to a committee would be to admit openly that an act of +fabrication was taking place. Very likely as many as a dozen people were +now working away on rival versions of what Big Brother had actually said. +And presently some master brain in the Inner Party would select this +version or that, would re-edit it and set in motion the complex processes +of cross-referencing that would be required, and then the chosen lie +would pass into the permanent records and become truth. + +Winston did not know why Withers had been disgraced. Perhaps it was for +corruption or incompetence. Perhaps Big Brother was merely getting rid of +a too-popular subordinate. Perhaps Withers or someone close to him had +been suspected of heretical tendencies. Or perhaps--what was likeliest of +all--the thing had simply happened because purges and vaporizations were a +necessary part of the mechanics of government. The only real clue lay in +the words 'refs unpersons', which indicated that Withers was already dead. +You could not invariably assume this to be the case when people were +arrested. Sometimes they were released and allowed to remain at liberty +for as much as a year or two years before being executed. Very occasionally +some person whom you had believed dead long since would make a ghostly +reappearance at some public trial where he would implicate hundreds of +others by his testimony before vanishing, this time for ever. Withers, +however, was already an UNPERSON. He did not exist: he had never existed. +Winston decided that it would not be enough simply to reverse the tendency +of Big Brother's speech. It was better to make it deal with something +totally unconnected with its original subject. + +He might turn the speech into the usual denunciation of traitors and +thought-criminals, but that was a little too obvious, while to invent a +victory at the front, or some triumph of over-production in the Ninth +Three-Year Plan, might complicate the records too much. What was needed +was a piece of pure fantasy. Suddenly there sprang into his mind, ready +made as it were, the image of a certain Comrade Ogilvy, who had recently +died in battle, in heroic circumstances. There were occasions when Big +Brother devoted his Order for the Day to commemorating some humble, +rank-and-file Party member whose life and death he held up as an example +worthy to be followed. Today he should commemorate Comrade Ogilvy. It was +true that there was no such person as Comrade Ogilvy, but a few lines of +print and a couple of faked photographs would soon bring him into +existence. + +Winston thought for a moment, then pulled the speakwrite towards him and +began dictating in Big Brother's familiar style: a style at once military +and pedantic, and, because of a trick of asking questions and then +promptly answering them ('What lessons do we learn from this fact, +comrades? The lesson--which is also one of the fundamental principles +of Ingsoc--that,' etc., etc.), easy to imitate. + +At the age of three Comrade Ogilvy had refused all toys except a drum, a +sub-machine gun, and a model helicopter. At six--a year early, by a special +relaxation of the rules--he had joined the Spies, at nine he had been a +troop leader. At eleven he had denounced his uncle to the Thought Police +after overhearing a conversation which appeared to him to have criminal +tendencies. At seventeen he had been a district organizer of the Junior +Anti-Sex League. At nineteen he had designed a hand-grenade which had +been adopted by the Ministry of Peace and which, at its first trial, had +killed thirty-one Eurasian prisoners in one burst. At twenty-three he had +perished in action. Pursued by enemy jet planes while flying over the +Indian Ocean with important despatches, he had weighted his body with his +machine gun and leapt out of the helicopter into deep water, despatches +and all--an end, said Big Brother, which it was impossible to contemplate +without feelings of envy. Big Brother added a few remarks on the purity +and single-mindedness of Comrade Ogilvy's life. He was a total abstainer +and a nonsmoker, had no recreations except a daily hour in the gymnasium, +and had taken a vow of celibacy, believing marriage and the care of a +family to be incompatible with a twenty-four-hour-a-day devotion to duty. +He had no subjects of conversation except the principles of Ingsoc, and +no aim in life except the defeat of the Eurasian enemy and the hunting-down +of spies, saboteurs, thought-criminals, and traitors generally. + +Winston debated with himself whether to award Comrade Ogilvy the Order of +Conspicuous Merit: in the end he decided against it because of the +unnecessary cross-referencing that it would entail. + +Once again he glanced at his rival in the opposite cubicle. Something +seemed to tell him with certainty that Tillotson was busy on the same job +as himself. There was no way of knowing whose job would finally be adopted, +but he felt a profound conviction that it would be his own. Comrade Ogilvy, +unimagined an hour ago, was now a fact. It struck him as curious that you +could create dead men but not living ones. Comrade Ogilvy, who had never +existed in the present, now existed in the past, and when once the act of +forgery was forgotten, he would exist just as authentically, and upon the +same evidence, as Charlemagne or Julius Caesar. + + + + +Chapter 5 + + + +In the low-ceilinged canteen, deep underground, the lunch queue jerked +slowly forward. The room was already very full and deafeningly noisy. From +the grille at the counter the steam of stew came pouring forth, with a sour +metallic smell which did not quite overcome the fumes of Victory Gin. On +the far side of the room there was a small bar, a mere hole in the wall, +where gin could be bought at ten cents the large nip. + +'Just the man I was looking for,' said a voice at Winston's back. + +He turned round. It was his friend Syme, who worked in the Research +Department. Perhaps 'friend' was not exactly the right word. You did not +have friends nowadays, you had comrades: but there were some comrades whose +society was pleasanter than that of others. Syme was a philologist, a +specialist in Newspeak. Indeed, he was one of the enormous team of experts +now engaged in compiling the Eleventh Edition of the Newspeak Dictionary. +He was a tiny creature, smaller than Winston, with dark hair and large, +protuberant eyes, at once mournful and derisive, which seemed to search +your face closely while he was speaking to you. + +'I wanted to ask you whether you'd got any razor blades,' he said. + +'Not one!' said Winston with a sort of guilty haste. 'I've tried all over +the place. They don't exist any longer.' + +Everyone kept asking you for razor blades. Actually he had two unused ones +which he was hoarding up. There had been a famine of them for months past. +At any given moment there was some necessary article which the Party shops +were unable to supply. Sometimes it was buttons, sometimes it was darning +wool, sometimes it was shoelaces; at present it was razor blades. You could +only get hold of them, if at all, by scrounging more or less furtively on +the 'free' market. + +'I've been using the same blade for six weeks,' he added untruthfully. + +The queue gave another jerk forward. As they halted he turned and faced +Syme again. Each of them took a greasy metal tray from a pile at the end +of the counter. + +'Did you go and see the prisoners hanged yesterday?' said Syme. + +'I was working,' said Winston indifferently. 'I shall see it on the +flicks, I suppose.' + +'A very inadequate substitute,' said Syme. + +His mocking eyes roved over Winston's face. 'I know you,' the eyes seemed +to say, 'I see through you. I know very well why you didn't go to see +those prisoners hanged.' In an intellectual way, Syme was venomously +orthodox. He would talk with a disagreeable gloating satisfaction of +helicopter raids on enemy villages, and trials and confessions of +thought-criminals, the executions in the cellars of the Ministry of Love. +Talking to him was largely a matter of getting him away from such subjects +and entangling him, if possible, in the technicalities of Newspeak, on +which he was authoritative and interesting. Winston turned his head a +little aside to avoid the scrutiny of the large dark eyes. + +'It was a good hanging,' said Syme reminiscently. 'I think it spoils it +when they tie their feet together. I like to see them kicking. And above +all, at the end, the tongue sticking right out, and blue--a quite bright +blue. That's the detail that appeals to me.' + +'Nex', please!' yelled the white-aproned prole with the ladle. + +Winston and Syme pushed their trays beneath the grille. On to each was +dumped swiftly the regulation lunch--a metal pannikin of pinkish-grey stew, +a hunk of bread, a cube of cheese, a mug of milkless Victory Coffee, and +one saccharine tablet. + +'There's a table over there, under that telescreen,' said Syme. 'Let's pick +up a gin on the way.' + +The gin was served out to them in handleless china mugs. They threaded +their way across the crowded room and unpacked their trays on to the +metal-topped table, on one corner of which someone had left a pool of stew, +a filthy liquid mess that had the appearance of vomit. Winston took up his +mug of gin, paused for an instant to collect his nerve, and gulped the +oily-tasting stuff down. When he had winked the tears out of his eyes he +suddenly discovered that he was hungry. He began swallowing spoonfuls of +the stew, which, in among its general sloppiness, had cubes of spongy +pinkish stuff which was probably a preparation of meat. Neither of them +spoke again till they had emptied their pannikins. From the table at +Winston's left, a little behind his back, someone was talking rapidly and +continuously, a harsh gabble almost like the quacking of a duck, which +pierced the general uproar of the room. + +'How is the Dictionary getting on?' said Winston, raising his voice to +overcome the noise. + +'Slowly,' said Syme. 'I'm on the adjectives. It's fascinating.' + +He had brightened up immediately at the mention of Newspeak. He pushed his +pannikin aside, took up his hunk of bread in one delicate hand and his +cheese in the other, and leaned across the table so as to be able to speak +without shouting. + +'The Eleventh Edition is the definitive edition,' he said. 'We're getting +the language into its final shape--the shape it's going to have when nobody +speaks anything else. When we've finished with it, people like you will +have to learn it all over again. You think, I dare say, that our chief job +is inventing new words. But not a bit of it! We're destroying words--scores +of them, hundreds of them, every day. We're cutting the language down to +the bone. The Eleventh Edition won't contain a single word that will become +obsolete before the year 2050.' + +He bit hungrily into his bread and swallowed a couple of mouthfuls, then +continued speaking, with a sort of pedant's passion. His thin dark face +had become animated, his eyes had lost their mocking expression and grown +almost dreamy. + +'It's a beautiful thing, the destruction of words. Of course the great +wastage is in the verbs and adjectives, but there are hundreds of nouns +that can be got rid of as well. It isn't only the synonyms; there are also +the antonyms. After all, what justification is there for a word which is +simply the opposite of some other word? A word contains its opposite in +itself. Take "good", for instance. If you have a word like "good", what +need is there for a word like "bad"? "Ungood" will do just as well--better, +because it's an exact opposite, which the other is not. Or again, if you +want a stronger version of "good", what sense is there in having a whole +string of vague useless words like "excellent" and "splendid" and all the +rest of them? "Plusgood" covers the meaning, or "doubleplusgood" if you +want something stronger still. Of course we use those forms already. but +in the final version of Newspeak there'll be nothing else. In the end the +whole notion of goodness and badness will be covered by only six words--in +reality, only one word. Don't you see the beauty of that, Winston? It was +B.B.'s idea originally, of course,' he added as an afterthought. + +A sort of vapid eagerness flitted across Winston's face at the mention of +Big Brother. Nevertheless Syme immediately detected a certain lack of +enthusiasm. + +'You haven't a real appreciation of Newspeak, Winston,' he said almost +sadly. 'Even when you write it you're still thinking in Oldspeak. I've read +some of those pieces that you write in "The Times" occasionally. They're +good enough, but they're translations. In your heart you'd prefer to stick +to Oldspeak, with all its vagueness and its useless shades of meaning. +You don't grasp the beauty of the destruction of words. Do you know that +Newspeak is the only language in the world whose vocabulary gets smaller +every year?' + +Winston did know that, of course. He smiled, sympathetically he hoped, not +trusting himself to speak. Syme bit off another fragment of the +dark-coloured bread, chewed it briefly, and went on: + +'Don't you see that the whole aim of Newspeak is to narrow the range of +thought? In the end we shall make thoughtcrime literally impossible, +because there will be no words in which to express it. Every concept that +can ever be needed, will be expressed by exactly one word, with its meaning +rigidly defined and all its subsidiary meanings rubbed out and forgotten. +Already, in the Eleventh Edition, we're not far from that point. But the +process will still be continuing long after you and I are dead. Every year +fewer and fewer words, and the range of consciousness always a little +smaller. Even now, of course, there's no reason or excuse for committing +thoughtcrime. It's merely a question of self-discipline, reality-control. +But in the end there won't be any need even for that. The Revolution will +be complete when the language is perfect. Newspeak is Ingsoc and Ingsoc +is Newspeak,' he added with a sort of mystical satisfaction. 'Has it ever +occurred to you, Winston, that by the year 2050, at the very latest, not a +single human being will be alive who could understand such a conversation +as we are having now?' + +'Except----' began Winston doubtfully, and he stopped. + +It had been on the tip of his tongue to say 'Except the proles,' but he +checked himself, not feeling fully certain that this remark was not in +some way unorthodox. Syme, however, had divined what he was about to say. + +'The proles are not human beings,' he said carelessly. 'By 2050--earlier, +probably--all real knowledge of Oldspeak will have disappeared. The whole +literature of the past will have been destroyed. Chaucer, Shakespeare, +Milton, Byron--they'll exist only in Newspeak versions, not merely changed +into something different, but actually changed into something contradictory +of what they used to be. Even the literature of the Party will change. +Even the slogans will change. How could you have a slogan like "freedom is +slavery" when the concept of freedom has been abolished? The whole climate +of thought will be different. In fact there will be no thought, as we +understand it now. Orthodoxy means not thinking--not needing to think. +Orthodoxy is unconsciousness.' + +One of these days, thought Winston with sudden deep conviction, Syme will +be vaporized. He is too intelligent. He sees too clearly and speaks too +plainly. The Party does not like such people. One day he will disappear. +It is written in his face. + +Winston had finished his bread and cheese. He turned a little sideways +in his chair to drink his mug of coffee. At the table on his left the man +with the strident voice was still talking remorselessly away. A young +woman who was perhaps his secretary, and who was sitting with her back +to Winston, was listening to him and seemed to be eagerly agreeing with +everything that he said. From time to time Winston caught some such remark +as 'I think you're so right, I do so agree with you', uttered in a youthful +and rather silly feminine voice. But the other voice never stopped for an +instant, even when the girl was speaking. Winston knew the man by sight, +though he knew no more about him than that he held some important post +in the Fiction Department. He was a man of about thirty, with a muscular +throat and a large, mobile mouth. His head was thrown back a little, and +because of the angle at which he was sitting, his spectacles caught the +light and presented to Winston two blank discs instead of eyes. What was +slightly horrible, was that from the stream of sound that poured out of +his mouth it was almost impossible to distinguish a single word. Just +once Winston caught a phrase--'complete and final elimination of +Goldsteinism'--jerked out very rapidly and, as it seemed, all in one piece, +like a line of type cast solid. For the rest it was just a noise, a +quack-quack-quacking. And yet, though you could not actually hear what the +man was saying, you could not be in any doubt about its general nature. +He might be denouncing Goldstein and demanding sterner measures against +thought-criminals and saboteurs, he might be fulminating against the +atrocities of the Eurasian army, he might be praising Big Brother or the +heroes on the Malabar front--it made no difference. Whatever it was, you +could be certain that every word of it was pure orthodoxy, pure Ingsoc. +As he watched the eyeless face with the jaw moving rapidly up and down, +Winston had a curious feeling that this was not a real human being but +some kind of dummy. It was not the man's brain that was speaking, it was +his larynx. The stuff that was coming out of him consisted of words, but +it was not speech in the true sense: it was a noise uttered in +unconsciousness, like the quacking of a duck. + +Syme had fallen silent for a moment, and with the handle of his spoon was +tracing patterns in the puddle of stew. The voice from the other table +quacked rapidly on, easily audible in spite of the surrounding din. + +'There is a word in Newspeak,' said Syme, 'I don't know whether you know +it: DUCKSPEAK, to quack like a duck. It is one of those interesting words +that have two contradictory meanings. Applied to an opponent, it is abuse, +applied to someone you agree with, it is praise.' + +Unquestionably Syme will be vaporized, Winston thought again. He thought +it with a kind of sadness, although well knowing that Syme despised him +and slightly disliked him, and was fully capable of denouncing him as a +thought-criminal if he saw any reason for doing so. There was something +subtly wrong with Syme. There was something that he lacked: discretion, +aloofness, a sort of saving stupidity. You could not say that he was +unorthodox. He believed in the principles of Ingsoc, he venerated Big +Brother, he rejoiced over victories, he hated heretics, not merely with +sincerity but with a sort of restless zeal, an up-to-dateness of +information, which the ordinary Party member did not approach. Yet a faint +air of disreputability always clung to him. He said things that would have +been better unsaid, he had read too many books, he frequented the Chestnut +Tree Cafe, haunt of painters and musicians. There was no law, not even an +unwritten law, against frequenting the Chestnut Tree Cafe, yet the place +was somehow ill-omened. The old, discredited leaders of the Party had been +used to gather there before they were finally purged. Goldstein himself, +it was said, had sometimes been seen there, years and decades ago. Syme's +fate was not difficult to foresee. And yet it was a fact that if Syme +grasped, even for three seconds, the nature of his, Winston's, secret +opinions, he would betray him instantly to the Thought Police. So would +anybody else, for that matter: but Syme more than most. Zeal was not +enough. Orthodoxy was unconsciousness. + +Syme looked up. 'Here comes Parsons,' he said. + +Something in the tone of his voice seemed to add, 'that bloody fool'. +Parsons, Winston's fellow-tenant at Victory Mansions, was in fact threading +his way across the room--a tubby, middle-sized man with fair hair and a +froglike face. At thirty-five he was already putting on rolls of fat at +neck and waistline, but his movements were brisk and boyish. His whole +appearance was that of a little boy grown large, so much so that although +he was wearing the regulation overalls, it was almost impossible not to +think of him as being dressed in the blue shorts, grey shirt, and red +neckerchief of the Spies. In visualizing him one saw always a picture of +dimpled knees and sleeves rolled back from pudgy forearms. Parsons did, +indeed, invariably revert to shorts when a community hike or any other +physical activity gave him an excuse for doing so. He greeted them both +with a cheery 'Hullo, hullo!' and sat down at the table, giving off an +intense smell of sweat. Beads of moisture stood out all over his pink face. +His powers of sweating were extraordinary. At the Community Centre you +could always tell when he had been playing table-tennis by the dampness of +the bat handle. Syme had produced a strip of paper on which there was a +long column of words, and was studying it with an ink-pencil between his +fingers. + +'Look at him working away in the lunch hour,' said Parsons, nudging +Winston. 'Keenness, eh? What's that you've got there, old boy? Something +a bit too brainy for me, I expect. Smith, old boy, I'll tell you why I'm +chasing you. It's that sub you forgot to give me.' + +'Which sub is that?' said Winston, automatically feeling for money. About +a quarter of one's salary had to be earmarked for voluntary subscriptions, +which were so numerous that it was difficult to keep track of them. + +'For Hate Week. You know--the house-by-house fund. I'm treasurer for our +block. We're making an all-out effort--going to put on a tremendous show. +I tell you, it won't be my fault if old Victory Mansions doesn't have the +biggest outfit of flags in the whole street. Two dollars you promised me.' + +Winston found and handed over two creased and filthy notes, which Parsons +entered in a small notebook, in the neat handwriting of the illiterate. + +'By the way, old boy,' he said. 'I hear that little beggar of mine let fly +at you with his catapult yesterday. I gave him a good dressing-down for it. +In fact I told him I'd take the catapult away if he does it again.' + +'I think he was a little upset at not going to the execution,' said +Winston. + +'Ah, well--what I mean to say, shows the right spirit, doesn't it? +Mischievous little beggars they are, both of them, but talk about keenness! +All they think about is the Spies, and the war, of course. D'you know what +that little girl of mine did last Saturday, when her troop was on a hike +out Berkhamsted way? She got two other girls to go with her, slipped off +from the hike, and spent the whole afternoon following a strange man. They +kept on his tail for two hours, right through the woods, and then, when +they got into Amersham, handed him over to the patrols.' + +'What did they do that for?' said Winston, somewhat taken aback. Parsons +went on triumphantly: + +'My kid made sure he was some kind of enemy agent--might have been dropped +by parachute, for instance. But here's the point, old boy. What do you +think put her on to him in the first place? She spotted he was wearing a +funny kind of shoes--said she'd never seen anyone wearing shoes like that +before. So the chances were he was a foreigner. Pretty smart for a nipper +of seven, eh?' + +'What happened to the man?' said Winston. + +'Ah, that I couldn't say, of course. But I wouldn't be altogether surprised +if----' Parsons made the motion of aiming a rifle, and clicked his tongue +for the explosion. + +'Good,' said Syme abstractedly, without looking up from his strip of paper. + +'Of course we can't afford to take chances,' agreed Winston dutifully. + +'What I mean to say, there is a war on,' said Parsons. + +As though in confirmation of this, a trumpet call floated from the +telescreen just above their heads. However, it was not the proclamation of +a military victory this time, but merely an announcement from the Ministry +of Plenty. + +'Comrades!' cried an eager youthful voice. 'Attention, comrades! We have +glorious news for you. We have won the battle for production! Returns now +completed of the output of all classes of consumption goods show that the +standard of living has risen by no less than 20 per cent over the past +year. All over Oceania this morning there were irrepressible spontaneous +demonstrations when workers marched out of factories and offices and +paraded through the streets with banners voicing their gratitude to Big +Brother for the new, happy life which his wise leadership has bestowed +upon us. Here are some of the completed figures. Foodstuffs----' + +The phrase 'our new, happy life' recurred several times. It had been a +favourite of late with the Ministry of Plenty. Parsons, his attention +caught by the trumpet call, sat listening with a sort of gaping solemnity, +a sort of edified boredom. He could not follow the figures, but he was +aware that they were in some way a cause for satisfaction. He had lugged +out a huge and filthy pipe which was already half full of charred tobacco. +With the tobacco ration at 100 grammes a week it was seldom possible to +fill a pipe to the top. Winston was smoking a Victory Cigarette which he +held carefully horizontal. The new ration did not start till tomorrow and +he had only four cigarettes left. For the moment he had shut his ears to +the remoter noises and was listening to the stuff that streamed out of the +telescreen. It appeared that there had even been demonstrations to thank +Big Brother for raising the chocolate ration to twenty grammes a week. And +only yesterday, he reflected, it had been announced that the ration was +to be REDUCED to twenty grammes a week. Was it possible that they could +swallow that, after only twenty-four hours? Yes, they swallowed it. Parsons +swallowed it easily, with the stupidity of an animal. The eyeless creature +at the other table swallowed it fanatically, passionately, with a furious +desire to track down, denounce, and vaporize anyone who should suggest that +last week the ration had been thirty grammes. Syme, too--in some more +complex way, involving doublethink, Syme swallowed it. Was he, then, ALONE +in the possession of a memory? + +The fabulous statistics continued to pour out of the telescreen. As +compared with last year there was more food, more clothes, more houses, +more furniture, more cooking-pots, more fuel, more ships, more helicopters, +more books, more babies--more of everything except disease, crime, and +insanity. Year by year and minute by minute, everybody and everything was +whizzing rapidly upwards. As Syme had done earlier Winston had taken up +his spoon and was dabbling in the pale-coloured gravy that dribbled across +the table, drawing a long streak of it out into a pattern. He meditated +resentfully on the physical texture of life. Had it always been like +this? Had food always tasted like this? He looked round the canteen. +A low-ceilinged, crowded room, its walls grimy from the contact of +innumerable bodies; battered metal tables and chairs, placed so close +together that you sat with elbows touching; bent spoons, dented trays, +coarse white mugs; all surfaces greasy, grime in every crack; and a +sourish, composite smell of bad gin and bad coffee and metallic stew and +dirty clothes. Always in your stomach and in your skin there was a sort +of protest, a feeling that you had been cheated of something that you had +a right to. It was true that he had no memories of anything greatly +different. In any time that he could accurately remember, there had never +been quite enough to eat, one had never had socks or underclothes that +were not full of holes, furniture had always been battered and rickety, +rooms underheated, tube trains crowded, houses falling to pieces, +bread dark-coloured, tea a rarity, coffee filthy-tasting, cigarettes +insufficient--nothing cheap and plentiful except synthetic gin. And though, +of course, it grew worse as one's body aged, was it not a sign that this +was NOT the natural order of things, if one's heart sickened at the +discomfort and dirt and scarcity, the interminable winters, the stickiness +of one's socks, the lifts that never worked, the cold water, the gritty +soap, the cigarettes that came to pieces, the food with its strange evil +tastes? Why should one feel it to be intolerable unless one had some kind +of ancestral memory that things had once been different? + +He looked round the canteen again. Nearly everyone was ugly, and would +still have been ugly even if dressed otherwise than in the uniform blue +overalls. On the far side of the room, sitting at a table alone, a small, +curiously beetle-like man was drinking a cup of coffee, his little eyes +darting suspicious glances from side to side. How easy it was, thought +Winston, if you did not look about you, to believe that the physical type +set up by the Party as an ideal--tall muscular youths and deep-bosomed +maidens, blond-haired, vital, sunburnt, carefree--existed and even +predominated. Actually, so far as he could judge, the majority of people +in Airstrip One were small, dark, and ill-favoured. It was curious how that +beetle-like type proliferated in the Ministries: little dumpy men, growing +stout very early in life, with short legs, swift scuttling movements, and +fat inscrutable faces with very small eyes. It was the type that seemed to +flourish best under the dominion of the Party. + +The announcement from the Ministry of Plenty ended on another trumpet call +and gave way to tinny music. Parsons, stirred to vague enthusiasm by the +bombardment of figures, took his pipe out of his mouth. + +'The Ministry of Plenty's certainly done a good job this year,' he said +with a knowing shake of his head. 'By the way, Smith old boy, I suppose +you haven't got any razor blades you can let me have?' + +'Not one,' said Winston. 'I've been using the same blade for six weeks +myself.' + +'Ah, well--just thought I'd ask you, old boy.' + +'Sorry,' said Winston. + +The quacking voice from the next table, temporarily silenced during the +Ministry's announcement, had started up again, as loud as ever. For some +reason Winston suddenly found himself thinking of Mrs Parsons, with her +wispy hair and the dust in the creases of her face. Within two years those +children would be denouncing her to the Thought Police. Mrs Parsons would +be vaporized. Syme would be vaporized. Winston would be vaporized. O'Brien +would be vaporized. Parsons, on the other hand, would never be vaporized. +The eyeless creature with the quacking voice would never be vaporized. +The little beetle-like men who scuttle so nimbly through the labyrinthine +corridors of Ministries they, too, would never be vaporized. And the girl +with dark hair, the girl from the Fiction Department--she would never be +vaporized either. It seemed to him that he knew instinctively who would +survive and who would perish: though just what it was that made for +survival, it was not easy to say. + +At this moment he was dragged out of his reverie with a violent jerk. The +girl at the next table had turned partly round and was looking at him. It +was the girl with dark hair. She was looking at him in a sidelong way, but +with curious intensity. The instant she caught his eye she looked away +again. + +The sweat started out on Winston's backbone. A horrible pang of terror +went through him. It was gone almost at once, but it left a sort of nagging +uneasiness behind. Why was she watching him? Why did she keep following him +about? Unfortunately he could not remember whether she had already been at +the table when he arrived, or had come there afterwards. But yesterday, at +any rate, during the Two Minutes Hate, she had sat immediately behind him +when there was no apparent need to do so. Quite likely her real object had +been to listen to him and make sure whether he was shouting loudly enough. + +His earlier thought returned to him: probably she was not actually a member +of the Thought Police, but then it was precisely the amateur spy who was +the greatest danger of all. He did not know how long she had been looking +at him, but perhaps for as much as five minutes, and it was possible +that his features had not been perfectly under control. It was terribly +dangerous to let your thoughts wander when you were in any public place +or within range of a telescreen. The smallest thing could give you away. +A nervous tic, an unconscious look of anxiety, a habit of muttering to +yourself--anything that carried with it the suggestion of abnormality, of +having something to hide. In any case, to wear an improper expression on +your face (to look incredulous when a victory was announced, for example) +was itself a punishable offence. There was even a word for it in Newspeak: +FACECRIME, it was called. + +The girl had turned her back on him again. Perhaps after all she was not +really following him about, perhaps it was coincidence that she had sat so +close to him two days running. His cigarette had gone out, and he laid it +carefully on the edge of the table. He would finish smoking it after work, +if he could keep the tobacco in it. Quite likely the person at the next +table was a spy of the Thought Police, and quite likely he would be in the +cellars of the Ministry of Love within three days, but a cigarette end +must not be wasted. Syme had folded up his strip of paper and stowed it +away in his pocket. Parsons had begun talking again. + +'Did I ever tell you, old boy,' he said, chuckling round the stem of his +pipe, 'about the time when those two nippers of mine set fire to the old +market-woman's skirt because they saw her wrapping up sausages in a poster +of B.B.? Sneaked up behind her and set fire to it with a box of matches. +Burned her quite badly, I believe. Little beggars, eh? But keen as mustard! +That's a first-rate training they give them in the Spies nowadays--better +than in my day, even. What d'you think's the latest thing they've served +them out with? Ear trumpets for listening through keyholes! My little +girl brought one home the other night--tried it out on our sitting-room +door, and reckoned she could hear twice as much as with her ear to the +hole. Of course it's only a toy, mind you. Still, gives 'em the right +idea, eh?' + +At this moment the telescreen let out a piercing whistle. It was the +signal to return to work. All three men sprang to their feet to join in +the struggle round the lifts, and the remaining tobacco fell out of +Winston's cigarette. + + + + +Chapter 6 + + + +Winston was writing in his diary: + + + It was three years ago. It was on a dark evening, in a narrow +side-street near one of the big railway stations. She was standing near a +doorway in the wall, under a street lamp that hardly gave any light. She +had a young face, painted very thick. It was really the paint that appealed +to me, the whiteness of it, like a mask, and the bright red lips. Party +women never paint their faces. There was nobody else in the street, and no +telescreens. She said two dollars. I---- + + +For the moment it was too difficult to go on. He shut his eyes and pressed +his fingers against them, trying to squeeze out the vision that kept +recurring. He had an almost overwhelming temptation to shout a string of +filthy words at the top of his voice. Or to bang his head against the wall, +to kick over the table, and hurl the inkpot through the window--to do any +violent or noisy or painful thing that might black out the memory that was +tormenting him. + +Your worst enemy, he reflected, was your own nervous system. At any moment +the tension inside you was liable to translate itself into some visible +symptom. He thought of a man whom he had passed in the street a few weeks +back; a quite ordinary-looking man, a Party member, aged thirty-five to +forty, tallish and thin, carrying a brief-case. They were a few metres +apart when the left side of the man's face was suddenly contorted by a sort +of spasm. It happened again just as they were passing one another: it was +only a twitch, a quiver, rapid as the clicking of a camera shutter, but +obviously habitual. He remembered thinking at the time: That poor devil is +done for. And what was frightening was that the action was quite possibly +unconscious. The most deadly danger of all was talking in your sleep. There +was no way of guarding against that, so far as he could see. + +He drew his breath and went on writing: + + + I went with her through the doorway and across a backyard into a +basement kitchen. There was a bed against the wall, and a lamp on the +table, turned down very low. She---- + + +His teeth were set on edge. He would have liked to spit. Simultaneously +with the woman in the basement kitchen he thought of Katharine, his wife. +Winston was married--had been married, at any rate: probably he still was +married, so far as he knew his wife was not dead. He seemed to breathe +again the warm stuffy odour of the basement kitchen, an odour compounded +of bugs and dirty clothes and villainous cheap scent, but nevertheless +alluring, because no woman of the Party ever used scent, or could be +imagined as doing so. Only the proles used scent. In his mind the smell +of it was inextricably mixed up with fornication. + +When he had gone with that woman it had been his first lapse in two years +or thereabouts. Consorting with prostitutes was forbidden, of course, but +it was one of those rules that you could occasionally nerve yourself to +break. It was dangerous, but it was not a life-and-death matter. To be +caught with a prostitute might mean five years in a forced-labour camp: +not more, if you had committed no other offence. And it was easy enough, +provided that you could avoid being caught in the act. The poorer quarters +swarmed with women who were ready to sell themselves. Some could even be +purchased for a bottle of gin, which the proles were not supposed to drink. +Tacitly the Party was even inclined to encourage prostitution, as an outlet +for instincts which could not be altogether suppressed. Mere debauchery +did not matter very much, so long as it was furtive and joyless and only +involved the women of a submerged and despised class. The unforgivable +crime was promiscuity between Party members. But--though this was one +of the crimes that the accused in the great purges invariably confessed +to--it was difficult to imagine any such thing actually happening. + +The aim of the Party was not merely to prevent men and women from forming +loyalties which it might not be able to control. Its real, undeclared +purpose was to remove all pleasure from the sexual act. Not love so much +as eroticism was the enemy, inside marriage as well as outside it. All +marriages between Party members had to be approved by a committee +appointed for the purpose, and--though the principle was never clearly +stated--permission was always refused if the couple concerned gave +the impression of being physically attracted to one another. The only +recognized purpose of marriage was to beget children for the service of +the Party. Sexual intercourse was to be looked on as a slightly disgusting +minor operation, like having an enema. This again was never put into plain +words, but in an indirect way it was rubbed into every Party member from +childhood onwards. There were even organizations such as the Junior +Anti-Sex League, which advocated complete celibacy for both sexes. All +children were to be begotten by artificial insemination (ARTSEM, it was +called in Newspeak) and brought up in public institutions. This, Winston +was aware, was not meant altogether seriously, but somehow it fitted in +with the general ideology of the Party. The Party was trying to kill the +sex instinct, or, if it could not be killed, then to distort it and dirty +it. He did not know why this was so, but it seemed natural that it should +be so. And as far as the women were concerned, the Party's efforts were +largely successful. + +He thought again of Katharine. It must be nine, ten--nearly eleven years +since they had parted. It was curious how seldom he thought of her. For +days at a time he was capable of forgetting that he had ever been married. +They had only been together for about fifteen months. The Party did not +permit divorce, but it rather encouraged separation in cases where there +were no children. + +Katharine was a tall, fair-haired girl, very straight, with splendid +movements. She had a bold, aquiline face, a face that one might have called +noble until one discovered that there was as nearly as possible nothing +behind it. Very early in her married life he had decided--though perhaps +it was only that he knew her more intimately than he knew most people--that +she had without exception the most stupid, vulgar, empty mind that he had +ever encountered. She had not a thought in her head that was not a slogan, +and there was no imbecility, absolutely none that she was not capable of +swallowing if the Party handed it out to her. 'The human sound-track' he +nicknamed her in his own mind. Yet he could have endured living with her +if it had not been for just one thing--sex. + +As soon as he touched her she seemed to wince and stiffen. To embrace her +was like embracing a jointed wooden image. And what was strange was that +even when she was clasping him against her he had the feeling that she +was simultaneously pushing him away with all her strength. The rigidity +of her muscles managed to convey that impression. She would lie there +with shut eyes, neither resisting nor co-operating but SUBMITTING. It was +extraordinarily embarrassing, and, after a while, horrible. But even then +he could have borne living with her if it had been agreed that they should +remain celibate. But curiously enough it was Katharine who refused this. +They must, she said, produce a child if they could. So the performance +continued to happen, once a week quite regularly, whenever it was not +impossible. She even used to remind him of it in the morning, as something +which had to be done that evening and which must not be forgotten. She had +two names for it. One was 'making a baby', and the other was 'our duty to +the Party' (yes, she had actually used that phrase). Quite soon he grew to +have a feeling of positive dread when the appointed day came round. But +luckily no child appeared, and in the end she agreed to give up trying, +and soon afterwards they parted. + +Winston sighed inaudibly. He picked up his pen again and +wrote: + + + She threw herself down on the bed, and at once, without any kind of +preliminary in the most coarse, horrible way you can imagine, pulled up +her skirt. I---- + + +He saw himself standing there in the dim lamplight, with the smell of bugs +and cheap scent in his nostrils, and in his heart a feeling of defeat and +resentment which even at that moment was mixed up with the thought of +Katharine's white body, frozen for ever by the hypnotic power of the Party. +Why did it always have to be like this? Why could he not have a woman of +his own instead of these filthy scuffles at intervals of years? But a real +love affair was an almost unthinkable event. The women of the Party were +all alike. Chastity was as deep ingrained in them as Party loyalty. By +careful early conditioning, by games and cold water, by the rubbish that +was dinned into them at school and in the Spies and the Youth League, by +lectures, parades, songs, slogans, and martial music, the natural feeling +had been driven out of them. His reason told him that there must be +exceptions, but his heart did not believe it. They were all impregnable, +as the Party intended that they should be. And what he wanted, more even +than to be loved, was to break down that wall of virtue, even if it were +only once in his whole life. The sexual act, successfully performed, was +rebellion. Desire was thoughtcrime. Even to have awakened Katharine, if he +could have achieved it, would have been like a seduction, although she was +his wife. + +But the rest of the story had got to be written down. He wrote: + + + I turned up the lamp. When I saw her in the light---- + + +After the darkness the feeble light of the paraffin lamp had seemed very +bright. For the first time he could see the woman properly. He had taken a +step towards her and then halted, full of lust and terror. He was painfully +conscious of the risk he had taken in coming here. It was perfectly +possible that the patrols would catch him on the way out: for that matter +they might be waiting outside the door at this moment. If he went away +without even doing what he had come here to do----! + +It had got to be written down, it had got to be confessed. What he had +suddenly seen in the lamplight was that the woman was OLD. The paint was +plastered so thick on her face that it looked as though it might crack +like a cardboard mask. There were streaks of white in her hair; but the +truly dreadful detail was that her mouth had fallen a little open, +revealing nothing except a cavernous blackness. She had no teeth at all. + +He wrote hurriedly, in scrabbling handwriting: + + + When I saw her in the light she was quite an old woman, fifty years old +at least. But I went ahead and did it just the same. + + +He pressed his fingers against his eyelids again. He had written it down +at last, but it made no difference. The therapy had not worked. The urge +to shout filthy words at the top of his voice was as strong as ever. + + + + +Chapter 7 + + + +'If there is hope,' wrote Winston, 'it lies in the proles.' + +If there was hope, it MUST lie in the proles, because only there in those +swarming disregarded masses, 85 per cent of the population of Oceania, +could the force to destroy the Party ever be generated. The Party could +not be overthrown from within. Its enemies, if it had any enemies, had +no way of coming together or even of identifying one another. Even if +the legendary Brotherhood existed, as just possibly it might, it was +inconceivable that its members could ever assemble in larger numbers than +twos and threes. Rebellion meant a look in the eyes, an inflexion of the +voice, at the most, an occasional whispered word. But the proles, if only +they could somehow become conscious of their own strength. would have no +need to conspire. They needed only to rise up and shake themselves like +a horse shaking off flies. If they chose they could blow the Party to +pieces tomorrow morning. Surely sooner or later it must occur to them to +do it? And yet----! + +He remembered how once he had been walking down a crowded street when a +tremendous shout of hundreds of voices women's voices--had burst from a +side-street a little way ahead. It was a great formidable cry of anger +and despair, a deep, loud 'Oh-o-o-o-oh!' that went humming on like the +reverberation of a bell. His heart had leapt. It's started! he had thought. +A riot! The proles are breaking loose at last! When he had reached the spot +it was to see a mob of two or three hundred women crowding round the stalls +of a street market, with faces as tragic as though they had been the doomed +passengers on a sinking ship. But at this moment the general despair broke +down into a multitude of individual quarrels. It appeared that one of the +stalls had been selling tin saucepans. They were wretched, flimsy things, +but cooking-pots of any kind were always difficult to get. Now the supply +had unexpectedly given out. The successful women, bumped and jostled by +the rest, were trying to make off with their saucepans while dozens of +others clamoured round the stall, accusing the stall-keeper of favouritism +and of having more saucepans somewhere in reserve. There was a fresh +outburst of yells. Two bloated women, one of them with her hair coming +down, had got hold of the same saucepan and were trying to tear it out of +one another's hands. For a moment they were both tugging, and then the +handle came off. Winston watched them disgustedly. And yet, just for a +moment, what almost frightening power had sounded in that cry from only +a few hundred throats! Why was it that they could never shout like that +about anything that mattered? + +He wrote: + + + Until they become conscious they will never rebel, and until after they +have rebelled they cannot become conscious. + + +That, he reflected, might almost have been a transcription from one of the +Party textbooks. The Party claimed, of course, to have liberated the proles +from bondage. Before the Revolution they had been hideously oppressed by +the capitalists, they had been starved and flogged, women had been forced +to work in the coal mines (women still did work in the coal mines, as a +matter of fact), children had been sold into the factories at the age +of six. But simultaneously, true to the Principles of doublethink, the +Party taught that the proles were natural inferiors who must be kept in +subjection, like animals, by the application of a few simple rules. In +reality very little was known about the proles. It was not necessary to +know much. So long as they continued to work and breed, their other +activities were without importance. Left to themselves, like cattle turned +loose upon the plains of Argentina, they had reverted to a style of life +that appeared to be natural to them, a sort of ancestral pattern. They were +born, they grew up in the gutters, they went to work at twelve, they passed +through a brief blossoming-period of beauty and sexual desire, they married +at twenty, they were middle-aged at thirty, they died, for the most part, +at sixty. Heavy physical work, the care of home and children, petty +quarrels with neighbours, films, football, beer, and above all, gambling, +filled up the horizon of their minds. To keep them in control was not +difficult. A few agents of the Thought Police moved always among them, +spreading false rumours and marking down and eliminating the few +individuals who were judged capable of becoming dangerous; but no attempt +was made to indoctrinate them with the ideology of the Party. It was not +desirable that the proles should have strong political feelings. All that +was required of them was a primitive patriotism which could be appealed to +whenever it was necessary to make them accept longer working-hours or +shorter rations. And even when they became discontented, as they sometimes +did, their discontent led nowhere, because being without general ideas, +they could only focus it on petty specific grievances. The larger evils +invariably escaped their notice. The great majority of proles did not even +have telescreens in their homes. Even the civil police interfered with them +very little. There was a vast amount of criminality in London, a whole +world-within-a-world of thieves, bandits, prostitutes, drug-peddlers, and +racketeers of every description; but since it all happened among the proles +themselves, it was of no importance. In all questions of morals they were +allowed to follow their ancestral code. The sexual puritanism of the +Party was not imposed upon them. Promiscuity went unpunished, divorce +was permitted. For that matter, even religious worship would have been +permitted if the proles had shown any sign of needing or wanting it. +They were beneath suspicion. As the Party slogan put it: 'Proles and +animals are free.' + +Winston reached down and cautiously scratched his varicose ulcer. It +had begun itching again. The thing you invariably came back to was the +impossibility of knowing what life before the Revolution had really been +like. He took out of the drawer a copy of a children's history textbook +which he had borrowed from Mrs Parsons, and began copying a passage into +the diary: + + + In the old days (it ran), before the glorious Revolution, London was +not the beautiful city that we know today. It was a dark, dirty, miserable +place where hardly anybody had enough to eat and where hundreds and +thousands of poor people had no boots on their feet and not even a roof to +sleep under. Children no older than you had to work twelve hours a day for +cruel masters who flogged them with whips if they worked too slowly and +fed them on nothing but stale breadcrusts and water. But in among all +this terrible poverty there were just a few great big beautiful houses +that were lived in by rich men who had as many as thirty servants to look +after them. These rich men were called capitalists. They were fat, ugly +men with wicked faces, like the one in the picture on the opposite page. +You can see that he is dressed in a long black coat which was called a +frock coat, and a queer, shiny hat shaped like a stovepipe, which was +called a top hat. This was the uniform of the capitalists, and no one else +was allowed to wear it. The capitalists owned everything in the world, and +everyone else was their slave. They owned all the land, all the houses, +all the factories, and all the money. If anyone disobeyed them they could +throw them into prison, or they could take his job away and starve him to +death. When any ordinary person spoke to a capitalist he had to cringe and +bow to him, and take off his cap and address him as 'Sir'. The chief of +all the capitalists was called the King, and---- + + +But he knew the rest of the catalogue. There would be mention of the +bishops in their lawn sleeves, the judges in their ermine robes, the +pillory, the stocks, the treadmill, the cat-o'-nine tails, the Lord Mayor's +Banquet, and the practice of kissing the Pope's toe. There was also +something called the JUS PRIMAE NOCTIS, which would probably not be +mentioned in a textbook for children. It was the law by which every +capitalist had the right to sleep with any woman working in one of his +factories. + +How could you tell how much of it was lies? It MIGHT be true that the +average human being was better off now than he had been before the +Revolution. The only evidence to the contrary was the mute protest in your +own bones, the instinctive feeling that the conditions you lived in were +intolerable and that at some other time they must have been different. It +struck him that the truly characteristic thing about modern life was not +its cruelty and insecurity, but simply its bareness, its dinginess, its +listlessness. Life, if you looked about you, bore no resemblance not only +to the lies that streamed out of the telescreens, but even to the ideals +that the Party was trying to achieve. Great areas of it, even for a Party +member, were neutral and non-political, a matter of slogging through dreary +jobs, fighting for a place on the Tube, darning a worn-out sock, cadging +a saccharine tablet, saving a cigarette end. The ideal set up by the +Party was something huge, terrible, and glittering--a world of steel +and concrete, of monstrous machines and terrifying weapons--a nation of +warriors and fanatics, marching forward in perfect unity, all thinking the +same thoughts and shouting the same slogans, perpetually working, fighting, +triumphing, persecuting--three hundred million people all with the same +face. The reality was decaying, dingy cities where underfed people shuffled +to and fro in leaky shoes, in patched-up nineteenth-century houses that +smelt always of cabbage and bad lavatories. He seemed to see a vision of +London, vast and ruinous, city of a million dustbins, and mixed up with it +was a picture of Mrs Parsons, a woman with lined face and wispy hair, +fiddling helplessly with a blocked waste-pipe. + +He reached down and scratched his ankle again. Day and night the +telescreens bruised your ears with statistics proving that people today +had more food, more clothes, better houses, better recreations--that they +lived longer, worked shorter hours, were bigger, healthier, stronger, +happier, more intelligent, better educated, than the people of fifty years +ago. Not a word of it could ever be proved or disproved. The Party claimed, +for example, that today 40 per cent of adult proles were literate: before +the Revolution, it was said, the number had only been 15 per cent. The +Party claimed that the infant mortality rate was now only 160 per +thousand, whereas before the Revolution it had been 300--and so it went +on. It was like a single equation with two unknowns. It might very well be +that literally every word in the history books, even the things that one +accepted without question, was pure fantasy. For all he knew there might +never have been any such law as the JUS PRIMAE NOCTIS, or any such creature +as a capitalist, or any such garment as a top hat. + +Everything faded into mist. The past was erased, the erasure was forgotten, +the lie became truth. Just once in his life he had possessed--AFTER the +event: that was what counted--concrete, unmistakable evidence of an act of +falsification. He had held it between his fingers for as long as thirty +seconds. In 1973, it must have been--at any rate, it was at about the time +when he and Katharine had parted. But the really relevant date was seven +or eight years earlier. + +The story really began in the middle sixties, the period of the great +purges in which the original leaders of the Revolution were wiped out +once and for all. By 1970 none of them was left, except Big Brother +himself. All the rest had by that time been exposed as traitors and +counter-revolutionaries. Goldstein had fled and was hiding no one knew +where, and of the others, a few had simply disappeared, while the majority +had been executed after spectacular public trials at which they made +confession of their crimes. Among the last survivors were three men named +Jones, Aaronson, and Rutherford. It must have been in 1965 that these three +had been arrested. As often happened, they had vanished for a year or more, +so that one did not know whether they were alive or dead, and then had +suddenly been brought forth to incriminate themselves in the usual way. +They had confessed to intelligence with the enemy (at that date, too, the +enemy was Eurasia), embezzlement of public funds, the murder of various +trusted Party members, intrigues against the leadership of Big Brother +which had started long before the Revolution happened, and acts of sabotage +causing the death of hundreds of thousands of people. After confessing to +these things they had been pardoned, reinstated in the Party, and given +posts which were in fact sinecures but which sounded important. All three +had written long, abject articles in 'The Times', analysing the reasons +for their defection and promising to make amends. + +Some time after their release Winston had actually seen all three of them +in the Chestnut Tree Cafe. He remembered the sort of terrified fascination +with which he had watched them out of the corner of his eye. They were men +far older than himself, relics of the ancient world, almost the last great +figures left over from the heroic days of the Party. The glamour of the +underground struggle and the civil war still faintly clung to them. He had +the feeling, though already at that time facts and dates were growing +blurry, that he had known their names years earlier than he had known that +of Big Brother. But also they were outlaws, enemies, untouchables, doomed +with absolute certainty to extinction within a year or two. No one who had +once fallen into the hands of the Thought Police ever escaped in the end. +They were corpses waiting to be sent back to the grave. + +There was no one at any of the tables nearest to them. It was not wise +even to be seen in the neighbourhood of such people. They were sitting +in silence before glasses of the gin flavoured with cloves which was the +speciality of the cafe. Of the three, it was Rutherford whose appearance +had most impressed Winston. Rutherford had once been a famous caricaturist, +whose brutal cartoons had helped to inflame popular opinion before and +during the Revolution. Even now, at long intervals, his cartoons were +appearing in The Times. They were simply an imitation of his earlier +manner, and curiously lifeless and unconvincing. Always they were a +rehashing of the ancient themes--slum tenements, starving children, street +battles, capitalists in top hats--even on the barricades the capitalists +still seemed to cling to their top hats an endless, hopeless effort to +get back into the past. He was a monstrous man, with a mane of greasy +grey hair, his face pouched and seamed, with thick negroid lips. At one +time he must have been immensely strong; now his great body was sagging, +sloping, bulging, falling away in every direction. He seemed to be breaking +up before one's eyes, like a mountain crumbling. + +It was the lonely hour of fifteen. Winston could not now remember how he +had come to be in the cafe at such a time. The place was almost empty. A +tinny music was trickling from the telescreens. The three men sat in their +corner almost motionless, never speaking. Uncommanded, the waiter brought +fresh glasses of gin. There was a chessboard on the table beside them, with +the pieces set out but no game started. And then, for perhaps half a minute +in all, something happened to the telescreens. The tune that they were +playing changed, and the tone of the music changed too. There came into +it--but it was something hard to describe. It was a peculiar, cracked, +braying, jeering note: in his mind Winston called it a yellow note. And +then a voice from the telescreen was singing: + + + Under the spreading chestnut tree + I sold you and you sold me: + There lie they, and here lie we + Under the spreading chestnut tree. + + +The three men never stirred. But when Winston glanced again at Rutherford's +ruinous face, he saw that his eyes were full of tears. And for the first +time he noticed, with a kind of inward shudder, and yet not knowing +AT WHAT he shuddered, that both Aaronson and Rutherford had broken noses. + +A little later all three were re-arrested. It appeared that they had +engaged in fresh conspiracies from the very moment of their release. At +their second trial they confessed to all their old crimes over again, with +a whole string of new ones. They were executed, and their fate was recorded +in the Party histories, a warning to posterity. About five years after +this, in 1973, Winston was unrolling a wad of documents which had just +flopped out of the pneumatic tube on to his desk when he came on a fragment +of paper which had evidently been slipped in among the others and then +forgotten. The instant he had flattened it out he saw its significance. +It was a half-page torn out of 'The Times' of about ten years earlier--the +top half of the page, so that it included the date--and it contained a +photograph of the delegates at some Party function in New York. Prominent +in the middle of the group were Jones, Aaronson, and Rutherford. There was +no mistaking them, in any case their names were in the caption at the +bottom. + +The point was that at both trials all three men had confessed that on that +date they had been on Eurasian soil. They had flown from a secret airfield +in Canada to a rendezvous somewhere in Siberia, and had conferred with +members of the Eurasian General Staff, to whom they had betrayed important +military secrets. The date had stuck in Winston's memory because it chanced +to be midsummer day; but the whole story must be on record in countless +other places as well. There was only one possible conclusion: the +confessions were lies. + +Of course, this was not in itself a discovery. Even at that time Winston +had not imagined that the people who were wiped out in the purges had +actually committed the crimes that they were accused of. But this was +concrete evidence; it was a fragment of the abolished past, like a fossil +bone which turns up in the wrong stratum and destroys a geological theory. +It was enough to blow the Party to atoms, if in some way it could have +been published to the world and its significance made known. + +He had gone straight on working. As soon as he saw what the photograph +was, and what it meant, he had covered it up with another sheet of paper. +Luckily, when he unrolled it, it had been upside-down from the point of +view of the telescreen. + +He took his scribbling pad on his knee and pushed back his chair so as +to get as far away from the telescreen as possible. To keep your face +expressionless was not difficult, and even your breathing could be +controlled, with an effort: but you could not control the beating of your +heart, and the telescreen was quite delicate enough to pick it up. He let +what he judged to be ten minutes go by, tormented all the while by the +fear that some accident--a sudden draught blowing across his desk, for +instance--would betray him. Then, without uncovering it again, he dropped +the photograph into the memory hole, along with some other waste papers. +Within another minute, perhaps, it would have crumbled into ashes. + +That was ten--eleven years ago. Today, probably, he would have kept that +photograph. It was curious that the fact of having held it in his fingers +seemed to him to make a difference even now, when the photograph itself, +as well as the event it recorded, was only memory. Was the Party's hold +upon the past less strong, he wondered, because a piece of evidence which +existed no longer HAD ONCE existed? + +But today, supposing that it could be somehow resurrected from its ashes, +the photograph might not even be evidence. Already, at the time when he +made his discovery, Oceania was no longer at war with Eurasia, and it must +have been to the agents of Eastasia that the three dead men had betrayed +their country. Since then there had been other changes--two, three, +he could not remember how many. Very likely the confessions had been +rewritten and rewritten until the original facts and dates no longer +had the smallest significance. The past not only changed, but changed +continuously. What most afflicted him with the sense of nightmare was that +he had never clearly understood why the huge imposture was undertaken. +The immediate advantages of falsifying the past were obvious, but the +ultimate motive was mysterious. He took up his pen again and wrote: + + + I understand HOW: I do not understand WHY. + + +He wondered, as he had many times wondered before, whether he himself was +a lunatic. Perhaps a lunatic was simply a minority of one. At one time it +had been a sign of madness to believe that the earth goes round the sun; +today, to believe that the past is unalterable. He might be ALONE in +holding that belief, and if alone, then a lunatic. But the thought of being +a lunatic did not greatly trouble him: the horror was that he might also +be wrong. + +He picked up the children's history book and looked at the portrait of +Big Brother which formed its frontispiece. The hypnotic eyes gazed into +his own. It was as though some huge force were pressing down upon +you--something that penetrated inside your skull, battering against your +brain, frightening you out of your beliefs, persuading you, almost, to +deny the evidence of your senses. In the end the Party would announce that +two and two made five, and you would have to believe it. It was inevitable +that they should make that claim sooner or later: the logic of their +position demanded it. Not merely the validity of experience, but the very +existence of external reality, was tacitly denied by their philosophy. The +heresy of heresies was common sense. And what was terrifying was not that +they would kill you for thinking otherwise, but that they might be right. +For, after all, how do we know that two and two make four? Or that the +force of gravity works? Or that the past is unchangeable? If both the past +and the external world exist only in the mind, and if the mind itself is +controllable what then? + +But no! His courage seemed suddenly to stiffen of its own accord. The face +of O'Brien, not called up by any obvious association, had floated into his +mind. He knew, with more certainty than before, that O'Brien was on his +side. He was writing the diary for O'Brien--TO O'Brien: it was like an +interminable letter which no one would ever read, but which was addressed +to a particular person and took its colour from that fact. + +The Party told you to reject the evidence of your eyes and ears. It was +their final, most essential command. His heart sank as he thought of +the enormous power arrayed against him, the ease with which any Party +intellectual would overthrow him in debate, the subtle arguments which he +would not be able to understand, much less answer. And yet he was in the +right! They were wrong and he was right. The obvious, the silly, and the +true had got to be defended. Truisms are true, hold on to that! The solid +world exists, its laws do not change. Stones are hard, water is wet, +objects unsupported fall towards the earth's centre. With the feeling that +he was speaking to O'Brien, and also that he was setting forth an important +axiom, he wrote: + + + Freedom is the freedom to say that two plus two make four. If that is +granted, all else follows. + + + + +Chapter 8 + + + +From somewhere at the bottom of a passage the smell of roasting +coffee--real coffee, not Victory Coffee--came floating out into the street. +Winston paused involuntarily. For perhaps two seconds he was back in the +half-forgotten world of his childhood. Then a door banged, seeming to cut +off the smell as abruptly as though it had been a sound. + +He had walked several kilometres over pavements, and his varicose ulcer +was throbbing. This was the second time in three weeks that he had missed +an evening at the Community Centre: a rash act, since you could be certain +that the number of your attendances at the Centre was carefully checked. +In principle a Party member had no spare time, and was never alone except +in bed. It was assumed that when he was not working, eating, or sleeping +he would be taking part in some kind of communal recreation: to do anything +that suggested a taste for solitude, even to go for a walk by yourself, +was always slightly dangerous. There was a word for it in Newspeak: +OWNLIFE, it was called, meaning individualism and eccentricity. But this +evening as he came out of the Ministry the balminess of the April air had +tempted him. The sky was a warmer blue than he had seen it that year, and +suddenly the long, noisy evening at the Centre, the boring, exhausting +games, the lectures, the creaking camaraderie oiled by gin, had seemed +intolerable. On impulse he had turned away from the bus-stop and wandered +off into the labyrinth of London, first south, then east, then north again, +losing himself among unknown streets and hardly bothering in which +direction he was going. + +'If there is hope,' he had written in the diary, 'it lies in the proles.' +The words kept coming back to him, statement of a mystical truth and a +palpable absurdity. He was somewhere in the vague, brown-coloured slums +to the north and east of what had once been Saint Pancras Station. He was +walking up a cobbled street of little two-storey houses with battered +doorways which gave straight on the pavement and which were somehow +curiously suggestive of ratholes. There were puddles of filthy water here +and there among the cobbles. In and out of the dark doorways, and down +narrow alley-ways that branched off on either side, people swarmed in +astonishing numbers--girls in full bloom, with crudely lipsticked mouths, +and youths who chased the girls, and swollen waddling women who showed you +what the girls would be like in ten years' time, and old bent creatures +shuffling along on splayed feet, and ragged barefooted children who played +in the puddles and then scattered at angry yells from their mothers. +Perhaps a quarter of the windows in the street were broken and boarded up. +Most of the people paid no attention to Winston; a few eyed him with a +sort of guarded curiosity. Two monstrous women with brick-red forearms +folded across their aprons were talking outside a doorway. Winston caught +scraps of conversation as he approached. + +'"Yes," I says to 'er, "that's all very well," I says. "But if you'd of +been in my place you'd of done the same as what I done. It's easy to +criticize," I says, "but you ain't got the same problems as what I got."' + +'Ah,' said the other, 'that's jest it. That's jest where it is.' + +The strident voices stopped abruptly. The women studied him in hostile +silence as he went past. But it was not hostility, exactly; merely a kind +of wariness, a momentary stiffening, as at the passing of some unfamiliar +animal. The blue overalls of the Party could not be a common sight in a +street like this. Indeed, it was unwise to be seen in such places, unless +you had definite business there. The patrols might stop you if you happened +to run into them. 'May I see your papers, comrade? What are you doing here? +What time did you leave work? Is this your usual way home?'--and so on and +so forth. Not that there was any rule against walking home by an unusual +route: but it was enough to draw attention to you if the Thought Police +heard about it. + +Suddenly the whole street was in commotion. There were yells of warning +from all sides. People were shooting into the doorways like rabbits. A +young woman leapt out of a doorway a little ahead of Winston, grabbed up a +tiny child playing in a puddle, whipped her apron round it, and leapt back +again, all in one movement. At the same instant a man in a concertina-like +black suit, who had emerged from a side alley, ran towards Winston, +pointing excitedly to the sky. + +'Steamer!' he yelled. 'Look out, guv'nor! Bang over'ead! Lay down quick!' + +'Steamer' was a nickname which, for some reason, the proles applied to +rocket bombs. Winston promptly flung himself on his face. The proles were +nearly always right when they gave you a warning of this kind. They seemed +to possess some kind of instinct which told them several seconds in advance +when a rocket was coming, although the rockets supposedly travelled faster +than sound. Winston clasped his forearms above his head. There was a roar +that seemed to make the pavement heave; a shower of light objects pattered +on to his back. When he stood up he found that he was covered with +fragments of glass from the nearest window. + +He walked on. The bomb had demolished a group of houses 200 metres up the +street. A black plume of smoke hung in the sky, and below it a cloud of +plaster dust in which a crowd was already forming around the ruins. There +was a little pile of plaster lying on the pavement ahead of him, and in +the middle of it he could see a bright red streak. When he got up to it he +saw that it was a human hand severed at the wrist. Apart from the bloody +stump, the hand was so completely whitened as to resemble a plaster cast. + +He kicked the thing into the gutter, and then, to avoid the crowd, turned +down a side-street to the right. Within three or four minutes he was out +of the area which the bomb had affected, and the sordid swarming life of +the streets was going on as though nothing had happened. It was nearly +twenty hours, and the drinking-shops which the proles frequented ('pubs', +they called them) were choked with customers. From their grimy swing doors, +endlessly opening and shutting, there came forth a smell of urine, sawdust, +and sour beer. In an angle formed by a projecting house-front three men +were standing very close together, the middle one of them holding a +folded-up newspaper which the other two were studying over his shoulder. +Even before he was near enough to make out the expression on their faces, +Winston could see absorption in every line of their bodies. It was +obviously some serious piece of news that they were reading. He was a few +paces away from them when suddenly the group broke up and two of the men +were in violent altercation. For a moment they seemed almost on the point +of blows. + +'Can't you bleeding well listen to what I say? I tell you no number ending +in seven ain't won for over fourteen months!' + +'Yes, it 'as, then!' + +'No, it 'as not! Back 'ome I got the 'ole lot of 'em for over two years +wrote down on a piece of paper. I takes 'em down reg'lar as the clock. An' +I tell you, no number ending in seven----' + +'Yes, a seven 'AS won! I could pretty near tell you the bleeding number. +Four oh seven, it ended in. It were in February--second week in February.' + +'February your grandmother! I got it all down in black and white. An' I +tell you, no number----' + +'Oh, pack it in!' said the third man. + +They were talking about the Lottery. Winston looked back when he had gone +thirty metres. They were still arguing, with vivid, passionate faces. +The Lottery, with its weekly pay-out of enormous prizes, was the one public +event to which the proles paid serious attention. It was probable that +there were some millions of proles for whom the Lottery was the principal +if not the only reason for remaining alive. It was their delight, their +folly, their anodyne, their intellectual stimulant. Where the Lottery was +concerned, even people who could barely read and write seemed capable of +intricate calculations and staggering feats of memory. There was a whole +tribe of men who made a living simply by selling systems, forecasts, and +lucky amulets. Winston had nothing to do with the running of the Lottery, +which was managed by the Ministry of Plenty, but he was aware (indeed +everyone in the party was aware) that the prizes were largely imaginary. +Only small sums were actually paid out, the winners of the big prizes being +non-existent persons. In the absence of any real intercommunication between +one part of Oceania and another, this was not difficult to arrange. + +But if there was hope, it lay in the proles. You had to cling on to that. +When you put it in words it sounded reasonable: it was when you looked at +the human beings passing you on the pavement that it became an act of +faith. The street into which he had turned ran downhill. He had a feeling +that he had been in this neighbourhood before, and that there was a main +thoroughfare not far away. From somewhere ahead there came a din of +shouting voices. The street took a sharp turn and then ended in a flight +of steps which led down into a sunken alley where a few stall-keepers +were selling tired-looking vegetables. At this moment Winston remembered +where he was. The alley led out into the main street, and down the next +turning, not five minutes away, was the junk-shop where he had bought the +blank book which was now his diary. And in a small stationer's shop not +far away he had bought his penholder and his bottle of ink. + +He paused for a moment at the top of the steps. On the opposite side of +the alley there was a dingy little pub whose windows appeared to be frosted +over but in reality were merely coated with dust. A very old man, bent but +active, with white moustaches that bristled forward like those of a prawn, +pushed open the swing door and went in. As Winston stood watching, it +occurred to him that the old man, who must be eighty at the least, had +already been middle-aged when the Revolution happened. He and a few others +like him were the last links that now existed with the vanished world of +capitalism. In the Party itself there were not many people left whose ideas +had been formed before the Revolution. The older generation had mostly +been wiped out in the great purges of the fifties and sixties, and the few +who survived had long ago been terrified into complete intellectual +surrender. If there was any one still alive who could give you a truthful +account of conditions in the early part of the century, it could only be a +prole. Suddenly the passage from the history book that he had copied into +his diary came back into Winston's mind, and a lunatic impulse took hold +of him. He would go into the pub, he would scrape acquaintance with that +old man and question him. He would say to him: 'Tell me about your life +when you were a boy. What was it like in those days? Were things better +than they are now, or were they worse?' + +Hurriedly, lest he should have time to become frightened, he descended the +steps and crossed the narrow street. It was madness of course. As usual, +there was no definite rule against talking to proles and frequenting their +pubs, but it was far too unusual an action to pass unnoticed. If the +patrols appeared he might plead an attack of faintness, but it was not +likely that they would believe him. He pushed open the door, and a hideous +cheesy smell of sour beer hit him in the face. As he entered the din of +voices dropped to about half its volume. Behind his back he could feel +everyone eyeing his blue overalls. A game of darts which was going on at +the other end of the room interrupted itself for perhaps as much as thirty +seconds. The old man whom he had followed was standing at the bar, having +some kind of altercation with the barman, a large, stout, hook-nosed young +man with enormous forearms. A knot of others, standing round with glasses +in their hands, were watching the scene. + +'I arst you civil enough, didn't I?' said the old man, straightening his +shoulders pugnaciously. 'You telling me you ain't got a pint mug in the +'ole bleeding boozer?' + +'And what in hell's name IS a pint?' said the barman, leaning forward with +the tips of his fingers on the counter. + +''Ark at 'im! Calls 'isself a barman and don't know what a pint is! Why, +a pint's the 'alf of a quart, and there's four quarts to the gallon. +'Ave to teach you the A, B, C next.' + +'Never heard of 'em,' said the barman shortly. 'Litre and half +litre--that's all we serve. There's the glasses on the shelf in front +of you.' + +'I likes a pint,' persisted the old man. 'You could 'a drawed me off a pint +easy enough. We didn't 'ave these bleeding litres when I was a young man.' + +'When you were a young man we were all living in the treetops,' said the +barman, with a glance at the other customers. + +There was a shout of laughter, and the uneasiness caused by Winston's entry +seemed to disappear. The old man's white-stubbled face had flushed pink. He +turned away, muttering to himself, and bumped into Winston. Winston caught +him gently by the arm. + +'May I offer you a drink?' he said. + +'You're a gent,' said the other, straightening his shoulders again. He +appeared not to have noticed Winston's blue overalls. 'Pint!' he added +aggressively to the barman. 'Pint of wallop.' + +The barman swished two half-litres of dark-brown beer into thick glasses +which he had rinsed in a bucket under the counter. Beer was the only drink +you could get in prole pubs. The proles were supposed not to drink gin, +though in practice they could get hold of it easily enough. The game of +darts was in full swing again, and the knot of men at the bar had begun +talking about lottery tickets. Winston's presence was forgotten for a +moment. There was a deal table under the window where he and the old man +could talk without fear of being overheard. It was horribly dangerous, but +at any rate there was no telescreen in the room, a point he had made sure +of as soon as he came in. + +''E could 'a drawed me off a pint,' grumbled the old man as he settled down +behind a glass. 'A 'alf litre ain't enough. It don't satisfy. And a 'ole +litre's too much. It starts my bladder running. Let alone the price.' + +'You must have seen great changes since you were a young man,' said +Winston tentatively. + +The old man's pale blue eyes moved from the darts board to the bar, and +from the bar to the door of the Gents, as though it were in the bar-room +that he expected the changes to have occurred. + +'The beer was better,' he said finally. 'And cheaper! When I was a young +man, mild beer--wallop we used to call it--was fourpence a pint. That was +before the war, of course.' + +'Which war was that?' said Winston. + +'It's all wars,' said the old man vaguely. He took up his glass, and his +shoulders straightened again. ''Ere's wishing you the very best of 'ealth!' + +In his lean throat the sharp-pointed Adam's apple made a surprisingly rapid +up-and-down movement, and the beer vanished. Winston went to the bar and +came back with two more half-litres. The old man appeared to have forgotten +his prejudice against drinking a full litre. + +'You are very much older than I am,' said Winston. 'You must have been a +grown man before I was born. You can remember what it was like in the old +days, before the Revolution. People of my age don't really know anything +about those times. We can only read about them in books, and what it says +in the books may not be true. I should like your opinion on that. The +history books say that life before the Revolution was completely different +from what it is now. There was the most terrible oppression, injustice, +poverty worse than anything we can imagine. Here in London, the great mass +of the people never had enough to eat from birth to death. Half of them +hadn't even boots on their feet. They worked twelve hours a day, they left +school at nine, they slept ten in a room. And at the same time there were +a very few people, only a few thousands--the capitalists, they were +called--who were rich and powerful. They owned everything that there was +to own. They lived in great gorgeous houses with thirty servants, they +rode about in motor-cars and four-horse carriages, they drank champagne, +they wore top hats----' + +The old man brightened suddenly. + +'Top 'ats!' he said. 'Funny you should mention 'em. The same thing come +into my 'ead only yesterday, I dono why. I was jest thinking, I ain't seen +a top 'at in years. Gorn right out, they 'ave. The last time I wore one +was at my sister-in-law's funeral. And that was--well, I couldn't give you +the date, but it must'a been fifty years ago. Of course it was only 'ired +for the occasion, you understand.' + +'It isn't very important about the top hats,' said Winston patiently. +'The point is, these capitalists--they and a few lawyers and priests and +so forth who lived on them--were the lords of the earth. Everything existed +for their benefit. You--the ordinary people, the workers--were their +slaves. They could do what they liked with you. They could ship you off to +Canada like cattle. They could sleep with your daughters if they chose. +They could order you to be flogged with something called a cat-o'-nine +tails. You had to take your cap off when you passed them. Every capitalist +went about with a gang of lackeys who----' + +The old man brightened again. + +'Lackeys!' he said. 'Now there's a word I ain't 'eard since ever so long. +Lackeys! That reg'lar takes me back, that does. I recollect--oh, donkey's +years ago--I used to sometimes go to 'Yde Park of a Sunday afternoon to +'ear the blokes making speeches. Salvation Army, Roman Catholics, Jews, +Indians--all sorts there was. And there was one bloke--well, I couldn't +give you 'is name, but a real powerful speaker 'e was. 'E didn't 'alf +give it 'em! "Lackeys!" 'e says, "lackeys of the bourgeoisie! Flunkies of +the ruling class!" Parasites--that was another of them. And 'yenas--'e +definitely called 'em 'yenas. Of course 'e was referring to the Labour +Party, you understand.' + +Winston had the feeling that they were talking at cross-purposes. + +'What I really wanted to know was this,' he said. 'Do you feel that you +have more freedom now than you had in those days? Are you treated more +like a human being? In the old days, the rich people, the people at the +top----' + +'The 'Ouse of Lords,' put in the old man reminiscently. + +'The House of Lords, if you like. What I am asking is, were these people +able to treat you as an inferior, simply because they were rich and you +were poor? Is it a fact, for instance, that you had to call them "Sir" and +take off your cap when you passed them?' + +The old man appeared to think deeply. He drank off about a quarter of his +beer before answering. + +'Yes,' he said. 'They liked you to touch your cap to 'em. It showed +respect, like. I didn't agree with it, myself, but I done it often enough. +Had to, as you might say.' + +'And was it usual--I'm only quoting what I've read in history books--was +it usual for these people and their servants to push you off the pavement +into the gutter?' + +'One of 'em pushed me once,' said the old man. 'I recollect it as if it +was yesterday. It was Boat Race night--terribly rowdy they used to get on +Boat Race night--and I bumps into a young bloke on Shaftesbury Avenue. +Quite a gent, 'e was--dress shirt, top 'at, black overcoat. 'E was kind +of zig-zagging across the pavement, and I bumps into 'im accidental-like. +'E says, "Why can't you look where you're going?" 'e says. I say, "Ju think +you've bought the bleeding pavement?" 'E says, "I'll twist your bloody 'ead +off if you get fresh with me." I says, "You're drunk. I'll give you in +charge in 'alf a minute," I says. An' if you'll believe me, 'e puts 'is +'and on my chest and gives me a shove as pretty near sent me under the +wheels of a bus. Well, I was young in them days, and I was going to 'ave +fetched 'im one, only----' + +A sense of helplessness took hold of Winston. The old man's memory was +nothing but a rubbish-heap of details. One could question him all day +without getting any real information. The party histories might still be +true, after a fashion: they might even be completely true. He made a last +attempt. + +'Perhaps I have not made myself clear,' he said. 'What I'm trying to say +is this. You have been alive a very long time; you lived half your life +before the Revolution. In 1925, for instance, you were already grown up. +Would you say from what you can remember, that life in 1925 was better +than it is now, or worse? If you could choose, would you prefer to live +then or now?' + +The old man looked meditatively at the darts board. He finished up his +beer, more slowly than before. When he spoke it was with a tolerant +philosophical air, as though the beer had mellowed him. + +'I know what you expect me to say,' he said. 'You expect me to say as I'd +sooner be young again. Most people'd say they'd sooner be young, if you +arst 'em. You got your 'ealth and strength when you're young. When you +get to my time of life you ain't never well. I suffer something wicked +from my feet, and my bladder's jest terrible. Six and seven times a night +it 'as me out of bed. On the other 'and, there's great advantages in being +a old man. You ain't got the same worries. No truck with women, and that's +a great thing. I ain't 'ad a woman for near on thirty year, if you'd +credit it. Nor wanted to, what's more.' + +Winston sat back against the window-sill. It was no use going on. He was +about to buy some more beer when the old man suddenly got up and shuffled +rapidly into the stinking urinal at the side of the room. The extra +half-litre was already working on him. Winston sat for a minute or two +gazing at his empty glass, and hardly noticed when his feet carried him out +into the street again. Within twenty years at the most, he reflected, the +huge and simple question, 'Was life better before the Revolution than it +is now?' would have ceased once and for all to be answerable. But in effect +it was unanswerable even now, since the few scattered survivors from the +ancient world were incapable of comparing one age with another. They +remembered a million useless things, a quarrel with a workmate, a hunt for +a lost bicycle pump, the expression on a long-dead sister's face, the +swirls of dust on a windy morning seventy years ago: but all the relevant +facts were outside the range of their vision. They were like the ant, +which can see small objects but not large ones. And when memory failed and +written records were falsified--when that happened, the claim of the Party +to have improved the conditions of human life had got to be accepted, +because there did not exist, and never again could exist, any standard +against which it could be tested. + +At this moment his train of thought stopped abruptly. He halted and looked +up. He was in a narrow street, with a few dark little shops, interspersed +among dwelling-houses. Immediately above his head there hung three +discoloured metal balls which looked as if they had once been gilded. He +seemed to know the place. Of course! He was standing outside the junk-shop +where he had bought the diary. + +A twinge of fear went through him. It had been a sufficiently rash act to +buy the book in the beginning, and he had sworn never to come near the +place again. And yet the instant that he allowed his thoughts to wander, +his feet had brought him back here of their own accord. It was precisely +against suicidal impulses of this kind that he had hoped to guard himself +by opening the diary. At the same time he noticed that although it was +nearly twenty-one hours the shop was still open. With the feeling that he +would be less conspicuous inside than hanging about on the pavement, he +stepped through the doorway. If questioned, he could plausibly say that +he was trying to buy razor blades. + +The proprietor had just lighted a hanging oil lamp which gave off an +unclean but friendly smell. He was a man of perhaps sixty, frail and +bowed, with a long, benevolent nose, and mild eyes distorted by thick +spectacles. His hair was almost white, but his eyebrows were bushy and +still black. His spectacles, his gentle, fussy movements, and the fact +that he was wearing an aged jacket of black velvet, gave him a vague air +of intellectuality, as though he had been some kind of literary man, or +perhaps a musician. His voice was soft, as though faded, and his accent +less debased than that of the majority of proles. + +'I recognized you on the pavement,' he said immediately. 'You're the +gentleman that bought the young lady's keepsake album. That was a beautiful +bit of paper, that was. Cream-laid, it used to be called. There's been no +paper like that made for--oh, I dare say fifty years.' He peered at Winston +over the top of his spectacles. 'Is there anything special I can do for +you? Or did you just want to look round?' + +'I was passing,' said Winston vaguely. 'I just looked in. I don't want +anything in particular.' + +'It's just as well,' said the other, 'because I don't suppose I could have +satisfied you.' He made an apologetic gesture with his softpalmed hand. +'You see how it is; an empty shop, you might say. Between you and me, the +antique trade's just about finished. No demand any longer, and no stock +either. Furniture, china, glass it's all been broken up by degrees. And +of course the metal stuff's mostly been melted down. I haven't seen a brass +candlestick in years.' + +The tiny interior of the shop was in fact uncomfortably full, but there +was almost nothing in it of the slightest value. The floorspace was very +restricted, because all round the walls were stacked innumerable dusty +picture-frames. In the window there were trays of nuts and bolts, worn-out +chisels, penknives with broken blades, tarnished watches that did not even +pretend to be in going order, and other miscellaneous rubbish. Only on a +small table in the corner was there a litter of odds and ends--lacquered +snuffboxes, agate brooches, and the like--which looked as though they might +include something interesting. As Winston wandered towards the table his +eye was caught by a round, smooth thing that gleamed softly in the +lamplight, and he picked it up. + +It was a heavy lump of glass, curved on one side, flat on the other, making +almost a hemisphere. There was a peculiar softness, as of rainwater, in +both the colour and the texture of the glass. At the heart of it, magnified +by the curved surface, there was a strange, pink, convoluted object that +recalled a rose or a sea anemone. + +'What is it?' said Winston, fascinated. + +'That's coral, that is,' said the old man. 'It must have come from the +Indian Ocean. They used to kind of embed it in the glass. That wasn't made +less than a hundred years ago. More, by the look of it.' + +'It's a beautiful thing,' said Winston. + +'It is a beautiful thing,' said the other appreciatively. 'But there's not +many that'd say so nowadays.' He coughed. 'Now, if it so happened that you +wanted to buy it, that'd cost you four dollars. I can remember when a thing +like that would have fetched eight pounds, and eight pounds was--well, I +can't work it out, but it was a lot of money. But who cares about genuine +antiques nowadays--even the few that's left?' + +Winston immediately paid over the four dollars and slid the coveted thing +into his pocket. What appealed to him about it was not so much its beauty +as the air it seemed to possess of belonging to an age quite different +from the present one. The soft, rainwatery glass was not like any glass +that he had ever seen. The thing was doubly attractive because of its +apparent uselessness, though he could guess that it must once have been +intended as a paperweight. It was very heavy in his pocket, but fortunately +it did not make much of a bulge. It was a queer thing, even a compromising +thing, for a Party member to have in his possession. Anything old, and for +that matter anything beautiful, was always vaguely suspect. The old man had +grown noticeably more cheerful after receiving the four dollars. Winston +realized that he would have accepted three or even two. + +'There's another room upstairs that you might care to take a look at,' he +said. 'There's not much in it. Just a few pieces. We'll do with a light if +we're going upstairs.' + +He lit another lamp, and, with bowed back, led the way slowly up the +steep and worn stairs and along a tiny passage, into a room which did +not give on the street but looked out on a cobbled yard and a forest of +chimney-pots. Winston noticed that the furniture was still arranged as +though the room were meant to be lived in. There was a strip of carpet on +the floor, a picture or two on the walls, and a deep, slatternly arm-chair +drawn up to the fireplace. An old-fashioned glass clock with a twelve-hour +face was ticking away on the mantelpiece. Under the window, and occupying +nearly a quarter of the room, was an enormous bed with the mattress still +on it. + +'We lived here till my wife died,' said the old man half apologetically. +'I'm selling the furniture off by little and little. Now that's a beautiful +mahogany bed, or at least it would be if you could get the bugs out of it. +But I dare say you'd find it a little bit cumbersome.' + +He was holding the lamp high up, so as to illuminate the whole room, and +in the warm dim light the place looked curiously inviting. The thought +flitted through Winston's mind that it would probably be quite easy to +rent the room for a few dollars a week, if he dared to take the risk. It +was a wild, impossible notion, to be abandoned as soon as thought of; but +the room had awakened in him a sort of nostalgia, a sort of ancestral +memory. It seemed to him that he knew exactly what it felt like to sit in +a room like this, in an arm-chair beside an open fire with your feet in +the fender and a kettle on the hob; utterly alone, utterly secure, with +nobody watching you, no voice pursuing you, no sound except the singing +of the kettle and the friendly ticking of the clock. + +'There's no telescreen!' he could not help murmuring. + +'Ah,' said the old man, 'I never had one of those things. Too expensive. +And I never seemed to feel the need of it, somehow. Now that's a nice +gateleg table in the corner there. Though of course you'd have to put new +hinges on it if you wanted to use the flaps.' + +There was a small bookcase in the other corner, and Winston had already +gravitated towards it. It contained nothing but rubbish. The hunting-down +and destruction of books had been done with the same thoroughness in the +prole quarters as everywhere else. It was very unlikely that there existed +anywhere in Oceania a copy of a book printed earlier than 1960. The old +man, still carrying the lamp, was standing in front of a picture in a +rosewood frame which hung on the other side of the fireplace, opposite +the bed. + +'Now, if you happen to be interested in old prints at all----' he began +delicately. + +Winston came across to examine the picture. It was a steel engraving of an +oval building with rectangular windows, and a small tower in front. There +was a railing running round the building, and at the rear end there was +what appeared to be a statue. Winston gazed at it for some moments. It +seemed vaguely familiar, though he did not remember the statue. + +'The frame's fixed to the wall,' said the old man, 'but I could unscrew it +for you, I dare say.' + +'I know that building,' said Winston finally. 'It's a ruin now. It's in +the middle of the street outside the Palace of Justice.' + +'That's right. Outside the Law Courts. It was bombed in--oh, many years +ago. It was a church at one time, St Clement Danes, its name was.' He +smiled apologetically, as though conscious of saying something slightly +ridiculous, and added: 'Oranges and lemons, say the bells of St Clement's!' + +'What's that?' said Winston. + +'Oh--"Oranges and lemons, say the bells of St Clement's." That was a rhyme +we had when I was a little boy. How it goes on I don't remember, but I do +know it ended up, "Here comes a candle to light you to bed, Here comes a +chopper to chop off your head." It was a kind of a dance. They held out +their arms for you to pass under, and when they came to "Here comes a +chopper to chop off your head" they brought their arms down and caught you. +It was just names of churches. All the London churches were in it--all the +principal ones, that is.' + +Winston wondered vaguely to what century the church belonged. It was always +difficult to determine the age of a London building. Anything large and +impressive, if it was reasonably new in appearance, was automatically +claimed as having been built since the Revolution, while anything that was +obviously of earlier date was ascribed to some dim period called the Middle +Ages. The centuries of capitalism were held to have produced nothing of any +value. One could not learn history from architecture any more than one +could learn it from books. Statues, inscriptions, memorial stones, the +names of streets--anything that might throw light upon the past had been +systematically altered. + +'I never knew it had been a church,' he said. + +'There's a lot of them left, really,' said the old man, 'though they've +been put to other uses. Now, how did that rhyme go? Ah! I've got it! + + + "Oranges and lemons, say the bells of St Clement's, + You owe me three farthings, say the bells of St Martin's----" + + +there, now, that's as far as I can get. A farthing, that was a small copper +coin, looked something like a cent.' + +'Where was St Martin's?' said Winston. + +'St Martin's? That's still standing. It's in Victory Square, alongside the +picture gallery. A building with a kind of a triangular porch and pillars +in front, and a big flight of steps.' + +Winston knew the place well. It was a museum used for propaganda displays +of various kinds--scale models of rocket bombs and Floating Fortresses, +waxwork tableaux illustrating enemy atrocities, and the like. + +'St Martin's-in-the-Fields it used to be called,' supplemented the old man, +'though I don't recollect any fields anywhere in those parts.' + +Winston did not buy the picture. It would have been an even more +incongruous possession than the glass paperweight, and impossible to carry +home, unless it were taken out of its frame. But he lingered for some +minutes more, talking to the old man, whose name, he discovered, was not +Weeks--as one might have gathered from the inscription over the +shop-front--but Charrington. Mr Charrington, it seemed, was a widower aged +sixty-three and had inhabited this shop for thirty years. Throughout that +time he had been intending to alter the name over the window, but had never +quite got to the point of doing it. All the while that they were talking +the half-remembered rhyme kept running through Winston's head. Oranges and +lemons say the bells of St Clement's, You owe me three farthings, say +the bells of St Martin's! It was curious, but when you said it to yourself +you had the illusion of actually hearing bells, the bells of a lost London +that still existed somewhere or other, disguised and forgotten. From one +ghostly steeple after another he seemed to hear them pealing forth. Yet so +far as he could remember he had never in real life heard church bells +ringing. + +He got away from Mr Charrington and went down the stairs alone, so as not +to let the old man see him reconnoitring the street before stepping out of +the door. He had already made up his mind that after a suitable +interval--a month, say--he would take the risk of visiting the shop again. +It was perhaps not more dangerous than shirking an evening at the Centre. +The serious piece of folly had been to come back here in the first place, +after buying the diary and without knowing whether the proprietor of the +shop could be trusted. However----! + +Yes, he thought again, he would come back. He would buy further scraps of +beautiful rubbish. He would buy the engraving of St Clement Danes, take +it out of its frame, and carry it home concealed under the jacket of his +overalls. He would drag the rest of that poem out of Mr Charrington's +memory. Even the lunatic project of renting the room upstairs flashed +momentarily through his mind again. For perhaps five seconds exaltation +made him careless, and he stepped out on to the pavement without so much +as a preliminary glance through the window. He had even started humming +to an improvised tune + + + Oranges and lemons, say the bells of St Clement's, + You owe me three farthings, say the---- + + +Suddenly his heart seemed to turn to ice and his bowels to water. A figure +in blue overalls was coming down the pavement, not ten metres away. It was +the girl from the Fiction Department, the girl with dark hair. The light +was failing, but there was no difficulty in recognizing her. She looked +him straight in the face, then walked quickly on as though she had not +seen him. + +For a few seconds Winston was too paralysed to move. Then he turned to the +right and walked heavily away, not noticing for the moment that he was +going in the wrong direction. At any rate, one question was settled. There +was no doubting any longer that the girl was spying on him. She must have +followed him here, because it was not credible that by pure chance she +should have happened to be walking on the same evening up the same obscure +backstreet, kilometres distant from any quarter where Party members lived. +It was too great a coincidence. Whether she was really an agent of the +Thought Police, or simply an amateur spy actuated by officiousness, hardly +mattered. It was enough that she was watching him. Probably she had seen +him go into the pub as well. + +It was an effort to walk. The lump of glass in his pocket banged against +his thigh at each step, and he was half minded to take it out and throw it +away. The worst thing was the pain in his belly. For a couple of minutes +he had the feeling that he would die if he did not reach a lavatory soon. +But there would be no public lavatories in a quarter like this. Then the +spasm passed, leaving a dull ache behind. + +The street was a blind alley. Winston halted, stood for several seconds +wondering vaguely what to do, then turned round and began to retrace his +steps. As he turned it occurred to him that the girl had only passed him +three minutes ago and that by running he could probably catch up with her. +He could keep on her track till they were in some quiet place, and then +smash her skull in with a cobblestone. The piece of glass in his pocket +would be heavy enough for the job. But he abandoned the idea immediately, +because even the thought of making any physical effort was unbearable. He +could not run, he could not strike a blow. Besides, she was young and lusty +and would defend herself. He thought also of hurrying to the Community +Centre and staying there till the place closed, so as to establish a +partial alibi for the evening. But that too was impossible. A deadly +lassitude had taken hold of him. All he wanted was to get home quickly and +then sit down and be quiet. + +It was after twenty-two hours when he got back to the flat. The lights +would be switched off at the main at twenty-three thirty. He went into the +kitchen and swallowed nearly a teacupful of Victory Gin. Then he went to +the table in the alcove, sat down, and took the diary out of the drawer. +But he did not open it at once. From the telescreen a brassy female voice +was squalling a patriotic song. He sat staring at the marbled cover of the +book, trying without success to shut the voice out of his consciousness. + +It was at night that they came for you, always at night. The proper thing +was to kill yourself before they got you. Undoubtedly some people did so. +Many of the disappearances were actually suicides. But it needed desperate +courage to kill yourself in a world where firearms, or any quick and +certain poison, were completely unprocurable. He thought with a kind of +astonishment of the biological uselessness of pain and fear, the treachery +of the human body which always freezes into inertia at exactly the moment +when a special effort is needed. He might have silenced the dark-haired +girl if only he had acted quickly enough: but precisely because of the +extremity of his danger he had lost the power to act. It struck him that +in moments of crisis one is never fighting against an external enemy, but +always against one's own body. Even now, in spite of the gin, the dull +ache in his belly made consecutive thought impossible. And it is the same, +he perceived, in all seemingly heroic or tragic situations. On the +battlefield, in the torture chamber, on a sinking ship, the issues that +you are fighting for are always forgotten, because the body swells up until +it fills the universe, and even when you are not paralysed by fright or +screaming with pain, life is a moment-to-moment struggle against hunger or +cold or sleeplessness, against a sour stomach or an aching tooth. + +He opened the diary. It was important to write something down. The woman +on the telescreen had started a new song. Her voice seemed to stick into +his brain like jagged splinters of glass. He tried to think of O'Brien, +for whom, or to whom, the diary was written, but instead he began thinking +of the things that would happen to him after the Thought Police took him +away. It would not matter if they killed you at once. To be killed was +what you expected. But before death (nobody spoke of such things, yet +everybody knew of them) there was the routine of confession that had to +be gone through: the grovelling on the floor and screaming for mercy, the +crack of broken bones, the smashed teeth and bloody clots of hair. + +Why did you have to endure it, since the end was always the same? Why was +it not possible to cut a few days or weeks out of your life? Nobody ever +escaped detection, and nobody ever failed to confess. When once you had +succumbed to thoughtcrime it was certain that by a given date you would be +dead. Why then did that horror, which altered nothing, have to lie embedded +in future time? + +He tried with a little more success than before to summon up the image of +O'Brien. 'We shall meet in the place where there is no darkness,' O'Brien +had said to him. He knew what it meant, or thought he knew. The place where +there is no darkness was the imagined future, which one would never see, +but which, by foreknowledge, one could mystically share in. But with the +voice from the telescreen nagging at his ears he could not follow the train +of thought further. He put a cigarette in his mouth. Half the tobacco +promptly fell out on to his tongue, a bitter dust which was difficult to +spit out again. The face of Big Brother swam into his mind, displacing that +of O'Brien. Just as he had done a few days earlier, he slid a coin out of +his pocket and looked at it. The face gazed up at him, heavy, calm, +protecting: but what kind of smile was hidden beneath the dark moustache? +Like a leaden knell the words came back at him: + + + WAR IS PEACE + FREEDOM IS SLAVERY + IGNORANCE IS STRENGTH + + + + + +PART TWO + + + + +Chapter 1 + + + +It was the middle of the morning, and Winston had left the cubicle to go +to the lavatory. + +A solitary figure was coming towards him from the other end of the long, +brightly-lit corridor. It was the girl with dark hair. Four days had gone +past since the evening when he had run into her outside the junk-shop. +As she came nearer he saw that her right arm was in a sling, not noticeable +at a distance because it was of the same colour as her overalls. Probably +she had crushed her hand while swinging round one of the big kaleidoscopes +on which the plots of novels were 'roughed in'. It was a common accident +in the Fiction Department. + +They were perhaps four metres apart when the girl stumbled and fell almost +flat on her face. A sharp cry of pain was wrung out of her. She must have +fallen right on the injured arm. Winston stopped short. The girl had risen +to her knees. Her face had turned a milky yellow colour against which her +mouth stood out redder than ever. Her eyes were fixed on his, with an +appealing expression that looked more like fear than pain. + +A curious emotion stirred in Winston's heart. In front of him was an enemy +who was trying to kill him: in front of him, also, was a human creature, +in pain and perhaps with a broken bone. Already he had instinctively +started forward to help her. In the moment when he had seen her fall on +the bandaged arm, it had been as though he felt the pain in his own body. + +'You're hurt?' he said. + +'It's nothing. My arm. It'll be all right in a second.' + +She spoke as though her heart were fluttering. She had certainly turned +very pale. + +'You haven't broken anything?' + +'No, I'm all right. It hurt for a moment, that's all.' + +She held out her free hand to him, and he helped her up. She had regained +some of her colour, and appeared very much better. + +'It's nothing,' she repeated shortly. 'I only gave my wrist a bit of a +bang. Thanks, comrade!' + +And with that she walked on in the direction in which she had been going, +as briskly as though it had really been nothing. The whole incident could +not have taken as much as half a minute. Not to let one's feelings appear +in one's face was a habit that had acquired the status of an instinct, +and in any case they had been standing straight in front of a telescreen +when the thing happened. Nevertheless it had been very difficult not to +betray a momentary surprise, for in the two or three seconds while he was +helping her up the girl had slipped something into his hand. There was no +question that she had done it intentionally. It was something small and +flat. As he passed through the lavatory door he transferred it to his +pocket and felt it with the tips of his fingers. It was a scrap of paper +folded into a square. + +While he stood at the urinal he managed, with a little more fingering, to +get it unfolded. Obviously there must be a message of some kind written on +it. For a moment he was tempted to take it into one of the water-closets +and read it at once. But that would be shocking folly, as he well knew. +There was no place where you could be more certain that the telescreens +were watched continuously. + +He went back to his cubicle, sat down, threw the fragment of paper +casually among the other papers on the desk, put on his spectacles and +hitched the speakwrite towards him. 'Five minutes,' he told himself, +'five minutes at the very least!' His heart bumped in his breast with +frightening loudness. Fortunately the piece of work he was engaged on was +mere routine, the rectification of a long list of figures, not needing +close attention. + +Whatever was written on the paper, it must have some kind of political +meaning. So far as he could see there were two possibilities. One, much +the more likely, was that the girl was an agent of the Thought Police, +just as he had feared. He did not know why the Thought Police should +choose to deliver their messages in such a fashion, but perhaps they had +their reasons. The thing that was written on the paper might be a threat, a +summons, an order to commit suicide, a trap of some description. But there +was another, wilder possibility that kept raising its head, though he +tried vainly to suppress it. This was, that the message did not come from +the Thought Police at all, but from some kind of underground organization. +Perhaps the Brotherhood existed after all! Perhaps the girl was part of it! +No doubt the idea was absurd, but it had sprung into his mind in the very +instant of feeling the scrap of paper in his hand. It was not till a couple +of minutes later that the other, more probable explanation had occurred to +him. And even now, though his intellect told him that the message probably +meant death--still, that was not what he believed, and the unreasonable +hope persisted, and his heart banged, and it was with difficulty that he +kept his voice from trembling as he murmured his figures into the +speakwrite. + +He rolled up the completed bundle of work and slid it into the pneumatic +tube. Eight minutes had gone by. He re-adjusted his spectacles on his nose, +sighed, and drew the next batch of work towards him, with the scrap of +paper on top of it. He flattened it out. On it was written, in a large +unformed handwriting: + +I LOVE YOU. + +For several seconds he was too stunned even to throw the incriminating +thing into the memory hole. When he did so, although he knew very well the +danger of showing too much interest, he could not resist reading it once +again, just to make sure that the words were really there. + +For the rest of the morning it was very difficult to work. What was even +worse than having to focus his mind on a series of niggling jobs was the +need to conceal his agitation from the telescreen. He felt as though a +fire were burning in his belly. Lunch in the hot, crowded, noise-filled +canteen was torment. He had hoped to be alone for a little while during +the lunch hour, but as bad luck would have it the imbecile Parsons flopped +down beside him, the tang of his sweat almost defeating the tinny smell of +stew, and kept up a stream of talk about the preparations for Hate Week. +He was particularly enthusiastic about a papier-mache model of Big +Brother's head, two metres wide, which was being made for the occasion by +his daughter's troop of Spies. The irritating thing was that in the racket +of voices Winston could hardly hear what Parsons was saying, and was +constantly having to ask for some fatuous remark to be repeated. Just once +he caught a glimpse of the girl, at a table with two other girls at the +far end of the room. She appeared not to have seen him, and he did not +look in that direction again. + +The afternoon was more bearable. Immediately after lunch there arrived a +delicate, difficult piece of work which would take several hours and +necessitated putting everything else aside. It consisted in falsifying a +series of production reports of two years ago, in such a way as to cast +discredit on a prominent member of the Inner Party, who was now under a +cloud. This was the kind of thing that Winston was good at, and for more +than two hours he succeeded in shutting the girl out of his mind +altogether. Then the memory of her face came back, and with it a raging, +intolerable desire to be alone. Until he could be alone it was impossible +to think this new development out. Tonight was one of his nights at the +Community Centre. He wolfed another tasteless meal in the canteen, hurried +off to the Centre, took part in the solemn foolery of a 'discussion group', +played two games of table tennis, swallowed several glasses of gin, and +sat for half an hour through a lecture entitled 'Ingsoc in relation to +chess'. His soul writhed with boredom, but for once he had had no impulse +to shirk his evening at the Centre. At the sight of the words I LOVE YOU +the desire to stay alive had welled up in him, and the taking of minor +risks suddenly seemed stupid. It was not till twenty-three hours, when he +was home and in bed--in the darkness, where you were safe even from the +telescreen so long as you kept silent--that he was able to think +continuously. + +It was a physical problem that had to be solved: how to get in touch with +the girl and arrange a meeting. He did not consider any longer the +possibility that she might be laying some kind of trap for him. He knew +that it was not so, because of her unmistakable agitation when she handed +him the note. Obviously she had been frightened out of her wits, as well +she might be. Nor did the idea of refusing her advances even cross his +mind. Only five nights ago he had contemplated smashing her skull in with +a cobblestone, but that was of no importance. He thought of her naked, +youthful body, as he had seen it in his dream. He had imagined her a fool +like all the rest of them, her head stuffed with lies and hatred, her +belly full of ice. A kind of fever seized him at the thought that he might +lose her, the white youthful body might slip away from him! What he feared +more than anything else was that she would simply change her mind if he +did not get in touch with her quickly. But the physical difficulty of +meeting was enormous. It was like trying to make a move at chess when you +were already mated. Whichever way you turned, the telescreen faced you. +Actually, all the possible ways of communicating with her had occurred to +him within five minutes of reading the note; but now, with time to think, +he went over them one by one, as though laying out a row of instruments +on a table. + +Obviously the kind of encounter that had happened this morning could not +be repeated. If she had worked in the Records Department it might have +been comparatively simple, but he had only a very dim idea whereabouts in +the building the Fiction Department lay, and he had no pretext for going +there. If he had known where she lived, and at what time she left work, +he could have contrived to meet her somewhere on her way home; but to try +to follow her home was not safe, because it would mean loitering about +outside the Ministry, which was bound to be noticed. As for sending a +letter through the mails, it was out of the question. By a routine that +was not even secret, all letters were opened in transit. Actually, few +people ever wrote letters. For the messages that it was occasionally +necessary to send, there were printed postcards with long lists of phrases, +and you struck out the ones that were inapplicable. In any case he did not +know the girl's name, let alone her address. Finally he decided that the +safest place was the canteen. If he could get her at a table by herself, +somewhere in the middle of the room, not too near the telescreens, and +with a sufficient buzz of conversation all round--if these conditions +endured for, say, thirty seconds, it might be possible to exchange a few +words. + +For a week after this, life was like a restless dream. On the next day she +did not appear in the canteen until he was leaving it, the whistle having +already blown. Presumably she had been changed on to a later shift. They +passed each other without a glance. On the day after that she was in the +canteen at the usual time, but with three other girls and immediately +under a telescreen. Then for three dreadful days she did not appear at +all. His whole mind and body seemed to be afflicted with an unbearable +sensitivity, a sort of transparency, which made every movement, every +sound, every contact, every word that he had to speak or listen to, an +agony. Even in sleep he could not altogether escape from her image. He did +not touch the diary during those days. If there was any relief, it was in +his work, in which he could sometimes forget himself for ten minutes at a +stretch. He had absolutely no clue as to what had happened to her. There +was no enquiry he could make. She might have been vaporized, she might +have committed suicide, she might have been transferred to the other end +of Oceania: worst and likeliest of all, she might simply have changed her +mind and decided to avoid him. + +The next day she reappeared. Her arm was out of the sling and she had a +band of sticking-plaster round her wrist. The relief of seeing her was +so great that he could not resist staring directly at her for several +seconds. On the following day he very nearly succeeded in speaking to her. +When he came into the canteen she was sitting at a table well out from the +wall, and was quite alone. It was early, and the place was not very full. +The queue edged forward till Winston was almost at the counter, then was +held up for two minutes because someone in front was complaining that he +had not received his tablet of saccharine. But the girl was still alone +when Winston secured his tray and began to make for her table. He walked +casually towards her, his eyes searching for a place at some table beyond +her. She was perhaps three metres away from him. Another two seconds would +do it. Then a voice behind him called, 'Smith!' He pretended not to hear. +'Smith!' repeated the voice, more loudly. It was no use. He turned round. +A blond-headed, silly-faced young man named Wilsher, whom he barely knew, +was inviting him with a smile to a vacant place at his table. It was not +safe to refuse. After having been recognized, he could not go and sit at +a table with an unattended girl. It was too noticeable. He sat down with +a friendly smile. The silly blond face beamed into his. Winston had a +hallucination of himself smashing a pick-axe right into the middle of it. +The girl's table filled up a few minutes later. + +But she must have seen him coming towards her, and perhaps she would take +the hint. Next day he took care to arrive early. Surely enough, she was at +a table in about the same place, and again alone. The person immediately +ahead of him in the queue was a small, swiftly-moving, beetle-like man +with a flat face and tiny, suspicious eyes. As Winston turned away from +the counter with his tray, he saw that the little man was making straight +for the girl's table. His hopes sank again. There was a vacant place at a +table further away, but something in the little man's appearance suggested +that he would be sufficiently attentive to his own comfort to choose the +emptiest table. With ice at his heart Winston followed. It was no use +unless he could get the girl alone. At this moment there was a tremendous +crash. The little man was sprawling on all fours, his tray had gone flying, +two streams of soup and coffee were flowing across the floor. He started +to his feet with a malignant glance at Winston, whom he evidently +suspected of having tripped him up. But it was all right. Five seconds +later, with a thundering heart, Winston was sitting at the girl's table. + +He did not look at her. He unpacked his tray and promptly began eating. +It was all-important to speak at once, before anyone else came, but now +a terrible fear had taken possession of him. A week had gone by since +she had first approached him. She would have changed her mind, she must +have changed her mind! It was impossible that this affair should end +successfully; such things did not happen in real life. He might have +flinched altogether from speaking if at this moment he had not seen +Ampleforth, the hairy-eared poet, wandering limply round the room with +a tray, looking for a place to sit down. In his vague way Ampleforth +was attached to Winston, and would certainly sit down at his table if +he caught sight of him. There was perhaps a minute in which to act. Both +Winston and the girl were eating steadily. The stuff they were eating was +a thin stew, actually a soup, of haricot beans. In a low murmur Winston +began speaking. Neither of them looked up; steadily they spooned the +watery stuff into their mouths, and between spoonfuls exchanged the few +necessary words in low expressionless voices. + +'What time do you leave work?' + +'Eighteen-thirty.' + +'Where can we meet?' + +'Victory Square, near the monument.' + +'It's full of telescreens.' + +'It doesn't matter if there's a crowd.' + +'Any signal?' + +'No. Don't come up to me until you see me among a lot of people. And don't +look at me. Just keep somewhere near me.' + +'What time?' + +'Nineteen hours.' + +'All right.' + +Ampleforth failed to see Winston and sat down at another table. They did +not speak again, and, so far as it was possible for two people sitting on +opposite sides of the same table, they did not look at one another. The +girl finished her lunch quickly and made off, while Winston stayed to +smoke a cigarette. + +Winston was in Victory Square before the appointed time. He wandered round +the base of the enormous fluted column, at the top of which Big Brother's +statue gazed southward towards the skies where he had vanquished the +Eurasian aeroplanes (the Eastasian aeroplanes, it had been, a few years +ago) in the Battle of Airstrip One. In the street in front of it there was +a statue of a man on horseback which was supposed to represent Oliver +Cromwell. At five minutes past the hour the girl had still not appeared. +Again the terrible fear seized upon Winston. She was not coming, she had +changed her mind! He walked slowly up to the north side of the square and +got a sort of pale-coloured pleasure from identifying St Martin's Church, +whose bells, when it had bells, had chimed 'You owe me three farthings.' +Then he saw the girl standing at the base of the monument, reading or +pretending to read a poster which ran spirally up the column. It was not +safe to go near her until some more people had accumulated. There were +telescreens all round the pediment. But at this moment there was a din of +shouting and a zoom of heavy vehicles from somewhere to the left. Suddenly +everyone seemed to be running across the square. The girl nipped nimbly +round the lions at the base of the monument and joined in the rush. +Winston followed. As he ran, he gathered from some shouted remarks that +a convoy of Eurasian prisoners was passing. + +Already a dense mass of people was blocking the south side of the square. +Winston, at normal times the kind of person who gravitates to the outer +edge of any kind of scrimmage, shoved, butted, squirmed his way forward +into the heart of the crowd. Soon he was within arm's length of the girl, +but the way was blocked by an enormous prole and an almost equally enormous +woman, presumably his wife, who seemed to form an impenetrable wall of +flesh. Winston wriggled himself sideways, and with a violent lunge managed +to drive his shoulder between them. For a moment it felt as though his +entrails were being ground to pulp between the two muscular hips, then he +had broken through, sweating a little. He was next to the girl. They were +shoulder to shoulder, both staring fixedly in front of them. + +A long line of trucks, with wooden-faced guards armed with sub-machine +guns standing upright in each corner, was passing slowly down the street. +In the trucks little yellow men in shabby greenish uniforms were squatting, +jammed close together. Their sad, Mongolian faces gazed out over the sides +of the trucks utterly incurious. Occasionally when a truck jolted there +was a clank-clank of metal: all the prisoners were wearing leg-irons. +Truck-load after truck-load of the sad faces passed. Winston knew they +were there but he saw them only intermittently. The girl's shoulder, and +her arm right down to the elbow, were pressed against his. Her cheek was +almost near enough for him to feel its warmth. She had immediately taken +charge of the situation, just as she had done in the canteen. She began +speaking in the same expressionless voice as before, with lips barely +moving, a mere murmur easily drowned by the din of voices and the rumbling +of the trucks. + +'Can you hear me?' + +'Yes.' + +'Can you get Sunday afternoon off?' + +'Yes.' + +'Then listen carefully. You'll have to remember this. Go to Paddington +Station----' + +With a sort of military precision that astonished him, she outlined the +route that he was to follow. A half-hour railway journey; turn left outside +the station; two kilometres along the road; a gate with the top bar +missing; a path across a field; a grass-grown lane; a track between bushes; +a dead tree with moss on it. It was as though she had a map inside her +head. 'Can you remember all that?' she murmured finally. + +'Yes.' + +'You turn left, then right, then left again. And the gate's got no top bar.' + +'Yes. What time?' + +'About fifteen. You may have to wait. I'll get there by another way. Are +you sure you remember everything?' + +'Yes.' + +'Then get away from me as quick as you can.' + +She need not have told him that. But for the moment they could not +extricate themselves from the crowd. The trucks were still filing past, +the people still insatiably gaping. At the start there had been a few boos +and hisses, but it came only from the Party members among the crowd, and +had soon stopped. The prevailing emotion was simply curiosity. Foreigners, +whether from Eurasia or from Eastasia, were a kind of strange animal. One +literally never saw them except in the guise of prisoners, and even as +prisoners one never got more than a momentary glimpse of them. Nor did +one know what became of them, apart from the few who were hanged as +war-criminals: the others simply vanished, presumably into forced-labour +camps. The round Mogol faces had given way to faces of a more European +type, dirty, bearded and exhausted. From over scrubby cheekbones eyes +looked into Winston's, sometimes with strange intensity, and flashed away +again. The convoy was drawing to an end. In the last truck he could see an +aged man, his face a mass of grizzled hair, standing upright with wrists +crossed in front of him, as though he were used to having them bound +together. It was almost time for Winston and the girl to part. But at the +last moment, while the crowd still hemmed them in, her hand felt for his +and gave it a fleeting squeeze. + +It could not have been ten seconds, and yet it seemed a long time that +their hands were clasped together. He had time to learn every detail +of her hand. He explored the long fingers, the shapely nails, the +work-hardened palm with its row of callouses, the smooth flesh under the +wrist. Merely from feeling it he would have known it by sight. In the +same instant it occurred to him that he did not know what colour the +girl's eyes were. They were probably brown, but people with dark hair +sometimes had blue eyes. To turn his head and look at her would have +been inconceivable folly. With hands locked together, invisible among +the press of bodies, they stared steadily in front of them, and instead +of the eyes of the girl, the eyes of the aged prisoner gazed mournfully +at Winston out of nests of hair. + + + + +Chapter 2 + + + +Winston picked his way up the lane through dappled light and shade, +stepping out into pools of gold wherever the boughs parted. Under the +trees to the left of him the ground was misty with bluebells. The air +seemed to kiss one's skin. It was the second of May. From somewhere deeper +in the heart of the wood came the droning of ring-doves. + +He was a bit early. There had been no difficulties about the journey, and +the girl was so evidently experienced that he was less frightened than he +would normally have been. Presumably she could be trusted to find a safe +place. In general you could not assume that you were much safer in the +country than in London. There were no telescreens, of course, but there +was always the danger of concealed microphones by which your voice might +be picked up and recognized; besides, it was not easy to make a journey +by yourself without attracting attention. For distances of less than +100 kilometres it was not necessary to get your passport endorsed, but +sometimes there were patrols hanging about the railway stations, who +examined the papers of any Party member they found there and asked awkward +questions. However, no patrols had appeared, and on the walk from the +station he had made sure by cautious backward glances that he was not +being followed. The train was full of proles, in holiday mood because of +the summery weather. The wooden-seated carriage in which he travelled was +filled to overflowing by a single enormous family, ranging from a toothless +great-grandmother to a month-old baby, going out to spend an afternoon +with 'in-laws' in the country, and, as they freely explained to Winston, +to get hold of a little black-market butter. + +The lane widened, and in a minute he came to the footpath she had told him +of, a mere cattle-track which plunged between the bushes. He had no watch, +but it could not be fifteen yet. The bluebells were so thick underfoot +that it was impossible not to tread on them. He knelt down and began +picking some partly to pass the time away, but also from a vague idea that +he would like to have a bunch of flowers to offer to the girl when they +met. He had got together a big bunch and was smelling their faint sickly +scent when a sound at his back froze him, the unmistakable crackle of a +foot on twigs. He went on picking bluebells. It was the best thing to do. +It might be the girl, or he might have been followed after all. To look +round was to show guilt. He picked another and another. A hand fell +lightly on his shoulder. + +He looked up. It was the girl. She shook her head, evidently as a warning +that he must keep silent, then parted the bushes and quickly led the way +along the narrow track into the wood. Obviously she had been that way +before, for she dodged the boggy bits as though by habit. Winston followed, +still clasping his bunch of flowers. His first feeling was relief, but as +he watched the strong slender body moving in front of him, with the scarlet +sash that was just tight enough to bring out the curve of her hips, the +sense of his own inferiority was heavy upon him. Even now it seemed quite +likely that when she turned round and looked at him she would draw back +after all. The sweetness of the air and the greenness of the leaves daunted +him. Already on the walk from the station the May sunshine had made him +feel dirty and etiolated, a creature of indoors, with the sooty dust of +London in the pores of his skin. It occurred to him that till now she had +probably never seen him in broad daylight in the open. They came to the +fallen tree that she had spoken of. The girl hopped over and forced apart +the bushes, in which there did not seem to be an opening. When Winston +followed her, he found that they were in a natural clearing, a tiny grassy +knoll surrounded by tall saplings that shut it in completely. The girl +stopped and turned. + +'Here we are,' she said. + +He was facing her at several paces' distance. As yet he did not dare move +nearer to her. + +'I didn't want to say anything in the lane,' she went on, 'in case there's +a mike hidden there. I don't suppose there is, but there could be. There's +always the chance of one of those swine recognizing your voice. We're all +right here.' + +He still had not the courage to approach her. 'We're all right here?' +he repeated stupidly. + +'Yes. Look at the trees.' They were small ashes, which at some time had +been cut down and had sprouted up again into a forest of poles, none of +them thicker than one's wrist. 'There's nothing big enough to hide a mike +in. Besides, I've been here before.' + +They were only making conversation. He had managed to move closer to her +now. She stood before him very upright, with a smile on her face that +looked faintly ironical, as though she were wondering why he was so slow +to act. The bluebells had cascaded on to the ground. They seemed to have +fallen of their own accord. He took her hand. + +'Would you believe,' he said, 'that till this moment I didn't know what +colour your eyes were?' They were brown, he noted, a rather light shade of +brown, with dark lashes. 'Now that you've seen what I'm really like, +can you still bear to look at me?' + +'Yes, easily.' + +'I'm thirty-nine years old. I've got a wife that I can't get rid of. I've +got varicose veins. I've got five false teeth.' + +'I couldn't care less,' said the girl. + +The next moment, it was hard to say by whose act, she was in his arms. +At the beginning he had no feeling except sheer incredulity. The youthful +body was strained against his own, the mass of dark hair was against his +face, and yes! actually she had turned her face up and he was kissing the +wide red mouth. She had clasped her arms about his neck, she was calling +him darling, precious one, loved one. He had pulled her down on to the +ground, she was utterly unresisting, he could do what he liked with her. +But the truth was that he had no physical sensation, except that of mere +contact. All he felt was incredulity and pride. He was glad that this was +happening, but he had no physical desire. It was too soon, her youth and +prettiness had frightened him, he was too much used to living without +women--he did not know the reason. The girl picked herself up and pulled a +bluebell out of her hair. She sat against him, putting her arm round his +waist. + +'Never mind, dear. There's no hurry. We've got the whole afternoon. Isn't +this a splendid hide-out? I found it when I got lost once on a community +hike. If anyone was coming you could hear them a hundred metres away.' + +'What is your name?' said Winston. + +'Julia. I know yours. It's Winston--Winston Smith.' + +'How did you find that out?' + +'I expect I'm better at finding things out than you are, dear. Tell me, +what did you think of me before that day I gave you the note?' + +He did not feel any temptation to tell lies to her. It was even a sort of +love-offering to start off by telling the worst. + +'I hated the sight of you,' he said. 'I wanted to rape you and then murder +you afterwards. Two weeks ago I thought seriously of smashing your head in +with a cobblestone. If you really want to know, I imagined that you had +something to do with the Thought Police.' + +The girl laughed delightedly, evidently taking this as a +tribute to the excellence of her disguise. + +'Not the Thought Police! You didn't honestly think that?' + +'Well, perhaps not exactly that. But from your general appearance--merely +because you're young and fresh and healthy, you understand--I thought that +probably----' + +'You thought I was a good Party member. Pure in word and deed. Banners, +processions, slogans, games, community hikes all that stuff. And you +thought that if I had a quarter of a chance I'd denounce you as a +thought-criminal and get you killed off?' + +'Yes, something of that kind. A great many young girls are like that, +you know.' + +'It's this bloody thing that does it,' she said, ripping off the scarlet +sash of the Junior Anti-Sex League and flinging it on to a bough. Then, +as though touching her waist had reminded her of something, she felt in +the pocket of her overalls and produced a small slab of chocolate. She +broke it in half and gave one of the pieces to Winston. Even before he had +taken it he knew by the smell that it was very unusual chocolate. It was +dark and shiny, and was wrapped in silver paper. Chocolate normally was +dull-brown crumbly stuff that tasted, as nearly as one could describe it, +like the smoke of a rubbish fire. But at some time or another he had tasted +chocolate like the piece she had given him. The first whiff of its scent +had stirred up some memory which he could not pin down, but which was +powerful and troubling. + +'Where did you get this stuff?' he said. + +'Black market,' she said indifferently. 'Actually I am that sort of girl, +to look at. I'm good at games. I was a troop-leader in the Spies. I do +voluntary work three evenings a week for the Junior Anti-Sex League. Hours +and hours I've spent pasting their bloody rot all over London. I always +carry one end of a banner in the processions. I always look cheerful and +I never shirk anything. Always yell with the crowd, that's what I say. +It's the only way to be safe.' + +The first fragment of chocolate had melted on Winston's tongue. The taste +was delightful. But there was still that memory moving round the edges of +his consciousness, something strongly felt but not reducible to definite +shape, like an object seen out of the corner of one's eye. He pushed it +away from him, aware only that it was the memory of some action which he +would have liked to undo but could not. + +'You are very young,' he said. 'You are ten or fifteen years younger than +I am. What could you see to attract you in a man like me?' + +'It was something in your face. I thought I'd take a chance. I'm good at +spotting people who don't belong. As soon as I saw you I knew you were +against THEM.' + +THEM, it appeared, meant the Party, and above all the Inner Party, about +whom she talked with an open jeering hatred which made Winston feel uneasy, +although he knew that they were safe here if they could be safe anywhere. +A thing that astonished him about her was the coarseness of her language. +Party members were supposed not to swear, and Winston himself very seldom +did swear, aloud, at any rate. Julia, however, seemed unable to mention +the Party, and especially the Inner Party, without using the kind of words +that you saw chalked up in dripping alley-ways. He did not dislike it. It +was merely one symptom of her revolt against the Party and all its ways, +and somehow it seemed natural and healthy, like the sneeze of a horse that +smells bad hay. They had left the clearing and were wandering again +through the chequered shade, with their arms round each other's waists +whenever it was wide enough to walk two abreast. He noticed how much +softer her waist seemed to feel now that the sash was gone. They did not +speak above a whisper. Outside the clearing, Julia said, it was better to +go quietly. Presently they had reached the edge of the little wood. She +stopped him. + +'Don't go out into the open. There might be someone watching. We're all +right if we keep behind the boughs.' + +They were standing in the shade of hazel bushes. The sunlight, filtering +through innumerable leaves, was still hot on their faces. Winston looked +out into the field beyond, and underwent a curious, slow shock of +recognition. He knew it by sight. An old, close-bitten pasture, with a +footpath wandering across it and a molehill here and there. In the ragged +hedge on the opposite side the boughs of the elm trees swayed just +perceptibly in the breeze, and their leaves stirred faintly in dense +masses like women's hair. Surely somewhere nearby, but out of sight, +there must be a stream with green pools where dace were swimming? + +'Isn't there a stream somewhere near here?' he whispered. + +'That's right, there is a stream. It's at the edge of the next field, +actually. There are fish in it, great big ones. You can watch them lying +in the pools under the willow trees, waving their tails.' + +'It's the Golden Country--almost,' he murmured. + +'The Golden Country?' + +'It's nothing, really. A landscape I've seen sometimes in a dream.' + +'Look!' whispered Julia. + +A thrush had alighted on a bough not five metres away, almost at the level +of their faces. Perhaps it had not seen them. It was in the sun, they in +the shade. It spread out its wings, fitted them carefully into place +again, ducked its head for a moment, as though making a sort of obeisance +to the sun, and then began to pour forth a torrent of song. In the +afternoon hush the volume of sound was startling. Winston and Julia clung +together, fascinated. The music went on and on, minute after minute, with +astonishing variations, never once repeating itself, almost as though the +bird were deliberately showing off its virtuosity. Sometimes it stopped +for a few seconds, spread out and resettled its wings, then swelled its +speckled breast and again burst into song. Winston watched it with a sort +of vague reverence. For whom, for what, was that bird singing? No mate, +no rival was watching it. What made it sit at the edge of the lonely wood +and pour its music into nothingness? He wondered whether after all there +was a microphone hidden somewhere near. He and Julia had spoken only in +low whispers, and it would not pick up what they had said, but it would +pick up the thrush. Perhaps at the other end of the instrument some small, +beetle-like man was listening intently--listening to that. But by degrees +the flood of music drove all speculations out of his mind. It was as +though it were a kind of liquid stuff that poured all over him and got +mixed up with the sunlight that filtered through the leaves. He stopped +thinking and merely felt. The girl's waist in the bend of his arm was soft +and warm. He pulled her round so that they were breast to breast; her body +seemed to melt into his. Wherever his hands moved it was all as yielding as +water. Their mouths clung together; it was quite different from the hard +kisses they had exchanged earlier. When they moved their faces apart again +both of them sighed deeply. The bird took fright and fled with a clatter +of wings. + +Winston put his lips against her ear. 'NOW,' he whispered. + +'Not here,' she whispered back. 'Come back to the hide-out. It's safer.' + +Quickly, with an occasional crackle of twigs, they threaded their way back +to the clearing. When they were once inside the ring of saplings she turned +and faced him. They were both breathing fast, but the smile had reappeared +round the corners of her mouth. She stood looking at him for an instant, +then felt at the zipper of her overalls. And, yes! it was almost as in his +dream. Almost as swiftly as he had imagined it, she had torn her clothes +off, and when she flung them aside it was with that same magnificent +gesture by which a whole civilization seemed to be annihilated. Her body +gleamed white in the sun. But for a moment he did not look at her body; +his eyes were anchored by the freckled face with its faint, bold smile. +He knelt down before her and took her hands in his. + +'Have you done this before?' + +'Of course. Hundreds of times--well, scores of times, anyway.' + +'With Party members?' + +'Yes, always with Party members.' + +'With members of the Inner Party?' + +'Not with those swine, no. But there's plenty that WOULD if they got half +a chance. They're not so holy as they make out.' + +His heart leapt. Scores of times she had done it: he wished it had been +hundreds--thousands. Anything that hinted at corruption always filled him +with a wild hope. Who knew, perhaps the Party was rotten under the surface, +its cult of strenuousness and self-denial simply a sham concealing +iniquity. If he could have infected the whole lot of them with leprosy or +syphilis, how gladly he would have done so! Anything to rot, to weaken, to +undermine! He pulled her down so that they were kneeling face to face. + +'Listen. The more men you've had, the more I love you. Do you understand +that?' + +'Yes, perfectly.' + +'I hate purity, I hate goodness! I don't want any virtue to exist anywhere. +I want everyone to be corrupt to the bones.' + +'Well then, I ought to suit you, dear. I'm corrupt to the bones.' + +'You like doing this? I don't mean simply me: I mean the thing in itself?' + +'I adore it.' + +That was above all what he wanted to hear. Not merely the love of one +person but the animal instinct, the simple undifferentiated desire: that +was the force that would tear the Party to pieces. He pressed her down +upon the grass, among the fallen bluebells. This time there was no +difficulty. Presently the rising and falling of their breasts slowed to +normal speed, and in a sort of pleasant helplessness they fell apart. The +sun seemed to have grown hotter. They were both sleepy. He reached out for +the discarded overalls and pulled them partly over her. Almost immediately +they fell asleep and slept for about half an hour. + +Winston woke first. He sat up and watched the freckled face, still +peacefully asleep, pillowed on the palm of her hand. Except for her mouth, +you could not call her beautiful. There was a line or two round the eyes, +if you looked closely. The short dark hair was extraordinarily thick and +soft. It occurred to him that he still did not know her surname or where +she lived. + +The young, strong body, now helpless in sleep, awoke in him a pitying, +protecting feeling. But the mindless tenderness that he had felt under +the hazel tree, while the thrush was singing, had not quite come back. +He pulled the overalls aside and studied her smooth white flank. In the +old days, he thought, a man looked at a girl's body and saw that it was +desirable, and that was the end of the story. But you could not have pure +love or pure lust nowadays. No emotion was pure, because everything was +mixed up with fear and hatred. Their embrace had been a battle, the climax +a victory. It was a blow struck against the Party. It was a political act. + + + + +Chapter 3 + + + +'We can come here once again,' said Julia. 'It's generally safe to use any +hide-out twice. But not for another month or two, of course.' + +As soon as she woke up her demeanour had changed. She became alert and +business-like, put her clothes on, knotted the scarlet sash about her +waist, and began arranging the details of the journey home. It seemed +natural to leave this to her. She obviously had a practical cunning which +Winston lacked, and she seemed also to have an exhaustive knowledge of the +countryside round London, stored away from innumerable community hikes. +The route she gave him was quite different from the one by which he had +come, and brought him out at a different railway station. 'Never go home +the same way as you went out,' she said, as though enunciating an important +general principle. She would leave first, and Winston was to wait half an +hour before following her. + +She had named a place where they could meet after work, four evenings +hence. It was a street in one of the poorer quarters, where there was an +open market which was generally crowded and noisy. She would be hanging +about among the stalls, pretending to be in search of shoelaces or +sewing-thread. If she judged that the coast was clear she would blow +her nose when he approached; otherwise he was to walk past her without +recognition. But with luck, in the middle of the crowd, it would be +safe to talk for a quarter of an hour and arrange another meeting. + +'And now I must go,' she said as soon as he had mastered his instructions. +'I'm due back at nineteen-thirty. I've got to put in two hours for the +Junior Anti-Sex League, handing out leaflets, or something. Isn't it +bloody? Give me a brush-down, would you? Have I got any twigs in my hair? +Are you sure? Then good-bye, my love, good-bye!' + +She flung herself into his arms, kissed him almost violently, and a moment +later pushed her way through the saplings and disappeared into the wood +with very little noise. Even now he had not found out her surname or her +address. However, it made no difference, for it was inconceivable that +they could ever meet indoors or exchange any kind of written communication. + +As it happened, they never went back to the clearing in the wood. During +the month of May there was only one further occasion on which they actually +succeeded in making love. That was in another hiding-place known to Julia, +the belfry of a ruinous church in an almost-deserted stretch of country +where an atomic bomb had fallen thirty years earlier. It was a good +hiding-place when once you got there, but the getting there was very +dangerous. For the rest they could meet only in the streets, in a different +place every evening and never for more than half an hour at a time. In the +street it was usually possible to talk, after a fashion. As they drifted +down the crowded pavements, not quite abreast and never looking at one +another, they carried on a curious, intermittent conversation which flicked +on and off like the beams of a lighthouse, suddenly nipped into silence +by the approach of a Party uniform or the proximity of a telescreen, then +taken up again minutes later in the middle of a sentence, then abruptly +cut short as they parted at the agreed spot, then continued almost without +introduction on the following day. Julia appeared to be quite used to this +kind of conversation, which she called 'talking by instalments'. She was +also surprisingly adept at speaking without moving her lips. Just once in +almost a month of nightly meetings they managed to exchange a kiss. They +were passing in silence down a side-street (Julia would never speak when +they were away from the main streets) when there was a deafening roar, the +earth heaved, and the air darkened, and Winston found himself lying on his +side, bruised and terrified. A rocket bomb must have dropped quite near at +hand. Suddenly he became aware of Julia's face a few centimetres from his +own, deathly white, as white as chalk. Even her lips were white. She was +dead! He clasped her against him and found that he was kissing a live +warm face. But there was some powdery stuff that got in the way of his +lips. Both of their faces were thickly coated with plaster. + +There were evenings when they reached their rendezvous and then had to +walk past one another without a sign, because a patrol had just come round +the corner or a helicopter was hovering overhead. Even if it had been +less dangerous, it would still have been difficult to find time to meet. +Winston's working week was sixty hours, Julia's was even longer, and +their free days varied according to the pressure of work and did not +often coincide. Julia, in any case, seldom had an evening completely free. +She spent an astonishing amount of time in attending lectures and +demonstrations, distributing literature for the junior Anti-Sex League, +preparing banners for Hate Week, making collections for the savings +campaign, and such-like activities. It paid, she said, it was camouflage. +If you kept the small rules, you could break the big ones. She even induced +Winston to mortgage yet another of his evenings by enrolling himself for +the part-time munition work which was done voluntarily by zealous Party +members. So, one evening every week, Winston spent four hours of paralysing +boredom, screwing together small bits of metal which were probably parts +of bomb fuses, in a draughty, ill-lit workshop where the knocking of +hammers mingled drearily with the music of the telescreens. + +When they met in the church tower the gaps in their fragmentary +conversation were filled up. It was a blazing afternoon. The air in the +little square chamber above the bells was hot and stagnant, and smelt +overpoweringly of pigeon dung. They sat talking for hours on the dusty, +twig-littered floor, one or other of them getting up from time to time to +cast a glance through the arrowslits and make sure that no one was coming. + +Julia was twenty-six years old. She lived in a hostel with thirty other +girls ('Always in the stink of women! How I hate women!' she said +parenthetically), and she worked, as he had guessed, on the novel-writing +machines in the Fiction Department. She enjoyed her work, which consisted +chiefly in running and servicing a powerful but tricky electric motor. +She was 'not clever', but was fond of using her hands and felt at home +with machinery. She could describe the whole process of composing a novel, +from the general directive issued by the Planning Committee down to the +final touching-up by the Rewrite Squad. But she was not interested in the +finished product. She 'didn't much care for reading,' she said. Books were +just a commodity that had to be produced, like jam or bootlaces. + +She had no memories of anything before the early sixties and the only +person she had ever known who talked frequently of the days before the +Revolution was a grandfather who had disappeared when she was eight. At +school she had been captain of the hockey team and had won the gymnastics +trophy two years running. She had been a troop-leader in the Spies and a +branch secretary in the Youth League before joining the Junior Anti-Sex +League. She had always borne an excellent character. She had even (an +infallible mark of good reputation) been picked out to work in Pornosec, +the sub-section of the Fiction Department which turned out cheap +pornography for distribution among the proles. It was nicknamed Muck House +by the people who worked in it, she remarked. There she had remained for +a year, helping to produce booklets in sealed packets with titles like +'Spanking Stories' or 'One Night in a Girls' School', to be bought +furtively by proletarian youths who were under the impression that they +were buying something illegal. + +'What are these books like?' said Winston curiously. + +'Oh, ghastly rubbish. They're boring, really. They only have six plots, +but they swap them round a bit. Of course I was only on the kaleidoscopes. +I was never in the Rewrite Squad. I'm not literary, dear--not even enough +for that.' + +He learned with astonishment that all the workers in Pornosec, except the +heads of the departments, were girls. The theory was that men, whose sex +instincts were less controllable than those of women, were in greater +danger of being corrupted by the filth they handled. + +'They don't even like having married women there,' she added. Girls are +always supposed to be so pure. Here's one who isn't, anyway. + +She had had her first love-affair when she was sixteen, with a Party member +of sixty who later committed suicide to avoid arrest. 'And a good job too,' +said Julia, 'otherwise they'd have had my name out of him when he +confessed.' Since then there had been various others. Life as she saw it +was quite simple. You wanted a good time; 'they', meaning the Party, +wanted to stop you having it; you broke the rules as best you could. She +seemed to think it just as natural that 'they' should want to rob you of +your pleasures as that you should want to avoid being caught. She hated +the Party, and said so in the crudest words, but she made no general +criticism of it. Except where it touched upon her own life she had no +interest in Party doctrine. He noticed that she never used Newspeak words +except the ones that had passed into everyday use. She had never heard of +the Brotherhood, and refused to believe in its existence. Any kind of +organized revolt against the Party, which was bound to be a failure, +struck her as stupid. The clever thing was to break the rules and stay +alive all the same. He wondered vaguely how many others like her there +might be in the younger generation people who had grown up in the world of +the Revolution, knowing nothing else, accepting the Party as something +unalterable, like the sky, not rebelling against its authority but simply +evading it, as a rabbit dodges a dog. + +They did not discuss the possibility of getting married. It was too remote +to be worth thinking about. No imaginable committee would ever sanction +such a marriage even if Katharine, Winston's wife, could somehow have been +got rid of. It was hopeless even as a daydream. + +'What was she like, your wife?' said Julia. + +'She was--do you know the Newspeak word GOODTHINKFUL? Meaning naturally +orthodox, incapable of thinking a bad thought?' + +'No, I didn't know the word, but I know the kind of person, right enough.' + +He began telling her the story of his married life, but curiously enough +she appeared to know the essential parts of it already. She described +to him, almost as though she had seen or felt it, the stiffening of +Katharine's body as soon as he touched her, the way in which she still +seemed to be pushing him from her with all her strength, even when her +arms were clasped tightly round him. With Julia he felt no difficulty in +talking about such things: Katharine, in any case, had long ceased to be +a painful memory and became merely a distasteful one. + +'I could have stood it if it hadn't been for one thing,' he said. He told +her about the frigid little ceremony that Katharine had forced him to go +through on the same night every week. 'She hated it, but nothing would +make her stop doing it. She used to call it--but you'll never guess.' + +'Our duty to the Party,' said Julia promptly. + +'How did you know that?' + +'I've been at school too, dear. Sex talks once a month for the +over-sixteens. And in the Youth Movement. They rub it into you for years. +I dare say it works in a lot of cases. But of course you can never tell; +people are such hypocrites.' + +She began to enlarge upon the subject. With Julia, everything came back +to her own sexuality. As soon as this was touched upon in any way she was +capable of great acuteness. Unlike Winston, she had grasped the inner +meaning of the Party's sexual puritanism. It was not merely that the sex +instinct created a world of its own which was outside the Party's control +and which therefore had to be destroyed if possible. What was more +important was that sexual privation induced hysteria, which was desirable +because it could be transformed into war-fever and leader-worship. The way +she put it was: + +'When you make love you're using up energy; and afterwards you feel happy +and don't give a damn for anything. They can't bear you to feel like that. +They want you to be bursting with energy all the time. All this marching +up and down and cheering and waving flags is simply sex gone sour. If +you're happy inside yourself, why should you get excited about Big Brother +and the Three-Year Plans and the Two Minutes Hate and all the rest of +their bloody rot?' + +That was very true, he thought. There was a direct intimate connexion +between chastity and political orthodoxy. For how could the fear, the +hatred, and the lunatic credulity which the Party needed in its members be +kept at the right pitch, except by bottling down some powerful instinct +and using it as a driving force? The sex impulse was dangerous to the +Party, and the Party had turned it to account. They had played a similar +trick with the instinct of parenthood. The family could not actually be +abolished, and, indeed, people were encouraged to be fond of their +children, in almost the old-fashioned way. The children, on the other hand, +were systematically turned against their parents and taught to spy on them +and report their deviations. The family had become in effect an extension +of the Thought Police. It was a device by means of which everyone could be +surrounded night and day by informers who knew him intimately. + +Abruptly his mind went back to Katharine. Katharine would unquestionably +have denounced him to the Thought Police if she had not happened to be too +stupid to detect the unorthodoxy of his opinions. But what really recalled +her to him at this moment was the stifling heat of the afternoon, which +had brought the sweat out on his forehead. He began telling Julia of +something that had happened, or rather had failed to happen, on another +sweltering summer afternoon, eleven years ago. + +It was three or four months after they were married. They had lost their +way on a community hike somewhere in Kent. They had only lagged behind +the others for a couple of minutes, but they took a wrong turning, and +presently found themselves pulled up short by the edge of an old chalk +quarry. It was a sheer drop of ten or twenty metres, with boulders at the +bottom. There was nobody of whom they could ask the way. As soon as she +realized that they were lost Katharine became very uneasy. To be away +from the noisy mob of hikers even for a moment gave her a feeling of +wrong-doing. She wanted to hurry back by the way they had come and start +searching in the other direction. But at this moment Winston noticed some +tufts of loosestrife growing in the cracks of the cliff beneath them. +One tuft was of two colours, magenta and brick-red, apparently growing on +the same root. He had never seen anything of the kind before, and he called +to Katharine to come and look at it. + +'Look, Katharine! Look at those flowers. That clump down near the bottom. +Do you see they're two different colours?' + +She had already turned to go, but she did rather fretfully come back for +a moment. She even leaned out over the cliff face to see where he was +pointing. He was standing a little behind her, and he put his hand on +her waist to steady her. At this moment it suddenly occurred to him how +completely alone they were. There was not a human creature anywhere, not a +leaf stirring, not even a bird awake. In a place like this the danger that +there would be a hidden microphone was very small, and even if there was a +microphone it would only pick up sounds. It was the hottest sleepiest hour +of the afternoon. The sun blazed down upon them, the sweat tickled his +face. And the thought struck him... + +'Why didn't you give her a good shove?' said Julia. 'I would have.' + +'Yes, dear, you would have. I would, if I'd been the same person then as +I am now. Or perhaps I would--I'm not certain.' + +'Are you sorry you didn't?' + +'Yes. On the whole I'm sorry I didn't.' + +They were sitting side by side on the dusty floor. He pulled her closer +against him. Her head rested on his shoulder, the pleasant smell of her +hair conquering the pigeon dung. She was very young, he thought, she +still expected something from life, she did not understand that to push +an inconvenient person over a cliff solves nothing. + +'Actually it would have made no difference,' he said. + +'Then why are you sorry you didn't do it?' + +'Only because I prefer a positive to a negative. In this game that we're +playing, we can't win. Some kinds of failure are better than other kinds, +that's all.' + +He felt her shoulders give a wriggle of dissent. She always contradicted +him when he said anything of this kind. She would not accept it as a law +of nature that the individual is always defeated. In a way she realized +that she herself was doomed, that sooner or later the Thought Police would +catch her and kill her, but with another part of her mind she believed +that it was somehow possible to construct a secret world in which you could +live as you chose. All you needed was luck and cunning and boldness. She +did not understand that there was no such thing as happiness, that the +only victory lay in the far future, long after you were dead, that from +the moment of declaring war on the Party it was better to think of yourself +as a corpse. + +'We are the dead,' he said. + +'We're not dead yet,' said Julia prosaically. + +'Not physically. Six months, a year--five years, conceivably. I am afraid +of death. You are young, so presumably you're more afraid of it than I am. +Obviously we shall put it off as long as we can. But it makes very little +difference. So long as human beings stay human, death and life are the +same thing.' + +'Oh, rubbish! Which would you sooner sleep with, me or a skeleton? Don't +you enjoy being alive? Don't you like feeling: This is me, this is my hand, +this is my leg, I'm real, I'm solid, I'm alive! Don't you like THIS?' + +She twisted herself round and pressed her bosom against him. He could feel +her breasts, ripe yet firm, through her overalls. Her body seemed to be +pouring some of its youth and vigour into his. + +'Yes, I like that,' he said. + +'Then stop talking about dying. And now listen, dear, we've got to fix +up about the next time we meet. We may as well go back to the place in +the wood. We've given it a good long rest. But you must get there by a +different way this time. I've got it all planned out. You take the +train--but look, I'll draw it out for you.' + +And in her practical way she scraped together a small square of dust, +and with a twig from a pigeon's nest began drawing a map on the floor. + + + + +Chapter 4 + + + +Winston looked round the shabby little room above Mr Charrington's shop. +Beside the window the enormous bed was made up, with ragged blankets and +a coverless bolster. The old-fashioned clock with the twelve-hour face was +ticking away on the mantelpiece. In the corner, on the gateleg table, the +glass paperweight which he had bought on his last visit gleamed softly out +of the half-darkness. + +In the fender was a battered tin oilstove, a saucepan, and two cups, +provided by Mr Charrington. Winston lit the burner and set a pan of water +to boil. He had brought an envelope full of Victory Coffee and some +saccharine tablets. The clock's hands said seventeen-twenty: it was +nineteen-twenty really. She was coming at nineteen-thirty. + +Folly, folly, his heart kept saying: conscious, gratuitous, suicidal folly. +Of all the crimes that a Party member could commit, this one was the least +possible to conceal. Actually the idea had first floated into his head in +the form of a vision, of the glass paperweight mirrored by the surface +of the gateleg table. As he had foreseen, Mr Charrington had made no +difficulty about letting the room. He was obviously glad of the few dollars +that it would bring him. Nor did he seem shocked or become offensively +knowing when it was made clear that Winston wanted the room for the purpose +of a love-affair. Instead he looked into the middle distance and spoke in +generalities, with so delicate an air as to give the impression that he +had become partly invisible. Privacy, he said, was a very valuable thing. +Everyone wanted a place where they could be alone occasionally. And when +they had such a place, it was only common courtesy in anyone else who knew +of it to keep his knowledge to himself. He even, seeming almost to fade +out of existence as he did so, added that there were two entries to the +house, one of them through the back yard, which gave on an alley. + +Under the window somebody was singing. Winston peeped out, secure in the +protection of the muslin curtain. The June sun was still high in the sky, +and in the sun-filled court below, a monstrous woman, solid as a Norman +pillar, with brawny red forearms and a sacking apron strapped about her +middle, was stumping to and fro between a washtub and a clothes line, +pegging out a series of square white things which Winston recognized as +babies' diapers. Whenever her mouth was not corked with clothes pegs she +was singing in a powerful contralto: + + + It was only an 'opeless fancy. + It passed like an Ipril dye, + But a look an' a word an' the dreams they stirred! + They 'ave stolen my 'eart awye! + + +The tune had been haunting London for weeks past. It was one of countless +similar songs published for the benefit of the proles by a sub-section of +the Music Department. The words of these songs were composed without any +human intervention whatever on an instrument known as a versificator. +But the woman sang so tunefully as to turn the dreadful rubbish into an +almost pleasant sound. He could hear the woman singing and the scrape of +her shoes on the flagstones, and the cries of the children in the street, +and somewhere in the far distance a faint roar of traffic, and yet the +room seemed curiously silent, thanks to the absence of a telescreen. + +Folly, folly, folly! he thought again. It was inconceivable that they could +frequent this place for more than a few weeks without being caught. But +the temptation of having a hiding-place that was truly their own, indoors +and near at hand, had been too much for both of them. For some time +after their visit to the church belfry it had been impossible to arrange +meetings. Working hours had been drastically increased in anticipation of +Hate Week. It was more than a month distant, but the enormous, complex +preparations that it entailed were throwing extra work on to everybody. +Finally both of them managed to secure a free afternoon on the same day. +They had agreed to go back to the clearing in the wood. On the evening +beforehand they met briefly in the street. As usual, Winston hardly looked +at Julia as they drifted towards one another in the crowd, but from the +short glance he gave her it seemed to him that she was paler than usual. + +'It's all off,' she murmured as soon as she judged it safe to speak. +'Tomorrow, I mean.' + +'What?' + +'Tomorrow afternoon. I can't come.' + +'Why not?' + +'Oh, the usual reason. It's started early this time.' + +For a moment he was violently angry. During the month that he had known +her the nature of his desire for her had changed. At the beginning there +had been little true sensuality in it. Their first love-making had been +simply an act of the will. But after the second time it was different. The +smell of her hair, the taste of her mouth, the feeling of her skin seemed +to have got inside him, or into the air all round him. She had become a +physical necessity, something that he not only wanted but felt that he +had a right to. When she said that she could not come, he had the feeling +that she was cheating him. But just at this moment the crowd pressed +them together and their hands accidentally met. She gave the tips of his +fingers a quick squeeze that seemed to invite not desire but affection. It +struck him that when one lived with a woman this particular disappointment +must be a normal, recurring event; and a deep tenderness, such as he had +not felt for her before, suddenly took hold of him. He wished that they +were a married couple of ten years' standing. He wished that he were +walking through the streets with her just as they were doing now but openly +and without fear, talking of trivialities and buying odds and ends for the +household. He wished above all that they had some place where they could +be alone together without feeling the obligation to make love every time +they met. It was not actually at that moment, but at some time on the +following day, that the idea of renting Mr Charrington's room had occurred +to him. When he suggested it to Julia she had agreed with unexpected +readiness. Both of them knew that it was lunacy. It was as though they were +intentionally stepping nearer to their graves. As he sat waiting on the +edge of the bed he thought again of the cellars of the Ministry of Love. +It was curious how that predestined horror moved in and out of one's +consciousness. There it lay, fixed in future times, preceding death as +surely as 99 precedes 100. One could not avoid it, but one could perhaps +postpone it: and yet instead, every now and again, by a conscious, wilful +act, one chose to shorten the interval before it happened. + +At this moment there was a quick step on the stairs. Julia burst into the +room. She was carrying a tool-bag of coarse brown canvas, such as he had +sometimes seen her carrying to and fro at the Ministry. He started forward +to take her in his arms, but she disengaged herself rather hurriedly, +partly because she was still holding the tool-bag. + +'Half a second,' she said. 'Just let me show you what I've brought. Did +you bring some of that filthy Victory Coffee? I thought you would. You +can chuck it away again, because we shan't be needing it. Look here.' + +She fell on her knees, threw open the bag, and tumbled out some spanners +and a screwdriver that filled the top part of it. Underneath were a number +of neat paper packets. The first packet that she passed to Winston had a +strange and yet vaguely familiar feeling. It was filled with some kind of +heavy, sand-like stuff which yielded wherever you touched it. + +'It isn't sugar?' he said. + +'Real sugar. Not saccharine, sugar. And here's a loaf of bread--proper +white bread, not our bloody stuff--and a little pot of jam. And here's a +tin of milk--but look! This is the one I'm really proud of. I had to wrap +a bit of sacking round it, because----' + +But she did not need to tell him why she had wrapped it up. The smell was +already filling the room, a rich hot smell which seemed like an emanation +from his early childhood, but which one did occasionally meet with even +now, blowing down a passage-way before a door slammed, or diffusing itself +mysteriously in a crowded street, sniffed for an instant and then lost +again. + +'It's coffee,' he murmured, 'real coffee.' + +'It's Inner Party coffee. There's a whole kilo here,' she said. + +'How did you manage to get hold of all these things?' + +'It's all Inner Party stuff. There's nothing those swine don't have, +nothing. But of course waiters and servants and people pinch things, +and--look, I got a little packet of tea as well.' + +Winston had squatted down beside her. He tore open a corner of the packet. + +'It's real tea. Not blackberry leaves.' + +'There's been a lot of tea about lately. They've captured India, or +something,' she said vaguely. 'But listen, dear. I want you to turn your +back on me for three minutes. Go and sit on the other side of the bed. +Don't go too near the window. And don't turn round till I tell you.' + +Winston gazed abstractedly through the muslin curtain. Down in the yard +the red-armed woman was still marching to and fro between the washtub and +the line. She took two more pegs out of her mouth and sang with deep +feeling: + + + They sye that time 'eals all things, + They sye you can always forget; + But the smiles an' the tears acrorss the years + They twist my 'eart-strings yet! + + +She knew the whole drivelling song by heart, it seemed. Her voice floated +upward with the sweet summer air, very tuneful, charged with a sort of +happy melancholy. One had the feeling that she would have been perfectly +content, if the June evening had been endless and the supply of clothes +inexhaustible, to remain there for a thousand years, pegging out diapers +and singing rubbish. It struck him as a curious fact that he had never +heard a member of the Party singing alone and spontaneously. It would even +have seemed slightly unorthodox, a dangerous eccentricity, like talking to +oneself. Perhaps it was only when people were somewhere near the starvation +level that they had anything to sing about. + +'You can turn round now,' said Julia. + +He turned round, and for a second almost failed to recognize her. What he +had actually expected was to see her naked. But she was not naked. The +transformation that had happened was much more surprising than that. She +had painted her face. + +She must have slipped into some shop in the proletarian quarters and bought +herself a complete set of make-up materials. Her lips were deeply reddened, +her cheeks rouged, her nose powdered; there was even a touch of something +under the eyes to make them brighter. It was not very skilfully done, but +Winston's standards in such matters were not high. He had never before +seen or imagined a woman of the Party with cosmetics on her face. The +improvement in her appearance was startling. With just a few dabs of colour +in the right places she had become not only very much prettier, but, above +all, far more feminine. Her short hair and boyish overalls merely added +to the effect. As he took her in his arms a wave of synthetic violets +flooded his nostrils. He remembered the half-darkness of a basement +kitchen, and a woman's cavernous mouth. It was the very same scent that +she had used; but at the moment it did not seem to matter. + +'Scent too!' he said. + +'Yes, dear, scent too. And do you know what I'm going to do next? I'm +going to get hold of a real woman's frock from somewhere and wear it +instead of these bloody trousers. I'll wear silk stockings and high-heeled +shoes! In this room I'm going to be a woman, not a Party comrade.' + +They flung their clothes off and climbed into the huge mahogany bed. It +was the first time that he had stripped himself naked in her presence. +Until now he had been too much ashamed of his pale and meagre body, with +the varicose veins standing out on his calves and the discoloured patch +over his ankle. There were no sheets, but the blanket they lay on was +threadbare and smooth, and the size and springiness of the bed astonished +both of them. 'It's sure to be full of bugs, but who cares?' said Julia. +One never saw a double bed nowadays, except in the homes of the proles. +Winston had occasionally slept in one in his boyhood: Julia had never been +in one before, so far as she could remember. + +Presently they fell asleep for a little while. When Winston woke up the +hands of the clock had crept round to nearly nine. He did not stir, because +Julia was sleeping with her head in the crook of his arm. Most of her +make-up had transferred itself to his own face or the bolster, but a light +stain of rouge still brought out the beauty of her cheekbone. A yellow ray +from the sinking sun fell across the foot of the bed and lighted up the +fireplace, where the water in the pan was boiling fast. Down in the yard +the woman had stopped singing, but the faint shouts of children floated in +from the street. He wondered vaguely whether in the abolished past it had +been a normal experience to lie in bed like this, in the cool of a summer +evening, a man and a woman with no clothes on, making love when they chose, +talking of what they chose, not feeling any compulsion to get up, simply +lying there and listening to peaceful sounds outside. Surely there could +never have been a time when that seemed ordinary? Julia woke up, rubbed +her eyes, and raised herself on her elbow to look at the oilstove. + +'Half that water's boiled away,' she said. 'I'll get up and make some +coffee in another moment. We've got an hour. What time do they cut the +lights off at your flats?' + +'Twenty-three thirty.' + +'It's twenty-three at the hostel. But you have to get in earlier than that, +because--Hi! Get out, you filthy brute!' + +She suddenly twisted herself over in the bed, seized a shoe from the floor, +and sent it hurtling into the corner with a boyish jerk of her arm, exactly +as he had seen her fling the dictionary at Goldstein, that morning during +the Two Minutes Hate. + +'What was it?' he said in surprise. + +'A rat. I saw him stick his beastly nose out of the wainscoting. There's a +hole down there. I gave him a good fright, anyway.' + +'Rats!' murmured Winston. 'In this room!' + +'They're all over the place,' said Julia indifferently as she lay down +again. 'We've even got them in the kitchen at the hostel. Some parts of +London are swarming with them. Did you know they attack children? Yes, +they do. In some of these streets a woman daren't leave a baby alone for +two minutes. It's the great huge brown ones that do it. And the nasty +thing is that the brutes always----' + +'DON'T GO ON!' said Winston, with his eyes tightly shut. + +'Dearest! You've gone quite pale. What's the matter? Do they make you feel +sick?' + +'Of all horrors in the world--a rat!' + +She pressed herself against him and wound her limbs round him, as though +to reassure him with the warmth of her body. He did not reopen his eyes +immediately. For several moments he had had the feeling of being back in a +nightmare which had recurred from time to time throughout his life. It was +always very much the same. He was standing in front of a wall of darkness, +and on the other side of it there was something unendurable, something too +dreadful to be faced. In the dream his deepest feeling was always one of +self-deception, because he did in fact know what was behind the wall of +darkness. With a deadly effort, like wrenching a piece out of his own +brain, he could even have dragged the thing into the open. He always woke +up without discovering what it was: but somehow it was connected with what +Julia had been saying when he cut her short. + +'I'm sorry,' he said, 'it's nothing. I don't like rats, that's all.' + +'Don't worry, dear, we're not going to have the filthy brutes in here. +I'll stuff the hole with a bit of sacking before we go. And next time we +come here I'll bring some plaster and bung it up properly.' + +Already the black instant of panic was half-forgotten. Feeling slightly +ashamed of himself, he sat up against the bedhead. Julia got out of bed, +pulled on her overalls, and made the coffee. The smell that rose from the +saucepan was so powerful and exciting that they shut the window lest +anybody outside should notice it and become inquisitive. What was even +better than the taste of the coffee was the silky texture given to it by +the sugar, a thing Winston had almost forgotten after years of saccharine. +With one hand in her pocket and a piece of bread and jam in the other, +Julia wandered about the room, glancing indifferently at the bookcase, +pointing out the best way of repairing the gateleg table, plumping herself +down in the ragged arm-chair to see if it was comfortable, and examining +the absurd twelve-hour clock with a sort of tolerant amusement. She brought +the glass paperweight over to the bed to have a look at it in a better +light. He took it out of her hand, fascinated, as always, by the soft, +rainwatery appearance of the glass. + +'What is it, do you think?' said Julia. + +'I don't think it's anything--I mean, I don't think it was ever put to any +use. That's what I like about it. It's a little chunk of history that +they've forgotten to alter. It's a message from a hundred years ago, if +one knew how to read it.' + +'And that picture over there'--she nodded at the engraving on the opposite +wall--'would that be a hundred years old?' + +'More. Two hundred, I dare say. One can't tell. It's impossible to discover +the age of anything nowadays.' + +She went over to look at it. 'Here's where that brute stuck his nose out,' +she said, kicking the wainscoting immediately below the picture. 'What is +this place? I've seen it before somewhere.' + +'It's a church, or at least it used to be. St Clement Danes its name was.' +The fragment of rhyme that Mr Charrington had taught him came back into +his head, and he added half-nostalgically: "Oranges and lemons, say the +bells of St Clement's!" + +To his astonishment she capped the line: + + + 'You owe me three farthings, say the bells of St Martin's, + When will you pay me? say the bells of Old Bailey----' + + +'I can't remember how it goes on after that. But anyway I remember it ends +up, "Here comes a candle to light you to bed, here comes a chopper to chop +off your head!"' + +It was like the two halves of a countersign. But there must be another +line after 'the bells of Old Bailey'. Perhaps it could be dug out of +Mr Charrington's memory, if he were suitably prompted. + +'Who taught you that?' he said. + +'My grandfather. He used to say it to me when I was a little girl. He was +vaporized when I was eight--at any rate, he disappeared. I wonder what a +lemon was,' she added inconsequently. 'I've seen oranges. They're a kind +of round yellow fruit with a thick skin.' + +'I can remember lemons,' said Winston. 'They were quite common in the +fifties. They were so sour that it set your teeth on edge even to smell +them.' + +'I bet that picture's got bugs behind it,' said Julia. 'I'll take it down +and give it a good clean some day. I suppose it's almost time we were +leaving. I must start washing this paint off. What a bore! I'll get the +lipstick off your face afterwards.' + +Winston did not get up for a few minutes more. The room was darkening. He +turned over towards the light and lay gazing into the glass paperweight. +The inexhaustibly interesting thing was not the fragment of coral but the +interior of the glass itself. There was such a depth of it, and yet it was +almost as transparent as air. It was as though the surface of the glass +had been the arch of the sky, enclosing a tiny world with its atmosphere +complete. He had the feeling that he could get inside it, and that in +fact he was inside it, along with the mahogany bed and the gateleg table, +and the clock and the steel engraving and the paperweight itself. The +paperweight was the room he was in, and the coral was Julia's life and his +own, fixed in a sort of eternity at the heart of the crystal. + + + + +Chapter 5 + + + +Syme had vanished. A morning came, and he was missing from work: a few +thoughtless people commented on his absence. On the next day nobody +mentioned him. On the third day Winston went into the vestibule of the +Records Department to look at the notice-board. One of the notices carried +a printed list of the members of the Chess Committee, of whom Syme had +been one. It looked almost exactly as it had looked before--nothing had +been crossed out--but it was one name shorter. It was enough. Syme had +ceased to exist: he had never existed. + +The weather was baking hot. In the labyrinthine Ministry the windowless, +air-conditioned rooms kept their normal temperature, but outside the +pavements scorched one's feet and the stench of the Tubes at the rush hours +was a horror. The preparations for Hate Week were in full swing, and the +staffs of all the Ministries were working overtime. Processions, meetings, +military parades, lectures, waxworks, displays, film shows, telescreen +programmes all had to be organized; stands had to be erected, effigies +built, slogans coined, songs written, rumours circulated, photographs +faked. Julia's unit in the Fiction Department had been taken off the +production of novels and was rushing out a series of atrocity pamphlets. +Winston, in addition to his regular work, spent long periods every day in +going through back files of 'The Times' and altering and embellishing news +items which were to be quoted in speeches. Late at night, when crowds of +rowdy proles roamed the streets, the town had a curiously febrile air. The +rocket bombs crashed oftener than ever, and sometimes in the far distance +there were enormous explosions which no one could explain and about which +there were wild rumours. + +The new tune which was to be the theme-song of Hate Week (the Hate Song, +it was called) had already been composed and was being endlessly plugged +on the telescreens. It had a savage, barking rhythm which could not exactly +be called music, but resembled the beating of a drum. Roared out by +hundreds of voices to the tramp of marching feet, it was terrifying. The +proles had taken a fancy to it, and in the midnight streets it competed +with the still-popular 'It was only a hopeless fancy'. The Parsons children +played it at all hours of the night and day, unbearably, on a comb and a +piece of toilet paper. Winston's evenings were fuller than ever. Squads of +volunteers, organized by Parsons, were preparing the street for Hate Week, +stitching banners, painting posters, erecting flagstaffs on the roofs, and +perilously slinging wires across the street for the reception of streamers. +Parsons boasted that Victory Mansions alone would display four hundred +metres of bunting. He was in his native element and as happy as a lark. +The heat and the manual work had even given him a pretext for reverting +to shorts and an open shirt in the evenings. He was everywhere at once, +pushing, pulling, sawing, hammering, improvising, jollying everyone along +with comradely exhortations and giving out from every fold of his body what +seemed an inexhaustible supply of acrid-smelling sweat. + +A new poster had suddenly appeared all over London. It had no caption, +and represented simply the monstrous figure of a Eurasian soldier, three +or four metres high, striding forward with expressionless Mongolian face +and enormous boots, a submachine gun pointed from his hip. From whatever +angle you looked at the poster, the muzzle of the gun, magnified by the +foreshortening, seemed to be pointed straight at you. The thing had been +plastered on every blank space on every wall, even outnumbering the +portraits of Big Brother. The proles, normally apathetic about the war, +were being lashed into one of their periodical frenzies of patriotism. +As though to harmonize with the general mood, the rocket bombs had been +killing larger numbers of people than usual. One fell on a crowded film +theatre in Stepney, burying several hundred victims among the ruins. The +whole population of the neighbourhood turned out for a long, trailing +funeral which went on for hours and was in effect an indignation meeting. +Another bomb fell on a piece of waste ground which was used as a playground +and several dozen children were blown to pieces. There were further angry +demonstrations, Goldstein was burned in effigy, hundreds of copies of the +poster of the Eurasian soldier were torn down and added to the flames, and +a number of shops were looted in the turmoil; then a rumour flew round +that spies were directing the rocket bombs by means of wireless waves, and +an old couple who were suspected of being of foreign extraction had their +house set on fire and perished of suffocation. + +In the room over Mr Charrington's shop, when they could get there, Julia +and Winston lay side by side on a stripped bed under the open window, +naked for the sake of coolness. The rat had never come back, but the bugs +had multiplied hideously in the heat. It did not seem to matter. Dirty or +clean, the room was paradise. As soon as they arrived they would sprinkle +everything with pepper bought on the black market, tear off their clothes, +and make love with sweating bodies, then fall asleep and wake to find that +the bugs had rallied and were massing for the counter-attack. + +Four, five, six--seven times they met during the month of June. Winston +had dropped his habit of drinking gin at all hours. He seemed to have lost +the need for it. He had grown fatter, his varicose ulcer had subsided, +leaving only a brown stain on the skin above his ankle, his fits of +coughing in the early morning had stopped. The process of life had ceased +to be intolerable, he had no longer any impulse to make faces at the +telescreen or shout curses at the top of his voice. Now that they had a +secure hiding-place, almost a home, it did not even seem a hardship that +they could only meet infrequently and for a couple of hours at a time. +What mattered was that the room over the junk-shop should exist. To know +that it was there, inviolate, was almost the same as being in it. The room +was a world, a pocket of the past where extinct animals could walk. +Mr Charrington, thought Winston, was another extinct animal. He usually +stopped to talk with Mr Charrington for a few minutes on his way upstairs. +The old man seemed seldom or never to go out of doors, and on the other +hand to have almost no customers. He led a ghostlike existence between the +tiny, dark shop, and an even tinier back kitchen where he prepared his +meals and which contained, among other things, an unbelievably ancient +gramophone with an enormous horn. He seemed glad of the opportunity to +talk. Wandering about among his worthless stock, with his long nose and +thick spectacles and his bowed shoulders in the velvet jacket, he had +always vaguely the air of being a collector rather than a tradesman. +With a sort of faded enthusiasm he would finger this scrap of rubbish or +that--a china bottle-stopper, the painted lid of a broken snuffbox, a +pinchbeck locket containing a strand of some long-dead baby's hair--never +asking that Winston should buy it, merely that he should admire it. To +talk to him was like listening to the tinkling of a worn-out musical-box. +He had dragged out from the corners of his memory some more fragments of +forgotten rhymes. There was one about four and twenty blackbirds, and +another about a cow with a crumpled horn, and another about the death +of poor Cock Robin. 'It just occurred to me you might be interested,' he +would say with a deprecating little laugh whenever he produced a new +fragment. But he could never recall more than a few lines of any one +rhyme. + +Both of them knew--in a way, it was never out of their minds that what +was now happening could not last long. There were times when the fact of +impending death seemed as palpable as the bed they lay on, and they would +cling together with a sort of despairing sensuality, like a damned soul +grasping at his last morsel of pleasure when the clock is within five +minutes of striking. But there were also times when they had the illusion +not only of safety but of permanence. So long as they were actually in +this room, they both felt, no harm could come to them. Getting there was +difficult and dangerous, but the room itself was sanctuary. It was as when +Winston had gazed into the heart of the paperweight, with the feeling that +it would be possible to get inside that glassy world, and that once inside +it time could be arrested. Often they gave themselves up to daydreams of +escape. Their luck would hold indefinitely, and they would carry on their +intrigue, just like this, for the remainder of their natural lives. Or +Katharine would die, and by subtle manoeuvrings Winston and Julia would +succeed in getting married. Or they would commit suicide together. Or +they would disappear, alter themselves out of recognition, learn to speak +with proletarian accents, get jobs in a factory and live out their lives +undetected in a back-street. It was all nonsense, as they both knew. In +reality there was no escape. Even the one plan that was practicable, +suicide, they had no intention of carrying out. To hang on from day to day +and from week to week, spinning out a present that had no future, seemed +an unconquerable instinct, just as one's lungs will always draw the next +breath so long as there is air available. + +Sometimes, too, they talked of engaging in active rebellion against the +Party, but with no notion of how to take the first step. Even if the +fabulous Brotherhood was a reality, there still remained the difficulty +of finding one's way into it. He told her of the strange intimacy that +existed, or seemed to exist, between himself and O'Brien, and of the +impulse he sometimes felt, simply to walk into O'Brien's presence, announce +that he was the enemy of the Party, and demand his help. Curiously enough, +this did not strike her as an impossibly rash thing to do. She was used to +judging people by their faces, and it seemed natural to her that Winston +should believe O'Brien to be trustworthy on the strength of a single flash +of the eyes. Moreover she took it for granted that everyone, or nearly +everyone, secretly hated the Party and would break the rules if he thought +it safe to do so. But she refused to believe that widespread, organized +opposition existed or could exist. The tales about Goldstein and his +underground army, she said, were simply a lot of rubbish which the Party +had invented for its own purposes and which you had to pretend to believe +in. Times beyond number, at Party rallies and spontaneous demonstrations, +she had shouted at the top of her voice for the execution of people whose +names she had never heard and in whose supposed crimes she had not the +faintest belief. When public trials were happening she had taken her place +in the detachments from the Youth League who surrounded the courts from +morning to night, chanting at intervals 'Death to the traitors!' During +the Two Minutes Hate she always excelled all others in shouting insults +at Goldstein. Yet she had only the dimmest idea of who Goldstein was and +what doctrines he was supposed to represent. She had grown up since the +Revolution and was too young to remember the ideological battles of the +fifties and sixties. Such a thing as an independent political movement was +outside her imagination: and in any case the Party was invincible. It +would always exist, and it would always be the same. You could only rebel +against it by secret disobedience or, at most, by isolated acts of +violence such as killing somebody or blowing something up. + +In some ways she was far more acute than Winston, and far less susceptible +to Party propaganda. Once when he happened in some connexion to mention +the war against Eurasia, she startled him by saying casually that in her +opinion the war was not happening. The rocket bombs which fell daily on +London were probably fired by the Government of Oceania itself, 'just to +keep people frightened'. This was an idea that had literally never occurred +to him. She also stirred a sort of envy in him by telling him that during +the Two Minutes Hate her great difficulty was to avoid bursting out +laughing. But she only questioned the teachings of the Party when they +in some way touched upon her own life. Often she was ready to accept +the official mythology, simply because the difference between truth and +falsehood did not seem important to her. She believed, for instance, having +learnt it at school, that the Party had invented aeroplanes. (In his own +schooldays, Winston remembered, in the late fifties, it was only the +helicopter that the Party claimed to have invented; a dozen years later, +when Julia was at school, it was already claiming the aeroplane; one +generation more, and it would be claiming the steam engine.) And when he +told her that aeroplanes had been in existence before he was born and long +before the Revolution, the fact struck her as totally uninteresting. After +all, what did it matter who had invented aeroplanes? It was rather more +of a shock to him when he discovered from some chance remark that she did +not remember that Oceania, four years ago, had been at war with Eastasia +and at peace with Eurasia. It was true that she regarded the whole war as +a sham: but apparently she had not even noticed that the name of the enemy +had changed. 'I thought we'd always been at war with Eurasia,' she said +vaguely. It frightened him a little. The invention of aeroplanes dated +from long before her birth, but the switchover in the war had happened +only four years ago, well after she was grown up. He argued with her about +it for perhaps a quarter of an hour. In the end he succeeded in forcing +her memory back until she did dimly recall that at one time Eastasia and +not Eurasia had been the enemy. But the issue still struck her as +unimportant. 'Who cares?' she said impatiently. 'It's always one bloody +war after another, and one knows the news is all lies anyway.' + +Sometimes he talked to her of the Records Department and the impudent +forgeries that he committed there. Such things did not appear to horrify +her. She did not feel the abyss opening beneath her feet at the thought +of lies becoming truths. He told her the story of Jones, Aaronson, and +Rutherford and the momentous slip of paper which he had once held between +his fingers. It did not make much impression on her. At first, indeed, she +failed to grasp the point of the story. + +'Were they friends of yours?' she said. + +'No, I never knew them. They were Inner Party members. Besides, they were +far older men than I was. They belonged to the old days, before the +Revolution. I barely knew them by sight.' + +'Then what was there to worry about? People are being killed off all the +time, aren't they?' + +He tried to make her understand. 'This was an exceptional case. It wasn't +just a question of somebody being killed. Do you realize that the past, +starting from yesterday, has been actually abolished? If it survives +anywhere, it's in a few solid objects with no words attached to them, like +that lump of glass there. Already we know almost literally nothing about +the Revolution and the years before the Revolution. Every record has been +destroyed or falsified, every book has been rewritten, every picture has +been repainted, every statue and street and building has been renamed, +every date has been altered. And that process is continuing day by day and +minute by minute. History has stopped. Nothing exists except an endless +present in which the Party is always right. I know, of course, that the +past is falsified, but it would never be possible for me to prove it, even +when I did the falsification myself. After the thing is done, no evidence +ever remains. The only evidence is inside my own mind, and I don't know +with any certainty that any other human being shares my memories. Just in +that one instance, in my whole life, I did possess actual concrete evidence +after the event--years after it.' + +'And what good was that?' + +'It was no good, because I threw it away a few minutes later. But if the +same thing happened today, I should keep it.' + +'Well, I wouldn't!' said Julia. 'I'm quite ready to take risks, but only +for something worth while, not for bits of old newspaper. What could you +have done with it even if you had kept it?' + +'Not much, perhaps. But it was evidence. It might have planted a few doubts +here and there, supposing that I'd dared to show it to anybody. I don't +imagine that we can alter anything in our own lifetime. But one can imagine +little knots of resistance springing up here and there--small groups of +people banding themselves together, and gradually growing, and even leaving +a few records behind, so that the next generations can carry on where we +leave off.' + +'I'm not interested in the next generation, dear. I'm interested in US.' + +'You're only a rebel from the waist downwards,' he told her. + +She thought this brilliantly witty and flung her arms round him in delight. + +In the ramifications of party doctrine she had not the faintest interest. +Whenever he began to talk of the principles of Ingsoc, doublethink, the +mutability of the past, and the denial of objective reality, and to use +Newspeak words, she became bored and confused and said that she never paid +any attention to that kind of thing. One knew that it was all rubbish, so +why let oneself be worried by it? She knew when to cheer and when to boo, +and that was all one needed. If he persisted in talking of such subjects, +she had a disconcerting habit of falling asleep. She was one of those +people who can go to sleep at any hour and in any position. Talking to her, +he realized how easy it was to present an appearance of orthodoxy while +having no grasp whatever of what orthodoxy meant. In a way, the world-view +of the Party imposed itself most successfully on people incapable of +understanding it. They could be made to accept the most flagrant violations +of reality, because they never fully grasped the enormity of what was +demanded of them, and were not sufficiently interested in public events to +notice what was happening. By lack of understanding they remained sane. +They simply swallowed everything, and what they swallowed did them no harm, +because it left no residue behind, just as a grain of corn will pass +undigested through the body of a bird. + + + + +Chapter 6 + + + +It had happened at last. The expected message had come. All his life, it +seemed to him, he had been waiting for this to happen. + +He was walking down the long corridor at the Ministry and he was almost +at the spot where Julia had slipped the note into his hand when he became +aware that someone larger than himself was walking just behind him. The +person, whoever it was, gave a small cough, evidently as a prelude to +speaking. Winston stopped abruptly and turned. It was O'Brien. + +At last they were face to face, and it seemed that his only impulse was +to run away. His heart bounded violently. He would have been incapable of +speaking. O'Brien, however, had continued forward in the same movement, +laying a friendly hand for a moment on Winston's arm, so that the two of +them were walking side by side. He began speaking with the peculiar grave +courtesy that differentiated him from the majority of Inner Party members. + +'I had been hoping for an opportunity of talking to you,' he said. 'I was +reading one of your Newspeak articles in 'The Times' the other day. You +take a scholarly interest in Newspeak, I believe?' + +Winston had recovered part of his self-possession. 'Hardly scholarly,' he +said. 'I'm only an amateur. It's not my subject. I have never had anything +to do with the actual construction of the language.' + +'But you write it very elegantly,' said O'Brien. 'That is not only my own +opinion. I was talking recently to a friend of yours who is certainly an +expert. His name has slipped my memory for the moment.' + +Again Winston's heart stirred painfully. It was inconceivable that this +was anything other than a reference to Syme. But Syme was not only dead, +he was abolished, an unperson. Any identifiable reference to him would have +been mortally dangerous. O'Brien's remark must obviously have been intended +as a signal, a codeword. By sharing a small act of thoughtcrime he had +turned the two of them into accomplices. They had continued to stroll +slowly down the corridor, but now O'Brien halted. With the curious, +disarming friendliness that he always managed to put in to the gesture he +resettled his spectacles on his nose. Then he went on: + +'What I had really intended to say was that in your article I noticed you +had used two words which have become obsolete. But they have only become +so very recently. Have you seen the tenth edition of the Newspeak +Dictionary?' + +'No,' said Winston. 'I didn't think it had been issued yet. We are still +using the ninth in the Records Department.' + +'The tenth edition is not due to appear for some months, I believe. But a +few advance copies have been circulated. I have one myself. It might +interest you to look at it, perhaps?' + +'Very much so,' said Winston, immediately seeing where this tended. + +'Some of the new developments are most ingenious. The reduction in the +number of verbs--that is the point that will appeal to you, I think. Let +me see, shall I send a messenger to you with the dictionary? But I am +afraid I invariably forget anything of that kind. Perhaps you could pick +it up at my flat at some time that suited you? Wait. Let me give you my +address.' + +They were standing in front of a telescreen. Somewhat absent-mindedly +O'Brien felt two of his pockets and then produced a small leather-covered +notebook and a gold ink-pencil. Immediately beneath the telescreen, in +such a position that anyone who was watching at the other end of the +instrument could read what he was writing, he scribbled an address, tore +out the page and handed it to Winston. + +'I am usually at home in the evenings,' he said. 'If not, my servant will +give you the dictionary.' + +He was gone, leaving Winston holding the scrap of paper, which this time +there was no need to conceal. Nevertheless he carefully memorized what was +written on it, and some hours later dropped it into the memory hole along +with a mass of other papers. + +They had been talking to one another for a couple of minutes at the most. +There was only one meaning that the episode could possibly have. It had +been contrived as a way of letting Winston know O'Brien's address. This +was necessary, because except by direct enquiry it was never possible to +discover where anyone lived. There were no directories of any kind. 'If +you ever want to see me, this is where I can be found,' was what O'Brien +had been saying to him. Perhaps there would even be a message concealed +somewhere in the dictionary. But at any rate, one thing was certain. The +conspiracy that he had dreamed of did exist, and he had reached the outer +edges of it. + +He knew that sooner or later he would obey O'Brien's summons. Perhaps +tomorrow, perhaps after a long delay--he was not certain. What was +happening was only the working-out of a process that had started years +ago. The first step had been a secret, involuntary thought, the second +had been the opening of the diary. He had moved from thoughts to words, +and now from words to actions. The last step was something that would +happen in the Ministry of Love. He had accepted it. The end was contained +in the beginning. But it was frightening: or, more exactly, it was like +a foretaste of death, like being a little less alive. Even while he was +speaking to O'Brien, when the meaning of the words had sunk in, a chilly +shuddering feeling had taken possession of his body. He had the sensation +of stepping into the dampness of a grave, and it was not much better +because he had always known that the grave was there and waiting for him. + + + + +Chapter 7 + + + +Winston had woken up with his eyes full of tears. Julia rolled sleepily +against him, murmuring something that might have been 'What's the matter?' + +'I dreamt--' he began, and stopped short. It was too complex to be put +into words. There was the dream itself, and there was a memory connected +with it that had swum into his mind in the few seconds after waking. + +He lay back with his eyes shut, still sodden in the atmosphere of the +dream. It was a vast, luminous dream in which his whole life seemed to +stretch out before him like a landscape on a summer evening after rain. +It had all occurred inside the glass paperweight, but the surface of the +glass was the dome of the sky, and inside the dome everything was flooded +with clear soft light in which one could see into interminable distances. +The dream had also been comprehended by--indeed, in some sense it had +consisted in--a gesture of the arm made by his mother, and made again +thirty years later by the Jewish woman he had seen on the news film, +trying to shelter the small boy from the bullets, before the helicopter +blew them both to pieces. + +'Do you know,' he said, 'that until this moment I believed I had murdered +my mother?' + +'Why did you murder her?' said Julia, almost asleep. + +'I didn't murder her. Not physically.' + +In the dream he had remembered his last glimpse of his mother, and within +a few moments of waking the cluster of small events surrounding it had all +come back. It was a memory that he must have deliberately pushed out of +his consciousness over many years. He was not certain of the date, but he +could not have been less than ten years old, possibly twelve, when it had +happened. + +His father had disappeared some time earlier, how much earlier he could +not remember. He remembered better the rackety, uneasy circumstances of +the time: the periodical panics about air-raids and the sheltering in Tube +stations, the piles of rubble everywhere, the unintelligible proclamations +posted at street corners, the gangs of youths in shirts all the same +colour, the enormous queues outside the bakeries, the intermittent +machine-gun fire in the distance--above all, the fact that there was +never enough to eat. He remembered long afternoons spent with other boys +in scrounging round dustbins and rubbish heaps, picking out the ribs of +cabbage leaves, potato peelings, sometimes even scraps of stale breadcrust +from which they carefully scraped away the cinders; and also in waiting +for the passing of trucks which travelled over a certain route and were +known to carry cattle feed, and which, when they jolted over the bad +patches in the road, sometimes spilt a few fragments of oil-cake. + +When his father disappeared, his mother did not show any surprise or any +violent grief, but a sudden change came over her. She seemed to have +become completely spiritless. It was evident even to Winston that she was +waiting for something that she knew must happen. She did everything that +was needed--cooked, washed, mended, made the bed, swept the floor, dusted +the mantelpiece--always very slowly and with a curious lack of superfluous +motion, like an artist's lay-figure moving of its own accord. Her large +shapely body seemed to relapse naturally into stillness. For hours at a +time she would sit almost immobile on the bed, nursing his young sister, +a tiny, ailing, very silent child of two or three, with a face made simian +by thinness. Very occasionally she would take Winston in her arms and +press him against her for a long time without saying anything. He was +aware, in spite of his youthfulness and selfishness, that this was somehow +connected with the never-mentioned thing that was about to happen. + +He remembered the room where they lived, a dark, close-smelling room that +seemed half filled by a bed with a white counterpane. There was a gas ring +in the fender, and a shelf where food was kept, and on the landing outside +there was a brown earthenware sink, common to several rooms. He remembered +his mother's statuesque body bending over the gas ring to stir at something +in a saucepan. Above all he remembered his continuous hunger, and the +fierce sordid battles at mealtimes. He would ask his mother naggingly, +over and over again, why there was not more food, he would shout and storm +at her (he even remembered the tones of his voice, which was beginning to +break prematurely and sometimes boomed in a peculiar way), or he would +attempt a snivelling note of pathos in his efforts to get more than his +share. His mother was quite ready to give him more than his share. She +took it for granted that he, 'the boy', should have the biggest portion; +but however much she gave him he invariably demanded more. At every meal +she would beseech him not to be selfish and to remember that his little +sister was sick and also needed food, but it was no use. He would cry out +with rage when she stopped ladling, he would try to wrench the saucepan +and spoon out of her hands, he would grab bits from his sister's plate. +He knew that he was starving the other two, but he could not help it; he +even felt that he had a right to do it. The clamorous hunger in his belly +seemed to justify him. Between meals, if his mother did not stand guard, +he was constantly pilfering at the wretched store of food on the shelf. + +One day a chocolate ration was issued. There had been no such issue for +weeks or months past. He remembered quite clearly that precious little +morsel of chocolate. It was a two-ounce slab (they still talked about +ounces in those days) between the three of them. It was obvious that it +ought to be divided into three equal parts. Suddenly, as though he were +listening to somebody else, Winston heard himself demanding in a loud +booming voice that he should be given the whole piece. His mother told him +not to be greedy. There was a long, nagging argument that went round and +round, with shouts, whines, tears, remonstrances, bargainings. His tiny +sister, clinging to her mother with both hands, exactly like a baby monkey, +sat looking over her shoulder at him with large, mournful eyes. In the +end his mother broke off three-quarters of the chocolate and gave it to +Winston, giving the other quarter to his sister. The little girl took hold +of it and looked at it dully, perhaps not knowing what it was. Winston +stood watching her for a moment. Then with a sudden swift spring he had +snatched the piece of chocolate out of his sister's hand and was fleeing +for the door. + +'Winston, Winston!' his mother called after him. 'Come back! Give your +sister back her chocolate!' + +He stopped, but did not come back. His mother's anxious eyes were fixed on +his face. Even now he was thinking about the thing, he did not know what +it was that was on the point of happening. His sister, conscious of having +been robbed of something, had set up a feeble wail. His mother drew her +arm round the child and pressed its face against her breast. Something in +the gesture told him that his sister was dying. He turned and fled down +the stairs, with the chocolate growing sticky in his hand. + +He never saw his mother again. After he had devoured the chocolate he felt +somewhat ashamed of himself and hung about in the streets for several +hours, until hunger drove him home. When he came back his mother had +disappeared. This was already becoming normal at that time. Nothing was +gone from the room except his mother and his sister. They had not taken +any clothes, not even his mother's overcoat. To this day he did not know +with any certainty that his mother was dead. It was perfectly possible +that she had merely been sent to a forced-labour camp. As for his sister, +she might have been removed, like Winston himself, to one of the colonies +for homeless children (Reclamation Centres, they were called) which had +grown up as a result of the civil war, or she might have been sent to the +labour camp along with his mother, or simply left somewhere or other +to die. + +The dream was still vivid in his mind, especially the enveloping protecting +gesture of the arm in which its whole meaning seemed to be contained. His +mind went back to another dream of two months ago. Exactly as his mother +had sat on the dingy white-quilted bed, with the child clinging to her, so +she had sat in the sunken ship, far underneath him, and drowning deeper +every minute, but still looking up at him through the darkening water. + +He told Julia the story of his mother's disappearance. Without opening her +eyes she rolled over and settled herself into a more comfortable position. + +'I expect you were a beastly little swine in those days,' she said +indistinctly. 'All children are swine.' + +'Yes. But the real point of the story----' + +From her breathing it was evident that she was going off to sleep again. +He would have liked to continue talking about his mother. He did not +suppose, from what he could remember of her, that she had been an unusual +woman, still less an intelligent one; and yet she had possessed a kind of +nobility, a kind of purity, simply because the standards that she obeyed +were private ones. Her feelings were her own, and could not be altered +from outside. It would not have occurred to her that an action which is +ineffectual thereby becomes meaningless. If you loved someone, you loved +him, and when you had nothing else to give, you still gave him love. When +the last of the chocolate was gone, his mother had clasped the child in +her arms. It was no use, it changed nothing, it did not produce more +chocolate, it did not avert the child's death or her own; but it seemed +natural to her to do it. The refugee woman in the boat had also covered +the little boy with her arm, which was no more use against the bullets +than a sheet of paper. The terrible thing that the Party had done was to +persuade you that mere impulses, mere feelings, were of no account, while +at the same time robbing you of all power over the material world. When +once you were in the grip of the Party, what you felt or did not feel, +what you did or refrained from doing, made literally no difference. +Whatever happened you vanished, and neither you nor your actions were ever +heard of again. You were lifted clean out of the stream of history. And +yet to the people of only two generations ago this would not have seemed +all-important, because they were not attempting to alter history. They +were governed by private loyalties which they did not question. What +mattered were individual relationships, and a completely helpless gesture, +an embrace, a tear, a word spoken to a dying man, could have value in +itself. The proles, it suddenly occurred to him, had remained in this +condition. They were not loyal to a party or a country or an idea, they +were loyal to one another. For the first time in his life he did not +despise the proles or think of them merely as an inert force which would +one day spring to life and regenerate the world. The proles had stayed +human. They had not become hardened inside. They had held on to the +primitive emotions which he himself had to re-learn by conscious effort. +And in thinking this he remembered, without apparent relevance, how a few +weeks ago he had seen a severed hand lying on the pavement and had kicked +it into the gutter as though it had been a cabbage-stalk. + +'The proles are human beings,' he said aloud. 'We are not human.' + +'Why not?' said Julia, who had woken up again. + +He thought for a little while. 'Has it ever occurred to you,' he said, +'that the best thing for us to do would be simply to walk out of here +before it's too late, and never see each other again?' + +'Yes, dear, it has occurred to me, several times. But I'm not going to do +it, all the same.' + +'We've been lucky,' he said 'but it can't last much longer. You're young. +You look normal and innocent. If you keep clear of people like me, you +might stay alive for another fifty years.' + +'No. I've thought it all out. What you do, I'm going to do. And don't be +too downhearted. I'm rather good at staying alive.' + +'We may be together for another six months--a year--there's no knowing. +At the end we're certain to be apart. Do you realize how utterly alone we +shall be? When once they get hold of us there will be nothing, literally +nothing, that either of us can do for the other. If I confess, they'll +shoot you, and if I refuse to confess, they'll shoot you just the same. +Nothing that I can do or say, or stop myself from saying, will put off +your death for as much as five minutes. Neither of us will even know +whether the other is alive or dead. We shall be utterly without power of +any kind. The one thing that matters is that we shouldn't betray one +another, although even that can't make the slightest difference.' + +'If you mean confessing,' she said, 'we shall do that, right enough. +Everybody always confesses. You can't help it. They torture you.' + +'I don't mean confessing. Confession is not betrayal. What you say or do +doesn't matter: only feelings matter. If they could make me stop loving +you--that would be the real betrayal.' + +She thought it over. 'They can't do that,' she said finally. 'It's the one +thing they can't do. They can make you say anything--ANYTHING--but they +can't make you believe it. They can't get inside you.' + +'No,' he said a little more hopefully, 'no; that's quite true. They can't +get inside you. If you can FEEL that staying human is worth while, even +when it can't have any result whatever, you've beaten them.' + +He thought of the telescreen with its never-sleeping ear. They could spy +upon you night and day, but if you kept your head you could still outwit +them. With all their cleverness they had never mastered the secret of +finding out what another human being was thinking. Perhaps that was less +true when you were actually in their hands. One did not know what happened +inside the Ministry of Love, but it was possible to guess: tortures, drugs, +delicate instruments that registered your nervous reactions, gradual +wearing-down by sleeplessness and solitude and persistent questioning. +Facts, at any rate, could not be kept hidden. They could be tracked down +by enquiry, they could be squeezed out of you by torture. But if the object +was not to stay alive but to stay human, what difference did it ultimately +make? They could not alter your feelings: for that matter you could not +alter them yourself, even if you wanted to. They could lay bare in the +utmost detail everything that you had done or said or thought; but the +inner heart, whose workings were mysterious even to yourself, remained +impregnable. + + + + +Chapter 8 + + + +They had done it, they had done it at last! + +The room they were standing in was long-shaped and softly lit. The +telescreen was dimmed to a low murmur; the richness of the dark-blue carpet +gave one the impression of treading on velvet. At the far end of the room +O'Brien was sitting at a table under a green-shaded lamp, with a mass of +papers on either side of him. He had not bothered to look up when the +servant showed Julia and Winston in. + +Winston's heart was thumping so hard that he doubted whether he would be +able to speak. They had done it, they had done it at last, was all he +could think. It had been a rash act to come here at all, and sheer folly +to arrive together; though it was true that they had come by different +routes and only met on O'Brien's doorstep. But merely to walk into such a +place needed an effort of the nerve. It was only on very rare occasions +that one saw inside the dwelling-places of the Inner Party, or even +penetrated into the quarter of the town where they lived. The whole +atmosphere of the huge block of flats, the richness and spaciousness of +everything, the unfamiliar smells of good food and good tobacco, the +silent and incredibly rapid lifts sliding up and down, the white-jacketed +servants hurrying to and fro--everything was intimidating. Although he had +a good pretext for coming here, he was haunted at every step by the fear +that a black-uniformed guard would suddenly appear from round the corner, +demand his papers, and order him to get out. O'Brien's servant, however, +had admitted the two of them without demur. He was a small, dark-haired +man in a white jacket, with a diamond-shaped, completely expressionless +face which might have been that of a Chinese. The passage down which he +led them was softly carpeted, with cream-papered walls and white +wainscoting, all exquisitely clean. That too was intimidating. Winston +could not remember ever to have seen a passageway whose walls were not +grimy from the contact of human bodies. + +O'Brien had a slip of paper between his fingers and seemed to be studying +it intently. His heavy face, bent down so that one could see the line of +the nose, looked both formidable and intelligent. For perhaps twenty +seconds he sat without stirring. Then he pulled the speakwrite towards +him and rapped out a message in the hybrid jargon of the Ministries: + +'Items one comma five comma seven approved fullwise stop suggestion +contained item six doubleplus ridiculous verging crimethink cancel stop +unproceed constructionwise antegetting plusfull estimates machinery +overheads stop end message.' + +He rose deliberately from his chair and came towards them across the +soundless carpet. A little of the official atmosphere seemed to have fallen +away from him with the Newspeak words, but his expression was grimmer than +usual, as though he were not pleased at being disturbed. The terror that +Winston already felt was suddenly shot through by a streak of ordinary +embarrassment. It seemed to him quite possible that he had simply made a +stupid mistake. For what evidence had he in reality that O'Brien was any +kind of political conspirator? Nothing but a flash of the eyes and a single +equivocal remark: beyond that, only his own secret imaginings, founded on +a dream. He could not even fall back on the pretence that he had come to +borrow the dictionary, because in that case Julia's presence was impossible +to explain. As O'Brien passed the telescreen a thought seemed to strike +him. He stopped, turned aside and pressed a switch on the wall. There was +a sharp snap. The voice had stopped. + +Julia uttered a tiny sound, a sort of squeak of surprise. Even in the midst +of his panic, Winston was too much taken aback to be able to hold his +tongue. + +'You can turn it off!' he said. + +'Yes,' said O'Brien, 'we can turn it off. We have that privilege.' + +He was opposite them now. His solid form towered over the pair of them, +and the expression on his face was still indecipherable. He was waiting, +somewhat sternly, for Winston to speak, but about what? Even now it was +quite conceivable that he was simply a busy man wondering irritably why he +had been interrupted. Nobody spoke. After the stopping of the telescreen +the room seemed deadly silent. The seconds marched past, enormous. With +difficulty Winston continued to keep his eyes fixed on O'Brien's. Then +suddenly the grim face broke down into what might have been the beginnings +of a smile. With his characteristic gesture O'Brien resettled his +spectacles on his nose. + +'Shall I say it, or will you?' he said. + +'I will say it,' said Winston promptly. 'That thing is really turned off?' + +'Yes, everything is turned off. We are alone.' + +'We have come here because----' + +He paused, realizing for the first time the vagueness of +his own motives. Since he did not in fact know what kind of +help he expected from O'Brien, it was not easy to say why he +had come here. He went on, conscious that what he was saying +must sound both feeble and pretentious: + +'We believe that there is some kind of conspiracy, some kind of secret +organization working against the Party, and that you are involved in it. +We want to join it and work for it. We are enemies of the Party. We +disbelieve in the principles of Ingsoc. We are thought-criminals. We are +also adulterers. I tell you this because we want to put ourselves at your +mercy. If you want us to incriminate ourselves in any other way, we are +ready.' + +He stopped and glanced over his shoulder, with the feeling that the door +had opened. Sure enough, the little yellow-faced servant had come in +without knocking. Winston saw that he was carrying a tray with a decanter +and glasses. + +'Martin is one of us,' said O'Brien impassively. 'Bring the drinks over +here, Martin. Put them on the round table. Have we enough chairs? Then +we may as well sit down and talk in comfort. Bring a chair for yourself, +Martin. This is business. You can stop being a servant for the next ten +minutes.' + +The little man sat down, quite at his ease, and yet still with a +servant-like air, the air of a valet enjoying a privilege. Winston +regarded him out of the corner of his eye. It struck him that the man's +whole life was playing a part, and that he felt it to be dangerous to +drop his assumed personality even for a moment. O'Brien took the decanter +by the neck and filled up the glasses with a dark-red liquid. It aroused +in Winston dim memories of something seen long ago on a wall or a +hoarding--a vast bottle composed of electric lights which seemed to move +up and down and pour its contents into a glass. Seen from the top the +stuff looked almost black, but in the decanter it gleamed like a ruby. +It had a sour-sweet smell. He saw Julia pick up her glass and sniff at +it with frank curiosity. + +'It is called wine,' said O'Brien with a faint smile. 'You will have read +about it in books, no doubt. Not much of it gets to the Outer Party, I am +afraid.' His face grew solemn again, and he raised his glass: 'I think it +is fitting that we should begin by drinking a health. To our Leader: To +Emmanuel Goldstein.' + +Winston took up his glass with a certain eagerness. Wine was a thing he +had read and dreamed about. Like the glass paperweight or Mr Charrington's +half-remembered rhymes, it belonged to the vanished, romantic past, the +olden time as he liked to call it in his secret thoughts. For some reason +he had always thought of wine as having an intensely sweet taste, like +that of blackberry jam and an immediate intoxicating effect. Actually, +when he came to swallow it, the stuff was distinctly disappointing. The +truth was that after years of gin-drinking he could barely taste it. He +set down the empty glass. + +'Then there is such a person as Goldstein?' he said. + +'Yes, there is such a person, and he is alive. Where, I do not know.' + +'And the conspiracy--the organization? Is it real? It is not simply an +invention of the Thought Police?' + +'No, it is real. The Brotherhood, we call it. You will never learn much +more about the Brotherhood than that it exists and that you belong to it. +I will come back to that presently.' He looked at his wrist-watch. 'It is +unwise even for members of the Inner Party to turn off the telescreen for +more than half an hour. You ought not to have come here together, and +you will have to leave separately. You, comrade'--he bowed his head to +Julia--'will leave first. We have about twenty minutes at our disposal. +You will understand that I must start by asking you certain questions. +In general terms, what are you prepared to do?' + +'Anything that we are capable of,' said Winston. + +O'Brien had turned himself a little in his chair so that he was facing +Winston. He almost ignored Julia, seeming to take it for granted that +Winston could speak for her. For a moment the lids flitted down over his +eyes. He began asking his questions in a low, expressionless voice, as +though this were a routine, a sort of catechism, most of whose answers +were known to him already. + +'You are prepared to give your lives?' + +'Yes.' + +'You are prepared to commit murder?' + +'Yes.' + +'To commit acts of sabotage which may cause the death of hundreds of +innocent people?' + +'Yes.' + +'To betray your country to foreign powers?' + +'Yes.' + +'You are prepared to cheat, to forge, to blackmail, to corrupt the minds +of children, to distribute habit-forming drugs, to encourage prostitution, +to disseminate venereal diseases--to do anything which is likely to cause +demoralization and weaken the power of the Party?' + +'Yes.' + +'If, for example, it would somehow serve our interests to throw sulphuric +acid in a child's face--are you prepared to do that?' + +'Yes.' + +'You are prepared to lose your identity and live out the rest of your life +as a waiter or a dock-worker?' + +'Yes.' + +'You are prepared to commit suicide, if and when we order you to do so?' + +'Yes.' + +'You are prepared, the two of you, to separate and never see one another +again?' + +'No!' broke in Julia. + +It appeared to Winston that a long time passed before he answered. For a +moment he seemed even to have been deprived of the power of speech. His +tongue worked soundlessly, forming the opening syllables first of one word, +then of the other, over and over again. Until he had said it, he did not +know which word he was going to say. 'No,' he said finally. + +'You did well to tell me,' said O'Brien. 'It is necessary for us to know +everything.' + +He turned himself toward Julia and added in a voice with somewhat more +expression in it: + +'Do you understand that even if he survives, it may be as a different +person? We may be obliged to give him a new identity. His face, his +movements, the shape of his hands, the colour of his hair--even his voice +would be different. And you yourself might have become a different person. +Our surgeons can alter people beyond recognition. Sometimes it is +necessary. Sometimes we even amputate a limb.' + +Winston could not help snatching another sidelong glance at Martin's +Mongolian face. There were no scars that he could see. Julia had turned a +shade paler, so that her freckles were showing, but she faced O'Brien +boldly. She murmured something that seemed to be assent. + +'Good. Then that is settled.' + +There was a silver box of cigarettes on the table. With a rather +absent-minded air O'Brien pushed them towards the others, took one himself, +then stood up and began to pace slowly to and fro, as though he could think +better standing. They were very good cigarettes, very thick and +well-packed, with an unfamiliar silkiness in the paper. O'Brien looked at +his wrist-watch again. + +'You had better go back to your Pantry, Martin,' he said. 'I shall switch +on in a quarter of an hour. Take a good look at these comrades' faces +before you go. You will be seeing them again. I may not.' + +Exactly as they had done at the front door, the little man's dark eyes +flickered over their faces. There was not a trace of friendliness in his +manner. He was memorizing their appearance, but he felt no interest in +them, or appeared to feel none. It occurred to Winston that a synthetic +face was perhaps incapable of changing its expression. Without speaking +or giving any kind of salutation, Martin went out, closing the door +silently behind him. O'Brien was strolling up and down, one hand in the +pocket of his black overalls, the other holding his cigarette. + +'You understand,' he said, 'that you will be fighting in the dark. You +will always be in the dark. You will receive orders and you will obey them, +without knowing why. Later I shall send you a book from which you will +learn the true nature of the society we live in, and the strategy by which +we shall destroy it. When you have read the book, you will be full members +of the Brotherhood. But between the general aims that we are fighting for +and the immediate tasks of the moment, you will never know anything. I +tell you that the Brotherhood exists, but I cannot tell you whether it +numbers a hundred members, or ten million. From your personal knowledge +you will never be able to say that it numbers even as many as a dozen. You +will have three or four contacts, who will be renewed from time to time as +they disappear. As this was your first contact, it will be preserved. When +you receive orders, they will come from me. If we find it necessary to +communicate with you, it will be through Martin. When you are finally +caught, you will confess. That is unavoidable. But you will have very +little to confess, other than your own actions. You will not be able to +betray more than a handful of unimportant people. Probably you will not +even betray me. By that time I may be dead, or I shall have become a +different person, with a different face.' + +He continued to move to and fro over the soft carpet. In spite of the +bulkiness of his body there was a remarkable grace in his movements. It +came out even in the gesture with which he thrust a hand into his pocket, +or manipulated a cigarette. More even than of strength, he gave an +impression of confidence and of an understanding tinged by irony. However +much in earnest he might be, he had nothing of the single-mindedness that +belongs to a fanatic. When he spoke of murder, suicide, venereal disease, +amputated limbs, and altered faces, it was with a faint air of persiflage. +'This is unavoidable,' his voice seemed to say; 'this is what we have got +to do, unflinchingly. But this is not what we shall be doing when life is +worth living again.' A wave of admiration, almost of worship, flowed out +from Winston towards O'Brien. For the moment he had forgotten the shadowy +figure of Goldstein. When you looked at O'Brien's powerful shoulders and +his blunt-featured face, so ugly and yet so civilized, it was impossible +to believe that he could be defeated. There was no stratagem that he was +not equal to, no danger that he could not foresee. Even Julia seemed to +be impressed. She had let her cigarette go out and was listening intently. +O'Brien went on: + +'You will have heard rumours of the existence of the Brotherhood. No doubt +you have formed your own picture of it. You have imagined, probably, a +huge underworld of conspirators, meeting secretly in cellars, scribbling +messages on walls, recognizing one another by codewords or by special +movements of the hand. Nothing of the kind exists. The members of the +Brotherhood have no way of recognizing one another, and it is impossible +for any one member to be aware of the identity of more than a few others. +Goldstein himself, if he fell into the hands of the Thought Police, could +not give them a complete list of members, or any information that would +lead them to a complete list. No such list exists. The Brotherhood cannot +be wiped out because it is not an organization in the ordinary sense. +Nothing holds it together except an idea which is indestructible. You +will never have anything to sustain you, except the idea. You will get no +comradeship and no encouragement. When finally you are caught, you will +get no help. We never help our members. At most, when it is absolutely +necessary that someone should be silenced, we are occasionally able to +smuggle a razor blade into a prisoner's cell. You will have to get used +to living without results and without hope. You will work for a while, +you will be caught, you will confess, and then you will die. Those are +the only results that you will ever see. There is no possibility that any +perceptible change will happen within our own lifetime. We are the dead. +Our only true life is in the future. We shall take part in it as handfuls +of dust and splinters of bone. But how far away that future may be, there +is no knowing. It might be a thousand years. At present nothing is possible +except to extend the area of sanity little by little. We cannot act +collectively. We can only spread our knowledge outwards from individual to +individual, generation after generation. In the face of the Thought Police +there is no other way.' + +He halted and looked for the third time at his wrist-watch. + +'It is almost time for you to leave, comrade,' he said to Julia. 'Wait. +The decanter is still half full.' + +He filled the glasses and raised his own glass by the stem. + +'What shall it be this time?' he said, still with the same faint +suggestion of irony. 'To the confusion of the Thought Police? To the +death of Big Brother? To humanity? To the future?' + +'To the past,' said Winston. + +'The past is more important,' agreed O'Brien gravely. + +They emptied their glasses, and a moment later Julia stood up to go. +O'Brien took a small box from the top of a cabinet and handed her a flat +white tablet which he told her to place on her tongue. It was important, +he said, not to go out smelling of wine: the lift attendants were very +observant. As soon as the door had shut behind her he appeared to forget +her existence. He took another pace or two up and down, then stopped. + +'There are details to be settled,' he said. 'I assume that you have a +hiding-place of some kind?' + +Winston explained about the room over Mr Charrington's shop. + +'That will do for the moment. Later we will arrange something else for you. +It is important to change one's hiding-place frequently. Meanwhile I shall +send you a copy of THE BOOK'--even O'Brien, Winston noticed, seemed to +pronounce the words as though they were in italics--'Goldstein's book, you +understand, as soon as possible. It may be some days before I can get hold +of one. There are not many in existence, as you can imagine. The Thought +Police hunt them down and destroy them almost as fast as we can produce +them. It makes very little difference. The book is indestructible. If +the last copy were gone, we could reproduce it almost word for word. Do +you carry a brief-case to work with you?' he added. + +'As a rule, yes.' + +'What is it like?' + +'Black, very shabby. With two straps.' + +'Black, two straps, very shabby--good. One day in the fairly near +future--I cannot give a date--one of the messages among your morning's +work will contain a misprinted word, and you will have to ask for a +repeat. On the following day you will go to work without your brief-case. +At some time during the day, in the street, a man will touch you on the +arm and say "I think you have dropped your brief-case." The one he gives +you will contain a copy of Goldstein's book. You will return it within +fourteen days.' + +They were silent for a moment. + +'There are a couple of minutes before you need go,' said O'Brien. 'We +shall meet again--if we do meet again----' + +Winston looked up at him. 'In the place where there is no darkness?' +he said hesitantly. + +O'Brien nodded without appearance of surprise. 'In the place where there +is no darkness,' he said, as though he had recognized the allusion. 'And +in the meantime, is there anything that you wish to say before you leave? +Any message? Any question?.' + +Winston thought. There did not seem to be any further question that he +wanted to ask: still less did he feel any impulse to utter high-sounding +generalities. Instead of anything directly connected with O'Brien or the +Brotherhood, there came into his mind a sort of composite picture of the +dark bedroom where his mother had spent her last days, and the little room +over Mr Charrington's shop, and the glass paperweight, and the steel +engraving in its rosewood frame. Almost at random he said: + +'Did you ever happen to hear an old rhyme that begins "Oranges and lemons, +say the bells of St Clement's"?' + +Again O'Brien nodded. With a sort of grave courtesy he completed the +stanza: + + + 'Oranges and lemons, say the bells of St Clement's, + You owe me three farthings, say the bells of St Martin's, + When will you pay me? say the bells of Old Bailey, + When I grow rich, say the bells of Shoreditch.' + + +'You knew the last line!' said Winston. + +'Yes, I knew the last line. And now, I am afraid, it is time for you to go. +But wait. You had better let me give you one of these tablets.' + +As Winston stood up O'Brien held out a hand. His powerful grip crushed +the bones of Winston's palm. At the door Winston looked back, but O'Brien +seemed already to be in process of putting him out of mind. He was waiting +with his hand on the switch that controlled the telescreen. Beyond him +Winston could see the writing-table with its green-shaded lamp and the +speakwrite and the wire baskets deep-laden with papers. The incident was +closed. Within thirty seconds, it occurred to him, O'Brien would be back +at his interrupted and important work on behalf of the Party. + + + + +Chapter 9 + + + +Winston was gelatinous with fatigue. Gelatinous was the right word. It had +come into his head spontaneously. His body seemed to have not only the +weakness of a jelly, but its translucency. He felt that if he held up his +hand he would be able to see the light through it. All the blood and +lymph had been drained out of him by an enormous debauch of work, leaving +only a frail structure of nerves, bones, and skin. All sensations seemed +to be magnified. His overalls fretted his shoulders, the pavement tickled +his feet, even the opening and closing of a hand was an effort that made +his joints creak. + +He had worked more than ninety hours in five days. So had everyone else in +the Ministry. Now it was all over, and he had literally nothing to do, no +Party work of any description, until tomorrow morning. He could spend six +hours in the hiding-place and another nine in his own bed. Slowly, in +mild afternoon sunshine, he walked up a dingy street in the direction +of Mr Charrington's shop, keeping one eye open for the patrols, but +irrationally convinced that this afternoon there was no danger of anyone +interfering with him. The heavy brief-case that he was carrying bumped +against his knee at each step, sending a tingling sensation up and down +the skin of his leg. Inside it was the book, which he had now had in his +possession for six days and had not yet opened, nor even looked at. + +On the sixth day of Hate Week, after the processions, the speeches, the +shouting, the singing, the banners, the posters, the films, the waxworks, +the rolling of drums and squealing of trumpets, the tramp of marching feet, +the grinding of the caterpillars of tanks, the roar of massed planes, +the booming of guns--after six days of this, when the great orgasm was +quivering to its climax and the general hatred of Eurasia had boiled up +into such delirium that if the crowd could have got their hands on the +2,000 Eurasian war-criminals who were to be publicly hanged on the last +day of the proceedings, they would unquestionably have torn them to +pieces--at just this moment it had been announced that Oceania was not +after all at war with Eurasia. Oceania was at war with Eastasia. Eurasia +was an ally. + +There was, of course, no admission that any change had taken place. Merely +it became known, with extreme suddenness and everywhere at once, that +Eastasia and not Eurasia was the enemy. Winston was taking part in a +demonstration in one of the central London squares at the moment when it +happened. It was night, and the white faces and the scarlet banners were +luridly floodlit. The square was packed with several thousand people, +including a block of about a thousand schoolchildren in the uniform of the +Spies. On a scarlet-draped platform an orator of the Inner Party, a small +lean man with disproportionately long arms and a large bald skull over +which a few lank locks straggled, was haranguing the crowd. A little +Rumpelstiltskin figure, contorted with hatred, he gripped the neck of the +microphone with one hand while the other, enormous at the end of a bony +arm, clawed the air menacingly above his head. His voice, made metallic by +the amplifiers, boomed forth an endless catalogue of atrocities, massacres, +deportations, lootings, rapings, torture of prisoners, bombing of +civilians, lying propaganda, unjust aggressions, broken treaties. It was +almost impossible to listen to him without being first convinced and then +maddened. At every few moments the fury of the crowd boiled over and the +voice of the speaker was drowned by a wild beast-like roaring that rose +uncontrollably from thousands of throats. The most savage yells of all +came from the schoolchildren. The speech had been proceeding for perhaps +twenty minutes when a messenger hurried on to the platform and a scrap of +paper was slipped into the speaker's hand. He unrolled and read it without +pausing in his speech. Nothing altered in his voice or manner, or in the +content of what he was saying, but suddenly the names were different. +Without words said, a wave of understanding rippled through the crowd. +Oceania was at war with Eastasia! The next moment there was a tremendous +commotion. The banners and posters with which the square was decorated +were all wrong! Quite half of them had the wrong faces on them. It was +sabotage! The agents of Goldstein had been at work! There was a riotous +interlude while posters were ripped from the walls, banners torn to shreds +and trampled underfoot. The Spies performed prodigies of activity in +clambering over the rooftops and cutting the streamers that fluttered from +the chimneys. But within two or three minutes it was all over. The orator, +still gripping the neck of the microphone, his shoulders hunched forward, +his free hand clawing at the air, had gone straight on with his speech. +One minute more, and the feral roars of rage were again bursting from the +crowd. The Hate continued exactly as before, except that the target had +been changed. + +The thing that impressed Winston in looking back was that the speaker had +switched from one line to the other actually in midsentence, not only +without a pause, but without even breaking the syntax. But at the moment +he had other things to preoccupy him. It was during the moment of disorder +while the posters were being torn down that a man whose face he did not +see had tapped him on the shoulder and said, 'Excuse me, I think you've +dropped your brief-case.' He took the brief-case abstractedly, without +speaking. He knew that it would be days before he had an opportunity to +look inside it. The instant that the demonstration was over he went +straight to the Ministry of Truth, though the time was now nearly +twenty-three hours. The entire staff of the Ministry had done likewise. +The orders already issuing from the telescreen, recalling them to their +posts, were hardly necessary. + +Oceania was at war with Eastasia: Oceania had always been at war with +Eastasia. A large part of the political literature of five years was now +completely obsolete. Reports and records of all kinds, newspapers, books, +pamphlets, films, sound-tracks, photographs--all had to be rectified at +lightning speed. Although no directive was ever issued, it was known that +the chiefs of the Department intended that within one week no reference +to the war with Eurasia, or the alliance with Eastasia, should remain in +existence anywhere. The work was overwhelming, all the more so because +the processes that it involved could not be called by their true +names. Everyone in the Records Department worked eighteen hours in the +twenty-four, with two three-hour snatches of sleep. Mattresses were brought +up from the cellars and pitched all over the corridors: meals consisted of +sandwiches and Victory Coffee wheeled round on trolleys by attendants from +the canteen. Each time that Winston broke off for one of his spells of +sleep he tried to leave his desk clear of work, and each time that he +crawled back sticky-eyed and aching, it was to find that another shower +of paper cylinders had covered the desk like a snowdrift, half-burying the +speakwrite and overflowing on to the floor, so that the first job was +always to stack them into a neat enough pile to give him room to work. +What was worst of all was that the work was by no means purely mechanical. +Often it was enough merely to substitute one name for another, but any +detailed report of events demanded care and imagination. Even the +geographical knowledge that one needed in transferring the war from one +part of the world to another was considerable. + +By the third day his eyes ached unbearably and his spectacles needed wiping +every few minutes. It was like struggling with some crushing physical task, +something which one had the right to refuse and which one was nevertheless +neurotically anxious to accomplish. In so far as he had time to remember +it, he was not troubled by the fact that every word he murmured into the +speakwrite, every stroke of his ink-pencil, was a deliberate lie. He was +as anxious as anyone else in the Department that the forgery should be +perfect. On the morning of the sixth day the dribble of cylinders slowed +down. For as much as half an hour nothing came out of the tube; then one +more cylinder, then nothing. Everywhere at about the same time the work +was easing off. A deep and as it were secret sigh went through the +Department. A mighty deed, which could never be mentioned, had been +achieved. It was now impossible for any human being to prove by documentary +evidence that the war with Eurasia had ever happened. At twelve hundred it +was unexpectedly announced that all workers in the Ministry were free till +tomorrow morning. Winston, still carrying the brief-case containing the +book, which had remained between his feet while he worked and under his +body while he slept, went home, shaved himself, and almost fell asleep in +his bath, although the water was barely more than tepid. + +With a sort of voluptuous creaking in his joints he climbed the stair above +Mr Charrington's shop. He was tired, but not sleepy any longer. He opened +the window, lit the dirty little oilstove and put on a pan of water for +coffee. Julia would arrive presently: meanwhile there was the book. He +sat down in the sluttish armchair and undid the straps of the brief-case. + +A heavy black volume, amateurishly bound, with no name or title on the +cover. The print also looked slightly irregular. The pages were worn at +the edges, and fell apart, easily, as though the book had passed through +many hands. The inscription on the title-page ran: + + + THE THEORY AND PRACTICE OF + OLIGARCHICAL COLLECTIVISM + by + Emmanuel Goldstein + + +Winston began reading: + + +Chapter I +Ignorance is Strength + +Throughout recorded time, and probably since the end of the Neolithic Age, +there have been three kinds of people in the world, the High, the Middle, +and the Low. They have been subdivided in many ways, they have borne +countless different names, and their relative numbers, as well as their +attitude towards one another, have varied from age to age: but the +essential structure of society has never altered. Even after enormous +upheavals and seemingly irrevocable changes, the same pattern has always +reasserted itself, just as a gyroscope will always return to equilibrium, +however far it is pushed one way or the other. + +The aims of these groups are entirely irreconcilable... + + +Winston stopped reading, chiefly in order to appreciate the fact that he +was reading, in comfort and safety. He was alone: no telescreen, no ear at +the keyhole, no nervous impulse to glance over his shoulder or cover the +page with his hand. The sweet summer air played against his cheek. From +somewhere far away there floated the faint shouts of children: in the room +itself there was no sound except the insect voice of the clock. He settled +deeper into the arm-chair and put his feet up on the fender. It was bliss, +it was eternity. Suddenly, as one sometimes does with a book of which one +knows that one will ultimately read and re-read every word, he opened it +at a different place and found himself at Chapter III. He went on reading: + + +Chapter III +War is Peace + +The splitting up of the world into three great super-states was an event +which could be and indeed was foreseen before the middle of the twentieth +century. With the absorption of Europe by Russia and of the British Empire +by the United States, two of the three existing powers, Eurasia and +Oceania, were already effectively in being. The third, Eastasia, only +emerged as a distinct unit after another decade of confused fighting. The +frontiers between the three super-states are in some places arbitrary, and +in others they fluctuate according to the fortunes of war, but in general +they follow geographical lines. Eurasia comprises the whole of the northern +part of the European and Asiatic land-mass, from Portugal to the Bering +Strait. Oceania comprises the Americas, the Atlantic islands including the +British Isles, Australasia, and the southern portion of Africa. Eastasia, +smaller than the others and with a less definite western frontier, +comprises China and the countries to the south of it, the Japanese islands +and a large but fluctuating portion of Manchuria, Mongolia, and Tibet. + +In one combination or another, these three super-states are permanently at +war, and have been so for the past twenty-five years. War, however, is no +longer the desperate, annihilating struggle that it was in the early +decades of the twentieth century. It is a warfare of limited aims between +combatants who are unable to destroy one another, have no material cause +for fighting and are not divided by any genuine ideological difference. +This is not to say that either the conduct of war, or the prevailing +attitude towards it, has become less bloodthirsty or more chivalrous. +On the contrary, war hysteria is continuous and universal in all countries, +and such acts as raping, looting, the slaughter of children, the reduction +of whole populations to slavery, and reprisals against prisoners which +extend even to boiling and burying alive, are looked upon as normal, +and, when they are committed by one's own side and not by the enemy, +meritorious. But in a physical sense war involves very small numbers of +people, mostly highly-trained specialists, and causes comparatively few +casualties. The fighting, when there is any, takes place on the vague +frontiers whose whereabouts the average man can only guess at, or round +the Floating Fortresses which guard strategic spots on the sea lanes. In +the centres of civilization war means no more than a continuous shortage +of consumption goods, and the occasional crash of a rocket bomb which may +cause a few scores of deaths. War has in fact changed its character. More +exactly, the reasons for which war is waged have changed in their order of +importance. Motives which were already present to some small extent in the +great wars of the early twentieth century have now become dominant and +are consciously recognized and acted upon. + +To understand the nature of the present war--for in spite of the regrouping +which occurs every few years, it is always the same war--one must realize +in the first place that it is impossible for it to be decisive. None of +the three super-states could be definitively conquered even by the other +two in combination. They are too evenly matched, and their natural defences +are too formidable. Eurasia is protected by its vast land spaces, Oceania +by the width of the Atlantic and the Pacific, Eastasia by the fecundity +and industriousness of its inhabitants. Secondly, there is no longer, in +a material sense, anything to fight about. With the establishment of +self-contained economies, in which production and consumption are geared +to one another, the scramble for markets which was a main cause of +previous wars has come to an end, while the competition for raw materials +is no longer a matter of life and death. In any case each of the three +super-states is so vast that it can obtain almost all the materials that +it needs within its own boundaries. In so far as the war has a direct +economic purpose, it is a war for labour power. Between the frontiers of +the super-states, and not permanently in the possession of any of them, +there lies a rough quadrilateral with its corners at Tangier, Brazzaville, +Darwin, and Hong Kong, containing within it about a fifth of the population +of the earth. It is for the possession of these thickly-populated regions, +and of the northern ice-cap, that the three powers are constantly +struggling. In practice no one power ever controls the whole of the +disputed area. Portions of it are constantly changing hands, and it is the +chance of seizing this or that fragment by a sudden stroke of treachery +that dictates the endless changes of alignment. + +All of the disputed territories contain valuable minerals, and some of +them yield important vegetable products such as rubber which in colder +climates it is necessary to synthesize by comparatively expensive methods. +But above all they contain a bottomless reserve of cheap labour. Whichever +power controls equatorial Africa, or the countries of the Middle East, or +Southern India, or the Indonesian Archipelago, disposes also of the bodies +of scores or hundreds of millions of ill-paid and hard-working coolies. +The inhabitants of these areas, reduced more or less openly to the status +of slaves, pass continually from conqueror to conqueror, and are expended +like so much coal or oil in the race to turn out more armaments, to capture +more territory, to control more labour power, to turn out more armaments, +to capture more territory, and so on indefinitely. It should be noted that +the fighting never really moves beyond the edges of the disputed areas. +The frontiers of Eurasia flow back and forth between the basin of the Congo +and the northern shore of the Mediterranean; the islands of the Indian +Ocean and the Pacific are constantly being captured and recaptured by +Oceania or by Eastasia; in Mongolia the dividing line between Eurasia and +Eastasia is never stable; round the Pole all three powers lay claim to +enormous territories which in fact are largely uninhabited and unexplored: +but the balance of power always remains roughly even, and the territory +which forms the heartland of each super-state always remains inviolate. +Moreover, the labour of the exploited peoples round the Equator is not +really necessary to the world's economy. They add nothing to the wealth of +the world, since whatever they produce is used for purposes of war, and +the object of waging a war is always to be in a better position in which +to wage another war. By their labour the slave populations allow the tempo +of continuous warfare to be speeded up. But if they did not exist, the +structure of world society, and the process by which it maintains itself, +would not be essentially different. + +The primary aim of modern warfare (in accordance with the principles of +DOUBLETHINK, this aim is simultaneously recognized and not recognized by +the directing brains of the Inner Party) is to use up the products of the +machine without raising the general standard of living. Ever since the end +of the nineteenth century, the problem of what to do with the surplus of +consumption goods has been latent in industrial society. At present, when +few human beings even have enough to eat, this problem is obviously not +urgent, and it might not have become so, even if no artificial processes +of destruction had been at work. The world of today is a bare, hungry, +dilapidated place compared with the world that existed before 1914, and +still more so if compared with the imaginary future to which the people of +that period looked forward. In the early twentieth century, the vision of +a future society unbelievably rich, leisured, orderly, and efficient--a +glittering antiseptic world of glass and steel and snow-white concrete--was +part of the consciousness of nearly every literate person. Science and +technology were developing at a prodigious speed, and it seemed natural to +assume that they would go on developing. This failed to happen, partly +because of the impoverishment caused by a long series of wars and +revolutions, partly because scientific and technical progress depended on +the empirical habit of thought, which could not survive in a strictly +regimented society. As a whole the world is more primitive today than it +was fifty years ago. Certain backward areas have advanced, and various +devices, always in some way connected with warfare and police espionage, +have been developed, but experiment and invention have largely stopped, +and the ravages of the atomic war of the nineteen-fifties have never been +fully repaired. Nevertheless the dangers inherent in the machine are still +there. From the moment when the machine first made its appearance it +was clear to all thinking people that the need for human drudgery, and +therefore to a great extent for human inequality, had disappeared. If the +machine were used deliberately for that end, hunger, overwork, dirt, +illiteracy, and disease could be eliminated within a few generations. +And in fact, without being used for any such purpose, but by a sort of +automatic process--by producing wealth which it was sometimes impossible +not to distribute--the machine did raise the living standards of the +average human being very greatly over a period of about fifty years at +the end of the nineteenth and the beginning of the twentieth centuries. + +But it was also clear that an all-round increase in wealth threatened the +destruction--indeed, in some sense was the destruction--of a hierarchical +society. In a world in which everyone worked short hours, had enough to +eat, lived in a house with a bathroom and a refrigerator, and possessed +a motor-car or even an aeroplane, the most obvious and perhaps the most +important form of inequality would already have disappeared. If it once +became general, wealth would confer no distinction. It was possible, no +doubt, to imagine a society in which WEALTH, in the sense of personal +possessions and luxuries, should be evenly distributed, while POWER +remained in the hands of a small privileged caste. But in practice such +a society could not long remain stable. For if leisure and security were +enjoyed by all alike, the great mass of human beings who are normally +stupefied by poverty would become literate and would learn to think for +themselves; and when once they had done this, they would sooner or later +realize that the privileged minority had no function, and they would sweep +it away. In the long run, a hierarchical society was only possible on a +basis of poverty and ignorance. To return to the agricultural past, as +some thinkers about the beginning of the twentieth century dreamed of +doing, was not a practicable solution. It conflicted with the tendency +towards mechanization which had become quasi-instinctive throughout almost +the whole world, and moreover, any country which remained industrially +backward was helpless in a military sense and was bound to be dominated, +directly or indirectly, by its more advanced rivals. + +Nor was it a satisfactory solution to keep the masses in poverty by +restricting the output of goods. This happened to a great extent during +the final phase of capitalism, roughly between 1920 and 1940. The economy +of many countries was allowed to stagnate, land went out of cultivation, +capital equipment was not added to, great blocks of the population were +prevented from working and kept half alive by State charity. But this, +too, entailed military weakness, and since the privations it inflicted +were obviously unnecessary, it made opposition inevitable. The problem was +how to keep the wheels of industry turning without increasing the real +wealth of the world. Goods must be produced, but they must not be +distributed. And in practice the only way of achieving this was by +continuous warfare. + +The essential act of war is destruction, not necessarily of human lives, +but of the products of human labour. War is a way of shattering to pieces, +or pouring into the stratosphere, or sinking in the depths of the sea, +materials which might otherwise be used to make the masses too comfortable, +and hence, in the long run, too intelligent. Even when weapons of war are +not actually destroyed, their manufacture is still a convenient way of +expending labour power without producing anything that can be consumed. +A Floating Fortress, for example, has locked up in it the labour that +would build several hundred cargo-ships. Ultimately it is scrapped as +obsolete, never having brought any material benefit to anybody, and with +further enormous labours another Floating Fortress is built. In principle +the war effort is always so planned as to eat up any surplus that might +exist after meeting the bare needs of the population. In practice the needs +of the population are always underestimated, with the result that there is +a chronic shortage of half the necessities of life; but this is looked on +as an advantage. It is deliberate policy to keep even the favoured groups +somewhere near the brink of hardship, because a general state of scarcity +increases the importance of small privileges and thus magnifies the +distinction between one group and another. By the standards of the early +twentieth century, even a member of the Inner Party lives an austere, +laborious kind of life. Nevertheless, the few luxuries that he does enjoy +his large, well-appointed flat, the better texture of his clothes, the +better quality of his food and drink and tobacco, his two or three +servants, his private motor-car or helicopter--set him in a different world +from a member of the Outer Party, and the members of the Outer Party have +a similar advantage in comparison with the submerged masses whom we call +'the proles'. The social atmosphere is that of a besieged city, where the +possession of a lump of horseflesh makes the difference between wealth and +poverty. And at the same time the consciousness of being at war, and +therefore in danger, makes the handing-over of all power to a small caste +seem the natural, unavoidable condition of survival. + +War, it will be seen, accomplishes the necessary destruction, but +accomplishes it in a psychologically acceptable way. In principle it would +be quite simple to waste the surplus labour of the world by building +temples and pyramids, by digging holes and filling them up again, or even +by producing vast quantities of goods and then setting fire to them. But +this would provide only the economic and not the emotional basis for a +hierarchical society. What is concerned here is not the morale of masses, +whose attitude is unimportant so long as they are kept steadily at work, +but the morale of the Party itself. Even the humblest Party member is +expected to be competent, industrious, and even intelligent within narrow +limits, but it is also necessary that he should be a credulous and ignorant +fanatic whose prevailing moods are fear, hatred, adulation, and orgiastic +triumph. In other words it is necessary that he should have the mentality +appropriate to a state of war. It does not matter whether the war is +actually happening, and, since no decisive victory is possible, it does +not matter whether the war is going well or badly. All that is needed is +that a state of war should exist. The splitting of the intelligence which +the Party requires of its members, and which is more easily achieved in an +atmosphere of war, is now almost universal, but the higher up the ranks +one goes, the more marked it becomes. It is precisely in the Inner Party +that war hysteria and hatred of the enemy are strongest. In his capacity +as an administrator, it is often necessary for a member of the Inner Party +to know that this or that item of war news is untruthful, and he may often +be aware that the entire war is spurious and is either not happening or +is being waged for purposes quite other than the declared ones: but such +knowledge is easily neutralized by the technique of DOUBLETHINK. Meanwhile +no Inner Party member wavers for an instant in his mystical belief that +the war is real, and that it is bound to end victoriously, with Oceania +the undisputed master of the entire world. + +All members of the Inner Party believe in this coming conquest as an +article of faith. It is to be achieved either by gradually acquiring more +and more territory and so building up an overwhelming preponderance of +power, or by the discovery of some new and unanswerable weapon. The search +for new weapons continues unceasingly, and is one of the very few remaining +activities in which the inventive or speculative type of mind can find any +outlet. In Oceania at the present day, Science, in the old sense, has +almost ceased to exist. In Newspeak there is no word for 'Science'. The +empirical method of thought, on which all the scientific achievements of +the past were founded, is opposed to the most fundamental principles of +Ingsoc. And even technological progress only happens when its products can +in some way be used for the diminution of human liberty. In all the useful +arts the world is either standing still or going backwards. The fields are +cultivated with horse-ploughs while books are written by machinery. But +in matters of vital importance--meaning, in effect, war and police +espionage--the empirical approach is still encouraged, or at least +tolerated. The two aims of the Party are to conquer the whole surface of +the earth and to extinguish once and for all the possibility of independent +thought. There are therefore two great problems which the Party is +concerned to solve. One is how to discover, against his will, what another +human being is thinking, and the other is how to kill several hundred +million people in a few seconds without giving warning beforehand. In +so far as scientific research still continues, this is its subject matter. +The scientist of today is either a mixture of psychologist and inquisitor, +studying with real ordinary minuteness the meaning of facial expressions, +gestures, and tones of voice, and testing the truth-producing effects of +drugs, shock therapy, hypnosis, and physical torture; or he is chemist, +physicist, or biologist concerned only with such branches of his special +subject as are relevant to the taking of life. In the vast laboratories +of the Ministry of Peace, and in the experimental stations hidden in the +Brazilian forests, or in the Australian desert, or on lost islands of +the Antarctic, the teams of experts are indefatigably at work. Some are +concerned simply with planning the logistics of future wars; others devise +larger and larger rocket bombs, more and more powerful explosives, and more +and more impenetrable armour-plating; others search for new and deadlier +gases, or for soluble poisons capable of being produced in such quantities +as to destroy the vegetation of whole continents, or for breeds of disease +germs immunized against all possible antibodies; others strive to produce +a vehicle that shall bore its way under the soil like a submarine under +the water, or an aeroplane as independent of its base as a sailing-ship; +others explore even remoter possibilities such as focusing the sun's rays +through lenses suspended thousands of kilometres away in space, or +producing artificial earthquakes and tidal waves by tapping the heat at +the earth's centre. + +But none of these projects ever comes anywhere near realization, and none +of the three super-states ever gains a significant lead on the others. +What is more remarkable is that all three powers already possess, in the +atomic bomb, a weapon far more powerful than any that their present +researches are likely to discover. Although the Party, according to its +habit, claims the invention for itself, atomic bombs first appeared as +early as the nineteen-forties, and were first used on a large scale about +ten years later. At that time some hundreds of bombs were dropped on +industrial centres, chiefly in European Russia, Western Europe, and +North America. The effect was to convince the ruling groups of all +countries that a few more atomic bombs would mean the end of organized +society, and hence of their own power. Thereafter, although no formal +agreement was ever made or hinted at, no more bombs were dropped. All three +powers merely continue to produce atomic bombs and store them up against +the decisive opportunity which they all believe will come sooner or later. +And meanwhile the art of war has remained almost stationary for thirty or +forty years. Helicopters are more used than they were formerly, bombing +planes have been largely superseded by self-propelled projectiles, and the +fragile movable battleship has given way to the almost unsinkable Floating +Fortress; but otherwise there has been little development. The tank, the +submarine, the torpedo, the machine gun, even the rifle and the hand +grenade are still in use. And in spite of the endless slaughters reported +in the Press and on the telescreens, the desperate battles of earlier wars, +in which hundreds of thousands or even millions of men were often killed +in a few weeks, have never been repeated. + +None of the three super-states ever attempts any manoeuvre which involves +the risk of serious defeat. When any large operation is undertaken, it is +usually a surprise attack against an ally. The strategy that all three +powers are following, or pretend to themselves that they are following, +is the same. The plan is, by a combination of fighting, bargaining, and +well-timed strokes of treachery, to acquire a ring of bases completely +encircling one or other of the rival states, and then to sign a pact of +friendship with that rival and remain on peaceful terms for so many years +as to lull suspicion to sleep. During this time rockets loaded with atomic +bombs can be assembled at all the strategic spots; finally they will all +be fired simultaneously, with effects so devastating as to make retaliation +impossible. It will then be time to sign a pact of friendship with the +remaining world-power, in preparation for another attack. This scheme, it +is hardly necessary to say, is a mere daydream, impossible of realization. +Moreover, no fighting ever occurs except in the disputed areas round the +Equator and the Pole: no invasion of enemy territory is ever undertaken. +This explains the fact that in some places the frontiers between the +super-states are arbitrary. Eurasia, for example, could easily conquer the +British Isles, which are geographically part of Europe, or on the other +hand it would be possible for Oceania to push its frontiers to the Rhine +or even to the Vistula. But this would violate the principle, followed on +all sides though never formulated, of cultural integrity. If Oceania were +to conquer the areas that used once to be known as France and Germany, it +would be necessary either to exterminate the inhabitants, a task of great +physical difficulty, or to assimilate a population of about a hundred +million people, who, so far as technical development goes, are roughly on +the Oceanic level. The problem is the same for all three super-states. +It is absolutely necessary to their structure that there should be no +contact with foreigners, except, to a limited extent, with war prisoners +and coloured slaves. Even the official ally of the moment is always +regarded with the darkest suspicion. War prisoners apart, the average +citizen of Oceania never sets eyes on a citizen of either Eurasia or +Eastasia, and he is forbidden the knowledge of foreign languages. If he +were allowed contact with foreigners he would discover that they are +creatures similar to himself and that most of what he has been told about +them is lies. The sealed world in which he lives would be broken, and the +fear, hatred, and self-righteousness on which his morale depends might +evaporate. It is therefore realized on all sides that however often Persia, +or Egypt, or Java, or Ceylon may change hands, the main frontiers must +never be crossed by anything except bombs. + +Under this lies a fact never mentioned aloud, but tacitly understood and +acted upon: namely, that the conditions of life in all three super-states +are very much the same. In Oceania the prevailing philosophy is called +Ingsoc, in Eurasia it is called Neo-Bolshevism, and in Eastasia it is +called by a Chinese name usually translated as Death-Worship, but perhaps +better rendered as Obliteration of the Self. The citizen of Oceania is not +allowed to know anything of the tenets of the other two philosophies, but +he is taught to execrate them as barbarous outrages upon morality and +common sense. Actually the three philosophies are barely distinguishable, +and the social systems which they support are not distinguishable at all. +Everywhere there is the same pyramidal structure, the same worship of +semi-divine leader, the same economy existing by and for continuous +warfare. It follows that the three super-states not only cannot conquer +one another, but would gain no advantage by doing so. On the contrary, +so long as they remain in conflict they prop one another up, like three +sheaves of corn. And, as usual, the ruling groups of all three powers are +simultaneously aware and unaware of what they are doing. Their lives are +dedicated to world conquest, but they also know that it is necessary that +the war should continue everlastingly and without victory. Meanwhile the +fact that there IS no danger of conquest makes possible the denial of +reality which is the special feature of Ingsoc and its rival systems of +thought. Here it is necessary to repeat what has been said earlier, that +by becoming continuous war has fundamentally changed its character. + +In past ages, a war, almost by definition, was something that sooner or +later came to an end, usually in unmistakable victory or defeat. In the +past, also, war was one of the main instruments by which human societies +were kept in touch with physical reality. All rulers in all ages have tried +to impose a false view of the world upon their followers, but they could +not afford to encourage any illusion that tended to impair military +efficiency. So long as defeat meant the loss of independence, or some other +result generally held to be undesirable, the precautions against defeat +had to be serious. Physical facts could not be ignored. In philosophy, or +religion, or ethics, or politics, two and two might make five, but when +one was designing a gun or an aeroplane they had to make four. Inefficient +nations were always conquered sooner or later, and the struggle for +efficiency was inimical to illusions. Moreover, to be efficient it was +necessary to be able to learn from the past, which meant having a fairly +accurate idea of what had happened in the past. Newspapers and history +books were, of course, always coloured and biased, but falsification of +the kind that is practised today would have been impossible. War was a +sure safeguard of sanity, and so far as the ruling classes were concerned +it was probably the most important of all safeguards. While wars could be +won or lost, no ruling class could be completely irresponsible. + +But when war becomes literally continuous, it also ceases to be dangerous. +When war is continuous there is no such thing as military necessity. +Technical progress can cease and the most palpable facts can be denied or +disregarded. As we have seen, researches that could be called scientific +are still carried out for the purposes of war, but they are essentially a +kind of daydreaming, and their failure to show results is not important. +Efficiency, even military efficiency, is no longer needed. Nothing is +efficient in Oceania except the Thought Police. Since each of the three +super-states is unconquerable, each is in effect a separate universe within +which almost any perversion of thought can be safely practised. Reality +only exerts its pressure through the needs of everyday life--the need to +eat and drink, to get shelter and clothing, to avoid swallowing poison or +stepping out of top-storey windows, and the like. Between life and death, +and between physical pleasure and physical pain, there is still a +distinction, but that is all. Cut off from contact with the outer world, +and with the past, the citizen of Oceania is like a man in interstellar +space, who has no way of knowing which direction is up and which is down. +The rulers of such a state are absolute, as the Pharaohs or the Caesars +could not be. They are obliged to prevent their followers from starving +to death in numbers large enough to be inconvenient, and they are obliged +to remain at the same low level of military technique as their rivals; but +once that minimum is achieved, they can twist reality into whatever shape +they choose. + +The war, therefore, if we judge it by the standards of previous wars, is +merely an imposture. It is like the battles between certain ruminant +animals whose horns are set at such an angle that they are incapable of +hurting one another. But though it is unreal it is not meaningless. It +eats up the surplus of consumable goods, and it helps to preserve the +special mental atmosphere that a hierarchical society needs. War, it will +be seen, is now a purely internal affair. In the past, the ruling groups +of all countries, although they might recognize their common interest and +therefore limit the destructiveness of war, did fight against one another, +and the victor always plundered the vanquished. In our own day they are +not fighting against one another at all. The war is waged by each ruling +group against its own subjects, and the object of the war is not to make +or prevent conquests of territory, but to keep the structure of society +intact. The very word 'war', therefore, has become misleading. It would +probably be accurate to say that by becoming continuous war has ceased to +exist. The peculiar pressure that it exerted on human beings between the +Neolithic Age and the early twentieth century has disappeared and been +replaced by something quite different. The effect would be much the same +if the three super-states, instead of fighting one another, should agree +to live in perpetual peace, each inviolate within its own boundaries. For +in that case each would still be a self-contained universe, freed for ever +from the sobering influence of external danger. A peace that was truly +permanent would be the same as a permanent war. This--although the vast +majority of Party members understand it only in a shallower sense--is the +inner meaning of the Party slogan: WAR IS PEACE. + + +Winston stopped reading for a moment. Somewhere in remote distance a +rocket bomb thundered. The blissful feeling of being alone with the +forbidden book, in a room with no telescreen, had not worn off. Solitude +and safety were physical sensations, mixed up somehow with the tiredness +of his body, the softness of the chair, the touch of the faint breeze from +the window that played upon his cheek. The book fascinated him, or more +exactly it reassured him. In a sense it told him nothing that was new, but +that was part of the attraction. It said what he would have said, if it +had been possible for him to set his scattered thoughts in order. It was +the product of a mind similar to his own, but enormously more powerful, +more systematic, less fear-ridden. The best books, he perceived, are those +that tell you what you know already. He had just turned back to Chapter I +when he heard Julia's footstep on the stair and started out of his chair +to meet her. She dumped her brown tool-bag on the floor and flung herself +into his arms. It was more than a week since they had seen one another. + +'I've got THE BOOK,' he said as they disentangled themselves. + +'Oh, you've got it? Good,' she said without much interest, and almost +immediately knelt down beside the oil stove to make the coffee. + +They did not return to the subject until they had been in bed for half an +hour. The evening was just cool enough to make it worth while to pull up +the counterpane. From below came the familiar sound of singing and the +scrape of boots on the flagstones. The brawny red-armed woman whom Winston +had seen there on his first visit was almost a fixture in the yard. There +seemed to be no hour of daylight when she was not marching to and fro +between the washtub and the line, alternately gagging herself with clothes +pegs and breaking forth into lusty song. Julia had settled down on her +side and seemed to be already on the point of falling asleep. He reached +out for the book, which was lying on the floor, and sat up against the +bedhead. + +'We must read it,' he said. 'You too. All members of the Brotherhood have +to read it.' + +'You read it,' she said with her eyes shut. 'Read it aloud. That's the +best way. Then you can explain it to me as you go.' + +The clock's hands said six, meaning eighteen. They had three or four hours +ahead of them. He propped the book against his knees and began reading: + + +Chapter I +Ignorance is Strength + +Throughout recorded time, and probably since the end of the Neolithic Age, +there have been three kinds of people in the world, the High, the Middle, +and the Low. They have been subdivided in many ways, they have borne +countless different names, and their relative numbers, as well as their +attitude towards one another, have varied from age to age: but the +essential structure of society has never altered. Even after enormous +upheavals and seemingly irrevocable changes, the same pattern has always +reasserted itself, just as a gyroscope will always return to equilibrium, +however far it is pushed one way or the other + + +'Julia, are you awake?' said Winston. + +'Yes, my love, I'm listening. Go on. It's marvellous.' + +He continued reading: + + +The aims of these three groups are entirely irreconcilable. The aim of +the High is to remain where they are. The aim of the Middle is to change +places with the High. The aim of the Low, when they have an aim--for it +is an abiding characteristic of the Low that they are too much crushed +by drudgery to be more than intermittently conscious of anything outside +their daily lives--is to abolish all distinctions and create a society in +which all men shall be equal. Thus throughout history a struggle which is +the same in its main outlines recurs over and over again. For long periods +the High seem to be securely in power, but sooner or later there always +comes a moment when they lose either their belief in themselves or their +capacity to govern efficiently, or both. They are then overthrown by the +Middle, who enlist the Low on their side by pretending to them that they +are fighting for liberty and justice. As soon as they have reached their +objective, the Middle thrust the Low back into their old position of +servitude, and themselves become the High. Presently a new Middle group +splits off from one of the other groups, or from both of them, and the +struggle begins over again. Of the three groups, only the Low are never +even temporarily successful in achieving their aims. It would be an +exaggeration to say that throughout history there has been no progress of +a material kind. Even today, in a period of decline, the average human +being is physically better off than he was a few centuries ago. But no +advance in wealth, no softening of manners, no reform or revolution has +ever brought human equality a millimetre nearer. From the point of view of +the Low, no historic change has ever meant much more than a change in the +name of their masters. + +By the late nineteenth century the recurrence of this pattern had become +obvious to many observers. There then rose schools of thinkers who +interpreted history as a cyclical process and claimed to show that +inequality was the unalterable law of human life. This doctrine, of course, +had always had its adherents, but in the manner in which it was now put +forward there was a significant change. In the past the need for a +hierarchical form of society had been the doctrine specifically of the +High. It had been preached by kings and aristocrats and by the priests, +lawyers, and the like who were parasitical upon them, and it had generally +been softened by promises of compensation in an imaginary world beyond the +grave. The Middle, so long as it was struggling for power, had always made +use of such terms as freedom, justice, and fraternity. Now, however, the +concept of human brotherhood began to be assailed by people who were not +yet in positions of command, but merely hoped to be so before long. In the +past the Middle had made revolutions under the banner of equality, and +then had established a fresh tyranny as soon as the old one was overthrown. +The new Middle groups in effect proclaimed their tyranny beforehand. +Socialism, a theory which appeared in the early nineteenth century and was +the last link in a chain of thought stretching back to the slave rebellions +of antiquity, was still deeply infected by the Utopianism of past ages. +But in each variant of Socialism that appeared from about 1900 onwards the +aim of establishing liberty and equality was more and more openly +abandoned. The new movements which appeared in the middle years of the +century, Ingsoc in Oceania, Neo-Bolshevism in Eurasia, Death-Worship, as +it is commonly called, in Eastasia, had the conscious aim of perpetuating +UNfreedom and INequality. These new movements, of course, grew out of the +old ones and tended to keep their names and pay lip-service to their +ideology. But the purpose of all of them was to arrest progress and freeze +history at a chosen moment. The familiar pendulum swing was to happen once +more, and then stop. As usual, the High were to be turned out by the +Middle, who would then become the High; but this time, by conscious +strategy, the High would be able to maintain their position permanently. + +The new doctrines arose partly because of the accumulation of historical +knowledge, and the growth of the historical sense, which had hardly existed +before the nineteenth century. The cyclical movement of history was now +intelligible, or appeared to be so; and if it was intelligible, then it +was alterable. But the principal, underlying cause was that, as early +as the beginning of the twentieth century, human equality had become +technically possible. It was still true that men were not equal in their +native talents and that functions had to be specialized in ways that +favoured some individuals against others; but there was no longer any real +need for class distinctions or for large differences of wealth. In earlier +ages, class distinctions had been not only inevitable but desirable. +Inequality was the price of civilization. With the development of machine +production, however, the case was altered. Even if it was still necessary +for human beings to do different kinds of work, it was no longer necessary +for them to live at different social or economic levels. Therefore, from +the point of view of the new groups who were on the point of seizing power, +human equality was no longer an ideal to be striven after, but a danger to +be averted. In more primitive ages, when a just and peaceful society was +in fact not possible, it had been fairly easy to believe it. The idea of +an earthly paradise in which men should live together in a state of +brotherhood, without laws and without brute labour, had haunted the human +imagination for thousands of years. And this vision had had a certain hold +even on the groups who actually profited by each historical change. The +heirs of the French, English, and American revolutions had partly believed +in their own phrases about the rights of man, freedom of speech, equality +before the law, and the like, and have even allowed their conduct to be +influenced by them to some extent. But by the fourth decade of the +twentieth century all the main currents of political thought were +authoritarian. The earthly paradise had been discredited at exactly the +moment when it became realizable. Every new political theory, by whatever +name it called itself, led back to hierarchy and regimentation. And in the +general hardening of outlook that set in round about 1930, practices which +had been long abandoned, in some cases for hundreds of years--imprisonment +without trial, the use of war prisoners as slaves, public executions, +torture to extract confessions, the use of hostages, and the deportation +of whole populations--not only became common again, but were tolerated +and even defended by people who considered themselves enlightened and +progressive. + +It was only after a decade of national wars, civil wars, revolutions, and +counter-revolutions in all parts of the world that Ingsoc and its rivals +emerged as fully worked-out political theories. But they had been +foreshadowed by the various systems, generally called totalitarian, which +had appeared earlier in the century, and the main outlines of the world +which would emerge from the prevailing chaos had long been obvious. What +kind of people would control this world had been equally obvious. The new +aristocracy was made up for the most part of bureaucrats, scientists, +technicians, trade-union organizers, publicity experts, sociologists, +teachers, journalists, and professional politicians. These people, whose +origins lay in the salaried middle class and the upper grades of the +working class, had been shaped and brought together by the barren world of +monopoly industry and centralized government. As compared with their +opposite numbers in past ages, they were less avaricious, less tempted by +luxury, hungrier for pure power, and, above all, more conscious of what +they were doing and more intent on crushing opposition. This last +difference was cardinal. By comparison with that existing today, all the +tyrannies of the past were half-hearted and inefficient. The ruling groups +were always infected to some extent by liberal ideas, and were content to +leave loose ends everywhere, to regard only the overt act and to be +uninterested in what their subjects were thinking. Even the Catholic Church +of the Middle Ages was tolerant by modern standards. Part of the reason +for this was that in the past no government had the power to keep its +citizens under constant surveillance. The invention of print, however, +made it easier to manipulate public opinion, and the film and the radio +carried the process further. With the development of television, and +the technical advance which made it possible to receive and transmit +simultaneously on the same instrument, private life came to an end. Every +citizen, or at least every citizen important enough to be worth watching, +could be kept for twenty-four hours a day under the eyes of the police +and in the sound of official propaganda, with all other channels of +communication closed. The possibility of enforcing not only complete +obedience to the will of the State, but complete uniformity of opinion +on all subjects, now existed for the first time. + +After the revolutionary period of the fifties and sixties, society +regrouped itself, as always, into High, Middle, and Low. But the new High +group, unlike all its forerunners, did not act upon instinct but knew what +was needed to safeguard its position. It had long been realized that the +only secure basis for oligarchy is collectivism. Wealth and privilege +are most easily defended when they are possessed jointly. The so-called +'abolition of private property' which took place in the middle years of +the century meant, in effect, the concentration of property in far fewer +hands than before: but with this difference, that the new owners were a +group instead of a mass of individuals. Individually, no member of the +Party owns anything, except petty personal belongings. Collectively, the +Party owns everything in Oceania, because it controls everything, and +disposes of the products as it thinks fit. In the years following the +Revolution it was able to step into this commanding position almost +unopposed, because the whole process was represented as an act of +collectivization. It had always been assumed that if the capitalist class +were expropriated, Socialism must follow: and unquestionably the +capitalists had been expropriated. Factories, mines, land, houses, +transport--everything had been taken away from them: and since these +things were no longer private property, it followed that they must be +public property. Ingsoc, which grew out of the earlier Socialist movement +and inherited its phraseology, has in fact carried out the main item in +the Socialist programme; with the result, foreseen and intended beforehand, +that economic inequality has been made permanent. + +But the problems of perpetuating a hierarchical society go deeper than +this. There are only four ways in which a ruling group can fall from power. +Either it is conquered from without, or it governs so inefficiently that +the masses are stirred to revolt, or it allows a strong and discontented +Middle group to come into being, or it loses its own self-confidence and +willingness to govern. These causes do not operate singly, and as a rule +all four of them are present in some degree. A ruling class which could +guard against all of them would remain in power permanently. Ultimately +the determining factor is the mental attitude of the ruling class itself. + +After the middle of the present century, the first danger had in reality +disappeared. Each of the three powers which now divide the world is in +fact unconquerable, and could only become conquerable through slow +demographic changes which a government with wide powers can easily avert. +The second danger, also, is only a theoretical one. The masses never +revolt of their own accord, and they never revolt merely because they are +oppressed. Indeed, so long as they are not permitted to have standards of +comparison, they never even become aware that they are oppressed. The +recurrent economic crises of past times were totally unnecessary and are +not now permitted to happen, but other and equally large dislocations +can and do happen without having political results, because there is no +way in which discontent can become articulate. As for the problem of +over-production, which has been latent in our society since the development +of machine technique, it is solved by the device of continuous warfare +(see Chapter III), which is also useful in keying up public morale to the +necessary pitch. From the point of view of our present rulers, therefore, +the only genuine dangers are the splitting-off of a new group of able, +under-employed, power-hungry people, and the growth of liberalism and +scepticism in their own ranks. The problem, that is to say, is educational. +It is a problem of continuously moulding the consciousness both of the +directing group and of the larger executive group that lies immediately +below it. The consciousness of the masses needs only to be influenced in +a negative way. + +Given this background, one could infer, if one did not know it already, +the general structure of Oceanic society. At the apex of the pyramid comes +Big Brother. Big Brother is infallible and all-powerful. Every success, +every achievement, every victory, every scientific discovery, all +knowledge, all wisdom, all happiness, all virtue, are held to issue +directly from his leadership and inspiration. Nobody has ever seen Big +Brother. He is a face on the hoardings, a voice on the telescreen. We +may be reasonably sure that he will never die, and there is already +considerable uncertainty as to when he was born. Big Brother is the guise +in which the Party chooses to exhibit itself to the world. His function is +to act as a focusing point for love, fear, and reverence, emotions which +are more easily felt towards an individual than towards an organization. +Below Big Brother comes the Inner Party. Its numbers limited to six +millions, or something less than 2 per cent of the population of Oceania. +Below the Inner Party comes the Outer Party, which, if the Inner Party is +described as the brain of the State, may be justly likened to the hands. +Below that come the dumb masses whom we habitually refer to as 'the +proles', numbering perhaps 85 per cent of the population. In the terms +of our earlier classification, the proles are the Low: for the slave +population of the equatorial lands who pass constantly from conqueror +to conqueror, are not a permanent or necessary part of the structure. + +In principle, membership of these three groups is not hereditary. The +child of Inner Party parents is in theory not born into the Inner Party. +Admission to either branch of the Party is by examination, taken at the +age of sixteen. Nor is there any racial discrimination, or any marked +domination of one province by another. Jews, Negroes, South Americans of +pure Indian blood are to be found in the highest ranks of the Party, and +the administrators of any area are always drawn from the inhabitants of +that area. In no part of Oceania do the inhabitants have the feeling that +they are a colonial population ruled from a distant capital. Oceania has +no capital, and its titular head is a person whose whereabouts nobody +knows. Except that English is its chief LINGUA FRANCA and Newspeak its +official language, it is not centralized in any way. Its rulers are not +held together by blood-ties but by adherence to a common doctrine. It is +true that our society is stratified, and very rigidly stratified, on what +at first sight appear to be hereditary lines. There is far less to-and-fro +movement between the different groups than happened under capitalism or +even in the pre-industrial age. Between the two branches of the Party +there is a certain amount of interchange, but only so much as will ensure +that weaklings are excluded from the Inner Party and that ambitious +members of the Outer Party are made harmless by allowing them to rise. +Proletarians, in practice, are not allowed to graduate into the Party. The +most gifted among them, who might possibly become nuclei of discontent, +are simply marked down by the Thought Police and eliminated. But this +state of affairs is not necessarily permanent, nor is it a matter of +principle. The Party is not a class in the old sense of the word. It does +not aim at transmitting power to its own children, as such; and if there +were no other way of keeping the ablest people at the top, it would be +perfectly prepared to recruit an entire new generation from the ranks of +the proletariat. In the crucial years, the fact that the Party was not a +hereditary body did a great deal to neutralize opposition. The older kind +of Socialist, who had been trained to fight against something called +'class privilege' assumed that what is not hereditary cannot be permanent. +He did not see that the continuity of an oligarchy need not be physical, +nor did he pause to reflect that hereditary aristocracies have always been +shortlived, whereas adoptive organizations such as the Catholic Church +have sometimes lasted for hundreds or thousands of years. The essence of +oligarchical rule is not father-to-son inheritance, but the persistence of +a certain world-view and a certain way of life, imposed by the dead upon +the living. A ruling group is a ruling group so long as it can nominate +its successors. The Party is not concerned with perpetuating its blood but +with perpetuating itself. WHO wields power is not important, provided that +the hierarchical structure remains always the same. + +All the beliefs, habits, tastes, emotions, mental attitudes that +characterize our time are really designed to sustain the mystique of +the Party and prevent the true nature of present-day society from being +perceived. Physical rebellion, or any preliminary move towards rebellion, +is at present not possible. From the proletarians nothing is to be feared. +Left to themselves, they will continue from generation to generation and +from century to century, working, breeding, and dying, not only without +any impulse to rebel, but without the power of grasping that the world +could be other than it is. They could only become dangerous if the advance +of industrial technique made it necessary to educate them more highly; +but, since military and commercial rivalry are no longer important, the +level of popular education is actually declining. What opinions the masses +hold, or do not hold, is looked on as a matter of indifference. They can +be granted intellectual liberty because they have no intellect. In a Party +member, on the other hand, not even the smallest deviation of opinion on +the most unimportant subject can be tolerated. + +A Party member lives from birth to death under the eye of the Thought +Police. Even when he is alone he can never be sure that he is alone. +Wherever he may be, asleep or awake, working or resting, in his bath or in +bed, he can be inspected without warning and without knowing that he is +being inspected. Nothing that he does is indifferent. His friendships, his +relaxations, his behaviour towards his wife and children, the expression +of his face when he is alone, the words he mutters in sleep, even the +characteristic movements of his body, are all jealously scrutinized. Not +only any actual misdemeanour, but any eccentricity, however small, any +change of habits, any nervous mannerism that could possibly be the symptom +of an inner struggle, is certain to be detected. He has no freedom of +choice in any direction whatever. On the other hand his actions are not +regulated by law or by any clearly formulated code of behaviour. In Oceania +there is no law. Thoughts and actions which, when detected, mean certain +death are not formally forbidden, and the endless purges, arrests, +tortures, imprisonments, and vaporizations are not inflicted as punishment +for crimes which have actually been committed, but are merely the +wiping-out of persons who might perhaps commit a crime at some time in the +future. A Party member is required to have not only the right opinions, +but the right instincts. Many of the beliefs and attitudes demanded of him +are never plainly stated, and could not be stated without laying bare the +contradictions inherent in Ingsoc. If he is a person naturally orthodox +(in Newspeak a GOODTHINKER), he will in all circumstances know, without +taking thought, what is the true belief or the desirable emotion. But in +any case an elaborate mental training, undergone in childhood and grouping +itself round the Newspeak words CRIMESTOP, BLACKWHITE, and DOUBLETHINK, +makes him unwilling and unable to think too deeply on any subject whatever. + +A Party member is expected to have no private emotions and no respites +from enthusiasm. He is supposed to live in a continuous frenzy of hatred +of foreign enemies and internal traitors, triumph over victories, and +self-abasement before the power and wisdom of the Party. The discontents +produced by his bare, unsatisfying life are deliberately turned outwards +and dissipated by such devices as the Two Minutes Hate, and the +speculations which might possibly induce a sceptical or rebellious attitude +are killed in advance by his early acquired inner discipline. The first +and simplest stage in the discipline, which can be taught even to young +children, is called, in Newspeak, CRIMESTOP. CRIMESTOP means the faculty +of stopping short, as though by instinct, at the threshold of any dangerous +thought. It includes the power of not grasping analogies, of failing to +perceive logical errors, of misunderstanding the simplest arguments if +they are inimical to Ingsoc, and of being bored or repelled by any train +of thought which is capable of leading in a heretical direction. CRIMESTOP, +in short, means protective stupidity. But stupidity is not enough. On the +contrary, orthodoxy in the full sense demands a control over one's own +mental processes as complete as that of a contortionist over his body. +Oceanic society rests ultimately on the belief that Big Brother is +omnipotent and that the Party is infallible. But since in reality Big +Brother is not omnipotent and the party is not infallible, there is need +for an unwearying, moment-to-moment flexibility in the treatment of facts. +The keyword here is BLACKWHITE. Like so many Newspeak words, this word has +two mutually contradictory meanings. Applied to an opponent, it means the +habit of impudently claiming that black is white, in contradiction of the +plain facts. Applied to a Party member, it means a loyal willingness to +say that black is white when Party discipline demands this. But it means +also the ability to BELIEVE that black is white, and more, to KNOW that +black is white, and to forget that one has ever believed the contrary. +This demands a continuous alteration of the past, made possible by the +system of thought which really embraces all the rest, and which is known +in Newspeak as DOUBLETHINK. + +The alteration of the past is necessary for two reasons, one of which is +subsidiary and, so to speak, precautionary. The subsidiary reason is that +the Party member, like the proletarian, tolerates present-day conditions +partly because he has no standards of comparison. He must be cut off from +the past, just as he must be cut off from foreign countries, because it is +necessary for him to believe that he is better off than his ancestors and +that the average level of material comfort is constantly rising. But by +far the more important reason for the readjustment of the past is the +need to safeguard the infallibility of the Party. It is not merely that +speeches, statistics, and records of every kind must be constantly brought +up to date in order to show that the predictions of the Party were in +all cases right. It is also that no change in doctrine or in political +alignment can ever be admitted. For to change one's mind, or even one's +policy, is a confession of weakness. If, for example, Eurasia or Eastasia +(whichever it may be) is the enemy today, then that country must always +have been the enemy. And if the facts say otherwise then the facts must +be altered. Thus history is continuously rewritten. This day-to-day +falsification of the past, carried out by the Ministry of Truth, is as +necessary to the stability of the regime as the work of repression and +espionage carried out by the Ministry of Love. + +The mutability of the past is the central tenet of Ingsoc. Past events, +it is argued, have no objective existence, but survive only in written +records and in human memories. The past is whatever the records and the +memories agree upon. And since the Party is in full control of all records +and in equally full control of the minds of its members, it follows that +the past is whatever the Party chooses to make it. It also follows that +though the past is alterable, it never has been altered in any specific +instance. For when it has been recreated in whatever shape is needed at +the moment, then this new version IS the past, and no different past can +ever have existed. This holds good even when, as often happens, the same +event has to be altered out of recognition several times in the course of +a year. At all times the Party is in possession of absolute truth, and +clearly the absolute can never have been different from what it is now. +It will be seen that the control of the past depends above all on the +training of memory. To make sure that all written records agree with +the orthodoxy of the moment is merely a mechanical act. But it is also +necessary to REMEMBER that events happened in the desired manner. And if +it is necessary to rearrange one's memories or to tamper with written +records, then it is necessary to FORGET that one has done so. The trick of +doing this can be learned like any other mental technique. It is learned +by the majority of Party members, and certainly by all who are intelligent +as well as orthodox. In Oldspeak it is called, quite frankly, 'reality +control'. In Newspeak it is called DOUBLETHINK, though DOUBLETHINK +comprises much else as well. + +DOUBLETHINK means the power of holding two contradictory beliefs in one's +mind simultaneously, and accepting both of them. The Party intellectual +knows in which direction his memories must be altered; he therefore knows +that he is playing tricks with reality; but by the exercise of DOUBLETHINK +he also satisfies himself that reality is not violated. The process has to +be conscious, or it would not be carried out with sufficient precision, +but it also has to be unconscious, or it would bring with it a feeling of +falsity and hence of guilt. DOUBLETHINK lies at the very heart of Ingsoc, +since the essential act of the Party is to use conscious deception while +retaining the firmness of purpose that goes with complete honesty. To tell +deliberate lies while genuinely believing in them, to forget any fact that +has become inconvenient, and then, when it becomes necessary again, to +draw it back from oblivion for just so long as it is needed, to deny the +existence of objective reality and all the while to take account of the +reality which one denies--all this is indispensably necessary. Even in +using the word DOUBLETHINK it is necessary to exercise DOUBLETHINK. For +by using the word one admits that one is tampering with reality; by a +fresh act of DOUBLETHINK one erases this knowledge; and so on indefinitely, +with the lie always one leap ahead of the truth. Ultimately it is by means +of DOUBLETHINK that the Party has been able--and may, for all we know, +continue to be able for thousands of years--to arrest the course of +history. + +All past oligarchies have fallen from power either because they ossified +or because they grew soft. Either they became stupid and arrogant, failed +to adjust themselves to changing circumstances, and were overthrown; or +they became liberal and cowardly, made concessions when they should have +used force, and once again were overthrown. They fell, that is to say, +either through consciousness or through unconsciousness. It is the +achievement of the Party to have produced a system of thought in which +both conditions can exist simultaneously. And upon no other intellectual +basis could the dominion of the Party be made permanent. If one is to rule, +and to continue ruling, one must be able to dislocate the sense of reality. +For the secret of rulership is to combine a belief in one's own +infallibility with the Power to learn from past mistakes. + +It need hardly be said that the subtlest practitioners of DOUBLETHINK are +those who invented DOUBLETHINK and know that it is a vast system of mental +cheating. In our society, those who have the best knowledge of what is +happening are also those who are furthest from seeing the world as it is. +In general, the greater the understanding, the greater the delusion; the +more intelligent, the less sane. One clear illustration of this is the +fact that war hysteria increases in intensity as one rises in the social +scale. Those whose attitude towards the war is most nearly rational are +the subject peoples of the disputed territories. To these people the war +is simply a continuous calamity which sweeps to and fro over their bodies +like a tidal wave. Which side is winning is a matter of complete +indifference to them. They are aware that a change of overlordship means +simply that they will be doing the same work as before for new masters who +treat them in the same manner as the old ones. The slightly more favoured +workers whom we call 'the proles' are only intermittently conscious of the +war. When it is necessary they can be prodded into frenzies of fear and +hatred, but when left to themselves they are capable of forgetting for +long periods that the war is happening. It is in the ranks of the Party, +and above all of the Inner Party, that the true war enthusiasm is found. +World-conquest is believed in most firmly by those who know it to be +impossible. This peculiar linking-together of opposites--knowledge with +ignorance, cynicism with fanaticism--is one of the chief distinguishing +marks of Oceanic society. The official ideology abounds with contradictions +even when there is no practical reason for them. Thus, the Party rejects +and vilifies every principle for which the Socialist movement originally +stood, and it chooses to do this in the name of Socialism. It preaches +a contempt for the working class unexampled for centuries past, and it +dresses its members in a uniform which was at one time peculiar to manual +workers and was adopted for that reason. It systematically undermines the +solidarity of the family, and it calls its leader by a name which is a +direct appeal to the sentiment of family loyalty. Even the names of the +four Ministries by which we are governed exhibit a sort of impudence in +their deliberate reversal of the facts. The Ministry of Peace concerns +itself with war, the Ministry of Truth with lies, the Ministry of Love +with torture and the Ministry of Plenty with starvation. These +contradictions are not accidental, nor do they result from ordinary +hypocrisy; they are deliberate exercises in DOUBLETHINK. For it is only +by reconciling contradictions that power can be retained indefinitely. +In no other way could the ancient cycle be broken. If human equality is +to be for ever averted--if the High, as we have called them, are to keep +their places permanently--then the prevailing mental condition must be +controlled insanity. + +But there is one question which until this moment we have almost ignored. +It is; WHY should human equality be averted? Supposing that the mechanics +of the process have been rightly described, what is the motive for this +huge, accurately planned effort to freeze history at a particular moment +of time? + +Here we reach the central secret. As we have seen. the mystique of the +Party, and above all of the Inner Party, depends upon DOUBLETHINK But +deeper than this lies the original motive, the never-questioned instinct +that first led to the seizure of power and brought DOUBLETHINK, the +Thought Police, continuous warfare, and all the other necessary +paraphernalia into existence afterwards. This motive really consists... + + +Winston became aware of silence, as one becomes aware of a new sound. It +seemed to him that Julia had been very still for some time past. She was +lying on her side, naked from the waist upwards, with her cheek pillowed +on her hand and one dark lock tumbling across her eyes. Her breast rose +and fell slowly and regularly. + +'Julia.' + +No answer. + +'Julia, are you awake?' + +No answer. She was asleep. He shut the book, put it carefully on the floor, +lay down, and pulled the coverlet over both of them. + +He had still, he reflected, not learned the ultimate secret. He understood +HOW; he did not understand WHY. Chapter I, like Chapter III, had not +actually told him anything that he did not know, it had merely systematized +the knowledge that he possessed already. But after reading it he knew +better than before that he was not mad. Being in a minority, even a +minority of one, did not make you mad. There was truth and there was +untruth, and if you clung to the truth even against the whole world, you +were not mad. A yellow beam from the sinking sun slanted in through the +window and fell across the pillow. He shut his eyes. The sun on his face +and the girl's smooth body touching his own gave him a strong, sleepy, +confident feeling. He was safe, everything was all right. He fell asleep +murmuring 'Sanity is not statistical,' with the feeling that this remark +contained in it a profound wisdom. + +***** + +When he woke it was with the sensation of having slept for a long time, +but a glance at the old-fashioned clock told him that it was only +twenty-thirty. He lay dozing for a while; then the usual deep-lunged +singing struck up from the yard below: + + + 'It was only an 'opeless fancy, + It passed like an Ipril dye, + But a look an' a word an' the dreams they stirred + They 'ave stolen my 'eart awye!' + + +The drivelling song seemed to have kept its popularity. You still heard it +all over the place. It had outlived the Hate Song. Julia woke at the +sound, stretched herself luxuriously, and got out of bed. + +'I'm hungry,' she said. 'Let's make some more coffee. Damn! The stove's +gone out and the water's cold.' She picked the stove up and shook it. +'There's no oil in it.' + +'We can get some from old Charrington, I expect.' + +'The funny thing is I made sure it was full. I'm going to put my clothes +on,' she added. 'It seems to have got colder.' + +Winston also got up and dressed himself. The indefatigable voice sang on: + + + 'They sye that time 'eals all things, + They sye you can always forget; + But the smiles an' the tears acrorss the years + They twist my 'eart-strings yet!' + + +As he fastened the belt of his overalls he strolled across to the window. +The sun must have gone down behind the houses; it was not shining into the +yard any longer. The flagstones were wet as though they had just been +washed, and he had the feeling that the sky had been washed too, so fresh +and pale was the blue between the chimney-pots. Tirelessly the woman +marched to and fro, corking and uncorking herself, singing and falling +silent, and pegging out more diapers, and more and yet more. He wondered +whether she took in washing for a living or was merely the slave of twenty +or thirty grandchildren. Julia had come across to his side; together they +gazed down with a sort of fascination at the sturdy figure below. As he +looked at the woman in her characteristic attitude, her thick arms reaching +up for the line, her powerful mare-like buttocks protruded, it struck him +for the first time that she was beautiful. It had never before occurred to +him that the body of a woman of fifty, blown up to monstrous dimensions by +childbearing, then hardened, roughened by work till it was coarse in the +grain like an over-ripe turnip, could be beautiful. But it was so, and +after all, he thought, why not? The solid, contourless body, like a block +of granite, and the rasping red skin, bore the same relation to the body +of a girl as the rose-hip to the rose. Why should the fruit be held +inferior to the flower? + +'She's beautiful,' he murmured. + +'She's a metre across the hips, easily,' said Julia. + +'That is her style of beauty,' said Winston. + +He held Julia's supple waist easily encircled by his arm. From the hip to +the knee her flank was against his. Out of their bodies no child would +ever come. That was the one thing they could never do. Only by word of +mouth, from mind to mind, could they pass on the secret. The woman down +there had no mind, she had only strong arms, a warm heart, and a fertile +belly. He wondered how many children she had given birth to. It might +easily be fifteen. She had had her momentary flowering, a year, perhaps, +of wild-rose beauty and then she had suddenly swollen like a fertilized +fruit and grown hard and red and coarse, and then her life had been +laundering, scrubbing, darning, cooking, sweeping, polishing, mending, +scrubbing, laundering, first for children, then for grandchildren, over +thirty unbroken years. At the end of it she was still singing. The mystical +reverence that he felt for her was somehow mixed up with the aspect of +the pale, cloudless sky, stretching away behind the chimney-pots into +interminable distance. It was curious to think that the sky was the same +for everybody, in Eurasia or Eastasia as well as here. And the people +under the sky were also very much the same--everywhere, all over the world, +hundreds of thousands of millions of people just like this, people ignorant +of one another's existence, held apart by walls of hatred and lies, and +yet almost exactly the same--people who had never learned to think but who +were storing up in their hearts and bellies and muscles the power that +would one day overturn the world. If there was hope, it lay in the proles! +Without having read to the end of THE BOOK, he knew that that must be +Goldstein's final message. The future belonged to the proles. And could he +be sure that when their time came the world they constructed would not be +just as alien to him, Winston Smith, as the world of the Party? Yes, +because at the least it would be a world of sanity. Where there is +equality there can be sanity. Sooner or later it would happen, strength +would change into consciousness. The proles were immortal, you could not +doubt it when you looked at that valiant figure in the yard. In the end +their awakening would come. And until that happened, though it might be a +thousand years, they would stay alive against all the odds, like birds, +passing on from body to body the vitality which the Party did not share +and could not kill. + +'Do you remember,' he said, 'the thrush that sang to us, that first day, +at the edge of the wood?' + +'He wasn't singing to us,' said Julia. 'He was singing to please himself. +Not even that. He was just singing.' + +The birds sang, the proles sang. the Party did not sing. All round the +world, in London and New York, in Africa and Brazil, and in the mysterious, +forbidden lands beyond the frontiers, in the streets of Paris and Berlin, +in the villages of the endless Russian plain, in the bazaars of China and +Japan--everywhere stood the same solid unconquerable figure, made monstrous +by work and childbearing, toiling from birth to death and still singing. +Out of those mighty loins a race of conscious beings must one day come. +You were the dead, theirs was the future. But you could share in that +future if you kept alive the mind as they kept alive the body, and passed +on the secret doctrine that two plus two make four. + +'We are the dead,' he said. + +'We are the dead,' echoed Julia dutifully. + +'You are the dead,' said an iron voice behind them. + +They sprang apart. Winston's entrails seemed to have turned into ice. He +could see the white all round the irises of Julia's eyes. Her face had +turned a milky yellow. The smear of rouge that was still on each cheekbone +stood out sharply, almost as though unconnected with the skin beneath. + +'You are the dead,' repeated the iron voice. + +'It was behind the picture,' breathed Julia. + +'It was behind the picture,' said the voice. 'Remain exactly where you +are. Make no movement until you are ordered.' + +It was starting, it was starting at last! They could do nothing except +stand gazing into one another's eyes. To run for life, to get out of the +house before it was too late--no such thought occurred to them. Unthinkable +to disobey the iron voice from the wall. There was a snap as though a catch +had been turned back, and a crash of breaking glass. The picture had fallen +to the floor uncovering the telescreen behind it. + +'Now they can see us,' said Julia. + +'Now we can see you,' said the voice. 'Stand out in the middle of the +room. Stand back to back. Clasp your hands behind your heads. Do not touch +one another.' + +They were not touching, but it seemed to him that he could feel Julia's +body shaking. Or perhaps it was merely the shaking of his own. He could +just stop his teeth from chattering, but his knees were beyond his control. +There was a sound of trampling boots below, inside the house and outside. +The yard seemed to be full of men. Something was being dragged across the +stones. The woman's singing had stopped abruptly. There was a long, rolling +clang, as though the washtub had been flung across the yard, and then a +confusion of angry shouts which ended in a yell of pain. + +'The house is surrounded,' said Winston. + +'The house is surrounded,' said the voice. + +He heard Julia snap her teeth together. 'I suppose we may as well say +good-bye,' she said. + +'You may as well say good-bye,' said the voice. And then another quite +different voice, a thin, cultivated voice which Winston had the impression +of having heard before, struck in; 'And by the way, while we are on the +subject, "Here comes a candle to light you to bed, here comes a chopper to +chop off your head"!' + +Something crashed on to the bed behind Winston's back. The head of a ladder +had been thrust through the window and had burst in the frame. Someone was +climbing through the window. There was a stampede of boots up the stairs. +The room was full of solid men in black uniforms, with iron-shod boots on +their feet and truncheons in their hands. + +Winston was not trembling any longer. Even his eyes he barely moved. One +thing alone mattered; to keep still, to keep still and not give them an +excuse to hit you! A man with a smooth prize-fighter's jowl in which the +mouth was only a slit paused opposite him balancing his truncheon +meditatively between thumb and forefinger. Winston met his eyes. The +feeling of nakedness, with one's hands behind one's head and one's face +and body all exposed, was almost unbearable. The man protruded the tip +of a white tongue, licked the place where his lips should have been, and +then passed on. There was another crash. Someone had picked up the glass +paperweight from the table and smashed it to pieces on the hearth-stone. + +The fragment of coral, a tiny crinkle of pink like a sugar rosebud from +a cake, rolled across the mat. How small, thought Winston, how small it +always was! There was a gasp and a thump behind him, and he received a +violent kick on the ankle which nearly flung him off his balance. One of +the men had smashed his fist into Julia's solar plexus, doubling her up +like a pocket ruler. She was thrashing about on the floor, fighting for +breath. Winston dared not turn his head even by a millimetre, but sometimes +her livid, gasping face came within the angle of his vision. Even in his +terror it was as though he could feel the pain in his own body, the deadly +pain which nevertheless was less urgent than the struggle to get back her +breath. He knew what it was like; the terrible, agonizing pain which was +there all the while but could not be suffered yet, because before all else +it was necessary to be able to breathe. Then two of the men hoisted her +up by knees and shoulders, and carried her out of the room like a sack. +Winston had a glimpse of her face, upside down, yellow and contorted, with +the eyes shut, and still with a smear of rouge on either cheek; and that +was the last he saw of her. + +He stood dead still. No one had hit him yet. Thoughts which came of their +own accord but seemed totally uninteresting began to flit through his +mind. He wondered whether they had got Mr Charrington. He wondered what +they had done to the woman in the yard. He noticed that he badly wanted +to urinate, and felt a faint surprise, because he had done so only two or +three hours ago. He noticed that the clock on the mantelpiece said nine, +meaning twenty-one. But the light seemed too strong. Would not the light +be fading at twenty-one hours on an August evening? He wondered whether +after all he and Julia had mistaken the time--had slept the clock round +and thought it was twenty-thirty when really it was nought eight-thirty +on the following morning. But he did not pursue the thought further. +It was not interesting. + +There was another, lighter step in the passage. Mr Charrington came into +the room. The demeanour of the black-uniformed men suddenly became more +subdued. Something had also changed in Mr Charrington's appearance. His +eye fell on the fragments of the glass paperweight. + +'Pick up those pieces,' he said sharply. + +A man stooped to obey. The cockney accent had disappeared; Winston suddenly +realized whose voice it was that he had heard a few moments ago on the +telescreen. Mr Charrington was still wearing his old velvet jacket, but +his hair, which had been almost white, had turned black. Also he was not +wearing his spectacles. He gave Winston a single sharp glance, as though +verifying his identity, and then paid no more attention to him. He was +still recognizable, but he was not the same person any longer. His body +had straightened, and seemed to have grown bigger. His face had undergone +only tiny changes that had nevertheless worked a complete transformation. +The black eyebrows were less bushy, the wrinkles were gone, the whole +lines of the face seemed to have altered; even the nose seemed shorter. It +was the alert, cold face of a man of about five-and-thirty. It occurred to +Winston that for the first time in his life he was looking, with knowledge, +at a member of the Thought Police. + + + + + +PART THREE + + + + +Chapter 1 + + + +He did not know where he was. Presumably he was in the Ministry of Love, +but there was no way of making certain. He was in a high-ceilinged +windowless cell with walls of glittering white porcelain. Concealed lamps +flooded it with cold light, and there was a low, steady humming sound +which he supposed had something to do with the air supply. A bench, or +shelf, just wide enough to sit on ran round the wall, broken only by the +door and, at the end opposite the door, a lavatory pan with no wooden +seat. There were four telescreens, one in each wall. + +There was a dull aching in his belly. It had been there ever since they +had bundled him into the closed van and driven him away. But he was also +hungry, with a gnawing, unwholesome kind of hunger. It might be twenty-four +hours since he had eaten, it might be thirty-six. He still did not know, +probably never would know, whether it had been morning or evening when +they arrested him. Since he was arrested he had not been fed. + +He sat as still as he could on the narrow bench, with his hands crossed +on his knee. He had already learned to sit still. If you made unexpected +movements they yelled at you from the telescreen. But the craving for food +was growing upon him. What he longed for above all was a piece of bread. +He had an idea that there were a few breadcrumbs in the pocket of his +overalls. It was even possible--he thought this because from time to time +something seemed to tickle his leg--that there might be a sizeable bit of +crust there. In the end the temptation to find out overcame his fear; he +slipped a hand into his pocket. + +'Smith!' yelled a voice from the telescreen. '6079 Smith W.! Hands out of +pockets in the cells!' + +He sat still again, his hands crossed on his knee. Before being brought +here he had been taken to another place which must have been an ordinary +prison or a temporary lock-up used by the patrols. He did not know how +long he had been there; some hours at any rate; with no clocks and no +daylight it was hard to gauge the time. It was a noisy, evil-smelling +place. They had put him into a cell similar to the one he was now in, +but filthily dirty and at all times crowded by ten or fifteen people. The +majority of them were common criminals, but there were a few political +prisoners among them. He had sat silent against the wall, jostled by dirty +bodies, too preoccupied by fear and the pain in his belly to take much +interest in his surroundings, but still noticing the astonishing difference +in demeanour between the Party prisoners and the others. The Party +prisoners were always silent and terrified, but the ordinary criminals +seemed to care nothing for anybody. They yelled insults at the guards, +fought back fiercely when their belongings were impounded, wrote obscene +words on the floor, ate smuggled food which they produced from mysterious +hiding-places in their clothes, and even shouted down the telescreen when +it tried to restore order. On the other hand some of them seemed to be on +good terms with the guards, called them by nicknames, and tried to wheedle +cigarettes through the spyhole in the door. The guards, too, treated the +common criminals with a certain forbearance, even when they had to handle +them roughly. There was much talk about the forced-labour camps to which +most of the prisoners expected to be sent. It was 'all right' in the +camps, he gathered, so long as you had good contacts and knew the ropes. +There was bribery, favouritism, and racketeering of every kind, there was +homosexuality and prostitution, there was even illicit alcohol distilled +from potatoes. The positions of trust were given only to the common +criminals, especially the gangsters and the murderers, who formed a sort +of aristocracy. All the dirty jobs were done by the politicals. + +There was a constant come-and-go of prisoners of every description: +drug-peddlers, thieves, bandits, black-marketeers, drunks, prostitutes. +Some of the drunks were so violent that the other prisoners had to combine +to suppress them. An enormous wreck of a woman, aged about sixty, with +great tumbling breasts and thick coils of white hair which had come down +in her struggles, was carried in, kicking and shouting, by four guards, +who had hold of her one at each corner. They wrenched off the boots with +which she had been trying to kick them, and dumped her down across +Winston's lap, almost breaking his thigh-bones. The woman hoisted herself +upright and followed them out with a yell of 'F---- bastards!' Then, +noticing that she was sitting on something uneven, she slid off Winston's +knees on to the bench. + +'Beg pardon, dearie,' she said. 'I wouldn't 'a sat on you, only the buggers +put me there. They dono 'ow to treat a lady, do they?' She paused, patted +her breast, and belched. 'Pardon,' she said, 'I ain't meself, quite.' + +She leant forward and vomited copiously on the floor. + +'Thass better,' she said, leaning back with closed eyes. 'Never keep it +down, thass what I say. Get it up while it's fresh on your stomach, like.' + +She revived, turned to have another look at Winston and seemed immediately +to take a fancy to him. She put a vast arm round his shoulder and drew him +towards her, breathing beer and vomit into his face. + +'Wass your name, dearie?' she said. + +'Smith,' said Winston. + +'Smith?' said the woman. 'Thass funny. My name's Smith too. Why,' she +added sentimentally, 'I might be your mother!' + +She might, thought Winston, be his mother. She was about the right age and +physique, and it was probable that people changed somewhat after twenty +years in a forced-labour camp. + +No one else had spoken to him. To a surprising extent the ordinary +criminals ignored the Party prisoners. 'The polITS,' they called them, +with a sort of uninterested contempt. The Party prisoners seemed terrified +of speaking to anybody, and above all of speaking to one another. Only +once, when two Party members, both women, were pressed close together on +the bench, he overheard amid the din of voices a few hurriedly-whispered +words; and in particular a reference to something called 'room one-oh-one', +which he did not understand. + +It might be two or three hours ago that they had brought him here. The +dull pain in his belly never went away, but sometimes it grew better and +sometimes worse, and his thoughts expanded or contracted accordingly. When +it grew worse he thought only of the pain itself, and of his desire for +food. When it grew better, panic took hold of him. There were moments +when he foresaw the things that would happen to him with such actuality +that his heart galloped and his breath stopped. He felt the smash of +truncheons on his elbows and iron-shod boots on his shins; he saw himself +grovelling on the floor, screaming for mercy through broken teeth. He +hardly thought of Julia. He could not fix his mind on her. He loved her +and would not betray her; but that was only a fact, known as he knew the +rules of arithmetic. He felt no love for her, and he hardly even wondered +what was happening to her. He thought oftener of O'Brien, with a flickering +hope. O'Brien might know that he had been arrested. The Brotherhood, he +had said, never tried to save its members. But there was the razor blade; +they would send the razor blade if they could. There would be perhaps five +seconds before the guard could rush into the cell. The blade would bite +into him with a sort of burning coldness, and even the fingers that held +it would be cut to the bone. Everything came back to his sick body, which +shrank trembling from the smallest pain. He was not certain that he would +use the razor blade even if he got the chance. It was more natural to exist +from moment to moment, accepting another ten minutes' life even with the +certainty that there was torture at the end of it. + +Sometimes he tried to calculate the number of porcelain bricks in the +walls of the cell. It should have been easy, but he always lost count at +some point or another. More often he wondered where he was, and what time +of day it was. At one moment he felt certain that it was broad daylight +outside, and at the next equally certain that it was pitch darkness. In +this place, he knew instinctively, the lights would never be turned out. +It was the place with no darkness: he saw now why O'Brien had seemed to +recognize the allusion. In the Ministry of Love there were no windows. His +cell might be at the heart of the building or against its outer wall; it +might be ten floors below ground, or thirty above it. He moved himself +mentally from place to place, and tried to determine by the feeling of his +body whether he was perched high in the air or buried deep underground. + +There was a sound of marching boots outside. The steel door opened with +a clang. A young officer, a trim black-uniformed figure who seemed to +glitter all over with polished leather, and whose pale, straight-featured +face was like a wax mask, stepped smartly through the doorway. He motioned +to the guards outside to bring in the prisoner they were leading. The +poet Ampleforth shambled into the cell. The door clanged shut again. + +Ampleforth made one or two uncertain movements from side to side, as +though having some idea that there was another door to go out of, and then +began to wander up and down the cell. He had not yet noticed Winston's +presence. His troubled eyes were gazing at the wall about a metre above +the level of Winston's head. He was shoeless; large, dirty toes were +sticking out of the holes in his socks. He was also several days away +from a shave. A scrubby beard covered his face to the cheekbones, giving +him an air of ruffianism that went oddly with his large weak frame and +nervous movements. + +Winston roused himself a little from his lethargy. He must speak +to Ampleforth, and risk the yell from the telescreen. It was even +conceivable that Ampleforth was the bearer of the razor blade. + +'Ampleforth,' he said. + +There was no yell from the telescreen. Ampleforth paused, mildly startled. +His eyes focused themselves slowly on Winston. + +'Ah, Smith!' he said. 'You too!' + +'What are you in for?' + +'To tell you the truth--' He sat down awkwardly on the bench opposite +Winston. 'There is only one offence, is there not?' he said. + +'And have you committed it?' + +'Apparently I have.' + +He put a hand to his forehead and pressed his temples for a moment, as +though trying to remember something. + +'These things happen,' he began vaguely. 'I have been able to recall one +instance--a possible instance. It was an indiscretion, undoubtedly. We +were producing a definitive edition of the poems of Kipling. I allowed the +word "God" to remain at the end of a line. I could not help it!' he added +almost indignantly, raising his face to look at Winston. 'It was impossible +to change the line. The rhyme was "rod". Do you realize that there are only +twelve rhymes to "rod" in the entire language? For days I had racked my +brains. There WAS no other rhyme.' + +The expression on his face changed. The annoyance passed out of it and for +a moment he looked almost pleased. A sort of intellectual warmth, the joy +of the pedant who has found out some useless fact, shone through the dirt +and scrubby hair. + +'Has it ever occurred to you,' he said, 'that the whole history of English +poetry has been determined by the fact that the English language lacks +rhymes?' + +No, that particular thought had never occurred to Winston. Nor, in the +circumstances, did it strike him as very important or interesting. + +'Do you know what time of day it is?' he said. + +Ampleforth looked startled again. 'I had hardly thought about it. They +arrested me--it could be two days ago--perhaps three.' His eyes flitted +round the walls, as though he half expected to find a window somewhere. +'There is no difference between night and day in this place. I do not see +how one can calculate the time.' + +They talked desultorily for some minutes, then, without apparent reason, +a yell from the telescreen bade them be silent. Winston sat quietly, his +hands crossed. Ampleforth, too large to sit in comfort on the narrow +bench, fidgeted from side to side, clasping his lank hands first round one +knee, then round the other. The telescreen barked at him to keep still. +Time passed. Twenty minutes, an hour--it was difficult to judge. Once more +there was a sound of boots outside. Winston's entrails contracted. Soon, +very soon, perhaps in five minutes, perhaps now, the tramp of boots would +mean that his own turn had come. + +The door opened. The cold-faced young officer stepped into the cell. With +a brief movement of the hand he indicated Ampleforth. + +'Room 101,' he said. + +Ampleforth marched clumsily out between the guards, his face vaguely +perturbed, but uncomprehending. + +What seemed like a long time passed. The pain in Winston's belly had +revived. His mind sagged round and round on the same trick, like a ball +falling again and again into the same series of slots. He had only six +thoughts. The pain in his belly; a piece of bread; the blood and the +screaming; O'Brien; Julia; the razor blade. There was another spasm in his +entrails, the heavy boots were approaching. As the door opened, the wave +of air that it created brought in a powerful smell of cold sweat. Parsons +walked into the cell. He was wearing khaki shorts and a sports-shirt. + +This time Winston was startled into self-forgetfulness. + +'YOU here!' he said. + +Parsons gave Winston a glance in which there was neither interest nor +surprise, but only misery. He began walking jerkily up and down, evidently +unable to keep still. Each time he straightened his pudgy knees it was +apparent that they were trembling. His eyes had a wide-open, staring look, +as though he could not prevent himself from gazing at something in the +middle distance. + +'What are you in for?' said Winston. + +'Thoughtcrime!' said Parsons, almost blubbering. The tone of his voice +implied at once a complete admission of his guilt and a sort of incredulous +horror that such a word could be applied to himself. He paused opposite +Winston and began eagerly appealing to him: 'You don't think they'll shoot +me, do you, old chap? They don't shoot you if you haven't actually done +anything--only thoughts, which you can't help? I know they give you a fair +hearing. Oh, I trust them for that! They'll know my record, won't they? +YOU know what kind of chap I was. Not a bad chap in my way. Not brainy, of +course, but keen. I tried to do my best for the Party, didn't I? I'll get +off with five years, don't you think? Or even ten years? A chap like me +could make himself pretty useful in a labour-camp. They wouldn't shoot me +for going off the rails just once?' + +'Are you guilty?' said Winston. + +'Of course I'm guilty!' cried Parsons with a servile glance at the +telescreen. 'You don't think the Party would arrest an innocent man, +do you?' His frog-like face grew calmer, and even took on a slightly +sanctimonious expression. 'Thoughtcrime is a dreadful thing, old man,' +he said sententiously. 'It's insidious. It can get hold of you without +your even knowing it. Do you know how it got hold of me? In my sleep! Yes, +that's a fact. There I was, working away, trying to do my bit--never knew +I had any bad stuff in my mind at all. And then I started talking in my +sleep. Do you know what they heard me saying?' + +He sank his voice, like someone who is obliged for medical reasons to +utter an obscenity. + +'"Down with Big Brother!" Yes, I said that! Said it over and over again, +it seems. Between you and me, old man, I'm glad they got me before it went +any further. Do you know what I'm going to say to them when I go up before +the tribunal? "Thank you," I'm going to say, "thank you for saving me +before it was too late."' + +'Who denounced you?' said Winston. + +'It was my little daughter,' said Parsons with a sort of doleful pride. +'She listened at the keyhole. Heard what I was saying, and nipped off to +the patrols the very next day. Pretty smart for a nipper of seven, eh? +I don't bear her any grudge for it. In fact I'm proud of her. It shows I +brought her up in the right spirit, anyway.' + +He made a few more jerky movements up and down, several times, casting a +longing glance at the lavatory pan. Then he suddenly ripped down his +shorts. + +'Excuse me, old man,' he said. 'I can't help it. It's the waiting.' + +He plumped his large posterior into the lavatory pan. Winston covered his +face with his hands. + +'Smith!' yelled the voice from the telescreen. '6079 Smith W.! Uncover your +face. No faces covered in the cells.' + +Winston uncovered his face. Parsons used the lavatory, loudly and +abundantly. It then turned out that the plug was defective and the cell +stank abominably for hours afterwards. + +Parsons was removed. More prisoners came and went, mysteriously. One, a +woman, was consigned to 'Room 101', and, Winston noticed, seemed to shrivel +and turn a different colour when she heard the words. A time came when, if +it had been morning when he was brought here, it would be afternoon; or if +it had been afternoon, then it would be midnight. There were six prisoners +in the cell, men and women. All sat very still. Opposite Winston there sat +a man with a chinless, toothy face exactly like that of some large, +harmless rodent. His fat, mottled cheeks were so pouched at the bottom +that it was difficult not to believe that he had little stores of food +tucked away there. His pale-grey eyes flitted timorously from face to face +and turned quickly away again when he caught anyone's eye. + +The door opened, and another prisoner was brought in whose appearance sent +a momentary chill through Winston. He was a commonplace, mean-looking man +who might have been an engineer or technician of some kind. But what was +startling was the emaciation of his face. It was like a skull. Because of +its thinness the mouth and eyes looked disproportionately large, and the +eyes seemed filled with a murderous, unappeasable hatred of somebody or +something. + +The man sat down on the bench at a little distance from Winston. Winston +did not look at him again, but the tormented, skull-like face was as +vivid in his mind as though it had been straight in front of his eyes. +Suddenly he realized what was the matter. The man was dying of starvation. +The same thought seemed to occur almost simultaneously to everyone in the +cell. There was a very faint stirring all the way round the bench. The +eyes of the chinless man kept flitting towards the skull-faced man, then +turning guiltily away, then being dragged back by an irresistible +attraction. Presently he began to fidget on his seat. At last he stood up, +waddled clumsily across the cell, dug down into the pocket of his overalls, +and, with an abashed air, held out a grimy piece of bread to the +skull-faced man. + +There was a furious, deafening roar from the telescreen. The chinless man +jumped in his tracks. The skull-faced man had quickly thrust his hands +behind his back, as though demonstrating to all the world that he refused +the gift. + +'Bumstead!' roared the voice. '2713 Bumstead J.! Let fall that piece of +bread!' + +The chinless man dropped the piece of bread on the floor. + +'Remain standing where you are,' said the voice. 'Face the door. Make no +movement.' + +The chinless man obeyed. His large pouchy cheeks were quivering +uncontrollably. The door clanged open. As the young officer entered and +stepped aside, there emerged from behind him a short stumpy guard with +enormous arms and shoulders. He took his stand opposite the chinless man, +and then, at a signal from the officer, let free a frightful blow, with +all the weight of his body behind it, full in the chinless man's mouth. +The force of it seemed almost to knock him clear of the floor. His body +was flung across the cell and fetched up against the base of the lavatory +seat. For a moment he lay as though stunned, with dark blood oozing from +his mouth and nose. A very faint whimpering or squeaking, which seemed +unconscious, came out of him. Then he rolled over and raised himself +unsteadily on hands and knees. Amid a stream of blood and saliva, the two +halves of a dental plate fell out of his mouth. + +The prisoners sat very still, their hands crossed on their knees. The +chinless man climbed back into his place. Down one side of his face the +flesh was darkening. His mouth had swollen into a shapeless cherry-coloured +mass with a black hole in the middle of it. + +From time to time a little blood dripped on to the breast of his overalls. +His grey eyes still flitted from face to face, more guiltily than ever, +as though he were trying to discover how much the others despised him for +his humiliation. + +The door opened. With a small gesture the officer indicated the +skull-faced man. + +'Room 101,' he said. + +There was a gasp and a flurry at Winston's side. The man had actually +flung himself on his knees on the floor, with his hand clasped together. + +'Comrade! Officer!' he cried. 'You don't have to take me to that place! +Haven't I told you everything already? What else is it you want to know? +There's nothing I wouldn't confess, nothing! Just tell me what it is and +I'll confess straight off. Write it down and I'll sign it--anything! +Not room 101!' + +'Room 101,' said the officer. + +The man's face, already very pale, turned a colour Winston would not have +believed possible. It was definitely, unmistakably, a shade of green. + +'Do anything to me!' he yelled. 'You've been starving me for weeks. Finish +it off and let me die. Shoot me. Hang me. Sentence me to twenty-five +years. Is there somebody else you want me to give away? Just say who it is +and I'll tell you anything you want. I don't care who it is or what you do +to them. I've got a wife and three children. The biggest of them isn't six +years old. You can take the whole lot of them and cut their throats in +front of my eyes, and I'll stand by and watch it. But not Room 101!' + +'Room 101,' said the officer. + +The man looked frantically round at the other prisoners, as though with +some idea that he could put another victim in his own place. His eyes +settled on the smashed face of the chinless man. He flung out a lean arm. + +'That's the one you ought to be taking, not me!' he shouted. 'You didn't +hear what he was saying after they bashed his face. Give me a chance and +I'll tell you every word of it. HE'S the one that's against the Party, not +me.' The guards stepped forward. The man's voice rose to a shriek. 'You +didn't hear him!' he repeated. 'Something went wrong with the telescreen. +HE'S the one you want. Take him, not me!' + +The two sturdy guards had stooped to take him by the arms. But just at +this moment he flung himself across the floor of the cell and grabbed one +of the iron legs that supported the bench. He had set up a wordless +howling, like an animal. The guards took hold of him to wrench him loose, +but he clung on with astonishing strength. For perhaps twenty seconds +they were hauling at him. The prisoners sat quiet, their hands crossed on +their knees, looking straight in front of them. The howling stopped; the +man had no breath left for anything except hanging on. Then there was a +different kind of cry. A kick from a guard's boot had broken the fingers +of one of his hands. They dragged him to his feet. + +'Room 101,' said the officer. + +The man was led out, walking unsteadily, with head sunken, nursing his +crushed hand, all the fight had gone out of him. + +A long time passed. If it had been midnight when the skull-faced man was +taken away, it was morning: if morning, it was afternoon. Winston was +alone, and had been alone for hours. The pain of sitting on the narrow +bench was such that often he got up and walked about, unreproved by the +telescreen. The piece of bread still lay where the chinless man had +dropped it. At the beginning it needed a hard effort not to look at it, +but presently hunger gave way to thirst. His mouth was sticky and +evil-tasting. The humming sound and the unvarying white light induced a +sort of faintness, an empty feeling inside his head. He would get up +because the ache in his bones was no longer bearable, and then would sit +down again almost at once because he was too dizzy to make sure of +staying on his feet. Whenever his physical sensations were a little under +control the terror returned. Sometimes with a fading hope he thought of +O'Brien and the razor blade. It was thinkable that the razor blade might +arrive concealed in his food, if he were ever fed. More dimly he thought +of Julia. Somewhere or other she was suffering perhaps far worse than he. +She might be screaming with pain at this moment. He thought: 'If I could +save Julia by doubling my own pain, would I do it? Yes, I would.' But that +was merely an intellectual decision, taken because he knew that he ought +to take it. He did not feel it. In this place you could not feel anything, +except pain and foreknowledge of pain. Besides, was it possible, when you +were actually suffering it, to wish for any reason that your own pain +should increase? But that question was not answerable yet. + +The boots were approaching again. The door opened. O'Brien came in. + +Winston started to his feet. The shock of the sight had driven all +caution out of him. For the first time in many years he forgot the +presence of the telescreen. + +'They've got you too!' he cried. + +'They got me a long time ago,' said O'Brien with a mild, almost regretful +irony. He stepped aside. From behind him there emerged a broad-chested +guard with a long black truncheon in his hand. + +'You know this, Winston,' said O'Brien. 'Don't deceive yourself. You did +know it--you have always known it.' + +Yes, he saw now, he had always known it. But there was no time to think of +that. All he had eyes for was the truncheon in the guard's hand. It might +fall anywhere; on the crown, on the tip of the ear, on the upper arm, on +the elbow---- + +The elbow! He had slumped to his knees, almost paralysed, clasping the +stricken elbow with his other hand. Everything had exploded into yellow +light. Inconceivable, inconceivable that one blow could cause such pain! +The light cleared and he could see the other two looking down at him. The +guard was laughing at his contortions. One question at any rate was +answered. Never, for any reason on earth, could you wish for an increase +of pain. Of pain you could wish only one thing: that it should stop. +Nothing in the world was so bad as physical pain. In the face of pain +there are no heroes, no heroes, he thought over and over as he writhed +on the floor, clutching uselessly at his disabled left arm. + + + + +Chapter 2 + + + +He was lying on something that felt like a camp bed, except that it was +higher off the ground and that he was fixed down in some way so that he +could not move. Light that seemed stronger than usual was falling on his +face. O'Brien was standing at his side, looking down at him intently. At +the other side of him stood a man in a white coat, holding a hypodermic +syringe. + +Even after his eyes were open he took in his surroundings only gradually. +He had the impression of swimming up into this room from some quite +different world, a sort of underwater world far beneath it. How long he +had been down there he did not know. Since the moment when they arrested +him he had not seen darkness or daylight. Besides, his memories were not +continuous. There had been times when consciousness, even the sort of +consciousness that one has in sleep, had stopped dead and started again +after a blank interval. But whether the intervals were of days or weeks +or only seconds, there was no way of knowing. + +With that first blow on the elbow the nightmare had started. Later he was +to realize that all that then happened was merely a preliminary, a routine +interrogation to which nearly all prisoners were subjected. There was a +long range of crimes--espionage, sabotage, and the like--to which everyone +had to confess as a matter of course. The confession was a formality, +though the torture was real. How many times he had been beaten, how long +the beatings had continued, he could not remember. Always there were five +or six men in black uniforms at him simultaneously. Sometimes it was +fists, sometimes it was truncheons, sometimes it was steel rods, sometimes +it was boots. There were times when he rolled about the floor, as shameless +as an animal, writhing his body this way and that in an endless, hopeless +effort to dodge the kicks, and simply inviting more and yet more kicks, +in his ribs, in his belly, on his elbows, on his shins, in his groin, +in his testicles, on the bone at the base of his spine. There were times +when it went on and on until the cruel, wicked, unforgivable thing seemed +to him not that the guards continued to beat him but that he could not +force himself into losing consciousness. There were times when his nerve +so forsook him that he began shouting for mercy even before the beating +began, when the mere sight of a fist drawn back for a blow was enough +to make him pour forth a confession of real and imaginary crimes. There +were other times when he started out with the resolve of confessing +nothing, when every word had to be forced out of him between gasps of +pain, and there were times when he feebly tried to compromise, when he +said to himself: 'I will confess, but not yet. I must hold out till the +pain becomes unbearable. Three more kicks, two more kicks, and then I will +tell them what they want.' Sometimes he was beaten till he could hardly +stand, then flung like a sack of potatoes on to the stone floor of a cell, +left to recuperate for a few hours, and then taken out and beaten again. +There were also longer periods of recovery. He remembered them dimly, +because they were spent chiefly in sleep or stupor. He remembered a cell +with a plank bed, a sort of shelf sticking out from the wall, and a tin +wash-basin, and meals of hot soup and bread and sometimes coffee. He +remembered a surly barber arriving to scrape his chin and crop his hair, +and businesslike, unsympathetic men in white coats feeling his pulse, +tapping his reflexes, turning up his eyelids, running harsh fingers over +him in search for broken bones, and shooting needles into his arm to make +him sleep. + +The beatings grew less frequent, and became mainly a threat, a horror +to which he could be sent back at any moment when his answers were +unsatisfactory. His questioners now were not ruffians in black uniforms +but Party intellectuals, little rotund men with quick movements and +flashing spectacles, who worked on him in relays over periods which +lasted--he thought, he could not be sure--ten or twelve hours at a stretch. +These other questioners saw to it that he was in constant slight pain, but +it was not chiefly pain that they relied on. They slapped his face, wrung +his ears, pulled his hair, made him stand on one leg, refused him leave to +urinate, shone glaring lights in his face until his eyes ran with water; +but the aim of this was simply to humiliate him and destroy his power of +arguing and reasoning. Their real weapon was the merciless questioning +that went on and on, hour after hour, tripping him up, laying traps for +him, twisting everything that he said, convicting him at every step of +lies and self-contradiction until he began weeping as much from shame as +from nervous fatigue. Sometimes he would weep half a dozen times in a +single session. Most of the time they screamed abuse at him and threatened +at every hesitation to deliver him over to the guards again; but sometimes +they would suddenly change their tune, call him comrade, appeal to him in +the name of Ingsoc and Big Brother, and ask him sorrowfully whether even +now he had not enough loyalty to the Party left to make him wish to +undo the evil he had done. When his nerves were in rags after hours of +questioning, even this appeal could reduce him to snivelling tears. In the +end the nagging voices broke him down more completely than the boots and +fists of the guards. He became simply a mouth that uttered, a hand that +signed, whatever was demanded of him. His sole concern was to find out +what they wanted him to confess, and then confess it quickly, before the +bullying started anew. He confessed to the assassination of eminent Party +members, the distribution of seditious pamphlets, embezzlement of public +funds, sale of military secrets, sabotage of every kind. He confessed that +he had been a spy in the pay of the Eastasian government as far back as +1968. He confessed that he was a religious believer, an admirer of +capitalism, and a sexual pervert. He confessed that he had murdered his +wife, although he knew, and his questioners must have known, that his wife +was still alive. He confessed that for years he had been in personal touch +with Goldstein and had been a member of an underground organization which +had included almost every human being he had ever known. It was easier to +confess everything and implicate everybody. Besides, in a sense it was all +true. It was true that he had been the enemy of the Party, and in the eyes +of the Party there was no distinction between the thought and the deed. + +There were also memories of another kind. They stood out in his mind +disconnectedly, like pictures with blackness all round them. + +He was in a cell which might have been either dark or light, because he +could see nothing except a pair of eyes. Near at hand some kind of +instrument was ticking slowly and regularly. The eyes grew larger and more +luminous. Suddenly he floated out of his seat, dived into the eyes, and +was swallowed up. + +He was strapped into a chair surrounded by dials, under dazzling lights. +A man in a white coat was reading the dials. There was a tramp of heavy +boots outside. The door clanged open. The waxed-faced officer marched in, +followed by two guards. + +'Room 101,' said the officer. + +The man in the white coat did not turn round. He did not look at Winston +either; he was looking only at the dials. + +He was rolling down a mighty corridor, a kilometre wide, full of glorious, +golden light, roaring with laughter and shouting out confessions at the +top of his voice. He was confessing everything, even the things he had +succeeded in holding back under the torture. He was relating the entire +history of his life to an audience who knew it already. With him were the +guards, the other questioners, the men in white coats, O'Brien, Julia, +Mr Charrington, all rolling down the corridor together and shouting with +laughter. Some dreadful thing which had lain embedded in the future had +somehow been skipped over and had not happened. Everything was all right, +there was no more pain, the last detail of his life was laid bare, +understood, forgiven. + +He was starting up from the plank bed in the half-certainty that he had +heard O'Brien's voice. All through his interrogation, although he had +never seen him, he had had the feeling that O'Brien was at his elbow, just +out of sight. It was O'Brien who was directing everything. It was he who +set the guards on to Winston and who prevented them from killing him. It +was he who decided when Winston should scream with pain, when he should +have a respite, when he should be fed, when he should sleep, when the +drugs should be pumped into his arm. It was he who asked the questions and +suggested the answers. He was the tormentor, he was the protector, he was +the inquisitor, he was the friend. And once--Winston could not remember +whether it was in drugged sleep, or in normal sleep, or even in a moment +of wakefulness--a voice murmured in his ear: 'Don't worry, Winston; you +are in my keeping. For seven years I have watched over you. Now the +turning-point has come. I shall save you, I shall make you perfect.' He +was not sure whether it was O'Brien's voice; but it was the same voice +that had said to him, 'We shall meet in the place where there is no +darkness,' in that other dream, seven years ago. + +He did not remember any ending to his interrogation. There was a period of +blackness and then the cell, or room, in which he now was had gradually +materialized round him. He was almost flat on his back, and unable to move. +His body was held down at every essential point. Even the back of his head +was gripped in some manner. O'Brien was looking down at him gravely and +rather sadly. His face, seen from below, looked coarse and worn, with +pouches under the eyes and tired lines from nose to chin. He was older +than Winston had thought him; he was perhaps forty-eight or fifty. Under +his hand there was a dial with a lever on top and figures running round +the face. + +'I told you,' said O'Brien, 'that if we met again it would be here.' + +'Yes,' said Winston. + +Without any warning except a slight movement of O'Brien's hand, a wave of +pain flooded his body. It was a frightening pain, because he could not see +what was happening, and he had the feeling that some mortal injury was +being done to him. He did not know whether the thing was really happening, +or whether the effect was electrically produced; but his body was being +wrenched out of shape, the joints were being slowly torn apart. Although +the pain had brought the sweat out on his forehead, the worst of all was +the fear that his backbone was about to snap. He set his teeth and +breathed hard through his nose, trying to keep silent as long as possible. + +'You are afraid,' said O'Brien, watching his face, 'that in another moment +something is going to break. Your especial fear is that it will be your +backbone. You have a vivid mental picture of the vertebrae snapping apart +and the spinal fluid dripping out of them. That is what you are thinking, +is it not, Winston?' + +Winston did not answer. O'Brien drew back the lever on the dial. The wave +of pain receded almost as quickly as it had come. + +'That was forty,' said O'Brien. 'You can see that the numbers on this dial +run up to a hundred. Will you please remember, throughout our conversation, +that I have it in my power to inflict pain on you at any moment and to +whatever degree I choose? If you tell me any lies, or attempt to +prevaricate in any way, or even fall below your usual level of +intelligence, you will cry out with pain, instantly. Do you understand +that?' + +'Yes,' said Winston. + +O'Brien's manner became less severe. He resettled his spectacles +thoughtfully, and took a pace or two up and down. When he spoke his voice +was gentle and patient. He had the air of a doctor, a teacher, even a +priest, anxious to explain and persuade rather than to punish. + +'I am taking trouble with you, Winston,' he said, 'because you are worth +trouble. You know perfectly well what is the matter with you. You have +known it for years, though you have fought against the knowledge. You are +mentally deranged. You suffer from a defective memory. You are unable to +remember real events and you persuade yourself that you remember other +events which never happened. Fortunately it is curable. You have never +cured yourself of it, because you did not choose to. There was a small +effort of the will that you were not ready to make. Even now, I am well +aware, you are clinging to your disease under the impression that it is +a virtue. Now we will take an example. At this moment, which power is +Oceania at war with?' + +'When I was arrested, Oceania was at war with Eastasia.' + +'With Eastasia. Good. And Oceania has always been at war with Eastasia, +has it not?' + +Winston drew in his breath. He opened his mouth to speak and then did not +speak. He could not take his eyes away from the dial. + +'The truth, please, Winston. YOUR truth. Tell me what you think you +remember.' + +'I remember that until only a week before I was arrested, we were not at +war with Eastasia at all. We were in alliance with them. The war was +against Eurasia. That had lasted for four years. Before that----' + +O'Brien stopped him with a movement of the hand. + +'Another example,' he said. 'Some years ago you had a very serious delusion +indeed. You believed that three men, three one-time Party members named +Jones, Aaronson, and Rutherford--men who were executed for treachery and +sabotage after making the fullest possible confession--were not guilty of +the crimes they were charged with. You believed that you had seen +unmistakable documentary evidence proving that their confessions were +false. There was a certain photograph about which you had a hallucination. +You believed that you had actually held it in your hands. It was a +photograph something like this.' + +An oblong slip of newspaper had appeared between O'Brien's fingers. For +perhaps five seconds it was within the angle of Winston's vision. It was +a photograph, and there was no question of its identity. It was THE +photograph. It was another copy of the photograph of Jones, Aaronson, and +Rutherford at the party function in New York, which he had chanced upon +eleven years ago and promptly destroyed. For only an instant it was before +his eyes, then it was out of sight again. But he had seen it, +unquestionably he had seen it! He made a desperate, agonizing effort to +wrench the top half of his body free. It was impossible to move so much as +a centimetre in any direction. For the moment he had even forgotten the +dial. All he wanted was to hold the photograph in his fingers again, or at +least to see it. + +'It exists!' he cried. + +'No,' said O'Brien. + +He stepped across the room. There was a memory hole in the opposite wall. +O'Brien lifted the grating. Unseen, the frail slip of paper was whirling +away on the current of warm air; it was vanishing in a flash of flame. +O'Brien turned away from the wall. + +'Ashes,' he said. 'Not even identifiable ashes. Dust. It does not exist. +It never existed.' + +'But it did exist! It does exist! It exists in memory. I remember it. +You remember it.' + +'I do not remember it,' said O'Brien. + +Winston's heart sank. That was doublethink. He had a feeling of deadly +helplessness. If he could have been certain that O'Brien was lying, it +would not have seemed to matter. But it was perfectly possible that O'Brien +had really forgotten the photograph. And if so, then already he would have +forgotten his denial of remembering it, and forgotten the act of +forgetting. How could one be sure that it was simple trickery? Perhaps +that lunatic dislocation in the mind could really happen: that was the +thought that defeated him. + +O'Brien was looking down at him speculatively. More than ever he had the +air of a teacher taking pains with a wayward but promising child. + +'There is a Party slogan dealing with the control of the past,' he said. +'Repeat it, if you please.' + +'"Who controls the past controls the future: who controls the present +controls the past,"' repeated Winston obediently. + +'"Who controls the present controls the past,"' said O'Brien, nodding his +head with slow approval. 'Is it your opinion, Winston, that the past has +real existence?' + +Again the feeling of helplessness descended upon Winston. His eyes flitted +towards the dial. He not only did not know whether 'yes' or 'no' was the +answer that would save him from pain; he did not even know which answer he +believed to be the true one. + +O'Brien smiled faintly. 'You are no metaphysician, Winston,' he said. +'Until this moment you had never considered what is meant by existence. I +will put it more precisely. Does the past exist concretely, in space? Is +there somewhere or other a place, a world of solid objects, where the past +is still happening?' + +'No.' + +'Then where does the past exist, if at all?' + +'In records. It is written down.' + +'In records. And----?' + +'In the mind. In human memories.' + +'In memory. Very well, then. We, the Party, control all records, and we +control all memories. Then we control the past, do we not?' + +'But how can you stop people remembering things?' cried Winston again +momentarily forgetting the dial. 'It is involuntary. It is outside oneself. +How can you control memory? You have not controlled mine!' + +O'Brien's manner grew stern again. He laid his hand on the dial. + +'On the contrary,' he said, 'YOU have not controlled it. That is what has +brought you here. You are here because you have failed in humility, in +self-discipline. You would not make the act of submission which is the +price of sanity. You preferred to be a lunatic, a minority of one. Only the +disciplined mind can see reality, Winston. You believe that reality is +something objective, external, existing in its own right. You also believe +that the nature of reality is self-evident. When you delude yourself into +thinking that you see something, you assume that everyone else sees the +same thing as you. But I tell you, Winston, that reality is not external. +Reality exists in the human mind, and nowhere else. Not in the individual +mind, which can make mistakes, and in any case soon perishes: only in the +mind of the Party, which is collective and immortal. Whatever the Party +holds to be the truth, is truth. It is impossible to see reality except by +looking through the eyes of the Party. That is the fact that you have got +to relearn, Winston. It needs an act of self-destruction, an effort of the +will. You must humble yourself before you can become sane.' + +He paused for a few moments, as though to allow what he had been saying to +sink in. + +'Do you remember,' he went on, 'writing in your diary, "Freedom is the +freedom to say that two plus two make four"?' + +'Yes,' said Winston. + +O'Brien held up his left hand, its back towards Winston, with the thumb +hidden and the four fingers extended. + +'How many fingers am I holding up, Winston?' + +'Four.' + +'And if the party says that it is not four but five--then how many?' + +'Four.' + +The word ended in a gasp of pain. The needle of the dial had shot up to +fifty-five. The sweat had sprung out all over Winston's body. The air tore +into his lungs and issued again in deep groans which even by clenching his +teeth he could not stop. O'Brien watched him, the four fingers still +extended. He drew back the lever. This time the pain was only slightly +eased. + +'How many fingers, Winston?' + +'Four.' + +The needle went up to sixty. + +'How many fingers, Winston?' + +'Four! Four! What else can I say? Four!' + +The needle must have risen again, but he did not look at it. The heavy, +stern face and the four fingers filled his vision. The fingers stood up +before his eyes like pillars, enormous, blurry, and seeming to vibrate, +but unmistakably four. + +'How many fingers, Winston?' + +'Four! Stop it, stop it! How can you go on? Four! Four!' + +'How many fingers, Winston?' + +'Five! Five! Five!' + +'No, Winston, that is no use. You are lying. You still think there are +four. How many fingers, please?' + +'Four! five! Four! Anything you like. Only stop it, stop the pain!' + +Abruptly he was sitting up with O'Brien's arm round his shoulders. He had +perhaps lost consciousness for a few seconds. The bonds that had held his +body down were loosened. He felt very cold, he was shaking uncontrollably, +his teeth were chattering, the tears were rolling down his cheeks. For a +moment he clung to O'Brien like a baby, curiously comforted by the heavy +arm round his shoulders. He had the feeling that O'Brien was his protector, +that the pain was something that came from outside, from some other source, +and that it was O'Brien who would save him from it. + +'You are a slow learner, Winston,' said O'Brien gently. + +'How can I help it?' he blubbered. 'How can I help seeing what is in front +of my eyes? Two and two are four.' + +'Sometimes, Winston. Sometimes they are five. Sometimes they are three. +Sometimes they are all of them at once. You must try harder. It is not +easy to become sane.' + +He laid Winston down on the bed. The grip of his limbs tightened again, +but the pain had ebbed away and the trembling had stopped, leaving him +merely weak and cold. O'Brien motioned with his head to the man in the +white coat, who had stood immobile throughout the proceedings. The man in +the white coat bent down and looked closely into Winston's eyes, felt his +pulse, laid an ear against his chest, tapped here and there, then he +nodded to O'Brien. + +'Again,' said O'Brien. + +The pain flowed into Winston's body. The needle must be at seventy, +seventy-five. He had shut his eyes this time. He knew that the fingers +were still there, and still four. All that mattered was somehow to stay +alive until the spasm was over. He had ceased to notice whether he was +crying out or not. The pain lessened again. He opened his eyes. O'Brien +had drawn back the lever. + +'How many fingers, Winston?' + +'Four. I suppose there are four. I would see five if I could. I am trying +to see five.' + +'Which do you wish: to persuade me that you see five, or really to see +them?' + +'Really to see them.' + +'Again,' said O'Brien. + +Perhaps the needle was eighty--ninety. Winston could not intermittently +remember why the pain was happening. Behind his screwed-up eyelids a +forest of fingers seemed to be moving in a sort of dance, weaving in and +out, disappearing behind one another and reappearing again. He was trying +to count them, he could not remember why. He knew only that it was +impossible to count them, and that this was somehow due to the mysterious +identity between five and four. The pain died down again. When he opened +his eyes it was to find that he was still seeing the same thing. +Innumerable fingers, like moving trees, were still streaming past in +either direction, crossing and recrossing. He shut his eyes again. + +'How many fingers am I holding up, Winston?' + +'I don't know. I don't know. You will kill me if you do that again. Four, +five, six--in all honesty I don't know.' + +'Better,' said O'Brien. + +A needle slid into Winston's arm. Almost in the same instant a blissful, +healing warmth spread all through his body. The pain was already +half-forgotten. He opened his eyes and looked up gratefully at O'Brien. +At sight of the heavy, lined face, so ugly and so intelligent, his heart +seemed to turn over. If he could have moved he would have stretched out +a hand and laid it on O'Brien's arm. He had never loved him so deeply as +at this moment, and not merely because he had stopped the pain. The old +feeling, that at bottom it did not matter whether O'Brien was a friend +or an enemy, had come back. O'Brien was a person who could be talked to. +Perhaps one did not want to be loved so much as to be understood. O'Brien +had tortured him to the edge of lunacy, and in a little while, it was +certain, he would send him to his death. It made no difference. In some +sense that went deeper than friendship, they were intimates: somewhere or +other, although the actual words might never be spoken, there was a place +where they could meet and talk. O'Brien was looking down at him with an +expression which suggested that the same thought might be in his own mind. +When he spoke it was in an easy, conversational tone. + +'Do you know where you are, Winston?' he said. + +'I don't know. I can guess. In the Ministry of Love.' + +'Do you know how long you have been here?' + +'I don't know. Days, weeks, months--I think it is months.' + +'And why do you imagine that we bring people to this place?' + +'To make them confess.' + +'No, that is not the reason. Try again.' + +'To punish them.' + +'No!' exclaimed O'Brien. His voice had changed extraordinarily, and his +face had suddenly become both stern and animated. 'No! Not merely to +extract your confession, not to punish you. Shall I tell you why we have +brought you here? To cure you! To make you sane! Will you understand, +Winston, that no one whom we bring to this place ever leaves our hands +uncured? We are not interested in those stupid crimes that you have +committed. The Party is not interested in the overt act: the thought is +all we care about. We do not merely destroy our enemies, we change them. +Do you understand what I mean by that?' + +He was bending over Winston. His face looked enormous because of its +nearness, and hideously ugly because it was seen from below. Moreover it +was filled with a sort of exaltation, a lunatic intensity. Again Winston's +heart shrank. If it had been possible he would have cowered deeper into +the bed. He felt certain that O'Brien was about to twist the dial out of +sheer wantonness. At this moment, however, O'Brien turned away. He took a +pace or two up and down. Then he continued less vehemently: + +'The first thing for you to understand is that in this place there are no +martyrdoms. You have read of the religious persecutions of the past. In +the Middle Ages there was the Inquisition. It was a failure. It set out +to eradicate heresy, and ended by perpetuating it. For every heretic it +burned at the stake, thousands of others rose up. Why was that? Because +the Inquisition killed its enemies in the open, and killed them while +they were still unrepentant: in fact, it killed them because they were +unrepentant. Men were dying because they would not abandon their true +beliefs. Naturally all the glory belonged to the victim and all the shame +to the Inquisitor who burned him. Later, in the twentieth century, there +were the totalitarians, as they were called. There were the German Nazis +and the Russian Communists. The Russians persecuted heresy more cruelly +than the Inquisition had done. And they imagined that they had learned +from the mistakes of the past; they knew, at any rate, that one must not +make martyrs. Before they exposed their victims to public trial, they +deliberately set themselves to destroy their dignity. They wore them down +by torture and solitude until they were despicable, cringing wretches, +confessing whatever was put into their mouths, covering themselves with +abuse, accusing and sheltering behind one another, whimpering for mercy. +And yet after only a few years the same thing had happened over again. +The dead men had become martyrs and their degradation was forgotten. Once +again, why was it? In the first place, because the confessions that they +had made were obviously extorted and untrue. We do not make mistakes of +that kind. All the confessions that are uttered here are true. We make +them true. And above all we do not allow the dead to rise up against us. +You must stop imagining that posterity will vindicate you, Winston. +Posterity will never hear of you. You will be lifted clean out from the +stream of history. We shall turn you into gas and pour you into the +stratosphere. Nothing will remain of you, not a name in a register, not +a memory in a living brain. You will be annihilated in the past as well +as in the future. You will never have existed.' + +Then why bother to torture me? thought Winston, with a momentary +bitterness. O'Brien checked his step as though Winston had uttered the +thought aloud. His large ugly face came nearer, with the eyes a little +narrowed. + +'You are thinking,' he said, 'that since we intend to destroy you utterly, +so that nothing that you say or do can make the smallest difference--in +that case, why do we go to the trouble of interrogating you first? That is +what you were thinking, was it not?' + +'Yes,' said Winston. + +O'Brien smiled slightly. 'You are a flaw in the pattern, Winston. You are +a stain that must be wiped out. Did I not tell you just now that we are +different from the persecutors of the past? We are not content with +negative obedience, nor even with the most abject submission. When finally +you surrender to us, it must be of your own free will. We do not destroy +the heretic because he resists us: so long as he resists us we never +destroy him. We convert him, we capture his inner mind, we reshape him. +We burn all evil and all illusion out of him; we bring him over to our +side, not in appearance, but genuinely, heart and soul. We make him one of +ourselves before we kill him. It is intolerable to us that an erroneous +thought should exist anywhere in the world, however secret and powerless +it may be. Even in the instant of death we cannot permit any deviation. In +the old days the heretic walked to the stake still a heretic, proclaiming +his heresy, exulting in it. Even the victim of the Russian purges could +carry rebellion locked up in his skull as he walked down the passage +waiting for the bullet. But we make the brain perfect before we blow it +out. The command of the old despotisms was "Thou shalt not". The command +of the totalitarians was "Thou shalt". Our command is "THOU ART". No one +whom we bring to this place ever stands out against us. Everyone is washed +clean. Even those three miserable traitors in whose innocence you once +believed--Jones, Aaronson, and Rutherford--in the end we broke them down. +I took part in their interrogation myself. I saw them gradually worn down, +whimpering, grovelling, weeping--and in the end it was not with pain or +fear, only with penitence. By the time we had finished with them they were +only the shells of men. There was nothing left in them except sorrow for +what they had done, and love of Big Brother. It was touching to see +how they loved him. They begged to be shot quickly, so that they could die +while their minds were still clean.' + +His voice had grown almost dreamy. The exaltation, the lunatic enthusiasm, +was still in his face. He is not pretending, thought Winston, he is not a +hypocrite, he believes every word he says. What most oppressed him was the +consciousness of his own intellectual inferiority. He watched the heavy +yet graceful form strolling to and fro, in and out of the range of his +vision. O'Brien was a being in all ways larger than himself. There was no +idea that he had ever had, or could have, that O'Brien had not long ago +known, examined, and rejected. His mind CONTAINED Winston's mind. But +in that case how could it be true that O'Brien was mad? It must be he, +Winston, who was mad. O'Brien halted and looked down at him. His voice had +grown stern again. + +'Do not imagine that you will save yourself, Winston, however completely +you surrender to us. No one who has once gone astray is ever spared. And +even if we chose to let you live out the natural term of your life, still +you would never escape from us. What happens to you here is for ever. +Understand that in advance. We shall crush you down to the point from +which there is no coming back. Things will happen to you from which you +could not recover, if you lived a thousand years. Never again will you be +capable of ordinary human feeling. Everything will be dead inside you. +Never again will you be capable of love, or friendship, or joy of living, +or laughter, or curiosity, or courage, or integrity. You will be hollow. +We shall squeeze you empty, and then we shall fill you with ourselves.' + +He paused and signed to the man in the white coat. Winston was aware of +some heavy piece of apparatus being pushed into place behind his head. +O'Brien had sat down beside the bed, so that his face was almost on a +level with Winston's. + +'Three thousand,' he said, speaking over Winston's head to the man in the +white coat. + +Two soft pads, which felt slightly moist, clamped themselves against +Winston's temples. He quailed. There was pain coming, a new kind of pain. +O'Brien laid a hand reassuringly, almost kindly, on his. + +'This time it will not hurt,' he said. 'Keep your eyes fixed on mine.' + +At this moment there was a devastating explosion, or what seemed like an +explosion, though it was not certain whether there was any noise. There +was undoubtedly a blinding flash of light. Winston was not hurt, only +prostrated. Although he had already been lying on his back when the thing +happened, he had a curious feeling that he had been knocked into that +position. A terrific painless blow had flattened him out. Also something +had happened inside his head. As his eyes regained their focus he +remembered who he was, and where he was, and recognized the face that was +gazing into his own; but somewhere or other there was a large patch of +emptiness, as though a piece had been taken out of his brain. + +'It will not last,' said O'Brien. 'Look me in the eyes. What country is +Oceania at war with?' + +Winston thought. He knew what was meant by Oceania and that he himself was +a citizen of Oceania. He also remembered Eurasia and Eastasia; but who was +at war with whom he did not know. In fact he had not been aware that there +was any war. + +'I don't remember.' + +'Oceania is at war with Eastasia. Do you remember that now?' + +'Yes.' + +'Oceania has always been at war with Eastasia. Since the beginning of your +life, since the beginning of the Party, since the beginning of history, +the war has continued without a break, always the same war. Do you +remember that?' + +'Yes.' + +'Eleven years ago you created a legend about three men who had been +condemned to death for treachery. You pretended that you had seen a piece +of paper which proved them innocent. No such piece of paper ever existed. +You invented it, and later you grew to believe in it. You remember now the +very moment at which you first invented it. Do you remember that?' + +'Yes.' + +'Just now I held up the fingers of my hand to you. You saw five fingers. +Do you remember that?' + +'Yes.' + +O'Brien held up the fingers of his left hand, with the thumb concealed. + +'There are five fingers there. Do you see five fingers?' + +'Yes.' + +And he did see them, for a fleeting instant, before the scenery of his +mind changed. He saw five fingers, and there was no deformity. Then +everything was normal again, and the old fear, the hatred, and the +bewilderment came crowding back again. But there had been a moment--he did +not know how long, thirty seconds, perhaps--of luminous certainty, when +each new suggestion of O'Brien's had filled up a patch of emptiness and +become absolute truth, and when two and two could have been three as +easily as five, if that were what was needed. It had faded but before +O'Brien had dropped his hand; but though he could not recapture it, he +could remember it, as one remembers a vivid experience at some period of +one's life when one was in effect a different person. + +'You see now,' said O'Brien, 'that it is at any rate possible.' + +'Yes,' said Winston. + +O'Brien stood up with a satisfied air. Over to his left Winston saw the +man in the white coat break an ampoule and draw back the plunger of a +syringe. O'Brien turned to Winston with a smile. In almost the old manner +he resettled his spectacles on his nose. + +'Do you remember writing in your diary,' he said, 'that it did not matter +whether I was a friend or an enemy, since I was at least a person who +understood you and could be talked to? You were right. I enjoy talking to +you. Your mind appeals to me. It resembles my own mind except that you +happen to be insane. Before we bring the session to an end you can ask me +a few questions, if you choose.' + +'Any question I like?' + +'Anything.' He saw that Winston's eyes were upon the dial. 'It is switched +off. What is your first question?' + +'What have you done with Julia?' said Winston. + +O'Brien smiled again. 'She betrayed you, Winston. Immediately--unreservedly. +I have seldom seen anyone come over to us so promptly. You would hardly +recognize her if you saw her. All her rebelliousness, her deceit, her +folly, her dirty-mindedness--everything has been burned out of her. It was +a perfect conversion, a textbook case.' + +'You tortured her?' + +O'Brien left this unanswered. 'Next question,' he said. + +'Does Big Brother exist?' + +'Of course he exists. The Party exists. Big Brother is the embodiment of +the Party.' + +'Does he exist in the same way as I exist?' + +'You do not exist,' said O'Brien. + +Once again the sense of helplessness assailed him. He knew, or he could +imagine, the arguments which proved his own nonexistence; but they were +nonsense, they were only a play on words. Did not the statement, 'You do +not exist', contain a logical absurdity? But what use was it to say so? +His mind shrivelled as he thought of the unanswerable, mad arguments with +which O'Brien would demolish him. + +'I think I exist,' he said wearily. 'I am conscious of my own identity. +I was born and I shall die. I have arms and legs. I occupy a particular +point in space. No other solid object can occupy the same point +simultaneously. In that sense, does Big Brother exist?' + +'It is of no importance. He exists.' + +'Will Big Brother ever die?' + +'Of course not. How could he die? Next question.' + +'Does the Brotherhood exist?' + +'That, Winston, you will never know. If we choose to set you free when we +have finished with you, and if you live to be ninety years old, still you +will never learn whether the answer to that question is Yes or No. As long +as you live it will be an unsolved riddle in your mind.' + +Winston lay silent. His breast rose and fell a little faster. He still had +not asked the question that had come into his mind the first. He had got +to ask it, and yet it was as though his tongue would not utter it. There +was a trace of amusement in O'Brien's face. Even his spectacles seemed to +wear an ironical gleam. He knows, thought Winston suddenly, he knows what +I am going to ask! At the thought the words burst out of him: + +'What is in Room 101?' + +The expression on O'Brien's face did not change. He answered drily: + +'You know what is in Room 101, Winston. Everyone knows what is in +Room 101.' + +He raised a finger to the man in the white coat. Evidently the session was +at an end. A needle jerked into Winston's arm. He sank almost instantly +into deep sleep. + + + + +Chapter 3 + + + +'There are three stages in your reintegration,' said O'Brien. 'There is +learning, there is understanding, and there is acceptance. It is time for +you to enter upon the second stage.' + +As always, Winston was lying flat on his back. But of late his bonds were +looser. They still held him to the bed, but he could move his knees a +little and could turn his head from side to side and raise his arms from +the elbow. The dial, also, had grown to be less of a terror. He could +evade its pangs if he was quick-witted enough: it was chiefly when he +showed stupidity that O'Brien pulled the lever. Sometimes they got through +a whole session without use of the dial. He could not remember how many +sessions there had been. The whole process seemed to stretch out over a +long, indefinite time--weeks, possibly--and the intervals between the +sessions might sometimes have been days, sometimes only an hour or two. + +'As you lie there,' said O'Brien, 'you have often wondered--you have even +asked me--why the Ministry of Love should expend so much time and trouble +on you. And when you were free you were puzzled by what was essentially +the same question. You could grasp the mechanics of the Society you lived +in, but not its underlying motives. Do you remember writing in your diary, +"I understand HOW: I do not understand WHY"? It was when you thought about +"why" that you doubted your own sanity. You have read THE BOOK, +Goldstein's book, or parts of it, at least. Did it tell you anything that +you did not know already?' + +'You have read it?' said Winston. + +'I wrote it. That is to say, I collaborated in writing it. No book is +produced individually, as you know.' + +'Is it true, what it says?' + +'As description, yes. The programme it sets forth is nonsense. The secret +accumulation of knowledge--a gradual spread of enlightenment--ultimately +a proletarian rebellion--the overthrow of the Party. You foresaw yourself +that that was what it would say. It is all nonsense. The proletarians will +never revolt, not in a thousand years or a million. They cannot. I do +not have to tell you the reason: you know it already. If you have ever +cherished any dreams of violent insurrection, you must abandon them. There +is no way in which the Party can be overthrown. The rule of the Party is +for ever. Make that the starting-point of your thoughts.' + +He came closer to the bed. 'For ever!' he repeated. 'And now let us get +back to the question of "how" and "why". You understand well enough HOW +the Party maintains itself in power. Now tell me WHY we cling to power. +What is our motive? Why should we want power? Go on, speak,' he added as +Winston remained silent. + +Nevertheless Winston did not speak for another moment or two. A feeling of +weariness had overwhelmed him. The faint, mad gleam of enthusiasm had come +back into O'Brien's face. He knew in advance what O'Brien would say. That +the Party did not seek power for its own ends, but only for the good of +the majority. That it sought power because men in the mass were frail, +cowardly creatures who could not endure liberty or face the truth, and +must be ruled over and systematically deceived by others who were stronger +than themselves. That the choice for mankind lay between freedom and +happiness, and that, for the great bulk of mankind, happiness was better. +That the party was the eternal guardian of the weak, a dedicated sect +doing evil that good might come, sacrificing its own happiness to that of +others. The terrible thing, thought Winston, the terrible thing was that +when O'Brien said this he would believe it. You could see it in his face. +O'Brien knew everything. A thousand times better than Winston he knew what +the world was really like, in what degradation the mass of human beings +lived and by what lies and barbarities the Party kept them there. He had +understood it all, weighed it all, and it made no difference: all was +justified by the ultimate purpose. What can you do, thought Winston, +against the lunatic who is more intelligent than yourself, who gives your +arguments a fair hearing and then simply persists in his lunacy? + +'You are ruling over us for our own good,' he said feebly. 'You believe +that human beings are not fit to govern themselves, and therefore----' + +He started and almost cried out. A pang of pain had shot through his body. +O'Brien had pushed the lever of the dial up to thirty-five. + +'That was stupid, Winston, stupid!' he said. 'You should know better than +to say a thing like that.' + +He pulled the lever back and continued: + +'Now I will tell you the answer to my question. It is this. The Party +seeks power entirely for its own sake. We are not interested in the good +of others; we are interested solely in power. Not wealth or luxury or long +life or happiness: only power, pure power. What pure power means you will +understand presently. We are different from all the oligarchies of the +past, in that we know what we are doing. All the others, even those who +resembled ourselves, were cowards and hypocrites. The German Nazis and the +Russian Communists came very close to us in their methods, but they never +had the courage to recognize their own motives. They pretended, perhaps +they even believed, that they had seized power unwillingly and for a +limited time, and that just round the corner there lay a paradise where +human beings would be free and equal. We are not like that. We know that +no one ever seizes power with the intention of relinquishing it. Power is +not a means, it is an end. One does not establish a dictatorship in order +to safeguard a revolution; one makes the revolution in order to establish +the dictatorship. The object of persecution is persecution. The object of +torture is torture. The object of power is power. Now do you begin to +understand me?' + +Winston was struck, as he had been struck before, by the tiredness of +O'Brien's face. It was strong and fleshy and brutal, it was full of +intelligence and a sort of controlled passion before which he felt himself +helpless; but it was tired. There were pouches under the eyes, the skin +sagged from the cheekbones. O'Brien leaned over him, deliberately bringing +the worn face nearer. + +'You are thinking,' he said, 'that my face is old and tired. You are +thinking that I talk of power, and yet I am not even able to prevent the +decay of my own body. Can you not understand, Winston, that the individual +is only a cell? The weariness of the cell is the vigour of the organism. +Do you die when you cut your fingernails?' + +He turned away from the bed and began strolling up and down again, one hand +in his pocket. + +'We are the priests of power,' he said. 'God is power. But at present +power is only a word so far as you are concerned. It is time for you to +gather some idea of what power means. The first thing you must realize +is that power is collective. The individual only has power in so far as +he ceases to be an individual. You know the Party slogan: "Freedom is +Slavery". Has it ever occurred to you that it is reversible? Slavery is +freedom. Alone--free--the human being is always defeated. It must be so, +because every human being is doomed to die, which is the greatest of all +failures. But if he can make complete, utter submission, if he can escape +from his identity, if he can merge himself in the Party so that he IS the +Party, then he is all-powerful and immortal. The second thing for you to +realize is that power is power over human beings. Over the body--but, above +all, over the mind. Power over matter--external reality, as you would call +it--is not important. Already our control over matter is absolute.' + +For a moment Winston ignored the dial. He made a violent effort to raise +himself into a sitting position, and merely succeeded in wrenching his +body painfully. + +'But how can you control matter?' he burst out. 'You don't even control +the climate or the law of gravity. And there are disease, pain, death----' + +O'Brien silenced him by a movement of his hand. 'We control matter because +we control the mind. Reality is inside the skull. You will learn by +degrees, Winston. There is nothing that we could not do. Invisibility, +levitation--anything. I could float off this floor like a soap bubble if +I wish to. I do not wish to, because the Party does not wish it. You must +get rid of those nineteenth-century ideas about the laws of Nature. We +make the laws of Nature.' + +'But you do not! You are not even masters of this planet. What about +Eurasia and Eastasia? You have not conquered them yet.' + +'Unimportant. We shall conquer them when it suits us. And if we did not, +what difference would it make? We can shut them out of existence. Oceania +is the world.' + +'But the world itself is only a speck of dust. And man is tiny--helpless! +How long has he been in existence? For millions of years the earth was +uninhabited.' + +'Nonsense. The earth is as old as we are, no older. How could it be older? +Nothing exists except through human consciousness.' + +'But the rocks are full of the bones of extinct animals--mammoths and +mastodons and enormous reptiles which lived here long before man was ever +heard of.' + +'Have you ever seen those bones, Winston? Of course not. Nineteenth-century +biologists invented them. Before man there was nothing. After man, if he +could come to an end, there would be nothing. Outside man there is +nothing.' + +'But the whole universe is outside us. Look at the stars! Some of them are +a million light-years away. They are out of our reach for ever.' + +'What are the stars?' said O'Brien indifferently. 'They are bits of fire +a few kilometres away. We could reach them if we wanted to. Or we could +blot them out. The earth is the centre of the universe. The sun and the +stars go round it.' + +Winston made another convulsive movement. This time he did not say +anything. O'Brien continued as though answering a spoken objection: + +'For certain purposes, of course, that is not true. When we navigate the +ocean, or when we predict an eclipse, we often find it convenient to +assume that the earth goes round the sun and that the stars are millions +upon millions of kilometres away. But what of it? Do you suppose it is +beyond us to produce a dual system of astronomy? The stars can be near +or distant, according as we need them. Do you suppose our mathematicians +are unequal to that? Have you forgotten doublethink?' + +Winston shrank back upon the bed. Whatever he said, the swift answer +crushed him like a bludgeon. And yet he knew, he KNEW, that he was in the +right. The belief that nothing exists outside your own mind--surely there +must be some way of demonstrating that it was false? Had it not been +exposed long ago as a fallacy? There was even a name for it, which he +had forgotten. A faint smile twitched the corners of O'Brien's mouth as +he looked down at him. + +'I told you, Winston,' he said, 'that metaphysics is not your strong +point. The word you are trying to think of is solipsism. But you are +mistaken. This is not solipsism. Collective solipsism, if you like. But +that is a different thing: in fact, the opposite thing. All this is a +digression,' he added in a different tone. 'The real power, the power we +have to fight for night and day, is not power over things, but over men.' +He paused, and for a moment assumed again his air of a schoolmaster +questioning a promising pupil: 'How does one man assert his power over +another, Winston?' + +Winston thought. 'By making him suffer,' he said. + +'Exactly. By making him suffer. Obedience is not enough. Unless he is +suffering, how can you be sure that he is obeying your will and not his +own? Power is in inflicting pain and humiliation. Power is in tearing +human minds to pieces and putting them together again in new shapes of +your own choosing. Do you begin to see, then, what kind of world we are +creating? It is the exact opposite of the stupid hedonistic Utopias that +the old reformers imagined. A world of fear and treachery and torment, a +world of trampling and being trampled upon, a world which will grow not +less but MORE merciless as it refines itself. Progress in our world will +be progress towards more pain. The old civilizations claimed that they +were founded on love or justice. Ours is founded upon hatred. In our world +there will be no emotions except fear, rage, triumph, and self-abasement. +Everything else we shall destroy--everything. Already we are breaking down +the habits of thought which have survived from before the Revolution. We +have cut the links between child and parent, and between man and man, and +between man and woman. No one dares trust a wife or a child or a friend +any longer. But in the future there will be no wives and no friends. +Children will be taken from their mothers at birth, as one takes eggs from +a hen. The sex instinct will be eradicated. Procreation will be an annual +formality like the renewal of a ration card. We shall abolish the orgasm. +Our neurologists are at work upon it now. There will be no loyalty, except +loyalty towards the Party. There will be no love, except the love of +Big Brother. There will be no laughter, except the laugh of triumph over +a defeated enemy. There will be no art, no literature, no science. When +we are omnipotent we shall have no more need of science. There will be +no distinction between beauty and ugliness. There will be no curiosity, +no enjoyment of the process of life. All competing pleasures will be +destroyed. But always--do not forget this, Winston--always there will be +the intoxication of power, constantly increasing and constantly growing +subtler. Always, at every moment, there will be the thrill of victory, +the sensation of trampling on an enemy who is helpless. If you want a +picture of the future, imagine a boot stamping on a human face--for ever.' + +He paused as though he expected Winston to speak. Winston had tried to +shrink back into the surface of the bed again. He could not say anything. +His heart seemed to be frozen. O'Brien went on: + +'And remember that it is for ever. The face will always be there to be +stamped upon. The heretic, the enemy of society, will always be there, so +that he can be defeated and humiliated over again. Everything that you +have undergone since you have been in our hands--all that will continue, +and worse. The espionage, the betrayals, the arrests, the tortures, the +executions, the disappearances will never cease. It will be a world of +terror as much as a world of triumph. The more the Party is powerful, the +less it will be tolerant: the weaker the opposition, the tighter the +despotism. Goldstein and his heresies will live for ever. Every day, at +every moment, they will be defeated, discredited, ridiculed, spat upon and +yet they will always survive. This drama that I have played out with you +during seven years will be played out over and over again generation after +generation, always in subtler forms. Always we shall have the heretic here +at our mercy, screaming with pain, broken up, contemptible--and in the end +utterly penitent, saved from himself, crawling to our feet of his own +accord. That is the world that we are preparing, Winston. A world of +victory after victory, triumph after triumph after triumph: an endless +pressing, pressing, pressing upon the nerve of power. You are beginning, +I can see, to realize what that world will be like. But in the end you +will do more than understand it. You will accept it, welcome it, become +part of it.' + +Winston had recovered himself sufficiently to speak. 'You can't!' he said +weakly. + +'What do you mean by that remark, Winston?' + +'You could not create such a world as you have just described. It is a +dream. It is impossible.' + +'Why?' + +'It is impossible to found a civilization on fear and hatred and cruelty. +It would never endure.' + +'Why not?' + +'It would have no vitality. It would disintegrate. It would commit +suicide.' + +'Nonsense. You are under the impression that hatred is more exhausting +than love. Why should it be? And if it were, what difference would that +make? Suppose that we choose to wear ourselves out faster. Suppose that we +quicken the tempo of human life till men are senile at thirty. Still what +difference would it make? Can you not understand that the death of the +individual is not death? The party is immortal.' + +As usual, the voice had battered Winston into helplessness. Moreover he +was in dread that if he persisted in his disagreement O'Brien would twist +the dial again. And yet he could not keep silent. Feebly, without +arguments, with nothing to support him except his inarticulate horror of +what O'Brien had said, he returned to the attack. + +'I don't know--I don't care. Somehow you will fail. Something will defeat +you. Life will defeat you.' + +'We control life, Winston, at all its levels. You are imagining that there +is something called human nature which will be outraged by what we do and +will turn against us. But we create human nature. Men are infinitely +malleable. Or perhaps you have returned to your old idea that the +proletarians or the slaves will arise and overthrow us. Put it out of your +mind. They are helpless, like the animals. Humanity is the Party. The +others are outside--irrelevant.' + +'I don't care. In the end they will beat you. Sooner or later they will +see you for what you are, and then they will tear you to pieces.' + +'Do you see any evidence that that is happening? Or any reason why it +should?' + +'No. I believe it. I KNOW that you will fail. There is something in the +universe--I don't know, some spirit, some principle--that you will never +overcome.' + +'Do you believe in God, Winston?' + +'No.' + +'Then what is it, this principle that will defeat us?' + +'I don't know. The spirit of Man.' + +'And do you consider yourself a man?' + +'Yes.' + +'If you are a man, Winston, you are the last man. Your kind is extinct; we +are the inheritors. Do you understand that you are ALONE? You are outside +history, you are non-existent.' His manner changed and he said more +harshly: 'And you consider yourself morally superior to us, with our lies +and our cruelty?' + +'Yes, I consider myself superior.' + +O'Brien did not speak. Two other voices were speaking. After a moment +Winston recognized one of them as his own. It was a sound-track of the +conversation he had had with O'Brien, on the night when he had enrolled +himself in the Brotherhood. He heard himself promising to lie, to steal, +to forge, to murder, to encourage drug-taking and prostitution, to +disseminate venereal diseases, to throw vitriol in a child's face. O'Brien +made a small impatient gesture, as though to say that the demonstration +was hardly worth making. Then he turned a switch and the voices stopped. + +'Get up from that bed,' he said. + +The bonds had loosened themselves. Winston lowered himself to the floor +and stood up unsteadily. + +'You are the last man,' said O'Brien. 'You are the guardian of the human +spirit. You shall see yourself as you are. Take off your clothes.' + +Winston undid the bit of string that held his overalls together. The zip +fastener had long since been wrenched out of them. He could not remember +whether at any time since his arrest he had taken off all his clothes at +one time. Beneath the overalls his body was looped with filthy yellowish +rags, just recognizable as the remnants of underclothes. As he slid +them to the ground he saw that there was a three-sided mirror at the far +end of the room. He approached it, then stopped short. An involuntary cry +had broken out of him. + +'Go on,' said O'Brien. 'Stand between the wings of the mirror. You shall +see the side view as well.' + +He had stopped because he was frightened. A bowed, grey-coloured, +skeleton-like thing was coming towards him. Its actual appearance was +frightening, and not merely the fact that he knew it to be himself. He +moved closer to the glass. The creature's face seemed to be protruded, +because of its bent carriage. A forlorn, jailbird's face with a nobby +forehead running back into a bald scalp, a crooked nose, and +battered-looking cheekbones above which his eyes were fierce and watchful. +The cheeks were seamed, the mouth had a drawn-in look. Certainly it was +his own face, but it seemed to him that it had changed more than he had +changed inside. The emotions it registered would be different from the +ones he felt. He had gone partially bald. For the first moment he had +thought that he had gone grey as well, but it was only the scalp that was +grey. Except for his hands and a circle of his face, his body was grey all +over with ancient, ingrained dirt. Here and there under the dirt there +were the red scars of wounds, and near the ankle the varicose ulcer was an +inflamed mass with flakes of skin peeling off it. But the truly frightening +thing was the emaciation of his body. The barrel of the ribs was as narrow +as that of a skeleton: the legs had shrunk so that the knees were thicker +than the thighs. He saw now what O'Brien had meant about seeing the side +view. The curvature of the spine was astonishing. The thin shoulders were +hunched forward so as to make a cavity of the chest, the scraggy neck +seemed to be bending double under the weight of the skull. At a guess he +would have said that it was the body of a man of sixty, suffering from +some malignant disease. + +'You have thought sometimes,' said O'Brien, 'that my face--the face of a +member of the Inner Party--looks old and worn. What do you think of your +own face?' + +He seized Winston's shoulder and spun him round so that he was facing him. + +'Look at the condition you are in!' he said. 'Look at this filthy grime +all over your body. Look at the dirt between your toes. Look at that +disgusting running sore on your leg. Do you know that you stink like a +goat? Probably you have ceased to notice it. Look at your emaciation. Do +you see? I can make my thumb and forefinger meet round your bicep. I could +snap your neck like a carrot. Do you know that you have lost twenty-five +kilograms since you have been in our hands? Even your hair is coming out +in handfuls. Look!' He plucked at Winston's head and brought away a tuft +of hair. 'Open your mouth. Nine, ten, eleven teeth left. How many had you +when you came to us? And the few you have left are dropping out of your +head. Look here!' + +He seized one of Winston's remaining front teeth between his powerful +thumb and forefinger. A twinge of pain shot through Winston's jaw. O'Brien +had wrenched the loose tooth out by the roots. He tossed it across the +cell. + +'You are rotting away,' he said; 'you are falling to pieces. What are you? +A bag of filth. Now turn around and look into that mirror again. Do you +see that thing facing you? That is the last man. If you are human, that is +humanity. Now put your clothes on again.' + +Winston began to dress himself with slow stiff movements. Until now he had +not seemed to notice how thin and weak he was. Only one thought stirred in +his mind: that he must have been in this place longer than he had imagined. +Then suddenly as he fixed the miserable rags round himself a feeling of +pity for his ruined body overcame him. Before he knew what he was doing +he had collapsed on to a small stool that stood beside the bed and burst +into tears. He was aware of his ugliness, his gracelessness, a bundle of +bones in filthy underclothes sitting weeping in the harsh white light: but +he could not stop himself. O'Brien laid a hand on his shoulder, almost +kindly. + +'It will not last for ever,' he said. 'You can escape from it whenever you +choose. Everything depends on yourself.' + +'You did it!' sobbed Winston. 'You reduced me to this state.' + +'No, Winston, you reduced yourself to it. This is what you accepted when +you set yourself up against the Party. It was all contained in that first +act. Nothing has happened that you did not foresee.' + +He paused, and then went on: + +'We have beaten you, Winston. We have broken you up. You have seen what +your body is like. Your mind is in the same state. I do not think there +can be much pride left in you. You have been kicked and flogged and +insulted, you have screamed with pain, you have rolled on the floor in +your own blood and vomit. You have whimpered for mercy, you have betrayed +everybody and everything. Can you think of a single degradation that has +not happened to you?' + +Winston had stopped weeping, though the tears were still oozing out of his +eyes. He looked up at O'Brien. + +'I have not betrayed Julia,' he said. + +O'Brien looked down at him thoughtfully. 'No,' he said; 'no; that is +perfectly true. You have not betrayed Julia.' + +The peculiar reverence for O'Brien, which nothing seemed able to destroy, +flooded Winston's heart again. How intelligent, he thought, how +intelligent! Never did O'Brien fail to understand what was said to him. +Anyone else on earth would have answered promptly that he HAD betrayed +Julia. For what was there that they had not screwed out of him under the +torture? He had told them everything he knew about her, her habits, her +character, her past life; he had confessed in the most trivial detail +everything that had happened at their meetings, all that he had said to +her and she to him, their black-market meals, their adulteries, their +vague plottings against the Party--everything. And yet, in the sense in +which he intended the word, he had not betrayed her. He had not stopped +loving her; his feelings towards her had remained the same. O'Brien had +seen what he meant without the need for explanation. + +'Tell me,' he said, 'how soon will they shoot me?' + +'It might be a long time,' said O'Brien. 'You are a difficult case. But +don't give up hope. Everyone is cured sooner or later. In the end we shall +shoot you.' + + + + +Chapter 4 + + + +He was much better. He was growing fatter and stronger every day, if it +was proper to speak of days. + +The white light and the humming sound were the same as ever, but the cell +was a little more comfortable than the others he had been in. There was a +pillow and a mattress on the plank bed, and a stool to sit on. They had +given him a bath, and they allowed him to wash himself fairly frequently +in a tin basin. They even gave him warm water to wash with. They had given +him new underclothes and a clean suit of overalls. They had dressed his +varicose ulcer with soothing ointment. They had pulled out the remnants +of his teeth and given him a new set of dentures. + +Weeks or months must have passed. It would have been possible now to keep +count of the passage of time, if he had felt any interest in doing so, +since he was being fed at what appeared to be regular intervals. He was +getting, he judged, three meals in the twenty-four hours; sometimes he +wondered dimly whether he was getting them by night or by day. The food +was surprisingly good, with meat at every third meal. Once there was even +a packet of cigarettes. He had no matches, but the never-speaking guard +who brought his food would give him a light. The first time he tried to +smoke it made him sick, but he persevered, and spun the packet out for +a long time, smoking half a cigarette after each meal. + +They had given him a white slate with a stump of pencil tied to the +corner. At first he made no use of it. Even when he was awake he was +completely torpid. Often he would lie from one meal to the next almost +without stirring, sometimes asleep, sometimes waking into vague reveries +in which it was too much trouble to open his eyes. He had long grown +used to sleeping with a strong light on his face. It seemed to make no +difference, except that one's dreams were more coherent. He dreamed a +great deal all through this time, and they were always happy dreams. He +was in the Golden Country, or he was sitting among enormous glorious, +sunlit ruins, with his mother, with Julia, with O'Brien--not doing +anything, merely sitting in the sun, talking of peaceful things. Such +thoughts as he had when he was awake were mostly about his dreams. He +seemed to have lost the power of intellectual effort, now that the +stimulus of pain had been removed. He was not bored, he had no desire +for conversation or distraction. Merely to be alone, not to be beaten +or questioned, to have enough to eat, and to be clean all over, was +completely satisfying. + +By degrees he came to spend less time in sleep, but he still felt no +impulse to get off the bed. All he cared for was to lie quiet and feel the +strength gathering in his body. He would finger himself here and there, +trying to make sure that it was not an illusion that his muscles were +growing rounder and his skin tauter. Finally it was established beyond a +doubt that he was growing fatter; his thighs were now definitely thicker +than his knees. After that, reluctantly at first, he began exercising +himself regularly. In a little while he could walk three kilometres, +measured by pacing the cell, and his bowed shoulders were growing +straighter. He attempted more elaborate exercises, and was astonished and +humiliated to find what things he could not do. He could not move out of a +walk, he could not hold his stool out at arm's length, he could not stand +on one leg without falling over. He squatted down on his heels, and found +that with agonizing pains in thigh and calf he could just lift himself to +a standing position. He lay flat on his belly and tried to lift his weight +by his hands. It was hopeless, he could not raise himself a centimetre. +But after a few more days--a few more mealtimes--even that feat was +accomplished. A time came when he could do it six times running. He began +to grow actually proud of his body, and to cherish an intermittent belief +that his face also was growing back to normal. Only when he chanced to put +his hand on his bald scalp did he remember the seamed, ruined face that +had looked back at him out of the mirror. + +His mind grew more active. He sat down on the plank bed, his back against +the wall and the slate on his knees, and set to work deliberately at the +task of re-educating himself. + +He had capitulated, that was agreed. In reality, as he saw now, he had +been ready to capitulate long before he had taken the decision. From the +moment when he was inside the Ministry of Love--and yes, even during those +minutes when he and Julia had stood helpless while the iron voice from the +telescreen told them what to do--he had grasped the frivolity, the +shallowness of his attempt to set himself up against the power of the +Party. He knew now that for seven years the Thought Police had watched him +like a beetle under a magnifying glass. There was no physical act, no word +spoken aloud, that they had not noticed, no train of thought that they had +not been able to infer. Even the speck of whitish dust on the cover of his +diary they had carefully replaced. They had played sound-tracks to him, +shown him photographs. Some of them were photographs of Julia and himself. +Yes, even... He could not fight against the Party any longer. Besides, +the Party was in the right. It must be so; how could the immortal, +collective brain be mistaken? By what external standard could you check +its judgements? Sanity was statistical. It was merely a question of +learning to think as they thought. Only----! + +The pencil felt thick and awkward in his fingers. He began to write down +the thoughts that came into his head. He wrote first in large clumsy +capitals: + + +FREEDOM IS SLAVERY + + +Then almost without a pause he wrote beneath it: + + +TWO AND TWO MAKE FIVE + + +But then there came a sort of check. His mind, as though shying away from +something, seemed unable to concentrate. He knew that he knew what came +next, but for the moment he could not recall it. When he did recall it, +it was only by consciously reasoning out what it must be: it did not come +of its own accord. He wrote: + + +GOD IS POWER + + +He accepted everything. The past was alterable. The past never had been +altered. Oceania was at war with Eastasia. Oceania had always been at war +with Eastasia. Jones, Aaronson, and Rutherford were guilty of the crimes +they were charged with. He had never seen the photograph that disproved +their guilt. It had never existed, he had invented it. He remembered +remembering contrary things, but those were false memories, products of +self-deception. How easy it all was! Only surrender, and everything else +followed. It was like swimming against a current that swept you backwards +however hard you struggled, and then suddenly deciding to turn round and +go with the current instead of opposing it. Nothing had changed except +your own attitude: the predestined thing happened in any case. He hardly +knew why he had ever rebelled. Everything was easy, except----! + +Anything could be true. The so-called laws of Nature were nonsense. The +law of gravity was nonsense. 'If I wished,' O'Brien had said, 'I could +float off this floor like a soap bubble.' Winston worked it out. 'If he +THINKS he floats off the floor, and if I simultaneously THINK I see him +do it, then the thing happens.' Suddenly, like a lump of submerged wreckage +breaking the surface of water, the thought burst into his mind: 'It doesn't +really happen. We imagine it. It is hallucination.' He pushed the thought +under instantly. The fallacy was obvious. It presupposed that somewhere +or other, outside oneself, there was a 'real' world where 'real' things +happened. But how could there be such a world? What knowledge have we of +anything, save through our own minds? All happenings are in the mind. +Whatever happens in all minds, truly happens. + +He had no difficulty in disposing of the fallacy, and he was in no danger +of succumbing to it. He realized, nevertheless, that it ought never to +have occurred to him. The mind should develop a blind spot whenever a +dangerous thought presented itself. The process should be automatic, +instinctive. CRIMESTOP, they called it in Newspeak. + +He set to work to exercise himself in crimestop. He presented himself with +propositions--'the Party says the earth is flat', 'the party says that +ice is heavier than water'--and trained himself in not seeing or not +understanding the arguments that contradicted them. It was not easy. +It needed great powers of reasoning and improvisation. The arithmetical +problems raised, for instance, by such a statement as 'two and two make +five' were beyond his intellectual grasp. It needed also a sort of +athleticism of mind, an ability at one moment to make the most delicate +use of logic and at the next to be unconscious of the crudest logical +errors. Stupidity was as necessary as intelligence, and as difficult to +attain. + +All the while, with one part of his mind, he wondered how soon they would +shoot him. 'Everything depends on yourself,' O'Brien had said; but he knew +that there was no conscious act by which he could bring it nearer. It +might be ten minutes hence, or ten years. They might keep him for years in +solitary confinement, they might send him to a labour-camp, they might +release him for a while, as they sometimes did. It was perfectly possible +that before he was shot the whole drama of his arrest and interrogation +would be enacted all over again. The one certain thing was that death +never came at an expected moment. The tradition--the unspoken tradition: +somehow you knew it, though you never heard it said--was that they shot +you from behind; always in the back of the head, without warning, as you +walked down a corridor from cell to cell. + +One day--but 'one day' was not the right expression; just as probably it +was in the middle of the night: once--he fell into a strange, blissful +reverie. He was walking down the corridor, waiting for the bullet. He knew +that it was coming in another moment. Everything was settled, smoothed +out, reconciled. There were no more doubts, no more arguments, no more +pain, no more fear. His body was healthy and strong. He walked easily, +with a joy of movement and with a feeling of walking in sunlight. He was +not any longer in the narrow white corridors in the Ministry of Love, he +was in the enormous sunlit passage, a kilometre wide, down which he had +seemed to walk in the delirium induced by drugs. He was in the Golden +Country, following the foot-track across the old rabbit-cropped pasture. +He could feel the short springy turf under his feet and the gentle sunshine +on his face. At the edge of the field were the elm trees, faintly stirring, +and somewhere beyond that was the stream where the dace lay in the green +pools under the willows. + +Suddenly he started up with a shock of horror. The sweat broke out on his +backbone. He had heard himself cry aloud: + +'Julia! Julia! Julia, my love! Julia!' + +For a moment he had had an overwhelming hallucination of her presence. She +had seemed to be not merely with him, but inside him. It was as though she +had got into the texture of his skin. In that moment he had loved her far +more than he had ever done when they were together and free. Also he knew +that somewhere or other she was still alive and needed his help. + +He lay back on the bed and tried to compose himself. What had he done? How +many years had he added to his servitude by that moment of weakness? + +In another moment he would hear the tramp of boots outside. They could not +let such an outburst go unpunished. They would know now, if they had not +known before, that he was breaking the agreement he had made with them. +He obeyed the Party, but he still hated the Party. In the old days he had +hidden a heretical mind beneath an appearance of conformity. Now he had +retreated a step further: in the mind he had surrendered, but he had hoped +to keep the inner heart inviolate. He knew that he was in the wrong, but +he preferred to be in the wrong. They would understand that--O'Brien would +understand it. It was all confessed in that single foolish cry. + +He would have to start all over again. It might take years. He ran a hand +over his face, trying to familiarize himself with the new shape. There +were deep furrows in the cheeks, the cheekbones felt sharp, the nose +flattened. Besides, since last seeing himself in the glass he had been +given a complete new set of teeth. It was not easy to preserve +inscrutability when you did not know what your face looked like. In any +case, mere control of the features was not enough. For the first time he +perceived that if you want to keep a secret you must also hide it from +yourself. You must know all the while that it is there, but until it is +needed you must never let it emerge into your consciousness in any shape +that could be given a name. From now onwards he must not only think right; +he must feel right, dream right. And all the while he must keep his hatred +locked up inside him like a ball of matter which was part of himself and +yet unconnected with the rest of him, a kind of cyst. + +One day they would decide to shoot him. You could not tell when it would +happen, but a few seconds beforehand it should be possible to guess. It +was always from behind, walking down a corridor. Ten seconds would be +enough. In that time the world inside him could turn over. And then +suddenly, without a word uttered, without a check in his step, without the +changing of a line in his face--suddenly the camouflage would be down and +bang! would go the batteries of his hatred. Hatred would fill him like an +enormous roaring flame. And almost in the same instant bang! would go the +bullet, too late, or too early. They would have blown his brain to pieces +before they could reclaim it. The heretical thought would be unpunished, +unrepented, out of their reach for ever. They would have blown a hole in +their own perfection. To die hating them, that was freedom. + +He shut his eyes. It was more difficult than accepting an intellectual +discipline. It was a question of degrading himself, mutilating himself. He +had got to plunge into the filthiest of filth. What was the most horrible, +sickening thing of all? He thought of Big Brother. The enormous face +(because of constantly seeing it on posters he always thought of it as +being a metre wide), with its heavy black moustache and the eyes that +followed you to and fro, seemed to float into his mind of its own accord. +What were his true feelings towards Big Brother? + +There was a heavy tramp of boots in the passage. The steel door swung open +with a clang. O'Brien walked into the cell. Behind him were the waxen-faced +officer and the black-uniformed guards. + +'Get up,' said O'Brien. 'Come here.' + +Winston stood opposite him. O'Brien took Winston's shoulders between his +strong hands and looked at him closely. + +'You have had thoughts of deceiving me,' he said. 'That was stupid. +Stand up straighter. Look me in the face.' + +He paused, and went on in a gentler tone: + +'You are improving. Intellectually there is very little wrong with you. +It is only emotionally that you have failed to make progress. Tell me, +Winston--and remember, no lies: you know that I am always able to detect +a lie--tell me, what are your true feelings towards Big Brother?' + +'I hate him.' + +'You hate him. Good. Then the time has come for you to take the last step. +You must love Big Brother. It is not enough to obey him: you must love +him.' + +He released Winston with a little push towards the guards. + +'Room 101,' he said. + + + + +Chapter 5 + + + +At each stage of his imprisonment he had known, or seemed to know, +whereabouts he was in the windowless building. Possibly there were slight +differences in the air pressure. The cells where the guards had beaten him +were below ground level. The room where he had been interrogated by +O'Brien was high up near the roof. This place was many metres underground, +as deep down as it was possible to go. + +It was bigger than most of the cells he had been in. But he hardly noticed +his surroundings. All he noticed was that there were two small tables +straight in front of him, each covered with green baize. One was only a +metre or two from him, the other was further away, near the door. He was +strapped upright in a chair, so tightly that he could move nothing, not +even his head. A sort of pad gripped his head from behind, forcing him to +look straight in front of him. + +For a moment he was alone, then the door opened and O'Brien came in. + +'You asked me once,' said O'Brien, 'what was in Room 101. I told you that +you knew the answer already. Everyone knows it. The thing that is in +Room 101 is the worst thing in the world.' + +The door opened again. A guard came in, carrying something made of wire, +a box or basket of some kind. He set it down on the further table. Because +of the position in which O'Brien was standing. Winston could not see what +the thing was. + +'The worst thing in the world,' said O'Brien, 'varies from individual to +individual. It may be burial alive, or death by fire, or by drowning, or +by impalement, or fifty other deaths. There are cases where it is some +quite trivial thing, not even fatal.' + +He had moved a little to one side, so that Winston had a better view of +the thing on the table. It was an oblong wire cage with a handle on top +for carrying it by. Fixed to the front of it was something that looked +like a fencing mask, with the concave side outwards. Although it was three +or four metres away from him, he could see that the cage was divided +lengthways into two compartments, and that there was some kind of creature +in each. They were rats. + +'In your case,' said O'Brien, 'the worst thing in the world happens to be +rats.' + +A sort of premonitory tremor, a fear of he was not certain what, had +passed through Winston as soon as he caught his first glimpse of the cage. +But at this moment the meaning of the mask-like attachment in front of it +suddenly sank into him. His bowels seemed to turn to water. + +'You can't do that!' he cried out in a high cracked voice. 'You couldn't, +you couldn't! It's impossible.' + +'Do you remember,' said O'Brien, 'the moment of panic that used to occur +in your dreams? There was a wall of blackness in front of you, and a +roaring sound in your ears. There was something terrible on the other side +of the wall. You knew that you knew what it was, but you dared not drag it +into the open. It was the rats that were on the other side of the wall.' + +'O'Brien!' said Winston, making an effort to control his voice. 'You know +this is not necessary. What is it that you want me to do?' + +O'Brien made no direct answer. When he spoke it was in the schoolmasterish +manner that he sometimes affected. He looked thoughtfully into the +distance, as though he were addressing an audience somewhere behind +Winston's back. + +'By itself,' he said, 'pain is not always enough. There are occasions when +a human being will stand out against pain, even to the point of death. +But for everyone there is something unendurable--something that cannot be +contemplated. Courage and cowardice are not involved. If you are falling +from a height it is not cowardly to clutch at a rope. If you have come up +from deep water it is not cowardly to fill your lungs with air. It is +merely an instinct which cannot be destroyed. It is the same with the +rats. For you, they are unendurable. They are a form of pressure that you +cannot withstand, even if you wished to. You will do what is required of +you.' + +'But what is it, what is it? How can I do it if I don't know what it is?' + +O'Brien picked up the cage and brought it across to the nearer table. +He set it down carefully on the baize cloth. Winston could hear the blood +singing in his ears. He had the feeling of sitting in utter loneliness. +He was in the middle of a great empty plain, a flat desert drenched with +sunlight, across which all sounds came to him out of immense distances. +Yet the cage with the rats was not two metres away from him. They were +enormous rats. They were at the age when a rat's muzzle grows blunt and +fierce and his fur brown instead of grey. + +'The rat,' said O'Brien, still addressing his invisible audience, +'although a rodent, is carnivorous. You are aware of that. You will have +heard of the things that happen in the poor quarters of this town. In some +streets a woman dare not leave her baby alone in the house, even for five +minutes. The rats are certain to attack it. Within quite a small time they +will strip it to the bones. They also attack sick or dying people. They +show astonishing intelligence in knowing when a human being is helpless.' + +There was an outburst of squeals from the cage. It seemed to reach Winston +from far away. The rats were fighting; they were trying to get at each +other through the partition. He heard also a deep groan of despair. +That, too, seemed to come from outside himself. + +O'Brien picked up the cage, and, as he did so, pressed something in it. +There was a sharp click. Winston made a frantic effort to tear himself +loose from the chair. It was hopeless; every part of him, even his head, +was held immovably. O'Brien moved the cage nearer. It was less than a +metre from Winston's face. + +'I have pressed the first lever,' said O'Brien. 'You understand the +construction of this cage. The mask will fit over your head, leaving no +exit. When I press this other lever, the door of the cage will slide up. +These starving brutes will shoot out of it like bullets. Have you ever +seen a rat leap through the air? They will leap on to your face and bore +straight into it. Sometimes they attack the eyes first. Sometimes they +burrow through the cheeks and devour the tongue.' + +The cage was nearer; it was closing in. Winston heard a succession of +shrill cries which appeared to be occurring in the air above his head. But +he fought furiously against his panic. To think, to think, even with a +split second left--to think was the only hope. Suddenly the foul musty +odour of the brutes struck his nostrils. There was a violent convulsion of +nausea inside him, and he almost lost consciousness. Everything had gone +black. For an instant he was insane, a screaming animal. Yet he came out +of the blackness clutching an idea. There was one and only one way to save +himself. He must interpose another human being, the BODY of another human +being, between himself and the rats. + +The circle of the mask was large enough now to shut out the vision of +anything else. The wire door was a couple of hand-spans from his face. The +rats knew what was coming now. One of them was leaping up and down, the +other, an old scaly grandfather of the sewers, stood up, with his pink +hands against the bars, and fiercely sniffed the air. Winston could see +the whiskers and the yellow teeth. Again the black panic took hold of him. +He was blind, helpless, mindless. + +'It was a common punishment in Imperial China,' said O'Brien as +didactically as ever. + +The mask was closing on his face. The wire brushed his cheek. And then--no, +it was not relief, only hope, a tiny fragment of hope. Too late, perhaps +too late. But he had suddenly understood that in the whole world there was +just ONE person to whom he could transfer his punishment--ONE body that he +could thrust between himself and the rats. And he was shouting frantically, +over and over. + +'Do it to Julia! Do it to Julia! Not me! Julia! I don't care what you do +to her. Tear her face off, strip her to the bones. Not me! Julia! Not me!' + +He was falling backwards, into enormous depths, away from the rats. He was +still strapped in the chair, but he had fallen through the floor, through +the walls of the building, through the earth, through the oceans, through +the atmosphere, into outer space, into the gulfs between the stars--always +away, away, away from the rats. He was light years distant, but O'Brien +was still standing at his side. There was still the cold touch of wire +against his cheek. But through the darkness that enveloped him he heard +another metallic click, and knew that the cage door had clicked shut and +not open. + + + + +Chapter 6 + + + +The Chestnut Tree was almost empty. A ray of sunlight slanting through a +window fell on dusty table-tops. It was the lonely hour of fifteen. A +tinny music trickled from the telescreens. + +Winston sat in his usual corner, gazing into an empty glass. Now and again +he glanced up at a vast face which eyed him from the opposite wall. +BIG BROTHER IS WATCHING YOU, the caption said. Unbidden, a waiter came and +filled his glass up with Victory Gin, shaking into it a few drops from +another bottle with a quill through the cork. It was saccharine flavoured +with cloves, the speciality of the cafe. + +Winston was listening to the telescreen. At present only music was coming +out of it, but there was a possibility that at any moment there might be +a special bulletin from the Ministry of Peace. The news from the African +front was disquieting in the extreme. On and off he had been worrying +about it all day. A Eurasian army (Oceania was at war with Eurasia: +Oceania had always been at war with Eurasia) was moving southward at +terrifying speed. The mid-day bulletin had not mentioned any definite +area, but it was probable that already the mouth of the Congo was a +battlefield. Brazzaville and Leopoldville were in danger. One did not have +to look at the map to see what it meant. It was not merely a question of +losing Central Africa: for the first time in the whole war, the territory +of Oceania itself was menaced. + +A violent emotion, not fear exactly but a sort of undifferentiated +excitement, flared up in him, then faded again. He stopped thinking about +the war. In these days he could never fix his mind on any one subject for +more than a few moments at a time. He picked up his glass and drained it +at a gulp. As always, the gin made him shudder and even retch slightly. +The stuff was horrible. The cloves and saccharine, themselves disgusting +enough in their sickly way, could not disguise the flat oily smell; and +what was worst of all was that the smell of gin, which dwelt with him +night and day, was inextricably mixed up in his mind with the smell of +those---- + +He never named them, even in his thoughts, and so far as it was possible +he never visualized them. They were something that he was half-aware of, +hovering close to his face, a smell that clung to his nostrils. As the gin +rose in him he belched through purple lips. He had grown fatter since they +released him, and had regained his old colour--indeed, more than regained +it. His features had thickened, the skin on nose and cheekbones was +coarsely red, even the bald scalp was too deep a pink. A waiter, again +unbidden, brought the chessboard and the current issue of 'The Times', +with the page turned down at the chess problem. Then, seeing that Winston's +glass was empty, he brought the gin bottle and filled it. There was no +need to give orders. They knew his habits. The chessboard was always +waiting for him, his corner table was always reserved; even when the place +was full he had it to himself, since nobody cared to be seen sitting too +close to him. He never even bothered to count his drinks. At irregular +intervals they presented him with a dirty slip of paper which they said +was the bill, but he had the impression that they always undercharged him. +It would have made no difference if it had been the other way about. He +had always plenty of money nowadays. He even had a job, a sinecure, more +highly-paid than his old job had been. + +The music from the telescreen stopped and a voice took over. Winston raised +his head to listen. No bulletins from the front, however. It was merely a +brief announcement from the Ministry of Plenty. In the preceding quarter, +it appeared, the Tenth Three-Year Plan's quota for bootlaces had been +overfulfilled by 98 per cent. + +He examined the chess problem and set out the pieces. It was a tricky +ending, involving a couple of knights. 'White to play and mate in two +moves.' Winston looked up at the portrait of Big Brother. White always +mates, he thought with a sort of cloudy mysticism. Always, without +exception, it is so arranged. In no chess problem since the beginning of +the world has black ever won. Did it not symbolize the eternal, unvarying +triumph of Good over Evil? The huge face gazed back at him, full of calm +power. White always mates. + +The voice from the telescreen paused and added in a different and much +graver tone: 'You are warned to stand by for an important announcement at +fifteen-thirty. Fifteen-thirty! This is news of the highest importance. +Take care not to miss it. Fifteen-thirty!' The tinkling music struck up +again. + +Winston's heart stirred. That was the bulletin from the front; instinct +told him that it was bad news that was coming. All day, with little spurts +of excitement, the thought of a smashing defeat in Africa had been in and +out of his mind. He seemed actually to see the Eurasian army swarming +across the never-broken frontier and pouring down into the tip of Africa +like a column of ants. Why had it not been possible to outflank them in +some way? The outline of the West African coast stood out vividly in his +mind. He picked up the white knight and moved it across the board. THERE +was the proper spot. Even while he saw the black horde racing southward he +saw another force, mysteriously assembled, suddenly planted in their rear, +cutting their communications by land and sea. He felt that by willing it he +was bringing that other force into existence. But it was necessary to act +quickly. If they could get control of the whole of Africa, if they had +airfields and submarine bases at the Cape, it would cut Oceania in two. It +might mean anything: defeat, breakdown, the redivision of the world, the +destruction of the Party! He drew a deep breath. An extraordinary medley +of feeling--but it was not a medley, exactly; rather it was successive +layers of feeling, in which one could not say which layer was +undermost--struggled inside him. + +The spasm passed. He put the white knight back in its place, but for the +moment he could not settle down to serious study of the chess problem. +His thoughts wandered again. Almost unconsciously he traced with his +finger in the dust on the table: + +2+2=5 + +'They can't get inside you,' she had said. But they could get inside you. +'What happens to you here is FOR EVER,' O'Brien had said. That was a true +word. There were things, your own acts, from which you could never recover. +Something was killed in your breast: burnt out, cauterized out. + +He had seen her; he had even spoken to her. There was no danger in it. He +knew as though instinctively that they now took almost no interest in his +doings. He could have arranged to meet her a second time if either of them +had wanted to. Actually it was by chance that they had met. It was in the +Park, on a vile, biting day in March, when the earth was like iron and +all the grass seemed dead and there was not a bud anywhere except a few +crocuses which had pushed themselves up to be dismembered by the wind. He +was hurrying along with frozen hands and watering eyes when he saw her not +ten metres away from him. It struck him at once that she had changed in +some ill-defined way. They almost passed one another without a sign, then +he turned and followed her, not very eagerly. He knew that there was no +danger, nobody would take any interest in him. She did not speak. She +walked obliquely away across the grass as though trying to get rid of him, +then seemed to resign herself to having him at her side. Presently they +were in among a clump of ragged leafless shrubs, useless either for +concealment or as protection from the wind. They halted. It was vilely +cold. The wind whistled through the twigs and fretted the occasional, +dirty-looking crocuses. He put his arm round her waist. + +There was no telescreen, but there must be hidden microphones: besides, +they could be seen. It did not matter, nothing mattered. They could have +lain down on the ground and done THAT if they had wanted to. His flesh +froze with horror at the thought of it. She made no response whatever to +the clasp of his arm; she did not even try to disengage herself. He knew +now what had changed in her. Her face was sallower, and there was a long +scar, partly hidden by the hair, across her forehead and temple; but that +was not the change. It was that her waist had grown thicker, and, in a +surprising way, had stiffened. He remembered how once, after the explosion +of a rocket bomb, he had helped to drag a corpse out of some ruins, and +had been astonished not only by the incredible weight of the thing, but by +its rigidity and awkwardness to handle, which made it seem more like stone +than flesh. Her body felt like that. It occurred to him that the texture +of her skin would be quite different from what it had once been. + +He did not attempt to kiss her, nor did they speak. As they walked back +across the grass, she looked directly at him for the first time. It +was only a momentary glance, full of contempt and dislike. He wondered +whether it was a dislike that came purely out of the past or whether it +was inspired also by his bloated face and the water that the wind kept +squeezing from his eyes. They sat down on two iron chairs, side by side +but not too close together. He saw that she was about to speak. She moved +her clumsy shoe a few centimetres and deliberately crushed a twig. Her +feet seemed to have grown broader, he noticed. + +'I betrayed you,' she said baldly. + +'I betrayed you,' he said. + +She gave him another quick look of dislike. + +'Sometimes,' she said, 'they threaten you with something something you +can't stand up to, can't even think about. And then you say, "Don't do it +to me, do it to somebody else, do it to so-and-so." And perhaps you might +pretend, afterwards, that it was only a trick and that you just said it to +make them stop and didn't really mean it. But that isn't true. At the time +when it happens you do mean it. You think there's no other way of saving +yourself, and you're quite ready to save yourself that way. You WANT it to +happen to the other person. You don't give a damn what they suffer. All +you care about is yourself.' + +'All you care about is yourself,' he echoed. + +'And after that, you don't feel the same towards the other person any +longer.' + +'No,' he said, 'you don't feel the same.' + +There did not seem to be anything more to say. The wind plastered their +thin overalls against their bodies. Almost at once it became embarrassing +to sit there in silence: besides, it was too cold to keep still. She said +something about catching her Tube and stood up to go. + +'We must meet again,' he said. + +'Yes,' she said, 'we must meet again.' + +He followed irresolutely for a little distance, half a pace behind her. +They did not speak again. She did not actually try to shake him off, but +walked at just such a speed as to prevent his keeping abreast of her. +He had made up his mind that he would accompany her as far as the Tube +station, but suddenly this process of trailing along in the cold seemed +pointless and unbearable. He was overwhelmed by a desire not so much to +get away from Julia as to get back to the Chestnut Tree Cafe, which had +never seemed so attractive as at this moment. He had a nostalgic vision +of his corner table, with the newspaper and the chessboard and the +ever-flowing gin. Above all, it would be warm in there. The next moment, +not altogether by accident, he allowed himself to become separated from +her by a small knot of people. He made a half-hearted attempt to catch up, +then slowed down, turned, and made off in the opposite direction. When he +had gone fifty metres he looked back. The street was not crowded, but +already he could not distinguish her. Any one of a dozen hurrying figures +might have been hers. Perhaps her thickened, stiffened body was no longer +recognizable from behind. + +'At the time when it happens,' she had said, 'you do mean it.' He had +meant it. He had not merely said it, he had wished it. He had wished that +she and not he should be delivered over to the---- + +Something changed in the music that trickled from the telescreen. A +cracked and jeering note, a yellow note, came into it. And then--perhaps +it was not happening, perhaps it was only a memory taking on the semblance +of sound--a voice was singing: + + + 'Under the spreading chestnut tree + I sold you and you sold me----' + + +The tears welled up in his eyes. A passing waiter noticed that his glass +was empty and came back with the gin bottle. + +He took up his glass and sniffed at it. The stuff grew not less but more +horrible with every mouthful he drank. But it had become the element he +swam in. It was his life, his death, and his resurrection. It was gin that +sank him into stupor every night, and gin that revived him every morning. +When he woke, seldom before eleven hundred, with gummed-up eyelids and +fiery mouth and a back that seemed to be broken, it would have been +impossible even to rise from the horizontal if it had not been for the +bottle and teacup placed beside the bed overnight. Through the midday +hours he sat with glazed face, the bottle handy, listening to the +telescreen. From fifteen to closing-time he was a fixture in the Chestnut +Tree. No one cared what he did any longer, no whistle woke him, no +telescreen admonished him. Occasionally, perhaps twice a week, he went +to a dusty, forgotten-looking office in the Ministry of Truth and did +a little work, or what was called work. He had been appointed to a +sub-committee of a sub-committee which had sprouted from one of the +innumerable committees dealing with minor difficulties that arose in the +compilation of the Eleventh Edition of the Newspeak Dictionary. They were +engaged in producing something called an Interim Report, but what it was +that they were reporting on he had never definitely found out. It was +something to do with the question of whether commas should be placed +inside brackets, or outside. There were four others on the committee, all +of them persons similar to himself. There were days when they assembled +and then promptly dispersed again, frankly admitting to one another that +there was not really anything to be done. But there were other days when +they settled down to their work almost eagerly, making a tremendous show +of entering up their minutes and drafting long memoranda which were never +finished--when the argument as to what they were supposedly arguing about +grew extraordinarily involved and abstruse, with subtle haggling over +definitions, enormous digressions, quarrels--threats, even, to appeal to +higher authority. And then suddenly the life would go out of them and +they would sit round the table looking at one another with extinct eyes, +like ghosts fading at cock-crow. + +The telescreen was silent for a moment. Winston raised his head again. The +bulletin! But no, they were merely changing the music. He had the map of +Africa behind his eyelids. The movement of the armies was a diagram: a +black arrow tearing vertically southward, and a white arrow horizontally +eastward, across the tail of the first. As though for reassurance he +looked up at the imperturbable face in the portrait. Was it conceivable +that the second arrow did not even exist? + +His interest flagged again. He drank another mouthful of gin, picked up +the white knight and made a tentative move. Check. But it was evidently +not the right move, because---- + +Uncalled, a memory floated into his mind. He saw a candle-lit room with a +vast white-counterpaned bed, and himself, a boy of nine or ten, sitting on +the floor, shaking a dice-box, and laughing excitedly. His mother was +sitting opposite him and also laughing. + +It must have been about a month before she disappeared. It was a moment of +reconciliation, when the nagging hunger in his belly was forgotten and his +earlier affection for her had temporarily revived. He remembered the day +well, a pelting, drenching day when the water streamed down the window-pane +and the light indoors was too dull to read by. The boredom of the two +children in the dark, cramped bedroom became unbearable. Winston whined +and grizzled, made futile demands for food, fretted about the room pulling +everything out of place and kicking the wainscoting until the neighbours +banged on the wall, while the younger child wailed intermittently. In the +end his mother said, 'Now be good, and I'll buy you a toy. A lovely +toy--you'll love it'; and then she had gone out in the rain, to a little +general shop which was still sporadically open nearby, and came back with +a cardboard box containing an outfit of Snakes and Ladders. He could still +remember the smell of the damp cardboard. It was a miserable outfit. The +board was cracked and the tiny wooden dice were so ill-cut that they +would hardly lie on their sides. Winston looked at the thing sulkily and +without interest. But then his mother lit a piece of candle and they sat +down on the floor to play. Soon he was wildly excited and shouting with +laughter as the tiddly-winks climbed hopefully up the ladders and then +came slithering down the snakes again, almost to the starting-point. They +played eight games, winning four each. His tiny sister, too young to +understand what the game was about, had sat propped up against a bolster, +laughing because the others were laughing. For a whole afternoon they had +all been happy together, as in his earlier childhood. + +He pushed the picture out of his mind. It was a false memory. He was +troubled by false memories occasionally. They did not matter so long as +one knew them for what they were. Some things had happened, others had not +happened. He turned back to the chessboard and picked up the white knight +again. Almost in the same instant it dropped on to the board with a +clatter. He had started as though a pin had run into him. + +A shrill trumpet-call had pierced the air. It was the bulletin! Victory! +It always meant victory when a trumpet-call preceded the news. A sort of +electric drill ran through the cafe. Even the waiters had started and +pricked up their ears. + +The trumpet-call had let loose an enormous volume of noise. Already an +excited voice was gabbling from the telescreen, but even as it started +it was almost drowned by a roar of cheering from outside. The news had +run round the streets like magic. He could hear just enough of what was +issuing from the telescreen to realize that it had all happened, as he had +foreseen; a vast seaborne armada had secretly assembled a sudden blow in +the enemy's rear, the white arrow tearing across the tail of the black. +Fragments of triumphant phrases pushed themselves through the din: 'Vast +strategic manoeuvre--perfect co-ordination--utter rout--half a million +prisoners--complete demoralization--control of the whole of Africa--bring +the war within measurable distance of its end--victory--greatest victory +in human history--victory, victory, victory!' + +Under the table Winston's feet made convulsive movements. He had not +stirred from his seat, but in his mind he was running, swiftly running, +he was with the crowds outside, cheering himself deaf. He looked up again +at the portrait of Big Brother. The colossus that bestrode the world! +The rock against which the hordes of Asia dashed themselves in vain! He +thought how ten minutes ago--yes, only ten minutes--there had still been +equivocation in his heart as he wondered whether the news from the front +would be of victory or defeat. Ah, it was more than a Eurasian army that +had perished! Much had changed in him since that first day in the Ministry +of Love, but the final, indispensable, healing change had never happened, +until this moment. + +The voice from the telescreen was still pouring forth its tale of prisoners +and booty and slaughter, but the shouting outside had died down a little. +The waiters were turning back to their work. One of them approached with +the gin bottle. Winston, sitting in a blissful dream, paid no attention +as his glass was filled up. He was not running or cheering any longer. He +was back in the Ministry of Love, with everything forgiven, his soul white +as snow. He was in the public dock, confessing everything, implicating +everybody. He was walking down the white-tiled corridor, with the feeling +of walking in sunlight, and an armed guard at his back. The long-hoped-for +bullet was entering his brain. + +He gazed up at the enormous face. Forty years it had taken him to learn +what kind of smile was hidden beneath the dark moustache. O cruel, needless +misunderstanding! O stubborn, self-willed exile from the loving breast! +Two gin-scented tears trickled down the sides of his nose. But it was all +right, everything was all right, the struggle was finished. He had won +the victory over himself. He loved Big Brother. + + + +THE END + + + +APPENDIX. + +The Principles of Newspeak + + + +Newspeak was the official language of Oceania and had been devised to meet +the ideological needs of Ingsoc, or English Socialism. In the year 1984 +there was not as yet anyone who used Newspeak as his sole means of +communication, either in speech or writing. The leading articles in +'The Times' were written in it, but this was a TOUR DE FORCE which could +only be carried out by a specialist. It was expected that Newspeak would +have finally superseded Oldspeak (or Standard English, as we should +call it) by about the year 2050. Meanwhile it gained ground steadily, all +Party members tending to use Newspeak words and grammatical constructions +more and more in their everyday speech. The version in use in 1984, and +embodied in the Ninth and Tenth Editions of the Newspeak Dictionary, was +a provisional one, and contained many superfluous words and archaic +formations which were due to be suppressed later. It is with the final, +perfected version, as embodied in the Eleventh Edition of the Dictionary, +that we are concerned here. + +The purpose of Newspeak was not only to provide a medium of expression +for the world-view and mental habits proper to the devotees of Ingsoc, +but to make all other modes of thought impossible. It was intended that +when Newspeak had been adopted once and for all and Oldspeak forgotten, +a heretical thought--that is, a thought diverging from the principles of +Ingsoc--should be literally unthinkable, at least so far as thought is +dependent on words. Its vocabulary was so constructed as to give exact and +often very subtle expression to every meaning that a Party member could +properly wish to express, while excluding all other meanings and also the +possibility of arriving at them by indirect methods. This was done partly +by the invention of new words, but chiefly by eliminating undesirable +words and by stripping such words as remained of unorthodox meanings, and +so far as possible of all secondary meanings whatever. To give a single +example. The word FREE still existed in Newspeak, but it could only be +used in such statements as 'This dog is free from lice' or 'This field is +free from weeds'. It could not be used in its old sense of 'politically +free' or 'intellectually free' since political and intellectual freedom no +longer existed even as concepts, and were therefore of necessity nameless. +Quite apart from the suppression of definitely heretical words, reduction +of vocabulary was regarded as an end in itself, and no word that could be +dispensed with was allowed to survive. Newspeak was designed not to extend +but to DIMINISH the range of thought, and this purpose was indirectly +assisted by cutting the choice of words down to a minimum. + +Newspeak was founded on the English language as we now know it, though +many Newspeak sentences, even when not containing newly-created words, +would be barely intelligible to an English-speaker of our own day. Newspeak +words were divided into three distinct classes, known as the A vocabulary, +the B vocabulary (also called compound words), and the C vocabulary. +It will be simpler to discuss each class separately, but the grammatical +peculiarities of the language can be dealt with in the section devoted to +the A vocabulary, since the same rules held good for all three categories. + + +THE A VOCABULARY. The A vocabulary consisted of the words needed for the +business of everyday life--for such things as eating, drinking, working, +putting on one's clothes, going up and down stairs, riding in vehicles, +gardening, cooking, and the like. It was composed almost entirely of words +that we already possess words like HIT, RUN, DOG, TREE, SUGAR, HOUSE, +FIELD--but in comparison with the present-day English vocabulary their +number was extremely small, while their meanings were far more rigidly +defined. All ambiguities and shades of meaning had been purged out of +them. So far as it could be achieved, a Newspeak word of this class was +simply a staccato sound expressing ONE clearly understood concept. It +would have been quite impossible to use the A vocabulary for literary +purposes or for political or philosophical discussion. It was intended +only to express simple, purposive thoughts, usually involving concrete +objects or physical actions. + +The grammar of Newspeak had two outstanding peculiarities. The first of +these was an almost complete interchangeability between different parts of +speech. Any word in the language (in principle this applied even to very +abstract words such as IF or WHEN) could be used either as verb, noun, +adjective, or adverb. Between the verb and the noun form, when they were +of the same root, there was never any variation, this rule of itself +involving the destruction of many archaic forms. The word THOUGHT, for +example, did not exist in Newspeak. Its place was taken by THINK, which +did duty for both noun and verb. No etymological principle was followed +here: in some cases it was the original noun that was chosen for retention, +in other cases the verb. Even where a noun and verb of kindred meaning +were not etymologically connected, one or other of them was frequently +suppressed. There was, for example, no such word as CUT, its meaning being +sufficiently covered by the noun-verb KNIFE. Adjectives were formed by +adding the suffix -FUL to the noun-verb, and adverbs by adding -WISE. Thus +for example, SPEEDFUL meant 'rapid' and SPEEDWISE meant 'quickly'. Certain +of our present-day adjectives, such as GOOD, STRONG, BIG, BLACK, SOFT, +were retained, but their total number was very small. There was little +need for them, since almost any adjectival meaning could be arrived at by +adding -FUL to a noun-verb. None of the now-existing adverbs was retained, +except for a very few already ending in -WISE: the -WISE termination was +invariable. The word WELL, for example, was replaced by GOODWISE. + +In addition, any word--this again applied in principle to every word in +the language--could be negatived by adding the affix UN-, or could be +strengthened by the affix PLUS-, or, for still greater emphasis, +DOUBLEPLUS-. Thus, for example, UNCOLD meant 'warm', while PLUSCOLD and +DOUBLEPLUSCOLD meant, respectively, 'very cold' and 'superlatively cold'. +It was also possible, as in present-day English, to modify the meaning of +almost any word by prepositional affixes such as ANTE-, POST-, UP-, DOWN-, +etc. By such methods it was found possible to bring about an enormous +diminution of vocabulary. Given, for instance, the word GOOD, there was no +need for such a word as BAD, since the required meaning was equally +well--indeed, better--expressed by UNGOOD. All that was necessary, in any +case where two words formed a natural pair of opposites, was to decide +which of them to suppress. DARK, for example, could be replaced by UNLIGHT, +or LIGHT by UNDARK, according to preference. + +The second distinguishing mark of Newspeak grammar was its regularity. +Subject to a few exceptions which are mentioned below all inflexions +followed the same rules. Thus, in all verbs the preterite and the past +participle were the same and ended in -ED. The preterite of STEAL was +STEALED, the preterite of THINK was THINKED, and so on throughout the +language, all such forms as SWAM, GAVE, BROUGHT, SPOKE, TAKEN, etc., being +abolished. All plurals were made by adding -S or -ES as the case might be. +The plurals OF MAN, OX, LIFE, were MANS, OXES, LIFES. Comparison of +adjectives was invariably made by adding -ER, -EST (GOOD, GOODER, GOODEST), +irregular forms and the MORE, MOST formation being suppressed. + +The only classes of words that were still allowed to inflect irregularly +were the pronouns, the relatives, the demonstrative adjectives, and the +auxiliary verbs. All of these followed their ancient usage, except that +WHOM had been scrapped as unnecessary, and the SHALL, SHOULD tenses had +been dropped, all their uses being covered by WILL and WOULD. There were +also certain irregularities in word-formation arising out of the need for +rapid and easy speech. A word which was difficult to utter, or was liable +to be incorrectly heard, was held to be ipso facto a bad word; occasionally +therefore, for the sake of euphony, extra letters were inserted into a word +or an archaic formation was retained. But this need made itself felt +chiefly in connexion with the B vocabulary. WHY so great an importance was +attached to ease of pronunciation will be made clear later in this essay. + + +THE B VOCABULARY. The B vocabulary consisted of words which had been +deliberately constructed for political purposes: words, that is to say, +which not only had in every case a political implication, but were intended +to impose a desirable mental attitude upon the person using them. Without +a full understanding of the principles of Ingsoc it was difficult to use +these words correctly. In some cases they could be translated into +Oldspeak, or even into words taken from the A vocabulary, but this usually +demanded a long paraphrase and always involved the loss of certain +overtones. The B words were a sort of verbal shorthand, often packing +whole ranges of ideas into a few syllables, and at the same time more +accurate and forcible than ordinary language. + +The B words were in all cases compound words. [Compound words such as +SPEAKWRITE, were of course to be found in the A vocabulary, but these were +merely convenient abbreviations and had no special ideological colour.] +They consisted of two or more words, or portions of words, welded together +in an easily pronounceable form. The resulting amalgam was always a +noun-verb, and inflected according to the ordinary rules. To take a single +example: the word GOODTHINK, meaning, very roughly, 'orthodoxy', or, if +one chose to regard it as a verb, 'to think in an orthodox manner'. This +inflected as follows: noun-verb, GOODTHINK; past tense and past participle, +GOODTHINKED; present participle, GOOD-THINKING; adjective, GOODTHINKFUL; +adverb, GOODTHINKWISE; verbal noun, GOODTHINKER. + +The B words were not constructed on any etymological plan. The words of +which they were made up could be any parts of speech, and could be placed +in any order and mutilated in any way which made them easy to pronounce +while indicating their derivation. In the word CRIMETHINK (thoughtcrime), +for instance, the THINK came second, whereas in THINKPOL (Thought Police) +it came first, and in the latter word POLICE had lost its second syllable. +Because of the great difficulty in securing euphony, irregular formations +were commoner in the B vocabulary than in the A vocabulary. For example, +the adjective forms of MINITRUE, MINIPAX, and MINILUV were, respectively, +MINITRUTHFUL, MINIPEACEFUL, and MINILOVELY, simply because -TRUEFUL, +-PAXFUL, and -LOVEFUL were slightly awkward to pronounce. In principle, +however, all B words could inflect, and all inflected in exactly the +same way. + +Some of the B words had highly subtilized meanings, barely intelligible to +anyone who had not mastered the language as a whole. Consider, for example, +such a typical sentence from a 'Times' leading article as OLDTHINKERS +UNBELLYFEEL INGSOC. The shortest rendering that one could make of this +in Oldspeak would be: 'Those whose ideas were formed before the Revolution +cannot have a full emotional understanding of the principles of English +Socialism.' But this is not an adequate translation. To begin with, in +order to grasp the full meaning of the Newspeak sentence quoted above, +one would have to have a clear idea of what is meant by INGSOC. And in +addition, only a person thoroughly grounded in Ingsoc could appreciate +the full force of the word BELLYFEEL, which implied a blind, enthusiastic +acceptance difficult to imagine today; or of the word OLDTHINK, which was +inextricably mixed up with the idea of wickedness and decadence. But the +special function of certain Newspeak words, of which OLDTHINK was one, +was not so much to express meanings as to destroy them. These words, +necessarily few in number, had had their meanings extended until they +contained within themselves whole batteries of words which, as they were +sufficiently covered by a single comprehensive term, could now be scrapped +and forgotten. The greatest difficulty facing the compilers of the Newspeak +Dictionary was not to invent new words, but, having invented them, to make +sure what they meant: to make sure, that is to say, what ranges of words +they cancelled by their existence. + +As we have already seen in the case of the word FREE, words which had +once borne a heretical meaning were sometimes retained for the sake of +convenience, but only with the undesirable meanings purged out of them. +Countless other words such as HONOUR, JUSTICE, MORALITY, INTERNATIONALISM, +DEMOCRACY, SCIENCE, and RELIGION had simply ceased to exist. A few blanket +words covered them, and, in covering them, abolished them. All words +grouping themselves round the concepts of liberty and equality, for +instance, were contained in the single word CRIMETHINK, while all words +grouping themselves round the concepts of objectivity and rationalism +were contained in the single word OLDTHINK. Greater precision would have +been dangerous. What was required in a Party member was an outlook similar +to that of the ancient Hebrew who knew, without knowing much else, that +all nations other than his own worshipped 'false gods'. He did not need to +know that these gods were called Baal, Osiris, Moloch, Ashtaroth, and the +like: probably the less he knew about them the better for his orthodoxy. +He knew Jehovah and the commandments of Jehovah: he knew, therefore, that +all gods with other names or other attributes were false gods. In somewhat +the same way, the party member knew what constituted right conduct, and in +exceedingly vague, generalized terms he knew what kinds of departure from +it were possible. His sexual life, for example, was entirely regulated by +the two Newspeak words SEXCRIME (sexual immorality) and GOODSEX (chastity). +SEXCRIME covered all sexual misdeeds whatever. It covered fornication, +adultery, homosexuality, and other perversions, and, in addition, normal +intercourse practised for its own sake. There was no need to enumerate +them separately, since they were all equally culpable, and, in principle, +all punishable by death. In the C vocabulary, which consisted of scientific +and technical words, it might be necessary to give specialized names to +certain sexual aberrations, but the ordinary citizen had no need of them. +He knew what was meant by GOODSEX--that is to say, normal intercourse +between man and wife, for the sole purpose of begetting children, and +without physical pleasure on the part of the woman: all else was SEXCRIME. +In Newspeak it was seldom possible to follow a heretical thought further +than the perception that it WAS heretical: beyond that point the necessary +words were nonexistent. + +No word in the B vocabulary was ideologically neutral. A great many were +euphemisms. Such words, for instance, as JOYCAMP (forced-labour camp) or +MINIPAX (Ministry of Peace, i.e. Ministry of War) meant almost the exact +opposite of what they appeared to mean. Some words, on the other hand, +displayed a frank and contemptuous understanding of the real nature of +Oceanic society. An example was PROLEFEED, meaning the rubbishy +entertainment and spurious news which the Party handed out to the masses. +Other words, again, were ambivalent, having the connotation 'good' when +applied to the Party and 'bad' when applied to its enemies. But in +addition there were great numbers of words which at first sight appeared +to be mere abbreviations and which derived their ideological colour not +from their meaning, but from their structure. + +So far as it could be contrived, everything that had or might have +political significance of any kind was fitted into the B vocabulary. The +name of every organization, or body of people, or doctrine, or country, or +institution, or public building, was invariably cut down into the familiar +shape; that is, a single easily pronounced word with the smallest number +of syllables that would preserve the original derivation. In the Ministry +of Truth, for example, the Records Department, in which Winston Smith +worked, was called RECDEP, the Fiction Department was called FICDEP, the +Teleprogrammes Department was called TELEDEP, and so on. This was not +done solely with the object of saving time. Even in the early decades of +the twentieth century, telescoped words and phrases had been one of the +characteristic features of political language; and it had been noticed +that the tendency to use abbreviations of this kind was most marked in +totalitarian countries and totalitarian organizations. Examples were such +words as NAZI, GESTAPO, COMINTERN, INPRECORR, AGITPROP. In the beginning +the practice had been adopted as it were instinctively, but in Newspeak +it was used with a conscious purpose. It was perceived that in thus +abbreviating a name one narrowed and subtly altered its meaning, by +cutting out most of the associations that would otherwise cling to it. +The words COMMUNIST INTERNATIONAL, for instance, call up a composite +picture of universal human brotherhood, red flags, barricades, Karl Marx, +and the Paris Commune. The word COMINTERN, on the other hand, suggests +merely a tightly-knit organization and a well-defined body of doctrine. +It refers to something almost as easily recognized, and as limited in +purpose, as a chair or a table. COMINTERN is a word that can be uttered +almost without taking thought, whereas COMMUNIST INTERNATIONAL is a phrase +over which one is obliged to linger at least momentarily. In the same way, +the associations called up by a word like MINITRUE are fewer and more +controllable than those called up by MINISTRY OF TRUTH. This accounted not +only for the habit of abbreviating whenever possible, but also for the +almost exaggerated care that was taken to make every word easily +pronounceable. + +In Newspeak, euphony outweighed every consideration other than exactitude +of meaning. Regularity of grammar was always sacrificed to it when it +seemed necessary. And rightly so, since what was required, above all for +political purposes, was short clipped words of unmistakable meaning which +could be uttered rapidly and which roused the minimum of echoes in the +speaker's mind. The words of the B vocabulary even gained in force from +the fact that nearly all of them were very much alike. Almost invariably +these words--GOODTHINK, MINIPAX, PROLEFEED, SEXCRIME, JOYCAMP, INGSOC, +BELLYFEEL, THINKPOL, and countless others--were words of two or three +syllables, with the stress distributed equally between the first syllable +and the last. The use of them encouraged a gabbling style of speech, at +once staccato and monotonous. And this was exactly what was aimed at. The +intention was to make speech, and especially speech on any subject not +ideologically neutral, as nearly as possible independent of consciousness. +For the purposes of everyday life it was no doubt necessary, or sometimes +necessary, to reflect before speaking, but a Party member called upon to +make a political or ethical judgement should be able to spray forth the +correct opinions as automatically as a machine gun spraying forth bullets. +His training fitted him to do this, the language gave him an almost +foolproof instrument, and the texture of the words, with their harsh sound +and a certain wilful ugliness which was in accord with the spirit of +Ingsoc, assisted the process still further. + +So did the fact of having very few words to choose from. Relative to our +own, the Newspeak vocabulary was tiny, and new ways of reducing it were +constantly being devised. Newspeak, indeed, differed from most all other +languages in that its vocabulary grew smaller instead of larger every +year. Each reduction was a gain, since the smaller the area of choice, +the smaller the temptation to take thought. Ultimately it was hoped to +make articulate speech issue from the larynx without involving the higher +brain centres at all. This aim was frankly admitted in the Newspeak word +DUCKSPEAK, meaning 'to quack like a duck'. Like various other words in +the B vocabulary, DUCKSPEAK was ambivalent in meaning. Provided that the +opinions which were quacked out were orthodox ones, it implied nothing but +praise, and when 'The Times' referred to one of the orators of the Party +as a DOUBLEPLUSGOOD DUCKSPEAKER it was paying a warm and valued compliment. + + +THE C VOCABULARY. The C vocabulary was supplementary to the others and +consisted entirely of scientific and technical terms. These resembled the +scientific terms in use today, and were constructed from the same roots, +but the usual care was taken to define them rigidly and strip them of +undesirable meanings. They followed the same grammatical rules as the +words in the other two vocabularies. Very few of the C words had any +currency either in everyday speech or in political speech. Any scientific +worker or technician could find all the words he needed in the list devoted +to his own speciality, but he seldom had more than a smattering of the +words occurring in the other lists. Only a very few words were common to +all lists, and there was no vocabulary expressing the function of Science +as a habit of mind, or a method of thought, irrespective of its particular +branches. There was, indeed, no word for 'Science', any meaning that it +could possibly bear being already sufficiently covered by the word INGSOC. + +From the foregoing account it will be seen that in Newspeak the expression +of unorthodox opinions, above a very low level, was well-nigh impossible. +It was of course possible to utter heresies of a very crude kind, a +species of blasphemy. It would have been possible, for example, to say +BIG BROTHER IS UNGOOD. But this statement, which to an orthodox ear merely +conveyed a self-evident absurdity, could not have been sustained by +reasoned argument, because the necessary words were not available. Ideas +inimical to Ingsoc could only be entertained in a vague wordless form, +and could only be named in very broad terms which lumped together and +condemned whole groups of heresies without defining them in doing so. +One could, in fact, only use Newspeak for unorthodox purposes by +illegitimately translating some of the words back into Oldspeak. For +example, ALL MANS ARE EQUAL was a possible Newspeak sentence, but only +in the same sense in which ALL MEN ARE REDHAIRED is a possible Oldspeak +sentence. It did not contain a grammatical error, but it expressed +a palpable untruth--i.e. that all men are of equal size, weight, or +strength. The concept of political equality no longer existed, and this +secondary meaning had accordingly been purged out of the word EQUAL. +In 1984, when Oldspeak was still the normal means of communication, +the danger theoretically existed that in using Newspeak words one might +remember their original meanings. In practice it was not difficult for +any person well grounded in DOUBLETHINK to avoid doing this, but within +a couple of generations even the possibility of such a lapse would have +vanished. A person growing up with Newspeak as his sole language would no +more know that EQUAL had once had the secondary meaning of 'politically +equal', or that FREE had once meant 'intellectually free', than for +instance, a person who had never heard of chess would be aware of the +secondary meanings attaching to QUEEN and ROOK. There would be many +crimes and errors which it would be beyond his power to commit, simply +because they were nameless and therefore unimaginable. And it was to be +foreseen that with the passage of time the distinguishing characteristics +of Newspeak would become more and more pronounced--its words growing +fewer and fewer, their meanings more and more rigid, and the chance of +putting them to improper uses always diminishing. + +When Oldspeak had been once and for all superseded, the last link with +the past would have been severed. History had already been rewritten, +but fragments of the literature of the past survived here and there, +imperfectly censored, and so long as one retained one's knowledge of +Oldspeak it was possible to read them. In the future such fragments, even +if they chanced to survive, would be unintelligible and untranslatable. +It was impossible to translate any passage of Oldspeak into Newspeak unless +it either referred to some technical process or some very simple everyday +action, or was already orthodox (GOODTHINKFUL would be the Newspeak +expression) in tendency. In practice this meant that no book written before +approximately 1960 could be translated as a whole. Pre-revolutionary +literature could only be subjected to ideological translation--that is, +alteration in sense as well as language. Take for example the well-known +passage from the Declaration of Independence: + + +WE HOLD THESE TRUTHS TO BE SELF-EVIDENT, THAT ALL MEN ARE CREATED EQUAL, +THAT THEY ARE ENDOWED BY THEIR CREATOR WITH CERTAIN INALIENABLE RIGHTS, +THAT AMONG THESE ARE LIFE, LIBERTY, AND THE PURSUIT OF HAPPINESS. +THAT TO SECURE THESE RIGHTS, GOVERNMENTS ARE INSTITUTED AMONG MEN, +DERIVING THEIR POWERS FROM THE CONSENT OF THE GOVERNED. THAT WHENEVER +ANY FORM OF GOVERNMENT BECOMES DESTRUCTIVE OF THOSE ENDS, IT IS THE RIGHT +OF THE PEOPLE TO ALTER OR ABOLISH IT, AND TO INSTITUTE NEW GOVERNMENT... + + +It would have been quite impossible to render this into Newspeak while +keeping to the sense of the original. The nearest one could come to doing +so would be to swallow the whole passage up in the single word CRIMETHINK. +A full translation could only be an ideological translation, whereby +Jefferson's words would be changed into a panegyric on absolute government. + +A good deal of the literature of the past was, indeed, already being +transformed in this way. Considerations of prestige made it desirable to +preserve the memory of certain historical figures, while at the same time +bringing their achievements into line with the philosophy of Ingsoc. +Various writers, such as Shakespeare, Milton, Swift, Byron, Dickens, and +some others were therefore in process of translation: when the task had +been completed, their original writings, with all else that survived of +the literature of the past, would be destroyed. These translations were +a slow and difficult business, and it was not expected that they would +be finished before the first or second decade of the twenty-first +century. There were also large quantities of merely utilitarian +literature--indispensable technical manuals, and the like--that had to +be treated in the same way. It was chiefly in order to allow time for +the preliminary work of translation that the final adoption of Newspeak +had been fixed for so late a date as 2050. + + + +THE END diff --git a/radix_trie-0.2.1/data/sun-rising.txt b/radix_trie-0.2.1/data/sun-rising.txt new file mode 100644 index 0000000000..f9aed2e3f4 --- /dev/null +++ b/radix_trie-0.2.1/data/sun-rising.txt @@ -0,0 +1,32 @@ +BUSY old fool, unruly Sun, +Why dost thou thus, +Through windows, and through curtains, call on us ? +Must to thy motions lovers' seasons run ? +Saucy pedantic wretch, go chide +Late school-boys and sour prentices, +Go tell court-huntsmen that the king will ride, +Call country ants to harvest offices ; +Love, all alike, no season knows nor clime, +Nor hours, days, months, which are the rags of time. + +Thy beams so reverend, and strong +Why shouldst thou think ? +I could eclipse and cloud them with a wink, +But that I would not lose her sight so long. +If her eyes have not blinded thine, +Look, and to-morrow late tell me, +Whether both th' Indias of spice and mine +Be where thou left'st them, or lie here with me. +Ask for those kings whom thou saw'st yesterday, +And thou shalt hear, "All here in one bed lay." + +She's all states, and all princes I ; +Nothing else is ; +Princes do but play us ; compared to this, +All honour's mimic, all wealth alchemy. +Thou, Sun, art half as happy as we, +In that the world's contracted thus ; +Thine age asks ease, and since thy duties be +To warm the world, that's done in warming us. +Shine here to us, and thou art everywhere ; +This bed thy center is, these walls thy sphere. diff --git a/radix_trie-0.2.1/examples/child_iter.rs b/radix_trie-0.2.1/examples/child_iter.rs new file mode 100644 index 0000000000..d137d7340f --- /dev/null +++ b/radix_trie-0.2.1/examples/child_iter.rs @@ -0,0 +1,20 @@ +extern crate radix_trie; + +use radix_trie::{Trie, TrieCommon}; + +fn main() { + let mut t = Trie::new(); + t.insert("z", 2); + t.insert("aba", 5); + t.insert("abb", 6); + t.insert("abc", 50); + + // This is a bit of a hack that relies on knowing the binary representation of + // strings... "abd" works, but "abz" doesn't... + let ab_sum = t.get_raw_ancestor(&"abd").children().fold(0, |acc, c| { + println!("Iterating over child with value: {:?}", c.value()); + acc + *c.value().unwrap_or(&0) + }); + println!("{}", ab_sum); + assert_eq!(ab_sum, 5 + 6 + 50); +} diff --git a/radix_trie-0.2.1/examples/debug.rs b/radix_trie-0.2.1/examples/debug.rs new file mode 100644 index 0000000000..df07b7f18c --- /dev/null +++ b/radix_trie-0.2.1/examples/debug.rs @@ -0,0 +1,13 @@ +extern crate radix_trie; + +use radix_trie::Trie; + +fn main() { + let mut trie = Trie::new(); + trie.insert("hello", 19u32); + trie.insert("hellcat", 35u32); + trie.insert("not related", 1u32); + trie.insert("handle nested", 5u32); + + println!("{:#?}", trie); +} diff --git a/radix_trie-0.2.1/examples/opt.rs b/radix_trie-0.2.1/examples/opt.rs new file mode 100644 index 0000000000..312c233c06 --- /dev/null +++ b/radix_trie-0.2.1/examples/opt.rs @@ -0,0 +1,17 @@ +extern crate radix_trie; + +use radix_trie::*; + +fn main() { + let mut trie = Trie::new(); + let mut key = vec![]; + for i in 0..10_000 { + key.push(0); + trie.insert(key.clone(), i); + key.pop(); + key.push(1); + trie.insert(key.clone(), i); + } + //let res = trie.remove(&blow_stack); + //println!("{}", res.unwrap()); +} diff --git a/radix_trie-0.2.1/examples/string_frequency.rs b/radix_trie-0.2.1/examples/string_frequency.rs new file mode 100644 index 0000000000..35d507a413 --- /dev/null +++ b/radix_trie-0.2.1/examples/string_frequency.rs @@ -0,0 +1,34 @@ +extern crate radix_trie; + +use radix_trie::{Trie, TrieCommon}; + +fn main() { + let example = "bananaphone".to_string(); + // Our frequency trie will store various strings with the frequency that they are used + let mut trie: Trie = Trie::new(); + let v: Vec = example.chars().collect(); + + // We want the frequencies of all strings from 1 to 3 characters long + for window_length in 1..4 { + for a in v.windows(window_length) { + // Create a new String to hold our key + let mut s = String::new(); + // Append all chars in a to the String + s.extend(a); + // If the value at s exists, add 1. Otherwise, assign 1 as the key's value. + trie.map_with_default(s, |v| *v += 1, 1); + } + } + + // Iterate through all the values in the trie and print them with their frequencies. + // Iterates and prints in lexicographic order. + println!("All trie nodes"); + for (k, v) in trie.iter() { + println!("{}: {}", k, v); + } + + println!("All children of 'a'"); + for n in trie.subtrie(&"a".to_string()).unwrap().children() { + println!("{}: {}", n.key().unwrap(), n.value().unwrap()); + } +} diff --git a/radix_trie-0.2.1/src/iter.rs b/radix_trie-0.2.1/src/iter.rs new file mode 100644 index 0000000000..6c430403ed --- /dev/null +++ b/radix_trie-0.2.1/src/iter.rs @@ -0,0 +1,187 @@ +//! Iterators over key-value pairs, keys, values and child subtries. + +use std::iter::{FilterMap, FromIterator, Map}; +use std::slice; + +use crate::TrieNode; +use crate::{SubTrie, Trie, TrieKey}; + +use nibble_vec::Nibblet; + +// MY EYES. +type Child = Box>; +type RawChildIter<'a, K, V> = slice::Iter<'a, Option>>; +type ChildMapFn<'a, K, V> = fn(&'a Option>) -> Option<&'a Child>; +type ChildIter<'a, K, V> = FilterMap, ChildMapFn<'a, K, V>>; + +/// Iterator over the keys and values of a Trie. +pub struct Iter<'a, K: 'a, V: 'a> { + root: &'a TrieNode, + root_visited: bool, + stack: Vec>, +} + +impl<'a, K, V> Iter<'a, K, V> { + // TODO: make this private somehow (and same for the other iterators). + pub fn new(root: &'a TrieNode) -> Iter<'a, K, V> { + Iter { + root: root, + root_visited: false, + stack: vec![], + } + } +} + +/// Iterator over the keys of a Trie. +pub struct Keys<'a, K: 'a, V: 'a> { + inner: Map, KeyMapFn<'a, K, V>>, +} + +type KeyMapFn<'a, K, V> = fn((&'a K, &'a V)) -> &'a K; + +impl<'a, K, V> Keys<'a, K, V> { + pub fn new(iter: Iter<'a, K, V>) -> Keys<'a, K, V> { + fn first<'b, K, V>((k, _): (&'b K, &'b V)) -> &'b K { + k + } + Keys { + inner: iter.map(first), + } + } +} + +impl<'a, K, V> Iterator for Keys<'a, K, V> { + type Item = &'a K; + + fn next(&mut self) -> Option<&'a K> { + self.inner.next() + } +} + +/// Iterator over the values of a Trie. +pub struct Values<'a, K: 'a, V: 'a> { + inner: Map, ValueMapFn<'a, K, V>>, +} + +type ValueMapFn<'a, K, V> = fn((&'a K, &'a V)) -> &'a V; + +impl<'a, K, V> Values<'a, K, V> { + pub fn new(iter: Iter<'a, K, V>) -> Values<'a, K, V> { + fn second<'b, K, V>((_, v): (&'b K, &'b V)) -> &'b V { + v + } + Values { + inner: iter.map(second), + } + } +} + +impl<'a, K, V> Iterator for Values<'a, K, V> { + type Item = &'a V; + + fn next(&mut self) -> Option<&'a V> { + self.inner.next() + } +} + +/// Iterator over the child subtries of a trie. +pub struct Children<'a, K: 'a, V: 'a> { + prefix: Nibblet, + inner: ChildIter<'a, K, V>, +} + +impl<'a, K, V> Children<'a, K, V> { + pub fn new(key: Nibblet, node: &'a TrieNode) -> Self { + Children { + prefix: key, + inner: node.child_iter(), + } + } +} + +impl<'a, K, V> Iterator for Children<'a, K, V> { + type Item = SubTrie<'a, K, V>; + + fn next(&mut self) -> Option> { + self.inner.next().map(|node| SubTrie { + prefix: self.prefix.clone().join(&node.key), + node: node, + }) + } +} + +impl TrieNode { + /// Helper function to get all the non-empty children of a node. + fn child_iter(&self) -> ChildIter { + fn id(x: &Option>) -> Option<&Child> { + x.as_ref() + } + + self.children.iter().filter_map(id) + } + + /// Get the key and value of a node as a pair. + fn kv_as_pair(&self) -> Option<(&K, &V)> { + self.key_value.as_ref().map(|kv| (&kv.key, &kv.value)) + } +} + +enum IterAction<'a, K: 'a, V: 'a> { + Push(&'a TrieNode), + Pop, +} + +impl<'a, K, V> Iterator for Iter<'a, K, V> { + type Item = (&'a K, &'a V); + + fn next(&mut self) -> Option { + use self::IterAction::*; + + // Visit each node as it is reached from its parent (with special root handling). + if !self.root_visited { + self.root_visited = true; + self.stack.push(self.root.child_iter()); + if let Some(kv) = self.root.kv_as_pair() { + return Some(kv); + } + } + + loop { + let action = match self.stack.last_mut() { + Some(stack_top) => match stack_top.next() { + Some(child) => Push(child), + None => Pop, + }, + None => return None, + }; + + match action { + Push(trie) => { + self.stack.push(trie.child_iter()); + if let Some(kv) = trie.kv_as_pair() { + return Some(kv); + } + } + Pop => { + self.stack.pop(); + } + } + } + } +} + +impl FromIterator<(K, V)> for Trie +where + K: TrieKey, +{ + fn from_iter(iter: T) -> Trie + where + T: IntoIterator, + { + let mut trie = Trie::new(); + for (k, v) in iter { + trie.insert(k, v); + } + trie + } +} diff --git a/radix_trie-0.2.1/src/keys.rs b/radix_trie-0.2.1/src/keys.rs new file mode 100644 index 0000000000..4d226e72ed --- /dev/null +++ b/radix_trie-0.2.1/src/keys.rs @@ -0,0 +1,253 @@ +use endian_type::{BigEndian, LittleEndian}; +use std::ffi::OsString; +use std::path::{Path, PathBuf}; + +use nibble_vec::Nibblet; + +/// Trait for types which can be used to key a Radix Trie. +/// +/// Types that implement this trait should be convertible to a vector of half-bytes (nibbles) +/// such that no two instances of the type convert to the same vector. +/// To protect against faulty behaviour, the trie will **panic** if it finds two distinct keys +/// of type `K` which encode to the same `Nibblet`, so be careful! +/// +/// If you would like to implement this trait for your own type, you need to implement +/// *either* `encode_bytes` or `encode`. You only need to implement one of the two. +/// If you don't implement one, your code will **panic** as soon you use the trie. +/// There is no performance penalty for implementing `encode_bytes` instead of `encode`, +/// so it is preferred except in the case where you require half-byte precision. +/// +/// Many standard types implement this trait already. Integer types are encoded *big-endian* +/// by default but can be encoded little-endian using the `LittleEndian` wrapper type. +pub trait TrieKey: PartialEq + Eq { + /// Encode a value as a vector of bytes. + fn encode_bytes(&self) -> Vec { + panic!("implement this method or TrieKey::encode"); + } + + /// Encode a value as a NibbleVec. + #[inline] + fn encode(&self) -> Nibblet { + Nibblet::from_byte_vec(self.encode_bytes()) + } +} + +/// Key comparison result. +#[derive(Debug)] +pub enum KeyMatch { + /// The keys match up to the given index. + Partial(usize), + /// The first key is a prefix of the second. + FirstPrefix, + /// The second key is a prefix of the first. + SecondPrefix, + /// The keys match exactly. + Full, +} + +/// Compare two Trie keys. +/// +/// Compares `first[start_idx .. ]` to `second`, i.e. only looks at a slice of the first key. +#[inline] +pub fn match_keys(start_idx: usize, first: &Nibblet, second: &Nibblet) -> KeyMatch { + let first_len = first.len() - start_idx; + let min_length = ::std::cmp::min(first_len, second.len()); + + for i in 0..min_length { + if first.get(start_idx + i) != second.get(i) { + return KeyMatch::Partial(i); + } + } + + match (first_len, second.len()) { + (x, y) if x < y => KeyMatch::FirstPrefix, + (x, y) if x == y => KeyMatch::Full, + _ => KeyMatch::SecondPrefix, + } +} + +/// Check two keys for equality and panic if they differ. +#[inline] +pub fn check_keys(key1: &K, key2: &K) +where + K: TrieKey, +{ + if *key1 != *key2 { + panic!("multiple-keys with the same bit representation."); + } +} + +// --- TrieKey Implementations for standard types --- /// + +// This blanket implementation goes into play when specialization is stabilized +// impl TrieKey for T where T: Into> + Clone + Eq + PartialEq { +// fn encode_bytes(&self) -> Vec { +// self.clone().into() +// } +// } + +impl TrieKey for Vec { + #[inline] + fn encode_bytes(&self) -> Vec { + self.clone() + } +} + +impl TrieKey for [u8] { + #[inline] + fn encode_bytes(&self) -> Vec { + self.to_vec() + } +} + +impl TrieKey for String { + #[inline] + fn encode_bytes(&self) -> Vec { + self.as_bytes().encode_bytes() + } +} + +impl TrieKey for str { + #[inline] + fn encode_bytes(&self) -> Vec { + self.as_bytes().encode_bytes() + } +} + +impl<'a, T: ?Sized + TrieKey> TrieKey for &'a T { + #[inline] + fn encode_bytes(&self) -> Vec { + (**self).encode_bytes() + } +} + +impl<'a, T: ?Sized + TrieKey> TrieKey for &'a mut T { + #[inline] + fn encode_bytes(&self) -> Vec { + (**self).encode_bytes() + } +} + +impl TrieKey for i8 { + #[inline] + fn encode_bytes(&self) -> Vec { + let mut v: Vec = Vec::with_capacity(1); + v.push(*self as u8); + v + } +} + +impl TrieKey for u8 { + #[inline] + fn encode_bytes(&self) -> Vec { + let mut v: Vec = Vec::with_capacity(1); + v.push(*self); + v + } +} + +#[cfg(unix)] +impl TrieKey for PathBuf { + fn encode_bytes(&self) -> Vec { + use std::os::unix::ffi::OsStringExt; + let str: OsString = self.clone().into(); + str.into_vec() + } +} + +#[cfg(unix)] +impl TrieKey for Path { + fn encode_bytes(&self) -> Vec { + use std::os::unix::ffi::OsStrExt; + self.as_os_str().as_bytes().encode_bytes() + } +} + +impl TrieKey for LittleEndian +where + T: Eq + Copy, +{ + fn encode_bytes(&self) -> Vec { + self.as_bytes().encode_bytes() + } +} + +impl TrieKey for BigEndian +where + T: Eq + Copy, +{ + fn encode_bytes(&self) -> Vec { + self.as_bytes().to_vec() + } +} + +macro_rules! int_keys { + ( $( $t:ty ),* ) => { + $( + impl TrieKey for $t { + fn encode_bytes(&self) -> Vec { + let be: BigEndian<$t> = From::from(*self); + be.encode_bytes() + } + } + )* + }; +} + +int_keys!(u16, u32, u64, i16, i32, i64, usize, isize); + +macro_rules! vec_int_keys { + ( $( $t:ty ),* ) => { + $( + impl TrieKey for Vec<$t> { + fn encode_bytes(&self) -> Vec { + let mut v = Vec::::with_capacity(self.len() * std::mem::size_of::<$t>()); + for u in self { + v.extend_from_slice(&u.to_be_bytes()); + } + v + } + } + )* + }; +} + +vec_int_keys!(u16, u32, u64, i16, i32, i64, usize, isize); + +#[cfg(test)] +mod test { + pub trait DefaultTrieKey { + fn encode_bytes(&self) -> Vec; + } + + impl> + Clone + PartialEq + Eq> DefaultTrieKey for T { + #[inline] + fn encode_bytes(&self) -> Vec { + self.clone().into() + } + } + + pub trait AsTrieKey { + fn encode_bytes(&self) -> Vec; + } + + impl + Clone + PartialEq + Eq> AsTrieKey for &T { + #[inline] + fn encode_bytes(&self) -> Vec { + self.as_ref().to_vec() + } + } + + macro_rules! encode_bytes { + ($e:expr) => { + (&$e).encode_bytes() + }; + } + + #[test] + fn test_autoref_specialization() { + let _ = encode_bytes!([0_u8]); + let _ = encode_bytes!("hello"); + let _ = encode_bytes!("hello".to_string()); + } +} diff --git a/radix_trie-0.2.1/src/lib.rs b/radix_trie-0.2.1/src/lib.rs new file mode 100644 index 0000000000..60ad7b6772 --- /dev/null +++ b/radix_trie-0.2.1/src/lib.rs @@ -0,0 +1,79 @@ +//! A wonderful, fast, safe, generic radix trie implementation. +//! +//! To get started, see the docs for `Trie` below. + +// #![warn(missing_docs)] + +extern crate endian_type; +extern crate nibble_vec; +#[cfg(test)] +extern crate quickcheck; +#[cfg(test)] +extern crate rand; + +pub use keys::TrieKey; +pub use nibble_vec::NibbleVec; +pub use trie_common::TrieCommon; +use trie_node::TrieNode; + +use nibble_vec::Nibblet; + +#[macro_use] +mod macros; +pub mod iter; +mod keys; +#[cfg(feature = "serde")] +mod serde; +mod subtrie; +mod traversal; +mod trie; +mod trie_common; +mod trie_node; + +#[cfg(test)] +mod qc_test; +#[cfg(test)] +mod test; + +const BRANCH_FACTOR: usize = 16; + +/// Data-structure for storing and querying string-like keys and associated values. +/// +/// Any keys which share a common *prefix* are stored below a single copy of that prefix. +/// This saves space, and also allows the longest prefix of any given key to be found. +/// +/// You can read more about Radix Tries on [Wikipedia][radix-wiki]. +/// +/// Lots of the methods on `Trie` return optional values - they can be composed +/// nicely using `Option::and_then`. +/// +/// [radix-wiki]: http://en.wikipedia.org/wiki/Radix_tree +#[derive(Debug, Clone)] +pub struct Trie { + /// The number of values stored in this sub-trie (this node and all descendants). + length: usize, + /// The main content of this trie. + node: TrieNode, +} + +/// Immutable view of a sub-tree a larger trie. +#[derive(Debug)] +pub struct SubTrie<'a, K: 'a, V: 'a> { + prefix: Nibblet, + node: &'a TrieNode, +} + +/// Mutable view of a sub-tree of a larger trie. +#[derive(Debug)] +pub struct SubTrieMut<'a, K: 'a, V: 'a> { + prefix: Nibblet, + length: &'a mut usize, + node: &'a mut TrieNode, +} + +/// Wrapper for subtrie lookup results. +/// +/// When fetching from a subtrie, if the prefix is wrong you'll get an `Err(())`. +/// Otherwise you'll get an `Ok(_)`, where the contained option value is what would ordinarily +/// be returned by get/insert/whatever. +pub type SubTrieResult = Result, ()>; diff --git a/radix_trie-0.2.1/src/macros.rs b/radix_trie-0.2.1/src/macros.rs new file mode 100644 index 0000000000..73e6e498e9 --- /dev/null +++ b/radix_trie-0.2.1/src/macros.rs @@ -0,0 +1,6 @@ +// Identity macro to allow expansion of the "mutability" token tree. +macro_rules! id { + ($e:item) => { + $e + }; +} diff --git a/radix_trie-0.2.1/src/qc_test.rs b/radix_trie-0.2.1/src/qc_test.rs new file mode 100644 index 0000000000..bc76d65a12 --- /dev/null +++ b/radix_trie-0.2.1/src/qc_test.rs @@ -0,0 +1,274 @@ +//! Proper testing, with QuickCheck. + +use crate::{Trie, TrieCommon, TrieKey}; +use quickcheck::{quickcheck, Arbitrary, Gen}; +use std::collections::{HashMap, HashSet}; +use std::iter::FromIterator; + +#[derive(Clone, Debug, PartialEq, Eq, Hash)] +struct Key(Vec); + +#[derive(Clone, Debug)] +struct RandomKeys(HashSet); + +const MAX_KEYS: usize = 512; +const KEY_RUN_LEN: usize = 8; +const KEY_MAX_VAL: u8 = 4; + +impl Arbitrary for Key { + fn arbitrary(g: &mut G) -> Key { + let len = g.gen::() % KEY_RUN_LEN; + let mut key = Vec::with_capacity(len); + for _ in 0..len { + key.push(g.gen::() % KEY_MAX_VAL); + } + Key(key) + } +} + +impl Key { + fn extend_random(&self, g: &mut G) -> Key { + self.extend(Key::arbitrary(g)) + } + + fn extend(&self, other: Key) -> Key { + let mut key = self.clone(); + key.0.extend(other.0); + key + } + + fn len(&self) -> usize { + self.0.len() + } +} + +impl TrieKey for Key { + fn encode_bytes(&self) -> Vec { + self.0.clone() + } +} + +impl Arbitrary for RandomKeys { + fn arbitrary(g: &mut G) -> RandomKeys { + let num_keys = g.gen::() % MAX_KEYS; + let mut keys = Vec::with_capacity(num_keys); + keys.push(Key::arbitrary(g)); + + for _ in 0..num_keys { + match g.gen::() % 10 { + // Generate a new random key. + 1 => keys.push(Key::arbitrary(g)), + // Extend an existing key. + _ => { + let i = g.gen::() % keys.len(); + let key = keys[i].extend_random(g); + keys.push(key); + } + } + } + + RandomKeys(HashSet::from_iter(keys)) + } +} + +#[test] +fn insert_all_remove_all() { + fn prop(RandomKeys(keys): RandomKeys) -> bool { + let mut trie = Trie::new(); + let mut length = 0; + + for k in &keys { + if trie.insert(k.clone(), k.len()).is_some() { + return false; + } + length += 1; + if trie.len() != length { + return false; + } + } + + if !trie.check_integrity() { + return false; + } + + for k in &keys { + if trie.get(&k) != Some(&k.len()) { + return false; + } + if trie.remove(&k) != Some(k.len()) { + return false; + } + length -= 1; + if trie.len() != length { + return false; + } + if trie.get(&k).is_some() { + return false; + } + } + trie.check_integrity() + } + + quickcheck(prop as fn(RandomKeys) -> bool); +} + +#[test] +fn subtrie() { + fn prop(RandomKeys(keys): RandomKeys) -> bool { + let half = keys.len() / 2; + let first_half = keys.iter().take(half).map(|k| (k.clone(), k.len())); + let trie = Trie::from_iter(first_half); + + // Check node existence for inserted keys. + for k in keys.iter().take(half) { + match trie.subtrie(&k) { + Some(node) => { + if node.value() != Some(&k.len()) { + return false; + } + } + None => return false, + } + } + + // Check that nodes for non-inserted keys don't have values. + for k in keys.iter().skip(half) { + if let Some(node) = trie.subtrie(&k) { + if node.value().is_some() { + return false; + } + } + } + + trie.check_integrity() + } + + quickcheck(prop as fn(RandomKeys) -> bool); +} + +// trie.subtrie(k1).get(k2) should be the same as trie.get(k2) if k1 is a prefix of k2. +#[test] +fn subtrie_get() { + fn prop(trie_keys: RandomKeys, k1: Key, k2: Key) -> bool { + let mut trie = length_trie(trie_keys.0); + trie.insert(k1.clone(), k1.len()); + + let subtrie = trie.subtrie(&k1).unwrap(); + + if k2.0.starts_with(&k1.0) { + subtrie.get(&k2).unwrap() == trie.get(&k2) + } else { + subtrie.get(&k2).is_err() + } + } + + quickcheck(prop as fn(RandomKeys, Key, Key) -> bool); +} + +#[test] +fn subtrie_mut_get() { + fn prop(trie_keys: RandomKeys, k1: Key, k2: Key) -> bool { + let mut trie = length_trie(trie_keys.0); + trie.insert(k1.clone(), k1.len()); + + let subtrie = trie.subtrie_mut(&k1).unwrap(); + + let ok = if k2.0.starts_with(&k1.0) { + subtrie.get(&k2).is_ok() + } else { + subtrie.get(&k2).is_err() + }; + ok && trie.check_integrity() + } + + quickcheck(prop as fn(RandomKeys, Key, Key) -> bool); +} + +#[test] +fn subtrie_insert() { + fn prop(trie_keys: RandomKeys, key_suffixes: RandomKeys, k1: Key) -> bool { + let mut trie = length_trie(trie_keys.0); + trie.insert(k1.clone(), k1.len()); + + { + let mut subtrie = trie.subtrie_mut(&k1).unwrap(); + + let insert_keys = key_suffixes + .0 + .into_iter() + .map(|x| k1.extend(x)) + .collect::>(); + + for k in insert_keys.iter() { + assert!(subtrie.insert(k.clone(), k.len()).is_ok()); + } + + for k in insert_keys.iter() { + match subtrie.get(k) { + Ok(Some(_)) => (), + _ => return false, + } + } + } + + trie.check_integrity() + } + + quickcheck(prop as fn(RandomKeys, RandomKeys, Key) -> bool); +} + +// Construct a trie from a set of keys, with each key mapped to its length. +fn length_trie(keys: HashSet) -> Trie { + let mut t = Trie::new(); + for k in keys { + let len = k.len(); + t.insert(k, len); + } + t +} + +#[test] +fn remove_non_existent() { + fn prop(RandomKeys(insert_keys): RandomKeys, RandomKeys(remove_keys): RandomKeys) -> bool { + let mut trie = length_trie(insert_keys.clone()); + + for k in remove_keys { + if !insert_keys.contains(&k) && trie.remove(&k).is_some() { + return false; + } + } + trie.check_integrity() + } + quickcheck(prop as fn(RandomKeys, RandomKeys) -> bool); +} + +#[test] +fn keys_iter() { + fn prop(RandomKeys(keys): RandomKeys) -> bool { + let trie = length_trie(keys.clone()); + let trie_keys: HashSet = trie.keys().cloned().collect(); + trie_keys == keys + } + quickcheck(prop as fn(RandomKeys) -> bool); +} + +#[test] +fn values_iter() { + // Create a map of values to frequencies. + fn frequency_map>(values: I) -> HashMap { + let mut map = HashMap::new(); + for v in values { + let current_val = map.entry(v).or_insert(0); + *current_val += 1; + } + map + } + + fn prop(RandomKeys(keys): RandomKeys) -> bool { + let trie = length_trie(keys.clone()); + let trie_values: HashMap = frequency_map(trie.values().cloned()); + let key_values = frequency_map(keys.into_iter().map(|k| k.len())); + trie_values == key_values + } + quickcheck(prop as fn(RandomKeys) -> bool); +} diff --git a/radix_trie-0.2.1/src/serde.rs b/radix_trie-0.2.1/src/serde.rs new file mode 100644 index 0000000000..bd0f717495 --- /dev/null +++ b/radix_trie-0.2.1/src/serde.rs @@ -0,0 +1,212 @@ +extern crate serde; + +use self::serde::ser::SerializeMap; +use self::serde::{de, Deserialize, Deserializer, Serialize, Serializer}; +use super::{Trie, TrieCommon, TrieKey}; +use std::fmt::{self, Formatter}; +use std::marker::PhantomData; + +impl Serialize for Trie +where + K: Serialize + TrieKey, + V: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let mut map = serializer.serialize_map(Some(self.len()))?; + for (k, v) in self.iter() { + map.serialize_entry(k, v)?; + } + map.end() + } +} + +struct TrieVisitor { + marker: PhantomData>, +} + +impl TrieVisitor { + fn new() -> Self { + TrieVisitor { + marker: PhantomData, + } + } +} + +impl<'a, K, V> de::Visitor<'a> for TrieVisitor +where + K: Deserialize<'a> + Clone + Eq + PartialEq + TrieKey, + V: Deserialize<'a>, +{ + type Value = Trie; + + fn expecting(&self, formatter: &mut Formatter) -> fmt::Result { + write!(formatter, "a serialized trie") + } + + fn visit_map(self, mut visitor: M) -> Result + where + M: de::MapAccess<'a>, + { + let mut values = Trie::new(); + + while let Some((key, value)) = visitor.next_entry()? { + values.insert(key, value); + } + + Ok(values) + } + + fn visit_unit(self) -> Result + where + E: de::Error, + { + Ok(Trie::new()) + } +} + +impl<'a, K, V> Deserialize<'a> for Trie +where + K: Deserialize<'a> + Clone + Eq + PartialEq + TrieKey, + V: Deserialize<'a>, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'a>, + { + // Instantiate our Visitor and ask the Deserializer to drive + // it over the input data, resulting in an instance of MyMap. + deserializer.deserialize_map(TrieVisitor::new()) + } +} + +#[cfg(test)] +mod test { + extern crate serde_test; + use self::serde_test::Token; + use super::super::Trie; + + macro_rules! tests_de { + ($($name:ident => $value:expr => $tokens:expr,)+) => { + $(#[test] + fn $name() { + // Test ser/de roundtripping + serde_test::assert_de_tokens(&$value, $tokens); + })+ + } + } + + macro_rules! tests_ser { + ($($name:ident => $value:expr => $tokens:expr,)+) => { + $(#[test] + fn $name() { + serde_test::assert_ser_tokens(&$value, $tokens); + })+ + } + } + + macro_rules! trie { + () => { + Trie::new() + }; + ($($key:expr => $value:expr),+) => { + { + let mut map = Trie::new(); + $(map.insert($key, $value);)+ + map + } + } + } + + tests_ser! { + test_ser_empty_trie => Trie::<&str, isize>::new() => &[ + Token::Map { len: Some(0) }, + Token::MapEnd, + ], + test_ser_single_element_trie => trie!["1" => 2] => &[ + Token::Map { len: Some(1) }, + + Token::Str("1"), + Token::I32(2), + Token::MapEnd, + ], + test_ser_multiple_element_trie => trie!["1" => 2, "3" => 4] => &[ + Token::Map { len: Some(2) }, + Token::Str("1"), + Token::I32(2), + + Token::Str("3"), + Token::I32(4), + Token::MapEnd, + ], + test_ser_deep_trie => trie!["1" => trie![], "2" => trie!["3" => 4, "5" => 6]] => &[ + Token::Map { len: Some(2) }, + Token::Str("1"), + Token::Map { len: Some(0) }, + Token::MapEnd, + + Token::Str("2"), + Token::Map { len: Some(2) }, + Token::Str("3"), + Token::I32(4), + + Token::Str("5"), + Token::I32(6), + Token::MapEnd, + Token::MapEnd, + ], + } + + tests_de! { + test_de_empty_trie1 => Trie::::new() => &[ + Token::Unit, + ], + test_de_empty_trie2 => Trie::::new() => &[ + Token::Map { len: Some(0) }, + Token::MapEnd, + ], + test_de_single_element_trie => trie!["1".to_string() => 2] => &[ + Token::Map { len: Some(1) }, + Token::Str("1"), + Token::I32(2), + Token::MapEnd, + ], + test_de_multiple_element_trie => trie!["1".to_string() => 2, "3".to_string() => 4] => &[ + Token::Map { len: Some(2) }, + Token::Str("1"), + Token::I32(2), + + Token::Str("3"), + Token::I32(4), + Token::MapEnd, + ], + test_de_deep_trie => trie!["1".to_string() => trie![], "2".to_string() => trie!["3".to_string() => 4, "5".to_string() => 6]] => &[ + Token::Map { len: Some(2) }, + Token::Str("1"), + Token::Map { len: Some(0) }, + Token::MapEnd, + + Token::Str("2"), + Token::Map { len: Some(2) }, + Token::Str("3"), + Token::I32(4), + + Token::Str("5"), + Token::I32(6), + Token::MapEnd, + Token::MapEnd, + ], + test_de_empty_trie3 => Trie::::new() => &[ + Token::UnitStruct { name: "Anything" }, + ], + test_de_empty_trie4 => Trie::::new() => &[ + Token::Struct { + name: "Anything", + len: 0, + }, + Token::StructEnd, + ], + } +} diff --git a/radix_trie-0.2.1/src/subtrie.rs b/radix_trie-0.2.1/src/subtrie.rs new file mode 100644 index 0000000000..7eeb131684 --- /dev/null +++ b/radix_trie-0.2.1/src/subtrie.rs @@ -0,0 +1,114 @@ +use crate::keys::*; +use crate::TrieNode; +use crate::{SubTrie, SubTrieMut, SubTrieResult}; +use std::borrow::Borrow; + +use nibble_vec::Nibblet; + +impl<'a, K, V> SubTrie<'a, K, V> +where + K: TrieKey, +{ + /// Look up the value for the given key, which should be an extension of this subtrie's key. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type + pub fn get(&self, key: &Q) -> SubTrieResult<&V> + where + K: Borrow, + Q: TrieKey, + { + subtrie_get(&self.prefix, self.node, key) + } +} + +fn subtrie_get<'a, K, Q: ?Sized, V>( + prefix: &Nibblet, + node: &'a TrieNode, + key: &Q, +) -> SubTrieResult<&'a V> +where + K: TrieKey, + K: Borrow, + Q: TrieKey, +{ + let key_enc = key.encode(); + match match_keys(0, prefix, &key_enc) { + KeyMatch::Full => Ok(node.value()), + KeyMatch::FirstPrefix => Ok(node + .get(&stripped(key_enc, prefix)) + .and_then(TrieNode::value)), + _ => Err(()), + } +} + +impl<'a, K, V> SubTrieMut<'a, K, V> +where + K: TrieKey, +{ + /// Mutable reference to the node's value. + pub fn value_mut(&mut self) -> Option<&mut V> { + self.node.value_mut() + } + + /// Look up the value for the given key, which should be an extension of this subtrie's key. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type + pub fn get(&self, key: &Q) -> SubTrieResult<&V> + where + K: Borrow, + Q: TrieKey, + { + subtrie_get(&self.prefix, &*self.node, key) + } + + /// Insert a value in this subtrie. The key should be an extension of this subtrie's key. + pub fn insert(&mut self, key: K, value: V) -> SubTrieResult { + let key_enc = key.encode(); + let previous = match match_keys(0, &self.prefix, &key_enc) { + KeyMatch::Full => self.node.replace_value(key, value), + KeyMatch::FirstPrefix => self + .node + .insert(key, value, stripped(key_enc, &self.prefix)), + _ => { + return Err(()); + } + }; + + if previous.is_none() { + *self.length += 1; + } + + Ok(previous) + } + + /// Remove a value from this subtrie. The key should be an extension of this subtrie's key. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type + pub fn remove(&mut self, key: &Q) -> SubTrieResult + where + K: Borrow, + Q: TrieKey, + { + let key_enc = key.encode(); + let removed = match match_keys(0, &self.prefix, &key_enc) { + KeyMatch::Full => self.node.take_value(key), + KeyMatch::FirstPrefix => self.node.remove(key), + _ => { + return Err(()); + } + }; + + if removed.is_some() { + *self.length -= 1; + } + + Ok(removed) + } +} + +fn stripped(mut key: Nibblet, prefix: &Nibblet) -> Nibblet { + key.split(prefix.len()) +} diff --git a/radix_trie-0.2.1/src/test.rs b/radix_trie-0.2.1/src/test.rs new file mode 100644 index 0000000000..40559d9ccb --- /dev/null +++ b/radix_trie-0.2.1/src/test.rs @@ -0,0 +1,480 @@ +use crate::keys::TrieKey; +use crate::{Trie, TrieCommon}; +use std::collections::HashSet; +use std::iter::FromIterator; + +const TEST_DATA: [(&'static str, u32); 7] = [ + ("abcdefgh", 19), + ("abcdef", 18), + ("abcd", 17), + ("ab", 16), + ("a", 15), + ("acbdef", 30), + ("bcdefgh", 29), +]; + +fn test_trie() -> Trie<&'static str, u32> { + let mut trie = Trie::new(); + + for &(key, val) in &TEST_DATA { + trie.insert(key, val); + assert!(trie.check_integrity()); + } + + trie +} + +#[test] +fn get_nonexistant() { + let trie = test_trie(); + assert!(trie.get(&"nonexistant").is_none()); + assert!(trie.get(&"").is_none()); +} + +#[test] +fn subtrie_nonexistant() { + let trie = test_trie(); + assert!(trie.subtrie(&"nonexistant").is_none()); + assert!(trie.subtrie(&"").is_some()); +} + +#[test] +fn unicode() { + let mut trie = Trie::new(); + trie.insert("bär", 1); + trie.insert("bären", 2); + + assert_eq!(*trie.get("bär").unwrap(), 1); + let values = trie + .get_raw_descendant("bä") + .unwrap() + .values() + .collect::>(); + assert_eq!([1, 2].iter().collect::>(), values); +} + +#[test] +fn subtrie() { + let mut trie = Trie::new(); + trie.insert("hello", 55); + assert!(trie.subtrie(&"h").is_none()); + assert!(trie.subtrie(&"hello").is_some()); +} +#[test] +fn subtrie_string() { + let mut trie = Trie::new(); + trie.insert("hello".to_string(), 55); + + let h = "h".to_string(); + let hello = "hello".to_string(); + + assert!(trie.subtrie(&h).is_none()); + assert!(trie.subtrie(&hello).is_some()); +} + +#[test] +fn empty_key() { + let mut trie = test_trie(); + trie.insert(&"", 99); + assert_eq!(*trie.get(&"").unwrap(), 99); + assert_eq!(trie.remove(&""), Some(99)); +} + +#[test] +fn insert() { + let trie = test_trie(); + + for &(key, val) in &TEST_DATA { + assert_eq!(*trie.get(&key).unwrap(), val); + } + + assert!(trie.check_integrity()); + assert_eq!(trie.len(), TEST_DATA.len()); +} + +#[test] +fn insert_replace() { + let mut trie = Trie::new(); + assert_eq!(trie.insert("haskell", 18), None); + let length = trie.len(); + assert_eq!(trie.insert("haskell", 36), Some(18)); + assert_eq!(trie.len(), length); +} + +#[test] +fn map_with_default() { + let mut trie = test_trie(); + trie.map_with_default(&"abcd", |x| *x = *x + 1, 42); + assert_eq!(*trie.get(&"abcd").unwrap(), 17 + 1); + trie.map_with_default(&"zzz", |x| *x = *x + 1, 42); + assert_eq!(*trie.get(&"zzz").unwrap(), 42); +} + +#[test] +fn remove() { + let mut trie = test_trie(); + + // Remove. + for &(key, val) in &TEST_DATA { + let res = trie.remove(&key); + assert_eq!(res, Some(val)); + assert!(trie.check_integrity()); + } + + // Check non-existance. + for &(key, _) in &TEST_DATA { + assert!(trie.get(&key).is_none()); + } +} + +#[test] +fn remove_simple() { + let mut trie = Trie::new(); + + trie.insert("HELL", 66); + trie.insert("HELLO", 77); + let val = trie.remove(&"HELLO"); + assert_eq!(val, Some(77)); +} + +#[test] +fn remove_non_existent() { + let mut trie = Trie::new(); + + trie.insert("acab", true); + + assert_eq!(trie.remove(&"abc"), None); + assert_eq!(trie.remove(&"acaba"), None); + assert_eq!(trie.remove(&"a"), None); + assert_eq!(trie.remove(&""), None); + assert_eq!(trie.len(), 1); + + trie.insert("acaz", true); + + assert_eq!(trie.remove(&"acb"), None); + assert_eq!(trie.remove(&"acaca"), None); + assert_eq!(trie.remove(&"aca"), None); + assert_eq!(trie.len(), 2); +} + +#[test] +fn nearest_ancestor_root() { + let mut trie = Trie::new(); + trie.insert("", 55); + assert_eq!(trie.get_ancestor_value(&""), Some(&55)); +} + +#[test] +fn nearest_ancestor() { + let trie = test_trie(); + assert_eq!(trie.get_ancestor_value(&""), None); + + // Test identity prefixes. + for &(key, val) in &TEST_DATA { + assert_eq!(trie.get_ancestor_value(&key), Some(&val)); + } + + assert_eq!(trie.get_ancestor_value(&"abcdefg"), trie.get(&"abcdef")); + assert_eq!(trie.get_ancestor_value(&"abcde"), trie.get(&"abcd")); + assert_eq!(trie.get_ancestor_value(&"aauksdjk"), trie.get(&"a")); +} + +#[test] +fn nearest_ancestor_no_child_fn() { + let mut t = Trie::new(); + t.insert("ab", 5); + let anc = t.get_ancestor(&"abc").unwrap(); + assert_eq!(*anc.value().unwrap(), 5); +} + +#[test] +fn raw_ancestor() { + let mut t = Trie::new(); + + for &(key, _) in &TEST_DATA { + assert_eq!(t.get_raw_ancestor(&key).key(), t.key()); + } + + t.insert("wow", 0); + t.insert("hella", 1); + t.insert("hellb", 2); + + // Ancestor should be "hell" node. + let anc = t.get_raw_ancestor(&"hello"); + assert_eq!(anc.len(), 2); +} + +// Check that the subtrie prefix is correct for raw_ancestor. +#[test] +fn raw_ancestor_prefix() { + let mut t = Trie::new(); + + t.insert("abac", ()); + t.insert("abaz", ()); + + let anc = t.get_raw_ancestor(&"aba"); + assert_eq!(anc.prefix, "aba".encode()); +} + +#[test] +fn iter() { + type Set = HashSet<(&'static str, u32)>; + let trie = test_trie(); + let expected = TEST_DATA.iter().map(|&x| x).collect::(); + let observed = trie.iter().map(|(&k, &v)| (k, v)).collect::(); + assert_eq!(expected, observed); +} + +#[test] +fn get_raw_descendant() { + let trie = test_trie(); + assert_eq!( + trie.get_raw_descendant(&"abcdefgh").and_then(|t| t.value()), + Some(&19) + ); + assert_eq!( + trie.get_raw_descendant(&"abcdefg").and_then(|t| t.value()), + Some(&19) + ); + assert!(trie.get_raw_descendant(&"acbg").is_none()); +} + +#[test] +fn raw_descendant_prefix() { + let mut t = Trie::new(); + + t.insert("abczzzz", ()); + t.insert("abcaaaa", ()); + + assert_eq!(t.get_raw_descendant(&"a").unwrap().prefix, "abc".encode()); + assert_eq!(t.get_raw_descendant(&"abc").unwrap().prefix, "abc".encode()); + assert_eq!( + t.get_raw_descendant(&"abca").unwrap().prefix, + "abcaaaa".encode() + ); +} + +#[test] +fn get_prefix_bug() { + let mut trie = Trie::new(); + trie.insert("abdc", 5); + trie.insert("abde", 6); + assert!(trie.get(&"abc").is_none()); +} + +#[test] +fn get_ancestor_bug() { + let mut trie = Trie::new(); + trie.insert("abc", 1); + trie.insert("abcde", 2); + assert_eq!(trie.get_ancestor_value(&"abcdz"), Some(&1)); +} + +#[test] +fn root_replace_bug() { + let mut trie = Trie::new(); + trie.insert("a", ()); + trie.insert("p", ()); + trie.remove(&"a"); + assert_eq!(trie.len(), 1); + trie.remove(&"p"); + assert_eq!(trie.len(), 0); +} + +#[test] +fn subtrie_insert() { + let mut trie = Trie::new(); + trie.insert("abc", 3); + { + let mut subtrie = trie.subtrie_mut(&"abc").unwrap(); + assert_eq!(subtrie.insert("somerandomshit", 666), Err(())); + assert_eq!(subtrie.insert("abcdef", 6), Ok(None)); + assert_eq!(subtrie.insert("abc", 9), Ok(Some(3))); + } + assert_eq!(trie.get(&"abc"), Some(&9)); + assert_eq!(trie.get(&"abcdef"), Some(&6)); + assert_eq!(trie.len(), 2); +} + +#[test] +fn subtrie_len() { + let trie = test_trie(); + assert_eq!(trie.subtrie(&"ab").unwrap().len(), 4); + assert_eq!(trie.subtrie(&"a").unwrap().len(), 6); + assert_eq!(trie.subtrie(&"").unwrap().len(), trie.len()); + assert_eq!(trie.subtrie(&"bcdefgh").unwrap().len(), 1); +} + +// Subtrie functions that return references should return references valid for +// the lifetime of the *original trie* from which they were borrowed, NOT +// just the lifetime of the subtrie (which may be shorter). +#[test] +fn subtrie_lifetime() { + let trie = test_trie(); + let subtrie_value = { + let subtrie = trie.subtrie(&"ab").unwrap(); + subtrie.value() + }; + assert_eq!(*subtrie_value.unwrap(), 16); +} + +#[test] +fn subtrie_mut_lifetime() { + let mut trie = test_trie(); + let subtrie_value = { + let mut subtrie = trie.subtrie_mut(&"ab").unwrap(); + *subtrie.value_mut().unwrap() = 999; + subtrie.value() + }; + assert_eq!(*subtrie_value.unwrap(), 999); +} + +#[test] +fn ancestor_key() { + let trie = test_trie(); + let subtrie = trie.get_ancestor(&"abcde").unwrap(); + assert_eq!(*subtrie.key().unwrap(), "abcd"); + assert_eq!(subtrie.prefix, "abcd".encode()); + assert_eq!(*subtrie.get(&"abcdef").unwrap().unwrap(), 18); + assert_eq!(*subtrie.get(&"abcdefgh").unwrap().unwrap(), 19); +} + +#[test] +fn child_subtrie_keys() { + let trie = test_trie(); + let subtrie = trie.subtrie(&"abcd").unwrap(); + for subsubtrie in subtrie.children() { + // This subtrie should be for "abcde". + assert_eq!(*subsubtrie.get(&"abcdef").unwrap().unwrap(), 18); + assert_eq!(*subsubtrie.get(&"abcdefgh").unwrap().unwrap(), 19); + } +} + +#[test] +fn int_keys() { + let mut trie = Trie::new(); + trie.insert(0x00ffu64, "asdf"); + trie.insert(0xdeadbeefu64, "asdf"); + assert!(trie.check_integrity()); +} + +#[test] +fn from_iter() { + let trie: Trie<&str, u32> = Trie::from_iter(vec![("test", 10), ("hello", 12)]); + assert_eq!(*trie.get(&"test").unwrap(), 10); + assert_eq!(*trie.get(&"hello").unwrap(), 12); + assert_eq!(trie.len(), 2); +} + +#[test] +fn test_get_borrow() { + let mut trie = Trie::new(); + trie.insert("/boot".to_string(), "dir"); + assert_eq!(*trie.get("/boot").unwrap(), "dir"); +} + +#[test] +fn test_get_mut_borrow() { + let mut trie = Trie::new(); + trie.insert("/boot".to_string(), "dir"); + assert_eq!(*trie.get_mut("/boot").unwrap(), "dir"); +} + +#[test] +fn test_remove_borrow() { + let mut trie = Trie::new(); + trie.insert("/boot".to_string(), "dir"); + assert_eq!(trie.remove("/boot").unwrap(), "dir"); +} + +#[test] +fn test_subtrie_borrow() { + let mut trie = Trie::new(); + trie.insert("/boot".to_string(), "dir"); + trie.insert("/boot/lol".to_string(), "dir"); + trie.insert("/bleh".to_string(), "ohi"); + let subtrie = trie.subtrie("/boot").unwrap(); + assert_eq!(*subtrie.value().unwrap(), "dir"); +} + +#[test] +fn test_subtrie_mut_borrow() { + let mut trie = Trie::new(); + trie.insert("/boot".to_string(), "dir"); + trie.insert("/boot/lol".to_string(), "dir"); + trie.insert("/bleh".to_string(), "ohi"); + let subtrie = trie.subtrie_mut("/boot").unwrap(); + assert_eq!(*subtrie.value().unwrap(), "dir"); +} + +#[test] +fn test_get_ancestor_borrow() { + let mut trie = Trie::new(); + trie.insert("/boot".to_string(), "ancestor"); + trie.insert("/boot/lol".to_string(), "dir"); + trie.insert("/bleh".to_string(), "ohi"); + let subtrie = trie.get_ancestor("/boot/lo").unwrap(); + assert_eq!(*subtrie.value().unwrap(), "ancestor"); +} + +#[test] +fn test_get_ancestor_value_borrow() { + let mut trie = Trie::new(); + trie.insert("/boot".to_string(), "ancestor"); + trie.insert("/boot/lol".to_string(), "dir"); + trie.insert("/bleh".to_string(), "ohi"); + let ancestor_val = trie.get_ancestor_value("/boot/lo").unwrap(); + assert_eq!(*ancestor_val, "ancestor"); +} + +#[test] +fn test_get_raw_ancestor_borrow() { + let mut trie = Trie::new(); + trie.insert("/boot".to_string(), "boot"); + trie.insert("/boot/lol".to_string(), "dir"); + trie.insert("/bleh".to_string(), "ohi"); + let subtrie = trie.get_raw_ancestor("/boot/lo"); + assert_eq!(*subtrie.value().unwrap(), "boot"); +} + +#[test] +fn test_get_raw_descendant_borrow() { + let mut trie = Trie::new(); + trie.insert("/boot".to_string(), "dir"); + trie.insert("/boot/lol".to_string(), "lol"); + trie.insert("/bleh".to_string(), "ohi"); + let subtrie = trie.get_raw_descendant("/boot/lo").unwrap(); + assert_eq!(*subtrie.value().unwrap(), "lol"); +} + +#[test] +fn test_prefix() { + let mut t = Trie::::new(); + t.insert(0xf1, ()); + t.remove(&0xf2); + t.insert(0xf2, ()); + println!("{:#?}", t); + assert_eq!(t.prefix(), [].as_ref()); + let first = t.children().next().unwrap(); + assert_eq!(first.prefix(), [0xf].as_ref()); + let mut c = first.children(); + let second = c.next().unwrap(); + let third = c.next().unwrap(); + assert!(c.next().is_none()); + assert_eq!(second.prefix(), [0x1].as_ref()); + assert_eq!(third.prefix(), [0x2].as_ref()); +} + +#[test] +fn clone() { + let mut t1 = test_trie(); + let mut t2 = t1.clone(); + + assert_eq!(t1, t2); + t1.insert("abc", 22); + + assert_ne!(t1, t2); + t2.insert("abc", 22); + + assert_eq!(t1, t2); +} diff --git a/radix_trie-0.2.1/src/traversal.rs b/radix_trie-0.2.1/src/traversal.rs new file mode 100644 index 0000000000..648a2a8459 --- /dev/null +++ b/radix_trie-0.2.1/src/traversal.rs @@ -0,0 +1,390 @@ +//! This module contains the core algorithms. + +use crate::keys::{match_keys, KeyMatch}; +use crate::TrieKey; +use crate::TrieNode; +use std::borrow::Borrow; + +use nibble_vec::Nibblet; + +use self::DescendantResult::*; + +impl TrieNode +where + K: TrieKey, +{ + #[inline] + pub fn get(&self, nv: &Nibblet) -> Option<&TrieNode> { + iterative_get(self, nv) + } + #[inline] + pub fn get_mut(&mut self, nv: &Nibblet) -> Option<&mut TrieNode> { + iterative_get_mut(self, nv) + } + #[inline] + pub fn insert(&mut self, key: K, value: V, nv: Nibblet) -> Option { + iterative_insert(self, key, value, nv) + } + #[inline] + pub fn remove(&mut self, key: &Q) -> Option + where + K: Borrow, + Q: TrieKey, + { + recursive_remove(self, key) + } + #[inline] + pub fn get_ancestor(&self, nv: &Nibblet) -> Option<(&TrieNode, usize)> { + get_ancestor(self, nv) + } + #[inline] + pub fn get_raw_ancestor(&self, nv: &Nibblet) -> (&TrieNode, usize) { + get_raw_ancestor(self, nv) + } + #[inline] + pub fn get_raw_descendant<'a>(&'a self, nv: &Nibblet) -> Option> { + get_raw_descendant(self, nv) + } +} + +macro_rules! get_func { + ( + name: $name:ident, + trie_type: $trie_type:ty, + mutability: $($mut_:tt)* + ) => {id!{ + #[inline] + fn $name<'a, K, V>(trie: $trie_type, nv: &Nibblet) -> Option<$trie_type> { + if nv.len() == 0 { + return Some(trie); + } + + let mut prev = trie; + let mut depth = 0; + + loop { + let bucket = nv.get(depth) as usize; + let current = prev; + if let Some(ref $($mut_)* child) = current.children[bucket] { + match match_keys(depth, nv, &child.key) { + KeyMatch::Full => { + return Some(child); + } + KeyMatch::SecondPrefix => { + depth += child.key.len(); + prev = child; + } + _ => { + return None; + } + } + } else { + return None; + } + } + } + }} +} + +get_func!(name: iterative_get, trie_type: &'a TrieNode, mutability: ); +get_func!(name: iterative_get_mut, trie_type: &'a mut TrieNode, mutability: mut); + +#[inline] +fn iterative_insert(trie: &mut TrieNode, key: K, value: V, mut nv: Nibblet) -> Option +where + K: TrieKey, +{ + if nv.len() == 0 { + return trie.replace_value(key, value); + } + + let mut prev = trie; + let mut depth = 0; + + loop { + let bucket = nv.get(depth) as usize; + let current = prev; + if let Some(ref mut child) = current.children[bucket] { + match match_keys(depth, &nv, &child.key) { + KeyMatch::Full => { + return child.replace_value(key, value); + } + KeyMatch::Partial(idx) => { + // Split the existing child. + child.split(idx); + + // Insert the new key below the prefix node. + let new_key = nv.split(depth + idx); + let new_key_bucket = new_key.get(0) as usize; + + child.add_child( + new_key_bucket, + Box::new(TrieNode::with_key_value(new_key, key, value)), + ); + + return None; + } + KeyMatch::FirstPrefix => { + child.split(nv.len() - depth); + child.add_key_value(key, value); + return None; + } + KeyMatch::SecondPrefix => { + depth += child.key.len(); + prev = child; + } + } + } else { + let node_key = nv.split(depth); + current.add_child( + bucket, + Box::new(TrieNode::with_key_value(node_key, key, value)), + ); + return None; + } + } +} + +// TODO: clean this up and make it iterative. +#[inline] +fn recursive_remove(trie: &mut TrieNode, key: &Q) -> Option +where + K: TrieKey, + K: Borrow, + Q: TrieKey, +{ + let nv = key.encode(); + + if nv.len() == 0 { + return trie.take_value(key); + } + + let bucket = nv.get(0) as usize; + + let child = trie.take_child(bucket); + + match child { + Some(mut child) => { + match match_keys(0, &nv, &child.key) { + KeyMatch::Full => { + let result = child.take_value(key); + if child.child_count != 0 { + // If removing this node's value has made it a value-less node with a + // single child, then merge its child. + let repl = if child.child_count == 1 { + get_merge_child(&mut child) + } else { + child + }; + trie.add_child(bucket, repl); + } + result + } + KeyMatch::SecondPrefix => { + let depth = child.key.len(); + rec_remove(trie, child, bucket, key, depth, &nv) + } + KeyMatch::FirstPrefix | KeyMatch::Partial(_) => { + trie.add_child(bucket, child); + None + } + } + } + None => None, + } +} +#[inline] +fn get_merge_child(trie: &mut TrieNode) -> Box> +where + K: TrieKey, +{ + let mut child = trie.take_only_child(); + + // Join the child's key onto the existing one. + child.key = trie.key.clone().join(&child.key); + + child +} + +// Tail-recursive remove function used by `recursive_remove`. +#[inline] +fn rec_remove( + parent: &mut TrieNode, + mut middle: Box>, + prev_bucket: usize, + key: &Q, + depth: usize, + nv: &Nibblet, +) -> Option +where + K: TrieKey, + K: Borrow, + Q: TrieKey, +{ + let bucket = nv.get(depth) as usize; + + let child = middle.take_child(bucket); + parent.add_child(prev_bucket, middle); + + match child { + Some(mut child) => { + let middle = parent.children[prev_bucket].as_mut().unwrap(); + match match_keys(depth, nv, &child.key) { + KeyMatch::Full => { + let result = child.take_value(key); + + // If this node has children, keep it. + if child.child_count != 0 { + // If removing this node's value has made it a value-less node with a + // single child, then merge its child. + let repl = if child.child_count == 1 { + get_merge_child(&mut *child) + } else { + child + }; + middle.add_child(bucket, repl); + } + // Otherwise, if the parent node now only has a single child, merge it. + else if middle.child_count == 1 && middle.key_value.is_none() { + let repl = get_merge_child(middle); + *middle = repl; + } + + result + } + KeyMatch::SecondPrefix => { + let new_depth = depth + child.key.len(); + rec_remove(middle, child, bucket, key, new_depth, nv) + } + KeyMatch::FirstPrefix | KeyMatch::Partial(_) => { + middle.add_child(bucket, child); + None + } + } + } + None => None, + } +} +#[inline] +fn get_ancestor<'a, K, V>( + trie: &'a TrieNode, + nv: &Nibblet, +) -> Option<(&'a TrieNode, usize)> +where + K: TrieKey, +{ + if nv.len() == 0 { + return trie.as_value_node().map(|node| (node, 0)); + } + + let mut prev = trie; + // The ancestor is such that all nodes upto and including `prev` have + // already been considered. + let mut ancestor = prev.as_value_node(); + let mut depth = 0; + + loop { + let bucket = nv.get(depth) as usize; + let current = prev; + if let Some(ref child) = current.children[bucket] { + match match_keys(depth, nv, &child.key) { + KeyMatch::Full => { + return child + .as_value_node() + .map(|node| (node, depth + node.key.len())) + .or_else(|| ancestor.map(|anc| (anc, depth))); + } + KeyMatch::FirstPrefix | KeyMatch::Partial(_) => { + return ancestor.map(|anc| (anc, depth)); + } + KeyMatch::SecondPrefix => { + depth += child.key.len(); + ancestor = child.as_value_node().or(ancestor); + prev = child; + } + } + } else { + return ancestor.map(|anc| (anc, depth)); + } + } +} +#[inline] +fn get_raw_ancestor<'a, K, V>(trie: &'a TrieNode, nv: &Nibblet) -> (&'a TrieNode, usize) +where + K: TrieKey, +{ + if nv.len() == 0 { + return (trie, 0); + } + + let mut prev = trie; + // The ancestor is such that all nodes upto and including `prev` have + // already been considered. + let mut ancestor = prev; + let mut depth = 0; + + loop { + let bucket = nv.get(depth) as usize; + let current = prev; + if let Some(ref child) = current.children[bucket] { + match match_keys(depth, nv, &child.key) { + KeyMatch::Full => { + return (child, depth + child.key.len()); + } + KeyMatch::FirstPrefix | KeyMatch::Partial(_) => { + return (ancestor, depth); + } + KeyMatch::SecondPrefix => { + depth += child.key.len(); + ancestor = child; + prev = child; + } + } + } else { + return (ancestor, depth); + } + } +} + +// Type used to propogate subtrie construction instructions to the top-level `get_raw_descendant` +// method. +pub enum DescendantResult<'a, K: 'a, V: 'a> { + NoModification(&'a TrieNode), + ExtendKey(&'a TrieNode, usize, &'a Nibblet), +} +#[inline] +fn get_raw_descendant<'a, K, V>( + trie: &'a TrieNode, + nv: &Nibblet, +) -> Option> { + if nv.len() == 0 { + return Some(NoModification(trie)); + } + + let mut prev = trie; + let mut depth = 0; + + loop { + let bucket = nv.get(depth) as usize; + let current = prev; + if let Some(ref child) = current.children[bucket] { + match match_keys(depth, nv, &child.key) { + KeyMatch::Full => { + return Some(NoModification(child)); + } + KeyMatch::FirstPrefix => { + return Some(ExtendKey(child, depth, &child.key)); + } + KeyMatch::SecondPrefix => { + depth += child.key.len(); + prev = child; + } + _ => { + return None; + } + } + } else { + return None; + } + } +} diff --git a/radix_trie-0.2.1/src/trie.rs b/radix_trie-0.2.1/src/trie.rs new file mode 100644 index 0000000000..6e77004e88 --- /dev/null +++ b/radix_trie-0.2.1/src/trie.rs @@ -0,0 +1,245 @@ +use crate::traversal::DescendantResult::*; +use crate::TrieNode; +use crate::{SubTrie, SubTrieMut, Trie, TrieCommon, TrieKey}; +use std::borrow::Borrow; + +use nibble_vec::Nibblet; + +impl Trie +where + K: TrieKey, +{ + /// Create an empty Trie. + #[inline] + pub fn new() -> Trie { + Trie { + length: 0, + node: TrieNode::new(), + } + } + + /// Fetch a reference to the given key's corresponding value, if any. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type. + #[inline] + pub fn get(&self, key: &Q) -> Option<&V> + where + K: Borrow, + Q: TrieKey, + { + let key_fragments = key.encode(); + self.node + .get(&key_fragments) + .and_then(|t| t.value_checked(key)) + } + + /// Fetch a mutable reference to the given key's corresponding value, if any. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type. + #[inline] + pub fn get_mut(&mut self, key: &Q) -> Option<&mut V> + where + K: Borrow, + Q: TrieKey, + { + let key_fragments = key.encode(); + self.node + .get_mut(&key_fragments) + .and_then(|t| t.value_checked_mut(key)) + } + + /// Insert the given key-value pair, returning any previous value associated with the key. + #[inline] + pub fn insert(&mut self, key: K, value: V) -> Option { + let key_fragments = key.encode(); + let result = self.node.insert(key, value, key_fragments); + if result.is_none() { + self.length += 1; + } + result + } + + /// Remove the value associated with the given key. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type. + #[inline] + pub fn remove(&mut self, key: &Q) -> Option + where + K: Borrow, + Q: TrieKey, + { + let removed = self.node.remove(key); + if removed.is_some() { + self.length -= 1; + } + removed + } + + /// Get a mutable reference to the value stored at this node, if any. + pub fn value_mut(&mut self) -> Option<&mut V> { + self.node.value_mut() + } + + /// Fetch a reference to the subtrie for a given key. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type. + #[inline] + pub fn subtrie<'a, Q: ?Sized>(&'a self, key: &Q) -> Option> + where + K: Borrow, + Q: TrieKey, + { + let key_fragments = key.encode(); + self.node + .get(&key_fragments) + .map(|node| node.as_subtrie(key_fragments)) + } + + /// Fetch a mutable reference to the subtrie for a given key. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type. + #[inline] + pub fn subtrie_mut<'a, Q: ?Sized>(&'a mut self, key: &Q) -> Option> + where + K: Borrow, + Q: TrieKey, + { + let key_fragments = key.encode(); + let length_ref = &mut self.length; + self.node + .get_mut(&key_fragments) + .map(move |node| node.as_subtrie_mut(key_fragments, length_ref)) + } + + /// Fetch a reference to the closest ancestor node of the given key. + /// + /// If `key` is encoded as byte-vector `b`, return the node `n` in the tree + /// such that `n`'s key's byte-vector is the longest possible prefix of `b`, and `n` + /// has a value. + /// + /// Invariant: `result.is_some() => result.key_value.is_some()`. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type. + #[inline] + pub fn get_ancestor<'a, Q: ?Sized>(&'a self, key: &Q) -> Option> + where + K: Borrow, + Q: TrieKey, + { + let mut key_fragments = key.encode(); + self.node + .get_ancestor(&key_fragments) + .map(|(node, node_key_len)| { + key_fragments.split(node_key_len); + node.as_subtrie(key_fragments) + }) + } + + /// Fetch the closest ancestor *value* for a given key. + /// + /// See `get_ancestor` for precise semantics, this is just a shortcut. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type. + #[inline] + pub fn get_ancestor_value(&self, key: &Q) -> Option<&V> + where + K: Borrow, + Q: TrieKey, + { + self.get_ancestor(key).and_then(|t| t.node.value()) + } + + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type + #[inline] + pub fn get_raw_ancestor<'a, Q: ?Sized>(&'a self, key: &Q) -> SubTrie<'a, K, V> + where + K: Borrow, + Q: TrieKey, + { + let mut nv = key.encode(); + let (ancestor_node, depth) = self.node.get_raw_ancestor(&nv); + nv.split(depth); + ancestor_node.as_subtrie(nv) + } + + /// Fetch the closest descendant for a given key. + /// + /// If the key is in the trie, this is the same as `subtrie`. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type + #[inline] + pub fn get_raw_descendant<'a, Q: ?Sized>(&'a self, key: &Q) -> Option> + where + K: Borrow, + Q: TrieKey, + { + let mut nv = key.encode(); + self.node.get_raw_descendant(&nv).map(|desc| { + let (node, prefix) = match desc { + NoModification(node) => (node, nv), + ExtendKey(node, depth, extension) => { + nv.split(depth); + (node, nv.join(extension)) + } + }; + node.as_subtrie(prefix) + }) + } + + /// Take a function `f` and apply it to the value stored at `key`. + /// + /// If no value is stored at `key`, store `default`. + #[inline] + pub fn map_with_default(&mut self, key: K, f: F, default: V) + where + F: Fn(&mut V), + { + { + if let Some(v) = self.get_mut(&key) { + f(v); + return; + } + } + self.insert(key, default); + } + + /// Check that the Trie invariants are satisfied - you shouldn't ever have to call this! + /// Quite slow! + #[doc(hidden)] + pub fn check_integrity(&self) -> bool { + let (ok, length) = self.node.check_integrity_recursive(&Nibblet::new()); + ok && length == self.length + } +} + +impl PartialEq for Trie +where + K: TrieKey, + V: PartialEq, +{ + #[inline] + fn eq(&self, other: &Trie) -> bool { + if self.len() != other.len() { + return false; + } + + self.iter() + .all(|(key, value)| other.get(key).map_or(false, |v| *value == *v)) + } +} + +impl Default for Trie { + #[inline] + fn default() -> Self { + Self::new() + } +} diff --git a/radix_trie-0.2.1/src/trie_common.rs b/radix_trie-0.2.1/src/trie_common.rs new file mode 100644 index 0000000000..002722faf5 --- /dev/null +++ b/radix_trie-0.2.1/src/trie_common.rs @@ -0,0 +1,175 @@ +use crate::iter::*; +use crate::TrieNode; +use crate::{SubTrie, SubTrieMut, Trie, TrieKey}; + +use nibble_vec::Nibblet; + +/// Common functionality available for tries and subtries. +pub trait TrieCommon<'a, K: 'a, V: 'a>: ContainsTrieNode<'a, K, V> +where + K: TrieKey, + Self: Sized, +{ + /// Get the key stored at this node, if any. + #[inline] + fn key(self) -> Option<&'a K> { + self.trie_node().key() + } + + /// Get the value stored at this node, if any. + #[inline] + fn value(self) -> Option<&'a V> { + self.trie_node().value() + } + + /// Number of key/value pairs stored in this trie. + fn len(self) -> usize; + + /// Determine if the Trie contains 0 key-value pairs. + #[inline] + fn is_empty(self) -> bool { + self.len() == 0 + } + + /// Determine if the trie is a leaf node (has no children). + #[inline] + fn is_leaf(self) -> bool { + self.trie_node().child_count == 0 + } + + /// Return an iterator over the keys and values of the Trie. + #[inline] + fn iter(self) -> Iter<'a, K, V> { + Iter::new(self.trie_node()) + } + + /// Return an iterator over the keys of the Trie. + #[inline] + fn keys(self) -> Keys<'a, K, V> { + Keys::new(self.iter()) + } + + /// Return an iterator over the values of the Trie. + #[inline] + fn values(self) -> Values<'a, K, V> { + Values::new(self.iter()) + } + + /// Return an iterator over the child subtries of this node. + fn children(self) -> Children<'a, K, V>; + + /// Get the prefix of this node. + #[inline] + fn prefix(self) -> &'a Nibblet { + &self.trie_node().key + } +} + +/// Helper trait for Trie/SubTrie/SubTrieMut, which all contain a trie node. +pub trait ContainsTrieNode<'a, K: 'a, V: 'a> +where + K: TrieKey, +{ + fn trie_node(self) -> &'a TrieNode; +} + +/// Regular trie. +impl<'a, K: 'a, V: 'a> ContainsTrieNode<'a, K, V> for &'a Trie +where + K: TrieKey, +{ + #[inline] + fn trie_node(self) -> &'a TrieNode { + &self.node + } +} + +impl<'a, K: 'a, V: 'a> TrieCommon<'a, K, V> for &'a Trie +where + K: TrieKey, +{ + #[inline] + fn len(self) -> usize { + self.length + } + #[inline] + fn children(self) -> Children<'a, K, V> { + Children::new(self.node.key.clone(), &self.node) + } +} + +/// Subtrie. +impl<'a: 'b, 'b, K: 'a, V: 'a> ContainsTrieNode<'a, K, V> for &'b SubTrie<'a, K, V> +where + K: TrieKey, +{ + #[inline] + fn trie_node(self) -> &'a TrieNode { + self.node + } +} + +impl<'a: 'b, 'b, K: 'a, V: 'a> TrieCommon<'a, K, V> for &'b SubTrie<'a, K, V> +where + K: TrieKey, +{ + #[inline] + fn len(self) -> usize { + self.node.compute_size() + } + #[inline] + fn children(self) -> Children<'a, K, V> { + Children::new(self.prefix.clone(), self.node) + } +} + +/// Mutable subtrie *by value* (consumes the subtrie). +impl<'a, K: 'a, V: 'a> ContainsTrieNode<'a, K, V> for SubTrieMut<'a, K, V> +where + K: TrieKey, +{ + #[inline] + fn trie_node(self) -> &'a TrieNode { + self.node + } +} + +impl<'a, K: 'a, V: 'a> TrieCommon<'a, K, V> for SubTrieMut<'a, K, V> +where + K: TrieKey, +{ + /// **Computes** from scratch. + #[inline] + fn len(self) -> usize { + self.node.compute_size() + } + #[inline] + fn children(self) -> Children<'a, K, V> { + Children::new(self.prefix.clone(), self.node) + } +} + +/// Mutable subtrie *by reference* (doesn't consume the subtrie, but limited). +impl<'a: 'b, 'b, K: 'a, V: 'a> ContainsTrieNode<'b, K, V> for &'b SubTrieMut<'a, K, V> +where + K: TrieKey, +{ + #[inline] + fn trie_node(self) -> &'b TrieNode { + self.node + } +} + +impl<'a: 'b, 'b, K: 'a, V: 'a> TrieCommon<'b, K, V> for &'b SubTrieMut<'a, K, V> +where + K: TrieKey, +{ + #[inline] + fn len(self) -> usize { + self.node.compute_size() + } + #[inline] + fn children(self) -> Children<'b, K, V> { + Children::new(self.prefix.clone(), self.node) + } +} diff --git a/radix_trie-0.2.1/src/trie_node.rs b/radix_trie-0.2.1/src/trie_node.rs new file mode 100644 index 0000000000..c5fbad8c74 --- /dev/null +++ b/radix_trie-0.2.1/src/trie_node.rs @@ -0,0 +1,310 @@ +use crate::keys::*; +use crate::{SubTrie, SubTrieMut, BRANCH_FACTOR}; +use std::borrow::Borrow; +use std::default::Default; + +use nibble_vec::Nibblet; + +#[derive(Debug, Clone)] +pub struct TrieNode { + /// Key fragments/bits associated with this node, such that joining the keys from all + /// parent nodes and this node is equal to the bit-encoding of this node's key. + pub key: Nibblet, + + /// The key and value stored at this node. + pub key_value: Option>>, + + /// The number of children which are Some rather than None. + pub child_count: usize, + + /// The children of this node stored such that the first nibble of each child key + /// dictates the child's bucket. + pub children: [Option>>; BRANCH_FACTOR], +} + +#[derive(Debug, Clone)] +pub struct KeyValue { + pub key: K, + pub value: V, +} + +impl TrieNode +where + K: TrieKey, +{ + /// Create a value-less, child-less TrieNode. + #[inline] + pub fn new() -> TrieNode { + TrieNode { + key: Nibblet::new(), + key_value: None, + children: Default::default(), + child_count: 0, + } + } + + /// Create a TrieNode with no children. + #[inline] + pub fn with_key_value(key_fragments: Nibblet, key: K, value: V) -> TrieNode { + TrieNode { + key: key_fragments, + key_value: Some(Box::new(KeyValue { + key: key, + value: value, + })), + children: Default::default(), + child_count: 0, + } + } + + /// Get the key stored at this node, if any. + #[inline] + pub fn key(&self) -> Option<&K> { + self.key_value.as_ref().map(|kv| &kv.key) + } + + /// Get the value stored at this node, if any. + #[inline] + pub fn value(&self) -> Option<&V> { + self.key_value.as_ref().map(|kv| &kv.value) + } + + /// Get a mutable reference to the value stored at this node, if any. + #[inline] + pub fn value_mut(&mut self) -> Option<&mut V> { + self.key_value.as_mut().map(|kv| &mut kv.value) + } + + /// Get the value whilst checking a key match. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type. + #[inline] + pub fn value_checked(&self, key: &Q) -> Option<&V> + where + K: Borrow, + Q: TrieKey, + { + self.key_value.as_ref().map(|kv| { + check_keys(kv.key.borrow(), key); + &kv.value + }) + } + + /// Get a mutable value whilst checking a key match. + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type. + #[inline] + pub fn value_checked_mut(&mut self, key: &Q) -> Option<&mut V> + where + K: Borrow, + Q: TrieKey, + { + self.key_value.as_mut().map(|kv| { + check_keys(kv.key.borrow(), key); + &mut kv.value + }) + } + + /// Compute the number of keys and values in this node's subtrie. + #[inline] + pub fn compute_size(&self) -> usize { + let mut size = self.key_value.is_some() as usize; + + for child in &self.children { + if let Some(ref child) = *child { + // TODO: could unroll this recursion + size += child.compute_size(); + } + } + + size + } + + /// Add a child at the given index, given that none exists there already. + #[inline] + pub fn add_child(&mut self, idx: usize, node: Box>) { + debug_assert!(self.children[idx].is_none()); + self.child_count += 1; + self.children[idx] = Some(node); + } + + /// Remove a child at the given index, if it exists. + #[inline] + pub fn take_child(&mut self, idx: usize) -> Option>> { + self.children[idx].take().map(|node| { + self.child_count -= 1; + node + }) + } + + /// Helper function for removing the single child of a node. + #[inline] + pub fn take_only_child(&mut self) -> Box> { + debug_assert_eq!(self.child_count, 1); + for i in 0..BRANCH_FACTOR { + if let Some(child) = self.take_child(i) { + return child; + } + } + unreachable!("node with child_count 1 has no actual children"); + } + + /// Set the key and value of a node, given that it currently lacks one. + #[inline] + pub fn add_key_value(&mut self, key: K, value: V) { + debug_assert!(self.key_value.is_none()); + self.key_value = Some(Box::new(KeyValue { key, value })); + } + + /// Move the value out of a node, whilst checking that its key is as expected. + /// Can panic (see check_keys). + /// + /// The key may be any borrowed form of the trie's key type, but TrieKey on the borrowed + /// form *must* match those for the key type + #[inline] + pub fn take_value(&mut self, key: &Q) -> Option + where + K: Borrow, + Q: TrieKey, + { + self.key_value.take().map(|kv| { + check_keys(kv.key.borrow(), key); + kv.value + }) + } + + /// Replace a value, returning the previous value if there was one. + #[inline] + pub fn replace_value(&mut self, key: K, value: V) -> Option { + // TODO: optimise this? + let previous = self.take_value(&key); + self.add_key_value(key, value); + previous + } + + /// Get a reference to this node if it has a value. + #[inline] + pub fn as_value_node(&self) -> Option<&TrieNode> { + self.key_value.as_ref().map(|_| self) + } + + /// Split a node at a given index in its key, transforming it into a prefix node of its + /// previous self. + #[inline] + pub fn split(&mut self, idx: usize) { + // Extract all the parts of the suffix node, starting with the key. + let key = self.key.split(idx); + + // Key-value. + let key_value = self.key_value.take(); + + // Children. + let mut children: [Option>>; BRANCH_FACTOR] = Default::default(); + + for (i, child) in self.children.iter_mut().enumerate() { + if child.is_some() { + children[i] = child.take(); + } + } + + // Child count. + let child_count = self.child_count; + self.child_count = 1; + + // Insert the collected items below what is now an empty prefix node. + let bucket = key.get(0) as usize; + self.children[bucket] = Some(Box::new(TrieNode { + key: key, + key_value, + children, + child_count, + })); + } + #[inline] + pub fn as_subtrie(&self, prefix: Nibblet) -> SubTrie { + SubTrie { + prefix: prefix, + node: self, + } + } + #[inline] + pub fn as_subtrie_mut<'a>( + &'a mut self, + prefix: Nibblet, + length: &'a mut usize, + ) -> SubTrieMut<'a, K, V> { + SubTrieMut { + prefix: prefix, + length: length, + node: self, + } + } + + /// Check the integrity of a trie subtree (quite costly). + /// Return true and the size of the subtree if all checks are successful, + /// or false and a junk value if any test fails. + pub fn check_integrity_recursive(&self, prefix: &Nibblet) -> (bool, usize) { + let mut sub_tree_size = 0; + let is_root = prefix.len() == 0; + + // Check that no value-less, non-root nodes have only 1 child. + if !is_root && self.child_count == 1 && self.key_value.is_none() { + println!("Value-less node with a single child."); + return (false, sub_tree_size); + } + + // Check that all non-root key vector's have length > 1. + if !is_root && self.key.len() == 0 { + println!("Key length is 0 at non-root node."); + return (false, sub_tree_size); + } + + // Check that the child count matches the actual number of children. + let child_count = self + .children + .iter() + .fold(0, |acc, e| acc + (e.is_some() as usize)); + + if child_count != self.child_count { + println!( + "Child count error, recorded: {}, actual: {}", + self.child_count, child_count + ); + return (false, sub_tree_size); + } + + // Compute the key fragments for this node, according to the trie. + let trie_key = prefix.clone().join(&self.key); + + // Account for this node in the size check, and check its key. + if let Some(ref kv) = self.key_value { + sub_tree_size += 1; + + let actual_key = kv.key.encode(); + + if trie_key != actual_key { + return (false, sub_tree_size); + } + } + + // Recursively check children. + for i in 0..BRANCH_FACTOR { + if let Some(ref child) = self.children[i] { + match child.check_integrity_recursive(&trie_key) { + (false, _) => return (false, sub_tree_size), + (true, child_size) => sub_tree_size += child_size, + } + } + } + + (true, sub_tree_size) + } +} + +impl Default for TrieNode { + fn default() -> Self { + Self::new() + } +} diff --git a/rustyline-15.0.0/.cargo-checksum.json b/rustyline-15.0.0/.cargo-checksum.json new file mode 100644 index 0000000000..1129d06005 --- /dev/null +++ b/rustyline-15.0.0/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"14e95025f4de174f836b6d3d919ca01dd15701628150c274a7baf45f4d191490","Ansi.md":"942893a96af5118ab0f73812b2f46f874e71bb62f5498c6a860013b1724f8abb","BUGS.md":"89102c4f2db80acb3ab748002a7db18deaafa6b74af60e3074d859ab79dec622","Cargo.lock":"b921484a9a2154a859acb52aa5d51beff65453511670acb1b2292e31ee74d963","Cargo.toml":"d3e30555559d81dabf3f757631c166cbc44f5bf45f093b86ca11b02f8e4ef4d6","Cargo.toml.orig":"afb5602a676ad7ed802c83df147e0965e24e6bf0bf537100e5eefad403ab4a79","CustomBinding.md":"769966ed714a5ea567cb127e8639504ce8f143514dd07f54eb2e2ca4cf96853f","Features.md":"76dc7cd46d96e3026ee98ab0f27d17bf150a88c82795da5a90fbd62568f68b06","History.md":"a3169fbec4a758f76cefbd21d8fb8032f272e23a397bdd6d48cf6e985f066b92","Incremental.md":"a17820ad2bf04adf60b316bdbe7b7c8350cf22e3fa845da666b4bb76212b3316","LICENSE":"c660c3a1ca6c7c0d736f249dbc7ca5bdf1cbc7bf4d57bc867d3b47ec1ba8374e","README.md":"eb4f5d5ff73dedd07b3cbcff52071e5113c7db04beba1d77bd895ace426df06b","TODO.md":"86731b723412255046d49f9330db7b21a9fa1002d77cb8ebd4a292441a4be9b5","examples/custom_key_bindings.rs":"84eb8d5bbe655388a38f47a9dc5088ac1d9071df978821dfb52b913edbd1baaa","examples/diy_hints.rs":"ce62f41ba63563ce1cb1c5064a452e5a675cdcad1b2b217b727768e330e802e7","examples/example.rs":"920f4d543c4c50a334dff7047a2618d4de7797c7f2ade856b389594d607f500f","examples/external_print.rs":"79c8862eef904c760ffb54c1e34ebbe08322da57c907fb27d26650564f94081f","examples/input_multiline.rs":"9746404a94fe18dabed961ced7b02f9ade134717a99de7ff02458fb0bb215532","examples/input_validation.rs":"da5d6a87d0b365e5e028d88d54223b20e122c03dbf0e0a9c17f85a30abd76c89","examples/minimal.rs":"251f4f4913b4b37e3adda79d1fd50e1a01625eaa9cdc9811cd185c92a35c558a","examples/numeric_input.rs":"2e4a739fb100a7d07589bfbf8971f580260c7853a9ae75bdf7ccf5173e62101f","examples/read_password.rs":"492ac35a3a14a886011fa43df8f4c4a575d487a5b67f46394a10e2a96fc3e48d","examples/sqlite_history.rs":"8856185b0a09bfd6d5dfd64ee53e257c299c34383a40cc3796e8ec38ad7d9d01","linenoise.md":"09345d0914395e8eb4c3b991d3ccb19fde82bef541165588b9f13f3823af750a","src/binding.rs":"2827cea7bb7142c7ac51f9f9e665503bab2be8834cd231a02ffb27408629591f","src/command.rs":"bc0e5e76b928f8f533af574922df534f1e8414da0a1f79e5c80a81b10c11afb6","src/completion.rs":"f47001b0d617d5004e8fa069d61eba266f76f511db82fe45390c3bd31ea121e1","src/config.rs":"9c48bfbacf795025b51e2e38ce0040c376dfbb960732823bd24d81da3fa5ecef","src/edit.rs":"0de7ad0f9d80c4451ed295926b776d69e2c304795f930a31b58d6412afa007a2","src/error.rs":"9123990332699c47aaf553b2943c4c66e64d3204ac8cf9e2ec826988251ded2b","src/highlight.rs":"d95d051592dd22af19b8e4c8ece8e133973d919410d201cd7fbc96f7e857f7ab","src/hint.rs":"82edb730df4d1bba325cf80a1b1de30ce49b931739e76d1267da85300126dbf3","src/history.rs":"6df6a596798802908d803c45ed6042e03414a9ca05cdb581205deba3490b9532","src/keymap.rs":"0d91d03dcafaea3c07242e653a64c959436a60ed57c7dbe29d398f3756a2f68d","src/keys.rs":"0b0b0bccd995f8ca2435c0ff266e8f0d2f8753d7f015a1289b7420ff5e2f740e","src/kill_ring.rs":"109e6ebdef1628536a1f05b51f8b66f0b3dabe3dc40c61ef81f02e5d27be90b4","src/layout.rs":"27c21a1b0eaf14c2ef18c8c8953a076ac82195782a99b99ba07c4f7f3fcc2504","src/lib.rs":"4209fd0d3e8fa1e3582488b3f2d101f48ed72cfbf84b61ca81eaf143c8fe6bde","src/line_buffer.rs":"2cdc301140567ba9e36d70c811ace9b65ffcac29a25d2263401faf455c5508eb","src/sqlite_history.rs":"bc675442ca3c1c1417c46f418bcaa54f4b8d1c8c6f2dec108366763eabe2d56f","src/test/common.rs":"bec77ee463cac21a9595113c18c34bb67acaf59eb62ee6bef37a4d9ff7cbaf8d","src/test/emacs.rs":"2096e6b60814d84484439c78fb8cedf911cc9f80e3f4d50126c2795357f33abb","src/test/history.rs":"c50155700945e0a82d32b5ea28854c1ba6aa6e6cca8262359bb2919176037ae3","src/test/mod.rs":"8642a52543e069b51a923388b89b3d4db41b069664e69ef7417c8fd32f366109","src/test/vi_cmd.rs":"596cb53aa19709de4641f662d15ee845a6a1f894bf2b59d2a8826a80c86629e4","src/test/vi_insert.rs":"ceb7a43afb77c5349258fcc6d548b4e7eedfaaad7f054094d506568b6908c520","src/tty/mod.rs":"fc3591b1238a6d29b9327750899de53e2663ea680aa1f44d3293221fcafb2b54","src/tty/test.rs":"08ce065ae739d57d09ba528cde0b6b614fcbced512ac31a070ee059455653fe1","src/tty/unix.rs":"68e6b4f4fed5a22d2f4e9f788f73419bdb0493c81ef4bb3651cd732605598c56","src/tty/windows.rs":"2fc623923bc9d8ce44468a49edbfdffd9a9ff30463a50024631bd8ef4faf1477","src/undo.rs":"68cb906444c90e7a594629ba316bb3fdfaf0d97a50b49fbddd102d3ecf5cfd60","src/validate.rs":"1919f621ed5e633f078453096b18be2e529b9b669e3405217a48be9e5f612fa6"},"package":"2ee1e066dc922e513bda599c6ccb5f3bb2b0ea5870a579448f2622993f0a9a2f"} \ No newline at end of file diff --git a/rustyline-15.0.0/.cargo_vcs_info.json b/rustyline-15.0.0/.cargo_vcs_info.json new file mode 100644 index 0000000000..317ad97184 --- /dev/null +++ b/rustyline-15.0.0/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "bc06b3eb322df1a535e6e3b64db8c0fee0b1df8c" + }, + "path_in_vcs": "" +} \ No newline at end of file diff --git a/rustyline-15.0.0/Ansi.md b/rustyline-15.0.0/Ansi.md new file mode 100644 index 0000000000..21556c3811 --- /dev/null +++ b/rustyline-15.0.0/Ansi.md @@ -0,0 +1,23 @@ +# Output + +| Seq | Terminfo | Comment | +| --------- | -------------------------- | -------------------------------------------------------- | +| \E[H | cursor_home, home, ho | | +| \E[K | clr_eol, el, ce | | +| \E[H\E[J | clear_screen, clear, cl | | +| \E[6n | user7, u7, u7 | cursor position report | +| ^M | carriage_return, cr, cr | move cursor to bol | +| \E[B | cursor_down, cud1, do | ^J | +| \E[%p1%dB | parm_down_cursor, cud, DO | | +| \E[A | cursor_up, cuu1, up | | +| \E[%p1%dA | parm_up_cursor, cuu, UP | | +| \E[C | cursor_right, cuf1, nd | | +| \E[%p1%dC | parm_right_cursor, cuf, RI | | +| \E[D | cursor_left, cub1, le | ^H | +| \E[%p1%dD | parm_left_cursor, cub, LE | | +| ^G | bell, bel, bl | | +| \E[?2004h | | bracketed paste on | +| \E[?2004l | | bracketed paste off | +| \E[?1000h | | X11 mouse reporting, reports on button press and release | +| \E[?1015h | | Enable urxvt Mouse mode | +| \E[?1006h | | Enable Xterm SGR mouse mode | diff --git a/rustyline-15.0.0/BUGS.md b/rustyline-15.0.0/BUGS.md new file mode 100644 index 0000000000..81529ae81c --- /dev/null +++ b/rustyline-15.0.0/BUGS.md @@ -0,0 +1,46 @@ +Know issues + +## Document / Syntax + +We would like to introduce an incremental parsing phase (see `tree-sitter`). +Because, when you have tokens (which may be as simple as words) or an AST, +completion / suggestion / highlighting / validation become easy. +So we need to send events to a lexer/parser, update `Document` accordingly. +And fix `Completer` / `Hinter` / `Highlighter` API such as they have access to `Document`. + +See [lex_document](https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/rendering_flow.html#the-rendering-flow). + +## Repaint / Refresh + +Currently, performance is poor because, most of the time, we refresh the whole line (and prompt). +We would like to transform events on prompt/line/hint into partial repaint. + +See `termwiz` design (`Surface`). +See `replxx` refresh delay (`_lastRefreshTime`) or `python-prompt-toolkit` max_render_postpone_time. +https://docs.rs/xi-unicode/0.3.0/xi_unicode/struct.LineBreakIterator.html +https://github.com/xi-editor/xi-editor/blob/master/rust/core-lib/src/linewrap.rs +[vt100](https://docs.rs/vt100/0.12.0/vt100/struct.Screen.html#method.contents_diff) + +## Action / Command + +We would like to support user defined actions that interact nicely with undo manager and kill-ring. +To do so, we need to refactor current key event dispatch. + +See `replxx` design (`ACTION_RESULT`, `action_trait_t`). + +## Line wrapping (should be fixed with versions >= 6.1.2) + +On Unix platform, we assume that `auto_right_margin` (`am`) is enabled. +And on Windows, we activate `ENABLE_WRAP_AT_EOL_OUTPUT`. +But on Windows 10, `ENABLE_WRAP_AT_EOL_OUTPUT` and `ENABLE_VIRTUAL_TERMINAL_PROCESSING` seems to be incompatible. + +## Colors + +We assume that ANSI colors are supported. +Which is not the case on Windows (except on Windows 10)! + +## Emoji + +https://github.com/kkawakam/rustyline/issues/184 +https://docs.rs/xi-unicode/0.3.0/xi_unicode/trait.EmojiExt.html +https://docs.rs/termwiz/0.11.0/termwiz/cell/fn.grapheme_column_width.html diff --git a/rustyline-15.0.0/Cargo.lock b/rustyline-15.0.0/Cargo.lock new file mode 100644 index 0000000000..6227e29fad --- /dev/null +++ b/rustyline-15.0.0/Cargo.lock @@ -0,0 +1,1296 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "buffer-redux" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e8acf87c5b9f5897cd3ebb9a327f420e0cae9dd4e5c1d2e36f2c84c571a58f1" +dependencies = [ + "memchr", +] + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cc" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets", +] + +[[package]] +name = "clipboard-win" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" +dependencies = [ + "error-code", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "defer-drop" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f613ec9fa66a6b28cdb1842b27f9adf24f39f9afc4dcdd9fdecee4aca7945c57" +dependencies = [ + "crossbeam-channel", + "once_cell", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_builder" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "env_filter" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +dependencies = [ + "log", +] + +[[package]] +name = "env_logger" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +dependencies = [ + "env_filter", + "log", +] + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "error-code" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fastrand" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" + +[[package]] +name = "fd-lock" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" +dependencies = [ + "cfg-if", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fuzzy-matcher" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54614a3312934d066701a80f20f15fa3b56d67ac7722b39eea5b4c9dd1d66c94" +dependencies = [ + "thread_local", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashlink" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "js-sys" +version = "0.3.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.162" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", +] + +[[package]] +name = "nix" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset", + "pin-utils", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rusqlite" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e" +dependencies = [ + "bitflags 2.6.0", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", +] + +[[package]] +name = "rustix" +version = "0.38.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustversion" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" + +[[package]] +name = "rustyline" +version = "15.0.0" +dependencies = [ + "assert_matches", + "bitflags 2.6.0", + "buffer-redux", + "cfg-if", + "clipboard-win", + "doc-comment", + "env_logger", + "fd-lock", + "home", + "libc", + "log", + "memchr", + "nix 0.29.0", + "radix_trie", + "rand", + "regex", + "rusqlite", + "rustyline-derive", + "signal-hook", + "skim", + "tempfile", + "termios", + "unicode-segmentation", + "unicode-width 0.2.0", + "utf8parse", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustyline-derive" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327e9d075f6df7e25fbf594f1be7ef55cf0d567a6cb5112eeccbbd51ceb48e0d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "serde" +version = "1.0.215" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.215" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "skim" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d28de0a6cb2cdd83a076f1de9d965b973ae08b244df1aa70b432946dda0f32" +dependencies = [ + "beef", + "bitflags 1.3.2", + "chrono", + "crossbeam", + "defer-drop", + "derive_builder", + "fuzzy-matcher", + "lazy_static", + "log", + "nix 0.25.1", + "rayon", + "regex", + "time", + "timer", + "tuikit", + "unicode-width 0.1.14", + "vte", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +dependencies = [ + "cfg-if", + "fastrand", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + +[[package]] +name = "termios" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b" +dependencies = [ + "libc", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "timer" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31d42176308937165701f50638db1c31586f183f1aab416268216577aec7306b" +dependencies = [ + "chrono", +] + +[[package]] +name = "tuikit" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e19c6ab038babee3d50c8c12ff8b910bdb2196f62278776422f50390d8e53d8" +dependencies = [ + "bitflags 1.3.2", + "lazy_static", + "log", + "nix 0.24.3", + "term", + "unicode-width 0.1.14", +] + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-width" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" + +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vte" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5022b5fbf9407086c180e9557be968742d839e68346af7792b8592489732197" +dependencies = [ + "arrayvec", + "utf8parse", + "vte_generate_state_changes", +] + +[[package]] +name = "vte_generate_state_changes" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +dependencies = [ + "cfg-if", + "once_cell", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.87", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/rustyline-15.0.0/Cargo.toml b/rustyline-15.0.0/Cargo.toml new file mode 100644 index 0000000000..5114581f07 --- /dev/null +++ b/rustyline-15.0.0/Cargo.toml @@ -0,0 +1,239 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO +# +# When uploading crates to the registry Cargo will automatically +# "normalize" Cargo.toml files for maximal compatibility +# with all versions of Cargo and also rewrite `path` dependencies +# to registry (e.g., crates.io) dependencies. +# +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. + +[package] +edition = "2021" +name = "rustyline" +version = "15.0.0" +authors = ["Katsu Kawakami "] +build = false +exclude = [ + "/.github/*", + "/rustfmt.toml", +] +autolib = false +autobins = false +autoexamples = false +autotests = false +autobenches = false +description = "Rustyline, a readline implementation based on Antirez's Linenoise" +documentation = "https://docs.rs/rustyline" +readme = "README.md" +keywords = ["readline"] +categories = ["command-line-interface"] +license = "MIT" +repository = "https://github.com/kkawakam/rustyline" + +[package.metadata.docs.rs] +all-features = false +default-target = "x86_64-unknown-linux-gnu" +features = [ + "custom-bindings", + "derive", + "with-dirs", + "with-file-history", + "with-fuzzy", +] +no-default-features = true +rustdoc-args = [ + "--cfg", + "docsrs", +] + +[lib] +name = "rustyline" +path = "src/lib.rs" + +[[example]] +name = "custom_key_bindings" +path = "examples/custom_key_bindings.rs" +required-features = [ + "custom-bindings", + "derive", +] + +[[example]] +name = "diy_hints" +path = "examples/diy_hints.rs" +required-features = ["derive"] + +[[example]] +name = "example" +path = "examples/example.rs" +required-features = [ + "custom-bindings", + "derive", +] + +[[example]] +name = "external_print" +path = "examples/external_print.rs" + +[[example]] +name = "input_multiline" +path = "examples/input_multiline.rs" +required-features = [ + "custom-bindings", + "derive", +] + +[[example]] +name = "input_validation" +path = "examples/input_validation.rs" +required-features = ["derive"] + +[[example]] +name = "minimal" +path = "examples/minimal.rs" + +[[example]] +name = "numeric_input" +path = "examples/numeric_input.rs" +required-features = ["custom-bindings"] + +[[example]] +name = "read_password" +path = "examples/read_password.rs" +required-features = ["derive"] + +[[example]] +name = "sqlite_history" +path = "examples/sqlite_history.rs" +required-features = ["with-sqlite-history"] + +[dependencies.bitflags] +version = "2.6" + +[dependencies.cfg-if] +version = "1.0" + +[dependencies.fd-lock] +version = "4.0.0" +optional = true + +[dependencies.home] +version = "0.5.4" +optional = true + +[dependencies.libc] +version = "0.2.155" + +[dependencies.log] +version = "0.4.22" + +[dependencies.memchr] +version = "2.7" + +[dependencies.radix_trie] +version = "0.2" +optional = true + +[dependencies.regex] +version = "1.10" +optional = true + +[dependencies.rusqlite] +version = "0.32.0" +features = [ + "bundled", + "backup", +] +optional = true +default-features = false + +[dependencies.rustyline-derive] +version = "0.11.0" +optional = true + +[dependencies.unicode-segmentation] +version = "1.0" + +[dependencies.unicode-width] +version = "0.2.0" + +[dev-dependencies.assert_matches] +version = "1.2" + +[dev-dependencies.doc-comment] +version = "0.3" + +[dev-dependencies.env_logger] +version = "0.11" +default-features = false + +[dev-dependencies.rand] +version = "0.8" + +[dev-dependencies.tempfile] +version = "3.1.0" + +[features] +case_insensitive_history_search = ["regex"] +custom-bindings = ["radix_trie"] +default = [ + "custom-bindings", + "with-dirs", + "with-file-history", +] +derive = ["rustyline-derive"] +with-dirs = ["home"] +with-file-history = ["fd-lock"] +with-fuzzy = ["skim"] +with-sqlite-history = ["rusqlite"] + +[target."cfg(unix)".dependencies.buffer-redux] +version = "1.0" +optional = true +default-features = false + +[target."cfg(unix)".dependencies.nix] +version = "0.29" +features = [ + "fs", + "ioctl", + "poll", + "signal", + "term", +] +default-features = false + +[target."cfg(unix)".dependencies.signal-hook] +version = "0.3" +optional = true +default-features = false + +[target."cfg(unix)".dependencies.skim] +version = "0.10" +optional = true +default-features = false + +[target."cfg(unix)".dependencies.termios] +version = "0.3.3" +optional = true + +[target."cfg(unix)".dependencies.utf8parse] +version = "0.2" + +[target."cfg(windows)".dependencies.clipboard-win] +version = "5.0" + +[target."cfg(windows)".dependencies.windows-sys] +version = "0.59.0" +features = [ + "Win32_Foundation", + "Win32_System_Console", + "Win32_Security", + "Win32_System_Threading", + "Win32_UI_Input_KeyboardAndMouse", +] + +[badges.maintenance] +status = "actively-developed" diff --git a/rustyline-15.0.0/Cargo.toml.orig b/rustyline-15.0.0/Cargo.toml.orig new file mode 100644 index 0000000000..d3f87d557b --- /dev/null +++ b/rustyline-15.0.0/Cargo.toml.orig @@ -0,0 +1,121 @@ +[package] +name = "rustyline" +version = "15.0.0" +authors = ["Katsu Kawakami "] +edition = "2021" +description = "Rustyline, a readline implementation based on Antirez's Linenoise" +documentation = "https://docs.rs/rustyline" +repository = "https://github.com/kkawakam/rustyline" +readme = "README.md" +keywords = ["readline"] +license = "MIT" +categories = ["command-line-interface"] + +exclude = ["/.github/*", "/rustfmt.toml"] + +[badges] +maintenance = { status = "actively-developed" } + +[workspace] +members = ["rustyline-derive"] + +[dependencies] +bitflags = "2.6" +cfg-if = "1.0" +# For file completion +home = { version = "0.5.4", optional = true } +# For History +fd-lock = { version = "4.0.0", optional = true } +rusqlite = { version = "0.32.0", optional = true, default-features = false, features = [ + "bundled", + "backup", +] } +libc = "0.2.155" +log = "0.4.22" +unicode-width = "0.2.0" +unicode-segmentation = "1.0" +memchr = "2.7" +# For custom bindings +radix_trie = { version = "0.2", optional = true } +regex = { version = "1.10", optional = true } +# For derive +rustyline-derive = { version = "0.11.0", optional = true, path = "rustyline-derive" } + +[target.'cfg(unix)'.dependencies] +nix = { version = "0.29", default-features = false, features = [ + "fs", + "ioctl", + "poll", + "signal", + "term", +] } +utf8parse = "0.2" +skim = { version = "0.10", optional = true, default-features = false } +signal-hook = { version = "0.3", optional = true, default-features = false } +termios = { version = "0.3.3", optional = true } +buffer-redux = { version = "1.0", optional = true, default-features = false } + +[target.'cfg(windows)'.dependencies] +windows-sys = { version = "0.59.0", features = [ + "Win32_Foundation", + "Win32_System_Console", + "Win32_Security", + "Win32_System_Threading", + "Win32_UI_Input_KeyboardAndMouse", +] } +clipboard-win = "5.0" + +[dev-dependencies] +doc-comment = "0.3" +env_logger = { version = "0.11", default-features = false } +tempfile = "3.1.0" +rand = "0.8" +assert_matches = "1.2" + +[features] +default = ["custom-bindings", "with-dirs", "with-file-history"] +custom-bindings = ["radix_trie"] +derive = ["rustyline-derive"] +with-dirs = ["home"] +with-file-history = ["fd-lock"] +with-sqlite-history = ["rusqlite"] +with-fuzzy = ["skim"] +case_insensitive_history_search = ["regex"] + +[[example]] +name = "custom_key_bindings" +required-features = ["custom-bindings", "derive"] +[[example]] +name = "diy_hints" +required-features = ["derive"] +[[example]] +name = "example" +required-features = ["custom-bindings", "derive"] +[[example]] +name = "input_multiline" +required-features = ["custom-bindings", "derive"] +[[example]] +name = "input_validation" +required-features = ["derive"] +[[example]] +name = "numeric_input" +required-features = ["custom-bindings"] +[[example]] +name = "read_password" +required-features = ["derive"] +[[example]] +name = "sqlite_history" +required-features = ["with-sqlite-history"] + +[package.metadata.docs.rs] +features = [ + "custom-bindings", + "derive", + "with-dirs", + "with-file-history", + "with-fuzzy", +] +all-features = false +no-default-features = true +default-target = "x86_64-unknown-linux-gnu" +rustdoc-args = ["--cfg", "docsrs"] diff --git a/rustyline-15.0.0/CustomBinding.md b/rustyline-15.0.0/CustomBinding.md new file mode 100644 index 0000000000..f2b413acda --- /dev/null +++ b/rustyline-15.0.0/CustomBinding.md @@ -0,0 +1,74 @@ +## Related topics + +- [Multiple commands for a keybinding](https://github.com/kkawakam/rustyline/issues/306) and + [Conditional Bind Sequences](https://github.com/kkawakam/rustyline/issues/269) : original issues +- [Conditional Bind Sequences](https://github.com/kkawakam/rustyline/pull/293) : incomplete proposal +- [Add `Cmd::Yield` for complex custom bindings](https://github.com/kkawakam/rustyline/pull/342) : another proposal +- [Initial invoke trait and auto-indent example](https://github.com/kkawakam/rustyline/pull/466) : a validator is like a custom action triggered indirectly. + +And other issues that should be solved if our design is good: + +- [Extend Meta-F,Alt+Right feature for hint partial completion](https://github.com/kkawakam/rustyline/pull/430) +- [Use Arrow-Up to search history with prefix](https://github.com/kkawakam/rustyline/issues/423) +- [Execute Arbitrary Command Via Keybinding](https://github.com/kkawakam/rustyline/issues/418) +- [Use Ctrl-E for hint completion](https://github.com/kkawakam/rustyline/pull/407) +- [Add History Search Behaviour](https://github.com/kkawakam/rustyline/pull/424) +- ... + +## Conditions / Filters + +See https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/key_bindings.html?highlight=filter#attaching-a-filter-condition + +Some keys/commands may behave differently depending on: + +- edit mode (emacs vs vi) +- vi input mode (insert vs replace vs command modes) +- empty line +- cursor position +- repeat count +- original key pressed (when same command is bound to different key) +- hint +- ... + +## More input + +Some keys/commands may ask for more input. +I am not sure if this point should be tackled here. + +## Multiple / complex actions + +For one key/command, we may want to perform multiple actions. +We should ask the undo manager to start a "transaction" before first action and commit it after the last action. +Should we do something specific with the kill ring ? +We should refresh / repaint only when all actions are performed (or if ask explicitly?) depending on cumulated action impacts. +... + +## Misc + +```rust +/// Command / action result +#[derive(Debug, Clone, PartialEq, Copy)] +#[non_exhaustive] +pub enum ActionResult { + // Interrupt / reject user input + // => Err should be fine + //Bail, + /// + Continue, + /// Accept user input (except if `Validator` disagrees) + Return, +} +``` + +```rust +bitflags::bitflags! { + #[doc = "Action invocation impacts"] + pub struct Impacts: u8 { + const PUSH_CHAR = 0b0000_0001; + const BEEP = 0b0000_0010; + const MOVE_CURSOR = 0b0000_0100; // State::move_cursor + const REFRESH = 0b0000_1000; // State::refresh_line + const CLEAR_SREEN = 0b0001_0000; // State::clear_screen + } +} +``` diff --git a/rustyline-15.0.0/Features.md b/rustyline-15.0.0/Features.md new file mode 100644 index 0000000000..f5123f1fa9 --- /dev/null +++ b/rustyline-15.0.0/Features.md @@ -0,0 +1,53 @@ +# Extra features + +| Alt | Scroll | Continuation prompt | Right prompt | Suspend | +| -------------- | ------ | ------------------- | ------------ | ------- | +| isocline | X | X | | | +| linefeed | | | | Unix | +| liner | | | | | +| prompt-toolkit | X | X | X | Unix | +| reedline | | X | X | | +| replxx | | | | Unix | +| rustyline | | | | Unix | +| termwiz | | | | | + +Scroll: for very long line (longer than screen cols\*rows), scrolls from start to end.\ +Continuation prompt: for multiline input, display a different prompt\ +Suspend: Control-Z + +| Alt | Editable History | Custom history backend | History timestamp | +| -------------- | ---------------- | ---------------------- | ----------------- | +| isocline | | | | +| linefeed | X | | | +| liner | | | | +| prompt-toolkit | | X | | +| reedline | | X | | +| replxx | X | | X | +| rustyline | | X | | +| termwiz | | X | \* | + +Editable History: any history entry can be edited and saved\ +Custom history backend: history persistence can be customized\ +History timestamp: history entries are timestamped + +Mouse support + +Text selection + +Completion candidates display + +Multiple commands for a keybinding + +Auto indent + +Minimal repaint + +Overwrite mode + +Lexer / Parser + +Configuration file (inputrc) + +Dynamic prompt (editing mode) + +External print diff --git a/rustyline-15.0.0/History.md b/rustyline-15.0.0/History.md new file mode 100644 index 0000000000..25f05f1c7c --- /dev/null +++ b/rustyline-15.0.0/History.md @@ -0,0 +1,32 @@ +# Config + +max_history_size + +# Current session + +- we should remember (index) of the first line inserted by this session. + - if no line has been inserted => do nothing on save + - reset this index after saving successfully. +- we should remember (path and timestamp) of the file used to initialize/`load` history. + - if path used to save history is the same: + - if timestamp is still the same => we can append only new lines if history has not been truncated. + - update timestamp after saving successfully. +- we should remember (path and timestamp) of the file used to persist/`save` history. + - reset them if `load` is then called with a different path + - update them if `load` is then called with same path. + - update them after saving successfully + - if path used to save history is the same: + - if timestamp is still the same => we can append only new lines if history has not been truncated. + +``` +HistoryInfo + first_add_index: Option, // first line inserted by this session + truncated: bool // + path_info: Option, +``` + +``` +PathInfo + path: Path, + modified: SystemTime, +``` diff --git a/rustyline-15.0.0/Incremental.md b/rustyline-15.0.0/Incremental.md new file mode 100644 index 0000000000..bcff1e14ce --- /dev/null +++ b/rustyline-15.0.0/Incremental.md @@ -0,0 +1,56 @@ +## Incremental computation + +We would like to avoid redrawing all row(s) when an event occurs. +Currently, we redraw all row(s) except when: + +- a character is inserted at the end of input (and there is no hint and no `highlight_char`), +- only the cursor is moved (input is not touched and no `highlight_char`). + +Ideally, we would like to redraw only impacted row(s) / cell(s). + +### Observable values + +Currently, we assume that highlighting does not impact layout / rendered text size. +So only the following observables impact layout: + +- prompt (interactive search, [input mode indicator](https://github.com/kkawakam/rustyline/pull/369)), +- [input mode](https://github.com/kkawakam/rustyline/pull/369), +- line(s) buffer, +- cursor position, +- hint / input validation message, +- screen size (line wrapping), +- [prompt continuation](https://github.com/kkawakam/rustyline/pull/372)s, +- row/wrap count. + +Some other values may impact layout but they are/should be constant: + +- tab stop, + +### Line wrapping and highlighting + +Currently, there is no word wrapping (only grapheme wrapping). +But we highlight the whole input at once. +So there is no issue: for example, even if a keyword is wrapped, style is preserved. + +With [prompt continuation](https://github.com/kkawakam/rustyline/pull/372)s, +we (will) interleave user input with continuations. +So we need to preserve style. + +TODO How prompt_toolkit handle this problem ? +Maybe using ANSI sequence directly was a bad idea. If `Highlighter` returns style ranges, +applying style on input slice is easy (and also supporting styles on Windows < 10). + +### Impacts + +Current granularity: + +- PUSH_CHAR at end of input +- BEEP +- MOVE_CURSOR +- REFRESH whole input / rows +- CLEAR_SCREEN (+REFRESH) + +Wanted additional granularity: + +- PUSH_STRING at end of input +- REFRESH_DIRTY only rows / cells diff --git a/rustyline-15.0.0/LICENSE b/rustyline-15.0.0/LICENSE new file mode 100644 index 0000000000..ddbad23c94 --- /dev/null +++ b/rustyline-15.0.0/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Katsu Kawakami & Rustyline authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/rustyline-15.0.0/README.md b/rustyline-15.0.0/README.md new file mode 100644 index 0000000000..f95d140202 --- /dev/null +++ b/rustyline-15.0.0/README.md @@ -0,0 +1,258 @@ +# RustyLine + +[![Build Status](https://github.com/kkawakam/rustyline/workflows/Rust/badge.svg)](https://github.com/kkawakam/rustyline/actions) +[![dependency status](https://deps.rs/repo/github/kkawakam/rustyline/status.svg)](https://deps.rs/repo/github/kkawakam/rustyline) +[![](https://img.shields.io/crates/v/rustyline.svg)](https://crates.io/crates/rustyline) +[![Docs](https://docs.rs/rustyline/badge.svg)](https://docs.rs/rustyline) + +Readline implementation in Rust that is based on [Antirez' Linenoise](https://github.com/antirez/linenoise) + +**Supported Platforms** + +- Unix (tested on FreeBSD, Linux and macOS) +- Windows + - cmd.exe + - Powershell + +**Note**: + +- Powershell ISE is not supported, check [issue #56](https://github.com/kkawakam/rustyline/issues/56) +- Mintty (Cygwin/MinGW) is not supported +- Highlighting / Colors are not supported on Windows < Windows 10 except with ConEmu and `ColorMode::Forced`. + +## Example + +```rust +use rustyline::error::ReadlineError; +use rustyline::{DefaultEditor, Result}; + +fn main() -> Result<()> { + // `()` can be used when no completer is required + let mut rl = DefaultEditor::new()?; + #[cfg(feature = "with-file-history")] + if rl.load_history("history.txt").is_err() { + println!("No previous history."); + } + loop { + let readline = rl.readline(">> "); + match readline { + Ok(line) => { + rl.add_history_entry(line.as_str()); + println!("Line: {}", line); + }, + Err(ReadlineError::Interrupted) => { + println!("CTRL-C"); + break + }, + Err(ReadlineError::Eof) => { + println!("CTRL-D"); + break + }, + Err(err) => { + println!("Error: {:?}", err); + break + } + } + } + #[cfg(feature = "with-file-history")] + rl.save_history("history.txt"); + Ok(()) +} +``` + +## crates.io + +You can use this package in your project by adding the following +to your `Cargo.toml`: + +```toml +[dependencies] +rustyline = "15.0.0" +``` + +## Features + +- Unicode (UTF-8) (linenoise supports only ASCII) +- Word completion (linenoise supports only line completion) +- Filename completion +- History search ([Searching for Commands in the History](http://tiswww.case.edu/php/chet/readline/readline.html#SEC8)) +- Kill ring ([Killing Commands](http://tiswww.case.edu/php/chet/readline/readline.html#IDX3)) +- Multi line support (line wrapping) +- Word commands +- Hints + +## Actions + +For all modes: + +| Keystroke | Action | +| --------------------- | --------------------------------------------------------------------------- | +| Home | Move cursor to the beginning of line | +| End | Move cursor to end of line | +| Left | Move cursor one character left | +| Right | Move cursor one character right | +| Ctrl-C | Interrupt/Cancel edition | +| Ctrl-D, Del | (if line is _not_ empty) Delete character under cursor | +| Ctrl-D | (if line _is_ empty) End of File | +| Ctrl-J, Ctrl-M, Enter | Finish the line entry | +| Ctrl-R | Reverse Search history (Ctrl-S forward, Ctrl-G cancel) | +| Ctrl-T | Transpose previous character with current character | +| Ctrl-U | Delete from start of line to cursor | +| Ctrl-V | Insert any special character without performing its associated action (#65) | +| Ctrl-W | Delete word leading up to cursor (using white space as a word boundary) | +| Ctrl-Y | Paste from Yank buffer | +| Ctrl-Z | Suspend (Unix only) | +| Ctrl-\_ | Undo | + +### Emacs mode (default mode) + +| Keystroke | Action | +| ----------------- | ------------------------------------------------------------------------------------------------ | +| Ctrl-A, Home | Move cursor to the beginning of line | +| Ctrl-B, Left | Move cursor one character left | +| Ctrl-E, End | Move cursor to end of line | +| Ctrl-F, Right | Move cursor one character right | +| Ctrl-H, Backspace | Delete character before cursor | +| Ctrl-I, Tab | Next completion | +| Ctrl-K | Delete from cursor to end of line | +| Ctrl-L | Clear screen | +| Ctrl-N, Down | Next match from history | +| Ctrl-P, Up | Previous match from history | +| Ctrl-X Ctrl-U | Undo | +| Ctrl-Y | Paste from Yank buffer (Meta-Y to paste next yank instead) | +| Meta-< | Move to first entry in history | +| Meta-> | Move to last entry in history | +| Meta-B, Alt-Left | Move cursor to previous word | +| Meta-C | Capitalize the current word | +| Meta-D | Delete forwards one word | +| Meta-F, Alt-Right | Move cursor to next word | +| Meta-L | Lower-case the next word | +| Meta-T | Transpose words | +| Meta-U | Upper-case the next word | +| Meta-Y | See Ctrl-Y | +| Meta-Backspace | Kill from the start of the current word, or, if between words, to the start of the previous word | +| Meta-0, 1, ..., - | Specify the digit to the argument. `–` starts a negative argument. | + +[Readline Emacs Editing Mode Cheat Sheet](http://www.catonmat.net/download/readline-emacs-editing-mode-cheat-sheet.pdf) + +### vi command mode + +| Keystroke | Action | +| -------------------- | --------------------------------------------------------------------------- | +| $, End | Move cursor to end of line | +| . | Redo the last text modification | +| ; | Redo the last character finding command | +| , | Redo the last character finding command in opposite direction | +| 0, Home | Move cursor to the beginning of line | +| ^ | Move to the first non-blank character of line | +| a | Insert after cursor | +| A | Insert at the end of line | +| b | Move one word or token left | +| B | Move one non-blank word left | +| c | Change text of a movement command | +| C | Change text to the end of line (equivalent to c$) | +| d | Delete text of a movement command | +| D, Ctrl-K | Delete to the end of the line | +| e | Move to the end of the current word | +| E | Move to the end of the current non-blank word | +| f | Move right to the next occurrence of `char` | +| F | Move left to the previous occurrence of `char` | +| h, Ctrl-H, Backspace | Move one character left | +| l, Space | Move one character right | +| Ctrl-L | Clear screen | +| i | Insert before cursor | +| I | Insert at the beginning of line | +| +, j, Ctrl-N | Move forward one command in history | +| -, k, Ctrl-P | Move backward one command in history | +| p | Insert the yanked text at the cursor (paste) | +| P | Insert the yanked text before the cursor | +| r | Replaces a single character under the cursor (without leaving command mode) | +| s | Delete a single character under the cursor and enter input mode | +| S | Change current line (equivalent to 0c$) | +| t | Move right to the next occurrence of `char`, then one char backward | +| T | Move left to the previous occurrence of `char`, then one char forward | +| u | Undo | +| w | Move one word or token right | +| W | Move one non-blank word right | +| x | Delete a single character under the cursor | +| X | Delete a character before the cursor | +| y | Yank a movement into buffer (copy) | + +### vi insert mode + +| Keystroke | Action | +| ----------------- | ------------------------------ | +| Ctrl-H, Backspace | Delete character before cursor | +| Ctrl-I, Tab | Next completion | +| Esc | Switch to command mode | + +[Readline vi Editing Mode Cheat Sheet](http://www.catonmat.net/download/bash-vi-editing-mode-cheat-sheet.pdf) + +[ANSI escape code](https://en.wikipedia.org/wiki/ANSI_escape_code) + +## Wine + +```sh +$ cargo run --example example --target 'x86_64-pc-windows-gnu' +... +Error: Io(Error { repr: Os { code: 6, message: "Invalid handle." } }) +$ wineconsole --backend=curses target/x86_64-pc-windows-gnu/debug/examples/example.exe +... +``` + +## Terminal checks + +```sh +$ # current settings of all terminal attributes: +$ stty -a +$ # key bindings: +$ bind -p +$ # print out a terminfo description: +$ infocmp +``` + +## Similar projects + +| Library | Lang | OS | Term | Unicode | History | Completion | Keymap | Kill Ring | Undo | Colors | Hint/Auto suggest | +| ------------------ | ------- | ------ | ---- | ------- | ------------- | ---------- | ------------- | --------- | ---- | ---------- | ----------------- | +| [go-prompt][] | Go | Ux/win | ANSI | Yes | Yes | any | Emacs/prog | No | No | Yes | Yes | +| [Haskeline][] | Haskell | Ux/Win | Any | Yes | Yes | any | Emacs/vi/conf | Yes | Yes | ? | ? | +| [isocline][] | C | Ux/Win | ANSI | Yes | Yes | any | Emacs | No | Yes | Yes | Yes | +| [linefeed][] | Rust | Ux/Win | Any | | Yes | any | Emacs/conf | Yes | No | ? | No | +| [linenoise][] | C | Ux | ANSI | No | Yes | only line | Emacs | No | No | Ux | Yes | +| [Liner][] | Rust | Ux | ANSI | | No inc search | only word | Emacs/vi/prog | No | Yes | Ux | History based | +| [prompt_toolkit][] | Python | Ux/Win | ANSI | Yes | Yes | any | Emacs/vi/conf | Yes | Yes | Ux/Win | Yes | +| [reedline][] | Rust | Ux/Win | ANSI | Yes | Yes | any | Emacs/vi/bind | No | Yes | Ux/Win | Yes | +| [replxx][] | C/C++ | Ux/Win | ANSI | Yes | Yes | only line | Emacs | Yes | No | Ux/Win | Yes | +| Rustyline | Rust | Ux/Win | ANSI | Yes | Yes | any | Emacs/vi/bind | Yes | Yes | Ux/Win 10+ | Yes | +| [termwiz][] | Rust | Ux/Win | Any | ? | Yes | any | Emacs | No | No | Ux/Win | No | + +[go-prompt]: https://github.com/c-bata/go-prompt +[haskeline]: https://github.com/judah/haskeline +[isocline]: https://github.com/daanx/isocline +[linefeed]: https://github.com/murarth/linefeed +[linenoise]: https://github.com/antirez/linenoise +[liner]: https://github.com/redox-os/liner +[prompt_toolkit]: https://github.com/jonathanslenders/python-prompt-toolkit +[reedline]: https://github.com/nushell/reedline +[replxx]: https://github.com/AmokHuginnsson/replxx +[termwiz]: https://github.com/wez/wezterm/tree/main/termwiz + +## Multi line support + +This is a very simple feature that simply causes lines that are longer +than the current terminal width to be displayed on the next visual +line instead of horizontally scrolling as more characters are +typed. Currently, this feature is always enabled and there is no +configuration option to disable it. + +This feature does not allow the end user to hit a special key +sequence and enter a mode where hitting the return key will cause a +literal newline to be added to the input buffer. + +The way to achieve multi-line editing is to implement the `Validator` +trait. + +## Minimum supported Rust version (MSRV) + +Latest stable Rust version at the time of release. It might compile with older versions. diff --git a/rustyline-15.0.0/TODO.md b/rustyline-15.0.0/TODO.md new file mode 100644 index 0000000000..4980b47ae6 --- /dev/null +++ b/rustyline-15.0.0/TODO.md @@ -0,0 +1,116 @@ +API + +- [ ] expose an API callable from C + +Async (#126) + +Bell + +- [x] bell-style + +Color + +- [x] ANSI Colors & Windows 10+ +- [ ] ANSI Colors & Windows <10 (https://docs.rs/console/0.6.1/console/fn.strip_ansi_codes.html ? + https://github.com/mattn/go-colorable/blob/master/colorable_windows.go, + https://github.com/mattn/ansicolor-w32.c) +- [ ] Syntax highlighting (https://github.com/trishume/syntect/) +- [ ] clicolors spec (https://docs.rs/console/0.6.1/console/fn.colors_enabled.html) + +Completion + +- [x] Quoted path +- [x] Windows escape/unescape space in path +- [ ] file completion & escape/unescape (#106) +- [ ] file completion & tilde (#62) +- [x] display versus replacement +- [ ] composite/alternate completer (if the current completer returns nothing, try the next one) + +Config + +- [ ] Maximum buffer size for the line read + +Cursor + +- [ ] insert versus overwrite versus command mode +- [ ] In vi command mode, prevent user from going to end of line. (#94) + +Grapheme + +- [ ] grapheme & input auto-wrap are buggy + +Hints Callback + +- [x] Not implemented on Windows +- [x] Do an implementation based on previous history + +History + +- [ ] Move to the history line n +- [ ] historyFile: Where to read/write the history at the start and end of + each line input session. +- [x] append_history +- [ ] history_truncate_file +- [X] custom persistent storage + +Input + +- [ ] Password input (#58) (https://github.com/conradkdotcom/rpassword) (https://github.com/antirez/linenoise/issues/125) +- [x] quoted insert (#65) +- [ ] Overwrite mode (em-toggle-overwrite, vi-replace-mode, rl_insert_mode) +- [ ] Encoding +- [x] \[Ctrl-]\[Alt-]\[Shift-] (#121) + +Layout + +- [ ] Scroll +- [ ] Redraw perf (https://crates.io/crates/cassowary) + +Misc + +- [ ] fallible iterator (https://docs.rs/fallible-iterator/0.2.1/fallible_iterator/) + +Mouse + +- [ ] Mouse support + +Movement + +- [ ] Move to the corresponding opening/closing bracket + +Redo + +- [x] redo substitute + +Repeat + +- [x] dynamic prompt (arg: ?) +- [ ] transpose chars + +Syntax + +- [ ] syntax specific tokenizer/parser +- [ ] highlighting + +Undo + +- [ ] Merge consecutive Replace +- [x] Undo group +- [ ] Undo all changes made to this line. +- [x] Kill+Insert (substitute/replace) +- [x] Repeated undo `Undo(RepeatCount)` + +Unix + +- [ ] Terminfo (https://github.com/Stebalien/term) +- [ ] [ncurses](https://crates.io/crates/ncurses) alternative backend ? +- [x] [bracketed paste mode](https://cirw.in/blog/bracketed-paste) +- [ ] async stdin (https://github.com/Rufflewind/tokio-file-unix) + +Windows + +- [ ] is_atty is not working with Cygwin/MSYS (https://github.com/softprops/atty works but then how to make `enable_raw_mode` works ?) + (https://github.com/mitsuhiko/console/blob/master/src/windows_term.rs#L285) + (https://github.com/mattn/go-isatty/blob/master/isatty_windows.go, https://github.com/mattn/go-tty/blob/master/tty_windows.go#L143) +- [x] UTF-16 surrogate pair +- [ ] handle ANSI escape code (#61) (https://github.com/DanielKeep/rust-ansi-interpreter) diff --git a/rustyline-15.0.0/examples/custom_key_bindings.rs b/rustyline-15.0.0/examples/custom_key_bindings.rs new file mode 100644 index 0000000000..7d6624af7c --- /dev/null +++ b/rustyline-15.0.0/examples/custom_key_bindings.rs @@ -0,0 +1,108 @@ +use std::borrow::Cow::{self, Borrowed, Owned}; + +use rustyline::highlight::Highlighter; +use rustyline::hint::HistoryHinter; +use rustyline::history::DefaultHistory; +use rustyline::{ + Cmd, ConditionalEventHandler, Editor, Event, EventContext, EventHandler, KeyEvent, RepeatCount, + Result, +}; +use rustyline::{Completer, Helper, Hinter, Validator}; + +#[derive(Completer, Helper, Hinter, Validator)] +struct MyHelper(#[rustyline(Hinter)] HistoryHinter); + +impl Highlighter for MyHelper { + fn highlight_prompt<'b, 's: 'b, 'p: 'b>( + &'s self, + prompt: &'p str, + default: bool, + ) -> Cow<'b, str> { + if default { + Owned(format!("\x1b[1;32m{prompt}\x1b[m")) + } else { + Borrowed(prompt) + } + } + + fn highlight_hint<'h>(&self, hint: &'h str) -> Cow<'h, str> { + Owned(format!("\x1b[1m{hint}\x1b[m")) + } +} + +#[derive(Clone)] +struct CompleteHintHandler; +impl ConditionalEventHandler for CompleteHintHandler { + fn handle(&self, evt: &Event, _: RepeatCount, _: bool, ctx: &EventContext) -> Option { + if !ctx.has_hint() { + return None; // default + } + if let Some(k) = evt.get(0) { + #[allow(clippy::if_same_then_else)] + if *k == KeyEvent::ctrl('E') { + Some(Cmd::CompleteHint) + } else if *k == KeyEvent::alt('f') && ctx.line().len() == ctx.pos() { + let text = ctx.hint_text()?; + let mut start = 0; + if let Some(first) = text.chars().next() { + if !first.is_alphanumeric() { + start = text.find(|c: char| c.is_alphanumeric()).unwrap_or_default(); + } + } + + let text = text + .chars() + .enumerate() + .take_while(|(i, c)| *i <= start || c.is_alphanumeric()) + .map(|(_, c)| c) + .collect::(); + + Some(Cmd::Insert(1, text)) + } else { + None + } + } else { + unreachable!() + } + } +} + +struct TabEventHandler; +impl ConditionalEventHandler for TabEventHandler { + fn handle(&self, evt: &Event, n: RepeatCount, _: bool, ctx: &EventContext) -> Option { + debug_assert_eq!(*evt, Event::from(KeyEvent::from('\t'))); + if ctx.line()[..ctx.pos()] + .chars() + .next_back() + .filter(|c| c.is_whitespace()) + .is_some() + { + Some(Cmd::SelfInsert(n, '\t')) + } else { + None // default complete + } + } +} + +fn main() -> Result<()> { + let mut rl = Editor::::new()?; + rl.set_helper(Some(MyHelper(HistoryHinter::new()))); + + let ceh = Box::new(CompleteHintHandler); + rl.bind_sequence(KeyEvent::ctrl('E'), EventHandler::Conditional(ceh.clone())); + rl.bind_sequence(KeyEvent::alt('f'), EventHandler::Conditional(ceh)); + rl.bind_sequence( + KeyEvent::from('\t'), + EventHandler::Conditional(Box::new(TabEventHandler)), + ); + rl.bind_sequence( + Event::KeySeq(vec![KeyEvent::ctrl('X'), KeyEvent::ctrl('E')]), + EventHandler::Simple(Cmd::Suspend), // TODO external editor + ); + + loop { + let line = rl.readline("> ")?; + rl.add_history_entry(line.as_str())?; + println!("Line: {line}"); + } +} diff --git a/rustyline-15.0.0/examples/diy_hints.rs b/rustyline-15.0.0/examples/diy_hints.rs new file mode 100644 index 0000000000..af8fadc803 --- /dev/null +++ b/rustyline-15.0.0/examples/diy_hints.rs @@ -0,0 +1,96 @@ +use std::collections::HashSet; + +use rustyline::hint::{Hint, Hinter}; +use rustyline::history::DefaultHistory; +use rustyline::Context; +use rustyline::{Completer, Helper, Highlighter, Validator}; +use rustyline::{Editor, Result}; + +#[derive(Completer, Helper, Validator, Highlighter)] +struct DIYHinter { + // It's simple example of rustyline, for more efficient, please use ** radix trie ** + hints: HashSet, +} + +#[derive(Hash, Debug, PartialEq, Eq)] +struct CommandHint { + display: String, + complete_up_to: usize, +} + +impl Hint for CommandHint { + fn display(&self) -> &str { + &self.display + } + + fn completion(&self) -> Option<&str> { + if self.complete_up_to > 0 { + Some(&self.display[..self.complete_up_to]) + } else { + None + } + } +} + +impl CommandHint { + fn new(text: &str, complete_up_to: &str) -> Self { + assert!(text.starts_with(complete_up_to)); + Self { + display: text.into(), + complete_up_to: complete_up_to.len(), + } + } + + fn suffix(&self, strip_chars: usize) -> Self { + Self { + display: self.display[strip_chars..].to_owned(), + complete_up_to: self.complete_up_to.saturating_sub(strip_chars), + } + } +} + +impl Hinter for DIYHinter { + type Hint = CommandHint; + + fn hint(&self, line: &str, pos: usize, _ctx: &Context<'_>) -> Option { + if line.is_empty() || pos < line.len() { + return None; + } + + self.hints + .iter() + .filter_map(|hint| { + // expect hint after word complete, like redis cli, add condition: + // line.ends_with(" ") + if hint.display.starts_with(line) { + Some(hint.suffix(pos)) + } else { + None + } + }) + .next() + } +} + +fn diy_hints() -> HashSet { + let mut set = HashSet::new(); + set.insert(CommandHint::new("help", "help")); + set.insert(CommandHint::new("get key", "get ")); + set.insert(CommandHint::new("set key value", "set ")); + set.insert(CommandHint::new("hget key field", "hget ")); + set.insert(CommandHint::new("hset key field value", "hset ")); + set +} + +fn main() -> Result<()> { + println!("This is a DIY hint hack of rustyline"); + let h = DIYHinter { hints: diy_hints() }; + + let mut rl: Editor = Editor::new()?; + rl.set_helper(Some(h)); + + loop { + let input = rl.readline("> ")?; + println!("input: {input}"); + } +} diff --git a/rustyline-15.0.0/examples/example.rs b/rustyline-15.0.0/examples/example.rs new file mode 100644 index 0000000000..d258064c67 --- /dev/null +++ b/rustyline-15.0.0/examples/example.rs @@ -0,0 +1,98 @@ +use std::borrow::Cow::{self, Borrowed, Owned}; + +use rustyline::completion::FilenameCompleter; +use rustyline::error::ReadlineError; +use rustyline::highlight::{CmdKind, Highlighter, MatchingBracketHighlighter}; +use rustyline::hint::HistoryHinter; +use rustyline::validate::MatchingBracketValidator; +use rustyline::{Cmd, CompletionType, Config, EditMode, Editor, KeyEvent}; +use rustyline::{Completer, Helper, Hinter, Validator}; + +#[derive(Helper, Completer, Hinter, Validator)] +struct MyHelper { + #[rustyline(Completer)] + completer: FilenameCompleter, + highlighter: MatchingBracketHighlighter, + #[rustyline(Validator)] + validator: MatchingBracketValidator, + #[rustyline(Hinter)] + hinter: HistoryHinter, + colored_prompt: String, +} + +impl Highlighter for MyHelper { + fn highlight_prompt<'b, 's: 'b, 'p: 'b>( + &'s self, + prompt: &'p str, + default: bool, + ) -> Cow<'b, str> { + if default { + Borrowed(&self.colored_prompt) + } else { + Borrowed(prompt) + } + } + + fn highlight_hint<'h>(&self, hint: &'h str) -> Cow<'h, str> { + Owned("\x1b[1m".to_owned() + hint + "\x1b[m") + } + + fn highlight<'l>(&self, line: &'l str, pos: usize) -> Cow<'l, str> { + self.highlighter.highlight(line, pos) + } + + fn highlight_char(&self, line: &str, pos: usize, kind: CmdKind) -> bool { + self.highlighter.highlight_char(line, pos, kind) + } +} + +// To debug rustyline: +// RUST_LOG=rustyline=debug cargo run --example example 2> debug.log +fn main() -> rustyline::Result<()> { + env_logger::init(); + let config = Config::builder() + .history_ignore_space(true) + .completion_type(CompletionType::List) + .edit_mode(EditMode::Emacs) + .build(); + let h = MyHelper { + completer: FilenameCompleter::new(), + highlighter: MatchingBracketHighlighter::new(), + hinter: HistoryHinter::new(), + colored_prompt: "".to_owned(), + validator: MatchingBracketValidator::new(), + }; + let mut rl = Editor::with_config(config)?; + rl.set_helper(Some(h)); + rl.bind_sequence(KeyEvent::alt('n'), Cmd::HistorySearchForward); + rl.bind_sequence(KeyEvent::alt('p'), Cmd::HistorySearchBackward); + if rl.load_history("history.txt").is_err() { + println!("No previous history."); + } + let mut count = 1; + loop { + let p = format!("{count}> "); + rl.helper_mut().expect("No helper").colored_prompt = format!("\x1b[1;32m{p}\x1b[0m"); + let readline = rl.readline(&p); + match readline { + Ok(line) => { + rl.add_history_entry(line.as_str())?; + println!("Line: {line}"); + } + Err(ReadlineError::Interrupted) => { + println!("Interrupted"); + break; + } + Err(ReadlineError::Eof) => { + println!("Encountered Eof"); + break; + } + Err(err) => { + println!("Error: {err:?}"); + break; + } + } + count += 1; + } + rl.append_history("history.txt") +} diff --git a/rustyline-15.0.0/examples/external_print.rs b/rustyline-15.0.0/examples/external_print.rs new file mode 100644 index 0000000000..f93769e955 --- /dev/null +++ b/rustyline-15.0.0/examples/external_print.rs @@ -0,0 +1,29 @@ +use std::thread; +use std::time::Duration; + +use rand::{thread_rng, Rng}; + +use rustyline::{DefaultEditor, ExternalPrinter, Result}; + +fn main() -> Result<()> { + let mut rl = DefaultEditor::new()?; + let mut printer = rl.create_external_printer()?; + thread::spawn(move || { + let mut rng = thread_rng(); + let mut i = 0usize; + loop { + printer + .print(format!("External message #{i}")) + .expect("External print failure"); + let wait_ms = rng.gen_range(1000..10000); + thread::sleep(Duration::from_millis(wait_ms)); + i += 1; + } + }); + + loop { + let line = rl.readline("> ")?; + rl.add_history_entry(line.as_str())?; + println!("Line: {line}"); + } +} diff --git a/rustyline-15.0.0/examples/input_multiline.rs b/rustyline-15.0.0/examples/input_multiline.rs new file mode 100644 index 0000000000..ead5e88259 --- /dev/null +++ b/rustyline-15.0.0/examples/input_multiline.rs @@ -0,0 +1,30 @@ +use rustyline::highlight::MatchingBracketHighlighter; +use rustyline::validate::MatchingBracketValidator; +use rustyline::{Cmd, Editor, EventHandler, KeyCode, KeyEvent, Modifiers, Result}; +use rustyline::{Completer, Helper, Highlighter, Hinter, Validator}; + +#[derive(Completer, Helper, Highlighter, Hinter, Validator)] +struct InputValidator { + #[rustyline(Validator)] + brackets: MatchingBracketValidator, + #[rustyline(Highlighter)] + highlighter: MatchingBracketHighlighter, +} + +fn main() -> Result<()> { + let h = InputValidator { + brackets: MatchingBracketValidator::new(), + highlighter: MatchingBracketHighlighter::new(), + }; + let mut rl = Editor::new()?; + rl.set_helper(Some(h)); + rl.bind_sequence( + KeyEvent(KeyCode::Char('s'), Modifiers::CTRL), + EventHandler::Simple(Cmd::Newline), + ); + + let input = rl.readline("> ")?; + println!("Input: {input}"); + + Ok(()) +} diff --git a/rustyline-15.0.0/examples/input_validation.rs b/rustyline-15.0.0/examples/input_validation.rs new file mode 100644 index 0000000000..583d94f62e --- /dev/null +++ b/rustyline-15.0.0/examples/input_validation.rs @@ -0,0 +1,31 @@ +use rustyline::validate::{ValidationContext, ValidationResult, Validator}; +use rustyline::{Completer, Helper, Highlighter, Hinter}; +use rustyline::{Editor, Result}; + +#[derive(Completer, Helper, Highlighter, Hinter)] +struct InputValidator {} + +impl Validator for InputValidator { + fn validate(&self, ctx: &mut ValidationContext) -> Result { + use ValidationResult::{Incomplete, Invalid, Valid}; + let input = ctx.input(); + let result = if !input.starts_with("SELECT") { + Invalid(Some(" --< Expect: SELECT stmt".to_owned())) + } else if !input.ends_with(';') { + Incomplete + } else { + Valid(None) + }; + Ok(result) + } +} + +fn main() -> Result<()> { + let h = InputValidator {}; + let mut rl = Editor::new()?; + rl.set_helper(Some(h)); + + let input = rl.readline("> ")?; + println!("Input: {input}"); + Ok(()) +} diff --git a/rustyline-15.0.0/examples/minimal.rs b/rustyline-15.0.0/examples/minimal.rs new file mode 100644 index 0000000000..9fc627ee4b --- /dev/null +++ b/rustyline-15.0.0/examples/minimal.rs @@ -0,0 +1,11 @@ +use rustyline::{DefaultEditor, Result}; + +/// Minimal REPL +fn main() -> Result<()> { + env_logger::init(); + let mut rl = DefaultEditor::new()?; + loop { + let line = rl.readline("> ")?; // read + println!("Line: {line}"); // eval / print + } // loop +} diff --git a/rustyline-15.0.0/examples/numeric_input.rs b/rustyline-15.0.0/examples/numeric_input.rs new file mode 100644 index 0000000000..49eb6f94b7 --- /dev/null +++ b/rustyline-15.0.0/examples/numeric_input.rs @@ -0,0 +1,33 @@ +use rustyline::{ + Cmd, ConditionalEventHandler, DefaultEditor, Event, EventContext, EventHandler, KeyCode, + KeyEvent, Modifiers, RepeatCount, Result, +}; + +struct FilteringEventHandler; +impl ConditionalEventHandler for FilteringEventHandler { + fn handle(&self, evt: &Event, _: RepeatCount, _: bool, _: &EventContext) -> Option { + if let Some(KeyEvent(KeyCode::Char(c), m)) = evt.get(0) { + if m.contains(Modifiers::CTRL) || m.contains(Modifiers::ALT) || c.is_ascii_digit() { + None + } else { + Some(Cmd::Noop) // filter out invalid input + } + } else { + None + } + } +} + +fn main() -> Result<()> { + let mut rl = DefaultEditor::new()?; + + rl.bind_sequence( + Event::Any, + EventHandler::Conditional(Box::new(FilteringEventHandler)), + ); + + loop { + let line = rl.readline("> ")?; + println!("Num: {line}"); + } +} diff --git a/rustyline-15.0.0/examples/read_password.rs b/rustyline-15.0.0/examples/read_password.rs new file mode 100644 index 0000000000..d93418ae2d --- /dev/null +++ b/rustyline-15.0.0/examples/read_password.rs @@ -0,0 +1,49 @@ +use std::borrow::Cow::{self, Borrowed, Owned}; + +use rustyline::config::Configurer; +use rustyline::highlight::{CmdKind, Highlighter}; +use rustyline::{ColorMode, Editor, Result}; +use rustyline::{Completer, Helper, Hinter, Validator}; + +#[derive(Completer, Helper, Hinter, Validator)] +struct MaskingHighlighter { + masking: bool, +} + +impl Highlighter for MaskingHighlighter { + fn highlight<'l>(&self, line: &'l str, _pos: usize) -> Cow<'l, str> { + use unicode_width::UnicodeWidthStr; + if self.masking { + Owned(" ".repeat(line.width())) + } else { + Borrowed(line) + } + } + + fn highlight_char(&self, _line: &str, _pos: usize, kind: CmdKind) -> bool { + match kind { + CmdKind::MoveCursor => false, + _ => self.masking, + } + } +} + +fn main() -> Result<()> { + env_logger::init(); + println!("This is just a hack. Reading passwords securely requires more than that."); + let h = MaskingHighlighter { masking: false }; + let mut rl = Editor::new()?; + rl.set_helper(Some(h)); + + let username = rl.readline("Username:")?; + println!("Username: {username}"); + + rl.helper_mut().expect("No helper").masking = true; + rl.set_color_mode(ColorMode::Forced); // force masking + rl.set_auto_add_history(false); // make sure password is not added to history + let mut guard = rl.set_cursor_visibility(false)?; + let passwd = rl.readline("Password:")?; + guard.take(); + println!("Secret: {passwd}"); + Ok(()) +} diff --git a/rustyline-15.0.0/examples/sqlite_history.rs b/rustyline-15.0.0/examples/sqlite_history.rs new file mode 100644 index 0000000000..a1efac840b --- /dev/null +++ b/rustyline-15.0.0/examples/sqlite_history.rs @@ -0,0 +1,17 @@ +use rustyline::{Config, Editor, Result}; + +fn main() -> Result<()> { + let config = Config::builder().auto_add_history(true).build(); + let history = if false { + // memory + rustyline::sqlite_history::SQLiteHistory::with_config(config)? + } else { + // file + rustyline::sqlite_history::SQLiteHistory::open(config, "history.sqlite3")? + }; + let mut rl: Editor<(), _> = Editor::with_history(config, history)?; + loop { + let line = rl.readline("> ")?; + println!("{line}"); + } +} diff --git a/rustyline-15.0.0/linenoise.md b/rustyline-15.0.0/linenoise.md new file mode 100644 index 0000000000..7dedb7fef5 --- /dev/null +++ b/rustyline-15.0.0/linenoise.md @@ -0,0 +1,34 @@ +Mapping between linenoise API and rustyline API + +| linenoise | rustyline | Remarks | +|--------------------------------|------------------------------|---------------------------| +| linenoiseState | State | | +| *Blocking API* | +| linenoise | Editor::readline | +| linenoiseFree | _ | RAII | +| *Non blocking API* | | +| linenoiseEditStart | _ | +| linenoiseEditFeed | _ | +| linenoiseEditStop | _ | +| linenoiseHide | Renderer::clear_rows | +| linenoiseShow | State::refresh_line | +| *Completion API* | +| linenoiseCompletions | Vec | +| linenoiseCompletionCallback | Completer | +| linenoiseAddCompletion | _ | std Vec::add | +| linenoiseSetCompletionCallback | Editor::set_helper | +| linenoiseHintsCallback | Hinter | +| linenoiseSetHintsCallback | Editor::set_helper | +| linenoiseFreeHintsCallback | _ | RAII | +| linenoiseSetFreeHintsCallback | _ | RAII | +| *History API* | +| linenoiseHistoryAdd | Editor::add_history_entry | +| linenoiseHistorySetMaxLen | Editor::set_max_history_size | +| linenoiseHistorySave | Editor::save_history | +| linenoiseHistoryLoad | Editor::load_history | +| *Other utilities* | +| linenoiseClearScreen | Editor::clear_screen | +| linenoiseSetMultiLine | _ | Always activated | +| linenoisePrintKeyCodes | _ | debug logs | +| linenoiseMaskModeEnable | _ | see read_password example | +| linenoiseMaskModeDisable | _ | diff --git a/rustyline-15.0.0/src/binding.rs b/rustyline-15.0.0/src/binding.rs new file mode 100644 index 0000000000..4641831246 --- /dev/null +++ b/rustyline-15.0.0/src/binding.rs @@ -0,0 +1,258 @@ +/// Custom event handlers +use crate::{ + Cmd, EditMode, InputMode, InputState, KeyCode, KeyEvent, Modifiers, Refresher, RepeatCount, +}; + +use radix_trie::TrieKey; + +/// Input event +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[cfg_attr(docsrs, doc(cfg(feature = "custom-bindings")))] +pub enum Event { + /// Wildcard. + /// Useful if you want to filter out some keys. + Any, + /// Key sequence + KeySeq(Vec), + /// TODO Mouse event + Mouse(), +} + +impl Event { + /// See [`KeyEvent::normalize`] + pub(crate) fn normalize(mut self) -> Self { + if let Self::KeySeq(ref mut keys) = self { + for key in keys.iter_mut() { + *key = KeyEvent::normalize(*key); + } + } + self + } + + /// Return `i`th key event + #[must_use] + pub fn get(&self, i: usize) -> Option<&KeyEvent> { + if let Self::KeySeq(ref ks) = self { + ks.get(i) + } else { + None + } + } +} + +impl From for Event { + fn from(k: KeyEvent) -> Self { + Self::KeySeq(vec![k]) + } +} + +const BASE: u32 = 0x0010_ffff + 1; +const BASE_CONTROL: u32 = 0x0200_0000; +const BASE_META: u32 = 0x0400_0000; +const BASE_SHIFT: u32 = 0x0100_0000; +const ESCAPE: u32 = 27; +const PAGE_UP: u32 = BASE + 1; +const PAGE_DOWN: u32 = PAGE_UP + 1; +const DOWN: u32 = PAGE_DOWN + 1; +const UP: u32 = DOWN + 1; +const LEFT: u32 = UP + 1; +const RIGHT: u32 = LEFT + 1; +const HOME: u32 = RIGHT + 1; +const END: u32 = HOME + 1; +const DELETE: u32 = END + 1; +const INSERT: u32 = DELETE + 1; +//const F1: u32 = INSERT + 1; +const MOUSE: u32 = /* F24 + 1 */ INSERT + 25; +const PASTE_START: u32 = MOUSE + 1; +const PASTE_FINISH: u32 = PASTE_START + 1; +const ANY: u32 = PASTE_FINISH + 1; + +impl KeyEvent { + fn encode(&self) -> u32 { + let mut u = match self.0 { + KeyCode::UnknownEscSeq | KeyCode::Null => 0, + KeyCode::Backspace => u32::from('\x7f'), + KeyCode::BackTab => u32::from('\t') | BASE_SHIFT, + KeyCode::BracketedPasteStart => PASTE_START, + KeyCode::BracketedPasteEnd => PASTE_FINISH, + KeyCode::Char(c) => u32::from(c), + KeyCode::Delete => DELETE, + KeyCode::Down => DOWN, + KeyCode::End => END, + KeyCode::Enter => u32::from('\r'), + KeyCode::F(i) => INSERT + u32::from(i), + KeyCode::Esc => ESCAPE, + KeyCode::Home => HOME, + KeyCode::Insert => INSERT, + KeyCode::Left => LEFT, + KeyCode::PageDown => PAGE_DOWN, + KeyCode::PageUp => PAGE_UP, + KeyCode::Right => RIGHT, + KeyCode::Tab => u32::from('\t'), + KeyCode::Up => UP, + }; + if self.1.contains(Modifiers::CTRL) { + u |= BASE_CONTROL; + } + if self.1.contains(Modifiers::ALT) { + u |= BASE_META; + } + if self.1.contains(Modifiers::SHIFT) { + u |= BASE_SHIFT; + } + u + } +} + +impl TrieKey for Event { + fn encode_bytes(&self) -> Vec { + match self { + Self::Any => ANY.to_be_bytes().to_vec(), + Self::KeySeq(keys) => { + let mut dst = Vec::with_capacity(keys.len() * 4); + for key in keys { + dst.extend_from_slice(&key.encode().to_be_bytes()); + } + dst + } + Self::Mouse() => MOUSE.to_be_bytes().to_vec(), + } + } +} + +/// Event handler +#[cfg_attr(docsrs, doc(cfg(feature = "custom-bindings")))] +pub enum EventHandler { + /// unconditional command + Simple(Cmd), + /// handler behaviour depends on input state + Conditional(Box), + /* invoke multiple actions + * TODO Macro(), */ +} + +impl From for EventHandler { + fn from(c: Cmd) -> Self { + Self::Simple(c) + } +} + +/// Give access to user input. +#[cfg_attr(docsrs, doc(cfg(feature = "custom-bindings")))] +pub struct EventContext<'r> { + mode: EditMode, + input_mode: InputMode, + wrt: &'r dyn Refresher, +} + +impl<'r> EventContext<'r> { + pub(crate) fn new(is: &InputState, wrt: &'r dyn Refresher) -> Self { + Self { + mode: is.mode, + input_mode: is.input_mode, + wrt, + } + } + + /// emacs or vi mode + #[must_use] + pub fn mode(&self) -> EditMode { + self.mode + } + + /// vi input mode + #[must_use] + pub fn input_mode(&self) -> InputMode { + self.input_mode + } + + /// Returns `true` if there is a hint displayed. + #[must_use] + pub fn has_hint(&self) -> bool { + self.wrt.has_hint() + } + + /// Returns the hint text that is shown after the current cursor position. + #[must_use] + pub fn hint_text(&self) -> Option<&str> { + self.wrt.hint_text() + } + + /// currently edited line + #[must_use] + pub fn line(&self) -> &str { + self.wrt.line() + } + + /// Current cursor position (byte position) + #[must_use] + pub fn pos(&self) -> usize { + self.wrt.pos() + } +} + +/// May behave differently depending on: +/// * edit mode (emacs vs vi) +/// * vi input mode (insert vs replace vs command modes) +/// * empty line +/// * cursor position +/// * repeat count +/// * original key pressed (when same command is bound to different key) +/// * hint +/// * ... +#[cfg_attr(docsrs, doc(cfg(feature = "custom-bindings")))] +pub trait ConditionalEventHandler: Send + Sync { + /// Takes the current input state and + /// returns the command to be performed or `None` to perform the default + /// one. + fn handle( + &self, + evt: &Event, + n: RepeatCount, + positive: bool, + ctx: &EventContext, + ) -> Option; +} + +#[cfg(test)] +mod test { + use super::{Event, EventHandler}; + use crate::{Cmd, KeyCode, KeyEvent, Modifiers}; + use radix_trie::Trie; + + #[test] + fn encode() { + let mut trie = Trie::new(); + let evt = Event::KeySeq(vec![KeyEvent::ctrl('X'), KeyEvent::ctrl('E')]); + trie.insert(evt.clone(), EventHandler::from(Cmd::Noop)); + let prefix = Event::from(KeyEvent::ctrl('X')); + let subtrie = trie.get_raw_descendant(&prefix); + assert!(subtrie.is_some()); + let subtrie = subtrie.unwrap(); + let sub_result = subtrie.get(&evt); + assert!(sub_result.unwrap().is_some()); + let prefix = Event::from(KeyEvent::ctrl('O')); + let subtrie = trie.get_raw_descendant(&prefix); + assert!(subtrie.is_none()) + } + + #[test] + fn no_collision() { + use {Event as E, EventHandler as H, KeyCode as C, KeyEvent as K, Modifiers as M}; + let mut trie = Trie::new(); + trie.insert(E::from(K(C::Backspace, M::NONE)), H::from(Cmd::Noop)); + trie.insert(E::from(K(C::Enter, M::NONE)), H::from(Cmd::Noop)); + trie.insert(E::from(K(C::Tab, M::NONE)), H::from(Cmd::Noop)); + trie.insert(E::from(K(C::Backspace, M::CTRL)), H::from(Cmd::Noop)); + trie.insert(E::from(K(C::Enter, M::CTRL)), H::from(Cmd::Noop)); + trie.insert(E::from(K(C::Tab, M::CTRL)), H::from(Cmd::Noop)); + } + + #[test] + #[ignore] + #[cfg(target_arch = "x86_64")] + fn size_of_event() { + use core::mem::size_of; + assert_eq!(size_of::(), 32); + } +} diff --git a/rustyline-15.0.0/src/command.rs b/rustyline-15.0.0/src/command.rs new file mode 100644 index 0000000000..4eb2151340 --- /dev/null +++ b/rustyline-15.0.0/src/command.rs @@ -0,0 +1,236 @@ +use crate::complete_hint_line; +use crate::config::Config; +use crate::edit::State; +use crate::error; +use crate::highlight::CmdKind; +use crate::history::SearchDirection; +use crate::keymap::{Anchor, At, Cmd, Movement, Word}; +use crate::keymap::{InputState, Refresher}; +use crate::kill_ring::{KillRing, Mode}; +use crate::line_buffer::WordAction; +use crate::{Helper, Result}; + +pub enum Status { + Proceed, + Submit, +} + +pub fn execute( + cmd: Cmd, + s: &mut State<'_, '_, H>, + input_state: &InputState, + kill_ring: &mut KillRing, + config: &Config, +) -> Result { + use Status::{Proceed, Submit}; + + match cmd { + Cmd::EndOfFile | Cmd::AcceptLine | Cmd::AcceptOrInsertLine { .. } | Cmd::Newline => { + if s.has_hint() || !s.is_default_prompt() || s.highlight_char { + // Force a refresh without hints to leave the previous + // line as the user typed it after a newline. + s.refresh_line_with_msg(None, CmdKind::ForcedRefresh)?; + } + } + _ => {} + }; + match cmd { + Cmd::CompleteHint => { + complete_hint_line(s)?; + } + Cmd::SelfInsert(n, c) => { + s.edit_insert(c, n)?; + } + Cmd::Insert(n, text) => { + s.edit_yank(input_state, &text, Anchor::Before, n)?; + } + Cmd::Move(Movement::BeginningOfLine) => { + // Move to the beginning of line. + s.edit_move_home()?; + } + Cmd::Move(Movement::ViFirstPrint) => { + s.edit_move_home()?; + if s.line.starts_with(char::is_whitespace) { + s.edit_move_to_next_word(At::Start, Word::Big, 1)?; + } + } + Cmd::Move(Movement::BackwardChar(n)) => { + // Move back a character. + s.edit_move_backward(n)?; + } + Cmd::ReplaceChar(n, c) => s.edit_replace_char(c, n)?, + Cmd::Replace(mvt, text) => { + s.edit_kill(&mvt, kill_ring)?; + if let Some(text) = text { + s.edit_insert_text(&text)?; + } + } + Cmd::Overwrite(c) => { + s.edit_overwrite_char(c)?; + } + Cmd::EndOfFile => { + if s.line.is_empty() { + return Err(error::ReadlineError::Eof); + } else if !input_state.is_emacs_mode() { + return Ok(Submit); + } + } + Cmd::Move(Movement::EndOfLine) => { + // Move to the end of line. + s.edit_move_end()?; + } + Cmd::Move(Movement::ForwardChar(n)) => { + // Move forward a character. + s.edit_move_forward(n)?; + } + Cmd::ClearScreen => { + // Clear the screen leaving the current line at the top of the screen. + s.clear_screen()?; + s.refresh_line()?; + } + Cmd::NextHistory => { + // Fetch the next command from the history list. + s.edit_history_next(false)?; + } + Cmd::PreviousHistory => { + // Fetch the previous command from the history list. + s.edit_history_next(true)?; + } + Cmd::LineUpOrPreviousHistory(n) => { + if !s.edit_move_line_up(n)? { + s.edit_history_next(true)?; + } + } + Cmd::LineDownOrNextHistory(n) => { + if !s.edit_move_line_down(n)? { + s.edit_history_next(false)?; + } + } + Cmd::HistorySearchBackward => s.edit_history_search(SearchDirection::Reverse)?, + Cmd::HistorySearchForward => s.edit_history_search(SearchDirection::Forward)?, + Cmd::TransposeChars => { + // Exchange the char before cursor with the character at cursor. + s.edit_transpose_chars()?; + } + Cmd::Yank(n, anchor) => { + // retrieve (yank) last item killed + if let Some(text) = kill_ring.yank() { + s.edit_yank(input_state, text, anchor, n)?; + } + } + Cmd::ViYankTo(ref mvt) => { + if let Some(text) = s.line.copy(mvt) { + kill_ring.kill(&text, Mode::Append); + } + } + Cmd::Newline => { + s.edit_insert('\n', 1)?; + } + Cmd::Repaint => { + s.refresh_line()?; + } + Cmd::AcceptLine | Cmd::AcceptOrInsertLine { .. } => { + let validation_result = s.validate()?; + let valid = validation_result.is_valid(); + let end = s.line.is_end_of_input(); + match (cmd, valid, end) { + (Cmd::AcceptLine, ..) + | (Cmd::AcceptOrInsertLine { .. }, true, true) + | ( + Cmd::AcceptOrInsertLine { + accept_in_the_middle: true, + }, + true, + _, + ) => { + return Ok(Submit); + } + (Cmd::AcceptOrInsertLine { .. }, false, _) + | (Cmd::AcceptOrInsertLine { .. }, true, false) => { + if valid || !validation_result.has_message() { + s.edit_insert('\n', 1)?; + } + } + _ => unreachable!(), + } + } + Cmd::BeginningOfHistory => { + // move to first entry in history + s.edit_history(true)?; + } + Cmd::EndOfHistory => { + // move to last entry in history + s.edit_history(false)?; + } + Cmd::Move(Movement::BackwardWord(n, word_def)) => { + // move backwards one word + s.edit_move_to_prev_word(word_def, n)?; + } + Cmd::CapitalizeWord => { + // capitalize word after point + s.edit_word(WordAction::Capitalize)?; + } + Cmd::Kill(ref mvt) => { + s.edit_kill(mvt, kill_ring)?; + } + Cmd::Move(Movement::ForwardWord(n, at, word_def)) => { + // move forwards one word + s.edit_move_to_next_word(at, word_def, n)?; + } + Cmd::Move(Movement::LineUp(n)) => { + s.edit_move_line_up(n)?; + } + Cmd::Move(Movement::LineDown(n)) => { + s.edit_move_line_down(n)?; + } + Cmd::Move(Movement::BeginningOfBuffer) => { + // Move to the start of the buffer. + s.edit_move_buffer_start()?; + } + Cmd::Move(Movement::EndOfBuffer) => { + // Move to the end of the buffer. + s.edit_move_buffer_end(CmdKind::MoveCursor)?; + } + Cmd::DowncaseWord => { + // lowercase word after point + s.edit_word(WordAction::Lowercase)?; + } + Cmd::TransposeWords(n) => { + // transpose words + s.edit_transpose_words(n)?; + } + Cmd::UpcaseWord => { + // uppercase word after point + s.edit_word(WordAction::Uppercase)?; + } + Cmd::YankPop => { + // yank-pop + if let Some((yank_size, text)) = kill_ring.yank_pop() { + s.edit_yank_pop(yank_size, text)?; + } + } + Cmd::Move(Movement::ViCharSearch(n, cs)) => s.edit_move_to(cs, n)?, + Cmd::Undo(n) => { + if s.changes.undo(&mut s.line, n) { + s.refresh_line()?; + } + } + Cmd::Dedent(mvt) => { + s.edit_indent(&mvt, config.indent_size(), true)?; + } + Cmd::Indent(mvt) => { + s.edit_indent(&mvt, config.indent_size(), false)?; + } + Cmd::Interrupt => { + // Move to end, in case cursor was in the middle of the + // line, so that next thing application prints goes after + // the input + s.move_cursor_to_end()?; + return Err(error::ReadlineError::Interrupted); + } + _ => { + // Ignore the character typed. + } + } + Ok(Proceed) +} diff --git a/rustyline-15.0.0/src/completion.rs b/rustyline-15.0.0/src/completion.rs new file mode 100644 index 0000000000..9566f7845a --- /dev/null +++ b/rustyline-15.0.0/src/completion.rs @@ -0,0 +1,628 @@ +//! Completion API +use std::borrow::Cow::{self, Borrowed, Owned}; +use std::fs; +use std::path::{self, Path}; + +use crate::line_buffer::LineBuffer; +use crate::{Context, Result}; + +/// A completion candidate. +pub trait Candidate { + /// Text to display when listing alternatives. + fn display(&self) -> &str; + /// Text to insert in line. + fn replacement(&self) -> &str; +} + +impl> Candidate for T { + fn display(&self) -> &str { + self.as_ref() + } + + fn replacement(&self) -> &str { + self.as_ref() + } +} + +/// Completion candidate pair +#[derive(Clone)] +pub struct Pair { + /// Text to display when listing alternatives. + pub display: String, + /// Text to insert in line. + pub replacement: String, +} + +impl Candidate for Pair { + fn display(&self) -> &str { + self.display.as_str() + } + + fn replacement(&self) -> &str { + self.replacement.as_str() + } +} + +// TODO: let the implementers customize how the candidate(s) are displayed +// https://github.com/kkawakam/rustyline/issues/302 + +/// To be called for tab-completion. +pub trait Completer { + /// Specific completion candidate. + type Candidate: Candidate; + + // TODO: let the implementers choose/find word boundaries ??? => Lexer + + /// Takes the currently edited `line` with the cursor `pos`ition and + /// returns the start position and the completion candidates for the + /// partial word to be completed. + /// + /// ("ls /usr/loc", 11) => Ok((3, vec!["/usr/local/"])) + fn complete( + &self, // FIXME should be `&mut self` + line: &str, + pos: usize, + ctx: &Context<'_>, + ) -> Result<(usize, Vec)> { + let _ = (line, pos, ctx); + Ok((0, Vec::with_capacity(0))) + } + /// Updates the edited `line` with the `elected` candidate. + fn update(&self, line: &mut LineBuffer, start: usize, elected: &str, cl: &mut Changeset) { + let end = line.pos(); + line.replace(start..end, elected, cl); + } +} + +impl Completer for () { + type Candidate = String; + + fn update(&self, _line: &mut LineBuffer, _start: usize, _elected: &str, _cl: &mut Changeset) { + unreachable!(); + } +} + +macro_rules! box_completer { + ($($id: ident)*) => { + $( + impl Completer for $id { + type Candidate = C::Candidate; + + fn complete(&self, line: &str, pos: usize, ctx: &Context<'_>) -> Result<(usize, Vec)> { + (**self).complete(line, pos, ctx) + } + fn update(&self, line: &mut LineBuffer, start: usize, elected: &str, cl: &mut Changeset) { + (**self).update(line, start, elected, cl) + } + } + )* + } +} + +use crate::undo::Changeset; +use std::rc::Rc; +use std::sync::Arc; +box_completer! { Box Rc Arc } + +/// A `Completer` for file and folder names. +pub struct FilenameCompleter { + break_chars: fn(char) -> bool, + double_quotes_special_chars: fn(char) -> bool, +} + +const DOUBLE_QUOTES_ESCAPE_CHAR: Option = Some('\\'); + +cfg_if::cfg_if! { + if #[cfg(unix)] { + // rl_basic_word_break_characters, rl_completer_word_break_characters + const fn default_break_chars(c : char) -> bool { + matches!(c, ' ' | '\t' | '\n' | '"' | '\\' | '\'' | '`' | '@' | '$' | '>' | '<' | '=' | ';' | '|' | '&' | + '{' | '(' | '\0') + } + const ESCAPE_CHAR: Option = Some('\\'); + // In double quotes, not all break_chars need to be escaped + // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html + const fn double_quotes_special_chars(c: char) -> bool { matches!(c, '"' | '$' | '\\' | '`') } + } else if #[cfg(windows)] { + // Remove \ to make file completion works on windows + const fn default_break_chars(c: char) -> bool { + matches!(c, ' ' | '\t' | '\n' | '"' | '\'' | '`' | '@' | '$' | '>' | '<' | '=' | ';' | '|' | '&' | '{' | + '(' | '\0') + } + const ESCAPE_CHAR: Option = None; + const fn double_quotes_special_chars(c: char) -> bool { c == '"' } // TODO Validate: only '"' ? + } else if #[cfg(target_arch = "wasm32")] { + const fn default_break_chars(c: char) -> bool { false } + const ESCAPE_CHAR: Option = None; + const fn double_quotes_special_chars(c: char) -> bool { false } + } +} + +/// Kind of quote. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum Quote { + /// Double quote: `"` + Double, + /// Single quote: `'` + Single, + /// No quote + None, +} + +impl FilenameCompleter { + /// Constructor + #[must_use] + pub fn new() -> Self { + Self { + break_chars: default_break_chars, + double_quotes_special_chars, + } + } + + /// Takes the currently edited `line` with the cursor `pos`ition and + /// returns the start position and the completion candidates for the + /// partial path to be completed. + pub fn complete_path(&self, line: &str, pos: usize) -> Result<(usize, Vec)> { + let (start, mut matches) = self.complete_path_unsorted(line, pos)?; + matches.sort_by(|a, b| a.display().cmp(b.display())); + Ok((start, matches)) + } + + /// Similar to [`Self::complete_path`], but the returned paths are unsorted. + pub fn complete_path_unsorted(&self, line: &str, pos: usize) -> Result<(usize, Vec)> { + let (start, path, esc_char, break_chars, quote) = + if let Some((idx, quote)) = find_unclosed_quote(&line[..pos]) { + let start = idx + 1; + if quote == Quote::Double { + ( + start, + unescape(&line[start..pos], DOUBLE_QUOTES_ESCAPE_CHAR), + DOUBLE_QUOTES_ESCAPE_CHAR, + self.double_quotes_special_chars, + quote, + ) + } else { + ( + start, + Borrowed(&line[start..pos]), + None, + self.break_chars, + quote, + ) + } + } else { + let (start, path) = extract_word(line, pos, ESCAPE_CHAR, self.break_chars); + let path = unescape(path, ESCAPE_CHAR); + (start, path, ESCAPE_CHAR, self.break_chars, Quote::None) + }; + let matches = filename_complete(&path, esc_char, break_chars, quote); + Ok((start, matches)) + } +} + +impl Default for FilenameCompleter { + fn default() -> Self { + Self::new() + } +} + +impl Completer for FilenameCompleter { + type Candidate = Pair; + + fn complete(&self, line: &str, pos: usize, _ctx: &Context<'_>) -> Result<(usize, Vec)> { + self.complete_path(line, pos) + } +} + +/// Remove escape char +#[must_use] +pub fn unescape(input: &str, esc_char: Option) -> Cow<'_, str> { + let Some(esc_char) = esc_char else { + return Borrowed(input); + }; + if !input.chars().any(|c| c == esc_char) { + return Borrowed(input); + } + let mut result = String::with_capacity(input.len()); + let mut chars = input.chars(); + while let Some(ch) = chars.next() { + if ch == esc_char { + if let Some(ch) = chars.next() { + if cfg!(windows) && ch != '"' { + // TODO Validate: only '"' ? + result.push(esc_char); + } + result.push(ch); + } else if cfg!(windows) { + result.push(ch); + } + } else { + result.push(ch); + } + } + Owned(result) +} + +/// Escape any `break_chars` in `input` string with `esc_char`. +/// For example, '/User Information' becomes '/User\ Information' +/// when space is a breaking char and '\\' the escape char. +#[must_use] +pub fn escape( + mut input: String, + esc_char: Option, + is_break_char: fn(char) -> bool, + quote: Quote, +) -> String { + if quote == Quote::Single { + return input; // no escape in single quotes + } + let n = input.chars().filter(|c| is_break_char(*c)).count(); + if n == 0 { + return input; // no need to escape + } + let Some(esc_char) = esc_char else { + if cfg!(windows) && quote == Quote::None { + input.insert(0, '"'); // force double quote + return input; + } + return input; + }; + let mut result = String::with_capacity(input.len() + n); + + for c in input.chars() { + if is_break_char(c) { + result.push(esc_char); + } + result.push(c); + } + result +} + +fn filename_complete( + path: &str, + esc_char: Option, + is_break_char: fn(char) -> bool, + quote: Quote, +) -> Vec { + #[cfg(feature = "with-dirs")] + use home::home_dir; + use std::env::current_dir; + + let sep = path::MAIN_SEPARATOR; + let (dir_name, file_name) = match path.rfind(sep) { + Some(idx) => path.split_at(idx + sep.len_utf8()), + None => ("", path), + }; + + let dir_path = Path::new(dir_name); + let dir = if dir_path.starts_with("~") { + // ~[/...] + #[cfg(feature = "with-dirs")] + { + if let Some(home) = home_dir() { + match dir_path.strip_prefix("~") { + Ok(rel_path) => home.join(rel_path), + _ => home, + } + } else { + dir_path.to_path_buf() + } + } + #[cfg(not(feature = "with-dirs"))] + { + dir_path.to_path_buf() + } + } else if dir_path.is_relative() { + // TODO ~user[/...] (https://crates.io/crates/users) + if let Ok(cwd) = current_dir() { + cwd.join(dir_path) + } else { + dir_path.to_path_buf() + } + } else { + dir_path.to_path_buf() + }; + + let mut entries: Vec = vec![]; + + // if dir doesn't exist, then don't offer any completions + if !dir.exists() { + return entries; + } + + // if any of the below IO operations have errors, just ignore them + if let Ok(read_dir) = dir.read_dir() { + let file_name = normalize(file_name); + for entry in read_dir.flatten() { + if let Some(s) = entry.file_name().to_str() { + let ns = normalize(s); + if ns.starts_with(file_name.as_ref()) { + if let Ok(metadata) = fs::metadata(entry.path()) { + let mut path = String::from(dir_name) + s; + if metadata.is_dir() { + path.push(sep); + } + entries.push(Pair { + display: String::from(s), + replacement: escape(path, esc_char, is_break_char, quote), + }); + } // else ignore PermissionDenied + } + } + } + } + entries +} + +#[cfg(any(windows, target_os = "macos"))] +fn normalize(s: &str) -> Cow { + // case insensitive + Owned(s.to_lowercase()) +} + +#[cfg(not(any(windows, target_os = "macos")))] +fn normalize(s: &str) -> Cow { + Cow::Borrowed(s) +} + +/// Given a `line` and a cursor `pos`ition, +/// try to find backward the start of a word. +/// +/// Return (0, `line[..pos]`) if no break char has been found. +/// Return the word and its start position (idx, `line[idx..pos]`) otherwise. +#[must_use] +pub fn extract_word( + line: &str, + pos: usize, + esc_char: Option, + is_break_char: fn(char) -> bool, +) -> (usize, &str) { + let line = &line[..pos]; + if line.is_empty() { + return (0, line); + } + let mut start = None; + for (i, c) in line.char_indices().rev() { + if let (Some(esc_char), true) = (esc_char, start.is_some()) { + if esc_char == c { + // escaped break char + start = None; + continue; + } + break; + } + if is_break_char(c) { + start = Some(i + c.len_utf8()); + if esc_char.is_none() { + break; + } // else maybe escaped... + } + } + + match start { + Some(start) => (start, &line[start..]), + None => (0, line), + } +} + +/// Returns the longest common prefix among all `Candidate::replacement()`s. +pub fn longest_common_prefix(candidates: &[C]) -> Option<&str> { + if candidates.is_empty() { + return None; + } else if candidates.len() == 1 { + return Some(candidates[0].replacement()); + } + let mut longest_common_prefix = 0; + 'o: loop { + for (i, c1) in candidates.iter().enumerate().take(candidates.len() - 1) { + let b1 = c1.replacement().as_bytes(); + let b2 = candidates[i + 1].replacement().as_bytes(); + if b1.len() <= longest_common_prefix + || b2.len() <= longest_common_prefix + || b1[longest_common_prefix] != b2[longest_common_prefix] + { + break 'o; + } + } + longest_common_prefix += 1; + } + let candidate = candidates[0].replacement(); + while !candidate.is_char_boundary(longest_common_prefix) { + longest_common_prefix -= 1; + } + if longest_common_prefix == 0 { + return None; + } + Some(&candidate[0..longest_common_prefix]) +} + +#[derive(Eq, PartialEq)] +enum ScanMode { + DoubleQuote, + Escape, + EscapeInDoubleQuote, + Normal, + SingleQuote, +} + +/// try to find an unclosed single/double quote in `s`. +/// Return `None` if no unclosed quote is found. +/// Return the unclosed quote position and if it is a double quote. +fn find_unclosed_quote(s: &str) -> Option<(usize, Quote)> { + let char_indices = s.char_indices(); + let mut mode = ScanMode::Normal; + let mut quote_index = 0; + for (index, char) in char_indices { + match mode { + ScanMode::DoubleQuote => { + if char == '"' { + mode = ScanMode::Normal; + } else if char == '\\' { + // both windows and unix support escape in double quote + mode = ScanMode::EscapeInDoubleQuote; + } + } + ScanMode::Escape => { + mode = ScanMode::Normal; + } + ScanMode::EscapeInDoubleQuote => { + mode = ScanMode::DoubleQuote; + } + ScanMode::Normal => { + if char == '"' { + mode = ScanMode::DoubleQuote; + quote_index = index; + } else if char == '\\' && cfg!(not(windows)) { + mode = ScanMode::Escape; + } else if char == '\'' && cfg!(not(windows)) { + mode = ScanMode::SingleQuote; + quote_index = index; + } + } + ScanMode::SingleQuote => { + if char == '\'' { + mode = ScanMode::Normal; + } // no escape in single quotes + } + }; + } + if ScanMode::DoubleQuote == mode || ScanMode::EscapeInDoubleQuote == mode { + return Some((quote_index, Quote::Double)); + } else if ScanMode::SingleQuote == mode { + return Some((quote_index, Quote::Single)); + } + None +} + +#[cfg(test)] +mod tests { + use super::{Completer, FilenameCompleter}; + + #[test] + pub fn extract_word() { + let break_chars = super::default_break_chars; + let line = "ls '/usr/local/b"; + assert_eq!( + (4, "/usr/local/b"), + super::extract_word(line, line.len(), Some('\\'), break_chars) + ); + let line = "ls /User\\ Information"; + assert_eq!( + (3, "/User\\ Information"), + super::extract_word(line, line.len(), Some('\\'), break_chars) + ); + } + + #[test] + pub fn unescape() { + use std::borrow::Cow::{self, Borrowed, Owned}; + let input = "/usr/local/b"; + assert_eq!(Borrowed(input), super::unescape(input, Some('\\'))); + if cfg!(windows) { + let input = "c:\\users\\All Users\\"; + let result: Cow<'_, str> = Borrowed(input); + assert_eq!(result, super::unescape(input, Some('\\'))); + } else { + let input = "/User\\ Information"; + let result: Cow<'_, str> = Owned(String::from("/User Information")); + assert_eq!(result, super::unescape(input, Some('\\'))); + } + } + + #[test] + pub fn escape() { + let break_chars = super::default_break_chars; + let input = String::from("/usr/local/b"); + assert_eq!( + input.clone(), + super::escape(input, Some('\\'), break_chars, super::Quote::None) + ); + let input = String::from("/User Information"); + let result = String::from("/User\\ Information"); + assert_eq!( + result, + super::escape(input, Some('\\'), break_chars, super::Quote::None) + ); + } + + #[test] + pub fn longest_common_prefix() { + let mut candidates = vec![]; + { + let lcp = super::longest_common_prefix(&candidates); + assert!(lcp.is_none()); + } + + let s = "User"; + let c1 = String::from(s); + candidates.push(c1); + { + let lcp = super::longest_common_prefix(&candidates); + assert_eq!(Some(s), lcp); + } + + let c2 = String::from("Users"); + candidates.push(c2); + { + let lcp = super::longest_common_prefix(&candidates); + assert_eq!(Some(s), lcp); + } + + let c3 = String::new(); + candidates.push(c3); + { + let lcp = super::longest_common_prefix(&candidates); + assert!(lcp.is_none()); + } + + let candidates = vec![String::from("fée"), String::from("fête")]; + let lcp = super::longest_common_prefix(&candidates); + assert_eq!(Some("f"), lcp); + } + + #[test] + pub fn find_unclosed_quote() { + assert_eq!(None, super::find_unclosed_quote("ls /etc")); + assert_eq!( + Some((3, super::Quote::Double)), + super::find_unclosed_quote("ls \"User Information") + ); + assert_eq!( + None, + super::find_unclosed_quote("ls \"/User Information\" /etc") + ); + assert_eq!( + Some((0, super::Quote::Double)), + super::find_unclosed_quote("\"c:\\users\\All Users\\") + ) + } + + #[cfg(windows)] + #[test] + pub fn normalize() { + assert_eq!(super::normalize("Windows"), "windows") + } + + #[test] + pub fn candidate_impls() { + struct StrCmp; + impl Completer for StrCmp { + type Candidate = &'static str; + } + struct RcCmp; + impl Completer for RcCmp { + type Candidate = std::rc::Rc; + } + struct ArcCmp; + impl Completer for ArcCmp { + type Candidate = std::sync::Arc; + } + } + + #[test] + pub fn completer_impls() { + struct Wrapper(T); + let boxed = Box::new(FilenameCompleter::new()); + let _ = Wrapper(boxed); + } +} diff --git a/rustyline-15.0.0/src/config.rs b/rustyline-15.0.0/src/config.rs new file mode 100644 index 0000000000..a4c3d12bca --- /dev/null +++ b/rustyline-15.0.0/src/config.rs @@ -0,0 +1,601 @@ +//! Customize line editor +use crate::Result; +use std::default::Default; + +/// User preferences +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct Config { + /// Maximum number of entries in History. + max_history_size: usize, // history_max_entries + history_duplicates: HistoryDuplicates, + history_ignore_space: bool, + completion_type: CompletionType, + /// When listing completion alternatives, only display + /// one screen of possibilities at a time. + completion_prompt_limit: usize, + /// Duration (milliseconds) Rustyline will wait for a character when + /// reading an ambiguous key sequence. + keyseq_timeout: Option, + /// Emacs or Vi mode + edit_mode: EditMode, + /// If true, each nonblank line returned by `readline` will be + /// automatically added to the history. + auto_add_history: bool, + /// Beep or Flash or nothing + bell_style: BellStyle, + /// if colors should be enabled. + color_mode: ColorMode, + /// Whether to use stdio or not + behavior: Behavior, + /// Horizontal space taken by a tab. + tab_stop: usize, + /// Indentation size for indent/dedent commands + indent_size: usize, + /// Check if cursor position is at leftmost before displaying prompt + check_cursor_position: bool, + /// Bracketed paste on unix platform + enable_bracketed_paste: bool, + /// Whether to disable or not the signals in termios + enable_signals: bool, +} + +impl Config { + /// Returns a `Config` builder. + #[must_use] + pub fn builder() -> Builder { + Builder::new() + } + + /// Tell the maximum length (i.e. number of entries) for the history. + #[must_use] + pub fn max_history_size(&self) -> usize { + self.max_history_size + } + + pub(crate) fn set_max_history_size(&mut self, max_size: usize) { + self.max_history_size = max_size; + } + + /// Tell if lines which match the previous history entry are saved or not + /// in the history list. + /// + /// By default, they are ignored. + #[must_use] + pub fn history_duplicates(&self) -> HistoryDuplicates { + self.history_duplicates + } + + pub(crate) fn set_history_ignore_dups(&mut self, yes: bool) { + self.history_duplicates = if yes { + HistoryDuplicates::IgnoreConsecutive + } else { + HistoryDuplicates::AlwaysAdd + }; + } + + /// Tell if lines which begin with a space character are saved or not in + /// the history list. + /// + /// By default, they are saved. + #[must_use] + pub fn history_ignore_space(&self) -> bool { + self.history_ignore_space + } + + pub(crate) fn set_history_ignore_space(&mut self, yes: bool) { + self.history_ignore_space = yes; + } + + /// Completion behaviour. + /// + /// By default, `CompletionType::Circular`. + #[must_use] + pub fn completion_type(&self) -> CompletionType { + self.completion_type + } + + /// When listing completion alternatives, only display + /// one screen of possibilities at a time (used for `CompletionType::List` + /// mode). + #[must_use] + pub fn completion_prompt_limit(&self) -> usize { + self.completion_prompt_limit + } + + /// Duration (milliseconds) Rustyline will wait for a character when + /// reading an ambiguous key sequence (used for `EditMode::Vi` mode on unix + /// platform). + /// + /// By default, no timeout (-1) or 500ms if `EditMode::Vi` is activated. + #[must_use] + pub fn keyseq_timeout(&self) -> Option { + self.keyseq_timeout + } + + /// Emacs or Vi mode + #[must_use] + pub fn edit_mode(&self) -> EditMode { + self.edit_mode + } + + /// Tell if lines are automatically added to the history. + /// + /// By default, they are not. + #[must_use] + pub fn auto_add_history(&self) -> bool { + self.auto_add_history + } + + /// Bell style: beep, flash or nothing. + #[must_use] + pub fn bell_style(&self) -> BellStyle { + self.bell_style + } + + /// Tell if colors should be enabled. + /// + /// By default, they are except if stdout is not a TTY. + #[must_use] + pub fn color_mode(&self) -> ColorMode { + self.color_mode + } + + pub(crate) fn set_color_mode(&mut self, color_mode: ColorMode) { + self.color_mode = color_mode; + } + + /// Whether to use stdio or not + /// + /// By default, stdio is used. + #[must_use] + pub fn behavior(&self) -> Behavior { + self.behavior + } + + pub(crate) fn set_behavior(&mut self, behavior: Behavior) { + self.behavior = behavior; + } + + /// Horizontal space taken by a tab. + /// + /// By default, 8. + #[must_use] + pub fn tab_stop(&self) -> usize { + self.tab_stop + } + + pub(crate) fn set_tab_stop(&mut self, tab_stop: usize) { + self.tab_stop = tab_stop; + } + + /// Check if cursor position is at leftmost before displaying prompt. + /// + /// By default, we don't check. + #[must_use] + pub fn check_cursor_position(&self) -> bool { + self.check_cursor_position + } + + /// Indentation size used by indentation commands + /// + /// By default, 2. + #[must_use] + pub fn indent_size(&self) -> usize { + self.indent_size + } + + pub(crate) fn set_indent_size(&mut self, indent_size: usize) { + self.indent_size = indent_size; + } + + /// Bracketed paste on unix platform + /// + /// By default, it's enabled. + #[must_use] + pub fn enable_bracketed_paste(&self) -> bool { + self.enable_bracketed_paste + } + + /// Enable or disable signals in termios + /// + /// By default, it's disabled. + #[must_use] + pub fn enable_signals(&self) -> bool { + self.enable_signals + } + + pub(crate) fn set_enable_signals(&mut self, enable_signals: bool) { + self.enable_signals = enable_signals; + } +} + +impl Default for Config { + fn default() -> Self { + Self { + max_history_size: 100, + history_duplicates: HistoryDuplicates::IgnoreConsecutive, + history_ignore_space: false, + completion_type: CompletionType::Circular, // TODO Validate + completion_prompt_limit: 100, + keyseq_timeout: None, + edit_mode: EditMode::Emacs, + auto_add_history: false, + bell_style: BellStyle::default(), + color_mode: ColorMode::Enabled, + behavior: Behavior::default(), + tab_stop: 8, + indent_size: 2, + check_cursor_position: false, + enable_bracketed_paste: true, + enable_signals: false, + } + } +} + +/// Beep or flash or nothing +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum BellStyle { + /// Beep + Audible, + /// Silent + None, + /// Flash screen (not supported) + Visible, +} + +/// `Audible` by default on unix (overridden by current Terminal settings). +/// `None` on windows. +impl Default for BellStyle { + #[cfg(any(windows, target_arch = "wasm32"))] + fn default() -> Self { + Self::None + } + + #[cfg(unix)] + fn default() -> Self { + Self::Audible + } +} + +/// History filter +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum HistoryDuplicates { + /// No filter + AlwaysAdd, + /// a line will not be added to the history if it matches the previous entry + IgnoreConsecutive, +} + +/// Tab completion style +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[non_exhaustive] +pub enum CompletionType { + /// Complete the next full match (like in Vim by default) + Circular, + /// Complete till longest match. + /// When more than one match, list all matches + /// (like in Bash/Readline). + List, + + /// Complete the match using fuzzy search and selection + /// (like fzf and plugins) + /// Currently only available for unix platforms as dependency on + /// skim->tuikit Compile with `--features=fuzzy` to enable + #[cfg(all(unix, feature = "with-fuzzy"))] + Fuzzy, +} + +/// Style of editing / Standard keymaps +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[non_exhaustive] +pub enum EditMode { + /// Emacs keymap + Emacs, + /// Vi keymap + Vi, +} + +/// Colorization mode +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[non_exhaustive] +pub enum ColorMode { + /// Activate highlighting if platform/terminal is supported. + Enabled, + /// Activate highlighting even if platform is not supported (windows < 10). + Forced, + /// Deactivate highlighting even if platform/terminal is supported. + Disabled, +} + +/// Should the editor use stdio +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +#[non_exhaustive] +pub enum Behavior { + /// Use stdin / stdout + #[default] + Stdio, + /// Use terminal-style interaction whenever possible, even if 'stdin' and/or + /// 'stdout' are not terminals. + PreferTerm, + // TODO + // Use file-style interaction, reading input from the given file. + // useFile +} + +/// Configuration builder +#[derive(Clone, Debug, Default)] +pub struct Builder { + p: Config, +} + +impl Builder { + /// Returns a `Config` builder. + #[must_use] + pub fn new() -> Self { + Self { + p: Config::default(), + } + } + + /// Set the maximum length for the history. + pub fn max_history_size(mut self, max_size: usize) -> Result { + self.set_max_history_size(max_size)?; + Ok(self) + } + + /// Tell if lines which match the previous history entry are saved or not + /// in the history list. + /// + /// By default, they are ignored. + pub fn history_ignore_dups(mut self, yes: bool) -> Result { + self.set_history_ignore_dups(yes)?; + Ok(self) + } + + /// Tell if lines which begin with a space character are saved or not in + /// the history list. + /// + /// By default, they are saved. + #[must_use] + pub fn history_ignore_space(mut self, yes: bool) -> Self { + self.set_history_ignore_space(yes); + self + } + + /// Set `completion_type`. + #[must_use] + pub fn completion_type(mut self, completion_type: CompletionType) -> Self { + self.set_completion_type(completion_type); + self + } + + /// The number of possible completions that determines when the user is + /// asked whether the list of possibilities should be displayed. + #[must_use] + pub fn completion_prompt_limit(mut self, completion_prompt_limit: usize) -> Self { + self.set_completion_prompt_limit(completion_prompt_limit); + self + } + + /// Timeout for ambiguous key sequences in milliseconds. + /// Currently, it is used only to distinguish a single ESC from an ESC + /// sequence. + /// After seeing an ESC key, wait at most `keyseq_timeout_ms` for another + /// byte. + #[must_use] + pub fn keyseq_timeout(mut self, keyseq_timeout_ms: Option) -> Self { + self.set_keyseq_timeout(keyseq_timeout_ms); + self + } + + /// Choose between Emacs or Vi mode. + #[must_use] + pub fn edit_mode(mut self, edit_mode: EditMode) -> Self { + self.set_edit_mode(edit_mode); + self + } + + /// Tell if lines are automatically added to the history. + /// + /// By default, they are not. + #[must_use] + pub fn auto_add_history(mut self, yes: bool) -> Self { + self.set_auto_add_history(yes); + self + } + + /// Set bell style: beep, flash or nothing. + #[must_use] + pub fn bell_style(mut self, bell_style: BellStyle) -> Self { + self.set_bell_style(bell_style); + self + } + + /// Forces colorization on or off. + /// + /// By default, colorization is on except if stdout is not a TTY. + #[must_use] + pub fn color_mode(mut self, color_mode: ColorMode) -> Self { + self.set_color_mode(color_mode); + self + } + + /// Whether to use stdio or not + /// + /// By default, stdio is used. + #[must_use] + pub fn behavior(mut self, behavior: Behavior) -> Self { + self.set_behavior(behavior); + self + } + + /// Horizontal space taken by a tab. + /// + /// By default, `8` + #[must_use] + pub fn tab_stop(mut self, tab_stop: usize) -> Self { + self.set_tab_stop(tab_stop); + self + } + + /// Check if cursor position is at leftmost before displaying prompt. + /// + /// By default, we don't check. + #[must_use] + pub fn check_cursor_position(mut self, yes: bool) -> Self { + self.set_check_cursor_position(yes); + self + } + + /// Indentation size + /// + /// By default, `2` + #[must_use] + pub fn indent_size(mut self, indent_size: usize) -> Self { + self.set_indent_size(indent_size); + self + } + + /// Enable or disable bracketed paste on unix platform + /// + /// By default, it's enabled. + #[must_use] + pub fn bracketed_paste(mut self, enabled: bool) -> Self { + self.enable_bracketed_paste(enabled); + self + } + + /// Enable or disable signals in termios + /// + /// By default, it's disabled. + #[must_use] + pub fn enable_signals(mut self, enable_signals: bool) -> Self { + self.p.set_enable_signals(enable_signals); + self + } + + /// Builds a `Config` with the settings specified so far. + #[must_use] + pub fn build(self) -> Config { + self.p + } +} + +impl Configurer for Builder { + fn config_mut(&mut self) -> &mut Config { + &mut self.p + } +} + +/// Trait for component that holds a `Config`. +pub trait Configurer { + /// `Config` accessor. + fn config_mut(&mut self) -> &mut Config; + + /// Set the maximum length for the history. + fn set_max_history_size(&mut self, max_size: usize) -> Result<()> { + self.config_mut().set_max_history_size(max_size); + Ok(()) + } + + /// Tell if lines which match the previous history entry are saved or not + /// in the history list. + /// + /// By default, they are ignored. + fn set_history_ignore_dups(&mut self, yes: bool) -> Result<()> { + self.config_mut().set_history_ignore_dups(yes); + Ok(()) + } + + /// Tell if lines which begin with a space character are saved or not in + /// the history list. + /// + /// By default, they are saved. + fn set_history_ignore_space(&mut self, yes: bool) { + self.config_mut().set_history_ignore_space(yes); + } + /// Set `completion_type`. + fn set_completion_type(&mut self, completion_type: CompletionType) { + self.config_mut().completion_type = completion_type; + } + + /// The number of possible completions that determines when the user is + /// asked whether the list of possibilities should be displayed. + fn set_completion_prompt_limit(&mut self, completion_prompt_limit: usize) { + self.config_mut().completion_prompt_limit = completion_prompt_limit; + } + + /// Timeout for ambiguous key sequences in milliseconds. + fn set_keyseq_timeout(&mut self, keyseq_timeout_ms: Option) { + self.config_mut().keyseq_timeout = keyseq_timeout_ms; + } + + /// Choose between Emacs or Vi mode. + fn set_edit_mode(&mut self, edit_mode: EditMode) { + self.config_mut().edit_mode = edit_mode; + match edit_mode { + EditMode::Emacs => self.set_keyseq_timeout(None), // no timeout + EditMode::Vi => self.set_keyseq_timeout(Some(500)), + } + } + + /// Tell if lines are automatically added to the history. + /// + /// By default, they are not. + fn set_auto_add_history(&mut self, yes: bool) { + self.config_mut().auto_add_history = yes; + } + + /// Set bell style: beep, flash or nothing. + fn set_bell_style(&mut self, bell_style: BellStyle) { + self.config_mut().bell_style = bell_style; + } + + /// Forces colorization on or off. + /// + /// By default, colorization is on except if stdout is not a TTY. + fn set_color_mode(&mut self, color_mode: ColorMode) { + self.config_mut().set_color_mode(color_mode); + } + + /// Whether to use stdio or not + /// + /// By default, stdio is used. + fn set_behavior(&mut self, behavior: Behavior) { + self.config_mut().set_behavior(behavior); + } + + /// Horizontal space taken by a tab. + /// + /// By default, `8` + fn set_tab_stop(&mut self, tab_stop: usize) { + self.config_mut().set_tab_stop(tab_stop); + } + + /// Check if cursor position is at leftmost before displaying prompt. + /// + /// By default, we don't check. + fn set_check_cursor_position(&mut self, yes: bool) { + self.config_mut().check_cursor_position = yes; + } + /// Indentation size for indent/dedent commands + /// + /// By default, `2` + fn set_indent_size(&mut self, size: usize) { + self.config_mut().set_indent_size(size); + } + + /// Enable or disable bracketed paste on unix platform + /// + /// By default, it's enabled. + fn enable_bracketed_paste(&mut self, enabled: bool) { + self.config_mut().enable_bracketed_paste = enabled; + } + + /// Enable or disable signals in termios + /// + /// By default, it's disabled. + fn set_enable_signals(&mut self, enable_signals: bool) { + self.config_mut().set_enable_signals(enable_signals); + } +} diff --git a/rustyline-15.0.0/src/edit.rs b/rustyline-15.0.0/src/edit.rs new file mode 100644 index 0000000000..b18de9e2e3 --- /dev/null +++ b/rustyline-15.0.0/src/edit.rs @@ -0,0 +1,812 @@ +//! Command processor + +use log::debug; +use std::fmt; +use unicode_segmentation::UnicodeSegmentation; +use unicode_width::UnicodeWidthChar; + +use super::{Context, Helper, Result}; +use crate::error::ReadlineError; +use crate::highlight::{CmdKind, Highlighter}; +use crate::hint::Hint; +use crate::history::SearchDirection; +use crate::keymap::{Anchor, At, CharSearch, Cmd, Movement, RepeatCount, Word}; +use crate::keymap::{InputState, Invoke, Refresher}; +use crate::layout::{Layout, Position}; +use crate::line_buffer::{ + ChangeListener, DeleteListener, Direction, LineBuffer, NoListener, WordAction, MAX_LINE, +}; +use crate::tty::{Renderer, Term, Terminal}; +use crate::undo::Changeset; +use crate::validate::{ValidationContext, ValidationResult}; +use crate::KillRing; + +/// Represent the state during line editing. +/// Implement rendering. +pub struct State<'out, 'prompt, H: Helper> { + pub out: &'out mut ::Writer, + prompt: &'prompt str, // Prompt to display (rl_prompt) + prompt_size: Position, // Prompt Unicode/visible width and height + pub line: LineBuffer, // Edited line buffer + pub layout: Layout, + saved_line_for_history: LineBuffer, // Current edited line before history browsing + byte_buffer: [u8; 4], + pub changes: Changeset, // changes to line, for undo/redo + pub helper: Option<&'out H>, + pub ctx: Context<'out>, // Give access to history for `hinter` + pub hint: Option>, // last hint displayed + pub highlight_char: bool, // `true` if a char has been highlighted +} + +enum Info<'m> { + NoHint, + Hint, + Msg(Option<&'m str>), +} + +impl<'out, 'prompt, H: Helper> State<'out, 'prompt, H> { + pub fn new( + out: &'out mut ::Writer, + prompt: &'prompt str, + helper: Option<&'out H>, + ctx: Context<'out>, + ) -> Self { + let prompt_size = out.calculate_position(prompt, Position::default()); + Self { + out, + prompt, + prompt_size, + line: LineBuffer::with_capacity(MAX_LINE).can_growth(true), + layout: Layout::default(), + saved_line_for_history: LineBuffer::with_capacity(MAX_LINE).can_growth(true), + byte_buffer: [0; 4], + changes: Changeset::new(), + helper, + ctx, + hint: None, + highlight_char: false, + } + } + + pub fn highlighter(&self) -> Option<&dyn Highlighter> { + if self.out.colors_enabled() { + self.helper.map(|h| h as &dyn Highlighter) + } else { + None + } + } + + pub fn next_cmd( + &mut self, + input_state: &mut InputState, + rdr: &mut ::Reader, + single_esc_abort: bool, + ignore_external_print: bool, + ) -> Result { + loop { + let rc = input_state.next_cmd(rdr, self, single_esc_abort, ignore_external_print); + if let Err(ReadlineError::WindowResized) = rc { + debug!(target: "rustyline", "SIGWINCH"); + let old_cols = self.out.get_columns(); + self.out.update_size(); + let new_cols = self.out.get_columns(); + if new_cols != old_cols + && (self.layout.end.row > 0 || self.layout.end.col >= new_cols) + { + self.prompt_size = self + .out + .calculate_position(self.prompt, Position::default()); + self.refresh_line()?; + } + continue; + } + if let Ok(Cmd::Replace(..)) = rc { + self.changes.begin(); + } + return rc; + } + } + + pub fn backup(&mut self) { + self.saved_line_for_history + .update(self.line.as_str(), self.line.pos(), &mut NoListener); + } + + pub fn restore(&mut self) { + self.line.update( + self.saved_line_for_history.as_str(), + self.saved_line_for_history.pos(), + &mut self.changes, + ); + } + + pub fn move_cursor(&mut self, kind: CmdKind) -> Result<()> { + // calculate the desired position of the cursor + let cursor = self + .out + .calculate_position(&self.line[..self.line.pos()], self.prompt_size); + if self.layout.cursor == cursor { + return Ok(()); + } + if self.highlight_char(kind) { + let prompt_size = self.prompt_size; + self.refresh(self.prompt, prompt_size, true, Info::NoHint)?; + } else { + self.out.move_cursor(self.layout.cursor, cursor)?; + self.layout.prompt_size = self.prompt_size; + self.layout.cursor = cursor; + debug_assert!(self.layout.prompt_size <= self.layout.cursor); + debug_assert!(self.layout.cursor <= self.layout.end); + } + Ok(()) + } + + pub fn move_cursor_to_end(&mut self) -> Result<()> { + if self.layout.cursor == self.layout.end { + return Ok(()); + } + self.out.move_cursor(self.layout.cursor, self.layout.end)?; + self.layout.cursor = self.layout.end; + Ok(()) + } + + pub fn move_cursor_at_leftmost(&mut self, rdr: &mut ::Reader) -> Result<()> { + self.out.move_cursor_at_leftmost(rdr) + } + + fn refresh( + &mut self, + prompt: &str, + prompt_size: Position, + default_prompt: bool, + info: Info<'_>, + ) -> Result<()> { + let info = match info { + Info::NoHint => None, + Info::Hint => self.hint.as_ref().map(|h| h.display()), + Info::Msg(msg) => msg, + }; + let highlighter = if self.out.colors_enabled() { + self.helper.map(|h| h as &dyn Highlighter) + } else { + None + }; + + let new_layout = self + .out + .compute_layout(prompt_size, default_prompt, &self.line, info); + + debug!(target: "rustyline", "old layout: {:?}", self.layout); + debug!(target: "rustyline", "new layout: {:?}", new_layout); + self.out.refresh_line( + prompt, + &self.line, + info, + &self.layout, + &new_layout, + highlighter, + )?; + self.layout = new_layout; + + Ok(()) + } + + pub fn hint(&mut self) { + if let Some(hinter) = self.helper { + let hint = hinter.hint(self.line.as_str(), self.line.pos(), &self.ctx); + self.hint = match hint { + Some(val) if !val.display().is_empty() => Some(Box::new(val) as Box), + _ => None, + }; + } else { + self.hint = None; + } + } + + fn highlight_char(&mut self, kind: CmdKind) -> bool { + if let Some(highlighter) = self.highlighter() { + let highlight_char = highlighter.highlight_char(&self.line, self.line.pos(), kind); + if highlight_char { + self.highlight_char = true; + true + } else if self.highlight_char { + // previously highlighted => force a full refresh + self.highlight_char = false; + true + } else { + false + } + } else { + false + } + } + + pub fn is_default_prompt(&self) -> bool { + self.layout.default_prompt + } + + pub fn validate(&mut self) -> Result { + if let Some(validator) = self.helper { + self.changes.begin(); + let result = validator.validate(&mut ValidationContext::new(self))?; + let corrected = self.changes.end(); + match result { + ValidationResult::Incomplete => {} + ValidationResult::Valid(ref msg) => { + // Accept the line regardless of where the cursor is. + if corrected || self.has_hint() || msg.is_some() { + // Force a refresh without hints to leave the previous + // line as the user typed it after a newline. + self.refresh_line_with_msg(msg.as_deref(), CmdKind::ForcedRefresh)?; + } + } + ValidationResult::Invalid(ref msg) => { + if corrected || self.has_hint() || msg.is_some() { + self.refresh_line_with_msg(msg.as_deref(), CmdKind::Other)?; + } + } + } + Ok(result) + } else { + Ok(ValidationResult::Valid(None)) + } + } +} + +impl Invoke for State<'_, '_, H> { + fn input(&self) -> &str { + self.line.as_str() + } +} + +impl Refresher for State<'_, '_, H> { + fn refresh_line(&mut self) -> Result<()> { + let prompt_size = self.prompt_size; + self.hint(); + self.highlight_char(CmdKind::Other); + self.refresh(self.prompt, prompt_size, true, Info::Hint) + } + + fn refresh_line_with_msg(&mut self, msg: Option<&str>, kind: CmdKind) -> Result<()> { + let prompt_size = self.prompt_size; + self.hint = None; + self.highlight_char(kind); + self.refresh(self.prompt, prompt_size, true, Info::Msg(msg)) + } + + fn refresh_prompt_and_line(&mut self, prompt: &str) -> Result<()> { + let prompt_size = self.out.calculate_position(prompt, Position::default()); + self.hint(); + self.highlight_char(CmdKind::Other); + self.refresh(prompt, prompt_size, false, Info::Hint) + } + + fn doing_insert(&mut self) { + self.changes.begin(); + } + + fn done_inserting(&mut self) { + self.changes.end(); + } + + fn last_insert(&self) -> Option { + self.changes.last_insert() + } + + fn is_cursor_at_end(&self) -> bool { + self.line.pos() == self.line.len() + } + + fn has_hint(&self) -> bool { + self.hint.is_some() + } + + fn hint_text(&self) -> Option<&str> { + self.hint.as_ref().and_then(|hint| hint.completion()) + } + + fn line(&self) -> &str { + self.line.as_str() + } + + fn pos(&self) -> usize { + self.line.pos() + } + + fn external_print(&mut self, msg: String) -> Result<()> { + self.out.clear_rows(&self.layout)?; + self.layout.end.row = 0; + self.layout.cursor.row = 0; + self.out.write_and_flush(msg.as_str())?; + if !msg.ends_with('\n') { + self.out.write_and_flush("\n")?; + } + self.refresh_line() + } +} + +impl fmt::Debug for State<'_, '_, H> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("State") + .field("prompt", &self.prompt) + .field("prompt_size", &self.prompt_size) + .field("buf", &self.line) + .field("cols", &self.out.get_columns()) + .field("layout", &self.layout) + .field("saved_line_for_history", &self.saved_line_for_history) + .finish() + } +} + +impl State<'_, '_, H> { + pub fn clear_screen(&mut self) -> Result<()> { + self.out.clear_screen()?; + self.layout.cursor = Position::default(); + self.layout.end = Position::default(); + Ok(()) + } + + /// Insert the character `ch` at cursor current position. + pub fn edit_insert(&mut self, ch: char, n: RepeatCount) -> Result<()> { + if let Some(push) = self.line.insert(ch, n, &mut self.changes) { + if push { + let prompt_size = self.prompt_size; + let no_previous_hint = self.hint.is_none(); + self.hint(); + let width = ch.width().unwrap_or(0); + if n == 1 + && width != 0 // Ctrl-V + \t or \n ... + && self.layout.cursor.col + width < self.out.get_columns() + && (self.hint.is_none() && no_previous_hint) // TODO refresh only current line + && !self.highlight_char(CmdKind::Other) + { + // Avoid a full update of the line in the trivial case. + self.layout.cursor.col += width; + self.layout.end.col += width; + debug_assert!(self.layout.prompt_size <= self.layout.cursor); + debug_assert!(self.layout.cursor <= self.layout.end); + let bits = ch.encode_utf8(&mut self.byte_buffer); + self.out.write_and_flush(bits) + } else { + self.refresh(self.prompt, prompt_size, true, Info::Hint) + } + } else { + self.refresh_line() + } + } else { + Ok(()) + } + } + + /// Replace a single (or n) character(s) under the cursor (Vi mode) + pub fn edit_replace_char(&mut self, ch: char, n: RepeatCount) -> Result<()> { + self.changes.begin(); + let succeed = if let Some(chars) = self.line.delete(n, &mut self.changes) { + let count = chars.graphemes(true).count(); + self.line.insert(ch, count, &mut self.changes); + self.line.move_backward(1); + true + } else { + false + }; + self.changes.end(); + if succeed { + self.refresh_line() + } else { + Ok(()) + } + } + + /// Overwrite the character under the cursor (Vi mode) + pub fn edit_overwrite_char(&mut self, ch: char) -> Result<()> { + if let Some(end) = self.line.next_pos(1) { + { + let text = ch.encode_utf8(&mut self.byte_buffer); + let start = self.line.pos(); + self.line.replace(start..end, text, &mut self.changes); + } + self.refresh_line() + } else { + Ok(()) + } + } + + // Yank/paste `text` at current position. + pub fn edit_yank( + &mut self, + input_state: &InputState, + text: &str, + anchor: Anchor, + n: RepeatCount, + ) -> Result<()> { + if let Anchor::After = anchor { + self.line.move_forward(1); + } + if self.line.yank(text, n, &mut self.changes).is_some() { + if !input_state.is_emacs_mode() { + self.line.move_backward(1); + } + self.refresh_line() + } else { + Ok(()) + } + } + + // Delete previously yanked text and yank/paste `text` at current position. + pub fn edit_yank_pop(&mut self, yank_size: usize, text: &str) -> Result<()> { + self.changes.begin(); + let result = if self + .line + .yank_pop(yank_size, text, &mut self.changes) + .is_some() + { + self.refresh_line() + } else { + Ok(()) + }; + self.changes.end(); + result + } + + /// Move cursor on the left. + pub fn edit_move_backward(&mut self, n: RepeatCount) -> Result<()> { + if self.line.move_backward(n) { + self.move_cursor(CmdKind::MoveCursor) + } else { + Ok(()) + } + } + + /// Move cursor on the right. + pub fn edit_move_forward(&mut self, n: RepeatCount) -> Result<()> { + if self.line.move_forward(n) { + self.move_cursor(CmdKind::MoveCursor) + } else { + Ok(()) + } + } + + /// Move cursor to the start of the line. + pub fn edit_move_home(&mut self) -> Result<()> { + if self.line.move_home() { + self.move_cursor(CmdKind::MoveCursor) + } else { + Ok(()) + } + } + + /// Move cursor to the end of the line. + pub fn edit_move_end(&mut self) -> Result<()> { + if self.line.move_end() { + self.move_cursor(CmdKind::MoveCursor) + } else { + Ok(()) + } + } + + /// Move cursor to the start of the buffer. + pub fn edit_move_buffer_start(&mut self) -> Result<()> { + if self.line.move_buffer_start() { + self.move_cursor(CmdKind::MoveCursor) + } else { + Ok(()) + } + } + + /// Move cursor to the end of the buffer. + pub fn edit_move_buffer_end(&mut self, kind: CmdKind) -> Result<()> { + if self.line.move_buffer_end() { + self.move_cursor(kind) + } else { + Ok(()) + } + } + + pub fn edit_kill(&mut self, mvt: &Movement, kill_ring: &mut KillRing) -> Result<()> { + struct Proxy<'p>(&'p mut Changeset, &'p mut KillRing); + let mut proxy = Proxy(&mut self.changes, kill_ring); + impl DeleteListener for Proxy<'_> { + fn start_killing(&mut self) { + self.1.start_killing(); + } + + fn delete(&mut self, idx: usize, string: &str, dir: Direction) { + self.0.delete(idx, string); + self.1.delete(idx, string, dir); + } + + fn stop_killing(&mut self) { + self.1.stop_killing() + } + } + impl ChangeListener for Proxy<'_> { + fn insert_char(&mut self, idx: usize, c: char) { + self.0.insert_char(idx, c) + } + + fn insert_str(&mut self, idx: usize, string: &str) { + self.0.insert_str(idx, string) + } + + fn replace(&mut self, idx: usize, old: &str, new: &str) { + self.0.replace(idx, old, new) + } + } + if self.line.kill(mvt, &mut proxy) { + self.refresh_line() + } else { + Ok(()) + } + } + + pub fn edit_insert_text(&mut self, text: &str) -> Result<()> { + if text.is_empty() { + return Ok(()); + } + let cursor = self.line.pos(); + self.line.insert_str(cursor, text, &mut self.changes); + self.refresh_line() + } + + /// Exchange the char before cursor with the character at cursor. + pub fn edit_transpose_chars(&mut self) -> Result<()> { + self.changes.begin(); + let succeed = self.line.transpose_chars(&mut self.changes); + self.changes.end(); + if succeed { + self.refresh_line() + } else { + Ok(()) + } + } + + pub fn edit_move_to_prev_word(&mut self, word_def: Word, n: RepeatCount) -> Result<()> { + if self.line.move_to_prev_word(word_def, n) { + self.move_cursor(CmdKind::MoveCursor) + } else { + Ok(()) + } + } + + pub fn edit_move_to_next_word(&mut self, at: At, word_def: Word, n: RepeatCount) -> Result<()> { + if self.line.move_to_next_word(at, word_def, n) { + self.move_cursor(CmdKind::MoveCursor) + } else { + Ok(()) + } + } + + /// Moves the cursor to the same column in the line above + pub fn edit_move_line_up(&mut self, n: RepeatCount) -> Result { + if self.line.move_to_line_up(n) { + self.move_cursor(CmdKind::MoveCursor)?; + Ok(true) + } else { + Ok(false) + } + } + + /// Moves the cursor to the same column in the line above + pub fn edit_move_line_down(&mut self, n: RepeatCount) -> Result { + if self.line.move_to_line_down(n) { + self.move_cursor(CmdKind::MoveCursor)?; + Ok(true) + } else { + Ok(false) + } + } + + pub fn edit_move_to(&mut self, cs: CharSearch, n: RepeatCount) -> Result<()> { + if self.line.move_to(cs, n) { + self.move_cursor(CmdKind::MoveCursor) + } else { + Ok(()) + } + } + + pub fn edit_word(&mut self, a: WordAction) -> Result<()> { + self.changes.begin(); + let succeed = self.line.edit_word(a, &mut self.changes); + self.changes.end(); + if succeed { + self.refresh_line() + } else { + Ok(()) + } + } + + pub fn edit_transpose_words(&mut self, n: RepeatCount) -> Result<()> { + self.changes.begin(); + let succeed = self.line.transpose_words(n, &mut self.changes); + self.changes.end(); + if succeed { + self.refresh_line() + } else { + Ok(()) + } + } + + /// Substitute the currently edited line with the next or previous history + /// entry. + pub fn edit_history_next(&mut self, prev: bool) -> Result<()> { + let history = self.ctx.history; + if history.is_empty() { + return Ok(()); + } + if self.ctx.history_index == history.len() { + if prev { + // Save the current edited line before overwriting it + self.backup(); + } else { + return Ok(()); + } + } else if self.ctx.history_index == 0 && prev { + return Ok(()); + } + let (idx, dir) = if prev { + (self.ctx.history_index - 1, SearchDirection::Reverse) + } else { + self.ctx.history_index += 1; + (self.ctx.history_index, SearchDirection::Forward) + }; + if idx < history.len() { + if let Some(r) = history.get(idx, dir)? { + let buf = r.entry; + self.ctx.history_index = r.idx; + self.changes.begin(); + self.line.update(&buf, buf.len(), &mut self.changes); + self.changes.end(); + } else { + return Ok(()); + } + } else { + // Restore current edited line + self.restore(); + } + self.refresh_line() + } + + // Non-incremental, anchored search + pub fn edit_history_search(&mut self, dir: SearchDirection) -> Result<()> { + let history = self.ctx.history; + if history.is_empty() { + return self.out.beep(); + } + if self.ctx.history_index == history.len() && dir == SearchDirection::Forward + || self.ctx.history_index == 0 && dir == SearchDirection::Reverse + { + return self.out.beep(); + } + if dir == SearchDirection::Reverse { + self.ctx.history_index -= 1; + } else { + self.ctx.history_index += 1; + } + if let Some(sr) = history.starts_with( + &self.line.as_str()[..self.line.pos()], + self.ctx.history_index, + dir, + )? { + self.ctx.history_index = sr.idx; + self.changes.begin(); + self.line.update(&sr.entry, sr.pos, &mut self.changes); + self.changes.end(); + self.refresh_line() + } else { + self.out.beep() + } + } + + /// Substitute the currently edited line with the first/last history entry. + pub fn edit_history(&mut self, first: bool) -> Result<()> { + let history = self.ctx.history; + if history.is_empty() { + return Ok(()); + } + if self.ctx.history_index == history.len() { + if first { + // Save the current edited line before overwriting it + self.backup(); + } else { + return Ok(()); + } + } else if self.ctx.history_index == 0 && first { + return Ok(()); + } + if first { + if let Some(r) = history.get(0, SearchDirection::Forward)? { + let buf = r.entry; + self.ctx.history_index = r.idx; + self.changes.begin(); + self.line.update(&buf, buf.len(), &mut self.changes); + self.changes.end(); + } else { + return Ok(()); + } + } else { + self.ctx.history_index = history.len(); + // Restore current edited line + self.restore(); + } + self.refresh_line() + } + + /// Change the indentation of the lines covered by movement + pub fn edit_indent(&mut self, mvt: &Movement, amount: usize, dedent: bool) -> Result<()> { + if self.line.indent(mvt, amount, dedent, &mut self.changes) { + self.refresh_line() + } else { + Ok(()) + } + } +} + +#[cfg(test)] +pub fn init_state<'out, H: Helper>( + out: &'out mut ::Writer, + line: &str, + pos: usize, + helper: Option<&'out H>, + history: &'out crate::history::DefaultHistory, +) -> State<'out, 'static, H> { + State { + out, + prompt: "", + prompt_size: Position::default(), + line: LineBuffer::init(line, pos), + layout: Layout::default(), + saved_line_for_history: LineBuffer::with_capacity(100), + byte_buffer: [0; 4], + changes: Changeset::new(), + helper, + ctx: Context::new(history), + hint: Some(Box::new("hint".to_owned())), + highlight_char: false, + } +} + +#[cfg(test)] +mod test { + use super::init_state; + use crate::history::{DefaultHistory, History}; + use crate::tty::Sink; + + #[test] + fn edit_history_next() { + let mut out = Sink::default(); + let mut history = DefaultHistory::new(); + history.add("line0").unwrap(); + history.add("line1").unwrap(); + let line = "current edited line"; + let helper: Option<()> = None; + let mut s = init_state(&mut out, line, 6, helper.as_ref(), &history); + s.ctx.history_index = history.len(); + + for _ in 0..2 { + s.edit_history_next(false).unwrap(); + assert_eq!(line, s.line.as_str()); + } + + s.edit_history_next(true).unwrap(); + assert_eq!(line, s.saved_line_for_history.as_str()); + assert_eq!(1, s.ctx.history_index); + assert_eq!("line1", s.line.as_str()); + + for _ in 0..2 { + s.edit_history_next(true).unwrap(); + assert_eq!(line, s.saved_line_for_history.as_str()); + assert_eq!(0, s.ctx.history_index); + assert_eq!("line0", s.line.as_str()); + } + + s.edit_history_next(false).unwrap(); + assert_eq!(line, s.saved_line_for_history.as_str()); + assert_eq!(1, s.ctx.history_index); + assert_eq!("line1", s.line.as_str()); + + s.edit_history_next(false).unwrap(); + // assert_eq!(line, s.saved_line_for_history); + assert_eq!(2, s.ctx.history_index); + assert_eq!(line, s.line.as_str()); + } +} diff --git a/rustyline-15.0.0/src/error.rs b/rustyline-15.0.0/src/error.rs new file mode 100644 index 0000000000..038ae4b2e5 --- /dev/null +++ b/rustyline-15.0.0/src/error.rs @@ -0,0 +1,147 @@ +//! Contains error type for handling I/O and Errno errors +#[cfg(windows)] +use std::char; +use std::error::Error; +use std::fmt; +use std::io; + +/// The error type for Rustyline errors that can arise from +/// I/O related errors or Errno when using the nix-rust library +// #[non_exhaustive] +#[expect(clippy::module_name_repetitions)] +#[derive(Debug)] +#[non_exhaustive] +pub enum ReadlineError { + /// I/O Error + Io(io::Error), + /// EOF (VEOF / Ctrl-D) + Eof, + /// Interrupt signal (VINTR / VQUIT / Ctrl-C) + Interrupted, + /// Unix Error from syscall + #[cfg(unix)] + Errno(nix::Error), + /// Error generated on `WINDOW_BUFFER_SIZE_EVENT` / `SIGWINCH` signal + WindowResized, + /// Like Utf8Error on unix + #[cfg(windows)] + Decode(char::DecodeUtf16Error), + /// Something went wrong calling a Windows API + #[cfg(windows)] + SystemError(clipboard_win::ErrorCode), + /// Error related to SQLite history backend + #[cfg(feature = "with-sqlite-history")] + SQLiteError(rusqlite::Error), +} + +impl fmt::Display for ReadlineError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match *self { + Self::Io(ref err) => err.fmt(f), + Self::Eof => write!(f, "EOF"), + Self::Interrupted => write!(f, "Interrupted"), + #[cfg(unix)] + Self::Errno(ref err) => err.fmt(f), + Self::WindowResized => write!(f, "WindowResized"), + #[cfg(windows)] + Self::Decode(ref err) => err.fmt(f), + #[cfg(windows)] + Self::SystemError(ref err) => err.fmt(f), + #[cfg(feature = "with-sqlite-history")] + Self::SQLiteError(ref err) => err.fmt(f), + } + } +} + +impl Error for ReadlineError { + fn source(&self) -> Option<&(dyn Error + 'static)> { + match *self { + Self::Io(ref err) => Some(err), + Self::Eof => None, + Self::Interrupted => None, + #[cfg(unix)] + Self::Errno(ref err) => Some(err), + Self::WindowResized => None, + #[cfg(windows)] + Self::Decode(ref err) => Some(err), + #[cfg(windows)] + Self::SystemError(_) => None, + #[cfg(feature = "with-sqlite-history")] + Self::SQLiteError(ref err) => Some(err), + } + } +} + +#[cfg(unix)] +#[derive(Debug)] +pub(crate) struct WindowResizedError; +#[cfg(unix)] +impl fmt::Display for WindowResizedError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "WindowResized") + } +} +#[cfg(unix)] +impl Error for WindowResizedError {} + +impl From for ReadlineError { + fn from(err: io::Error) -> Self { + #[cfg(unix)] + if err.kind() == io::ErrorKind::Interrupted { + if let Some(e) = err.get_ref() { + if e.downcast_ref::().is_some() { + return Self::WindowResized; + } + } + } + Self::Io(err) + } +} + +impl From for ReadlineError { + fn from(kind: io::ErrorKind) -> Self { + Self::Io(io::Error::from(kind)) + } +} + +#[cfg(unix)] +impl From for ReadlineError { + fn from(err: nix::Error) -> Self { + Self::Errno(err) + } +} + +#[cfg(windows)] +impl From for ReadlineError { + fn from(err: char::DecodeUtf16Error) -> Self { + Self::Io(io::Error::new(io::ErrorKind::InvalidData, err)) + } +} + +#[cfg(windows)] +impl From for ReadlineError { + fn from(err: std::string::FromUtf8Error) -> Self { + Self::Io(io::Error::new(io::ErrorKind::InvalidData, err)) + } +} + +#[cfg(unix)] +impl From for ReadlineError { + fn from(err: fmt::Error) -> Self { + Self::Io(io::Error::new(io::ErrorKind::Other, err)) + } +} + +#[cfg(windows)] +impl From for ReadlineError { + fn from(err: clipboard_win::ErrorCode) -> Self { + Self::SystemError(err) + } +} + +#[cfg(feature = "with-sqlite-history")] +impl From for ReadlineError { + fn from(err: rusqlite::Error) -> Self { + Self::SQLiteError(err) + } +} diff --git a/rustyline-15.0.0/src/highlight.rs b/rustyline-15.0.0/src/highlight.rs new file mode 100644 index 0000000000..6cc718a07b --- /dev/null +++ b/rustyline-15.0.0/src/highlight.rs @@ -0,0 +1,259 @@ +//! Syntax highlighting + +use crate::config::CompletionType; +use std::borrow::Cow::{self, Borrowed, Owned}; +use std::cell::Cell; + +/// Describe which kind of action has been triggering the call to `Highlighter`. +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +pub enum CmdKind { + /// Cursor moved + MoveCursor, + /// Other action + Other, + /// Forced / final refresh (no auto-suggestion / hint, no matching bracket + /// highlighted, ...) + ForcedRefresh, +} + +/// Syntax highlighter with [ANSI color](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters). +/// +/// Currently, the highlighted version *must* have the same display width as +/// the original input. +pub trait Highlighter { + /// Takes the currently edited `line` with the cursor `pos`ition and + /// returns the highlighted version (with ANSI color). + /// + /// For example, you can implement + /// [blink-matching-paren](https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html). + fn highlight<'l>(&self, line: &'l str, pos: usize) -> Cow<'l, str> { + let _ = pos; + Borrowed(line) + } + /// Takes the `prompt` and + /// returns the highlighted version (with ANSI color). + fn highlight_prompt<'b, 's: 'b, 'p: 'b>( + &'s self, + prompt: &'p str, + default: bool, + ) -> Cow<'b, str> { + let _ = default; + Borrowed(prompt) + } + /// Takes the `hint` and + /// returns the highlighted version (with ANSI color). + fn highlight_hint<'h>(&self, hint: &'h str) -> Cow<'h, str> { + Borrowed(hint) + } + /// Takes the completion `candidate` and + /// returns the highlighted version (with ANSI color). + /// + /// Currently, used only with `CompletionType::List`. + fn highlight_candidate<'c>( + &self, + candidate: &'c str, // FIXME should be Completer::Candidate + completion: CompletionType, + ) -> Cow<'c, str> { + let _ = completion; + Borrowed(candidate) + } + /// Tells if `line` needs to be highlighted when a specific char is typed or + /// when cursor is moved under a specific char. + /// + /// Used to optimize refresh when a character is inserted or the cursor is + /// moved. + fn highlight_char(&self, line: &str, pos: usize, kind: CmdKind) -> bool { + let _ = (line, pos, kind); + false + } +} + +impl Highlighter for () {} + +// TODO versus https://python-prompt-toolkit.readthedocs.io/en/master/pages/reference.html?highlight=HighlightMatchingBracketProcessor#prompt_toolkit.layout.processors.HighlightMatchingBracketProcessor + +/// Highlight matching bracket when typed or cursor moved on. +#[derive(Default)] +pub struct MatchingBracketHighlighter { + bracket: Cell>, // memorize the character to search... +} + +impl MatchingBracketHighlighter { + /// Constructor + #[must_use] + pub fn new() -> Self { + Self { + bracket: Cell::new(None), + } + } +} + +impl Highlighter for MatchingBracketHighlighter { + fn highlight<'l>(&self, line: &'l str, _pos: usize) -> Cow<'l, str> { + if line.len() <= 1 { + return Borrowed(line); + } + // highlight matching brace/bracket/parenthesis if it exists + if let Some((bracket, pos)) = self.bracket.get() { + if let Some((matching, idx)) = find_matching_bracket(line, pos, bracket) { + let mut copy = line.to_owned(); + copy.replace_range(idx..=idx, &format!("\x1b[1;34m{}\x1b[0m", matching as char)); + return Owned(copy); + } + } + Borrowed(line) + } + + fn highlight_char(&self, line: &str, pos: usize, kind: CmdKind) -> bool { + if kind == CmdKind::ForcedRefresh { + self.bracket.set(None); + return false; + } + // will highlight matching brace/bracket/parenthesis if it exists + self.bracket.set(check_bracket(line, pos)); + self.bracket.get().is_some() + } +} + +fn find_matching_bracket(line: &str, pos: usize, bracket: u8) -> Option<(u8, usize)> { + let matching = matching_bracket(bracket); + let mut idx; + let mut unmatched = 1; + if is_open_bracket(bracket) { + // forward search + idx = pos + 1; + let bytes = &line.as_bytes()[idx..]; + for b in bytes { + if *b == matching { + unmatched -= 1; + if unmatched == 0 { + debug_assert_eq!(matching, line.as_bytes()[idx]); + return Some((matching, idx)); + } + } else if *b == bracket { + unmatched += 1; + } + idx += 1; + } + debug_assert_eq!(idx, line.len()); + } else { + // backward search + idx = pos; + let bytes = &line.as_bytes()[..idx]; + for b in bytes.iter().rev() { + if *b == matching { + unmatched -= 1; + if unmatched == 0 { + debug_assert_eq!(matching, line.as_bytes()[idx - 1]); + return Some((matching, idx - 1)); + } + } else if *b == bracket { + unmatched += 1; + } + idx -= 1; + } + debug_assert_eq!(idx, 0); + } + None +} + +// check under or before the cursor +fn check_bracket(line: &str, pos: usize) -> Option<(u8, usize)> { + if line.is_empty() { + return None; + } + let mut pos = pos; + if pos >= line.len() { + pos = line.len() - 1; // before cursor + let b = line.as_bytes()[pos]; // previous byte + if is_close_bracket(b) { + Some((b, pos)) + } else { + None + } + } else { + let mut under_cursor = true; + loop { + let b = line.as_bytes()[pos]; + if is_close_bracket(b) { + return if pos == 0 { None } else { Some((b, pos)) }; + } else if is_open_bracket(b) { + return if pos + 1 == line.len() { + None + } else { + Some((b, pos)) + }; + } else if under_cursor && pos > 0 { + under_cursor = false; + pos -= 1; // or before cursor + } else { + return None; + } + } + } +} + +const fn matching_bracket(bracket: u8) -> u8 { + match bracket { + b'{' => b'}', + b'}' => b'{', + b'[' => b']', + b']' => b'[', + b'(' => b')', + b')' => b'(', + b => b, + } +} +const fn is_open_bracket(bracket: u8) -> bool { + matches!(bracket, b'{' | b'[' | b'(') +} +const fn is_close_bracket(bracket: u8) -> bool { + matches!(bracket, b'}' | b']' | b')') +} + +#[cfg(test)] +mod tests { + #[test] + pub fn find_matching_bracket() { + use super::find_matching_bracket; + assert_eq!(find_matching_bracket("(...", 0, b'('), None); + assert_eq!(find_matching_bracket("...)", 3, b')'), None); + + assert_eq!(find_matching_bracket("()..", 0, b'('), Some((b')', 1))); + assert_eq!(find_matching_bracket("(..)", 0, b'('), Some((b')', 3))); + + assert_eq!(find_matching_bracket("..()", 3, b')'), Some((b'(', 2))); + assert_eq!(find_matching_bracket("(..)", 3, b')'), Some((b'(', 0))); + + assert_eq!(find_matching_bracket("(())", 0, b'('), Some((b')', 3))); + assert_eq!(find_matching_bracket("(())", 3, b')'), Some((b'(', 0))); + } + #[test] + pub fn check_bracket() { + use super::check_bracket; + assert_eq!(check_bracket(")...", 0), None); + assert_eq!(check_bracket("(...", 2), None); + assert_eq!(check_bracket("...(", 3), None); + assert_eq!(check_bracket("...(", 4), None); + assert_eq!(check_bracket("..).", 4), None); + + assert_eq!(check_bracket("(...", 0), Some((b'(', 0))); + assert_eq!(check_bracket("(...", 1), Some((b'(', 0))); + assert_eq!(check_bracket("...)", 3), Some((b')', 3))); + assert_eq!(check_bracket("...)", 4), Some((b')', 3))); + } + #[test] + pub fn matching_bracket() { + use super::matching_bracket; + assert_eq!(matching_bracket(b'('), b')'); + assert_eq!(matching_bracket(b')'), b'('); + } + + #[test] + pub fn is_open_bracket() { + use super::is_close_bracket; + use super::is_open_bracket; + assert!(is_open_bracket(b'(')); + assert!(is_close_bracket(b')')); + } +} diff --git a/rustyline-15.0.0/src/hint.rs b/rustyline-15.0.0/src/hint.rs new file mode 100644 index 0000000000..5543f2e8ca --- /dev/null +++ b/rustyline-15.0.0/src/hint.rs @@ -0,0 +1,95 @@ +//! Hints (suggestions at the right of the prompt as you type). + +use crate::history::SearchDirection; +use crate::Context; + +/// A hint returned by Hinter +pub trait Hint { + /// Text to display when hint is active + fn display(&self) -> &str; + /// Text to insert in line when right arrow is pressed + fn completion(&self) -> Option<&str>; +} + +impl Hint for String { + fn display(&self) -> &str { + self.as_str() + } + + fn completion(&self) -> Option<&str> { + Some(self.as_str()) + } +} + +/// Hints provider +pub trait Hinter { + /// Specific hint type + type Hint: Hint + 'static; + + /// Takes the currently edited `line` with the cursor `pos`ition and + /// returns the string that should be displayed or `None` + /// if no hint is available for the text the user currently typed. + // TODO Validate: called while editing line but not while moving cursor. + fn hint(&self, line: &str, pos: usize, ctx: &Context<'_>) -> Option { + let _ = (line, pos, ctx); + None + } +} + +impl Hinter for () { + type Hint = String; +} + +/// Add suggestion based on previous history entries matching current user +/// input. +#[derive(Default)] +pub struct HistoryHinter {} + +impl HistoryHinter { + /// Create a new `HistoryHinter` + pub fn new() -> Self { + Self::default() + } +} + +impl Hinter for HistoryHinter { + type Hint = String; + + fn hint(&self, line: &str, pos: usize, ctx: &Context<'_>) -> Option { + if line.is_empty() || pos < line.len() { + return None; + } + let start = if ctx.history_index() == ctx.history().len() { + ctx.history_index().saturating_sub(1) + } else { + ctx.history_index() + }; + if let Some(sr) = ctx + .history + .starts_with(line, start, SearchDirection::Reverse) + .unwrap_or(None) + { + if sr.entry == line { + return None; + } + return Some(sr.entry[pos..].to_owned()); + } + None + } +} + +#[cfg(test)] +mod test { + use super::{Hinter, HistoryHinter}; + use crate::history::DefaultHistory; + use crate::Context; + + #[test] + pub fn empty_history() { + let history = DefaultHistory::new(); + let ctx = Context::new(&history); + let hinter = HistoryHinter {}; + let hint = hinter.hint("test", 4, &ctx); + assert_eq!(None, hint); + } +} diff --git a/rustyline-15.0.0/src/history.rs b/rustyline-15.0.0/src/history.rs new file mode 100644 index 0000000000..f3237d7aaf --- /dev/null +++ b/rustyline-15.0.0/src/history.rs @@ -0,0 +1,1075 @@ +//! History API + +#[cfg(feature = "with-file-history")] +use fd_lock::RwLock; +#[cfg(feature = "with-file-history")] +use log::{debug, warn}; +use std::borrow::Cow; +use std::collections::vec_deque; +use std::collections::VecDeque; +#[cfg(feature = "with-file-history")] +use std::fs::{File, OpenOptions}; +#[cfg(feature = "with-file-history")] +use std::io::SeekFrom; +use std::ops::Index; +use std::path::Path; +#[cfg(feature = "with-file-history")] +use std::time::SystemTime; + +use super::Result; +use crate::config::{Config, HistoryDuplicates}; + +/// Search direction +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum SearchDirection { + /// Search history forward + Forward, + /// Search history backward + Reverse, +} + +/// History search result +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct SearchResult<'a> { + /// history entry + pub entry: Cow<'a, str>, + /// history index + pub idx: usize, + /// match position in `entry` + pub pos: usize, +} + +/// Interface for navigating/loading/storing history +// TODO Split navigation part from backend part +pub trait History { + // TODO jline3: interface Entry { + // int index(); + // Instant time(); + // String line(); + // } + // replxx: HistoryEntry { + // std::string _timestamp; + // std::string _text; + + // termwiz: fn get(&self, idx: HistoryIndex) -> Option>; + + /// Return the history entry at position `index`, starting from 0. + /// + /// `SearchDirection` is useful only for implementations without direct + /// indexing. + fn get(&self, index: usize, dir: SearchDirection) -> Result>; + + // termwiz: fn last(&self) -> Option; + + // jline3: default void add(String line) { + // add(Instant.now(), line); + // } + // jline3: void add(Instant time, String line); + // termwiz: fn add(&mut self, line: &str); + // reedline: fn append(&mut self, entry: &str); + + /// Add a new entry in the history. + /// + /// Return false if the `line` has been ignored (blank line / duplicate / + /// ...). + fn add(&mut self, line: &str) -> Result; + /// Add a new entry in the history. + /// + /// Return false if the `line` has been ignored (blank line / duplicate / + /// ...). + fn add_owned(&mut self, line: String) -> Result; // TODO check AsRef + Into vs object safe + + /// Return the number of entries in the history. + #[must_use] + fn len(&self) -> usize; + + /// Return true if the history has no entry. + #[must_use] + fn is_empty(&self) -> bool; + + // TODO jline3: int index(); + // TODO jline3: String current(); + // reedline: fn string_at_cursor(&self) -> Option; + // TODO jline3: boolean previous(); + // reedline: fn back(&mut self); + // TODO jline3: boolean next(); + // reedline: fn forward(&mut self); + // TODO jline3: boolean moveToFirst(); + // TODO jline3: boolean moveToFirst(); + // TODO jline3: boolean moveToLast(); + // TODO jline3: boolean moveTo(int index); + // TODO jline3: void moveToEnd(); + // TODO jline3: void resetIndex(); + + // TODO jline3: int first(); + // TODO jline3: default boolean isPersistable(Entry entry) { + // return true; + // } + + /// Set the maximum length for the history. This function can be called even + /// if there is already some history, the function will make sure to retain + /// just the latest `len` elements if the new history length value is + /// smaller than the amount of items already inside the history. + /// + /// Like [stifle_history](http://tiswww.case.edu/php/chet/readline/history.html#IDX11). + fn set_max_len(&mut self, len: usize) -> Result<()>; + + /// Ignore consecutive duplicates + fn ignore_dups(&mut self, yes: bool) -> Result<()>; + + /// Ignore lines which begin with a space or not + fn ignore_space(&mut self, yes: bool); + + /// Save the history in the specified file. + // TODO history_truncate_file + // https://tiswww.case.edu/php/chet/readline/history.html#IDX31 + fn save(&mut self, path: &Path) -> Result<()>; // FIXME Path vs AsRef + + /// Append new entries in the specified file. + // Like [append_history](http://tiswww.case.edu/php/chet/readline/history.html#IDX30). + fn append(&mut self, path: &Path) -> Result<()>; // FIXME Path vs AsRef + + /// Load the history from the specified file. + /// + /// # Errors + /// Will return `Err` if path does not already exist or could not be read. + fn load(&mut self, path: &Path) -> Result<()>; // FIXME Path vs AsRef + + /// Clear in-memory history + fn clear(&mut self) -> Result<()>; + + // termwiz: fn search( + // &self, + // idx: HistoryIndex, + // style: SearchStyle, + // direction: SearchDirection, + // pattern: &str, + // ) -> Option; + // reedline: fn set_navigation(&mut self, navigation: HistoryNavigationQuery); + // reedline: fn get_navigation(&self) -> HistoryNavigationQuery; + + /// Search history (start position inclusive [0, len-1]). + /// + /// Return the absolute index of the nearest history entry that matches + /// `term`. + /// + /// Return None if no entry contains `term` between [start, len -1] for + /// forward search + /// or between [0, start] for reverse search. + fn search( + &self, + term: &str, + start: usize, + dir: SearchDirection, + ) -> Result>; + + /// Anchored search + fn starts_with( + &self, + term: &str, + start: usize, + dir: SearchDirection, + ) -> Result>; + + /* TODO How ? DoubleEndedIterator may be difficult to implement (for an SQLite backend) + /// Return a iterator. + #[must_use] + fn iter(&self) -> impl DoubleEndedIterator + '_; + */ +} + +/// Transient in-memory history implementation. +pub struct MemHistory { + entries: VecDeque, + max_len: usize, + ignore_space: bool, + ignore_dups: bool, +} + +impl MemHistory { + /// Default constructor + #[must_use] + pub fn new() -> Self { + Self::with_config(Config::default()) + } + + /// Customized constructor with: + /// - `Config::max_history_size()`, + /// - `Config::history_ignore_space()`, + /// - `Config::history_duplicates()`. + #[must_use] + pub fn with_config(config: Config) -> Self { + Self { + entries: VecDeque::new(), + max_len: config.max_history_size(), + ignore_space: config.history_ignore_space(), + ignore_dups: config.history_duplicates() == HistoryDuplicates::IgnoreConsecutive, + } + } + + fn search_match( + &self, + term: &str, + start: usize, + dir: SearchDirection, + test: F, + ) -> Option + where + F: Fn(&str) -> Option, + { + if term.is_empty() || start >= self.len() { + return None; + } + match dir { + SearchDirection::Reverse => { + for (idx, entry) in self + .entries + .iter() + .rev() + .skip(self.len() - 1 - start) + .enumerate() + { + if let Some(cursor) = test(entry) { + return Some(SearchResult { + idx: start - idx, + entry: Cow::Borrowed(entry), + pos: cursor, + }); + } + } + None + } + SearchDirection::Forward => { + for (idx, entry) in self.entries.iter().skip(start).enumerate() { + if let Some(cursor) = test(entry) { + return Some(SearchResult { + idx: idx + start, + entry: Cow::Borrowed(entry), + pos: cursor, + }); + } + } + None + } + } + } + + fn ignore(&self, line: &str) -> bool { + if self.max_len == 0 { + return true; + } + if line.is_empty() + || (self.ignore_space && line.chars().next().map_or(true, char::is_whitespace)) + { + return true; + } + if self.ignore_dups { + if let Some(s) = self.entries.back() { + if s == line { + return true; + } + } + } + false + } + + fn insert(&mut self, line: String) { + if self.entries.len() == self.max_len { + self.entries.pop_front(); + } + self.entries.push_back(line); + } +} + +impl Default for MemHistory { + fn default() -> Self { + Self::new() + } +} + +impl History for MemHistory { + fn get(&self, index: usize, _: SearchDirection) -> Result> { + Ok(self + .entries + .get(index) + .map(String::as_ref) + .map(Cow::Borrowed) + .map(|entry| SearchResult { + entry, + idx: index, + pos: 0, + })) + } + + fn add(&mut self, line: &str) -> Result { + if self.ignore(line) { + return Ok(false); + } + self.insert(line.to_owned()); + Ok(true) + } + + fn add_owned(&mut self, line: String) -> Result { + if self.ignore(&line) { + return Ok(false); + } + self.insert(line); + Ok(true) + } + + fn len(&self) -> usize { + self.entries.len() + } + + fn is_empty(&self) -> bool { + self.entries.is_empty() + } + + fn set_max_len(&mut self, len: usize) -> Result<()> { + self.max_len = len; + if self.len() > len { + self.entries.drain(..self.len() - len); + } + Ok(()) + } + + fn ignore_dups(&mut self, yes: bool) -> Result<()> { + self.ignore_dups = yes; + Ok(()) + } + + fn ignore_space(&mut self, yes: bool) { + self.ignore_space = yes; + } + + fn save(&mut self, _: &Path) -> Result<()> { + unimplemented!(); + } + + fn append(&mut self, _: &Path) -> Result<()> { + unimplemented!(); + } + + fn load(&mut self, _: &Path) -> Result<()> { + unimplemented!(); + } + + fn clear(&mut self) -> Result<()> { + self.entries.clear(); + Ok(()) + } + + fn search( + &self, + term: &str, + start: usize, + dir: SearchDirection, + ) -> Result> { + #[cfg(not(feature = "case_insensitive_history_search"))] + { + let test = |entry: &str| entry.find(term); + Ok(self.search_match(term, start, dir, test)) + } + #[cfg(feature = "case_insensitive_history_search")] + { + use regex::{escape, RegexBuilder}; + Ok( + if let Ok(re) = RegexBuilder::new(&escape(term)) + .case_insensitive(true) + .build() + { + let test = |entry: &str| re.find(entry).map(|m| m.start()); + self.search_match(term, start, dir, test) + } else { + None + }, + ) + } + } + + fn starts_with( + &self, + term: &str, + start: usize, + dir: SearchDirection, + ) -> Result> { + #[cfg(not(feature = "case_insensitive_history_search"))] + { + let test = |entry: &str| { + if entry.starts_with(term) { + Some(term.len()) + } else { + None + } + }; + Ok(self.search_match(term, start, dir, test)) + } + #[cfg(feature = "case_insensitive_history_search")] + { + use regex::{escape, RegexBuilder}; + Ok( + if let Ok(re) = RegexBuilder::new(&escape(term)) + .case_insensitive(true) + .build() + { + let test = |entry: &str| { + re.find(entry) + .and_then(|m| if m.start() == 0 { Some(m) } else { None }) + .map(|m| m.end()) + }; + self.search_match(term, start, dir, test) + } else { + None + }, + ) + } + } +} + +impl Index for MemHistory { + type Output = String; + + fn index(&self, index: usize) -> &String { + &self.entries[index] + } +} + +impl<'a> IntoIterator for &'a MemHistory { + type IntoIter = vec_deque::Iter<'a, String>; + type Item = &'a String; + + fn into_iter(self) -> Self::IntoIter { + self.entries.iter() + } +} + +/// Current state of the history stored in a file. +#[derive(Default)] +#[cfg(feature = "with-file-history")] +pub struct FileHistory { + mem: MemHistory, + /// Number of entries inputted by user and not saved yet + new_entries: usize, + /// last path used by either `load` or `save` + path_info: Option, +} + +// TODO impl Deref for FileHistory ? + +/// Last histo path, modified timestamp and size +#[cfg(feature = "with-file-history")] +struct PathInfo(std::path::PathBuf, SystemTime, usize); + +#[cfg(feature = "with-file-history")] +impl FileHistory { + // New multiline-aware history files start with `#V2\n` and have newlines + // and backslashes escaped in them. + const FILE_VERSION_V2: &'static str = "#V2"; + + /// Default constructor + #[must_use] + pub fn new() -> Self { + Self::with_config(Config::default()) + } + + /// Customized constructor with: + /// - `Config::max_history_size()`, + /// - `Config::history_ignore_space()`, + /// - `Config::history_duplicates()`. + #[must_use] + pub fn with_config(config: Config) -> Self { + Self { + mem: MemHistory::with_config(config), + new_entries: 0, + path_info: None, + } + } + + fn save_to(&mut self, file: &File, append: bool) -> Result<()> { + use std::io::{BufWriter, Write}; + + fix_perm(file); + let mut wtr = BufWriter::new(file); + let first_new_entry = if append { + self.mem.len().saturating_sub(self.new_entries) + } else { + wtr.write_all(Self::FILE_VERSION_V2.as_bytes())?; + wtr.write_all(b"\n")?; + 0 + }; + for entry in self.mem.entries.iter().skip(first_new_entry) { + let mut bytes = entry.as_bytes(); + while let Some(i) = memchr::memchr2(b'\\', b'\n', bytes) { + let (head, tail) = bytes.split_at(i); + wtr.write_all(head)?; + + let (&escapable_byte, tail) = tail + .split_first() + .expect("memchr guarantees i is a valid index"); + if escapable_byte == b'\n' { + wtr.write_all(br"\n")?; // escaped line feed + } else { + debug_assert_eq!(escapable_byte, b'\\'); + wtr.write_all(br"\\")?; // escaped backslash + } + bytes = tail; + } + wtr.write_all(bytes)?; // remaining bytes with no \n or \ + wtr.write_all(b"\n")?; + } + // https://github.com/rust-lang/rust/issues/32677#issuecomment-204833485 + wtr.flush()?; + Ok(()) + } + + fn load_from(&mut self, file: &File) -> Result { + use std::io::{BufRead, BufReader}; + + let rdr = BufReader::new(file); + let mut lines = rdr.lines(); + let mut v2 = false; + if let Some(first) = lines.next() { + let line = first?; + if line == Self::FILE_VERSION_V2 { + v2 = true; + } else { + self.add_owned(line)?; + } + } + let mut appendable = v2; + for line in lines { + let mut line = line?; + if line.is_empty() { + continue; + } + if v2 { + let mut copy = None; // lazily copy line if unescaping is needed + let mut str = line.as_str(); + while let Some(i) = str.find('\\') { + if copy.is_none() { + copy = Some(String::with_capacity(line.len())); + } + let s = copy.as_mut().unwrap(); + s.push_str(&str[..i]); + let j = i + 1; // escaped char idx + let b = if j < str.len() { + str.as_bytes()[j] + } else { + 0 // unexpected if History::save works properly + }; + match b { + b'n' => { + s.push('\n'); // unescaped line feed + } + b'\\' => { + s.push('\\'); // unescaped back slash + } + _ => { + // only line feed and back slash should have been escaped + warn!(target: "rustyline", "bad escaped line: {}", line); + copy = None; + break; + } + } + str = &str[j + 1..]; + } + if let Some(mut s) = copy { + s.push_str(str); // remaining bytes with no escaped char + line = s; + } + } + appendable &= self.add_owned(line)?; // TODO truncate to MAX_LINE + } + self.new_entries = 0; // TODO we may lost new entries if loaded lines < max_len + Ok(appendable) + } + + fn update_path(&mut self, path: &Path, file: &File, size: usize) -> Result<()> { + let modified = file.metadata()?.modified()?; + if let Some(PathInfo( + ref mut previous_path, + ref mut previous_modified, + ref mut previous_size, + )) = self.path_info + { + if previous_path.as_path() != path { + path.clone_into(previous_path); + } + *previous_modified = modified; + *previous_size = size; + } else { + self.path_info = Some(PathInfo(path.to_owned(), modified, size)); + } + debug!(target: "rustyline", "PathInfo({:?}, {:?}, {})", path, modified, size); + Ok(()) + } + + fn can_just_append(&self, path: &Path, file: &File) -> Result { + if let Some(PathInfo(ref previous_path, ref previous_modified, ref previous_size)) = + self.path_info + { + if previous_path.as_path() != path { + debug!(target: "rustyline", "cannot append: {:?} <> {:?}", previous_path, path); + return Ok(false); + } + let modified = file.metadata()?.modified()?; + if *previous_modified != modified + || self.mem.max_len <= *previous_size + || self.mem.max_len < (*previous_size).saturating_add(self.new_entries) + { + debug!(target: "rustyline", "cannot append: {:?} < {:?} or {} < {} + {}", + previous_modified, modified, self.mem.max_len, previous_size, self.new_entries); + Ok(false) + } else { + Ok(true) + } + } else { + Ok(false) + } + } + + /// Return a forward iterator. + #[must_use] + pub fn iter(&self) -> impl DoubleEndedIterator + '_ { + self.mem.entries.iter() + } +} + +/// Default transient in-memory history implementation +#[cfg(not(feature = "with-file-history"))] +pub type DefaultHistory = MemHistory; +/// Default file-based history implementation +#[cfg(feature = "with-file-history")] +pub type DefaultHistory = FileHistory; + +#[cfg(feature = "with-file-history")] +impl History for FileHistory { + fn get(&self, index: usize, dir: SearchDirection) -> Result> { + self.mem.get(index, dir) + } + + fn add(&mut self, line: &str) -> Result { + if self.mem.add(line)? { + self.new_entries = self.new_entries.saturating_add(1).min(self.len()); + Ok(true) + } else { + Ok(false) + } + } + + fn add_owned(&mut self, line: String) -> Result { + if self.mem.add_owned(line)? { + self.new_entries = self.new_entries.saturating_add(1).min(self.len()); + Ok(true) + } else { + Ok(false) + } + } + + fn len(&self) -> usize { + self.mem.len() + } + + fn is_empty(&self) -> bool { + self.mem.is_empty() + } + + fn set_max_len(&mut self, len: usize) -> Result<()> { + self.mem.set_max_len(len)?; + self.new_entries = self.new_entries.min(len); + Ok(()) + } + + fn ignore_dups(&mut self, yes: bool) -> Result<()> { + self.mem.ignore_dups(yes) + } + + fn ignore_space(&mut self, yes: bool) { + self.mem.ignore_space(yes); + } + + fn save(&mut self, path: &Path) -> Result<()> { + if self.is_empty() || self.new_entries == 0 { + return Ok(()); + } + let old_umask = umask(); + let f = File::create(path); + restore_umask(old_umask); + let file = f?; + let mut lock = RwLock::new(file); + let lock_guard = lock.write()?; + self.save_to(&lock_guard, false)?; + self.new_entries = 0; + self.update_path(path, &lock_guard, self.len()) + } + + fn append(&mut self, path: &Path) -> Result<()> { + use std::io::Seek; + + if self.is_empty() || self.new_entries == 0 { + return Ok(()); + } + if !path.exists() || self.new_entries == self.mem.max_len { + return self.save(path); + } + let file = OpenOptions::new().write(true).read(true).open(path)?; + let mut lock = RwLock::new(file); + let mut lock_guard = lock.write()?; + if self.can_just_append(path, &lock_guard)? { + lock_guard.seek(SeekFrom::End(0))?; + self.save_to(&lock_guard, true)?; + let size = self + .path_info + .as_ref() + .unwrap() + .2 + .saturating_add(self.new_entries); + self.new_entries = 0; + return self.update_path(path, &lock_guard, size); + } + // we may need to truncate file before appending new entries + let mut other = Self { + mem: MemHistory { + entries: VecDeque::new(), + max_len: self.mem.max_len, + ignore_space: self.mem.ignore_space, + ignore_dups: self.mem.ignore_dups, + }, + new_entries: 0, + path_info: None, + }; + other.load_from(&lock_guard)?; + let first_new_entry = self.mem.len().saturating_sub(self.new_entries); + for entry in self.mem.entries.iter().skip(first_new_entry) { + other.add(entry)?; + } + lock_guard.seek(SeekFrom::Start(0))?; + lock_guard.set_len(0)?; // if new size < old size + other.save_to(&lock_guard, false)?; + self.update_path(path, &lock_guard, other.len())?; + self.new_entries = 0; + Ok(()) + } + + fn load(&mut self, path: &Path) -> Result<()> { + let file = File::open(path)?; + let lock = RwLock::new(file); + let lock_guard = lock.read()?; + let len = self.len(); + if self.load_from(&lock_guard)? { + self.update_path(path, &lock_guard, self.len() - len) + } else { + // discard old version on next save + self.path_info = None; + Ok(()) + } + } + + fn clear(&mut self) -> Result<()> { + self.mem.clear()?; + self.new_entries = 0; + Ok(()) + } + + fn search( + &self, + term: &str, + start: usize, + dir: SearchDirection, + ) -> Result> { + self.mem.search(term, start, dir) + } + + fn starts_with( + &self, + term: &str, + start: usize, + dir: SearchDirection, + ) -> Result> { + self.mem.starts_with(term, start, dir) + } +} + +#[cfg(feature = "with-file-history")] +impl Index for FileHistory { + type Output = String; + + fn index(&self, index: usize) -> &String { + &self.mem.entries[index] + } +} + +#[cfg(feature = "with-file-history")] +impl<'a> IntoIterator for &'a FileHistory { + type IntoIter = vec_deque::Iter<'a, String>; + type Item = &'a String; + + fn into_iter(self) -> Self::IntoIter { + self.mem.entries.iter() + } +} + +#[cfg(feature = "with-file-history")] +cfg_if::cfg_if! { + if #[cfg(any(windows, target_arch = "wasm32"))] { + fn umask() -> u16 { + 0 + } + + fn restore_umask(_: u16) {} + + fn fix_perm(_: &File) {} + } else if #[cfg(unix)] { + use nix::sys::stat::{self, Mode, fchmod}; + fn umask() -> Mode { + stat::umask(Mode::S_IXUSR | Mode::S_IRWXG | Mode::S_IRWXO) + } + + fn restore_umask(old_umask: Mode) { + stat::umask(old_umask); + } + + fn fix_perm(file: &File) { + use std::os::unix::io::AsRawFd; + let _ = fchmod(file.as_raw_fd(), Mode::S_IRUSR | Mode::S_IWUSR); + } + } +} + +#[cfg(test)] +mod tests { + use super::{DefaultHistory, History, SearchDirection, SearchResult}; + use crate::config::Config; + use crate::Result; + + fn init() -> DefaultHistory { + let mut history = DefaultHistory::new(); + assert!(history.add("line1").unwrap()); + assert!(history.add("line2").unwrap()); + assert!(history.add("line3").unwrap()); + history + } + + #[test] + fn new() { + let history = DefaultHistory::new(); + assert_eq!(0, history.len()); + } + + #[test] + fn add() { + let config = Config::builder().history_ignore_space(true).build(); + let mut history = DefaultHistory::with_config(config); + #[cfg(feature = "with-file-history")] + assert_eq!(config.max_history_size(), history.mem.max_len); + assert!(history.add("line1").unwrap()); + assert!(history.add("line2").unwrap()); + assert!(!history.add("line2").unwrap()); + assert!(!history.add("").unwrap()); + assert!(!history.add(" line3").unwrap()); + } + + #[test] + fn set_max_len() { + let mut history = init(); + history.set_max_len(1).unwrap(); + assert_eq!(1, history.len()); + assert_eq!(Some(&"line3".to_owned()), history.into_iter().last()); + } + + #[test] + #[cfg(feature = "with-file-history")] + #[cfg_attr(miri, ignore)] // unsupported operation: `getcwd` not available when isolation is enabled + fn save() -> Result<()> { + check_save("line\nfour \\ abc") + } + + #[test] + #[cfg(feature = "with-file-history")] + #[cfg_attr(miri, ignore)] // unsupported operation: `open` not available when isolation is enabled + fn save_windows_path() -> Result<()> { + let path = "cd source\\repos\\forks\\nushell\\"; + check_save(path) + } + + #[cfg(feature = "with-file-history")] + fn check_save(line: &str) -> Result<()> { + let mut history = init(); + assert!(history.add(line)?); + let tf = tempfile::NamedTempFile::new()?; + + history.save(tf.path())?; + let mut history2 = DefaultHistory::new(); + history2.load(tf.path())?; + for (a, b) in history.iter().zip(history2.iter()) { + assert_eq!(a, b); + } + tf.close()?; + Ok(()) + } + + #[test] + #[cfg(feature = "with-file-history")] + #[cfg_attr(miri, ignore)] // unsupported operation: `getcwd` not available when isolation is enabled + fn load_legacy() -> Result<()> { + use std::io::Write; + let tf = tempfile::NamedTempFile::new()?; + { + let mut legacy = std::fs::File::create(tf.path())?; + // Some data we'd accidentally corrupt if we got the version wrong + let data = b"\ + test\\n \\abc \\123\n\ + 123\\n\\\\n\n\ + abcde + "; + legacy.write_all(data)?; + legacy.flush()?; + } + let mut history = DefaultHistory::new(); + history.load(tf.path())?; + assert_eq!(history[0], "test\\n \\abc \\123"); + assert_eq!(history[1], "123\\n\\\\n"); + assert_eq!(history[2], "abcde"); + + tf.close()?; + Ok(()) + } + + #[test] + #[cfg(feature = "with-file-history")] + #[cfg_attr(miri, ignore)] // unsupported operation: `getcwd` not available when isolation is enabled + fn append() -> Result<()> { + let mut history = init(); + let tf = tempfile::NamedTempFile::new()?; + + history.append(tf.path())?; + + let mut history2 = DefaultHistory::new(); + history2.load(tf.path())?; + history2.add("line4")?; + history2.append(tf.path())?; + + history.add("line5")?; + history.append(tf.path())?; + + let mut history3 = DefaultHistory::new(); + history3.load(tf.path())?; + assert_eq!(history3.len(), 5); + + tf.close()?; + Ok(()) + } + + #[test] + #[cfg(feature = "with-file-history")] + #[cfg_attr(miri, ignore)] // unsupported operation: `getcwd` not available when isolation is enabled + fn truncate() -> Result<()> { + let tf = tempfile::NamedTempFile::new()?; + + let config = Config::builder().history_ignore_dups(false)?.build(); + let mut history = DefaultHistory::with_config(config); + history.add("line1")?; + history.add("line1")?; + history.append(tf.path())?; + + let mut history = DefaultHistory::new(); + history.load(tf.path())?; + history.add("l")?; + history.append(tf.path())?; + + let mut history = DefaultHistory::new(); + history.load(tf.path())?; + assert_eq!(history.len(), 2); + assert_eq!(history[1], "l"); + + tf.close()?; + Ok(()) + } + + #[test] + fn search() -> Result<()> { + let history = init(); + assert_eq!(None, history.search("", 0, SearchDirection::Forward)?); + assert_eq!(None, history.search("none", 0, SearchDirection::Forward)?); + assert_eq!(None, history.search("line", 3, SearchDirection::Forward)?); + + assert_eq!( + Some(SearchResult { + idx: 0, + entry: history.get(0, SearchDirection::Forward)?.unwrap().entry, + pos: 0 + }), + history.search("line", 0, SearchDirection::Forward)? + ); + assert_eq!( + Some(SearchResult { + idx: 1, + entry: history.get(1, SearchDirection::Forward)?.unwrap().entry, + pos: 0 + }), + history.search("line", 1, SearchDirection::Forward)? + ); + assert_eq!( + Some(SearchResult { + idx: 2, + entry: history.get(2, SearchDirection::Forward)?.unwrap().entry, + pos: 0 + }), + history.search("line3", 1, SearchDirection::Forward)? + ); + Ok(()) + } + + #[test] + fn reverse_search() -> Result<()> { + let history = init(); + assert_eq!(None, history.search("", 2, SearchDirection::Reverse)?); + assert_eq!(None, history.search("none", 2, SearchDirection::Reverse)?); + assert_eq!(None, history.search("line", 3, SearchDirection::Reverse)?); + + assert_eq!( + Some(SearchResult { + idx: 2, + entry: history.get(2, SearchDirection::Reverse)?.unwrap().entry, + pos: 0 + }), + history.search("line", 2, SearchDirection::Reverse)? + ); + assert_eq!( + Some(SearchResult { + idx: 1, + entry: history.get(1, SearchDirection::Reverse)?.unwrap().entry, + pos: 0 + }), + history.search("line", 1, SearchDirection::Reverse)? + ); + assert_eq!( + Some(SearchResult { + idx: 0, + entry: history.get(0, SearchDirection::Reverse)?.unwrap().entry, + pos: 0 + }), + history.search("line1", 1, SearchDirection::Reverse)? + ); + Ok(()) + } + + #[test] + #[cfg(feature = "case_insensitive_history_search")] + fn anchored_search() -> Result<()> { + let history = init(); + assert_eq!( + Some(SearchResult { + idx: 2, + entry: history.get(2, SearchDirection::Reverse)?.unwrap().entry, + pos: 4 + }), + history.starts_with("LiNe", 2, SearchDirection::Reverse)? + ); + assert_eq!( + None, + history.starts_with("iNe", 2, SearchDirection::Reverse)? + ); + Ok(()) + } +} diff --git a/rustyline-15.0.0/src/keymap.rs b/rustyline-15.0.0/src/keymap.rs new file mode 100644 index 0000000000..c8561207c7 --- /dev/null +++ b/rustyline-15.0.0/src/keymap.rs @@ -0,0 +1,1222 @@ +//! Bindings from keys to command for Emacs and Vi modes +use log::debug; + +use super::Result; +use crate::highlight::CmdKind; +use crate::keys::{KeyCode as K, KeyEvent, KeyEvent as E, Modifiers as M}; +use crate::tty::{self, RawReader, Term, Terminal}; +use crate::{Config, EditMode}; +#[cfg(feature = "custom-bindings")] +use crate::{Event, EventContext, EventHandler}; + +/// The number of times one command should be repeated. +pub type RepeatCount = usize; + +/// Commands +#[derive(Debug, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum Cmd { + /// abort + Abort, // Miscellaneous Command + /// accept-line + /// + /// See also `AcceptOrInsertLine` + AcceptLine, + /// beginning-of-history + BeginningOfHistory, + /// capitalize-word + CapitalizeWord, + /// clear-screen + ClearScreen, + /// Paste from the clipboard + #[cfg(windows)] + PasteFromClipboard, + /// complete + Complete, + /// complete-backward + CompleteBackward, + /// complete-hint + CompleteHint, + /// Dedent current line + Dedent(Movement), + /// downcase-word + DowncaseWord, + /// vi-eof-maybe + EndOfFile, + /// end-of-history + EndOfHistory, + /// forward-search-history (incremental search) + ForwardSearchHistory, + /// history-search-backward (common prefix search) + HistorySearchBackward, + /// history-search-forward (common prefix search) + HistorySearchForward, + /// Indent current line + Indent(Movement), + /// Insert text + Insert(RepeatCount, String), + /// Interrupt signal (Ctrl-C) + Interrupt, + /// backward-delete-char, backward-kill-line, backward-kill-word + /// delete-char, kill-line, kill-word, unix-line-discard, unix-word-rubout, + /// vi-delete, vi-delete-to, vi-rubout + Kill(Movement), + /// backward-char, backward-word, beginning-of-line, end-of-line, + /// forward-char, forward-word, vi-char-search, vi-end-word, vi-next-word, + /// vi-prev-word + Move(Movement), + /// next-history + NextHistory, + /// No action + Noop, + /// repaint + Repaint, + /// vi-replace + Overwrite(char), + /// previous-history + PreviousHistory, + /// quoted-insert + QuotedInsert, + /// vi-change-char + ReplaceChar(RepeatCount, char), + /// vi-change-to, vi-substitute + Replace(Movement, Option), + /// reverse-search-history (incremental search) + ReverseSearchHistory, + /// self-insert + SelfInsert(RepeatCount, char), + /// Suspend signal (Ctrl-Z on unix platform) + Suspend, + /// transpose-chars + TransposeChars, + /// transpose-words + TransposeWords(RepeatCount), + /// undo + Undo(RepeatCount), + /// Unsupported / unexpected + Unknown, + /// upcase-word + UpcaseWord, + /// vi-yank-to + ViYankTo(Movement), + /// yank, vi-put + Yank(RepeatCount, Anchor), + /// yank-pop + YankPop, + /// moves cursor to the line above or switches to prev history entry if + /// the cursor is already on the first line + LineUpOrPreviousHistory(RepeatCount), + /// moves cursor to the line below or switches to next history entry if + /// the cursor is already on the last line + LineDownOrNextHistory(RepeatCount), + /// Inserts a newline + Newline, + /// Either accepts or inserts a newline + /// + /// Always inserts newline if input is non-valid. Can also insert newline + /// if cursor is in the middle of the text + /// + /// If you support multi-line input: + /// * Use `accept_in_the_middle: true` for mostly single-line cases, for + /// example command-line. + /// * Use `accept_in_the_middle: false` for mostly multi-line cases, for + /// example SQL or JSON input. + AcceptOrInsertLine { + /// Whether this commands accepts input if the cursor not at the end + /// of the current input + accept_in_the_middle: bool, + }, +} + +impl Cmd { + /// Tells if current command should reset kill ring. + #[must_use] + pub const fn should_reset_kill_ring(&self) -> bool { + match *self { + Self::Kill(Movement::BackwardChar(_) | Movement::ForwardChar(_)) => true, + Self::ClearScreen + | Self::Kill(_) + | Self::Replace(..) + | Self::Noop + | Self::Suspend + | Self::Yank(..) + | Self::YankPop => false, + _ => true, + } + } + + const fn is_repeatable_change(&self) -> bool { + matches!( + *self, + Self::Dedent(..) + | Self::Indent(..) + | Self::Insert(..) + | Self::Kill(_) + | Self::ReplaceChar(..) + | Self::Replace(..) + | Self::SelfInsert(..) + | Self::ViYankTo(_) + | Self::Yank(..) // Cmd::TransposeChars | TODO Validate + ) + } + + const fn is_repeatable(&self) -> bool { + match *self { + Self::Move(_) => true, + _ => self.is_repeatable_change(), + } + } + + // Replay this command with a possible different `RepeatCount`. + fn redo(&self, new: Option, wrt: &dyn Refresher) -> Self { + match *self { + Self::Dedent(ref mvt) => Self::Dedent(mvt.redo(new)), + Self::Indent(ref mvt) => Self::Indent(mvt.redo(new)), + Self::Insert(previous, ref text) => { + Self::Insert(repeat_count(previous, new), text.clone()) + } + Self::Kill(ref mvt) => Self::Kill(mvt.redo(new)), + Self::Move(ref mvt) => Self::Move(mvt.redo(new)), + Self::ReplaceChar(previous, c) => Self::ReplaceChar(repeat_count(previous, new), c), + Self::Replace(ref mvt, ref text) => { + if text.is_none() { + let last_insert = wrt.last_insert(); + if let Movement::ForwardChar(0) = mvt { + Self::Replace( + Movement::ForwardChar(last_insert.as_ref().map_or(0, String::len)), + last_insert, + ) + } else { + Self::Replace(mvt.redo(new), last_insert) + } + } else { + Self::Replace(mvt.redo(new), text.clone()) + } + } + Self::SelfInsert(previous, c) => { + // consecutive char inserts are repeatable not only the last one... + if let Some(text) = wrt.last_insert() { + Self::Insert(repeat_count(previous, new), text) + } else { + Self::SelfInsert(repeat_count(previous, new), c) + } + } + // Cmd::TransposeChars => Cmd::TransposeChars, + Self::ViYankTo(ref mvt) => Self::ViYankTo(mvt.redo(new)), + Self::Yank(previous, anchor) => Self::Yank(repeat_count(previous, new), anchor), + _ => unreachable!(), + } + } +} + +const fn repeat_count(previous: RepeatCount, new: Option) -> RepeatCount { + match new { + Some(n) => n, + None => previous, + } +} + +/// Different word definitions +#[derive(Debug, Clone, Eq, PartialEq, Copy)] +pub enum Word { + /// non-blanks characters + Big, + /// alphanumeric characters + Emacs, + /// alphanumeric (and '_') characters + Vi, +} + +/// Where to move with respect to word boundary +#[derive(Debug, Clone, Eq, PartialEq, Copy)] +pub enum At { + /// Start of word. + Start, + /// Before end of word. + BeforeEnd, + /// After end of word. + AfterEnd, +} + +/// Where to paste (relative to cursor position) +#[derive(Debug, Clone, Eq, PartialEq, Copy)] +pub enum Anchor { + /// After cursor + After, + /// Before cursor + Before, +} + +/// character search +#[derive(Debug, Clone, Eq, PartialEq, Copy)] +pub enum CharSearch { + /// Forward search + Forward(char), + /// Forward search until + ForwardBefore(char), + /// Backward search + Backward(char), + /// Backward search until + BackwardAfter(char), +} + +impl CharSearch { + const fn opposite(self) -> Self { + match self { + Self::Forward(c) => Self::Backward(c), + Self::ForwardBefore(c) => Self::BackwardAfter(c), + Self::Backward(c) => Self::Forward(c), + Self::BackwardAfter(c) => Self::ForwardBefore(c), + } + } +} + +/// Where to move +#[derive(Debug, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum Movement { + /// Whole current line (not really a movement but a range) + WholeLine, + /// beginning-of-line + BeginningOfLine, + /// end-of-line + EndOfLine, + /// backward-word, vi-prev-word + BackwardWord(RepeatCount, Word), // Backward until start of word + /// forward-word, vi-end-word, vi-next-word + ForwardWord(RepeatCount, At, Word), // Forward until start/end of word + /// character-search, character-search-backward, vi-char-search + ViCharSearch(RepeatCount, CharSearch), + /// vi-first-print + ViFirstPrint, + /// backward-char + BackwardChar(RepeatCount), + /// forward-char + ForwardChar(RepeatCount), + /// move to the same column on the previous line + LineUp(RepeatCount), + /// move to the same column on the next line + LineDown(RepeatCount), + /// Whole user input (not really a movement but a range) + WholeBuffer, + /// beginning-of-buffer + BeginningOfBuffer, + /// end-of-buffer + EndOfBuffer, +} + +impl Movement { + // Replay this movement with a possible different `RepeatCount`. + const fn redo(&self, new: Option) -> Self { + match *self { + Self::WholeLine => Self::WholeLine, + Self::BeginningOfLine => Self::BeginningOfLine, + Self::ViFirstPrint => Self::ViFirstPrint, + Self::EndOfLine => Self::EndOfLine, + Self::BackwardWord(previous, word) => { + Self::BackwardWord(repeat_count(previous, new), word) + } + Self::ForwardWord(previous, at, word) => { + Self::ForwardWord(repeat_count(previous, new), at, word) + } + Self::ViCharSearch(previous, char_search) => { + Self::ViCharSearch(repeat_count(previous, new), char_search) + } + Self::BackwardChar(previous) => Self::BackwardChar(repeat_count(previous, new)), + Self::ForwardChar(previous) => Self::ForwardChar(repeat_count(previous, new)), + Self::LineUp(previous) => Self::LineUp(repeat_count(previous, new)), + Self::LineDown(previous) => Self::LineDown(repeat_count(previous, new)), + Self::WholeBuffer => Self::WholeBuffer, + Self::BeginningOfBuffer => Self::BeginningOfBuffer, + Self::EndOfBuffer => Self::EndOfBuffer, + } + } +} + +/// Vi input modes +#[derive(Clone, Copy, Eq, PartialEq)] +pub enum InputMode { + /// Vi Command/Alternate + Command, + /// Insert/Input mode + Insert, + /// Overwrite mode + Replace, +} + +/// Transform key(s) to commands based on current input mode +pub struct InputState<'b> { + pub(crate) mode: EditMode, + #[cfg_attr(not(feature = "custom-bindings"), expect(dead_code))] + custom_bindings: &'b Bindings, + pub(crate) input_mode: InputMode, // vi only ? + // numeric arguments: http://web.mit.edu/gnu/doc/html/rlman_1.html#SEC7 + num_args: i16, + last_cmd: Cmd, // vi only + last_char_search: Option, // vi only +} + +/// Provide indirect mutation to user input. +pub trait Invoke { + /// currently edited line + fn input(&self) -> &str; + // TODO + //fn invoke(&mut self, cmd: Cmd) -> Result; +} + +impl Invoke for &str { + fn input(&self) -> &str { + self + } +} + +pub trait Refresher { + /// Rewrite the currently edited line accordingly to the buffer content, + /// cursor position, and number of columns of the terminal. + fn refresh_line(&mut self) -> Result<()>; + /// Same as [`refresh_line`] with a specific message instead of hint + fn refresh_line_with_msg(&mut self, msg: Option<&str>, kind: CmdKind) -> Result<()>; + /// Same as `refresh_line` but with a dynamic prompt. + fn refresh_prompt_and_line(&mut self, prompt: &str) -> Result<()>; + /// Vi only, switch to insert mode. + fn doing_insert(&mut self); + /// Vi only, switch to command mode. + fn done_inserting(&mut self); + /// Vi only, last text inserted. + fn last_insert(&self) -> Option; + /// Returns `true` if the cursor is currently at the end of the line. + fn is_cursor_at_end(&self) -> bool; + /// Returns `true` if there is a hint displayed. + fn has_hint(&self) -> bool; + /// Returns the hint text that is shown after the current cursor position. + #[cfg_attr(not(feature = "custom-bindings"), expect(dead_code))] + fn hint_text(&self) -> Option<&str>; + /// currently edited line + fn line(&self) -> &str; + /// Current cursor position (byte position) + #[cfg_attr(not(feature = "custom-bindings"), expect(dead_code))] + fn pos(&self) -> usize; + /// Display `msg` above currently edited line. + fn external_print(&mut self, msg: String) -> Result<()>; +} + +impl<'b> InputState<'b> { + pub fn new(config: &Config, custom_bindings: &'b Bindings) -> Self { + Self { + mode: config.edit_mode(), + custom_bindings, + input_mode: InputMode::Insert, + num_args: 0, + last_cmd: Cmd::Noop, + last_char_search: None, + } + } + + pub fn is_emacs_mode(&self) -> bool { + self.mode == EditMode::Emacs + } + + /// Parse user input into one command + /// `single_esc_abort` is used in emacs mode on unix platform when a single + /// esc key is expected to abort current action. + pub fn next_cmd( + &mut self, + rdr: &mut ::Reader, + wrt: &mut dyn Refresher, + single_esc_abort: bool, + ignore_external_print: bool, + ) -> Result { + let single_esc_abort = self.single_esc_abort(single_esc_abort); + let key; + if ignore_external_print { + key = rdr.next_key(single_esc_abort)?; + } else { + loop { + let event = rdr.wait_for_input(single_esc_abort)?; + match event { + tty::Event::KeyPress(k) => { + key = k; + break; + } + tty::Event::ExternalPrint(msg) => { + wrt.external_print(msg)?; + } + } + } + } + match self.mode { + EditMode::Emacs => self.emacs(rdr, wrt, key), + EditMode::Vi if self.input_mode != InputMode::Command => self.vi_insert(rdr, wrt, key), + EditMode::Vi => self.vi_command(rdr, wrt, key), + } + } + + fn single_esc_abort(&self, single_esc_abort: bool) -> bool { + match self.mode { + EditMode::Emacs => single_esc_abort, + EditMode::Vi => false, + } + } + + /// Terminal peculiar binding + fn term_binding(rdr: &R, wrt: &dyn Refresher, key: &KeyEvent) -> Option { + let cmd = rdr.find_binding(key); + if cmd == Some(Cmd::EndOfFile) && !wrt.line().is_empty() { + None // ReadlineError::Eof only if line is empty + } else { + cmd + } + } + + fn emacs_digit_argument( + &mut self, + rdr: &mut R, + wrt: &mut dyn Refresher, + digit: char, + ) -> Result { + #[expect(clippy::cast_possible_truncation)] + match digit { + '0'..='9' => { + self.num_args = digit.to_digit(10).unwrap() as i16; + } + '-' => { + self.num_args = -1; + } + _ => unreachable!(), + } + loop { + wrt.refresh_prompt_and_line(&format!("(arg: {}) ", self.num_args))?; + let key = rdr.next_key(true)?; + #[expect(clippy::cast_possible_truncation)] + match key { + E(K::Char(digit @ '0'..='9'), m) if m == M::NONE || m == M::ALT => { + if self.num_args == -1 { + self.num_args *= digit.to_digit(10).unwrap() as i16; + } else if self.num_args.abs() < 1000 { + // shouldn't ever need more than 4 digits + self.num_args = self + .num_args + .saturating_mul(10) + .saturating_add(digit.to_digit(10).unwrap() as i16); + } + } + E(K::Char('-'), m) if m == M::NONE || m == M::ALT => {} + _ => { + wrt.refresh_line()?; + return Ok(key); + } + }; + } + } + + fn emacs( + &mut self, + rdr: &mut R, + wrt: &mut dyn Refresher, + mut key: KeyEvent, + ) -> Result { + if let E(K::Char(digit @ '-'), M::ALT) = key { + key = self.emacs_digit_argument(rdr, wrt, digit)?; + } else if let E(K::Char(digit @ '0'..='9'), M::ALT) = key { + key = self.emacs_digit_argument(rdr, wrt, digit)?; + } + let (n, positive) = self.emacs_num_args(); // consume them in all cases + + let mut evt = key.into(); + if let Some(cmd) = self.custom_binding(wrt, &evt, n, positive) { + return Ok(if cmd.is_repeatable() { + cmd.redo(Some(n), wrt) + } else { + cmd + }); + } else if let Some(cmd) = InputState::term_binding(rdr, wrt, &key) { + return Ok(cmd); + } + let cmd = match key { + E(K::Char(c), M::NONE) => { + if positive { + Cmd::SelfInsert(n, c) + } else { + Cmd::Unknown + } + } + E(K::Char('A'), M::CTRL) => Cmd::Move(Movement::BeginningOfLine), + E(K::Char('B'), M::CTRL) => Cmd::Move(if positive { + Movement::BackwardChar(n) + } else { + Movement::ForwardChar(n) + }), + E(K::Char('E'), M::CTRL) => Cmd::Move(Movement::EndOfLine), + E(K::Char('F'), M::CTRL) => Cmd::Move(if positive { + Movement::ForwardChar(n) + } else { + Movement::BackwardChar(n) + }), + E(K::Char('G'), M::CTRL | M::CTRL_ALT) | E::ESC => Cmd::Abort, + E(K::Char('H'), M::CTRL) | E::BACKSPACE => Cmd::Kill(if positive { + Movement::BackwardChar(n) + } else { + Movement::ForwardChar(n) + }), + E(K::BackTab, M::NONE) => Cmd::CompleteBackward, + E(K::Char('I'), M::CTRL) | E(K::Tab, M::NONE) => { + if positive { + Cmd::Complete + } else { + Cmd::CompleteBackward + } + } + // Don't complete hints when the cursor is not at the end of a line + E(K::Right, M::NONE) if wrt.has_hint() && wrt.is_cursor_at_end() => Cmd::CompleteHint, + E(K::Char('K'), M::CTRL) => Cmd::Kill(if positive { + Movement::EndOfLine + } else { + Movement::BeginningOfLine + }), + E(K::Char('L'), M::CTRL) => Cmd::ClearScreen, + E(K::Char('N'), M::CTRL) => Cmd::NextHistory, + E(K::Char('P'), M::CTRL) => Cmd::PreviousHistory, + E(K::Char('X'), M::CTRL) => { + if let Some(cmd) = self.custom_seq_binding(rdr, wrt, &mut evt, n, positive)? { + cmd + } else { + let snd_key = match evt { + // we may have already read the second key in custom_seq_binding + #[allow(clippy::out_of_bounds_indexing)] + Event::KeySeq(ref key_seq) if key_seq.len() > 1 => key_seq[1], + _ => rdr.next_key(true)?, + }; + match snd_key { + E(K::Char('G'), M::CTRL) | E::ESC => Cmd::Abort, + E(K::Char('U'), M::CTRL) => Cmd::Undo(n), + E(K::Backspace, M::NONE) => Cmd::Kill(if positive { + Movement::BeginningOfLine + } else { + Movement::EndOfLine + }), + _ => Cmd::Unknown, + } + } + } + // character-search, character-search-backward + E(K::Char(']'), m @ (M::CTRL | M::CTRL_ALT)) => { + let ch = rdr.next_key(false)?; + match ch { + E(K::Char(ch), M::NONE) => Cmd::Move(Movement::ViCharSearch( + n, + if positive { + if m.contains(M::ALT) { + CharSearch::Backward(ch) + } else { + CharSearch::ForwardBefore(ch) + } + } else if m.contains(M::ALT) { + CharSearch::ForwardBefore(ch) + } else { + CharSearch::Backward(ch) + }, + )), + _ => Cmd::Unknown, + } + } + E(K::Backspace, M::ALT) => Cmd::Kill(if positive { + Movement::BackwardWord(n, Word::Emacs) + } else { + Movement::ForwardWord(n, At::AfterEnd, Word::Emacs) + }), + E(K::Char('<'), M::ALT) => Cmd::BeginningOfHistory, + E(K::Char('>'), M::ALT) => Cmd::EndOfHistory, + E(K::Char('B' | 'b') | K::Left, M::ALT) | E(K::Left, M::CTRL) => { + Cmd::Move(if positive { + Movement::BackwardWord(n, Word::Emacs) + } else { + Movement::ForwardWord(n, At::AfterEnd, Word::Emacs) + }) + } + E(K::Char('C' | 'c'), M::ALT) => Cmd::CapitalizeWord, + E(K::Char('D' | 'd'), M::ALT) => Cmd::Kill(if positive { + Movement::ForwardWord(n, At::AfterEnd, Word::Emacs) + } else { + Movement::BackwardWord(n, Word::Emacs) + }), + E(K::Char('F' | 'f') | K::Right, M::ALT) | E(K::Right, M::CTRL) => { + Cmd::Move(if positive { + Movement::ForwardWord(n, At::AfterEnd, Word::Emacs) + } else { + Movement::BackwardWord(n, Word::Emacs) + }) + } + E(K::Char('L' | 'l'), M::ALT) => Cmd::DowncaseWord, + E(K::Char('T' | 't'), M::ALT) => Cmd::TransposeWords(n), + // TODO ESC-R (r): Undo all changes made to this line. + E(K::Char('U' | 'u'), M::ALT) => Cmd::UpcaseWord, + E(K::Char('Y' | 'y'), M::ALT) => Cmd::YankPop, + _ => self.common(rdr, wrt, evt, key, n, positive)?, + }; + debug!(target: "rustyline", "Emacs command: {:?}", cmd); + Ok(cmd) + } + + #[expect(clippy::cast_possible_truncation)] + fn vi_arg_digit( + &mut self, + rdr: &mut R, + wrt: &mut dyn Refresher, + digit: char, + ) -> Result { + self.num_args = digit.to_digit(10).unwrap() as i16; + loop { + wrt.refresh_prompt_and_line(&format!("(arg: {}) ", self.num_args))?; + let key = rdr.next_key(false)?; + if let E(K::Char(digit @ '0'..='9'), M::NONE) = key { + if self.num_args.abs() < 1000 { + // shouldn't ever need more than 4 digits + self.num_args = self + .num_args + .saturating_mul(10) + .saturating_add(digit.to_digit(10).unwrap() as i16); + } + } else { + wrt.refresh_line()?; + return Ok(key); + }; + } + } + + fn vi_command( + &mut self, + rdr: &mut R, + wrt: &mut dyn Refresher, + mut key: KeyEvent, + ) -> Result { + if let E(K::Char(digit @ '1'..='9'), M::NONE) = key { + key = self.vi_arg_digit(rdr, wrt, digit)?; + } + let no_num_args = self.num_args == 0; + let n = self.vi_num_args(); // consume them in all cases + let evt = key.into(); + if let Some(cmd) = self.custom_binding(wrt, &evt, n, true) { + return Ok(if cmd.is_repeatable() { + if no_num_args { + cmd.redo(None, wrt) + } else { + cmd.redo(Some(n), wrt) + } + } else { + cmd + }); + } else if let Some(cmd) = InputState::term_binding(rdr, wrt, &key) { + return Ok(cmd); + } + let cmd = match key { + E(K::Char('$') | K::End, M::NONE) => Cmd::Move(Movement::EndOfLine), + E(K::Char('.'), M::NONE) => { + // vi-redo (repeat last command) + if !self.last_cmd.is_repeatable() { + Cmd::Noop + } else if no_num_args { + self.last_cmd.redo(None, wrt) + } else { + self.last_cmd.redo(Some(n), wrt) + } + } + // TODO E(K::Char('%'), M::NONE) => Cmd::???, Move to the corresponding opening/closing + // bracket + E(K::Char('0'), M::NONE) => Cmd::Move(Movement::BeginningOfLine), + E(K::Char('^'), M::NONE) => Cmd::Move(Movement::ViFirstPrint), + E(K::Char('a'), M::NONE) => { + // vi-append-mode + self.input_mode = InputMode::Insert; + wrt.doing_insert(); + Cmd::Move(Movement::ForwardChar(n)) + } + E(K::Char('A'), M::NONE) => { + // vi-append-eol + self.input_mode = InputMode::Insert; + wrt.doing_insert(); + Cmd::Move(Movement::EndOfLine) + } + E(K::Char('b'), M::NONE) => Cmd::Move(Movement::BackwardWord(n, Word::Vi)), /* vi-prev-word */ + E(K::Char('B'), M::NONE) => Cmd::Move(Movement::BackwardWord(n, Word::Big)), + E(K::Char('c'), M::NONE) => { + self.input_mode = InputMode::Insert; + match self.vi_cmd_motion(rdr, wrt, key, n)? { + Some(mvt) => Cmd::Replace(mvt, None), + None => Cmd::Unknown, + } + } + E(K::Char('C'), M::NONE) => { + self.input_mode = InputMode::Insert; + Cmd::Replace(Movement::EndOfLine, None) + } + E(K::Char('d'), M::NONE) => match self.vi_cmd_motion(rdr, wrt, key, n)? { + Some(mvt) => Cmd::Kill(mvt), + None => Cmd::Unknown, + }, + E(K::Char('D'), M::NONE) | E(K::Char('K'), M::CTRL) => Cmd::Kill(Movement::EndOfLine), + E(K::Char('e'), M::NONE) => { + Cmd::Move(Movement::ForwardWord(n, At::BeforeEnd, Word::Vi)) + } + E(K::Char('E'), M::NONE) => { + Cmd::Move(Movement::ForwardWord(n, At::BeforeEnd, Word::Big)) + } + E(K::Char('i'), M::NONE) => { + // vi-insertion-mode + self.input_mode = InputMode::Insert; + wrt.doing_insert(); + Cmd::Noop + } + E(K::Char('I'), M::NONE) => { + // vi-insert-beg + self.input_mode = InputMode::Insert; + wrt.doing_insert(); + Cmd::Move(Movement::BeginningOfLine) + } + E(K::Char(c), M::NONE) if c == 'f' || c == 'F' || c == 't' || c == 'T' => { + // vi-char-search + let cs = self.vi_char_search(rdr, c)?; + match cs { + Some(cs) => Cmd::Move(Movement::ViCharSearch(n, cs)), + None => Cmd::Unknown, + } + } + E(K::Char(';'), M::NONE) => match self.last_char_search { + Some(cs) => Cmd::Move(Movement::ViCharSearch(n, cs)), + None => Cmd::Noop, + }, + E(K::Char(','), M::NONE) => match self.last_char_search { + Some(ref cs) => Cmd::Move(Movement::ViCharSearch(n, cs.opposite())), + None => Cmd::Noop, + }, + // TODO E(K::Char('G'), M::NONE) => Cmd::???, Move to the history line n + E(K::Char('p'), M::NONE) => Cmd::Yank(n, Anchor::After), // vi-put + E(K::Char('P'), M::NONE) => Cmd::Yank(n, Anchor::Before), // vi-put + E(K::Char('r'), M::NONE) => { + // vi-replace-char: + let ch = rdr.next_key(false)?; + match ch { + E(K::Char(c), M::NONE) => Cmd::ReplaceChar(n, c), + E::ESC => Cmd::Noop, + _ => Cmd::Unknown, + } + } + E(K::Char('R'), M::NONE) => { + // vi-replace-mode (overwrite-mode) + self.input_mode = InputMode::Replace; + Cmd::Replace(Movement::ForwardChar(0), None) + } + E(K::Char('s'), M::NONE) => { + // vi-substitute-char: + self.input_mode = InputMode::Insert; + Cmd::Replace(Movement::ForwardChar(n), None) + } + E(K::Char('S'), M::NONE) => { + // vi-substitute-line: + self.input_mode = InputMode::Insert; + Cmd::Replace(Movement::WholeLine, None) + } + E(K::Char('u'), M::NONE) => Cmd::Undo(n), + // E(K::Char('U'), M::NONE) => Cmd::???, // revert-line + E(K::Char('w'), M::NONE) => Cmd::Move(Movement::ForwardWord(n, At::Start, Word::Vi)), /* vi-next-word */ + E(K::Char('W'), M::NONE) => Cmd::Move(Movement::ForwardWord(n, At::Start, Word::Big)), /* vi-next-word */ + // TODO move backward if eol + E(K::Char('x'), M::NONE) => Cmd::Kill(Movement::ForwardChar(n)), // vi-delete + E(K::Char('X'), M::NONE) => Cmd::Kill(Movement::BackwardChar(n)), // vi-rubout + E(K::Char('y'), M::NONE) => match self.vi_cmd_motion(rdr, wrt, key, n)? { + Some(mvt) => Cmd::ViYankTo(mvt), + None => Cmd::Unknown, + }, + // E(K::Char('Y'), M::NONE) => Cmd::???, // vi-yank-to + E(K::Char('h'), M::NONE) | E(K::Char('H'), M::CTRL) | E::BACKSPACE => { + Cmd::Move(Movement::BackwardChar(n)) + } + E(K::Char('G'), M::CTRL) => Cmd::Abort, + E(K::Char('l' | ' '), M::NONE) => Cmd::Move(Movement::ForwardChar(n)), + E(K::Char('L'), M::CTRL) => Cmd::ClearScreen, + E(K::Char('+' | 'j'), M::NONE) => Cmd::LineDownOrNextHistory(n), + // TODO: move to the start of the line. + E(K::Char('N'), M::CTRL) => Cmd::NextHistory, + E(K::Char('-' | 'k'), M::NONE) => Cmd::LineUpOrPreviousHistory(n), + // TODO: move to the start of the line. + E(K::Char('P'), M::CTRL) => Cmd::PreviousHistory, + E(K::Char('R'), M::CTRL) => { + self.input_mode = InputMode::Insert; // TODO Validate + Cmd::ReverseSearchHistory + } + E(K::Char('S'), M::CTRL) => { + self.input_mode = InputMode::Insert; // TODO Validate + Cmd::ForwardSearchHistory + } + E(K::Char('<'), M::NONE) => match self.vi_cmd_motion(rdr, wrt, key, n)? { + Some(mvt) => Cmd::Dedent(mvt), + None => Cmd::Unknown, + }, + E(K::Char('>'), M::NONE) => match self.vi_cmd_motion(rdr, wrt, key, n)? { + Some(mvt) => Cmd::Indent(mvt), + None => Cmd::Unknown, + }, + E::ESC => Cmd::Noop, + _ => self.common(rdr, wrt, evt, key, n, true)?, + }; + debug!(target: "rustyline", "Vi command: {:?}", cmd); + if cmd.is_repeatable_change() { + self.last_cmd = cmd.clone(); + } + Ok(cmd) + } + + fn vi_insert( + &mut self, + rdr: &mut R, + wrt: &mut dyn Refresher, + key: KeyEvent, + ) -> Result { + let evt = key.into(); + if let Some(cmd) = self.custom_binding(wrt, &evt, 0, true) { + return Ok(if cmd.is_repeatable() { + cmd.redo(None, wrt) + } else { + cmd + }); + } else if let Some(cmd) = InputState::term_binding(rdr, wrt, &key) { + return Ok(cmd); + } + let cmd = match key { + E(K::Char(c), M::NONE) => { + if self.input_mode == InputMode::Replace { + Cmd::Overwrite(c) + } else { + Cmd::SelfInsert(1, c) + } + } + E(K::Char('H'), M::CTRL) | E::BACKSPACE => Cmd::Kill(Movement::BackwardChar(1)), + E(K::BackTab, M::NONE) => Cmd::CompleteBackward, + E(K::Char('I'), M::CTRL) | E(K::Tab, M::NONE) => Cmd::Complete, + // Don't complete hints when the cursor is not at the end of a line + E(K::Right, M::NONE) if wrt.has_hint() && wrt.is_cursor_at_end() => Cmd::CompleteHint, + E(K::Char(k), M::ALT) => { + debug!(target: "rustyline", "Vi fast command mode: {}", k); + self.input_mode = InputMode::Command; + wrt.done_inserting(); + + self.vi_command(rdr, wrt, E(K::Char(k), M::NONE))? + } + E::ESC => { + // vi-movement-mode/vi-command-mode + self.input_mode = InputMode::Command; + wrt.done_inserting(); + Cmd::Move(Movement::BackwardChar(1)) + } + _ => self.common(rdr, wrt, evt, key, 1, true)?, + }; + debug!(target: "rustyline", "Vi insert: {:?}", cmd); + if cmd.is_repeatable_change() { + if let (Cmd::Replace(..), Cmd::SelfInsert(..)) = (&self.last_cmd, &cmd) { + // replacing... + } else if let (Cmd::SelfInsert(..), Cmd::SelfInsert(..)) = (&self.last_cmd, &cmd) { + // inserting... + } else { + self.last_cmd = cmd.clone(); + } + } + Ok(cmd) + } + + fn vi_cmd_motion( + &mut self, + rdr: &mut R, + wrt: &mut dyn Refresher, + key: KeyEvent, + n: RepeatCount, + ) -> Result> { + let mut mvt = rdr.next_key(false)?; + if mvt == key { + return Ok(Some(Movement::WholeLine)); + } + let mut n = n; + if let E(K::Char(digit @ '1'..='9'), M::NONE) = mvt { + // vi-arg-digit + mvt = self.vi_arg_digit(rdr, wrt, digit)?; + n = self.vi_num_args().saturating_mul(n); + } + Ok(match mvt { + E(K::Char('$'), M::NONE) => Some(Movement::EndOfLine), + E(K::Char('0'), M::NONE) => Some(Movement::BeginningOfLine), + E(K::Char('^'), M::NONE) => Some(Movement::ViFirstPrint), + E(K::Char('b'), M::NONE) => Some(Movement::BackwardWord(n, Word::Vi)), + E(K::Char('B'), M::NONE) => Some(Movement::BackwardWord(n, Word::Big)), + E(K::Char('e'), M::NONE) => Some(Movement::ForwardWord(n, At::AfterEnd, Word::Vi)), + E(K::Char('E'), M::NONE) => Some(Movement::ForwardWord(n, At::AfterEnd, Word::Big)), + E(K::Char(c), M::NONE) if c == 'f' || c == 'F' || c == 't' || c == 'T' => { + let cs = self.vi_char_search(rdr, c)?; + cs.map(|cs| Movement::ViCharSearch(n, cs)) + } + E(K::Char(';'), M::NONE) => self + .last_char_search + .map(|cs| Movement::ViCharSearch(n, cs)), + E(K::Char(','), M::NONE) => self + .last_char_search + .map(|cs| Movement::ViCharSearch(n, cs.opposite())), + E(K::Char('h'), M::NONE) | E(K::Char('H'), M::CTRL) | E::BACKSPACE => { + Some(Movement::BackwardChar(n)) + } + E(K::Char('l' | ' '), M::NONE) => Some(Movement::ForwardChar(n)), + E(K::Char('j' | '+'), M::NONE) => Some(Movement::LineDown(n)), + E(K::Char('k' | '-'), M::NONE) => Some(Movement::LineUp(n)), + E(K::Char('w'), M::NONE) => { + // 'cw' is 'ce' + if key == E(K::Char('c'), M::NONE) { + Some(Movement::ForwardWord(n, At::AfterEnd, Word::Vi)) + } else { + Some(Movement::ForwardWord(n, At::Start, Word::Vi)) + } + } + E(K::Char('W'), M::NONE) => { + // 'cW' is 'cE' + if key == E(K::Char('c'), M::NONE) { + Some(Movement::ForwardWord(n, At::AfterEnd, Word::Big)) + } else { + Some(Movement::ForwardWord(n, At::Start, Word::Big)) + } + } + _ => None, + }) + } + + fn vi_char_search( + &mut self, + rdr: &mut R, + cmd: char, + ) -> Result> { + let ch = rdr.next_key(false)?; + Ok(match ch { + E(K::Char(ch), M::NONE) => { + let cs = match cmd { + 'f' => CharSearch::Forward(ch), + 't' => CharSearch::ForwardBefore(ch), + 'F' => CharSearch::Backward(ch), + 'T' => CharSearch::BackwardAfter(ch), + _ => unreachable!(), + }; + self.last_char_search = Some(cs); + Some(cs) + } + _ => None, + }) + } + + fn common( + &mut self, + rdr: &mut R, + wrt: &dyn Refresher, + mut evt: Event, + key: KeyEvent, + n: RepeatCount, + positive: bool, + ) -> Result { + Ok(match key { + E(K::Home, M::NONE) => Cmd::Move(Movement::BeginningOfLine), + E(K::Left, M::NONE) => Cmd::Move(if positive { + Movement::BackwardChar(n) + } else { + Movement::ForwardChar(n) + }), + #[cfg(any(windows, test))] + E(K::Char('C'), M::CTRL) => Cmd::Interrupt, + E(K::Char('D'), M::CTRL) => { + if self.is_emacs_mode() && !wrt.line().is_empty() { + Cmd::Kill(if positive { + Movement::ForwardChar(n) + } else { + Movement::BackwardChar(n) + }) + } else if cfg!(windows) || cfg!(test) || !wrt.line().is_empty() { + Cmd::EndOfFile + } else { + Cmd::Unknown + } + } + E(K::Delete, M::NONE) => Cmd::Kill(if positive { + Movement::ForwardChar(n) + } else { + Movement::BackwardChar(n) + }), + E(K::End, M::NONE) => Cmd::Move(Movement::EndOfLine), + E(K::Right, M::NONE) => Cmd::Move(if positive { + Movement::ForwardChar(n) + } else { + Movement::BackwardChar(n) + }), + E(K::Char('J' | 'M'), M::CTRL) | E::ENTER => Cmd::AcceptOrInsertLine { + accept_in_the_middle: true, + }, + E(K::Down, M::NONE) => Cmd::LineDownOrNextHistory(1), + E(K::Up, M::NONE) => Cmd::LineUpOrPreviousHistory(1), + E(K::Char('R'), M::CTRL) => Cmd::ReverseSearchHistory, + // most terminals override Ctrl+S to suspend execution + E(K::Char('S'), M::CTRL) => Cmd::ForwardSearchHistory, + E(K::Char('T'), M::CTRL) => Cmd::TransposeChars, + E(K::Char('U'), M::CTRL) => Cmd::Kill(if positive { + Movement::BeginningOfLine + } else { + Movement::EndOfLine + }), + // most terminals override Ctrl+Q to resume execution + E(K::Char('Q'), M::CTRL) => Cmd::QuotedInsert, + #[cfg(not(windows))] + E(K::Char('V'), M::CTRL) => Cmd::QuotedInsert, + #[cfg(windows)] + E(K::Char('V'), M::CTRL) => Cmd::PasteFromClipboard, + E(K::Char('W'), M::CTRL) => Cmd::Kill(if positive { + Movement::BackwardWord(n, Word::Big) + } else { + Movement::ForwardWord(n, At::AfterEnd, Word::Big) + }), + E(K::Char('Y'), M::CTRL) => { + if positive { + Cmd::Yank(n, Anchor::Before) + } else { + Cmd::Unknown // TODO Validate + } + } + E(K::Char('_'), M::CTRL) => Cmd::Undo(n), + E(K::UnknownEscSeq, M::NONE) => Cmd::Noop, + E(K::BracketedPasteStart, M::NONE) => { + let paste = rdr.read_pasted_text()?; + Cmd::Insert(1, paste) + } + _ => self + .custom_seq_binding(rdr, wrt, &mut evt, n, positive)? + .unwrap_or(Cmd::Unknown), + }) + } + + fn num_args(&mut self) -> i16 { + let num_args = match self.num_args { + 0 => 1, + _ => self.num_args, + }; + self.num_args = 0; + num_args + } + + #[expect(clippy::cast_sign_loss)] + fn emacs_num_args(&mut self) -> (RepeatCount, bool) { + let num_args = self.num_args(); + if num_args < 0 { + if let (n, false) = num_args.overflowing_abs() { + (n as RepeatCount, false) + } else { + (RepeatCount::MAX, false) + } + } else { + (num_args as RepeatCount, true) + } + } + + fn vi_num_args(&mut self) -> RepeatCount { + let num_args = self.num_args(); + if num_args < 0 { + unreachable!() + } else { + num_args.unsigned_abs() as RepeatCount + } + } +} + +#[cfg(feature = "custom-bindings")] +impl InputState<'_> { + /// Application customized binding + fn custom_binding( + &self, + wrt: &dyn Refresher, + evt: &Event, + n: RepeatCount, + positive: bool, + ) -> Option { + let bindings = self.custom_bindings; + let handler = bindings.get(evt).or_else(|| bindings.get(&Event::Any)); + if let Some(handler) = handler { + match handler { + EventHandler::Simple(cmd) => Some(cmd.clone()), + EventHandler::Conditional(handler) => { + let ctx = EventContext::new(self, wrt); + handler.handle(evt, n, positive, &ctx) + } + } + } else { + None + } + } + + fn custom_seq_binding( + &self, + rdr: &mut R, + wrt: &dyn Refresher, + evt: &mut Event, + n: RepeatCount, + positive: bool, + ) -> Result> { + while let Some(subtrie) = self.custom_bindings.get_raw_descendant(evt) { + let snd_key = rdr.next_key(true)?; + if let Event::KeySeq(ref mut key_seq) = evt { + key_seq.push(snd_key); + } else { + break; + } + let handler = subtrie.get(evt).unwrap(); + if let Some(handler) = handler { + let cmd = match handler { + EventHandler::Simple(cmd) => Some(cmd.clone()), + EventHandler::Conditional(handler) => { + let ctx = EventContext::new(self, wrt); + handler.handle(evt, n, positive, &ctx) + } + }; + if cmd.is_some() { + return Ok(cmd); + } + } + } + Ok(None) + } +} + +#[cfg(not(feature = "custom-bindings"))] +impl<'b> InputState<'b> { + fn custom_binding(&self, _: &dyn Refresher, _: &Event, _: RepeatCount, _: bool) -> Option { + None + } + + fn custom_seq_binding( + &self, + _: &mut R, + _: &dyn Refresher, + _: &mut Event, + _: RepeatCount, + _: bool, + ) -> Result> { + Ok(None) + } +} + +cfg_if::cfg_if! { + if #[cfg(feature = "custom-bindings")] { +pub type Bindings = radix_trie::Trie; + } else { +enum Event { + KeySeq([KeyEvent; 1]), +} +impl From for Event { + fn from(k: KeyEvent) -> Self { + Self::KeySeq([k]) + } +} +pub struct Bindings {} +impl Bindings { + pub fn new() -> Self { + Self {} + } +} + } +} diff --git a/rustyline-15.0.0/src/keys.rs b/rustyline-15.0.0/src/keys.rs new file mode 100644 index 0000000000..7135d385dc --- /dev/null +++ b/rustyline-15.0.0/src/keys.rs @@ -0,0 +1,222 @@ +//! Key constants + +/// Input key pressed and modifiers +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub struct KeyEvent(pub KeyCode, pub Modifiers); + +impl KeyEvent { + /// Constant value representing an unmodified press of `KeyCode::Backspace`. + pub(crate) const BACKSPACE: Self = Self(KeyCode::Backspace, Modifiers::NONE); + /// Constant value representing an unmodified press of `KeyCode::Enter`. + pub(crate) const ENTER: Self = Self(KeyCode::Enter, Modifiers::NONE); + /// Constant value representing an unmodified press of `KeyCode::Esc`. + pub(crate) const ESC: Self = Self(KeyCode::Esc, Modifiers::NONE); + + /// Constructor from `char` and modifiers + #[must_use] + pub fn new(c: char, mut mods: Modifiers) -> Self { + use {KeyCode as K, KeyEvent as E, Modifiers as M}; + + if !c.is_control() { + if !mods.is_empty() { + mods.remove(M::SHIFT); // TODO Validate: no SHIFT even if + // `c` is uppercase + } + return E(K::Char(c), mods); + } + match c { + '\x00' => E(K::Char('@'), mods | M::CTRL), // '\0' + '\x01' => E(K::Char('A'), mods | M::CTRL), + '\x02' => E(K::Char('B'), mods | M::CTRL), + '\x03' => E(K::Char('C'), mods | M::CTRL), + '\x04' => E(K::Char('D'), mods | M::CTRL), + '\x05' => E(K::Char('E'), mods | M::CTRL), + '\x06' => E(K::Char('F'), mods | M::CTRL), + '\x07' => E(K::Char('G'), mods | M::CTRL), // '\a' + #[cfg(unix)] + '\x08' => E(K::Backspace, mods), // '\b' + #[cfg(windows)] + '\x08' => E(K::Char('H'), mods | M::CTRL), + #[cfg(unix)] + '\x09' => { + // '\t' + if mods.contains(M::SHIFT) { + mods.remove(M::SHIFT); + E(K::BackTab, mods) + } else { + E(K::Tab, mods) + } + } + #[cfg(windows)] + '\x09' => E(K::Char('I'), mods | M::CTRL), + '\x0a' => E(K::Char('J'), mods | M::CTRL), // '\n' (10) + '\x0b' => E(K::Char('K'), mods | M::CTRL), + '\x0c' => E(K::Char('L'), mods | M::CTRL), + #[cfg(unix)] + '\x0d' => E(K::Enter, mods), // '\r' (13) + #[cfg(windows)] + '\x0d' => E(K::Char('M'), mods | M::CTRL), + '\x0e' => E(K::Char('N'), mods | M::CTRL), + '\x0f' => E(K::Char('O'), mods | M::CTRL), + '\x10' => E(K::Char('P'), mods | M::CTRL), + '\x11' => E(K::Char('Q'), mods | M::CTRL), + '\x12' => E(K::Char('R'), mods | M::CTRL), + '\x13' => E(K::Char('S'), mods | M::CTRL), + '\x14' => E(K::Char('T'), mods | M::CTRL), + '\x15' => E(K::Char('U'), mods | M::CTRL), + '\x16' => E(K::Char('V'), mods | M::CTRL), + '\x17' => E(K::Char('W'), mods | M::CTRL), + '\x18' => E(K::Char('X'), mods | M::CTRL), + '\x19' => E(K::Char('Y'), mods | M::CTRL), + '\x1a' => E(K::Char('Z'), mods | M::CTRL), + '\x1b' => E(K::Esc, mods), // Ctrl-[, '\e' + '\x1c' => E(K::Char('\\'), mods | M::CTRL), + '\x1d' => E(K::Char(']'), mods | M::CTRL), + '\x1e' => E(K::Char('^'), mods | M::CTRL), + '\x1f' => E(K::Char('_'), mods | M::CTRL), + '\x7f' => E(K::Backspace, mods), // Rubout, Ctrl-? + '\u{9b}' => E(K::Esc, mods | M::SHIFT), + _ => E(K::Null, mods), + } + } + + /// Constructor from `char` with Ctrl modifier + #[must_use] + pub fn ctrl(c: char) -> Self { + Self::new(c, Modifiers::CTRL) + } + + /// Constructor from `char` with Alt modifier + #[must_use] + pub fn alt(c: char) -> Self { + Self::new(c, Modifiers::ALT) + } + + /// ctrl-a => ctrl-A (uppercase) + /// shift-A => A (no SHIFT modifier) + /// shift-Tab => `BackTab` + #[must_use] + pub fn normalize(e: Self) -> Self { + use {KeyCode as K, KeyEvent as E, Modifiers as M}; + + match e { + E(K::Char(c), m) if c.is_ascii_control() => Self::new(c, m), + E(K::Char(c), m) if c.is_ascii_lowercase() && m.contains(M::CTRL) => { + E(K::Char(c.to_ascii_uppercase()), m) + } + E(K::Char(c), m) if c.is_ascii_uppercase() && m.contains(M::SHIFT) => { + E(K::Char(c), m ^ M::SHIFT) + } + E(K::Tab, m) if m.contains(M::SHIFT) => E(K::BackTab, m ^ M::SHIFT), + _ => e, + } + } +} + +impl From for KeyEvent { + fn from(c: char) -> Self { + Self::new(c, Modifiers::NONE) + } +} + +/// Input key pressed +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[non_exhaustive] +pub enum KeyCode { + /// Unsupported escape sequence (on unix platform) + UnknownEscSeq, + /// ⌫ or Ctrl-H + Backspace, + /// ⇤ (usually Shift-Tab) + BackTab, + /// Paste (on unix platform) + BracketedPasteStart, + /// Paste (on unix platform) + BracketedPasteEnd, + /// Single char + Char(char), + /// ⌦ + Delete, + /// ↓ arrow key + Down, + /// ⇲ + End, + /// ↵ or Ctrl-M + Enter, + /// Escape or Ctrl-[ + Esc, + /// Function key + F(u8), + /// ⇱ + Home, + /// Insert key + Insert, + /// ← arrow key + Left, + /// \0 + Null, + /// ⇟ + PageDown, + /// ⇞ + PageUp, + /// → arrow key + Right, + /// ⇥ or Ctrl-I + Tab, + /// ↑ arrow key + Up, +} + +bitflags::bitflags! { + /// The set of modifier keys that were triggered along with a key press. + #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] + pub struct Modifiers: u8 { + /// Control modifier + const CTRL = 1<<3; + /// Escape or Alt modifier + const ALT = 1<<2; + /// Shift modifier + const SHIFT = 1<<1; + + /// No modifier + const NONE = 0; + /// Ctrl + Shift + const CTRL_SHIFT = Self::CTRL.bits() | Self::SHIFT.bits(); + /// Alt + Shift + const ALT_SHIFT = Self::ALT.bits() | Self::SHIFT.bits(); + /// Ctrl + Alt + const CTRL_ALT = Self::CTRL.bits() | Self::ALT.bits(); + /// Ctrl + Alt + Shift + const CTRL_ALT_SHIFT = Self::CTRL.bits() | Self::ALT.bits() | Self::SHIFT.bits(); + } +} + +#[cfg(test)] +mod tests { + use super::{KeyCode as K, KeyEvent as E, Modifiers as M}; + + #[test] + fn new() { + assert_eq!(E::ESC, E::new('\x1b', M::NONE)); + } + + #[test] + #[cfg(unix)] + fn from() { + assert_eq!(E(K::Tab, M::NONE), E::from('\t')); + } + + #[test] + #[cfg(windows)] + fn from() { + assert_eq!(E(K::Char('I'), M::CTRL), E::from('\t')); + } + + #[test] + fn normalize() { + assert_eq!(E::ctrl('A'), E::normalize(E(K::Char('\x01'), M::NONE))); + assert_eq!(E::ctrl('A'), E::normalize(E::ctrl('a'))); + assert_eq!(E::from('A'), E::normalize(E(K::Char('A'), M::SHIFT))); + assert_eq!(E(K::BackTab, M::NONE), E::normalize(E(K::Tab, M::SHIFT))); + } +} diff --git a/rustyline-15.0.0/src/kill_ring.rs b/rustyline-15.0.0/src/kill_ring.rs new file mode 100644 index 0000000000..f04c51ea3c --- /dev/null +++ b/rustyline-15.0.0/src/kill_ring.rs @@ -0,0 +1,230 @@ +//! Kill Ring management +use crate::line_buffer::{DeleteListener, Direction}; + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +enum Action { + Kill, + Yank(usize), + Other, +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Mode { + Append, + Prepend, +} + +pub struct KillRing { + slots: Vec, + // where we are in the kill ring + index: usize, + // whether or not the last command was a kill or a yank + last_action: Action, + killing: bool, +} + +impl KillRing { + /// Create a new kill-ring of the given `size`. + pub fn new(size: usize) -> Self { + Self { + slots: Vec::with_capacity(size), + index: 0, + last_action: Action::Other, + killing: false, + } + } + + /// Reset `last_action` state. + pub fn reset(&mut self) { + self.last_action = Action::Other; + } + + /// Add `text` to the kill-ring. + pub fn kill(&mut self, text: &str, dir: Mode) { + if let Action::Kill = self.last_action { + if self.slots.capacity() == 0 { + // disabled + return; + } + match dir { + Mode::Append => self.slots[self.index].push_str(text), + Mode::Prepend => self.slots[self.index].insert_str(0, text), + }; + } else { + self.last_action = Action::Kill; + if self.slots.capacity() == 0 { + // disabled + return; + } + if self.index == self.slots.capacity() - 1 { + // full + self.index = 0; + } else if !self.slots.is_empty() { + self.index += 1; + } + if self.index == self.slots.len() { + self.slots.push(String::from(text)); + } else { + self.slots[self.index] = String::from(text); + } + } + } + + /// Yank previously killed text. + /// Return `None` when kill-ring is empty. + pub fn yank(&mut self) -> Option<&String> { + if self.slots.is_empty() { + None + } else { + self.last_action = Action::Yank(self.slots[self.index].len()); + Some(&self.slots[self.index]) + } + } + + /// Yank killed text stored in previous slot. + /// Return `None` when the previous command was not a yank. + pub fn yank_pop(&mut self) -> Option<(usize, &String)> { + match self.last_action { + Action::Yank(yank_size) => { + if self.slots.is_empty() { + return None; + } + if self.index == 0 { + self.index = self.slots.len() - 1; + } else { + self.index -= 1; + } + self.last_action = Action::Yank(self.slots[self.index].len()); + Some((yank_size, &self.slots[self.index])) + } + _ => None, + } + } +} + +impl DeleteListener for KillRing { + fn start_killing(&mut self) { + self.killing = true; + } + + fn delete(&mut self, _: usize, string: &str, dir: Direction) { + if !self.killing { + return; + } + let mode = match dir { + Direction::Forward => Mode::Append, + Direction::Backward => Mode::Prepend, + }; + self.kill(string, mode); + } + + fn stop_killing(&mut self) { + self.killing = false; + } +} + +#[cfg(test)] +mod tests { + use super::{Action, KillRing, Mode}; + + #[test] + fn disabled() { + let mut kill_ring = KillRing::new(0); + kill_ring.kill("text", Mode::Append); + assert!(kill_ring.slots.is_empty()); + assert_eq!(0, kill_ring.index); + assert_eq!(Action::Kill, kill_ring.last_action); + + assert_eq!(None, kill_ring.yank()); + assert_eq!(Action::Kill, kill_ring.last_action); + } + + #[test] + fn one_kill() { + let mut kill_ring = KillRing::new(2); + kill_ring.kill("word1", Mode::Append); + assert_eq!(0, kill_ring.index); + assert_eq!(1, kill_ring.slots.len()); + assert_eq!("word1", kill_ring.slots[0]); + assert_eq!(Action::Kill, kill_ring.last_action); + } + + #[test] + fn kill_append() { + let mut kill_ring = KillRing::new(2); + kill_ring.kill("word1", Mode::Append); + kill_ring.kill(" word2", Mode::Append); + assert_eq!(0, kill_ring.index); + assert_eq!(1, kill_ring.slots.len()); + assert_eq!("word1 word2", kill_ring.slots[0]); + assert_eq!(Action::Kill, kill_ring.last_action); + } + + #[test] + fn kill_backward() { + let mut kill_ring = KillRing::new(2); + kill_ring.kill("word1", Mode::Prepend); + kill_ring.kill("word2 ", Mode::Prepend); + assert_eq!(0, kill_ring.index); + assert_eq!(1, kill_ring.slots.len()); + assert_eq!("word2 word1", kill_ring.slots[0]); + assert_eq!(Action::Kill, kill_ring.last_action); + } + + #[test] + fn kill_other_kill() { + let mut kill_ring = KillRing::new(2); + kill_ring.kill("word1", Mode::Append); + kill_ring.reset(); + kill_ring.kill("word2", Mode::Append); + assert_eq!(1, kill_ring.index); + assert_eq!(2, kill_ring.slots.len()); + assert_eq!("word1", kill_ring.slots[0]); + assert_eq!("word2", kill_ring.slots[1]); + assert_eq!(Action::Kill, kill_ring.last_action); + } + + #[test] + fn many_kill() { + let mut kill_ring = KillRing::new(2); + kill_ring.kill("word1", Mode::Append); + kill_ring.reset(); + kill_ring.kill("word2", Mode::Append); + kill_ring.reset(); + kill_ring.kill("word3", Mode::Append); + kill_ring.reset(); + kill_ring.kill("word4", Mode::Append); + assert_eq!(1, kill_ring.index); + assert_eq!(2, kill_ring.slots.len()); + assert_eq!("word3", kill_ring.slots[0]); + assert_eq!("word4", kill_ring.slots[1]); + assert_eq!(Action::Kill, kill_ring.last_action); + } + + #[test] + fn yank() { + let mut kill_ring = KillRing::new(2); + kill_ring.kill("word1", Mode::Append); + kill_ring.reset(); + kill_ring.kill("word2", Mode::Append); + + assert_eq!(Some(&"word2".to_owned()), kill_ring.yank()); + assert_eq!(Action::Yank(5), kill_ring.last_action); + assert_eq!(Some(&"word2".to_owned()), kill_ring.yank()); + assert_eq!(Action::Yank(5), kill_ring.last_action); + } + + #[test] + fn yank_pop() { + let mut kill_ring = KillRing::new(2); + kill_ring.kill("word1", Mode::Append); + kill_ring.reset(); + kill_ring.kill("longword2", Mode::Append); + + assert_eq!(None, kill_ring.yank_pop()); + kill_ring.yank(); + assert_eq!(Some((9, &"word1".to_owned())), kill_ring.yank_pop()); + assert_eq!(Some((5, &"longword2".to_owned())), kill_ring.yank_pop()); + assert_eq!(Some((9, &"word1".to_owned())), kill_ring.yank_pop()); + } +} diff --git a/rustyline-15.0.0/src/layout.rs b/rustyline-15.0.0/src/layout.rs new file mode 100644 index 0000000000..5aa8834fa0 --- /dev/null +++ b/rustyline-15.0.0/src/layout.rs @@ -0,0 +1,33 @@ +use std::cmp::Ordering; + +#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)] +pub struct Position { + pub col: usize, // The leftmost column is number 0. + pub row: usize, // The highest row is number 0. +} + +impl PartialOrd for Position { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} + +impl Ord for Position { + fn cmp(&self, other: &Self) -> Ordering { + match self.row.cmp(&other.row) { + Ordering::Equal => self.col.cmp(&other.col), + o => o, + } + } +} + +#[derive(Debug, Default)] +pub struct Layout { + /// Prompt Unicode/visible width and height + pub prompt_size: Position, + pub default_prompt: bool, + /// Cursor position (relative to the start of the prompt) + pub cursor: Position, + /// Number of rows used so far (from start of prompt to end of input) + pub end: Position, +} diff --git a/rustyline-15.0.0/src/lib.rs b/rustyline-15.0.0/src/lib.rs new file mode 100644 index 0000000000..701565037c --- /dev/null +++ b/rustyline-15.0.0/src/lib.rs @@ -0,0 +1,990 @@ +//! Readline for Rust +//! +//! This implementation is based on [Antirez's +//! Linenoise](https://github.com/antirez/linenoise) +//! +//! # Example +//! +//! Usage +//! +//! ``` +//! let mut rl = rustyline::DefaultEditor::new()?; +//! let readline = rl.readline(">> "); +//! match readline { +//! Ok(line) => println!("Line: {:?}", line), +//! Err(_) => println!("No input"), +//! } +//! # Ok::<(), rustyline::error::ReadlineError>(()) +//! ``` +#![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_cfg))] + +#[cfg(feature = "custom-bindings")] +mod binding; +mod command; +pub mod completion; +pub mod config; +mod edit; +pub mod error; +pub mod highlight; +pub mod hint; +pub mod history; +mod keymap; +mod keys; +mod kill_ring; +mod layout; +pub mod line_buffer; +#[cfg(feature = "with-sqlite-history")] +pub mod sqlite_history; +mod tty; +mod undo; +pub mod validate; + +use std::fmt; +use std::io::{self, BufRead, Write}; +use std::path::Path; +use std::result; + +use log::debug; +#[cfg(feature = "derive")] +#[cfg_attr(docsrs, doc(cfg(feature = "derive")))] +pub use rustyline_derive::{Completer, Helper, Highlighter, Hinter, Validator}; +use unicode_width::UnicodeWidthStr; + +use crate::tty::{Buffer, RawMode, RawReader, Renderer, Term, Terminal}; + +#[cfg(feature = "custom-bindings")] +pub use crate::binding::{ConditionalEventHandler, Event, EventContext, EventHandler}; +use crate::completion::{longest_common_prefix, Candidate, Completer}; +pub use crate::config::{Behavior, ColorMode, CompletionType, Config, EditMode, HistoryDuplicates}; +use crate::edit::State; +use crate::error::ReadlineError; +use crate::highlight::{CmdKind, Highlighter}; +use crate::hint::Hinter; +use crate::history::{DefaultHistory, History, SearchDirection}; +pub use crate::keymap::{Anchor, At, CharSearch, Cmd, InputMode, Movement, RepeatCount, Word}; +use crate::keymap::{Bindings, InputState, Refresher}; +pub use crate::keys::{KeyCode, KeyEvent, Modifiers}; +use crate::kill_ring::KillRing; +pub use crate::tty::ExternalPrinter; +pub use crate::undo::Changeset; +use crate::validate::Validator; + +/// The error type for I/O and Linux Syscalls (Errno) +pub type Result = result::Result; + +/// Completes the line/word +fn complete_line( + rdr: &mut ::Reader, + s: &mut State<'_, '_, H>, + input_state: &mut InputState, + config: &Config, +) -> Result> { + #[cfg(all(unix, feature = "with-fuzzy"))] + use skim::prelude::{ + unbounded, Skim, SkimItem, SkimItemReceiver, SkimItemSender, SkimOptionsBuilder, + }; + + let completer = s.helper.unwrap(); + // get a list of completions + let (start, candidates) = completer.complete(&s.line, s.line.pos(), &s.ctx)?; + // if no completions, we are done + if candidates.is_empty() { + s.out.beep()?; + Ok(None) + } else if CompletionType::Circular == config.completion_type() { + let mark = s.changes.begin(); + // Save the current edited line before overwriting it + let backup = s.line.as_str().to_owned(); + let backup_pos = s.line.pos(); + let mut cmd; + let mut i = 0; + loop { + // Show completion or original buffer + if i < candidates.len() { + let candidate = candidates[i].replacement(); + // TODO we can't highlight the line buffer directly + /*let candidate = if let Some(highlighter) = s.highlighter { + highlighter.highlight_candidate(candidate, CompletionType::Circular) + } else { + Borrowed(candidate) + };*/ + completer.update(&mut s.line, start, candidate, &mut s.changes); + } else { + // Restore current edited line + s.line.update(&backup, backup_pos, &mut s.changes); + } + s.refresh_line()?; + + cmd = s.next_cmd(input_state, rdr, true, true)?; + match cmd { + Cmd::Complete => { + i = (i + 1) % (candidates.len() + 1); // Circular + if i == candidates.len() { + s.out.beep()?; + } + } + Cmd::CompleteBackward => { + if i == 0 { + i = candidates.len(); // Circular + s.out.beep()?; + } else { + i = (i - 1) % (candidates.len() + 1); // Circular + } + } + Cmd::Abort => { + // Re-show original buffer + if i < candidates.len() { + s.line.update(&backup, backup_pos, &mut s.changes); + s.refresh_line()?; + } + s.changes.truncate(mark); + return Ok(None); + } + _ => { + s.changes.end(); + break; + } + } + } + Ok(Some(cmd)) + } else if CompletionType::List == config.completion_type() { + if let Some(lcp) = longest_common_prefix(&candidates) { + // if we can extend the item, extend it + if lcp.len() > s.line.pos() - start || candidates.len() == 1 { + completer.update(&mut s.line, start, lcp, &mut s.changes); + s.refresh_line()?; + } + } + // beep if ambiguous + if candidates.len() > 1 { + s.out.beep()?; + } else { + return Ok(None); + } + // we can't complete any further, wait for second tab + let mut cmd = s.next_cmd(input_state, rdr, true, true)?; + // if any character other than tab, pass it to the main loop + if cmd != Cmd::Complete { + return Ok(Some(cmd)); + } + // move cursor to EOL to avoid overwriting the command line + let save_pos = s.line.pos(); + s.edit_move_end()?; + s.line.set_pos(save_pos); + // we got a second tab, maybe show list of possible completions + let show_completions = if candidates.len() > config.completion_prompt_limit() { + let msg = format!("\nDisplay all {} possibilities? (y or n)", candidates.len()); + s.out.write_and_flush(msg.as_str())?; + s.layout.end.row += 1; + while cmd != Cmd::SelfInsert(1, 'y') + && cmd != Cmd::SelfInsert(1, 'Y') + && cmd != Cmd::SelfInsert(1, 'n') + && cmd != Cmd::SelfInsert(1, 'N') + && cmd != Cmd::Kill(Movement::BackwardChar(1)) + { + cmd = s.next_cmd(input_state, rdr, false, true)?; + } + matches!(cmd, Cmd::SelfInsert(1, 'y' | 'Y')) + } else { + true + }; + if show_completions { + page_completions(rdr, s, input_state, &candidates) + } else { + s.refresh_line()?; + Ok(None) + } + } else { + // if fuzzy feature is enabled and on unix based systems check for the + // corresponding completion_type + #[cfg(all(unix, feature = "with-fuzzy"))] + { + use std::borrow::Cow; + if CompletionType::Fuzzy == config.completion_type() { + struct Candidate { + index: usize, + text: String, + } + impl SkimItem for Candidate { + fn text(&self) -> Cow { + Cow::Borrowed(&self.text) + } + } + + let (tx_item, rx_item): (SkimItemSender, SkimItemReceiver) = unbounded(); + + candidates + .iter() + .enumerate() + .map(|(i, c)| Candidate { + index: i, + text: c.display().to_owned(), + }) + .for_each(|c| { + let _ = tx_item.send(std::sync::Arc::new(c)); + }); + drop(tx_item); // so that skim could know when to stop waiting for more items. + + // setup skim and run with input options + // will display UI for fuzzy search and return selected results + // by default skim multi select is off so only expect one selection + + let options = SkimOptionsBuilder::default() + .prompt(Some("? ")) + .reverse(true) + .build() + .unwrap(); + + let selected_items = Skim::run_with(&options, Some(rx_item)) + .map(|out| out.selected_items) + .unwrap_or_default(); + + // match the first (and only) returned option with the candidate and update the + // line otherwise only refresh line to clear the skim UI changes + if let Some(item) = selected_items.first() { + let item: &Candidate = (*item).as_any() // cast to Any + .downcast_ref::() // downcast to concrete type + .expect("something wrong with downcast"); + if let Some(candidate) = candidates.get(item.index) { + completer.update( + &mut s.line, + start, + candidate.replacement(), + &mut s.changes, + ); + } + } + s.refresh_line()?; + } + }; + Ok(None) + } +} + +/// Completes the current hint +fn complete_hint_line(s: &mut State<'_, '_, H>) -> Result<()> { + let Some(hint) = s.hint.as_ref() else { + return Ok(()); + }; + s.line.move_end(); + if let Some(text) = hint.completion() { + if s.line.yank(text, 1, &mut s.changes).is_none() { + s.out.beep()?; + } + } else { + s.out.beep()?; + } + s.refresh_line() +} + +fn page_completions( + rdr: &mut ::Reader, + s: &mut State<'_, '_, H>, + input_state: &mut InputState, + candidates: &[C], +) -> Result> { + use std::cmp; + + let min_col_pad = 2; + let cols = s.out.get_columns(); + let max_width = cmp::min( + cols, + candidates + .iter() + .map(|s| s.display().width()) + .max() + .unwrap() + + min_col_pad, + ); + let num_cols = cols / max_width; + + let mut pause_row = s.out.get_rows() - 1; + let num_rows = candidates.len().div_ceil(num_cols); + let mut ab = String::new(); + for row in 0..num_rows { + if row == pause_row { + s.out.write_and_flush("\n--More--")?; + let mut cmd = Cmd::Noop; + while cmd != Cmd::SelfInsert(1, 'y') + && cmd != Cmd::SelfInsert(1, 'Y') + && cmd != Cmd::SelfInsert(1, 'n') + && cmd != Cmd::SelfInsert(1, 'N') + && cmd != Cmd::SelfInsert(1, 'q') + && cmd != Cmd::SelfInsert(1, 'Q') + && cmd != Cmd::SelfInsert(1, ' ') + && cmd != Cmd::Kill(Movement::BackwardChar(1)) + && cmd != Cmd::AcceptLine + && cmd != Cmd::Newline + && !matches!(cmd, Cmd::AcceptOrInsertLine { .. }) + { + cmd = s.next_cmd(input_state, rdr, false, true)?; + } + match cmd { + Cmd::SelfInsert(1, 'y' | 'Y' | ' ') => { + pause_row += s.out.get_rows() - 1; + } + Cmd::AcceptLine | Cmd::Newline | Cmd::AcceptOrInsertLine { .. } => { + pause_row += 1; + } + _ => break, + } + } + s.out.write_and_flush("\n")?; + ab.clear(); + for col in 0..num_cols { + let i = (col * num_rows) + row; + if i < candidates.len() { + let candidate = &candidates[i].display(); + let width = candidate.width(); + if let Some(highlighter) = s.highlighter() { + ab.push_str(&highlighter.highlight_candidate(candidate, CompletionType::List)); + } else { + ab.push_str(candidate); + } + if ((col + 1) * num_rows) + row < candidates.len() { + for _ in width..max_width { + ab.push(' '); + } + } + } + } + s.out.write_and_flush(ab.as_str())?; + } + s.out.write_and_flush("\n")?; + s.layout.end.row = 0; // dirty way to make clear_old_rows do nothing + s.layout.cursor.row = 0; + s.refresh_line()?; + Ok(None) +} + +/// Incremental search +fn reverse_incremental_search( + rdr: &mut ::Reader, + s: &mut State<'_, '_, H>, + input_state: &mut InputState, + history: &I, +) -> Result> { + if history.is_empty() { + return Ok(None); + } + let mark = s.changes.begin(); + // Save the current edited line (and cursor position) before overwriting it + let backup = s.line.as_str().to_owned(); + let backup_pos = s.line.pos(); + + let mut search_buf = String::new(); + let mut history_idx = history.len() - 1; + let mut direction = SearchDirection::Reverse; + let mut success = true; + + let mut cmd; + // Display the reverse-i-search prompt and process chars + loop { + let prompt = if success { + format!("(reverse-i-search)`{search_buf}': ") + } else { + format!("(failed reverse-i-search)`{search_buf}': ") + }; + s.refresh_prompt_and_line(&prompt)?; + + cmd = s.next_cmd(input_state, rdr, true, true)?; + if let Cmd::SelfInsert(_, c) = cmd { + search_buf.push(c); + } else { + match cmd { + Cmd::Kill(Movement::BackwardChar(_)) => { + search_buf.pop(); + continue; + } + Cmd::ReverseSearchHistory => { + direction = SearchDirection::Reverse; + if history_idx > 0 { + history_idx -= 1; + } else { + success = false; + continue; + } + } + Cmd::ForwardSearchHistory => { + direction = SearchDirection::Forward; + if history_idx < history.len() - 1 { + history_idx += 1; + } else { + success = false; + continue; + } + } + Cmd::Abort => { + // Restore current edited line (before search) + s.line.update(&backup, backup_pos, &mut s.changes); + s.refresh_line()?; + s.changes.truncate(mark); + return Ok(None); + } + Cmd::Move(_) => { + s.refresh_line()?; // restore prompt + break; + } + _ => break, + } + } + success = match history.search(&search_buf, history_idx, direction)? { + Some(sr) => { + history_idx = sr.idx; + s.line.update(&sr.entry, sr.pos, &mut s.changes); + true + } + _ => false, + }; + } + s.changes.end(); + Ok(Some(cmd)) +} + +struct Guard<'m>(&'m tty::Mode); + +#[expect(unused_must_use)] +impl Drop for Guard<'_> { + fn drop(&mut self) { + let Guard(mode) = *self; + mode.disable_raw_mode(); + } +} + +// Helper to handle backspace characters in a direct input +fn apply_backspace_direct(input: &str) -> String { + // Setup the output buffer + // No '\b' in the input in the common case, so set the capacity to the input + // length + let mut out = String::with_capacity(input.len()); + + // Keep track of the size of each grapheme from the input + // As many graphemes as input bytes in the common case + let mut grapheme_sizes: Vec = Vec::with_capacity(input.len()); + + for g in unicode_segmentation::UnicodeSegmentation::graphemes(input, true) { + if g == "\u{0008}" { + // backspace char + if let Some(n) = grapheme_sizes.pop() { + // Remove the last grapheme + out.truncate(out.len() - n as usize); + } + } else { + out.push_str(g); + grapheme_sizes.push(g.len() as u8); + } + } + + out +} + +fn readline_direct( + mut reader: impl BufRead, + mut writer: impl Write, + validator: &Option, +) -> Result { + let mut input = String::new(); + + loop { + if reader.read_line(&mut input)? == 0 { + return Err(ReadlineError::Eof); + } + // Remove trailing newline + let trailing_n = input.ends_with('\n'); + let trailing_r; + + if trailing_n { + input.pop(); + trailing_r = input.ends_with('\r'); + if trailing_r { + input.pop(); + } + } else { + trailing_r = false; + } + + input = apply_backspace_direct(&input); + + match validator.as_ref() { + None => return Ok(input), + Some(v) => { + let mut ctx = input.as_str(); + let mut ctx = validate::ValidationContext::new(&mut ctx); + + match v.validate(&mut ctx)? { + validate::ValidationResult::Valid(msg) => { + if let Some(msg) = msg { + writer.write_all(msg.as_bytes())?; + } + return Ok(input); + } + validate::ValidationResult::Invalid(Some(msg)) => { + writer.write_all(msg.as_bytes())?; + } + validate::ValidationResult::Incomplete => { + // Add newline and keep on taking input + if trailing_r { + input.push('\r'); + } + if trailing_n { + input.push('\n'); + } + } + _ => {} + } + } + } + } +} + +/// Syntax specific helper. +/// +/// TODO Tokenizer/parser used for both completion, suggestion, highlighting. +/// (parse current line once) +pub trait Helper +where + Self: Completer + Hinter + Highlighter + Validator, +{ +} + +impl Helper for () {} + +/// Completion/suggestion context +pub struct Context<'h> { + history: &'h dyn History, + history_index: usize, +} + +impl<'h> Context<'h> { + /// Constructor. Visible for testing. + #[must_use] + pub fn new(history: &'h dyn History) -> Self { + Self { + history, + history_index: history.len(), + } + } + + /// Return an immutable reference to the history object. + #[must_use] + pub fn history(&self) -> &dyn History { + self.history + } + + /// The history index we are currently editing + #[must_use] + pub fn history_index(&self) -> usize { + self.history_index + } +} + +/// Line editor +#[must_use] +pub struct Editor { + term: Terminal, + buffer: Option, + history: I, + helper: Option, + kill_ring: KillRing, + config: Config, + custom_bindings: Bindings, +} + +/// Default editor with no helper and `DefaultHistory` +pub type DefaultEditor = Editor<(), DefaultHistory>; + +impl Editor { + /// Create an editor with the default configuration + pub fn new() -> Result { + Self::with_config(Config::default()) + } + + /// Create an editor with a specific configuration. + pub fn with_config(config: Config) -> Result { + Self::with_history(config, DefaultHistory::with_config(config)) + } +} + +impl Editor { + /// Create an editor with a custom history impl. + pub fn with_history(config: Config, history: I) -> Result { + let term = Terminal::new( + config.color_mode(), + config.behavior(), + config.tab_stop(), + config.bell_style(), + config.enable_bracketed_paste(), + config.enable_signals(), + )?; + Ok(Self { + term, + buffer: None, + history, + helper: None, + kill_ring: KillRing::new(60), + config, + custom_bindings: Bindings::new(), + }) + } + + /// This method will read a line from STDIN and will display a `prompt`. + /// + /// It uses terminal-style interaction if `stdin` is connected to a + /// terminal. + /// Otherwise (e.g., if `stdin` is a pipe or the terminal is not supported), + /// it uses file-style interaction. + pub fn readline(&mut self, prompt: &str) -> Result { + self.readline_with(prompt, None) + } + + /// This function behaves in the exact same manner as `readline`, except + /// that it pre-populates the input area. + /// + /// The text that resides in the input area is given as a 2-tuple. + /// The string on the left of the tuple is what will appear to the left of + /// the cursor and the string on the right is what will appear to the + /// right of the cursor. + pub fn readline_with_initial(&mut self, prompt: &str, initial: (&str, &str)) -> Result { + self.readline_with(prompt, Some(initial)) + } + + fn readline_with(&mut self, prompt: &str, initial: Option<(&str, &str)>) -> Result { + if self.term.is_unsupported() { + debug!(target: "rustyline", "unsupported terminal"); + // Write prompt and flush it to stdout + let mut stdout = io::stdout(); + stdout.write_all(prompt.as_bytes())?; + stdout.flush()?; + + readline_direct(io::stdin().lock(), io::stderr(), &self.helper) + } else if self.term.is_input_tty() { + let (original_mode, term_key_map) = self.term.enable_raw_mode()?; + let guard = Guard(&original_mode); + let user_input = self.readline_edit(prompt, initial, &original_mode, term_key_map); + if self.config.auto_add_history() { + if let Ok(ref line) = user_input { + self.add_history_entry(line.as_str())?; + } + } + drop(guard); // disable_raw_mode(original_mode)?; + self.term.writeln()?; + user_input + } else { + debug!(target: "rustyline", "stdin is not a tty"); + // Not a tty: read from file / pipe. + readline_direct(io::stdin().lock(), io::stderr(), &self.helper) + } + } + + /// Handles reading and editing the readline buffer. + /// It will also handle special inputs in an appropriate fashion + /// (e.g., C-c will exit readline) + fn readline_edit( + &mut self, + prompt: &str, + initial: Option<(&str, &str)>, + original_mode: &tty::Mode, + term_key_map: tty::KeyMap, + ) -> Result { + let mut stdout = self.term.create_writer(); + + self.kill_ring.reset(); // TODO recreate a new kill ring vs reset + let ctx = Context::new(&self.history); + let mut s = State::new(&mut stdout, prompt, self.helper.as_ref(), ctx); + + let mut input_state = InputState::new(&self.config, &self.custom_bindings); + + if let Some((left, right)) = initial { + s.line.update( + (left.to_owned() + right).as_ref(), + left.len(), + &mut s.changes, + ); + } + + let mut rdr = self + .term + .create_reader(self.buffer.take(), &self.config, term_key_map); + if self.term.is_output_tty() && self.config.check_cursor_position() { + if let Err(e) = s.move_cursor_at_leftmost(&mut rdr) { + if let ReadlineError::WindowResized = e { + s.out.update_size(); + } else { + return Err(e); + } + } + } + s.refresh_line()?; + + loop { + let mut cmd = s.next_cmd(&mut input_state, &mut rdr, false, false)?; + + if cmd.should_reset_kill_ring() { + self.kill_ring.reset(); + } + + // First trigger commands that need extra input + + if cmd == Cmd::Complete && s.helper.is_some() { + let next = complete_line(&mut rdr, &mut s, &mut input_state, &self.config)?; + if let Some(next) = next { + cmd = next; + } else { + continue; + } + } + + if cmd == Cmd::ReverseSearchHistory { + // Search history backward + let next = + reverse_incremental_search(&mut rdr, &mut s, &mut input_state, &self.history)?; + if let Some(next) = next { + cmd = next; + } else { + continue; + } + } + + #[cfg(unix)] + if cmd == Cmd::Suspend { + original_mode.disable_raw_mode()?; + tty::suspend()?; + let _ = self.term.enable_raw_mode()?; // TODO original_mode may have changed + s.out.update_size(); // window may have been resized + s.refresh_line()?; + continue; + } + + #[cfg(unix)] + if cmd == Cmd::QuotedInsert { + // Quoted insert + let c = rdr.next_char()?; + s.edit_insert(c, 1)?; + continue; + } + + #[cfg(windows)] + if cmd == Cmd::PasteFromClipboard { + let clipboard = rdr.read_pasted_text()?; + s.edit_yank(&input_state, &clipboard[..], Anchor::Before, 1)?; + } + + // Tiny test quirk + #[cfg(test)] + if matches!( + cmd, + Cmd::AcceptLine | Cmd::Newline | Cmd::AcceptOrInsertLine { .. } + ) { + self.term.cursor = s.layout.cursor.col; + } + + // Execute things can be done solely on a state object + match command::execute(cmd, &mut s, &input_state, &mut self.kill_ring, &self.config)? { + command::Status::Proceed => continue, + command::Status::Submit => break, + } + } + + // Move to end, in case cursor was in the middle of the line, so that + // next thing application prints goes after the input + s.edit_move_buffer_end(CmdKind::ForcedRefresh)?; + + if cfg!(windows) { + let _ = original_mode; // silent warning + } + self.buffer = rdr.unbuffer(); + Ok(s.line.into_string()) + } + + /// Load the history from the specified file. + pub fn load_history + ?Sized>(&mut self, path: &P) -> Result<()> { + self.history.load(path.as_ref()) + } + + /// Save the history in the specified file. + pub fn save_history + ?Sized>(&mut self, path: &P) -> Result<()> { + self.history.save(path.as_ref()) + } + + /// Append new entries in the specified file. + pub fn append_history + ?Sized>(&mut self, path: &P) -> Result<()> { + self.history.append(path.as_ref()) + } + + /// Add a new entry in the history. + pub fn add_history_entry + Into>(&mut self, line: S) -> Result { + self.history.add(line.as_ref()) + } + + /// Clear history. + pub fn clear_history(&mut self) -> Result<()> { + self.history.clear() + } + + /// Return a mutable reference to the history object. + pub fn history_mut(&mut self) -> &mut I { + &mut self.history + } + + /// Return an immutable reference to the history object. + pub fn history(&self) -> &I { + &self.history + } + + /// Register a callback function to be called for tab-completion + /// or to show hints to the user at the right of the prompt. + pub fn set_helper(&mut self, helper: Option) { + self.helper = helper; + } + + /// Return a mutable reference to the helper. + pub fn helper_mut(&mut self) -> Option<&mut H> { + self.helper.as_mut() + } + + /// Return an immutable reference to the helper. + pub fn helper(&self) -> Option<&H> { + self.helper.as_ref() + } + + /// Bind a sequence to a command. + #[cfg(feature = "custom-bindings")] + #[cfg_attr(docsrs, doc(cfg(feature = "custom-bindings")))] + pub fn bind_sequence, R: Into>( + &mut self, + key_seq: E, + handler: R, + ) -> Option { + self.custom_bindings + .insert(Event::normalize(key_seq.into()), handler.into()) + } + + /// Remove a binding for the given sequence. + #[cfg(feature = "custom-bindings")] + #[cfg_attr(docsrs, doc(cfg(feature = "custom-bindings")))] + pub fn unbind_sequence>(&mut self, key_seq: E) -> Option { + self.custom_bindings + .remove(&Event::normalize(key_seq.into())) + } + + /// Returns an iterator over edited lines. + /// Iterator ends at [EOF](ReadlineError::Eof). + /// ``` + /// let mut rl = rustyline::DefaultEditor::new()?; + /// for readline in rl.iter("> ") { + /// match readline { + /// Ok(line) => { + /// println!("Line: {}", line); + /// } + /// Err(err) => { + /// println!("Error: {:?}", err); + /// break; + /// } + /// } + /// } + /// # Ok::<(), rustyline::error::ReadlineError>(()) + /// ``` + pub fn iter<'a>(&'a mut self, prompt: &'a str) -> impl Iterator> + 'a { + Iter { + editor: self, + prompt, + } + } + + /// If output stream is a tty, this function returns its width and height as + /// a number of characters. + pub fn dimensions(&mut self) -> Option<(usize, usize)> { + if self.term.is_output_tty() { + let out = self.term.create_writer(); + Some((out.get_columns(), out.get_rows())) + } else { + None + } + } + + /// Clear the screen. + pub fn clear_screen(&mut self) -> Result<()> { + if self.term.is_output_tty() { + let mut out = self.term.create_writer(); + out.clear_screen() + } else { + Ok(()) + } + } + + /// Create an external printer + pub fn create_external_printer(&mut self) -> Result<::ExternalPrinter> { + self.term.create_external_printer() + } + + /// Change cursor visibility + pub fn set_cursor_visibility( + &mut self, + visible: bool, + ) -> Result::CursorGuard>> { + self.term.set_cursor_visibility(visible) + } +} + +impl config::Configurer for Editor { + fn config_mut(&mut self) -> &mut Config { + &mut self.config + } + + fn set_max_history_size(&mut self, max_size: usize) -> Result<()> { + self.config_mut().set_max_history_size(max_size); + self.history.set_max_len(max_size) + } + + fn set_history_ignore_dups(&mut self, yes: bool) -> Result<()> { + self.config_mut().set_history_ignore_dups(yes); + self.history.ignore_dups(yes) + } + + fn set_history_ignore_space(&mut self, yes: bool) { + self.config_mut().set_history_ignore_space(yes); + self.history.ignore_space(yes); + } + + fn set_color_mode(&mut self, color_mode: ColorMode) { + self.config_mut().set_color_mode(color_mode); + self.term.color_mode = color_mode; + } +} + +impl fmt::Debug for Editor { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Editor") + .field("term", &self.term) + .field("config", &self.config) + .finish() + } +} + +struct Iter<'a, H: Helper, I: History> { + editor: &'a mut Editor, + prompt: &'a str, +} + +impl Iterator for Iter<'_, H, I> { + type Item = Result; + + fn next(&mut self) -> Option> { + let readline = self.editor.readline(self.prompt); + match readline { + Ok(l) => Some(Ok(l)), + Err(ReadlineError::Eof) => None, + e @ Err(_) => Some(e), + } + } +} + +#[cfg(test)] +#[macro_use] +extern crate assert_matches; +#[cfg(test)] +mod test; + +#[cfg(doctest)] +doc_comment::doctest!("../README.md"); diff --git a/rustyline-15.0.0/src/line_buffer.rs b/rustyline-15.0.0/src/line_buffer.rs new file mode 100644 index 0000000000..3f2dda9a53 --- /dev/null +++ b/rustyline-15.0.0/src/line_buffer.rs @@ -0,0 +1,1869 @@ +//! Line buffer with current cursor position +use crate::keymap::{At, CharSearch, Movement, RepeatCount, Word}; +use std::cmp::min; +use std::fmt; +use std::iter; +use std::ops::{Deref, Index, Range}; +use std::string::Drain; +use unicode_segmentation::UnicodeSegmentation; + +/// Default maximum buffer size for the line read +pub(crate) const MAX_LINE: usize = 4096; +pub(crate) const INDENT: &str = " "; + +/// Word's case change +#[derive(Clone, Copy)] +pub enum WordAction { + /// Capitalize word + Capitalize, + /// lowercase word + Lowercase, + /// uppercase word + Uppercase, +} + +/// Delete (kill) direction +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] +pub enum Direction { + /// After cursor + #[default] + Forward, + /// Before cursor + Backward, +} + +/// Listener to be notified when some text is deleted. +pub trait DeleteListener { + /// used to make the distinction between simple character(s) deletion and + /// word(s)/line(s) deletion + fn start_killing(&mut self) {} + /// `string` deleted at `idx` index + fn delete(&mut self, idx: usize, string: &str, dir: Direction); + /// used to make the distinction between simple character(s) deletion and + /// word(s)/line(s) deletion + fn stop_killing(&mut self) {} +} + +/// Listener to be notified when the line is modified. +pub trait ChangeListener: DeleteListener { + /// `c`har inserted at `idx` index + fn insert_char(&mut self, idx: usize, c: char); + /// `string` inserted at `idx` index + fn insert_str(&mut self, idx: usize, string: &str); + /// `old` text replaced by `new` text at `idx` index + fn replace(&mut self, idx: usize, old: &str, new: &str); +} + +pub(crate) struct NoListener; + +impl DeleteListener for NoListener { + fn delete(&mut self, _idx: usize, _string: &str, _dir: Direction) {} +} +impl ChangeListener for NoListener { + fn insert_char(&mut self, _idx: usize, _c: char) {} + + fn insert_str(&mut self, _idx: usize, _string: &str) {} + + fn replace(&mut self, _idx: usize, _old: &str, _new: &str) {} +} + +// TODO split / cache lines ? + +/// Represent the current input (text and cursor position). +/// +/// The methods do text manipulations or/and cursor movements. +pub struct LineBuffer { + buf: String, // Edited line buffer (rl_line_buffer) + pos: usize, // Current cursor position (byte position) (rl_point) + can_growth: bool, // Whether to allow dynamic growth +} + +impl fmt::Debug for LineBuffer { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("LineBuffer") + .field("buf", &self.buf) + .field("pos", &self.pos) + .finish() + } +} + +impl LineBuffer { + /// Create a new line buffer with the given maximum `capacity`. + #[must_use] + pub fn with_capacity(capacity: usize) -> Self { + Self { + buf: String::with_capacity(capacity), + pos: 0, + can_growth: false, + } + } + + /// Set whether to allow dynamic allocation + pub(crate) fn can_growth(mut self, can_growth: bool) -> Self { + self.can_growth = can_growth; + self + } + + fn must_truncate(&self, new_len: usize) -> bool { + !self.can_growth && new_len > self.buf.capacity() + } + + #[cfg(test)] + pub(crate) fn init(line: &str, pos: usize) -> Self { + let mut lb = Self::with_capacity(MAX_LINE); + assert!(lb.insert_str(0, line, &mut NoListener)); + lb.set_pos(pos); + lb + } + + /// Extracts a string slice containing the entire buffer. + #[must_use] + pub fn as_str(&self) -> &str { + &self.buf + } + + /// Converts a buffer into a `String` without copying or allocating. + #[must_use] + pub fn into_string(self) -> String { + self.buf + } + + /// Current cursor position (byte position) + #[must_use] + pub fn pos(&self) -> usize { + self.pos + } + + /// Set cursor position (byte position) + pub fn set_pos(&mut self, pos: usize) { + assert!(pos <= self.buf.len()); + self.pos = pos; + } + + /// Returns the length of this buffer, in bytes. + #[must_use] + pub fn len(&self) -> usize { + self.buf.len() + } + + /// Returns `true` if this buffer has a length of zero. + #[must_use] + pub fn is_empty(&self) -> bool { + self.buf.is_empty() + } + + /// Set line content (`buf`) and cursor position (`pos`). + pub fn update(&mut self, buf: &str, pos: usize, cl: &mut C) { + assert!(pos <= buf.len()); + let end = self.len(); + self.drain(0..end, Direction::default(), cl); + let max = self.buf.capacity(); + if self.must_truncate(buf.len()) { + self.insert_str(0, &buf[..max], cl); + self.pos = max.min(pos); + } else { + self.insert_str(0, buf, cl); + self.pos = pos; + } + } + + fn end_of_line(&self) -> usize { + if let Some(n) = self.buf[self.pos..].find('\n') { + n + self.pos + } else { + self.buf.len() + } + } + + fn start_of_line(&self) -> usize { + if let Some(i) = self.buf[..self.pos].rfind('\n') { + // `i` is before the new line, e.g. at the end of the previous one. + i + 1 + } else { + 0 + } + } + + /// Returns the character at current cursor position. + pub(crate) fn grapheme_at_cursor(&self) -> Option<&str> { + if self.pos == self.buf.len() { + None + } else { + self.buf[self.pos..].graphemes(true).next() + } + } + + /// Returns the position of the character just after the current cursor + /// position. + #[must_use] + pub fn next_pos(&self, n: RepeatCount) -> Option { + if self.pos == self.buf.len() { + return None; + } + self.buf[self.pos..] + .grapheme_indices(true) + .take(n) + .last() + .map(|(i, s)| i + self.pos + s.len()) + } + + /// Returns the position of the character just before the current cursor + /// position. + fn prev_pos(&self, n: RepeatCount) -> Option { + if self.pos == 0 { + return None; + } + self.buf[..self.pos] + .grapheme_indices(true) + .rev() + .take(n) + .last() + .map(|(i, _)| i) + } + + /// Insert the character `ch` at current cursor position + /// and advance cursor position accordingly. + /// Return `None` when maximum buffer size has been reached, + /// `true` when the character has been appended to the end of the line. + pub fn insert( + &mut self, + ch: char, + n: RepeatCount, + cl: &mut C, + ) -> Option { + let shift = ch.len_utf8() * n; + if self.must_truncate(self.buf.len() + shift) { + return None; + } + let push = self.pos == self.buf.len(); + if n == 1 { + self.buf.insert(self.pos, ch); + cl.insert_char(self.pos, ch); + } else { + let text = iter::repeat(ch).take(n).collect::(); + let pos = self.pos; + self.insert_str(pos, &text, cl); + } + self.pos += shift; + Some(push) + } + + /// Yank/paste `text` at current position. + /// Return `None` when maximum buffer size has been reached or is empty, + /// `true` when the character has been appended to the end of the line. + pub fn yank( + &mut self, + text: &str, + n: RepeatCount, + cl: &mut C, + ) -> Option { + let shift = text.len() * n; + if text.is_empty() || self.must_truncate(self.buf.len() + shift) { + return None; + } + let push = self.pos == self.buf.len(); + let pos = self.pos; + if n == 1 { + self.insert_str(pos, text, cl); + } else { + let text = text.repeat(n); + self.insert_str(pos, &text, cl); + } + self.pos += shift; + Some(push) + } + + /// Delete previously yanked text and yank/paste `text` at current position. + pub fn yank_pop( + &mut self, + yank_size: usize, + text: &str, + cl: &mut C, + ) -> Option { + let end = self.pos; + let start = end - yank_size; + self.drain(start..end, Direction::default(), cl); + self.pos -= yank_size; + self.yank(text, 1, cl) + } + + /// Move cursor on the left. + pub fn move_backward(&mut self, n: RepeatCount) -> bool { + match self.prev_pos(n) { + Some(pos) => { + self.pos = pos; + true + } + None => false, + } + } + + /// Move cursor on the right. + pub fn move_forward(&mut self, n: RepeatCount) -> bool { + match self.next_pos(n) { + Some(pos) => { + self.pos = pos; + true + } + None => false, + } + } + + /// Move cursor to the start of the buffer. + pub fn move_buffer_start(&mut self) -> bool { + if self.pos > 0 { + self.pos = 0; + true + } else { + false + } + } + + /// Move cursor to the end of the buffer. + pub fn move_buffer_end(&mut self) -> bool { + if self.pos == self.buf.len() { + false + } else { + self.pos = self.buf.len(); + true + } + } + + /// Move cursor to the start of the line. + pub fn move_home(&mut self) -> bool { + let start = self.start_of_line(); + if self.pos > start { + self.pos = start; + true + } else { + false + } + } + + /// Move cursor to the end of the line. + pub fn move_end(&mut self) -> bool { + let end = self.end_of_line(); + if self.pos == end { + false + } else { + self.pos = end; + true + } + } + + /// Is cursor at the end of input (whitespaces after cursor is discarded) + #[must_use] + pub fn is_end_of_input(&self) -> bool { + self.pos >= self.buf.trim_end().len() + } + + /// Delete the character at the right of the cursor without altering the + /// cursor position. Basically this is what happens with the "Delete" + /// keyboard key. + /// Return the number of characters deleted. + pub fn delete(&mut self, n: RepeatCount, dl: &mut D) -> Option { + match self.next_pos(n) { + Some(pos) => { + let start = self.pos; + let chars = self + .drain(start..pos, Direction::Forward, dl) + .collect::(); + Some(chars) + } + None => None, + } + } + + /// Delete the character at the left of the cursor. + /// Basically that is what happens with the "Backspace" keyboard key. + pub fn backspace(&mut self, n: RepeatCount, dl: &mut D) -> bool { + match self.prev_pos(n) { + Some(pos) => { + let end = self.pos; + self.drain(pos..end, Direction::Backward, dl); + self.pos = pos; + true + } + None => false, + } + } + + /// Kill the text from point to the end of the line. + pub fn kill_line(&mut self, dl: &mut D) -> bool { + if !self.buf.is_empty() && self.pos < self.buf.len() { + let start = self.pos; + let end = self.end_of_line(); + if start == end { + self.delete(1, dl); + } else { + self.drain(start..end, Direction::Forward, dl); + } + true + } else { + false + } + } + + /// Kill the text from point to the end of the buffer. + pub fn kill_buffer(&mut self, dl: &mut D) -> bool { + if !self.buf.is_empty() && self.pos < self.buf.len() { + let start = self.pos; + let end = self.buf.len(); + self.drain(start..end, Direction::Forward, dl); + true + } else { + false + } + } + + /// Kill backward from point to the beginning of the line. + pub fn discard_line(&mut self, dl: &mut D) -> bool { + if self.pos > 0 && !self.buf.is_empty() { + let start = self.start_of_line(); + let end = self.pos; + if end == start { + self.backspace(1, dl) + } else { + self.drain(start..end, Direction::Backward, dl); + self.pos = start; + true + } + } else { + false + } + } + + /// Kill backward from point to the beginning of the buffer. + pub fn discard_buffer(&mut self, dl: &mut D) -> bool { + if self.pos > 0 && !self.buf.is_empty() { + let end = self.pos; + self.drain(0..end, Direction::Backward, dl); + self.pos = 0; + true + } else { + false + } + } + + /// Exchange the char before cursor with the character at cursor. + pub fn transpose_chars(&mut self, cl: &mut C) -> bool { + if self.pos == 0 || self.buf.graphemes(true).count() < 2 { + return false; + } + if self.pos == self.buf.len() { + self.move_backward(1); + } + let chars = self.delete(1, cl).unwrap(); + self.move_backward(1); + self.yank(&chars, 1, cl); + self.move_forward(1); + true + } + + /// Go left until start of word + fn prev_word_pos(&self, pos: usize, word_def: Word, n: RepeatCount) -> Option { + if pos == 0 { + return None; + } + let mut sow = 0; + let mut gis = self.buf[..pos].grapheme_indices(true).rev(); + 'outer: for _ in 0..n { + sow = 0; + let mut gj = gis.next(); + 'inner: loop { + if let Some((j, y)) = gj { + let gi = gis.next(); + if let Some((_, x)) = gi { + if is_start_of_word(word_def, x, y) { + sow = j; + break 'inner; + } + gj = gi; + } else { + break 'outer; + } + } else { + break 'outer; + } + } + } + Some(sow) + } + + /// Moves the cursor to the beginning of previous word. + pub fn move_to_prev_word(&mut self, word_def: Word, n: RepeatCount) -> bool { + if let Some(pos) = self.prev_word_pos(self.pos, word_def, n) { + self.pos = pos; + true + } else { + false + } + } + + /// Delete the previous word, maintaining the cursor at the start of the + /// current word. + pub fn delete_prev_word( + &mut self, + word_def: Word, + n: RepeatCount, + dl: &mut D, + ) -> bool { + if let Some(pos) = self.prev_word_pos(self.pos, word_def, n) { + let end = self.pos; + self.drain(pos..end, Direction::Backward, dl); + self.pos = pos; + true + } else { + false + } + } + + fn next_word_pos(&self, pos: usize, at: At, word_def: Word, n: RepeatCount) -> Option { + if pos == self.buf.len() { + return None; + } + let mut wp = 0; + let mut gis = self.buf[pos..].grapheme_indices(true); + let mut gi = if at == At::BeforeEnd { + // TODO Validate + gis.next() + } else { + None + }; + 'outer: for _ in 0..n { + wp = 0; + gi = gis.next(); + 'inner: loop { + if let Some((i, x)) = gi { + let gj = gis.next(); + if let Some((j, y)) = gj { + if at == At::Start && is_start_of_word(word_def, x, y) { + wp = j; + break 'inner; + } else if at != At::Start && is_end_of_word(word_def, x, y) { + if word_def == Word::Emacs || at == At::AfterEnd { + wp = j; + } else { + wp = i; + } + break 'inner; + } + gi = gj; + } else { + break 'outer; + } + } else { + break 'outer; + } + } + } + if wp == 0 { + if word_def == Word::Emacs || at == At::AfterEnd { + Some(self.buf.len()) + } else { + match gi { + Some((i, _)) if i != 0 => Some(i + pos), + _ => None, + } + } + } else { + Some(wp + pos) + } + } + + /// Moves the cursor to the end of next word. + pub fn move_to_next_word(&mut self, at: At, word_def: Word, n: RepeatCount) -> bool { + if let Some(pos) = self.next_word_pos(self.pos, at, word_def, n) { + self.pos = pos; + true + } else { + false + } + } + + /// Moves the cursor to the same column in the line above + pub fn move_to_line_up(&mut self, n: RepeatCount) -> bool { + match self.buf[..self.pos].rfind('\n') { + Some(off) => { + let column = self.buf[off + 1..self.pos].graphemes(true).count(); + + let mut dest_start = self.buf[..off].rfind('\n').map_or(0, |n| n + 1); + let mut dest_end = off; + for _ in 1..n { + if dest_start == 0 { + break; + } + dest_end = dest_start - 1; + dest_start = self.buf[..dest_end].rfind('\n').map_or(0, |n| n + 1); + } + let gidx = self.buf[dest_start..dest_end] + .grapheme_indices(true) + .nth(column); + + self.pos = gidx.map_or(off, |(idx, _)| dest_start + idx); // if there's no enough columns + true + } + None => false, + } + } + + /// N lines up starting from the current one + /// + /// Fails if the cursor is on the first line + fn n_lines_up(&self, n: RepeatCount) -> Option<(usize, usize)> { + let mut start = if let Some(off) = self.buf[..self.pos].rfind('\n') { + off + 1 + } else { + return None; + }; + let end = self.buf[self.pos..] + .find('\n') + .map_or_else(|| self.buf.len(), |x| self.pos + x + 1); + for _ in 0..n { + if let Some(off) = self.buf[..start - 1].rfind('\n') { + start = off + 1; + } else { + start = 0; + break; + } + } + Some((start, end)) + } + + /// N lines down starting from the current one + /// + /// Fails if the cursor is on the last line + fn n_lines_down(&self, n: RepeatCount) -> Option<(usize, usize)> { + let mut end = if let Some(off) = self.buf[self.pos..].find('\n') { + self.pos + off + 1 + } else { + return None; + }; + let start = self.buf[..self.pos].rfind('\n').unwrap_or(0); + for _ in 0..n { + if let Some(off) = self.buf[end..].find('\n') { + end = end + off + 1; + } else { + end = self.buf.len(); + break; + }; + } + Some((start, end)) + } + + /// Moves the cursor to the same column in the line above + pub fn move_to_line_down(&mut self, n: RepeatCount) -> bool { + match self.buf[self.pos..].find('\n') { + Some(off) => { + let line_start = self.buf[..self.pos].rfind('\n').map_or(0, |n| n + 1); + let column = self.buf[line_start..self.pos].graphemes(true).count(); + let mut dest_start = self.pos + off + 1; + let mut dest_end = self.buf[dest_start..] + .find('\n') + .map_or_else(|| self.buf.len(), |v| dest_start + v); + for _ in 1..n { + if dest_end == self.buf.len() { + break; + } + dest_start = dest_end + 1; + dest_end = self.buf[dest_start..] + .find('\n') + .map_or_else(|| self.buf.len(), |v| dest_start + v); + } + self.pos = self.buf[dest_start..dest_end] + .grapheme_indices(true) + .nth(column) + .map_or(dest_end, |(idx, _)| dest_start + idx); // if there's no enough columns + debug_assert!(self.pos <= self.buf.len()); + true + } + None => false, + } + } + + fn search_char_pos(&self, cs: CharSearch, n: RepeatCount) -> Option { + let mut shift = 0; + let search_result = match cs { + CharSearch::Backward(c) | CharSearch::BackwardAfter(c) => self.buf[..self.pos] + .char_indices() + .rev() + .filter(|&(_, ch)| ch == c) + .take(n) + .last() + .map(|(i, _)| i), + CharSearch::Forward(c) | CharSearch::ForwardBefore(c) => { + if let Some(cc) = self.grapheme_at_cursor() { + shift = self.pos + cc.len(); + if shift < self.buf.len() { + self.buf[shift..] + .char_indices() + .filter(|&(_, ch)| ch == c) + .take(n) + .last() + .map(|(i, _)| i) + } else { + None + } + } else { + None + } + } + }; + search_result.map(|pos| match cs { + CharSearch::Backward(_) => pos, + CharSearch::BackwardAfter(c) => pos + c.len_utf8(), + CharSearch::Forward(_) => shift + pos, + CharSearch::ForwardBefore(_) => { + shift + pos + - self.buf[..shift + pos] + .chars() + .next_back() + .unwrap() + .len_utf8() + } + }) + } + + /// Move cursor to the matching character position. + /// Return `true` when the search succeeds. + pub fn move_to(&mut self, cs: CharSearch, n: RepeatCount) -> bool { + if let Some(pos) = self.search_char_pos(cs, n) { + self.pos = pos; + true + } else { + false + } + } + + /// Kill from the cursor to the end of the current word, + /// or, if between words, to the end of the next word. + pub fn delete_word( + &mut self, + at: At, + word_def: Word, + n: RepeatCount, + dl: &mut D, + ) -> bool { + if let Some(pos) = self.next_word_pos(self.pos, at, word_def, n) { + let start = self.pos; + self.drain(start..pos, Direction::Forward, dl); + true + } else { + false + } + } + + /// Delete range specified by `cs` search. + pub fn delete_to( + &mut self, + cs: CharSearch, + n: RepeatCount, + dl: &mut D, + ) -> bool { + let search_result = match cs { + CharSearch::ForwardBefore(c) => self.search_char_pos(CharSearch::Forward(c), n), + _ => self.search_char_pos(cs, n), + }; + if let Some(pos) = search_result { + match cs { + CharSearch::Backward(_) | CharSearch::BackwardAfter(_) => { + let end = self.pos; + self.pos = pos; + self.drain(pos..end, Direction::Backward, dl); + } + CharSearch::ForwardBefore(_) => { + let start = self.pos; + self.drain(start..pos, Direction::Forward, dl); + } + CharSearch::Forward(c) => { + let start = self.pos; + self.drain(start..pos + c.len_utf8(), Direction::Forward, dl); + } + }; + true + } else { + false + } + } + + fn skip_whitespace(&self) -> Option { + if self.pos == self.buf.len() { + return None; + } + self.buf[self.pos..] + .grapheme_indices(true) + .find_map(|(i, ch)| { + if ch.chars().all(char::is_alphanumeric) { + Some(i) + } else { + None + } + }) + .map(|i| i + self.pos) + } + + /// Alter the next word. + pub fn edit_word(&mut self, a: WordAction, cl: &mut C) -> bool { + if let Some(start) = self.skip_whitespace() { + if let Some(end) = self.next_word_pos(start, At::AfterEnd, Word::Emacs, 1) { + if start == end { + return false; + } + let word = self + .drain(start..end, Direction::default(), cl) + .collect::(); + let result = match a { + WordAction::Capitalize => { + let ch = word.graphemes(true).next().unwrap(); + let cap = ch.to_uppercase(); + cap + &word[ch.len()..].to_lowercase() + } + WordAction::Lowercase => word.to_lowercase(), + WordAction::Uppercase => word.to_uppercase(), + }; + self.insert_str(start, &result, cl); + self.pos = start + result.len(); + return true; + } + } + false + } + + /// Transpose two words + pub fn transpose_words(&mut self, n: RepeatCount, cl: &mut C) -> bool { + let word_def = Word::Emacs; + self.move_to_next_word(At::AfterEnd, word_def, n); + let w2_end = self.pos; + self.move_to_prev_word(word_def, 1); + let w2_beg = self.pos; + self.move_to_prev_word(word_def, n); + let w1_beg = self.pos; + self.move_to_next_word(At::AfterEnd, word_def, 1); + let w1_end = self.pos; + if w1_beg == w2_beg || w2_beg < w1_end { + return false; + } + + let w1 = self.buf[w1_beg..w1_end].to_owned(); + + let w2 = self + .drain(w2_beg..w2_end, Direction::default(), cl) + .collect::(); + self.insert_str(w2_beg, &w1, cl); + + self.drain(w1_beg..w1_end, Direction::default(), cl); + self.insert_str(w1_beg, &w2, cl); + + self.pos = w2_end; + true + } + + /// Replaces the content between [`start`..`end`] with `text` + /// and positions the cursor to the end of text. + pub fn replace(&mut self, range: Range, text: &str, cl: &mut C) { + let start = range.start; + cl.replace(start, self.buf.index(range.clone()), text); + self.buf.drain(range); + if start == self.buf.len() { + self.buf.push_str(text); + } else { + self.buf.insert_str(start, text); + } + self.pos = start + text.len(); + } + + /// Insert the `s`tring at the specified position. + /// Return `true` if the text has been inserted at the end of the line. + pub fn insert_str(&mut self, idx: usize, s: &str, cl: &mut C) -> bool { + cl.insert_str(idx, s); + if idx == self.buf.len() { + self.buf.push_str(s); + true + } else { + self.buf.insert_str(idx, s); + false + } + } + + /// Remove the specified `range` in the line. + pub fn delete_range(&mut self, range: Range, dl: &mut D) { + self.set_pos(range.start); + self.drain(range, Direction::default(), dl); + } + + fn drain( + &mut self, + range: Range, + dir: Direction, + dl: &mut D, + ) -> Drain<'_> { + dl.delete(range.start, &self.buf[range.start..range.end], dir); + self.buf.drain(range) + } + + /// Return the content between current cursor position and `mvt` position. + /// Return `None` when the buffer is empty or when the movement fails. + #[must_use] + pub fn copy(&self, mvt: &Movement) -> Option { + if self.is_empty() { + return None; + } + match *mvt { + Movement::WholeLine => { + let start = self.start_of_line(); + let end = self.end_of_line(); + if start == end { + None + } else { + Some(self.buf[start..self.pos].to_owned()) + } + } + Movement::BeginningOfLine => { + let start = self.start_of_line(); + if self.pos == start { + None + } else { + Some(self.buf[start..self.pos].to_owned()) + } + } + Movement::ViFirstPrint => { + if self.pos == 0 { + None + } else { + self.next_word_pos(0, At::Start, Word::Big, 1) + .map(|pos| self.buf[pos..self.pos].to_owned()) + } + } + Movement::EndOfLine => { + let end = self.end_of_line(); + if self.pos == end { + None + } else { + Some(self.buf[self.pos..end].to_owned()) + } + } + Movement::EndOfBuffer => { + if self.pos == self.buf.len() { + None + } else { + Some(self.buf[self.pos..].to_owned()) + } + } + Movement::WholeBuffer => { + if self.buf.is_empty() { + None + } else { + Some(self.buf.clone()) + } + } + Movement::BeginningOfBuffer => { + if self.pos == 0 { + None + } else { + Some(self.buf[..self.pos].to_owned()) + } + } + Movement::BackwardWord(n, word_def) => self + .prev_word_pos(self.pos, word_def, n) + .map(|pos| self.buf[pos..self.pos].to_owned()), + Movement::ForwardWord(n, at, word_def) => self + .next_word_pos(self.pos, at, word_def, n) + .map(|pos| self.buf[self.pos..pos].to_owned()), + Movement::ViCharSearch(n, cs) => { + let search_result = match cs { + CharSearch::ForwardBefore(c) => self.search_char_pos(CharSearch::Forward(c), n), + _ => self.search_char_pos(cs, n), + }; + search_result.map(|pos| match cs { + CharSearch::Backward(_) | CharSearch::BackwardAfter(_) => { + self.buf[pos..self.pos].to_owned() + } + CharSearch::ForwardBefore(_) => self.buf[self.pos..pos].to_owned(), + CharSearch::Forward(c) => self.buf[self.pos..pos + c.len_utf8()].to_owned(), + }) + } + Movement::BackwardChar(n) => self + .prev_pos(n) + .map(|pos| self.buf[pos..self.pos].to_owned()), + Movement::ForwardChar(n) => self + .next_pos(n) + .map(|pos| self.buf[self.pos..pos].to_owned()), + Movement::LineUp(n) => { + if let Some((start, end)) = self.n_lines_up(n) { + Some(self.buf[start..end].to_owned()) + } else { + None + } + } + Movement::LineDown(n) => { + if let Some((start, end)) = self.n_lines_down(n) { + Some(self.buf[start..end].to_owned()) + } else { + None + } + } + } + } + + /// Kill range specified by `mvt`. + pub fn kill(&mut self, mvt: &Movement, dl: &mut D) -> bool { + let notify = !matches!(*mvt, Movement::ForwardChar(_) | Movement::BackwardChar(_)); + if notify { + dl.start_killing(); + } + let killed = match *mvt { + Movement::ForwardChar(n) => { + // Delete (forward) `n` characters at point. + self.delete(n, dl).is_some() + } + Movement::BackwardChar(n) => { + // Delete `n` characters backward. + self.backspace(n, dl) + } + Movement::EndOfLine => { + // Kill the text from point to the end of the line. + self.kill_line(dl) + } + Movement::WholeLine => { + self.move_home(); + self.kill_line(dl) + } + Movement::BeginningOfLine => { + // Kill backward from point to the beginning of the line. + self.discard_line(dl) + } + Movement::BackwardWord(n, word_def) => { + // kill `n` words backward (until start of word) + self.delete_prev_word(word_def, n, dl) + } + Movement::ForwardWord(n, at, word_def) => { + // kill `n` words forward (until start/end of word) + self.delete_word(at, word_def, n, dl) + } + Movement::ViCharSearch(n, cs) => self.delete_to(cs, n, dl), + Movement::LineUp(n) => { + if let Some((start, end)) = self.n_lines_up(n) { + self.delete_range(start..end, dl); + true + } else { + false + } + } + Movement::LineDown(n) => { + if let Some((start, end)) = self.n_lines_down(n) { + self.delete_range(start..end, dl); + true + } else { + false + } + } + Movement::ViFirstPrint => { + false // TODO + } + Movement::EndOfBuffer => { + // Kill the text from point to the end of the buffer. + self.kill_buffer(dl) + } + Movement::BeginningOfBuffer => { + // Kill backward from point to the beginning of the buffer. + self.discard_buffer(dl) + } + Movement::WholeBuffer => { + self.move_buffer_start(); + self.kill_buffer(dl) + } + }; + if notify { + dl.stop_killing(); + } + killed + } + + /// Indent range specified by `mvt`. + pub fn indent( + &mut self, + mvt: &Movement, + amount: usize, + dedent: bool, + cl: &mut C, + ) -> bool { + let pair = match *mvt { + // All inline operators are the same: indent current line + Movement::WholeLine + | Movement::BeginningOfLine + | Movement::ViFirstPrint + | Movement::EndOfLine + | Movement::BackwardChar(..) + | Movement::ForwardChar(..) + | Movement::ViCharSearch(..) => Some((self.pos, self.pos)), + Movement::EndOfBuffer => Some((self.pos, self.buf.len())), + Movement::WholeBuffer => Some((0, self.buf.len())), + Movement::BeginningOfBuffer => Some((0, self.pos)), + Movement::BackwardWord(n, word_def) => self + .prev_word_pos(self.pos, word_def, n) + .map(|pos| (pos, self.pos)), + Movement::ForwardWord(n, at, word_def) => self + .next_word_pos(self.pos, at, word_def, n) + .map(|pos| (self.pos, pos)), + Movement::LineUp(n) => self.n_lines_up(n), + Movement::LineDown(n) => self.n_lines_down(n), + }; + let (start, end) = pair.unwrap_or((self.pos, self.pos)); + let start = self.buf[..start].rfind('\n').map_or(0, |pos| pos + 1); + let end = self.buf[end..] + .rfind('\n') + .map_or_else(|| self.buf.len(), |pos| end + pos); + let mut index = start; + if dedent { + #[expect(clippy::unnecessary_to_owned)] + for line in self.buf[start..end].to_string().split('\n') { + let max = line.len() - line.trim_start().len(); + let deleting = min(max, amount); + self.drain(index..index + deleting, Direction::default(), cl); + if self.pos >= index { + if self.pos.saturating_sub(index) < deleting { + // don't wrap into the previous line + self.pos = index; + } else { + self.pos -= deleting; + } + } + index += line.len() + 1 - deleting; + } + } else { + #[expect(clippy::unnecessary_to_owned)] + for line in self.buf[start..end].to_string().split('\n') { + for off in (0..amount).step_by(INDENT.len()) { + self.insert_str(index, &INDENT[..min(amount - off, INDENT.len())], cl); + } + if self.pos >= index { + self.pos += amount; + } + index += amount + line.len() + 1; + } + } + true + } +} + +impl Deref for LineBuffer { + type Target = str; + + fn deref(&self) -> &str { + self.as_str() + } +} + +fn is_start_of_word(word_def: Word, previous: &str, grapheme: &str) -> bool { + (!is_word_char(word_def, previous) && is_word_char(word_def, grapheme)) + || (word_def == Word::Vi && !is_other_char(previous) && is_other_char(grapheme)) +} +fn is_end_of_word(word_def: Word, grapheme: &str, next: &str) -> bool { + (!is_word_char(word_def, next) && is_word_char(word_def, grapheme)) + || (word_def == Word::Vi && !is_other_char(next) && is_other_char(grapheme)) +} + +fn is_word_char(word_def: Word, grapheme: &str) -> bool { + match word_def { + Word::Emacs => grapheme.chars().all(char::is_alphanumeric), + Word::Vi => is_vi_word_char(grapheme), + Word::Big => !grapheme.chars().any(char::is_whitespace), + } +} +fn is_vi_word_char(grapheme: &str) -> bool { + grapheme.chars().all(char::is_alphanumeric) || grapheme == "_" +} +fn is_other_char(grapheme: &str) -> bool { + !(grapheme.chars().any(char::is_whitespace) || is_vi_word_char(grapheme)) +} + +#[cfg(test)] +mod test { + use super::{ + ChangeListener, DeleteListener, Direction, LineBuffer, NoListener, WordAction, MAX_LINE, + }; + use crate::keymap::{At, CharSearch, Word}; + + struct Listener { + deleted_str: Option, + } + + impl Listener { + fn new() -> Self { + Self { deleted_str: None } + } + + fn assert_deleted_str_eq(&self, expected: &str) { + let actual = self.deleted_str.as_ref().expect("no deleted string"); + assert_eq!(expected, actual) + } + } + + impl DeleteListener for Listener { + fn delete(&mut self, _: usize, string: &str, _: Direction) { + self.deleted_str = Some(string.to_owned()); + } + } + impl ChangeListener for Listener { + fn insert_char(&mut self, _: usize, _: char) {} + + fn insert_str(&mut self, _: usize, _: &str) {} + + fn replace(&mut self, _: usize, _: &str, _: &str) {} + } + + #[test] + fn next_pos() { + let s = LineBuffer::init("ö̲g̈", 0); + assert_eq!(7, s.len()); + let pos = s.next_pos(1); + assert_eq!(Some(4), pos); + + let s = LineBuffer::init("ö̲g̈", 4); + let pos = s.next_pos(1); + assert_eq!(Some(7), pos); + } + + #[test] + fn prev_pos() { + let s = LineBuffer::init("ö̲g̈", 4); + assert_eq!(7, s.len()); + let pos = s.prev_pos(1); + assert_eq!(Some(0), pos); + + let s = LineBuffer::init("ö̲g̈", 7); + let pos = s.prev_pos(1); + assert_eq!(Some(4), pos); + } + + #[test] + fn insert() { + let mut s = LineBuffer::with_capacity(MAX_LINE); + let push = s.insert('α', 1, &mut NoListener).unwrap(); + assert_eq!("α", s.buf); + assert_eq!(2, s.pos); + assert!(push); + + let push = s.insert('ß', 1, &mut NoListener).unwrap(); + assert_eq!("αß", s.buf); + assert_eq!(4, s.pos); + assert!(push); + + s.pos = 0; + let push = s.insert('γ', 1, &mut NoListener).unwrap(); + assert_eq!("γαß", s.buf); + assert_eq!(2, s.pos); + assert!(!push); + } + + #[test] + fn yank_after() { + let mut s = LineBuffer::init("αß", 2); + s.move_forward(1); + let ok = s.yank("γδε", 1, &mut NoListener); + assert_eq!(Some(true), ok); + assert_eq!("αßγδε", s.buf); + assert_eq!(10, s.pos); + } + + #[test] + fn yank_before() { + let mut s = LineBuffer::init("αε", 2); + let ok = s.yank("ßγδ", 1, &mut NoListener); + assert_eq!(Some(false), ok); + assert_eq!("αßγδε", s.buf); + assert_eq!(8, s.pos); + } + + #[test] + fn moves() { + let mut s = LineBuffer::init("αß", 4); + let ok = s.move_backward(1); + assert_eq!("αß", s.buf); + assert_eq!(2, s.pos); + assert!(ok); + + let ok = s.move_forward(1); + assert_eq!("αß", s.buf); + assert_eq!(4, s.pos); + assert!(ok); + + let ok = s.move_home(); + assert_eq!("αß", s.buf); + assert_eq!(0, s.pos); + assert!(ok); + + let ok = s.move_end(); + assert_eq!("αß", s.buf); + assert_eq!(4, s.pos); + assert!(ok); + } + + #[test] + fn move_home_end_multiline() { + let text = "αa\nsdf ßc\nasdf"; + let mut s = LineBuffer::init(text, 7); + let ok = s.move_home(); + assert_eq!(text, s.buf); + assert_eq!(4, s.pos); + assert!(ok); + + let ok = s.move_home(); + assert_eq!(text, s.buf); + assert_eq!(4, s.pos); + assert!(!ok); + + let ok = s.move_end(); + assert_eq!(text, s.buf); + assert_eq!(11, s.pos); + assert!(ok); + + let ok = s.move_end(); + assert_eq!(text, s.buf); + assert_eq!(11, s.pos); + assert!(!ok); + } + + #[test] + fn move_buffer_multiline() { + let text = "αa\nsdf ßc\nasdf"; + let mut s = LineBuffer::init(text, 7); + let ok = s.move_buffer_start(); + assert_eq!(text, s.buf); + assert_eq!(0, s.pos); + assert!(ok); + + let ok = s.move_buffer_start(); + assert_eq!(text, s.buf); + assert_eq!(0, s.pos); + assert!(!ok); + + let ok = s.move_buffer_end(); + assert_eq!(text, s.buf); + assert_eq!(text.len(), s.pos); + assert!(ok); + + let ok = s.move_buffer_end(); + assert_eq!(text, s.buf); + assert_eq!(text.len(), s.pos); + assert!(!ok); + } + + #[test] + fn move_grapheme() { + let mut s = LineBuffer::init("ag̈", 4); + assert_eq!(4, s.len()); + let ok = s.move_backward(1); + assert!(ok); + assert_eq!(1, s.pos); + + let ok = s.move_forward(1); + assert!(ok); + assert_eq!(4, s.pos); + } + + #[test] + fn delete() { + let mut cl = Listener::new(); + let mut s = LineBuffer::init("αß", 2); + let chars = s.delete(1, &mut cl); + assert_eq!("α", s.buf); + assert_eq!(2, s.pos); + assert_eq!(Some("ß".to_owned()), chars); + + let ok = s.backspace(1, &mut cl); + assert_eq!("", s.buf); + assert_eq!(0, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("α"); + } + + #[test] + fn kill() { + let mut cl = Listener::new(); + let mut s = LineBuffer::init("αßγδε", 6); + let ok = s.kill_line(&mut cl); + assert_eq!("αßγ", s.buf); + assert_eq!(6, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("δε"); + + s.pos = 4; + let ok = s.discard_line(&mut cl); + assert_eq!("γ", s.buf); + assert_eq!(0, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("αß"); + } + + #[test] + fn kill_multiline() { + let mut cl = Listener::new(); + let mut s = LineBuffer::init("αß\nγδ 12\nε f4", 7); + + let ok = s.kill_line(&mut cl); + assert_eq!("αß\nγ\nε f4", s.buf); + assert_eq!(7, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("δ 12"); + + let ok = s.kill_line(&mut cl); + assert_eq!("αß\nγε f4", s.buf); + assert_eq!(7, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("\n"); + + let ok = s.kill_line(&mut cl); + assert_eq!("αß\nγ", s.buf); + assert_eq!(7, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("ε f4"); + + let ok = s.kill_line(&mut cl); + assert_eq!(7, s.pos); + assert!(!ok); + } + + #[test] + fn discard_multiline() { + let mut cl = Listener::new(); + let mut s = LineBuffer::init("αß\nc γδε", 9); + + let ok = s.discard_line(&mut cl); + assert_eq!("αß\nδε", s.buf); + assert_eq!(5, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("c γ"); + + let ok = s.discard_line(&mut cl); + assert_eq!("αßδε", s.buf); + assert_eq!(4, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("\n"); + + let ok = s.discard_line(&mut cl); + assert_eq!("δε", s.buf); + assert_eq!(0, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("αß"); + + let ok = s.discard_line(&mut cl); + assert_eq!(0, s.pos); + assert!(!ok); + } + + #[test] + fn transpose() { + let mut s = LineBuffer::init("aßc", 1); + let ok = s.transpose_chars(&mut NoListener); + assert_eq!("ßac", s.buf); + assert_eq!(3, s.pos); + assert!(ok); + + s.buf = String::from("aßc"); + s.pos = 3; + let ok = s.transpose_chars(&mut NoListener); + assert_eq!("acß", s.buf); + assert_eq!(4, s.pos); + assert!(ok); + + s.buf = String::from("aßc"); + s.pos = 4; + let ok = s.transpose_chars(&mut NoListener); + assert_eq!("acß", s.buf); + assert_eq!(4, s.pos); + assert!(ok); + } + + #[test] + fn move_to_prev_word() { + let mut s = LineBuffer::init("a ß c", 6); // before 'c' + let ok = s.move_to_prev_word(Word::Emacs, 1); + assert_eq!("a ß c", s.buf); + assert_eq!(2, s.pos); // before 'ß' + assert!(ok); + + assert!(s.move_end()); // after 'c' + assert_eq!(7, s.pos); + let ok = s.move_to_prev_word(Word::Emacs, 1); + assert!(ok); + assert_eq!(6, s.pos); // before 'c' + + let ok = s.move_to_prev_word(Word::Emacs, 2); + assert!(ok); + assert_eq!(0, s.pos); + } + + #[test] + fn move_to_prev_vi_word() { + let mut s = LineBuffer::init("alpha ,beta/rho; mu", 19); + let ok = s.move_to_prev_word(Word::Vi, 1); + assert!(ok); + assert_eq!(17, s.pos); + let ok = s.move_to_prev_word(Word::Vi, 1); + assert!(ok); + assert_eq!(15, s.pos); + let ok = s.move_to_prev_word(Word::Vi, 1); + assert!(ok); + assert_eq!(12, s.pos); + let ok = s.move_to_prev_word(Word::Vi, 1); + assert!(ok); + assert_eq!(11, s.pos); + let ok = s.move_to_prev_word(Word::Vi, 1); + assert!(ok); + assert_eq!(7, s.pos); + let ok = s.move_to_prev_word(Word::Vi, 1); + assert!(ok); + assert_eq!(6, s.pos); + let ok = s.move_to_prev_word(Word::Vi, 1); + assert!(ok); + assert_eq!(0, s.pos); + let ok = s.move_to_prev_word(Word::Vi, 1); + assert!(!ok); + } + + #[test] + fn move_to_prev_big_word() { + let mut s = LineBuffer::init("alpha ,beta/rho; mu", 19); + let ok = s.move_to_prev_word(Word::Big, 1); + assert!(ok); + assert_eq!(17, s.pos); + let ok = s.move_to_prev_word(Word::Big, 1); + assert!(ok); + assert_eq!(6, s.pos); + let ok = s.move_to_prev_word(Word::Big, 1); + assert!(ok); + assert_eq!(0, s.pos); + let ok = s.move_to_prev_word(Word::Big, 1); + assert!(!ok); + } + + #[test] + fn move_to_forward() { + let mut s = LineBuffer::init("αßγδε", 2); + let ok = s.move_to(CharSearch::ForwardBefore('ε'), 1); + assert!(ok); + assert_eq!(6, s.pos); + + let mut s = LineBuffer::init("αßγδε", 2); + let ok = s.move_to(CharSearch::Forward('ε'), 1); + assert!(ok); + assert_eq!(8, s.pos); + + let mut s = LineBuffer::init("αßγδε", 2); + let ok = s.move_to(CharSearch::Forward('ε'), 10); + assert!(ok); + assert_eq!(8, s.pos); + } + + #[test] + fn move_to_backward() { + let mut s = LineBuffer::init("αßγδε", 8); + let ok = s.move_to(CharSearch::BackwardAfter('ß'), 1); + assert!(ok); + assert_eq!(4, s.pos); + + let mut s = LineBuffer::init("αßγδε", 8); + let ok = s.move_to(CharSearch::Backward('ß'), 1); + assert!(ok); + assert_eq!(2, s.pos); + } + + #[test] + fn delete_prev_word() { + let mut cl = Listener::new(); + let mut s = LineBuffer::init("a ß c", 6); + let ok = s.delete_prev_word(Word::Big, 1, &mut cl); + assert_eq!("a c", s.buf); + assert_eq!(2, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("ß "); + } + + #[test] + fn move_to_next_word() { + let mut s = LineBuffer::init("a ß c", 1); // after 'a' + let ok = s.move_to_next_word(At::AfterEnd, Word::Emacs, 1); + assert_eq!("a ß c", s.buf); + assert!(ok); + assert_eq!(4, s.pos); // after 'ß' + + let ok = s.move_to_next_word(At::AfterEnd, Word::Emacs, 1); + assert!(ok); + assert_eq!(7, s.pos); // after 'c' + + s.move_home(); + let ok = s.move_to_next_word(At::AfterEnd, Word::Emacs, 1); + assert!(ok); + assert_eq!(1, s.pos); // after 'a' + + let ok = s.move_to_next_word(At::AfterEnd, Word::Emacs, 2); + assert!(ok); + assert_eq!(7, s.pos); // after 'c' + } + + #[test] + fn move_to_end_of_word() { + let mut s = LineBuffer::init("a ßeta c", 1); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Vi, 1); + assert_eq!("a ßeta c", s.buf); + assert_eq!(6, s.pos); + assert!(ok); + } + + #[test] + fn move_to_end_of_vi_word() { + let mut s = LineBuffer::init("alpha ,beta/rho; mu", 0); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Vi, 1); + assert!(ok); + assert_eq!(4, s.pos); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Vi, 1); + assert!(ok); + assert_eq!(6, s.pos); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Vi, 1); + assert!(ok); + assert_eq!(10, s.pos); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Vi, 1); + assert!(ok); + assert_eq!(11, s.pos); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Vi, 1); + assert!(ok); + assert_eq!(14, s.pos); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Vi, 1); + assert!(ok); + assert_eq!(15, s.pos); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Vi, 1); + assert!(ok); + assert_eq!(18, s.pos); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Vi, 1); + assert!(!ok); + } + + #[test] + fn move_to_end_of_big_word() { + let mut s = LineBuffer::init("alpha ,beta/rho; mu", 0); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Big, 1); + assert!(ok); + assert_eq!(4, s.pos); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Big, 1); + assert!(ok); + assert_eq!(15, s.pos); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Big, 1); + assert!(ok); + assert_eq!(18, s.pos); + let ok = s.move_to_next_word(At::BeforeEnd, Word::Big, 1); + assert!(!ok); + } + + #[test] + fn move_to_start_of_word() { + let mut s = LineBuffer::init("a ß c", 2); + let ok = s.move_to_next_word(At::Start, Word::Emacs, 1); + assert_eq!("a ß c", s.buf); + assert_eq!(6, s.pos); + assert!(ok); + } + + #[test] + fn move_to_start_of_vi_word() { + let mut s = LineBuffer::init("alpha ,beta/rho; mu", 0); + let ok = s.move_to_next_word(At::Start, Word::Vi, 1); + assert!(ok); + assert_eq!(6, s.pos); + let ok = s.move_to_next_word(At::Start, Word::Vi, 1); + assert!(ok); + assert_eq!(7, s.pos); + let ok = s.move_to_next_word(At::Start, Word::Vi, 1); + assert!(ok); + assert_eq!(11, s.pos); + let ok = s.move_to_next_word(At::Start, Word::Vi, 1); + assert!(ok); + assert_eq!(12, s.pos); + let ok = s.move_to_next_word(At::Start, Word::Vi, 1); + assert!(ok); + assert_eq!(15, s.pos); + let ok = s.move_to_next_word(At::Start, Word::Vi, 1); + assert!(ok); + assert_eq!(17, s.pos); + let ok = s.move_to_next_word(At::Start, Word::Vi, 1); + assert!(ok); + assert_eq!(18, s.pos); + let ok = s.move_to_next_word(At::Start, Word::Vi, 1); + assert!(!ok); + } + + #[test] + fn move_to_start_of_big_word() { + let mut s = LineBuffer::init("alpha ,beta/rho; mu", 0); + let ok = s.move_to_next_word(At::Start, Word::Big, 1); + assert!(ok); + assert_eq!(6, s.pos); + let ok = s.move_to_next_word(At::Start, Word::Big, 1); + assert!(ok); + assert_eq!(17, s.pos); + let ok = s.move_to_next_word(At::Start, Word::Big, 1); + assert!(ok); + assert_eq!(18, s.pos); + let ok = s.move_to_next_word(At::Start, Word::Big, 1); + assert!(!ok); + } + + #[test] + fn delete_word() { + let mut cl = Listener::new(); + let mut s = LineBuffer::init("a ß c", 1); + let ok = s.delete_word(At::AfterEnd, Word::Emacs, 1, &mut cl); + assert_eq!("a c", s.buf); + assert_eq!(1, s.pos); + assert!(ok); + cl.assert_deleted_str_eq(" ß"); + + let mut s = LineBuffer::init("test", 0); + let ok = s.delete_word(At::AfterEnd, Word::Vi, 1, &mut cl); + assert_eq!("", s.buf); + assert_eq!(0, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("test"); + } + + #[test] + fn delete_til_start_of_word() { + let mut cl = Listener::new(); + let mut s = LineBuffer::init("a ß c", 2); + let ok = s.delete_word(At::Start, Word::Emacs, 1, &mut cl); + assert_eq!("a c", s.buf); + assert_eq!(2, s.pos); + assert!(ok); + cl.assert_deleted_str_eq("ß "); + } + + #[test] + fn delete_to_forward() { + let mut cl = Listener::new(); + let mut s = LineBuffer::init("αßγδε", 2); + let ok = s.delete_to(CharSearch::ForwardBefore('ε'), 1, &mut cl); + assert!(ok); + cl.assert_deleted_str_eq("ßγδ"); + assert_eq!("αε", s.buf); + assert_eq!(2, s.pos); + + let mut s = LineBuffer::init("αßγδε", 2); + let ok = s.delete_to(CharSearch::Forward('ε'), 1, &mut cl); + assert!(ok); + cl.assert_deleted_str_eq("ßγδε"); + assert_eq!("α", s.buf); + assert_eq!(2, s.pos); + } + + #[test] + fn delete_to_backward() { + let mut cl = Listener::new(); + let mut s = LineBuffer::init("αßγδε", 8); + let ok = s.delete_to(CharSearch::BackwardAfter('α'), 1, &mut cl); + assert!(ok); + cl.assert_deleted_str_eq("ßγδ"); + assert_eq!("αε", s.buf); + assert_eq!(2, s.pos); + + let mut s = LineBuffer::init("αßγδε", 8); + let ok = s.delete_to(CharSearch::Backward('ß'), 1, &mut cl); + assert!(ok); + cl.assert_deleted_str_eq("ßγδ"); + assert_eq!("αε", s.buf); + assert_eq!(2, s.pos); + } + + #[test] + fn edit_word() { + let mut s = LineBuffer::init("a ßeta c", 1); + assert!(s.edit_word(WordAction::Uppercase, &mut NoListener)); + assert_eq!("a SSETA c", s.buf); + assert_eq!(7, s.pos); + + let mut s = LineBuffer::init("a ßetA c", 1); + assert!(s.edit_word(WordAction::Lowercase, &mut NoListener)); + assert_eq!("a ßeta c", s.buf); + assert_eq!(7, s.pos); + + let mut s = LineBuffer::init("a ßETA c", 1); + assert!(s.edit_word(WordAction::Capitalize, &mut NoListener)); + assert_eq!("a SSeta c", s.buf); + assert_eq!(7, s.pos); + + let mut s = LineBuffer::init("test", 1); + assert!(s.edit_word(WordAction::Capitalize, &mut NoListener)); + assert_eq!("tEst", s.buf); + assert_eq!(4, s.pos); + } + + #[test] + fn transpose_words() { + let mut s = LineBuffer::init("ßeta / δelta__", 15); + assert!(s.transpose_words(1, &mut NoListener)); + assert_eq!("δelta__ / ßeta", s.buf); + assert_eq!(16, s.pos); + + let mut s = LineBuffer::init("ßeta / δelta", 14); + assert!(s.transpose_words(1, &mut NoListener)); + assert_eq!("δelta / ßeta", s.buf); + assert_eq!(14, s.pos); + + let mut s = LineBuffer::init(" / δelta", 8); + assert!(!s.transpose_words(1, &mut NoListener)); + + let mut s = LineBuffer::init("ßeta / __", 9); + assert!(!s.transpose_words(1, &mut NoListener)); + } + + #[test] + fn move_by_line() { + let text = "aa123\nsdf bc\nasdf"; + let mut s = LineBuffer::init(text, 14); + // move up + let ok = s.move_to_line_up(1); + assert_eq!(7, s.pos); + assert!(ok); + + let ok = s.move_to_line_up(1); + assert_eq!(1, s.pos); + assert!(ok); + + let ok = s.move_to_line_up(1); + assert_eq!(1, s.pos); + assert!(!ok); + + // move down + let ok = s.move_to_line_down(1); + assert_eq!(7, s.pos); + assert!(ok); + + let ok = s.move_to_line_down(1); + assert_eq!(14, s.pos); + assert!(ok); + + let ok = s.move_to_line_down(1); + assert_eq!(14, s.pos); + assert!(!ok); + + // move by multiple steps + let ok = s.move_to_line_up(2); + assert_eq!(1, s.pos); + assert!(ok); + + let ok = s.move_to_line_down(2); + assert_eq!(14, s.pos); + assert!(ok); + } + + #[test] + fn test_send() { + fn assert_send() {} + assert_send::(); + } + + #[test] + fn test_sync() { + fn assert_sync() {} + assert_sync::(); + } +} diff --git a/rustyline-15.0.0/src/sqlite_history.rs b/rustyline-15.0.0/src/sqlite_history.rs new file mode 100644 index 0000000000..867f5b7d50 --- /dev/null +++ b/rustyline-15.0.0/src/sqlite_history.rs @@ -0,0 +1,679 @@ +//! History impl. based on SQLite +use std::borrow::Cow; +use std::cell::Cell; +use std::path::{Path, PathBuf}; + +use rusqlite::{Connection, DatabaseName, OptionalExtension}; + +use crate::history::SearchResult; +use crate::{Config, History, HistoryDuplicates, ReadlineError, Result, SearchDirection}; + +/// History stored in an SQLite database. +pub struct SQLiteHistory { + max_len: usize, + ignore_space: bool, + ignore_dups: bool, + path: Option, // None => memory + conn: Connection, /* we need to keep a connection opened at least for in memory + * database and also for cached statement(s) */ + session_id: usize, // 0 means no new entry added + row_id: Cell, // max entry id +} + +/* +https://sqlite.org/autoinc.html +If no ROWID is specified on the insert, or if the specified ROWID has a value of NULL, then an appropriate ROWID is created automatically. +The usual algorithm is to give the newly created row a ROWID that is one larger than the largest ROWID in the table prior to the insert. +If the table is initially empty, then a ROWID of 1 is used. +If the largest ROWID is equal to the largest possible integer (9223372036854775807) then the database engine starts picking positive candidate ROWIDs +at random until it finds one that is not previously used. +https://sqlite.org/lang_vacuum.html +The VACUUM command may change the ROWIDs of entries in any tables that do not have an explicit INTEGER PRIMARY KEY. + */ + +impl SQLiteHistory { + /// Transient in-memory database + pub fn with_config(config: Config) -> Result + where + Self: Sized, + { + Self::new(config, None) + } + + /// Open specified database + pub fn open + ?Sized>(config: Config, path: &P) -> Result { + Self::new(config, normalize(path.as_ref())) + } + + fn new(config: Config, path: Option) -> Result { + let conn = conn(path.as_ref())?; + let mut sh = Self { + max_len: config.max_history_size(), + ignore_space: config.history_ignore_space(), + // not strictly consecutive... + ignore_dups: config.history_duplicates() == HistoryDuplicates::IgnoreConsecutive, + path, + conn, + session_id: 0, + row_id: Cell::new(0), + }; + sh.check_schema()?; + Ok(sh) + } + + fn is_mem_or_temp(&self) -> bool { + match self.path { + None => true, + Some(ref p) => is_mem_or_temp(p), + } + } + + fn reset(&mut self, path: &Path) -> Result { + self.path = normalize(path); + self.session_id = 0; + self.row_id.set(0); + Ok(std::mem::replace(&mut self.conn, conn(self.path.as_ref())?)) + } + + fn update_row_id(&mut self) -> Result<()> { + self.row_id.set(self.conn.query_row( + "SELECT ifnull(max(rowid), 0) FROM history;", + [], + |r| r.get(0), + )?); + Ok(()) + } + + fn check_schema(&mut self) -> Result<()> { + let user_version: i32 = self + .conn + .pragma_query_value(None, "user_version", |r| r.get(0))?; + if user_version <= 0 { + self.conn.execute_batch( + " +BEGIN EXCLUSIVE; +PRAGMA auto_vacuum = INCREMENTAL; +CREATE TABLE session ( + id INTEGER PRIMARY KEY NOT NULL, + timestamp REAL NOT NULL DEFAULT (julianday('now')) +) STRICT; -- user, host, pid +CREATE TABLE history ( + --id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, + session_id INTEGER NOT NULL, + entry TEXT NOT NULL, + timestamp REAL NOT NULL DEFAULT (julianday('now')), + FOREIGN KEY (session_id) REFERENCES session(id) ON DELETE CASCADE +) STRICT; +CREATE VIRTUAL TABLE fts USING fts4(content=history, entry); +CREATE TRIGGER history_bu BEFORE UPDATE ON history BEGIN + DELETE FROM fts WHERE docid=old.rowid; +END; +CREATE TRIGGER history_bd BEFORE DELETE ON history BEGIN + DELETE FROM fts WHERE docid=old.rowid; +END; +CREATE TRIGGER history_au AFTER UPDATE ON history BEGIN + INSERT INTO fts (docid, entry) VALUES (new.rowid, new.entry); +END; +CREATE TRIGGER history_ai AFTER INSERT ON history BEGIN + INSERT INTO fts (docid, entry) VALUES(new.rowid, new.entry); +END; +PRAGMA user_version = 1; +COMMIT; + ", + )? + } + self.conn.pragma_update(None, "foreign_keys", 1)?; + if self.ignore_dups || user_version > 0 { + self.set_ignore_dups()?; + } + if self.row_id.get() == 0 && user_version > 0 { + self.update_row_id()?; + } + Ok(()) + } + + fn set_ignore_dups(&mut self) -> Result<()> { + if self.ignore_dups { + // TODO Validate: ignore dups only in the same session_id ? + self.conn.execute_batch( + "CREATE UNIQUE INDEX IF NOT EXISTS ignore_dups ON history(entry, session_id);", + )?; + } else { + self.conn + .execute_batch("DROP INDEX IF EXISTS ignore_dups;")?; + } + Ok(()) + } + + fn create_session(&mut self) -> Result<()> { + if self.session_id == 0 { + self.check_schema()?; + self.session_id = self.conn.query_row( + "INSERT INTO session (id) VALUES (NULL) RETURNING id;", + [], + |r| r.get(0), + )?; + } + Ok(()) + } + + fn ignore(&self, line: &str) -> bool { + if self.max_len == 0 { + return true; + } + if line.is_empty() + || (self.ignore_space && line.chars().next().map_or(true, char::is_whitespace)) + { + return true; + } + // ignore_dups => SQLITE_CONSTRAINT_UNIQUE + false + } + + fn add_entry(&mut self, line: &str) -> Result { + // ignore SQLITE_CONSTRAINT_UNIQUE + let mut stmt = self.conn.prepare_cached( + "INSERT OR REPLACE INTO history (session_id, entry) VALUES (?1, ?2) RETURNING rowid;", + )?; + if let Some(row_id) = stmt + .query_row((self.session_id, line), |r| r.get(0)) + .optional()? + { + self.row_id.set(row_id); + Ok(true) + } else { + Ok(false) + } + } + + fn search_match( + &self, + term: &str, + start: usize, + dir: SearchDirection, + start_with: bool, + ) -> Result> { + if term.is_empty() || start >= self.len() { + return Ok(None); + } + let start = start + 1; // first rowid is 1 + let query = match (dir, start_with) { + (SearchDirection::Forward, true) => { + "SELECT docid, entry FROM fts WHERE entry MATCH '^' || ?1 || '*' AND docid >= ?2 \ + ORDER BY docid ASC LIMIT 1;" + } + (SearchDirection::Forward, false) => { + "SELECT docid, entry, offsets(fts) FROM fts WHERE entry MATCH ?1 || '*' AND docid \ + >= ?2 ORDER BY docid ASC LIMIT 1;" + } + (SearchDirection::Reverse, true) => { + "SELECT docid, entry FROM fts WHERE entry MATCH '^' || ?1 || '*' AND docid <= ?2 \ + ORDER BY docid DESC LIMIT 1;" + } + (SearchDirection::Reverse, false) => { + "SELECT docid, entry, offsets(fts) FROM fts WHERE entry MATCH ?1 || '*' AND docid \ + <= ?2 ORDER BY docid DESC LIMIT 1;" + } + }; + let mut stmt = self.conn.prepare_cached(query)?; + stmt.query_row((term, start), |r| { + let rowid = r.get::<_, usize>(0)?; + if rowid > self.row_id.get() { + self.row_id.set(rowid); + } + Ok(SearchResult { + entry: Cow::Owned(r.get(1)?), + idx: rowid - 1, // rowid - 1 + pos: if start_with { + term.len() + } else { + offset(r.get(2)?) + }, + }) + }) + .optional() + .map_err(ReadlineError::from) + } +} + +impl History for SQLiteHistory { + /// rowid <> index + fn get(&self, index: usize, dir: SearchDirection) -> Result> { + let rowid = index + 1; // first rowid is 1 + if self.is_empty() { + return Ok(None); + } + // rowid may not be sequential + let query = match dir { + SearchDirection::Forward => { + "SELECT rowid, entry FROM history WHERE rowid >= ?1 ORDER BY rowid ASC LIMIT 1;" + } + SearchDirection::Reverse => { + "SELECT rowid, entry FROM history WHERE rowid <= ?1 ORDER BY rowid DESC LIMIT 1;" + } + }; + let mut stmt = self.conn.prepare_cached(query)?; + stmt.query_row([rowid], |r| { + let rowid = r.get::<_, usize>(0)?; + if rowid > self.row_id.get() { + self.row_id.set(rowid); + } + Ok(SearchResult { + entry: Cow::Owned(r.get(1)?), + idx: rowid - 1, + pos: 0, + }) + }) + .optional() + .map_err(ReadlineError::from) + } + + fn add(&mut self, line: &str) -> Result { + if self.ignore(line) { + return Ok(false); + } + // Do not create a session until the first entry is added. + self.create_session()?; + self.add_entry(line) + } + + fn add_owned(&mut self, line: String) -> Result { + self.add(line.as_str()) + } + + /// This is not really the length + fn len(&self) -> usize { + self.row_id.get() + } + + fn is_empty(&self) -> bool { + self.row_id.get() == 0 + } + + fn set_max_len(&mut self, len: usize) -> Result<()> { + // TODO call this method on save ? before append ? + // FIXME rowid may not be sequential + let count: usize = self + .conn + .query_row("SELECT count(1) FROM history;", [], |r| r.get(0))?; + if count > len { + self.conn.execute( + "DELETE FROM history WHERE rowid IN (SELECT rowid FROM history ORDER BY rowid ASC \ + LIMIT ?1);", + [count - len], + )?; + } + self.max_len = len; + Ok(()) + } + + fn ignore_dups(&mut self, yes: bool) -> Result<()> { + if self.ignore_dups != yes { + self.ignore_dups = yes; + self.set_ignore_dups()?; + } + Ok(()) + } + + fn ignore_space(&mut self, yes: bool) { + self.ignore_space = yes; + } + + fn save(&mut self, path: &Path) -> Result<()> { + if self.session_id == 0 { + // nothing to save + return Ok(()); + } else if is_same(self.path.as_ref(), path) { + if !self.is_mem_or_temp() { + self.conn.execute_batch( + " +PRAGMA optimize; +PRAGMA incremental_vacuum; + ", + )?; + } + } else { + // TODO Validate: backup whole history + self.conn.backup(DatabaseName::Main, path, None)?; + // TODO Validate: keep using original path + } + Ok(()) + } + + fn append(&mut self, path: &Path) -> Result<()> { + if is_same(self.path.as_ref(), path) { + return Ok(()); // no entry in memory + } else if self.session_id == 0 { + self.reset(path)?; + self.check_schema()?; + return Ok(()); // no entry to append + } + let old_id = self.session_id; + { + let old = self.reset(path)?; // keep connection alive in case of in-memory database + self.create_session()?; // TODO preserve session.timestamp + old.execute("ATTACH DATABASE ?1 AS new;", [path.to_string_lossy()])?; // TODO empty path / temporary database + old.execute( + "INSERT OR IGNORE INTO new.history (session_id, entry) SELECT ?1, entry FROM \ + history WHERE session_id = ?2;", + [self.session_id, old_id], + )?; // TODO Validate: only current session entries + old.execute("DETACH DATABASE new;", [])?; + } + self.update_row_id()?; + Ok(()) + } + + fn load(&mut self, path: &Path) -> Result<()> { + #[allow(clippy::if_same_then_else)] + if is_same(self.path.as_ref(), path) { + return Ok(()); + } else if self.path.is_none() { + // TODO check that there is no memory entries (session_id == 0) ? + self.reset(path)?; + self.check_schema()?; + } else if self.path.as_ref().map_or(true, |p| p != path) { + self.reset(path)?; + self.check_schema()?; + } + // Keep all on disk + Ok(()) + } + + fn clear(&mut self) -> Result<()> { + if self.session_id == 0 { + return Ok(()); + } else if self.is_mem_or_temp() { + // ON DELETE CASCADE... + self.conn + .execute("DELETE FROM session WHERE id = ?1;", [self.session_id])?; + self.session_id = 0; + self.update_row_id()?; + } // else nothing in memory, TODO Validate: no delete ? + Ok(()) + } + + fn search( + &self, + term: &str, + start: usize, + dir: SearchDirection, + ) -> Result> { + self.search_match(term, start, dir, false) + } + + fn starts_with( + &self, + term: &str, + start: usize, + dir: SearchDirection, + ) -> Result> { + self.search_match(term, start, dir, true) + } +} + +fn conn(path: Option<&PathBuf>) -> rusqlite::Result { + if let Some(ref path) = path { + Connection::open(path) + } else { + Connection::open_in_memory() + } +} + +const MEMORY: &str = ":memory:"; + +fn normalize(path: &Path) -> Option { + if path.as_os_str() == MEMORY { + None + } else { + Some(path.to_path_buf()) + } +} +fn is_mem_or_temp(path: &Path) -> bool { + let os_str = path.as_os_str(); + os_str.is_empty() || os_str == MEMORY +} +fn is_same(old: Option<&PathBuf>, new: &Path) -> bool { + if let Some(old) = old { + old == new // TODO canonicalize ? + } else { + new.as_os_str() == MEMORY + } +} +fn offset(s: String) -> usize { + s.split(' ') + .nth(2) + .and_then(|s| s.parse().ok()) + .unwrap_or(0) +} + +#[cfg(test)] +mod tests { + use super::SQLiteHistory; + use crate::config::Config; + use crate::history::{History, SearchDirection, SearchResult}; + use crate::Result; + use std::borrow::Cow; + use std::path::Path; + + fn init() -> Result { + let mut h = SQLiteHistory::with_config(Config::default())?; + h.add("line1")?; + h.add("line2")?; + h.add("line3")?; + Ok(h) + } + + #[test] + fn get() -> Result<()> { + let mut h = SQLiteHistory::with_config(Config::default())?; + assert_eq!(None, h.get(0, SearchDirection::Forward)?); + h.add("line")?; + assert_eq!( + Some(Cow::Borrowed("line")), + h.get(0, SearchDirection::Forward)?.map(|r| r.entry) + ); + h.add("line")?; // add duplicates => first entry removed + assert_eq!( + Some(Cow::Borrowed("line")), + h.get(0, SearchDirection::Forward)?.map(|r| r.entry) + ); + Ok(()) + } + + #[test] + fn len() -> Result<()> { + let mut h = SQLiteHistory::with_config(Config::default())?; + assert_eq!(0, h.len()); + h.add("line")?; + assert_eq!(1, h.len()); + Ok(()) + } + + #[test] + fn is_empty() -> Result<()> { + let mut h = SQLiteHistory::with_config(Config::default())?; + assert!(h.is_empty()); + h.add("line")?; + assert!(!h.is_empty()); + Ok(()) + } + + #[test] + fn set_max_len() -> Result<()> { + let mut h = SQLiteHistory::with_config(Config::default())?; + h.add("l1")?; + h.add("l2")?; + h.add("l3")?; + h.set_max_len(2)?; + let (min, max) = + h.conn + .query_row("SELECT min(rowid), max(rowid) FROM history;", [], |r| { + Ok((r.get::<_, i64>(0)?, r.get::<_, i64>(1)?)) + })?; + assert_eq!(2, min); + assert_eq!(3, max); + Ok(()) + } + + #[test] + fn ignore_dups() -> Result<()> { + let mut h = SQLiteHistory::with_config(Config::default())?; + h.ignore_dups(true)?; + h.ignore_dups(false)?; + h.ignore_dups(true) + } + + #[test] + fn save() -> Result<()> { + let db1 = "file:db1?mode=memory"; + let db2 = "file:db2?mode=memory"; + let mut h = SQLiteHistory::open(Config::default(), db1)?; + h.save(Path::new(db1))?; + h.save(Path::new(db2))?; + h.add("line")?; + h.save(Path::new(db1))?; + assert_eq!(db1, h.path.unwrap().as_os_str()); + assert_eq!(1, h.session_id); + assert_eq!(1, h.row_id.get()); + Ok(()) + } + + #[test] + #[cfg_attr(miri, ignore)] // unsupported operation: `getcwd` not available when isolation is enabled + fn append() -> Result<()> { + let db1 = "file:db1?mode=memory"; + // https://sqlite.org/forum/forumpost/c8b364331a8cac86 + // let db2 = "file:db2?mode=memory&cache=shared"; + let tf = tempfile::NamedTempFile::new()?; + let db2 = tf.path(); + let mut h = SQLiteHistory::open(Config::default(), db1)?; + h.append(Path::new(db1))?; + //h.append(Path::new(db2))?; + h.add("line")?; + h.append(Path::new(db2))?; + assert_eq!(db2, h.path.unwrap().as_os_str()); + assert_eq!(1, h.session_id); + assert_eq!(1, h.row_id.get()); + tf.close()?; + Ok(()) + } + + #[test] + fn load() -> Result<()> { + let db1 = "file:db1?mode=memory"; + let db2 = "file:db2?mode=memory"; + let mut h = SQLiteHistory::open(Config::default(), db1)?; + h.load(Path::new(db1))?; + h.add("line")?; + h.load(Path::new(db2))?; + assert_eq!(db2, h.path.unwrap().as_os_str()); + assert_eq!(0, h.session_id); + assert_eq!(0, h.row_id.get()); + Ok(()) + } + + #[test] + fn clear() -> Result<()> { + let mut h = SQLiteHistory::with_config(Config::default())?; + h.clear()?; + h.add("line")?; + h.clear()?; + assert_eq!(0, h.session_id); + assert_eq!(0, h.row_id.get()); + assert_eq!( + 0, + h.conn + .query_row("SELECT count(1) FROM session;", [], |r| r.get::<_, i32>(0))? + ); + assert_eq!( + 0, + h.conn + .query_row("SELECT count(1) FROM history;", [], |r| r.get::<_, i32>(0))? + ); + Ok(()) + } + + #[test] + fn search() -> Result<()> { + let h = init()?; + assert_eq!(None, h.search("", 0, SearchDirection::Forward)?); + assert_eq!(None, h.search("none", 0, SearchDirection::Forward)?); + assert_eq!(None, h.search("line", 3, SearchDirection::Forward)?); + + assert_eq!( + Some(SearchResult { + idx: 0, + entry: h.get(0, SearchDirection::Forward)?.unwrap().entry, + pos: 0 + }), + h.search("line", 0, SearchDirection::Forward)? + ); + assert_eq!( + Some(SearchResult { + idx: 1, + entry: h.get(1, SearchDirection::Forward)?.unwrap().entry, + pos: 0 + }), + h.search("line", 1, SearchDirection::Forward)? + ); + assert_eq!( + Some(SearchResult { + idx: 2, + entry: h.get(2, SearchDirection::Forward)?.unwrap().entry, + pos: 0 + }), + h.search("line3", 1, SearchDirection::Forward)? + ); + Ok(()) + } + + #[test] + fn reverse_search() -> Result<()> { + let h = init()?; + assert_eq!(None, h.search("", 2, SearchDirection::Reverse)?); + assert_eq!(None, h.search("none", 2, SearchDirection::Reverse)?); + assert_eq!(None, h.search("line", 3, SearchDirection::Reverse)?); + + assert_eq!( + Some(SearchResult { + idx: 2, + entry: h.get(2, SearchDirection::Reverse)?.unwrap().entry, + pos: 0 + }), + h.search("line", 2, SearchDirection::Reverse)? + ); + assert_eq!( + Some(SearchResult { + idx: 1, + entry: h.get(1, SearchDirection::Reverse)?.unwrap().entry, + pos: 0 + }), + h.search("line", 1, SearchDirection::Reverse)? + ); + assert_eq!( + Some(SearchResult { + idx: 0, + entry: h.get(0, SearchDirection::Reverse)?.unwrap().entry, + pos: 0 + }), + h.search("line1", 1, SearchDirection::Reverse)? + ); + Ok(()) + } + + #[test] + fn starts_with() -> Result<()> { + let h = init()?; + assert_eq!( + Some(SearchResult { + idx: 2, + entry: h.get(2, SearchDirection::Reverse)?.unwrap().entry, + pos: 4 + }), + h.starts_with("LiNe", 2, SearchDirection::Reverse)? + ); + assert_eq!(None, h.starts_with("iNe", 2, SearchDirection::Reverse)?); + Ok(()) + } +} diff --git a/rustyline-15.0.0/src/test/common.rs b/rustyline-15.0.0/src/test/common.rs new file mode 100644 index 0000000000..d426b5f557 --- /dev/null +++ b/rustyline-15.0.0/src/test/common.rs @@ -0,0 +1,340 @@ +//! Basic commands tests. +use super::{assert_cursor, assert_line, assert_line_with_initial, init_editor}; +use crate::config::EditMode; +use crate::error::ReadlineError; +use crate::keys::{KeyCode as K, KeyEvent as E, Modifiers as M}; + +#[test] +fn home_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_cursor(*mode, ("", ""), &[E(K::Home, M::NONE), E::ENTER], ("", "")); + assert_cursor( + *mode, + ("Hi", ""), + &[E(K::Home, M::NONE), E::ENTER], + ("", "Hi"), + ); + if *mode == EditMode::Vi { + // vi command mode + assert_cursor( + *mode, + ("Hi", ""), + &[E::ESC, E(K::Home, M::NONE), E::ENTER], + ("", "Hi"), + ); + } + } +} + +#[test] +fn end_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_cursor(*mode, ("", ""), &[E(K::End, M::NONE), E::ENTER], ("", "")); + assert_cursor( + *mode, + ("H", "i"), + &[E(K::End, M::NONE), E::ENTER], + ("Hi", ""), + ); + assert_cursor( + *mode, + ("", "Hi"), + &[E(K::End, M::NONE), E::ENTER], + ("Hi", ""), + ); + if *mode == EditMode::Vi { + // vi command mode + assert_cursor( + *mode, + ("", "Hi"), + &[E::ESC, E(K::End, M::NONE), E::ENTER], + ("Hi", ""), + ); + } + } +} + +#[test] +fn left_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_cursor( + *mode, + ("Hi", ""), + &[E(K::Left, M::NONE), E::ENTER], + ("H", "i"), + ); + assert_cursor( + *mode, + ("H", "i"), + &[E(K::Left, M::NONE), E::ENTER], + ("", "Hi"), + ); + assert_cursor( + *mode, + ("", "Hi"), + &[E(K::Left, M::NONE), E::ENTER], + ("", "Hi"), + ); + if *mode == EditMode::Vi { + // vi command mode + assert_cursor( + *mode, + ("Bye", ""), + &[E::ESC, E(K::Left, M::NONE), E::ENTER], + ("B", "ye"), + ); + } + } +} + +#[test] +fn right_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_cursor(*mode, ("", ""), &[E(K::Right, M::NONE), E::ENTER], ("", "")); + assert_cursor( + *mode, + ("", "Hi"), + &[E(K::Right, M::NONE), E::ENTER], + ("H", "i"), + ); + assert_cursor( + *mode, + ("B", "ye"), + &[E(K::Right, M::NONE), E::ENTER], + ("By", "e"), + ); + assert_cursor( + *mode, + ("H", "i"), + &[E(K::Right, M::NONE), E::ENTER], + ("Hi", ""), + ); + if *mode == EditMode::Vi { + // vi command mode + assert_cursor( + *mode, + ("", "Hi"), + &[E::ESC, E(K::Right, M::NONE), E::ENTER], + ("H", "i"), + ); + } + } +} + +#[test] +fn enter_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_line(*mode, &[E::ENTER], ""); + assert_line(*mode, &[E::from('a'), E::ENTER], "a"); + assert_line_with_initial(*mode, ("Hi", ""), &[E::ENTER], "Hi"); + assert_line_with_initial(*mode, ("", "Hi"), &[E::ENTER], "Hi"); + assert_line_with_initial(*mode, ("H", "i"), &[E::ENTER], "Hi"); + if *mode == EditMode::Vi { + // vi command mode + assert_line(*mode, &[E::ESC, E::ENTER], ""); + assert_line(*mode, &[E::from('a'), E::ESC, E::ENTER], "a"); + assert_line_with_initial(*mode, ("Hi", ""), &[E::ESC, E::ENTER], "Hi"); + assert_line_with_initial(*mode, ("", "Hi"), &[E::ESC, E::ENTER], "Hi"); + assert_line_with_initial(*mode, ("H", "i"), &[E::ESC, E::ENTER], "Hi"); + } + } +} + +#[test] +fn newline_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_line(*mode, &[E::ctrl('J')], ""); + assert_line(*mode, &[E::from('a'), E::ctrl('J')], "a"); + if *mode == EditMode::Vi { + // vi command mode + assert_line(*mode, &[E::ESC, E::ctrl('J')], ""); + assert_line(*mode, &[E::from('a'), E::ESC, E::ctrl('J')], "a"); + } + } +} + +#[test] +fn eof_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + let mut editor = init_editor(*mode, &[E::ctrl('D')]); + let err = editor.readline(">>"); + assert_matches!(err, Err(ReadlineError::Eof)); + } + assert_line( + EditMode::Emacs, + &[E::from('a'), E::ctrl('D'), E::ENTER], + "a", + ); + assert_line(EditMode::Vi, &[E::from('a'), E::ctrl('D')], "a"); + assert_line(EditMode::Vi, &[E::from('a'), E::ESC, E::ctrl('D')], "a"); + assert_line_with_initial(EditMode::Emacs, ("", "Hi"), &[E::ctrl('D'), E::ENTER], "i"); + assert_line_with_initial(EditMode::Vi, ("", "Hi"), &[E::ctrl('D')], "Hi"); + assert_line_with_initial(EditMode::Vi, ("", "Hi"), &[E::ESC, E::ctrl('D')], "Hi"); +} + +#[test] +fn interrupt_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + let mut editor = init_editor(*mode, &[E::ctrl('C')]); + let err = editor.readline(">>"); + assert_matches!(err, Err(ReadlineError::Interrupted)); + + let mut editor = init_editor(*mode, &[E::ctrl('C')]); + let err = editor.readline_with_initial(">>", ("Hi", "")); + assert_matches!(err, Err(ReadlineError::Interrupted)); + if *mode == EditMode::Vi { + // vi command mode + let mut editor = init_editor(*mode, &[E::ESC, E::ctrl('C')]); + let err = editor.readline_with_initial(">>", ("Hi", "")); + assert_matches!(err, Err(ReadlineError::Interrupted)); + } + } +} + +#[test] +fn delete_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_cursor( + *mode, + ("a", ""), + &[E(K::Delete, M::NONE), E::ENTER], + ("a", ""), + ); + assert_cursor( + *mode, + ("", "a"), + &[E(K::Delete, M::NONE), E::ENTER], + ("", ""), + ); + if *mode == EditMode::Vi { + // vi command mode + assert_cursor( + *mode, + ("", "a"), + &[E::ESC, E(K::Delete, M::NONE), E::ENTER], + ("", ""), + ); + } + } +} + +#[test] +fn ctrl_t() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_cursor(*mode, ("a", "b"), &[E::ctrl('T'), E::ENTER], ("ba", "")); + assert_cursor(*mode, ("ab", "cd"), &[E::ctrl('T'), E::ENTER], ("acb", "d")); + if *mode == EditMode::Vi { + // vi command mode + assert_cursor( + *mode, + ("ab", ""), + &[E::ESC, E::ctrl('T'), E::ENTER], + ("ba", ""), + ); + } + } +} + +#[test] +fn ctrl_u() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_cursor( + *mode, + ("start of line ", "end"), + &[E::ctrl('U'), E::ENTER], + ("", "end"), + ); + assert_cursor(*mode, ("", "end"), &[E::ctrl('U'), E::ENTER], ("", "end")); + if *mode == EditMode::Vi { + // vi command mode + assert_cursor( + *mode, + ("start of line ", "end"), + &[E::ESC, E::ctrl('U'), E::ENTER], + ("", " end"), + ); + } + } +} + +#[cfg(unix)] +#[test] +fn ctrl_v() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_cursor( + *mode, + ("", ""), + &[E::ctrl('V'), E(K::Char('\t'), M::NONE), E::ENTER], + ("\t", ""), + ); + if *mode == EditMode::Vi { + // vi command mode + assert_cursor( + *mode, + ("", ""), + &[E::ESC, E::ctrl('V'), E(K::Char('\t'), M::NONE), E::ENTER], + ("\t", ""), + ); + } + } +} + +#[test] +fn ctrl_w() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_cursor( + *mode, + ("Hello, ", "world"), + &[E::ctrl('W'), E::ENTER], + ("", "world"), + ); + assert_cursor( + *mode, + ("Hello, world.", ""), + &[E::ctrl('W'), E::ENTER], + ("Hello, ", ""), + ); + if *mode == EditMode::Vi { + // vi command mode + assert_cursor( + *mode, + ("Hello, world.", ""), + &[E::ESC, E::ctrl('W'), E::ENTER], + ("Hello, ", "."), + ); + } + } +} + +#[test] +fn ctrl_y() { + for mode in &[EditMode::Emacs /* FIXME, EditMode::Vi */] { + assert_cursor( + *mode, + ("Hello, ", "world"), + &[E::ctrl('W'), E::ctrl('Y'), E::ENTER], + ("Hello, ", "world"), + ); + } +} + +#[test] +fn ctrl__() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_cursor( + *mode, + ("Hello, ", "world"), + &[E::ctrl('W'), E::ctrl('_'), E::ENTER], + ("Hello, ", "world"), + ); + if *mode == EditMode::Vi { + // vi command mode + assert_cursor( + *mode, + ("Hello, ", "world"), + &[E::ESC, E::ctrl('W'), E::ctrl('_'), E::ENTER], + ("Hello,", " world"), + ); + } + } +} diff --git a/rustyline-15.0.0/src/test/emacs.rs b/rustyline-15.0.0/src/test/emacs.rs new file mode 100644 index 0000000000..aa3e0b66d6 --- /dev/null +++ b/rustyline-15.0.0/src/test/emacs.rs @@ -0,0 +1,424 @@ +//! Emacs specific key bindings +use super::{assert_cursor, assert_history}; +use crate::config::EditMode; +use crate::keys::{KeyCode as K, KeyEvent as E, Modifiers as M}; + +#[test] +fn ctrl_a() { + assert_cursor( + EditMode::Emacs, + ("Hi", ""), + &[E::ctrl('A'), E::ENTER], + ("", "Hi"), + ); + assert_cursor( + EditMode::Emacs, + ("test test\n123", "foo"), + &[E::ctrl('A'), E::ENTER], + ("test test\n", "123foo"), + ); +} + +#[test] +fn ctrl_e() { + assert_cursor( + EditMode::Emacs, + ("", "Hi"), + &[E::ctrl('E'), E::ENTER], + ("Hi", ""), + ); + assert_cursor( + EditMode::Emacs, + ("foo", "test test\n123"), + &[E::ctrl('E'), E::ENTER], + ("footest test", "\n123"), + ); +} + +#[test] +fn ctrl_b() { + assert_cursor( + EditMode::Emacs, + ("Hi", ""), + &[E::ctrl('B'), E::ENTER], + ("H", "i"), + ); + assert_cursor( + EditMode::Emacs, + ("Hi", ""), + &[E::alt('2'), E::ctrl('B'), E::ENTER], + ("", "Hi"), + ); + assert_cursor( + EditMode::Emacs, + ("", "Hi"), + &[E::alt('-'), E::alt('2'), E::ctrl('B'), E::ENTER], + ("Hi", ""), + ); +} + +#[test] +fn ctrl_f() { + assert_cursor( + EditMode::Emacs, + ("", "Hi"), + &[E::ctrl('F'), E::ENTER], + ("H", "i"), + ); + assert_cursor( + EditMode::Emacs, + ("", "Hi"), + &[E::alt('2'), E::ctrl('F'), E::ENTER], + ("Hi", ""), + ); + assert_cursor( + EditMode::Emacs, + ("Hi", ""), + &[E::alt('-'), E::alt('2'), E::ctrl('F'), E::ENTER], + ("", "Hi"), + ); +} + +#[test] +fn ctrl_h() { + assert_cursor( + EditMode::Emacs, + ("Hi", ""), + &[E::ctrl('H'), E::ENTER], + ("H", ""), + ); + assert_cursor( + EditMode::Emacs, + ("Hi", ""), + &[E::alt('2'), E::ctrl('H'), E::ENTER], + ("", ""), + ); + assert_cursor( + EditMode::Emacs, + ("", "Hi"), + &[E::alt('-'), E::alt('2'), E::ctrl('H'), E::ENTER], + ("", ""), + ); +} + +#[test] +fn backspace() { + assert_cursor( + EditMode::Emacs, + ("", ""), + &[E::BACKSPACE, E::ENTER], + ("", ""), + ); + assert_cursor( + EditMode::Emacs, + ("Hi", ""), + &[E::BACKSPACE, E::ENTER], + ("H", ""), + ); + assert_cursor( + EditMode::Emacs, + ("", "Hi"), + &[E::BACKSPACE, E::ENTER], + ("", "Hi"), + ); +} + +#[test] +fn ctrl_k() { + assert_cursor( + EditMode::Emacs, + ("Hi", ""), + &[E::ctrl('K'), E::ENTER], + ("Hi", ""), + ); + assert_cursor( + EditMode::Emacs, + ("", "Hi"), + &[E::ctrl('K'), E::ENTER], + ("", ""), + ); + assert_cursor( + EditMode::Emacs, + ("B", "ye"), + &[E::ctrl('K'), E::ENTER], + ("B", ""), + ); + assert_cursor( + EditMode::Emacs, + ("Hi", "foo\nbar"), + &[E::ctrl('K'), E::ENTER], + ("Hi", "\nbar"), + ); + assert_cursor( + EditMode::Emacs, + ("Hi", "\nbar"), + &[E::ctrl('K'), E::ENTER], + ("Hi", "bar"), + ); + assert_cursor( + EditMode::Emacs, + ("Hi", "bar"), + &[E::ctrl('K'), E::ENTER], + ("Hi", ""), + ); +} + +#[test] +fn ctrl_u() { + assert_cursor( + EditMode::Emacs, + ("", "Hi"), + &[E::ctrl('U'), E::ENTER], + ("", "Hi"), + ); + assert_cursor( + EditMode::Emacs, + ("Hi", ""), + &[E::ctrl('U'), E::ENTER], + ("", ""), + ); + assert_cursor( + EditMode::Emacs, + ("B", "ye"), + &[E::ctrl('U'), E::ENTER], + ("", "ye"), + ); + assert_cursor( + EditMode::Emacs, + ("foo\nbar", "Hi"), + &[E::ctrl('U'), E::ENTER], + ("foo\n", "Hi"), + ); + assert_cursor( + EditMode::Emacs, + ("foo\n", "Hi"), + &[E::ctrl('U'), E::ENTER], + ("foo", "Hi"), + ); + assert_cursor( + EditMode::Emacs, + ("foo", "Hi"), + &[E::ctrl('U'), E::ENTER], + ("", "Hi"), + ); +} +#[test] +fn ctrl_n() { + assert_history( + EditMode::Emacs, + &["line1", "line2"], + &[E::ctrl('P'), E::ctrl('P'), E::ctrl('N'), E::ENTER], + "", + ("line2", ""), + ); +} + +#[test] +fn ctrl_p() { + assert_history( + EditMode::Emacs, + &["line1"], + &[E::ctrl('P'), E::ENTER], + "", + ("line1", ""), + ); +} + +#[test] +fn ctrl_t() { + /* FIXME + assert_cursor( + ("ab", "cd"), + &[E::alt('2'), E::ctrl('T'), E::ENTER], + ("acdb", ""), + );*/ +} + +#[test] +fn ctrl_x_ctrl_u() { + assert_cursor( + EditMode::Emacs, + ("Hello, ", "world"), + &[E::ctrl('W'), E::ctrl('X'), E::ctrl('U'), E::ENTER], + ("Hello, ", "world"), + ); +} + +#[test] +fn meta_b() { + assert_cursor( + EditMode::Emacs, + ("Hello, world!", ""), + &[E::alt('B'), E::ENTER], + ("Hello, ", "world!"), + ); + assert_cursor( + EditMode::Emacs, + ("Hello, world!", ""), + &[E::alt('2'), E::alt('B'), E::ENTER], + ("", "Hello, world!"), + ); + assert_cursor( + EditMode::Emacs, + ("", "Hello, world!"), + &[E::alt('-'), E::alt('B'), E::ENTER], + ("Hello", ", world!"), + ); +} + +#[test] +fn meta_f() { + assert_cursor( + EditMode::Emacs, + ("", "Hello, world!"), + &[E::alt('F'), E::ENTER], + ("Hello", ", world!"), + ); + assert_cursor( + EditMode::Emacs, + ("", "Hello, world!"), + &[E::alt('2'), E::alt('F'), E::ENTER], + ("Hello, world", "!"), + ); + assert_cursor( + EditMode::Emacs, + ("Hello, world!", ""), + &[E::alt('-'), E::alt('F'), E::ENTER], + ("Hello, ", "world!"), + ); +} + +#[test] +fn meta_c() { + assert_cursor( + EditMode::Emacs, + ("hi", ""), + &[E::alt('C'), E::ENTER], + ("hi", ""), + ); + assert_cursor( + EditMode::Emacs, + ("", "hi"), + &[E::alt('C'), E::ENTER], + ("Hi", ""), + ); + /* FIXME + assert_cursor( + ("", "hi test"), + &[E::alt('2'), E::alt('C'), E::ENTER], + ("Hi Test", ""), + );*/ +} + +#[test] +fn meta_l() { + assert_cursor( + EditMode::Emacs, + ("Hi", ""), + &[E::alt('L'), E::ENTER], + ("Hi", ""), + ); + assert_cursor( + EditMode::Emacs, + ("", "HI"), + &[E::alt('L'), E::ENTER], + ("hi", ""), + ); + /* FIXME + assert_cursor( + ("", "HI TEST"), + &[E::alt('2'), E::alt('L'), E::ENTER], + ("hi test", ""), + );*/ +} + +#[test] +fn meta_u() { + assert_cursor( + EditMode::Emacs, + ("hi", ""), + &[E::alt('U'), E::ENTER], + ("hi", ""), + ); + assert_cursor( + EditMode::Emacs, + ("", "hi"), + &[E::alt('U'), E::ENTER], + ("HI", ""), + ); + /* FIXME + assert_cursor( + ("", "hi test"), + &[E::alt('2'), E::alt('U'), E::ENTER], + ("HI TEST", ""), + );*/ +} + +#[test] +fn meta_d() { + assert_cursor( + EditMode::Emacs, + ("Hello", ", world!"), + &[E::alt('D'), E::ENTER], + ("Hello", "!"), + ); + assert_cursor( + EditMode::Emacs, + ("Hello", ", world!"), + &[E::alt('2'), E::alt('D'), E::ENTER], + ("Hello", ""), + ); +} + +#[test] +fn meta_t() { + assert_cursor( + EditMode::Emacs, + ("Hello", ", world!"), + &[E::alt('T'), E::ENTER], + ("world, Hello", "!"), + ); + /* FIXME + assert_cursor( + ("One Two", " Three Four"), + &[E::alt('T'), E::ENTER], + ("One Four Three Two", ""), + );*/ +} + +#[test] +fn meta_y() { + assert_cursor( + EditMode::Emacs, + ("Hello, world", "!"), + &[ + E::ctrl('W'), + E(K::Left, M::NONE), + E::ctrl('W'), + E::ctrl('Y'), + E::alt('Y'), + E::ENTER, + ], + ("world", " !"), + ); +} + +#[test] +fn meta_backspace() { + assert_cursor( + EditMode::Emacs, + ("Hello, wor", "ld!"), + &[E(K::Backspace, M::ALT), E::ENTER], + ("Hello, ", "ld!"), + ); +} + +#[test] +fn meta_digit() { + assert_cursor( + EditMode::Emacs, + ("", ""), + &[E::alt('3'), E::from('h'), E::ENTER], + ("hhh", ""), + ); +} diff --git a/rustyline-15.0.0/src/test/history.rs b/rustyline-15.0.0/src/test/history.rs new file mode 100644 index 0000000000..ab869249c6 --- /dev/null +++ b/rustyline-15.0.0/src/test/history.rs @@ -0,0 +1,243 @@ +//! History related commands tests +use super::assert_history; +use crate::config::EditMode; +use crate::keys::{KeyCode as K, KeyEvent as E, Modifiers as M}; + +#[test] +fn down_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_history( + *mode, + &["line1"], + &[E(K::Down, M::NONE), E::ENTER], + "", + ("", ""), + ); + assert_history( + *mode, + &["line1", "line2"], + &[ + E(K::Up, M::NONE), + E(K::Up, M::NONE), + E(K::Down, M::NONE), + E::ENTER, + ], + "", + ("line2", ""), + ); + assert_history( + *mode, + &["line1"], + &[ + E::from('a'), + E(K::Up, M::NONE), + E(K::Down, M::NONE), // restore original line + E::ENTER, + ], + "", + ("a", ""), + ); + assert_history( + *mode, + &["line1"], + &[ + E::from('a'), + E(K::Down, M::NONE), // noop + E::ENTER, + ], + "", + ("a", ""), + ); + } +} + +#[test] +fn up_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_history(*mode, &[], &[E(K::Up, M::NONE), E::ENTER], "", ("", "")); + assert_history( + *mode, + &["line1"], + &[E(K::Up, M::NONE), E::ENTER], + "", + ("line1", ""), + ); + assert_history( + *mode, + &["line1", "line2"], + &[E(K::Up, M::NONE), E(K::Up, M::NONE), E::ENTER], + "", + ("line1", ""), + ); + } +} + +#[test] +fn ctrl_r() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_history( + *mode, + &[], + &[E::ctrl('R'), E::from('o'), E::ENTER], + "", + ("o", ""), + ); + assert_history( + *mode, + &["rustc", "cargo"], + &[ + E::ctrl('R'), + E::from('o'), + E(K::Right, M::NONE), // just to assert cursor pos + E::ENTER, + ], + "", + ("cargo", ""), + ); + assert_history( + *mode, + &["rustc", "cargo"], + &[ + E::ctrl('R'), + E::from('u'), + E(K::Right, M::NONE), // just to assert cursor pos + E::ENTER, + ], + "", + ("ru", "stc"), + ); + assert_history( + *mode, + &["rustc", "cargo"], + &[ + E::ctrl('R'), + E::from('r'), + E::from('u'), + E(K::Right, M::NONE), // just to assert cursor pos + E::ENTER, + ], + "", + ("r", "ustc"), + ); + assert_history( + *mode, + &["rustc", "cargo"], + &[ + E::ctrl('R'), + E::from('r'), + E::ctrl('R'), + E(K::Right, M::NONE), // just to assert cursor pos + E::ENTER, + ], + "", + ("r", "ustc"), + ); + assert_history( + *mode, + &["rustc", "cargo"], + &[ + E::ctrl('R'), + E::from('r'), + E::from('z'), // no match + E(K::Right, M::NONE), // just to assert cursor pos + E::ENTER, + ], + "", + ("car", "go"), + ); + assert_history( + EditMode::Emacs, + &["rustc", "cargo"], + &[ + E::from('a'), + E::ctrl('R'), + E::from('r'), + E::ctrl('G'), // abort (FIXME: doesn't work with vi mode) + E::ENTER, + ], + "", + ("a", ""), + ); + } +} + +#[test] +fn ctrl_r_with_long_prompt() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_history( + *mode, + &["rustc", "cargo"], + &[E::ctrl('R'), E::from('o'), E::ENTER], + ">>>>>>>>>>>>>>>>>>>>>>>>>>> ", + ("cargo", ""), + ); + } +} + +#[test] +fn ctrl_s() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_history( + *mode, + &["rustc", "cargo"], + &[ + E::ctrl('R'), + E::from('r'), + E::ctrl('R'), + E::ctrl('S'), + E(K::Right, M::NONE), // just to assert cursor pos + E::ENTER, + ], + "", + ("car", "go"), + ); + } +} + +#[test] +fn meta_lt() { + assert_history( + EditMode::Emacs, + &[""], + &[E::alt('<'), E::ENTER], + "", + ("", ""), + ); + assert_history( + EditMode::Emacs, + &["rustc", "cargo"], + &[E::alt('<'), E::ENTER], + "", + ("rustc", ""), + ); +} + +#[test] +fn meta_gt() { + assert_history( + EditMode::Emacs, + &[""], + &[E::alt('>'), E::ENTER], + "", + ("", ""), + ); + assert_history( + EditMode::Emacs, + &["rustc", "cargo"], + &[E::alt('<'), E::alt('>'), E::ENTER], + "", + ("", ""), + ); + assert_history( + EditMode::Emacs, + &["rustc", "cargo"], + &[ + E::from('a'), + E::alt('<'), + E::alt('>'), // restore original line + E::ENTER, + ], + "", + ("a", ""), + ); +} diff --git a/rustyline-15.0.0/src/test/mod.rs b/rustyline-15.0.0/src/test/mod.rs new file mode 100644 index 0000000000..14ff9052be --- /dev/null +++ b/rustyline-15.0.0/src/test/mod.rs @@ -0,0 +1,199 @@ +use std::vec::IntoIter; + +use crate::completion::Completer; +use crate::config::{CompletionType, Config, EditMode}; +use crate::edit::init_state; +use crate::highlight::Highlighter; +use crate::hint::Hinter; +use crate::history::History; +use crate::keymap::{Bindings, Cmd, InputState}; +use crate::keys::{KeyCode as K, KeyEvent, KeyEvent as E, Modifiers as M}; +use crate::tty::Sink; +use crate::validate::Validator; +use crate::{apply_backspace_direct, readline_direct, Context, DefaultEditor, Helper, Result}; + +mod common; +mod emacs; +mod history; +mod vi_cmd; +mod vi_insert; + +fn init_editor(mode: EditMode, keys: &[KeyEvent]) -> DefaultEditor { + let config = Config::builder().edit_mode(mode).build(); + let mut editor = DefaultEditor::with_config(config).unwrap(); + editor.term.keys.extend(keys.iter().copied()); + editor +} + +struct SimpleCompleter; +impl Completer for SimpleCompleter { + type Candidate = String; + + fn complete( + &self, + line: &str, + _pos: usize, + _ctx: &Context<'_>, + ) -> Result<(usize, Vec)> { + Ok(( + 0, + if line == "rus" { + vec![line.to_owned() + "t"] + } else if line == "\\hbar" { + vec!["ℏ".to_owned()] + } else { + vec![] + }, + )) + } +} +impl Hinter for SimpleCompleter { + type Hint = String; + + fn hint(&self, _line: &str, _pos: usize, _ctx: &Context<'_>) -> Option { + None + } +} + +impl Helper for SimpleCompleter {} +impl Highlighter for SimpleCompleter {} +impl Validator for SimpleCompleter {} + +#[test] +fn complete_line() { + let mut out = Sink::default(); + let history = crate::history::DefaultHistory::new(); + let helper = Some(SimpleCompleter); + let mut s = init_state(&mut out, "rus", 3, helper.as_ref(), &history); + let config = Config::default(); + let bindings = Bindings::new(); + let mut input_state = InputState::new(&config, &bindings); + let keys = vec![E::ENTER]; + let mut rdr: IntoIter = keys.into_iter(); + let cmd = super::complete_line(&mut rdr, &mut s, &mut input_state, &config).unwrap(); + assert_eq!( + Some(Cmd::AcceptOrInsertLine { + accept_in_the_middle: true + }), + cmd + ); + assert_eq!("rust", s.line.as_str()); + assert_eq!(4, s.line.pos()); +} + +#[test] +fn complete_symbol() { + let mut out = Sink::default(); + let history = crate::history::DefaultHistory::new(); + let helper = Some(SimpleCompleter); + let mut s = init_state(&mut out, "\\hbar", 5, helper.as_ref(), &history); + let config = Config::builder() + .completion_type(CompletionType::List) + .build(); + let bindings = Bindings::new(); + let mut input_state = InputState::new(&config, &bindings); + let keys = vec![E::ENTER]; + let mut rdr: IntoIter = keys.into_iter(); + let cmd = super::complete_line(&mut rdr, &mut s, &mut input_state, &config).unwrap(); + assert_eq!(None, cmd); + assert_eq!("ℏ", s.line.as_str()); + assert_eq!(3, s.line.pos()); +} + +// `keys`: keys to press +// `expected_line`: line after enter key +fn assert_line(mode: EditMode, keys: &[KeyEvent], expected_line: &str) { + let mut editor = init_editor(mode, keys); + let actual_line = editor.readline(">>").unwrap(); + assert_eq!(expected_line, actual_line); +} + +// `initial`: line status before `keys` pressed: strings before and after cursor +// `keys`: keys to press +// `expected_line`: line after enter key +fn assert_line_with_initial( + mode: EditMode, + initial: (&str, &str), + keys: &[KeyEvent], + expected_line: &str, +) { + let mut editor = init_editor(mode, keys); + let actual_line = editor.readline_with_initial(">>", initial).unwrap(); + assert_eq!(expected_line, actual_line); +} + +// `initial`: line status before `keys` pressed: strings before and after cursor +// `keys`: keys to press +// `expected`: line status before enter key: strings before and after cursor +fn assert_cursor(mode: EditMode, initial: (&str, &str), keys: &[KeyEvent], expected: (&str, &str)) { + let mut editor = init_editor(mode, keys); + let actual_line = editor.readline_with_initial("", initial).unwrap(); + assert_eq!(expected.0.to_owned() + expected.1, actual_line); + assert_eq!(expected.0.len(), editor.term.cursor); +} + +// `entries`: history entries before `keys` pressed +// `keys`: keys to press +// `expected`: line status before enter key: strings before and after cursor +fn assert_history( + mode: EditMode, + entries: &[&str], + keys: &[KeyEvent], + prompt: &str, + expected: (&str, &str), +) { + let mut editor = init_editor(mode, keys); + for entry in entries { + editor.history.add(entry).unwrap(); + } + let actual_line = editor.readline(prompt).unwrap(); + assert_eq!(expected.0.to_owned() + expected.1, actual_line); + if prompt.is_empty() { + assert_eq!(expected.0.len(), editor.term.cursor); + } +} + +#[test] +fn unknown_esc_key() { + for mode in &[EditMode::Emacs, EditMode::Vi] { + assert_line(*mode, &[E(K::UnknownEscSeq, M::NONE), E::ENTER], ""); + } +} + +#[test] +fn test_send() { + fn assert_send() {} + assert_send::(); +} + +#[test] +fn test_sync() { + fn assert_sync() {} + assert_sync::(); +} + +#[test] +fn test_apply_backspace_direct() { + assert_eq!( + &apply_backspace_direct("Hel\u{0008}\u{0008}el\u{0008}llo ☹\u{0008}☺"), + "Hello ☺" + ); +} + +#[test] +fn test_readline_direct() { + use std::io::Cursor; + + let mut write_buf = vec![]; + let output = readline_direct( + Cursor::new("([)\n\u{0008}\n\n\r\n])".as_bytes()), + Cursor::new(&mut write_buf), + &Some(crate::validate::MatchingBracketValidator::new()), + ); + + assert_eq!( + &write_buf, + b"Mismatched brackets: '[' is not properly closed" + ); + assert_eq!(&output.unwrap(), "([\n\n\r\n])"); +} diff --git a/rustyline-15.0.0/src/test/vi_cmd.rs b/rustyline-15.0.0/src/test/vi_cmd.rs new file mode 100644 index 0000000000..9971562996 --- /dev/null +++ b/rustyline-15.0.0/src/test/vi_cmd.rs @@ -0,0 +1,598 @@ +//! Vi command mode specific key bindings +use super::{assert_cursor, assert_history}; +use crate::config::EditMode; +use crate::keys::KeyEvent as E; + +#[test] +fn dollar() { + assert_cursor( + EditMode::Vi, + ("", "Hi"), + &[E::ESC, E::from('$'), E::ENTER], + ("Hi", ""), // FIXME + ); +} + +#[test] +fn dot() { + assert_cursor( + EditMode::Vi, + ("", ""), + &[E::ESC, E::from('.'), E::ENTER], + ("", ""), + ); +} + +#[test] +fn semi_colon() { + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('f'), E::from('o'), E::from(';'), E::ENTER], + ("Hello, w", "orld!"), + ); +} + +#[test] +fn comma() { + assert_cursor( + EditMode::Vi, + ("Hello, w", "orld!"), + &[E::ESC, E::from('f'), E::from('l'), E::from(','), E::ENTER], + ("Hel", "lo, world!"), + ); +} + +#[test] +fn zero() { + assert_cursor( + EditMode::Vi, + ("Hi", ""), + &[E::ESC, E::from('0'), E::ENTER], + ("", "Hi"), + ); +} + +#[test] +fn caret() { + assert_cursor( + EditMode::Vi, + (" Hi", ""), + &[E::ESC, E::from('^'), E::ENTER], + (" ", "Hi"), + ); +} + +#[test] +fn caret_no_whitespace() { + assert_cursor( + EditMode::Vi, + ("Hi", ""), + &[E::ESC, E::from('^'), E::ENTER], + ("", "Hi"), + ); +} + +#[test] +fn a() { + assert_cursor( + EditMode::Vi, + ("B", "e"), + &[E::ESC, E::from('a'), E::from('y'), E::ENTER], + ("By", "e"), + ); +} + +#[test] +fn uppercase_a() { + assert_cursor( + EditMode::Vi, + ("", "By"), + &[E::ESC, E::from('A'), E::from('e'), E::ENTER], + ("Bye", ""), + ); +} + +#[test] +fn b() { + assert_cursor( + EditMode::Vi, + ("Hello, world!", ""), + &[E::ESC, E::from('b'), E::ENTER], + ("Hello, ", "world!"), + ); + assert_cursor( + EditMode::Vi, + ("Hello, world!", ""), + &[E::ESC, E::from('2'), E::from('b'), E::ENTER], + ("Hello", ", world!"), + ); +} + +#[test] +fn uppercase_b() { + assert_cursor( + EditMode::Vi, + ("Hello, world!", ""), + &[E::ESC, E::from('B'), E::ENTER], + ("Hello, ", "world!"), + ); + assert_cursor( + EditMode::Vi, + ("Hello, world!", ""), + &[E::ESC, E::from('2'), E::from('B'), E::ENTER], + ("", "Hello, world!"), + ); +} + +#[test] +fn uppercase_c() { + assert_cursor( + EditMode::Vi, + ("Hello, w", "orld!"), + &[E::ESC, E::from('C'), E::from('i'), E::ENTER], + ("Hello, i", ""), + ); +} + +#[test] +fn ctrl_k() { + for key in &[E::from('D'), E::ctrl('K')] { + assert_cursor( + EditMode::Vi, + ("Hi", ""), + &[E::ESC, *key, E::ENTER], + ("H", ""), + ); + assert_cursor( + EditMode::Vi, + ("", "Hi"), + &[E::ESC, *key, E::ENTER], + ("", ""), + ); + assert_cursor( + EditMode::Vi, + ("By", "e"), + &[E::ESC, *key, E::ENTER], + ("B", ""), + ); + } +} + +#[test] +fn e() { + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('e'), E::ENTER], + ("Hell", "o, world!"), + ); + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('2'), E::from('e'), E::ENTER], + ("Hello, worl", "d!"), + ); +} + +#[test] +fn uppercase_e() { + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('E'), E::ENTER], + ("Hello", ", world!"), + ); + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('2'), E::from('E'), E::ENTER], + ("Hello, world", "!"), + ); +} + +#[test] +fn f() { + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('f'), E::from('r'), E::ENTER], + ("Hello, wo", "rld!"), + ); + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('3'), E::from('f'), E::from('l'), E::ENTER], + ("Hello, wor", "ld!"), + ); +} + +#[test] +fn uppercase_f() { + assert_cursor( + EditMode::Vi, + ("Hello, world!", ""), + &[E::ESC, E::from('F'), E::from('r'), E::ENTER], + ("Hello, wo", "rld!"), + ); + assert_cursor( + EditMode::Vi, + ("Hello, world!", ""), + &[E::ESC, E::from('3'), E::from('F'), E::from('l'), E::ENTER], + ("He", "llo, world!"), + ); +} + +#[test] +fn i() { + assert_cursor( + EditMode::Vi, + ("Be", ""), + &[E::ESC, E::from('i'), E::from('y'), E::ENTER], + ("By", "e"), + ); +} + +#[test] +fn uppercase_i() { + assert_cursor( + EditMode::Vi, + ("Be", ""), + &[E::ESC, E::from('I'), E::from('y'), E::ENTER], + ("y", "Be"), + ); +} + +#[test] +fn u() { + assert_cursor( + EditMode::Vi, + ("Hello, ", "world"), + &[E::ESC, E::ctrl('W'), E::from('u'), E::ENTER], + ("Hello,", " world"), + ); +} + +#[test] +fn w() { + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('w'), E::ENTER], + ("Hello", ", world!"), + ); + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('2'), E::from('w'), E::ENTER], + ("Hello, ", "world!"), + ); +} + +#[test] +fn uppercase_w() { + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('W'), E::ENTER], + ("Hello, ", "world!"), + ); + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('2'), E::from('W'), E::ENTER], + ("Hello, world", "!"), + ); +} + +#[test] +fn x() { + assert_cursor( + EditMode::Vi, + ("", "a"), + &[E::ESC, E::from('x'), E::ENTER], + ("", ""), + ); +} + +#[test] +fn uppercase_x() { + assert_cursor( + EditMode::Vi, + ("Hi", ""), + &[E::ESC, E::from('X'), E::ENTER], + ("", "i"), + ); +} + +#[test] +fn h() { + for key in &[E::from('h'), E::ctrl('H'), E::BACKSPACE] { + assert_cursor( + EditMode::Vi, + ("Bye", ""), + &[E::ESC, *key, E::ENTER], + ("B", "ye"), + ); + assert_cursor( + EditMode::Vi, + ("Bye", ""), + &[E::ESC, E::from('2'), *key, E::ENTER], + ("", "Bye"), + ); + } +} + +#[test] +fn l() { + for key in &[E::from('l'), E::from(' ')] { + assert_cursor( + EditMode::Vi, + ("", "Hi"), + &[E::ESC, *key, E::ENTER], + ("H", "i"), + ); + assert_cursor( + EditMode::Vi, + ("", "Hi"), + &[E::ESC, E::from('2'), *key, E::ENTER], + ("Hi", ""), + ); + } +} + +#[test] +fn j() { + for key in &[E::from('j'), E::from('+')] { + assert_cursor( + EditMode::Vi, + ("Hel", "lo,\nworld!"), + // NOTE: escape moves backwards on char + &[E::ESC, *key, E::ENTER], + ("Hello,\nwo", "rld!"), + ); + assert_cursor( + EditMode::Vi, + ("", "One\nTwo\nThree"), + &[E::ESC, E::from('2'), *key, E::ENTER], + ("One\nTwo\n", "Three"), + ); + assert_cursor( + EditMode::Vi, + ("Hel", "lo,\nworld!"), + // NOTE: escape moves backwards on char + &[E::ESC, E::from('7'), *key, E::ENTER], + ("Hello,\nwo", "rld!"), + ); + } +} + +#[test] +fn k() { + for key in &[E::from('k'), E::from('-')] { + assert_cursor( + EditMode::Vi, + ("Hello,\nworl", "d!"), + // NOTE: escape moves backwards on char + &[E::ESC, *key, E::ENTER], + ("Hel", "lo,\nworld!"), + ); + assert_cursor( + EditMode::Vi, + ("One\nTwo\nT", "hree"), + // NOTE: escape moves backwards on char + &[E::ESC, E::from('2'), *key, E::ENTER], + ("", "One\nTwo\nThree"), + ); + assert_cursor( + EditMode::Vi, + ("Hello,\nworl", "d!"), + // NOTE: escape moves backwards on char + &[E::ESC, E::from('5'), *key, E::ENTER], + ("Hel", "lo,\nworld!"), + ); + assert_cursor( + EditMode::Vi, + ("first line\nshort\nlong line", ""), + &[E::ESC, *key, E::ENTER], + ("first line\nshort", "\nlong line"), + ); + } +} + +#[test] +fn ctrl_n() { + for key in &[E::ctrl('N')] { + assert_history( + EditMode::Vi, + &["line1", "line2"], + &[E::ESC, E::ctrl('P'), E::ctrl('P'), *key, E::ENTER], + "", + ("line2", ""), + ); + } +} + +#[test] +fn ctrl_p() { + for key in &[E::ctrl('P')] { + assert_history( + EditMode::Vi, + &["line1"], + &[E::ESC, *key, E::ENTER], + "", + ("line1", ""), + ); + } +} + +#[test] +fn p() { + assert_cursor( + EditMode::Vi, + ("Hello, ", "world"), + &[E::ESC, E::ctrl('W'), E::from('p'), E::ENTER], + (" Hello", ",world"), + ); +} + +#[test] +fn uppercase_p() { + assert_cursor( + EditMode::Vi, + ("Hello, ", "world"), + &[E::ESC, E::ctrl('W'), E::from('P'), E::ENTER], + ("Hello", ", world"), + ); +} + +#[test] +fn r() { + assert_cursor( + EditMode::Vi, + ("Hi", ", world!"), + &[E::ESC, E::from('r'), E::from('o'), E::ENTER], + ("H", "o, world!"), + ); + assert_cursor( + EditMode::Vi, + ("He", "llo, world!"), + &[E::ESC, E::from('4'), E::from('r'), E::from('i'), E::ENTER], + ("Hiii", "i, world!"), + ); +} + +#[test] +fn s() { + assert_cursor( + EditMode::Vi, + ("Hi", ", world!"), + &[E::ESC, E::from('s'), E::from('o'), E::ENTER], + ("Ho", ", world!"), + ); + assert_cursor( + EditMode::Vi, + ("He", "llo, world!"), + &[E::ESC, E::from('4'), E::from('s'), E::from('i'), E::ENTER], + ("Hi", ", world!"), + ); +} + +#[test] +fn uppercase_s() { + assert_cursor( + EditMode::Vi, + ("Hello, ", "world"), + &[E::ESC, E::from('S'), E::ENTER], + ("", ""), + ); +} + +#[test] +fn t() { + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('t'), E::from('r'), E::ENTER], + ("Hello, w", "orld!"), + ); + assert_cursor( + EditMode::Vi, + ("", "Hello, world!"), + &[E::ESC, E::from('3'), E::from('t'), E::from('l'), E::ENTER], + ("Hello, wo", "rld!"), + ); +} + +#[test] +fn uppercase_t() { + assert_cursor( + EditMode::Vi, + ("Hello, world!", ""), + &[E::ESC, E::from('T'), E::from('r'), E::ENTER], + ("Hello, wor", "ld!"), + ); + assert_cursor( + EditMode::Vi, + ("Hello, world!", ""), + &[E::ESC, E::from('3'), E::from('T'), E::from('l'), E::ENTER], + ("Hel", "lo, world!"), + ); +} + +#[test] +fn indent() { + assert_cursor( + EditMode::Vi, + ("Hello, world!", ""), + &[E::ESC, E::from('>'), E::from('>'), E::ENTER], + (" Hello, world", "!"), // Esc moves to the left + ); + assert_cursor( + EditMode::Vi, + ("line1\nline2", ""), + &[E::ESC, E::from('>'), E::from('>'), E::ENTER], + ("line1\n line", "2"), // Esc moves to the left + ); + assert_cursor( + EditMode::Vi, + ("line1\nline2", ""), + &[E::ESC, E::from('>'), E::from('k'), E::ENTER], + (" line1\n line", "2"), // Esc moves to the left + ); + assert_cursor( + EditMode::Vi, + (" li", "ne1\n line2"), + &[E::ESC, E::from('>'), E::from('j'), E::ENTER], + (" l", "ine1\n line2"), // Esc moves to the left + ); + assert_cursor( + EditMode::Vi, + (" ", "line1\n line2"), + &[E::ESC, E::from('>'), E::from('j'), E::ENTER], + (" ", " line1\n line2"), // Esc moves to the left + ); + assert_cursor( + EditMode::Vi, + (" ", "line1\n line2"), + &[E::ESC, E::from('>'), E::from('j'), E::ENTER], + (" ", " line1\n line2"), // Esc moves to the left + ); +} + +#[test] +fn dedent() { + assert_cursor( + EditMode::Vi, + (" line1\n line2", ""), + &[E::ESC, E::from('<'), E::from('<'), E::ENTER], + (" line1\nline", "2"), + ); + + assert_cursor( + EditMode::Vi, + (" line1\n line2", ""), + &[E::ESC, E::from('<'), E::from('k'), E::ENTER], + ("line1\nline", "2"), + ); + + assert_cursor( + EditMode::Vi, + (" li", "ne1\n line2"), + &[E::ESC, E::from('<'), E::from('j'), E::ENTER], + ("l", "ine1\nline2"), + ); + + assert_cursor( + EditMode::Vi, + (" ", "line1\n line2"), + &[E::ESC, E::from('<'), E::from('j'), E::ENTER], + ("", "line1\nline2"), + ); + assert_cursor( + EditMode::Vi, + ("line", "1\n line2"), + &[E::ESC, E::from('<'), E::from('j'), E::ENTER], + ("lin", "e1\nline2"), + ); +} diff --git a/rustyline-15.0.0/src/test/vi_insert.rs b/rustyline-15.0.0/src/test/vi_insert.rs new file mode 100644 index 0000000000..8a18529631 --- /dev/null +++ b/rustyline-15.0.0/src/test/vi_insert.rs @@ -0,0 +1,46 @@ +//! Vi insert mode specific key bindings +use super::assert_cursor; +use crate::config::EditMode; +use crate::keys::KeyEvent as E; + +#[test] +fn insert_mode_by_default() { + assert_cursor(EditMode::Vi, ("", ""), &[E::from('a'), E::ENTER], ("a", "")); +} + +#[test] +fn ctrl_h() { + assert_cursor( + EditMode::Vi, + ("Hi", ""), + &[E::ctrl('H'), E::ENTER], + ("H", ""), + ); +} + +#[test] +fn backspace() { + assert_cursor(EditMode::Vi, ("", ""), &[E::BACKSPACE, E::ENTER], ("", "")); + assert_cursor( + EditMode::Vi, + ("Hi", ""), + &[E::BACKSPACE, E::ENTER], + ("H", ""), + ); + assert_cursor( + EditMode::Vi, + ("", "Hi"), + &[E::BACKSPACE, E::ENTER], + ("", "Hi"), + ); +} + +#[test] +fn esc() { + assert_cursor( + EditMode::Vi, + ("", ""), + &[E::from('a'), E::ESC, E::ENTER], + ("", "a"), + ); +} diff --git a/rustyline-15.0.0/src/tty/mod.rs b/rustyline-15.0.0/src/tty/mod.rs new file mode 100644 index 0000000000..22dcb8a2be --- /dev/null +++ b/rustyline-15.0.0/src/tty/mod.rs @@ -0,0 +1,220 @@ +//! This module implements and describes common TTY methods & traits + +use unicode_width::UnicodeWidthStr; + +use crate::config::{Behavior, BellStyle, ColorMode, Config}; +use crate::highlight::Highlighter; +use crate::keys::KeyEvent; +use crate::layout::{Layout, Position}; +use crate::line_buffer::LineBuffer; +use crate::{Cmd, Result}; + +/// Terminal state +pub trait RawMode: Sized { + /// Disable RAW mode for the terminal. + fn disable_raw_mode(&self) -> Result<()>; +} + +/// Input event +pub enum Event { + KeyPress(KeyEvent), + ExternalPrint(String), +} + +/// Translate bytes read from stdin to keys. +pub trait RawReader { + type Buffer; + /// Blocking wait for either a key press or an external print + fn wait_for_input(&mut self, single_esc_abort: bool) -> Result; // TODO replace calls to `next_key` by `wait_for_input` where relevant + /// Blocking read of key pressed. + fn next_key(&mut self, single_esc_abort: bool) -> Result; + /// For CTRL-V support + #[cfg(unix)] + fn next_char(&mut self) -> Result; + /// Bracketed paste + fn read_pasted_text(&mut self) -> Result; + /// Check if `key` is bound to a peculiar command + fn find_binding(&self, key: &KeyEvent) -> Option; + /// Backup type ahead + fn unbuffer(self) -> Option; +} + +/// Display prompt, line and cursor in terminal output +pub trait Renderer { + type Reader: RawReader; + + fn move_cursor(&mut self, old: Position, new: Position) -> Result<()>; + + /// Display `prompt`, line and cursor in terminal output + fn refresh_line( + &mut self, + prompt: &str, + line: &LineBuffer, + hint: Option<&str>, + old_layout: &Layout, + new_layout: &Layout, + highlighter: Option<&dyn Highlighter>, + ) -> Result<()>; + + /// Compute layout for rendering prompt + line + some info (either hint, + /// validation msg, ...). on the screen. Depending on screen width, line + /// wrapping may be applied. + fn compute_layout( + &self, + prompt_size: Position, + default_prompt: bool, + line: &LineBuffer, + info: Option<&str>, + ) -> Layout { + // calculate the desired position of the cursor + let pos = line.pos(); + let cursor = self.calculate_position(&line[..pos], prompt_size); + // calculate the position of the end of the input line + let mut end = if pos == line.len() { + cursor + } else { + self.calculate_position(&line[pos..], cursor) + }; + if let Some(info) = info { + end = self.calculate_position(info, end); + } + + let new_layout = Layout { + prompt_size, + default_prompt, + cursor, + end, + }; + debug_assert!(new_layout.prompt_size <= new_layout.cursor); + debug_assert!(new_layout.cursor <= new_layout.end); + new_layout + } + + /// Calculate the number of columns and rows used to display `s` on a + /// `cols` width terminal starting at `orig`. + fn calculate_position(&self, s: &str, orig: Position) -> Position; + + fn write_and_flush(&mut self, buf: &str) -> Result<()>; + + /// Beep, used for completion when there is nothing to complete or when all + /// the choices were already shown. + fn beep(&mut self) -> Result<()>; + + /// Clear the screen. Used to handle ctrl+l + fn clear_screen(&mut self) -> Result<()>; + /// Clear rows used by prompt and edited line + fn clear_rows(&mut self, layout: &Layout) -> Result<()>; + + /// Update the number of columns/rows in the current terminal. + fn update_size(&mut self); + /// Get the number of columns in the current terminal. + fn get_columns(&self) -> usize; + /// Get the number of rows in the current terminal. + fn get_rows(&self) -> usize; + /// Check if output supports colors. + fn colors_enabled(&self) -> bool; + + /// Make sure prompt is at the leftmost edge of the screen + fn move_cursor_at_leftmost(&mut self, rdr: &mut Self::Reader) -> Result<()>; +} + +// ignore ANSI escape sequence +fn width(s: &str, esc_seq: &mut u8) -> usize { + if *esc_seq == 1 { + if s == "[" { + // CSI + *esc_seq = 2; + } else { + // two-character sequence + *esc_seq = 0; + } + 0 + } else if *esc_seq == 2 { + if s == ";" || (s.as_bytes()[0] >= b'0' && s.as_bytes()[0] <= b'9') { + /*} else if s == "m" { + // last + *esc_seq = 0;*/ + } else { + // not supported + *esc_seq = 0; + } + 0 + } else if s == "\x1b" { + *esc_seq = 1; + 0 + } else if s == "\n" { + 0 + } else { + s.width() + } +} + +/// External printer +pub trait ExternalPrinter { + /// Print message to stdout + fn print(&mut self, msg: String) -> Result<()>; +} + +/// Terminal contract +pub trait Term { + type Buffer; + type KeyMap; + type Reader: RawReader; // rl_instream + type Writer: Renderer; // rl_outstream + type Mode: RawMode; + type ExternalPrinter: ExternalPrinter; + type CursorGuard; + + fn new( + color_mode: ColorMode, + behavior: Behavior, + tab_stop: usize, + bell_style: BellStyle, + enable_bracketed_paste: bool, + enable_signals: bool, + ) -> Result + where + Self: Sized; + /// Check if current terminal can provide a rich line-editing user + /// interface. + fn is_unsupported(&self) -> bool; + /// check if input stream is connected to a terminal. + fn is_input_tty(&self) -> bool; + /// check if output stream is connected to a terminal. + fn is_output_tty(&self) -> bool; + /// Enable RAW mode for the terminal. + fn enable_raw_mode(&mut self) -> Result<(Self::Mode, Self::KeyMap)>; + /// Create a RAW reader + fn create_reader( + &self, + buffer: Option, + config: &Config, + key_map: Self::KeyMap, + ) -> Self::Reader; + /// Create a writer + fn create_writer(&self) -> Self::Writer; + fn writeln(&self) -> Result<()>; + /// Create an external printer + fn create_external_printer(&mut self) -> Result; + /// Change cursor visibility + fn set_cursor_visibility(&mut self, visible: bool) -> Result>; +} + +// If on Windows platform import Windows TTY module +// and re-export into mod.rs scope +#[cfg(all(windows, not(target_arch = "wasm32")))] +mod windows; +#[cfg(all(windows, not(target_arch = "wasm32"), not(test)))] +pub use self::windows::*; + +// If on Unix platform import Unix TTY module +// and re-export into mod.rs scope +#[cfg(all(unix, not(target_arch = "wasm32")))] +mod unix; +#[cfg(all(unix, not(target_arch = "wasm32"), not(test)))] +pub use self::unix::*; + +#[cfg(any(test, target_arch = "wasm32"))] +mod test; +#[cfg(any(test, target_arch = "wasm32"))] +pub use self::test::*; diff --git a/rustyline-15.0.0/src/tty/test.rs b/rustyline-15.0.0/src/tty/test.rs new file mode 100644 index 0000000000..3478baf9fa --- /dev/null +++ b/rustyline-15.0.0/src/tty/test.rs @@ -0,0 +1,249 @@ +//! Tests specific definitions +use std::slice::Iter; +use std::vec::IntoIter; + +use super::{Event, ExternalPrinter, RawMode, RawReader, Renderer, Term}; +use crate::config::{Behavior, BellStyle, ColorMode, Config}; +use crate::error::ReadlineError; +use crate::highlight::Highlighter; +use crate::keys::KeyEvent; +use crate::layout::{Layout, Position}; +use crate::line_buffer::LineBuffer; +use crate::{Cmd, Result}; + +pub type Buffer = (); +pub type KeyMap = (); +pub type Mode = (); + +impl RawMode for Mode { + fn disable_raw_mode(&self) -> Result<()> { + Ok(()) + } +} + +impl RawReader for Iter<'_, KeyEvent> { + type Buffer = Buffer; + + fn wait_for_input(&mut self, single_esc_abort: bool) -> Result { + self.next_key(single_esc_abort).map(Event::KeyPress) + } + + fn next_key(&mut self, _: bool) -> Result { + match self.next() { + Some(key) => Ok(*key), + None => Err(ReadlineError::Eof), + } + } + + #[cfg(unix)] + fn next_char(&mut self) -> Result { + unimplemented!(); + } + + fn read_pasted_text(&mut self) -> Result { + unimplemented!() + } + + fn find_binding(&self, _: &KeyEvent) -> Option { + None + } + + fn unbuffer(self) -> Option { + None + } +} + +impl RawReader for IntoIter { + type Buffer = Buffer; + + fn wait_for_input(&mut self, single_esc_abort: bool) -> Result { + self.next_key(single_esc_abort).map(Event::KeyPress) + } + + fn next_key(&mut self, _: bool) -> Result { + match self.next() { + Some(key) => Ok(key), + None => Err(ReadlineError::Eof), + } + } + + #[cfg(unix)] + fn next_char(&mut self) -> Result { + use crate::keys::{KeyCode as K, KeyEvent as E, Modifiers as M}; + match self.next() { + Some(E(K::Char(c), M::NONE)) => Ok(c), + None => Err(ReadlineError::Eof), + _ => unimplemented!(), + } + } + + fn read_pasted_text(&mut self) -> Result { + unimplemented!() + } + + fn find_binding(&self, _: &KeyEvent) -> Option { + None + } + + fn unbuffer(self) -> Option { + None + } +} + +#[derive(Default)] +pub struct Sink {} + +impl Renderer for Sink { + type Reader = IntoIter; + + fn move_cursor(&mut self, _: Position, _: Position) -> Result<()> { + Ok(()) + } + + fn refresh_line( + &mut self, + _prompt: &str, + _line: &LineBuffer, + _hint: Option<&str>, + _old_layout: &Layout, + _new_layout: &Layout, + _highlighter: Option<&dyn Highlighter>, + ) -> Result<()> { + Ok(()) + } + + fn calculate_position(&self, s: &str, orig: Position) -> Position { + let mut pos = orig; + pos.col += s.len(); + pos + } + + fn write_and_flush(&mut self, _: &str) -> Result<()> { + Ok(()) + } + + fn beep(&mut self) -> Result<()> { + Ok(()) + } + + fn clear_screen(&mut self) -> Result<()> { + Ok(()) + } + + fn clear_rows(&mut self, _: &Layout) -> Result<()> { + Ok(()) + } + + fn update_size(&mut self) {} + + fn get_columns(&self) -> usize { + 80 + } + + fn get_rows(&self) -> usize { + 24 + } + + fn colors_enabled(&self) -> bool { + false + } + + fn move_cursor_at_leftmost(&mut self, _: &mut IntoIter) -> Result<()> { + Ok(()) + } +} + +pub struct DummyExternalPrinter {} + +impl ExternalPrinter for DummyExternalPrinter { + fn print(&mut self, _msg: String) -> Result<()> { + Ok(()) + } +} + +pub type Terminal = DummyTerminal; + +#[derive(Clone, Debug)] +pub struct DummyTerminal { + pub keys: Vec, + pub cursor: usize, // cursor position before last command + pub color_mode: ColorMode, + pub bell_style: BellStyle, +} + +impl Term for DummyTerminal { + type Buffer = Buffer; + type CursorGuard = (); + type ExternalPrinter = DummyExternalPrinter; + type KeyMap = KeyMap; + type Mode = Mode; + type Reader = IntoIter; + type Writer = Sink; + + fn new( + color_mode: ColorMode, + _behavior: Behavior, + _tab_stop: usize, + bell_style: BellStyle, + _enable_bracketed_paste: bool, + _enable_signals: bool, + ) -> Result { + Ok(Self { + keys: vec![], + cursor: 0, + color_mode, + bell_style, + }) + } + + // Init checks: + + #[cfg(not(target_arch = "wasm32"))] + fn is_unsupported(&self) -> bool { + false + } + + #[cfg(target_arch = "wasm32")] + fn is_unsupported(&self) -> bool { + true + } + + fn is_input_tty(&self) -> bool { + true + } + + fn is_output_tty(&self) -> bool { + false + } + + // Interactive loop: + + fn enable_raw_mode(&mut self) -> Result<(Mode, KeyMap)> { + Ok(((), ())) + } + + fn create_reader(&self, _: Option, _: &Config, _: KeyMap) -> Self::Reader { + self.keys.clone().into_iter() + } + + fn create_writer(&self) -> Sink { + Sink::default() + } + + fn create_external_printer(&mut self) -> Result { + Ok(DummyExternalPrinter {}) + } + + fn set_cursor_visibility(&mut self, _: bool) -> Result> { + Ok(None) + } + + fn writeln(&self) -> Result<()> { + Ok(()) + } +} + +#[cfg(unix)] +pub fn suspend() -> Result<()> { + Ok(()) +} diff --git a/rustyline-15.0.0/src/tty/unix.rs b/rustyline-15.0.0/src/tty/unix.rs new file mode 100644 index 0000000000..f08d700b57 --- /dev/null +++ b/rustyline-15.0.0/src/tty/unix.rs @@ -0,0 +1,1704 @@ +//! Unix specific definitions +#[cfg(feature = "buffer-redux")] +use buffer_redux::BufReader; +use std::cmp; +use std::collections::HashMap; +use std::fs::{File, OpenOptions}; +#[cfg(not(feature = "buffer-redux"))] +use std::io::BufReader; +use std::io::{self, ErrorKind, Read, Write}; +use std::os::unix::io::{AsFd, AsRawFd, BorrowedFd, IntoRawFd, RawFd}; +use std::os::unix::net::UnixStream; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::mpsc::{self, SyncSender}; +use std::sync::{Arc, Mutex}; + +use log::{debug, warn}; +use nix::errno::Errno; +use nix::poll::{self, PollFlags, PollTimeout}; +use nix::sys::select::{self, FdSet}; +#[cfg(not(feature = "termios"))] +use nix::sys::termios::Termios; +use nix::unistd::{close, isatty, read, write}; +#[cfg(feature = "termios")] +use termios::Termios; +use unicode_segmentation::UnicodeSegmentation; +use utf8parse::{Parser, Receiver}; + +use super::{width, Event, RawMode, RawReader, Renderer, Term}; +use crate::config::{Behavior, BellStyle, ColorMode, Config}; +use crate::highlight::Highlighter; +use crate::keys::{KeyCode as K, KeyEvent, KeyEvent as E, Modifiers as M}; +use crate::layout::{Layout, Position}; +use crate::line_buffer::LineBuffer; +use crate::{error, Cmd, ReadlineError, Result}; + +/// Unsupported Terminals that don't support RAW mode +const UNSUPPORTED_TERM: [&str; 3] = ["dumb", "cons25", "emacs"]; + +const BRACKETED_PASTE_ON: &str = "\x1b[?2004h"; +const BRACKETED_PASTE_OFF: &str = "\x1b[?2004l"; + +nix::ioctl_read_bad!(win_size, libc::TIOCGWINSZ, libc::winsize); + +fn get_win_size(fd: RawFd) -> (usize, usize) { + use std::mem::zeroed; + + if cfg!(test) { + return (80, 24); + } + + unsafe { + let mut size: libc::winsize = zeroed(); + match win_size(fd, &mut size) { + Ok(0) => { + // In linux pseudo-terminals are created with dimensions of + // zero. If host application didn't initialize the correct + // size before start we treat zero size as 80 columns and + // infinite rows + let cols = if size.ws_col == 0 { + 80 + } else { + size.ws_col as usize + }; + let rows = if size.ws_row == 0 { + usize::MAX + } else { + size.ws_row as usize + }; + (cols, rows) + } + _ => (80, 24), + } + } +} + +/// Check TERM environment variable to see if current term is in our +/// unsupported list +fn is_unsupported_term() -> bool { + match std::env::var("TERM") { + Ok(term) => { + for iter in &UNSUPPORTED_TERM { + if (*iter).eq_ignore_ascii_case(&term) { + return true; + } + } + false + } + Err(_) => false, + } +} + +/// Return whether or not STDIN, STDOUT or STDERR is a TTY +fn is_a_tty(fd: RawFd) -> bool { + isatty(fd).unwrap_or(false) +} + +#[cfg(any(not(feature = "buffer-redux"), test))] +pub type PosixBuffer = (); +#[cfg(all(feature = "buffer-redux", not(test)))] +pub type PosixBuffer = buffer_redux::Buffer; +#[cfg(not(test))] +pub type Buffer = PosixBuffer; + +pub type PosixKeyMap = HashMap; +#[cfg(not(test))] +pub type KeyMap = PosixKeyMap; + +#[must_use = "You must restore default mode (disable_raw_mode)"] +pub struct PosixMode { + termios: Termios, + tty_in: RawFd, + tty_out: Option, + raw_mode: Arc, +} + +#[cfg(not(test))] +pub type Mode = PosixMode; + +impl RawMode for PosixMode { + /// Disable RAW mode for the terminal. + fn disable_raw_mode(&self) -> Result<()> { + termios_::disable_raw_mode(self.tty_in, &self.termios)?; + // disable bracketed paste + if let Some(out) = self.tty_out { + write_all(out, BRACKETED_PASTE_OFF)?; + } + self.raw_mode.store(false, Ordering::SeqCst); + Ok(()) + } +} + +// Rust std::io::Stdin is buffered with no way to know if bytes are available. +// So we use low-level stuff instead... +struct TtyIn { + fd: RawFd, + sigwinch_pipe: Option, +} + +impl Read for TtyIn { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + loop { + let res = unsafe { + libc::read( + self.fd, + buf.as_mut_ptr().cast::(), + buf.len() as libc::size_t, + ) + }; + if res == -1 { + let error = io::Error::last_os_error(); + if error.kind() == ErrorKind::Interrupted && self.sigwinch()? { + return Err(io::Error::new( + ErrorKind::Interrupted, + error::WindowResizedError, + )); + } else if error.kind() != ErrorKind::Interrupted { + return Err(error); + } + } else { + #[expect(clippy::cast_sign_loss)] + return Ok(res as usize); + } + } + } +} + +impl TtyIn { + /// Check if a SIGWINCH signal has been received + fn sigwinch(&self) -> nix::Result { + if let Some(pipe) = self.sigwinch_pipe { + let mut buf = [0u8; 64]; + match read(pipe, &mut buf) { + Ok(0) => Ok(false), + Ok(_) => Ok(true), + Err(e) if e == Errno::EWOULDBLOCK || e == Errno::EINTR => Ok(false), + Err(e) => Err(e), + } + } else { + Ok(false) + } + } +} + +// (native receiver with a selectable file descriptor, actual message receiver) +type PipeReader = Arc)>>; +// (native sender, actual message sender) +type PipeWriter = (Arc>, SyncSender); + +/// Console input reader +pub struct PosixRawReader { + tty_in: BufReader, + timeout_ms: PollTimeout, + parser: Parser, + key_map: PosixKeyMap, + // external print reader + pipe_reader: Option, +} + +impl AsFd for PosixRawReader { + fn as_fd(&self) -> BorrowedFd<'_> { + let fd = self.tty_in.get_ref().fd; + unsafe { BorrowedFd::borrow_raw(fd) } + } +} + +struct Utf8 { + c: Option, + valid: bool, +} + +const UP: char = 'A'; // kcuu1, kUP* +const DOWN: char = 'B'; // kcud1, kDN* +const RIGHT: char = 'C'; // kcuf1, kRIT* +const LEFT: char = 'D'; // kcub1, kLFT* +const END: char = 'F'; // kend* +const HOME: char = 'H'; // khom* +const INSERT: char = '2'; // kic* +const DELETE: char = '3'; // kdch1, kDC* +const PAGE_UP: char = '5'; // kpp, kPRV* +const PAGE_DOWN: char = '6'; // knp, kNXT* + +const RXVT_HOME: char = '7'; +const RXVT_END: char = '8'; + +const SHIFT: char = '2'; +const ALT: char = '3'; +const ALT_SHIFT: char = '4'; +const CTRL: char = '5'; +const CTRL_SHIFT: char = '6'; +const CTRL_ALT: char = '7'; +const CTRL_ALT_SHIFT: char = '8'; + +const RXVT_SHIFT: char = '$'; +const RXVT_CTRL: char = '\x1e'; +const RXVT_CTRL_SHIFT: char = '@'; + +impl PosixRawReader { + fn new( + fd: RawFd, + sigwinch_pipe: Option, + buffer: Option, + config: &Config, + key_map: PosixKeyMap, + pipe_reader: Option, + ) -> Self { + let inner = TtyIn { fd, sigwinch_pipe }; + #[cfg(any(not(feature = "buffer-redux"), test))] + let (tty_in, _) = (BufReader::with_capacity(1024, inner), buffer); + #[cfg(all(feature = "buffer-redux", not(test)))] + let tty_in = if let Some(buffer) = buffer { + BufReader::with_buffer(buffer, inner) + } else { + BufReader::with_capacity(1024, inner) + }; + Self { + tty_in, + timeout_ms: config.keyseq_timeout().into(), + parser: Parser::new(), + key_map, + pipe_reader, + } + } + + /// Handle \E sequences + // https://invisible-island.net/xterm/xterm-function-keys.html + fn escape_sequence(&mut self) -> Result { + self._do_escape_sequence(true) + } + + /// Don't call directly, call `PosixRawReader::escape_sequence` instead + fn _do_escape_sequence(&mut self, allow_recurse: bool) -> Result { + // Read the next byte representing the escape sequence. + let seq1 = self.next_char()?; + if seq1 == '[' { + // \E[ sequences. (CSI) + self.escape_csi() + } else if seq1 == 'O' { + // xterm + // \EO sequences. (SS3) + self.escape_o() + } else if seq1 == '\x1b' { + // \E\E — used by rxvt, iTerm (under default config), etc. + // ``` + // \E\E[A => Alt-Up + // \E\E[B => Alt-Down + // \E\E[C => Alt-Right + // \E\E[D => Alt-Left + // ``` + // + // In general this more or less works just adding ALT to an existing + // key, but has a wrinkle in that `ESC ESC` without anything + // following should be interpreted as the the escape key. + // + // We handle this by polling to see if there's anything coming + // within our timeout, and if so, recursing once, but adding alt to + // what we read. + if !allow_recurse { + return Ok(E::ESC); + } + let timeout = if self.timeout_ms.is_none() { + 100u8.into() + } else { + self.timeout_ms + }; + match self.poll(timeout) { + // Ignore poll errors, it's very likely we'll pick them up on + // the next read anyway. + Ok(0) | Err(_) => Ok(E::ESC), + Ok(n) => { + debug_assert!(n > 0, "{}", n); + // recurse, and add the alt modifier. + let E(k, m) = self._do_escape_sequence(false)?; + Ok(E(k, m | M::ALT)) + } + } + } else { + Ok(E::alt(seq1)) + } + } + + /// Handle \E[ escape sequences + fn escape_csi(&mut self) -> Result { + let seq2 = self.next_char()?; + if seq2.is_ascii_digit() { + match seq2 { + '0' | '9' => { + debug!(target: "rustyline", "unsupported esc sequence: \\E[{:?}", seq2); + Ok(E(K::UnknownEscSeq, M::NONE)) + } + _ => { + // Extended escape, read additional byte. + self.extended_escape(seq2) + } + } + } else if seq2 == '[' { + let seq3 = self.next_char()?; + // Linux console + Ok(match seq3 { + 'A' => E(K::F(1), M::NONE), + 'B' => E(K::F(2), M::NONE), + 'C' => E(K::F(3), M::NONE), + 'D' => E(K::F(4), M::NONE), + 'E' => E(K::F(5), M::NONE), + _ => { + debug!(target: "rustyline", "unsupported esc sequence: \\E[[{:?}", seq3); + E(K::UnknownEscSeq, M::NONE) + } + }) + } else { + // ANSI + Ok(match seq2 { + UP => E(K::Up, M::NONE), + DOWN => E(K::Down, M::NONE), + RIGHT => E(K::Right, M::NONE), + LEFT => E(K::Left, M::NONE), + //'E' => E(K::, M::), // Ignore + END => E(K::End, M::NONE), + //'G' => E(K::, M::), // Ignore + HOME => E(K::Home, M::NONE), // khome + //'J' => E(K::, M::), // clr_eos + //'K' => E(K::, M::), // clr_eol + //'L' => E(K::, M::), // il1 + //'M' => E(K::, M::), // kmous + //'P' => E(K::Delete, M::NONE), // dch1 + 'Z' => E(K::BackTab, M::NONE), + 'a' => E(K::Up, M::SHIFT), // rxvt: kind or kUP + 'b' => E(K::Down, M::SHIFT), // rxvt: kri or kDN + 'c' => E(K::Right, M::SHIFT), // rxvt + 'd' => E(K::Left, M::SHIFT), // rxvt + _ => { + debug!(target: "rustyline", "unsupported esc sequence: \\E[{:?}", seq2); + E(K::UnknownEscSeq, M::NONE) + } + }) + } + } + + /// Handle \E[ escape sequences + #[expect(clippy::cognitive_complexity)] + fn extended_escape(&mut self, seq2: char) -> Result { + let seq3 = self.next_char()?; + if seq3 == '~' { + Ok(match seq2 { + '1' | RXVT_HOME => E(K::Home, M::NONE), // tmux, xrvt + INSERT => E(K::Insert, M::NONE), + DELETE => E(K::Delete, M::NONE), + '4' | RXVT_END => E(K::End, M::NONE), // tmux, xrvt + PAGE_UP => E(K::PageUp, M::NONE), + PAGE_DOWN => E(K::PageDown, M::NONE), + _ => { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{}~", seq2); + E(K::UnknownEscSeq, M::NONE) + } + }) + } else if seq3.is_ascii_digit() { + let seq4 = self.next_char()?; + if seq4 == '~' { + Ok(match (seq2, seq3) { + ('1', '1') => E(K::F(1), M::NONE), // rxvt-unicode + ('1', '2') => E(K::F(2), M::NONE), // rxvt-unicode + ('1', '3') => E(K::F(3), M::NONE), // rxvt-unicode + ('1', '4') => E(K::F(4), M::NONE), // rxvt-unicode + ('1', '5') => E(K::F(5), M::NONE), // kf5 + ('1', '7') => E(K::F(6), M::NONE), // kf6 + ('1', '8') => E(K::F(7), M::NONE), // kf7 + ('1', '9') => E(K::F(8), M::NONE), // kf8 + ('2', '0') => E(K::F(9), M::NONE), // kf9 + ('2', '1') => E(K::F(10), M::NONE), // kf10 + ('2', '3') => E(K::F(11), M::NONE), // kf11 + ('2', '4') => E(K::F(12), M::NONE), // kf12 + //('6', '2') => KeyCode::ScrollUp, + //('6', '3') => KeyCode::ScrollDown, + _ => { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{}{}~", seq2, seq3); + E(K::UnknownEscSeq, M::NONE) + } + }) + } else if seq4 == ';' { + let seq5 = self.next_char()?; + if seq5.is_ascii_digit() { + let seq6 = self.next_char()?; + if seq6.is_ascii_digit() { + self.next_char()?; // 'R' expected + Ok(E(K::UnknownEscSeq, M::NONE)) + } else if seq6 == 'R' { + Ok(E(K::UnknownEscSeq, M::NONE)) + } else if seq6 == '~' { + Ok(match (seq2, seq3, seq5) { + ('1', '5', CTRL) => E(K::F(5), M::CTRL), + //('1', '5', '6') => E(K::F(17), M::CTRL), + ('1', '7', CTRL) => E(K::F(6), M::CTRL), + //('1', '7', '6') => E(K::F(18), M::CTRL), + ('1', '8', CTRL) => E(K::F(7), M::CTRL), + ('1', '9', CTRL) => E(K::F(8), M::CTRL), + //('1', '9', '6') => E(K::F(19), M::CTRL), + ('2', '0', CTRL) => E(K::F(9), M::CTRL), + //('2', '0', '6') => E(K::F(21), M::CTRL), + ('2', '1', CTRL) => E(K::F(10), M::CTRL), + //('2', '1', '6') => E(K::F(22), M::CTRL), + ('2', '3', CTRL) => E(K::F(11), M::CTRL), + //('2', '3', '6') => E(K::F(23), M::CTRL), + ('2', '4', CTRL) => E(K::F(12), M::CTRL), + //('2', '4', '6') => E(K::F(24), M::CTRL), + _ => { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{}{};{}~", seq2, seq3, seq5); + E(K::UnknownEscSeq, M::NONE) + } + }) + } else { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{}{};{}{}", seq2, seq3, seq5, seq6); + Ok(E(K::UnknownEscSeq, M::NONE)) + } + } else { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{}{};{:?}", seq2, seq3, seq5); + Ok(E(K::UnknownEscSeq, M::NONE)) + } + } else if seq4.is_ascii_digit() { + let seq5 = self.next_char()?; + if seq5 == '~' { + Ok(match (seq2, seq3, seq4) { + ('2', '0', '0') => E(K::BracketedPasteStart, M::NONE), + ('2', '0', '1') => E(K::BracketedPasteEnd, M::NONE), + _ => { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{}{}{}~", seq2, seq3, seq4); + E(K::UnknownEscSeq, M::NONE) + } + }) + } else { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{}{}{}{}", seq2, seq3, seq4, seq5); + Ok(E(K::UnknownEscSeq, M::NONE)) + } + } else { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{}{}{:?}", seq2, seq3, seq4); + Ok(E(K::UnknownEscSeq, M::NONE)) + } + } else if seq3 == ';' { + let seq4 = self.next_char()?; + if seq4.is_ascii_digit() { + let seq5 = self.next_char()?; + if seq5.is_ascii_digit() { + self.next_char()?; // 'R' expected + //('1', '0', UP) => E(K::, M::), // Alt + Shift + Up + Ok(E(K::UnknownEscSeq, M::NONE)) + } else if seq2 == '1' { + Ok(match (seq4, seq5) { + (SHIFT, UP) => E(K::Up, M::SHIFT), // ~ key_sr + (SHIFT, DOWN) => E(K::Down, M::SHIFT), // ~ key_sf + (SHIFT, RIGHT) => E(K::Right, M::SHIFT), + (SHIFT, LEFT) => E(K::Left, M::SHIFT), + (SHIFT, END) => E(K::End, M::SHIFT), // kEND + (SHIFT, HOME) => E(K::Home, M::SHIFT), // kHOM + //('2', 'P') => E(K::F(13), M::NONE), + //('2', 'Q') => E(K::F(14), M::NONE), + //('2', 'S') => E(K::F(16), M::NONE), + (ALT, UP) => E(K::Up, M::ALT), + (ALT, DOWN) => E(K::Down, M::ALT), + (ALT, RIGHT) => E(K::Right, M::ALT), + (ALT, LEFT) => E(K::Left, M::ALT), + (ALT, END) => E(K::End, M::ALT), + (ALT, HOME) => E(K::Home, M::ALT), + (ALT_SHIFT, UP) => E(K::Up, M::ALT_SHIFT), + (ALT_SHIFT, DOWN) => E(K::Down, M::ALT_SHIFT), + (ALT_SHIFT, RIGHT) => E(K::Right, M::ALT_SHIFT), + (ALT_SHIFT, LEFT) => E(K::Left, M::ALT_SHIFT), + (ALT_SHIFT, END) => E(K::End, M::ALT_SHIFT), + (ALT_SHIFT, HOME) => E(K::Home, M::ALT_SHIFT), + (CTRL, UP) => E(K::Up, M::CTRL), + (CTRL, DOWN) => E(K::Down, M::CTRL), + (CTRL, RIGHT) => E(K::Right, M::CTRL), + (CTRL, LEFT) => E(K::Left, M::CTRL), + (CTRL, END) => E(K::End, M::CTRL), + (CTRL, HOME) => E(K::Home, M::CTRL), + (CTRL, 'P') => E(K::F(1), M::CTRL), + (CTRL, 'Q') => E(K::F(2), M::CTRL), + (CTRL, 'S') => E(K::F(4), M::CTRL), + (CTRL, 'p') => E(K::Char('0'), M::CTRL), + (CTRL, 'q') => E(K::Char('1'), M::CTRL), + (CTRL, 'r') => E(K::Char('2'), M::CTRL), + (CTRL, 's') => E(K::Char('3'), M::CTRL), + (CTRL, 't') => E(K::Char('4'), M::CTRL), + (CTRL, 'u') => E(K::Char('5'), M::CTRL), + (CTRL, 'v') => E(K::Char('6'), M::CTRL), + (CTRL, 'w') => E(K::Char('7'), M::CTRL), + (CTRL, 'x') => E(K::Char('8'), M::CTRL), + (CTRL, 'y') => E(K::Char('9'), M::CTRL), + (CTRL_SHIFT, UP) => E(K::Up, M::CTRL_SHIFT), + (CTRL_SHIFT, DOWN) => E(K::Down, M::CTRL_SHIFT), + (CTRL_SHIFT, RIGHT) => E(K::Right, M::CTRL_SHIFT), + (CTRL_SHIFT, LEFT) => E(K::Left, M::CTRL_SHIFT), + (CTRL_SHIFT, END) => E(K::End, M::CTRL_SHIFT), + (CTRL_SHIFT, HOME) => E(K::Home, M::CTRL_SHIFT), + //('6', 'P') => E(K::F(13), M::CTRL), + //('6', 'Q') => E(K::F(14), M::CTRL), + //('6', 'S') => E(K::F(16), M::CTRL), + (CTRL_SHIFT, 'p') => E(K::Char('0'), M::CTRL_SHIFT), + (CTRL_SHIFT, 'q') => E(K::Char('1'), M::CTRL_SHIFT), + (CTRL_SHIFT, 'r') => E(K::Char('2'), M::CTRL_SHIFT), + (CTRL_SHIFT, 's') => E(K::Char('3'), M::CTRL_SHIFT), + (CTRL_SHIFT, 't') => E(K::Char('4'), M::CTRL_SHIFT), + (CTRL_SHIFT, 'u') => E(K::Char('5'), M::CTRL_SHIFT), + (CTRL_SHIFT, 'v') => E(K::Char('6'), M::CTRL_SHIFT), + (CTRL_SHIFT, 'w') => E(K::Char('7'), M::CTRL_SHIFT), + (CTRL_SHIFT, 'x') => E(K::Char('8'), M::CTRL_SHIFT), + (CTRL_SHIFT, 'y') => E(K::Char('9'), M::CTRL_SHIFT), + (CTRL_ALT, UP) => E(K::Up, M::CTRL_ALT), + (CTRL_ALT, DOWN) => E(K::Down, M::CTRL_ALT), + (CTRL_ALT, RIGHT) => E(K::Right, M::CTRL_ALT), + (CTRL_ALT, LEFT) => E(K::Left, M::CTRL_ALT), + (CTRL_ALT, END) => E(K::End, M::CTRL_ALT), + (CTRL_ALT, HOME) => E(K::Home, M::CTRL_ALT), + (CTRL_ALT, 'p') => E(K::Char('0'), M::CTRL_ALT), + (CTRL_ALT, 'q') => E(K::Char('1'), M::CTRL_ALT), + (CTRL_ALT, 'r') => E(K::Char('2'), M::CTRL_ALT), + (CTRL_ALT, 's') => E(K::Char('3'), M::CTRL_ALT), + (CTRL_ALT, 't') => E(K::Char('4'), M::CTRL_ALT), + (CTRL_ALT, 'u') => E(K::Char('5'), M::CTRL_ALT), + (CTRL_ALT, 'v') => E(K::Char('6'), M::CTRL_ALT), + (CTRL_ALT, 'w') => E(K::Char('7'), M::CTRL_ALT), + (CTRL_ALT, 'x') => E(K::Char('8'), M::CTRL_ALT), + (CTRL_ALT, 'y') => E(K::Char('9'), M::CTRL_ALT), + (CTRL_ALT_SHIFT, UP) => E(K::Up, M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, DOWN) => E(K::Down, M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, RIGHT) => E(K::Right, M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, LEFT) => E(K::Left, M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, END) => E(K::End, M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, HOME) => E(K::Home, M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, 'p') => E(K::Char('0'), M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, 'q') => E(K::Char('1'), M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, 'r') => E(K::Char('2'), M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, 's') => E(K::Char('3'), M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, 't') => E(K::Char('4'), M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, 'u') => E(K::Char('5'), M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, 'v') => E(K::Char('6'), M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, 'w') => E(K::Char('7'), M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, 'x') => E(K::Char('8'), M::CTRL_ALT_SHIFT), + (CTRL_ALT_SHIFT, 'y') => E(K::Char('9'), M::CTRL_ALT_SHIFT), + // Meta + arrow on (some?) Macs when using iTerm defaults + ('9', UP) => E(K::Up, M::ALT), + ('9', DOWN) => E(K::Down, M::ALT), + ('9', RIGHT) => E(K::Right, M::ALT), + ('9', LEFT) => E(K::Left, M::ALT), + _ => { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[1;{}{:?}", seq4, seq5); + E(K::UnknownEscSeq, M::NONE) + } + }) + } else if seq5 == '~' { + Ok(match (seq2, seq4) { + (INSERT, SHIFT) => E(K::Insert, M::SHIFT), + (INSERT, ALT) => E(K::Insert, M::ALT), + (INSERT, ALT_SHIFT) => E(K::Insert, M::ALT_SHIFT), + (INSERT, CTRL) => E(K::Insert, M::CTRL), + (INSERT, CTRL_SHIFT) => E(K::Insert, M::CTRL_SHIFT), + (INSERT, CTRL_ALT) => E(K::Insert, M::CTRL_ALT), + (INSERT, CTRL_ALT_SHIFT) => E(K::Insert, M::CTRL_ALT_SHIFT), + (DELETE, SHIFT) => E(K::Delete, M::SHIFT), + (DELETE, ALT) => E(K::Delete, M::ALT), + (DELETE, ALT_SHIFT) => E(K::Delete, M::ALT_SHIFT), + (DELETE, CTRL) => E(K::Delete, M::CTRL), + (DELETE, CTRL_SHIFT) => E(K::Delete, M::CTRL_SHIFT), + (DELETE, CTRL_ALT) => E(K::Delete, M::CTRL_ALT), + (DELETE, CTRL_ALT_SHIFT) => E(K::Delete, M::CTRL_ALT_SHIFT), + (PAGE_UP, SHIFT) => E(K::PageUp, M::SHIFT), + (PAGE_UP, ALT) => E(K::PageUp, M::ALT), + (PAGE_UP, ALT_SHIFT) => E(K::PageUp, M::ALT_SHIFT), + (PAGE_UP, CTRL) => E(K::PageUp, M::CTRL), + (PAGE_UP, CTRL_SHIFT) => E(K::PageUp, M::CTRL_SHIFT), + (PAGE_UP, CTRL_ALT) => E(K::PageUp, M::CTRL_ALT), + (PAGE_UP, CTRL_ALT_SHIFT) => E(K::PageUp, M::CTRL_ALT_SHIFT), + (PAGE_DOWN, SHIFT) => E(K::PageDown, M::SHIFT), + (PAGE_DOWN, ALT) => E(K::PageDown, M::ALT), + (PAGE_DOWN, ALT_SHIFT) => E(K::PageDown, M::ALT_SHIFT), + (PAGE_DOWN, CTRL) => E(K::PageDown, M::CTRL), + (PAGE_DOWN, CTRL_SHIFT) => E(K::PageDown, M::CTRL_SHIFT), + (PAGE_DOWN, CTRL_ALT) => E(K::PageDown, M::CTRL_ALT), + (PAGE_DOWN, CTRL_ALT_SHIFT) => E(K::PageDown, M::CTRL_ALT_SHIFT), + _ => { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{};{:?}~", seq2, seq4); + E(K::UnknownEscSeq, M::NONE) + } + }) + } else { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{};{}{:?}", seq2, seq4, seq5); + Ok(E(K::UnknownEscSeq, M::NONE)) + } + } else { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{};{:?}", seq2, seq4); + Ok(E(K::UnknownEscSeq, M::NONE)) + } + } else { + Ok(match (seq2, seq3) { + (DELETE, RXVT_CTRL) => E(K::Delete, M::CTRL), + (DELETE, RXVT_CTRL_SHIFT) => E(K::Delete, M::CTRL_SHIFT), + (CTRL, UP) => E(K::Up, M::CTRL), + (CTRL, DOWN) => E(K::Down, M::CTRL), + (CTRL, RIGHT) => E(K::Right, M::CTRL), + (CTRL, LEFT) => E(K::Left, M::CTRL), + (PAGE_UP, RXVT_CTRL) => E(K::PageUp, M::CTRL), + (PAGE_UP, RXVT_SHIFT) => E(K::PageUp, M::SHIFT), + (PAGE_UP, RXVT_CTRL_SHIFT) => E(K::PageUp, M::CTRL_SHIFT), + (PAGE_DOWN, RXVT_CTRL) => E(K::PageDown, M::CTRL), + (PAGE_DOWN, RXVT_SHIFT) => E(K::PageDown, M::SHIFT), + (PAGE_DOWN, RXVT_CTRL_SHIFT) => E(K::PageDown, M::CTRL_SHIFT), + (RXVT_HOME, RXVT_CTRL) => E(K::Home, M::CTRL), + (RXVT_HOME, RXVT_SHIFT) => E(K::Home, M::SHIFT), + (RXVT_HOME, RXVT_CTRL_SHIFT) => E(K::Home, M::CTRL_SHIFT), + (RXVT_END, RXVT_CTRL) => E(K::End, M::CTRL), // kEND5 or kel + (RXVT_END, RXVT_SHIFT) => E(K::End, M::SHIFT), + (RXVT_END, RXVT_CTRL_SHIFT) => E(K::End, M::CTRL_SHIFT), + _ => { + debug!(target: "rustyline", + "unsupported esc sequence: \\E[{}{:?}", seq2, seq3); + E(K::UnknownEscSeq, M::NONE) + } + }) + } + } + + /// Handle \EO escape sequences + fn escape_o(&mut self) -> Result { + let seq2 = self.next_char()?; + Ok(match seq2 { + UP => E(K::Up, M::NONE), + DOWN => E(K::Down, M::NONE), + RIGHT => E(K::Right, M::NONE), + LEFT => E(K::Left, M::NONE), + //'E' => E(K::, M::),// key_b2, kb2 + END => E(K::End, M::NONE), // kend + HOME => E(K::Home, M::NONE), // khome + 'M' => E::ENTER, // kent + 'P' => E(K::F(1), M::NONE), // kf1 + 'Q' => E(K::F(2), M::NONE), // kf2 + 'R' => E(K::F(3), M::NONE), // kf3 + 'S' => E(K::F(4), M::NONE), // kf4 + 'a' => E(K::Up, M::CTRL), + 'b' => E(K::Down, M::CTRL), + 'c' => E(K::Right, M::CTRL), // rxvt + 'd' => E(K::Left, M::CTRL), // rxvt + 'l' => E(K::F(8), M::NONE), + 't' => E(K::F(5), M::NONE), // kf5 or kb1 + 'u' => E(K::F(6), M::NONE), // kf6 or kb2 + 'v' => E(K::F(7), M::NONE), // kf7 or kb3 + 'w' => E(K::F(9), M::NONE), // kf9 or ka1 + 'x' => E(K::F(10), M::NONE), // kf10 or ka2 + _ => { + debug!(target: "rustyline", "unsupported esc sequence: \\EO{:?}", seq2); + E(K::UnknownEscSeq, M::NONE) + } + }) + } + + fn poll(&mut self, timeout_ms: PollTimeout) -> Result { + let n = self.tty_in.buffer().len(); + if n > 0 { + return Ok(n as i32); + } + let mut fds = [poll::PollFd::new(self.as_fd(), PollFlags::POLLIN)]; + let r = poll::poll(&mut fds, timeout_ms); + match r { + Ok(n) => Ok(n), + Err(Errno::EINTR) => { + if self.tty_in.get_ref().sigwinch()? { + Err(ReadlineError::WindowResized) + } else { + Ok(0) // Ignore EINTR while polling + } + } + Err(e) => Err(e.into()), + } + } + + fn select(&mut self, single_esc_abort: bool) -> Result { + let tty_in = self.as_fd(); + let sigwinch_pipe = self + .tty_in + .get_ref() + .sigwinch_pipe + .map(|fd| unsafe { BorrowedFd::borrow_raw(fd) }); + let pipe_reader = self + .pipe_reader + .as_ref() + .map(|pr| pr.lock().unwrap().0.as_raw_fd()) + .map(|fd| unsafe { BorrowedFd::borrow_raw(fd) }); + loop { + let mut readfds = FdSet::new(); + if let Some(sigwinch_pipe) = sigwinch_pipe { + readfds.insert(sigwinch_pipe); + } + readfds.insert(tty_in); + if let Some(pipe_reader) = pipe_reader { + readfds.insert(pipe_reader); + } + if let Err(err) = select::select(None, Some(&mut readfds), None, None, None) { + if err == Errno::EINTR && self.tty_in.get_ref().sigwinch()? { + return Err(ReadlineError::WindowResized); + } else if err != Errno::EINTR { + return Err(err.into()); + } else { + continue; + } + }; + if sigwinch_pipe.map_or(false, |fd| readfds.contains(fd)) { + self.tty_in.get_ref().sigwinch()?; + return Err(ReadlineError::WindowResized); + } else if readfds.contains(tty_in) { + // prefer user input over external print + return self.next_key(single_esc_abort).map(Event::KeyPress); + } else if let Some(ref pipe_reader) = self.pipe_reader { + let mut guard = pipe_reader.lock().unwrap(); + let mut buf = [0; 1]; + guard.0.read_exact(&mut buf)?; + if let Ok(msg) = guard.1.try_recv() { + return Ok(Event::ExternalPrint(msg)); + } + } + } + } +} + +impl RawReader for PosixRawReader { + type Buffer = PosixBuffer; + + #[cfg(not(feature = "signal-hook"))] + fn wait_for_input(&mut self, single_esc_abort: bool) -> Result { + match self.pipe_reader { + Some(_) => self.select(single_esc_abort), + None => self.next_key(single_esc_abort).map(Event::KeyPress), + } + } + + #[cfg(feature = "signal-hook")] + fn wait_for_input(&mut self, single_esc_abort: bool) -> Result { + self.select(single_esc_abort) + } + + fn next_key(&mut self, single_esc_abort: bool) -> Result { + let c = self.next_char()?; + + let mut key = KeyEvent::new(c, M::NONE); + if key == E::ESC { + if !self.tty_in.buffer().is_empty() { + debug!(target: "rustyline", "read buffer {:?}", self.tty_in.buffer()); + } + let timeout_ms = if single_esc_abort && self.timeout_ms.is_none() { + PollTimeout::ZERO + } else { + self.timeout_ms + }; + match self.poll(timeout_ms) { + Ok(0) => { + // single escape + } + Ok(_) => { + // escape sequence + key = self.escape_sequence()? + } + // Err(ref e) if e.kind() == ErrorKind::Interrupted => continue, + Err(e) => return Err(e), + } + } + debug!(target: "rustyline", "c: {:?} => key: {:?}", c, key); + Ok(key) + } + + fn next_char(&mut self) -> Result { + let mut buf = [0; 1]; + let mut receiver = Utf8 { + c: None, + valid: true, + }; + loop { + let n = self.tty_in.read(&mut buf)?; + if n == 0 { + return Err(ReadlineError::Eof); + } + let b = buf[0]; + self.parser.advance(&mut receiver, b); + if !receiver.valid { + return Err(ReadlineError::from(ErrorKind::InvalidData)); + } else if let Some(c) = receiver.c.take() { + return Ok(c); + } + } + } + + fn read_pasted_text(&mut self) -> Result { + let mut buffer = String::new(); + loop { + match self.next_char()? { + '\x1b' => { + let key = self.escape_sequence()?; + if key == E(K::BracketedPasteEnd, M::NONE) { + break; + } else { + continue; // TODO validate + } + } + c => buffer.push(c), + }; + } + let buffer = buffer.replace("\r\n", "\n"); + let buffer = buffer.replace('\r', "\n"); + Ok(buffer) + } + + fn find_binding(&self, key: &KeyEvent) -> Option { + let cmd = self.key_map.get(key).cloned(); + if let Some(ref cmd) = cmd { + debug!(target: "rustyline", "terminal key binding: {:?} => {:?}", key, cmd); + } + cmd + } + + #[cfg(any(not(feature = "buffer-redux"), test))] + fn unbuffer(self) -> Option { + None + } + + #[cfg(all(feature = "buffer-redux", not(test)))] + fn unbuffer(self) -> Option { + let (_, buffer) = self.tty_in.into_inner_with_buffer(); + Some(buffer) + } +} + +impl Receiver for Utf8 { + /// Called whenever a code point is parsed successfully + fn codepoint(&mut self, c: char) { + self.c = Some(c); + self.valid = true; + } + + /// Called when an invalid sequence is detected + fn invalid_sequence(&mut self) { + self.c = None; + self.valid = false; + } +} + +/// Console output writer +pub struct PosixRenderer { + out: RawFd, + cols: usize, // Number of columns in terminal + buffer: String, + tab_stop: usize, + colors_enabled: bool, + bell_style: BellStyle, +} + +impl PosixRenderer { + fn new(out: RawFd, tab_stop: usize, colors_enabled: bool, bell_style: BellStyle) -> Self { + let (cols, _) = get_win_size(out); + Self { + out, + cols, + buffer: String::with_capacity(1024), + tab_stop, + colors_enabled, + bell_style, + } + } + + fn clear_old_rows(&mut self, layout: &Layout) { + use std::fmt::Write; + let current_row = layout.cursor.row; + let old_rows = layout.end.row; + // old_rows < cursor_row if the prompt spans multiple lines and if + // this is the default State. + let cursor_row_movement = old_rows.saturating_sub(current_row); + // move the cursor down as required + if cursor_row_movement > 0 { + write!(self.buffer, "\x1b[{cursor_row_movement}B").unwrap(); + } + // clear old rows + for _ in 0..old_rows { + self.buffer.push_str("\r\x1b[K\x1b[A"); + } + // clear the line + self.buffer.push_str("\r\x1b[K"); + } +} + +impl Renderer for PosixRenderer { + type Reader = PosixRawReader; + + fn move_cursor(&mut self, old: Position, new: Position) -> Result<()> { + use std::fmt::Write; + self.buffer.clear(); + let row_ordering = new.row.cmp(&old.row); + if row_ordering == cmp::Ordering::Greater { + // move down + let row_shift = new.row - old.row; + if row_shift == 1 { + self.buffer.push_str("\x1b[B"); + } else { + write!(self.buffer, "\x1b[{row_shift}B")?; + } + } else if row_ordering == cmp::Ordering::Less { + // move up + let row_shift = old.row - new.row; + if row_shift == 1 { + self.buffer.push_str("\x1b[A"); + } else { + write!(self.buffer, "\x1b[{row_shift}A")?; + } + } + let col_ordering = new.col.cmp(&old.col); + if col_ordering == cmp::Ordering::Greater { + // move right + let col_shift = new.col - old.col; + if col_shift == 1 { + self.buffer.push_str("\x1b[C"); + } else { + write!(self.buffer, "\x1b[{col_shift}C")?; + } + } else if col_ordering == cmp::Ordering::Less { + // move left + let col_shift = old.col - new.col; + if col_shift == 1 { + self.buffer.push_str("\x1b[D"); + } else { + write!(self.buffer, "\x1b[{col_shift}D")?; + } + } + write_all(self.out, self.buffer.as_str())?; + Ok(()) + } + + fn refresh_line( + &mut self, + prompt: &str, + line: &LineBuffer, + hint: Option<&str>, + old_layout: &Layout, + new_layout: &Layout, + highlighter: Option<&dyn Highlighter>, + ) -> Result<()> { + use std::fmt::Write; + self.buffer.clear(); + + let default_prompt = new_layout.default_prompt; + let cursor = new_layout.cursor; + let end_pos = new_layout.end; + + self.clear_old_rows(old_layout); + + if let Some(highlighter) = highlighter { + // display the prompt + self.buffer + .push_str(&highlighter.highlight_prompt(prompt, default_prompt)); + // display the input line + self.buffer + .push_str(&highlighter.highlight(line, line.pos())); + } else { + // display the prompt + self.buffer.push_str(prompt); + // display the input line + self.buffer.push_str(line); + } + // display hint + if let Some(hint) = hint { + if let Some(highlighter) = highlighter { + self.buffer.push_str(&highlighter.highlight_hint(hint)); + } else { + self.buffer.push_str(hint); + } + } + // we have to generate our own newline on line wrap + if end_pos.col == 0 + && end_pos.row > 0 + && !hint.map_or_else(|| line.ends_with('\n'), |h| h.ends_with('\n')) + { + self.buffer.push('\n'); + } + // position the cursor + let new_cursor_row_movement = end_pos.row - cursor.row; + // move the cursor up as required + if new_cursor_row_movement > 0 { + write!(self.buffer, "\x1b[{new_cursor_row_movement}A")?; + } + // position the cursor within the line + if cursor.col > 0 { + write!(self.buffer, "\r\x1b[{}C", cursor.col)?; + } else { + self.buffer.push('\r'); + } + + write_all(self.out, self.buffer.as_str())?; + Ok(()) + } + + fn write_and_flush(&mut self, buf: &str) -> Result<()> { + write_all(self.out, buf)?; + Ok(()) + } + + /// Control characters are treated as having zero width. + /// Characters with 2 column width are correctly handled (not split). + fn calculate_position(&self, s: &str, orig: Position) -> Position { + let mut pos = orig; + let mut esc_seq = 0; + for c in s.graphemes(true) { + if c == "\n" { + pos.row += 1; + pos.col = 0; + continue; + } + let cw = if c == "\t" { + self.tab_stop - (pos.col % self.tab_stop) + } else { + width(c, &mut esc_seq) + }; + pos.col += cw; + if pos.col > self.cols { + pos.row += 1; + pos.col = cw; + } + } + if pos.col == self.cols { + pos.col = 0; + pos.row += 1; + } + pos + } + + fn beep(&mut self) -> Result<()> { + match self.bell_style { + BellStyle::Audible => self.write_and_flush("\x07"), + _ => Ok(()), + } + } + + /// Clear the screen. Used to handle ctrl+l + fn clear_screen(&mut self) -> Result<()> { + self.write_and_flush("\x1b[H\x1b[J") + } + + fn clear_rows(&mut self, layout: &Layout) -> Result<()> { + self.buffer.clear(); + self.clear_old_rows(layout); + write_all(self.out, self.buffer.as_str())?; + Ok(()) + } + + /// Try to update the number of columns in the current terminal, + fn update_size(&mut self) { + let (cols, _) = get_win_size(self.out); + self.cols = cols; + } + + fn get_columns(&self) -> usize { + self.cols + } + + /// Try to get the number of rows in the current terminal, + /// or assume 24 if it fails. + fn get_rows(&self) -> usize { + let (_, rows) = get_win_size(self.out); + rows + } + + fn colors_enabled(&self) -> bool { + self.colors_enabled + } + + fn move_cursor_at_leftmost(&mut self, rdr: &mut PosixRawReader) -> Result<()> { + if rdr.poll(PollTimeout::ZERO)? != 0 { + debug!(target: "rustyline", "cannot request cursor location"); + return Ok(()); + } + /* Report cursor location */ + self.write_and_flush("\x1b[6n")?; + /* Read the response: ESC [ rows ; cols R */ + if rdr.poll(PollTimeout::from(100u8))? == 0 + || rdr.next_char()? != '\x1b' + || rdr.next_char()? != '[' + || read_digits_until(rdr, ';')?.is_none() + { + warn!(target: "rustyline", "cannot read initial cursor location"); + return Ok(()); + } + let col = read_digits_until(rdr, 'R')?; + debug!(target: "rustyline", "initial cursor location: {:?}", col); + if col != Some(1) { + self.write_and_flush("\n")?; + } + Ok(()) + } +} + +fn read_digits_until(rdr: &mut PosixRawReader, sep: char) -> Result> { + let mut num: u32 = 0; + loop { + match rdr.next_char()? { + digit @ '0'..='9' => { + num = num + .saturating_mul(10) + .saturating_add(digit.to_digit(10).unwrap()); + continue; + } + c if c == sep => break, + _ => return Ok(None), + } + } + Ok(Some(num)) +} + +fn write_all(fd: RawFd, buf: &str) -> nix::Result<()> { + let mut bytes = buf.as_bytes(); + while !bytes.is_empty() { + match write(unsafe { BorrowedFd::borrow_raw(fd) }, bytes) { + Ok(0) => return Err(Errno::EIO), + Ok(n) => bytes = &bytes[n..], + Err(Errno::EINTR) => {} + Err(r) => return Err(r), + } + } + Ok(()) +} + +pub struct PosixCursorGuard(RawFd); + +impl Drop for PosixCursorGuard { + fn drop(&mut self) { + let _ = set_cursor_visibility(self.0, true); + } +} + +fn set_cursor_visibility(fd: RawFd, visible: bool) -> Result> { + write_all(fd, if visible { "\x1b[?25h" } else { "\x1b[?25l" })?; + Ok(if visible { + None + } else { + Some(PosixCursorGuard(fd)) + }) +} + +#[cfg(not(feature = "signal-hook"))] +static mut SIGWINCH_PIPE: RawFd = -1; +#[cfg(not(feature = "signal-hook"))] +extern "C" fn sigwinch_handler(_: libc::c_int) { + let _ = unsafe { write(BorrowedFd::borrow_raw(SIGWINCH_PIPE), b"s") }; +} + +#[derive(Clone, Debug)] +struct SigWinCh { + pipe: RawFd, + #[cfg(not(feature = "signal-hook"))] + original: nix::sys::signal::SigAction, + #[cfg(feature = "signal-hook")] + id: signal_hook::SigId, +} +impl SigWinCh { + #[cfg(not(feature = "signal-hook"))] + fn install_sigwinch_handler() -> Result { + use nix::sys::signal; + let (pipe, pipe_write) = UnixStream::pair()?; + pipe.set_nonblocking(true)?; + unsafe { SIGWINCH_PIPE = pipe_write.into_raw_fd() }; + let sigwinch = signal::SigAction::new( + signal::SigHandler::Handler(sigwinch_handler), + signal::SaFlags::empty(), + signal::SigSet::empty(), + ); + let original = unsafe { signal::sigaction(signal::SIGWINCH, &sigwinch)? }; + Ok(Self { + pipe: pipe.into_raw_fd(), + original, + }) + } + + #[cfg(feature = "signal-hook")] + fn install_sigwinch_handler() -> Result { + let (pipe, pipe_write) = UnixStream::pair()?; + pipe.set_nonblocking(true)?; + let id = signal_hook::low_level::pipe::register(libc::SIGWINCH, pipe_write)?; + Ok(Self { + pipe: pipe.into_raw_fd(), + id, + }) + } + + #[cfg(not(feature = "signal-hook"))] + fn uninstall_sigwinch_handler(self) -> Result<()> { + use nix::sys::signal; + let _ = unsafe { signal::sigaction(signal::SIGWINCH, &self.original)? }; + close(self.pipe)?; + unsafe { close(SIGWINCH_PIPE)? }; + unsafe { SIGWINCH_PIPE = -1 }; + Ok(()) + } + + #[cfg(feature = "signal-hook")] + fn uninstall_sigwinch_handler(self) -> Result<()> { + signal_hook::low_level::unregister(self.id); + close(self.pipe)?; + Ok(()) + } +} + +#[cfg(not(test))] +pub type Terminal = PosixTerminal; + +#[derive(Clone, Debug)] +pub struct PosixTerminal { + unsupported: bool, + tty_in: RawFd, + is_in_a_tty: bool, + tty_out: RawFd, + is_out_a_tty: bool, + close_on_drop: bool, + pub(crate) color_mode: ColorMode, + tab_stop: usize, + bell_style: BellStyle, + enable_bracketed_paste: bool, + raw_mode: Arc, + // external print reader + pipe_reader: Option, + // external print writer + pipe_writer: Option, + sigwinch: Option, + enable_signals: bool, +} + +impl PosixTerminal { + fn colors_enabled(&self) -> bool { + match self.color_mode { + ColorMode::Enabled => self.is_out_a_tty, + ColorMode::Forced => true, + ColorMode::Disabled => false, + } + } +} + +impl Term for PosixTerminal { + type Buffer = PosixBuffer; + type CursorGuard = PosixCursorGuard; + type ExternalPrinter = ExternalPrinter; + type KeyMap = PosixKeyMap; + type Mode = PosixMode; + type Reader = PosixRawReader; + type Writer = PosixRenderer; + + fn new( + color_mode: ColorMode, + behavior: Behavior, + tab_stop: usize, + bell_style: BellStyle, + enable_bracketed_paste: bool, + enable_signals: bool, + ) -> Result { + let (tty_in, is_in_a_tty, tty_out, is_out_a_tty, close_on_drop) = + if behavior == Behavior::PreferTerm { + let tty = OpenOptions::new().read(true).write(true).open("/dev/tty"); + if let Ok(tty) = tty { + let fd = tty.into_raw_fd(); + let is_a_tty = is_a_tty(fd); // TODO: useless ? + (fd, is_a_tty, fd, is_a_tty, true) + } else { + ( + libc::STDIN_FILENO, + is_a_tty(libc::STDIN_FILENO), + libc::STDOUT_FILENO, + is_a_tty(libc::STDOUT_FILENO), + false, + ) + } + } else { + ( + libc::STDIN_FILENO, + is_a_tty(libc::STDIN_FILENO), + libc::STDOUT_FILENO, + is_a_tty(libc::STDOUT_FILENO), + false, + ) + }; + let unsupported = is_unsupported_term(); + let sigwinch = if !unsupported && is_in_a_tty && is_out_a_tty { + Some(SigWinCh::install_sigwinch_handler()?) + } else { + None + }; + Ok(Self { + unsupported, + tty_in, + is_in_a_tty, + tty_out, + is_out_a_tty, + close_on_drop, + color_mode, + tab_stop, + bell_style, + enable_bracketed_paste, + raw_mode: Arc::new(AtomicBool::new(false)), + pipe_reader: None, + pipe_writer: None, + sigwinch, + enable_signals, + }) + } + + // Init checks: + + /// Check if current terminal can provide a rich line-editing user + /// interface. + fn is_unsupported(&self) -> bool { + self.unsupported + } + + fn is_input_tty(&self) -> bool { + self.is_in_a_tty + } + + fn is_output_tty(&self) -> bool { + self.is_out_a_tty + } + + // Interactive loop: + + fn enable_raw_mode(&mut self) -> Result<(Self::Mode, PosixKeyMap)> { + use nix::errno::Errno::ENOTTY; + if !self.is_in_a_tty { + return Err(ENOTTY.into()); + } + let (original_mode, key_map) = termios_::enable_raw_mode(self.tty_in, self.enable_signals)?; + + self.raw_mode.store(true, Ordering::SeqCst); + // enable bracketed paste + let out = if !self.enable_bracketed_paste { + None + } else if let Err(e) = write_all(self.tty_out, BRACKETED_PASTE_ON) { + debug!(target: "rustyline", "Cannot enable bracketed paste: {}", e); + None + } else { + Some(self.tty_out) + }; + + // when all ExternalPrinter are dropped there is no need to use `pipe_reader` + if Arc::strong_count(&self.raw_mode) == 1 { + self.pipe_writer = None; + self.pipe_reader = None; + } + + Ok(( + PosixMode { + termios: original_mode, + tty_in: self.tty_in, + tty_out: out, + raw_mode: self.raw_mode.clone(), + }, + key_map, + )) + } + + /// Create a RAW reader + fn create_reader( + &self, + buffer: Option, + config: &Config, + key_map: PosixKeyMap, + ) -> PosixRawReader { + PosixRawReader::new( + self.tty_in, + self.sigwinch.as_ref().map(|s| s.pipe), + buffer, + config, + key_map, + self.pipe_reader.clone(), + ) + } + + fn create_writer(&self) -> PosixRenderer { + PosixRenderer::new( + self.tty_out, + self.tab_stop, + self.colors_enabled(), + self.bell_style, + ) + } + + fn writeln(&self) -> Result<()> { + write_all(self.tty_out, "\n")?; + Ok(()) + } + + fn create_external_printer(&mut self) -> Result { + use nix::unistd::pipe; + if let Some(ref writer) = self.pipe_writer { + return Ok(ExternalPrinter { + writer: writer.clone(), + raw_mode: self.raw_mode.clone(), + tty_out: self.tty_out, + }); + } + if self.unsupported || !self.is_input_tty() || !self.is_output_tty() { + return Err(nix::Error::ENOTTY.into()); + } + let (sender, receiver) = mpsc::sync_channel(1); // TODO validate: bound + let (r, w) = pipe()?; + let reader = Arc::new(Mutex::new((r.into(), receiver))); + let writer = (Arc::new(Mutex::new(w.into())), sender); + self.pipe_reader.replace(reader); + self.pipe_writer.replace(writer.clone()); + Ok(ExternalPrinter { + writer, + raw_mode: self.raw_mode.clone(), + tty_out: self.tty_out, + }) + } + + fn set_cursor_visibility(&mut self, visible: bool) -> Result> { + if self.is_out_a_tty { + set_cursor_visibility(self.tty_out, visible) + } else { + Ok(None) + } + } +} + +#[expect(unused_must_use)] +impl Drop for PosixTerminal { + fn drop(&mut self) { + if self.close_on_drop { + close(self.tty_in); + debug_assert_eq!(self.tty_in, self.tty_out); + } + if let Some(sigwinch) = self.sigwinch.take() { + sigwinch.uninstall_sigwinch_handler(); + } + } +} + +#[derive(Debug)] +pub struct ExternalPrinter { + writer: PipeWriter, + raw_mode: Arc, + tty_out: RawFd, +} + +impl super::ExternalPrinter for ExternalPrinter { + fn print(&mut self, msg: String) -> Result<()> { + // write directly to stdout/stderr while not in raw mode + if !self.raw_mode.load(Ordering::SeqCst) { + write_all(self.tty_out, msg.as_str())?; + } else if let Ok(mut writer) = self.writer.0.lock() { + self.writer + .1 + .send(msg) + .map_err(|_| io::Error::from(ErrorKind::Other))?; // FIXME + writer.write_all(b"m")?; + writer.flush()?; + } else { + return Err(io::Error::from(ErrorKind::Other).into()); // FIXME + } + Ok(()) + } +} + +#[cfg(not(test))] +pub fn suspend() -> Result<()> { + use nix::sys::signal; + use nix::unistd::Pid; + // suspend the whole process group + signal::kill(Pid::from_raw(0), signal::SIGTSTP)?; + Ok(()) +} + +#[cfg(not(feature = "termios"))] +mod termios_ { + use super::PosixKeyMap; + use crate::keys::{KeyEvent, Modifiers as M}; + use crate::{Cmd, Result}; + use nix::sys::termios::{self, SetArg, SpecialCharacterIndices as SCI, Termios}; + use std::collections::HashMap; + use std::os::unix::io::{BorrowedFd, RawFd}; + pub fn disable_raw_mode(tty_in: RawFd, termios: &Termios) -> Result<()> { + let fd = unsafe { BorrowedFd::borrow_raw(tty_in) }; + Ok(termios::tcsetattr(fd, SetArg::TCSADRAIN, termios)?) + } + pub fn enable_raw_mode(tty_in: RawFd, enable_signals: bool) -> Result<(Termios, PosixKeyMap)> { + use nix::sys::termios::{ControlFlags, InputFlags, LocalFlags}; + + let fd = unsafe { BorrowedFd::borrow_raw(tty_in) }; + let original_mode = termios::tcgetattr(fd)?; + let mut raw = original_mode.clone(); + // disable BREAK interrupt, CR to NL conversion on input, + // input parity check, strip high bit (bit 8), output flow control + raw.input_flags &= !(InputFlags::BRKINT + | InputFlags::ICRNL + | InputFlags::INPCK + | InputFlags::ISTRIP + | InputFlags::IXON); + // we don't want raw output, it turns newlines into straight line feeds + // disable all output processing + // raw.c_oflag = raw.c_oflag & !(OutputFlags::OPOST); + + // character-size mark (8 bits) + raw.control_flags |= ControlFlags::CS8; + // disable echoing, canonical mode, extended input processing and signals + raw.local_flags &= + !(LocalFlags::ECHO | LocalFlags::ICANON | LocalFlags::IEXTEN | LocalFlags::ISIG); + + if enable_signals { + raw.local_flags |= LocalFlags::ISIG; + } + + raw.control_chars[SCI::VMIN as usize] = 1; // One character-at-a-time input + raw.control_chars[SCI::VTIME as usize] = 0; // with blocking read + + let mut key_map: HashMap = HashMap::with_capacity(4); + map_key(&mut key_map, &raw, SCI::VEOF, "VEOF", Cmd::EndOfFile); + map_key(&mut key_map, &raw, SCI::VINTR, "VINTR", Cmd::Interrupt); + map_key(&mut key_map, &raw, SCI::VQUIT, "VQUIT", Cmd::Interrupt); + map_key(&mut key_map, &raw, SCI::VSUSP, "VSUSP", Cmd::Suspend); + + termios::tcsetattr(fd, SetArg::TCSADRAIN, &raw)?; + Ok((original_mode, key_map)) + } + fn map_key( + key_map: &mut HashMap, + raw: &Termios, + index: SCI, + name: &str, + cmd: Cmd, + ) { + let cc = char::from(raw.control_chars[index as usize]); + let key = KeyEvent::new(cc, M::NONE); + log::debug!(target: "rustyline", "{}: {:?}", name, key); + key_map.insert(key, cmd); + } +} +#[cfg(feature = "termios")] +mod termios_ { + use super::PosixKeyMap; + use crate::keys::{KeyEvent, Modifiers as M}; + use crate::{Cmd, Result}; + use std::collections::HashMap; + use std::os::unix::io::RawFd; + use termios::{self, Termios}; + pub fn disable_raw_mode(tty_in: RawFd, termios: &Termios) -> Result<()> { + Ok(termios::tcsetattr(tty_in, termios::TCSADRAIN, termios)?) + } + pub fn enable_raw_mode(tty_in: RawFd, enable_signals: bool) -> Result<(Termios, PosixKeyMap)> { + let original_mode = Termios::from_fd(tty_in)?; + let mut raw = original_mode; + // disable BREAK interrupt, CR to NL conversion on input, + // input parity check, strip high bit (bit 8), output flow control + raw.c_iflag &= + !(termios::BRKINT | termios::ICRNL | termios::INPCK | termios::ISTRIP | termios::IXON); + // we don't want raw output, it turns newlines into straight line feeds + // disable all output processing + // raw.c_oflag = raw.c_oflag & !(OutputFlags::OPOST); + + // character-size mark (8 bits) + raw.c_cflag |= termios::CS8; + // disable echoing, canonical mode, extended input processing and signals + raw.c_lflag &= !(termios::ECHO | termios::ICANON | termios::IEXTEN | termios::ISIG); + + if enable_signals { + raw.c_lflag |= termios::ISIG; + } + + raw.c_cc[termios::VMIN] = 1; // One character-at-a-time input + raw.c_cc[termios::VTIME] = 0; // with blocking read + + let mut key_map: HashMap = HashMap::with_capacity(4); + map_key(&mut key_map, &raw, termios::VEOF, "VEOF", Cmd::EndOfFile); + map_key(&mut key_map, &raw, termios::VINTR, "VINTR", Cmd::Interrupt); + map_key(&mut key_map, &raw, termios::VQUIT, "VQUIT", Cmd::Interrupt); + map_key(&mut key_map, &raw, termios::VSUSP, "VSUSP", Cmd::Suspend); + + termios::tcsetattr(tty_in, termios::TCSADRAIN, &raw)?; + Ok((original_mode, key_map)) + } + fn map_key( + key_map: &mut HashMap, + raw: &Termios, + index: usize, + name: &str, + cmd: Cmd, + ) { + let cc = char::from(raw.c_cc[index]); + let key = KeyEvent::new(cc, M::NONE); + log::debug!(target: "rustyline", "{}: {:?}", name, key); + key_map.insert(key, cmd); + } +} + +#[cfg(test)] +mod test { + use super::{Position, PosixRenderer, PosixTerminal, Renderer}; + use crate::config::BellStyle; + use crate::line_buffer::{LineBuffer, NoListener}; + + #[test] + #[ignore] + fn prompt_with_ansi_escape_codes() { + let out = PosixRenderer::new(libc::STDOUT_FILENO, 4, true, BellStyle::default()); + let pos = out.calculate_position("\x1b[1;32m>>\x1b[0m ", Position::default()); + assert_eq!(3, pos.col); + assert_eq!(0, pos.row); + } + + #[test] + fn test_unsupported_term() { + std::env::set_var("TERM", "xterm"); + assert!(!super::is_unsupported_term()); + + std::env::set_var("TERM", "dumb"); + assert!(super::is_unsupported_term()); + } + + #[test] + fn test_send() { + fn assert_send() {} + assert_send::(); + } + + #[test] + fn test_sync() { + fn assert_sync() {} + assert_sync::(); + } + + #[test] + fn test_line_wrap() { + let mut out = PosixRenderer::new(libc::STDOUT_FILENO, 4, true, BellStyle::default()); + let prompt = "> "; + let default_prompt = true; + let prompt_size = out.calculate_position(prompt, Position::default()); + + let mut line = LineBuffer::init("", 0); + let old_layout = out.compute_layout(prompt_size, default_prompt, &line, None); + assert_eq!(Position { col: 2, row: 0 }, old_layout.cursor); + assert_eq!(old_layout.cursor, old_layout.end); + + assert_eq!( + Some(true), + line.insert('a', out.cols - prompt_size.col + 1, &mut NoListener) + ); + let new_layout = out.compute_layout(prompt_size, default_prompt, &line, None); + assert_eq!(Position { col: 1, row: 1 }, new_layout.cursor); + assert_eq!(new_layout.cursor, new_layout.end); + out.refresh_line(prompt, &line, None, &old_layout, &new_layout, None) + .unwrap(); + #[rustfmt::skip] + assert_eq!( + "\r\u{1b}[K> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r\u{1b}[1C", + out.buffer + ); + } +} diff --git a/rustyline-15.0.0/src/tty/windows.rs b/rustyline-15.0.0/src/tty/windows.rs new file mode 100644 index 0000000000..02cf69a4b8 --- /dev/null +++ b/rustyline-15.0.0/src/tty/windows.rs @@ -0,0 +1,943 @@ +//! Windows specific definitions +#![expect(clippy::try_err)] // suggested fix does not work (cannot infer...) + +use std::fs::OpenOptions; +use std::io; +use std::mem; +use std::os::windows::io::IntoRawHandle; +use std::ptr; +use std::rc::Rc; +use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::mpsc::{sync_channel, Receiver, SyncSender}; +use std::sync::Arc; + +use log::{debug, warn}; +use unicode_segmentation::UnicodeSegmentation; +use unicode_width::UnicodeWidthStr; +use windows_sys::Win32::Foundation::{self as foundation, BOOL, FALSE, HANDLE, TRUE}; +use windows_sys::Win32::System::Console as console; +use windows_sys::Win32::System::Threading as threading; +use windows_sys::Win32::UI::Input::KeyboardAndMouse; + +use super::{width, Event, RawMode, RawReader, Renderer, Term}; +use crate::config::{Behavior, BellStyle, ColorMode, Config}; +use crate::highlight::Highlighter; +use crate::keys::{KeyCode as K, KeyEvent, Modifiers as M}; +use crate::layout::{Layout, Position}; +use crate::line_buffer::LineBuffer; +use crate::{error, Cmd, Result}; + +fn get_std_handle(fd: console::STD_HANDLE) -> Result { + let handle = unsafe { console::GetStdHandle(fd) }; + check_handle(handle) +} + +fn check_handle(handle: HANDLE) -> Result { + if handle == foundation::INVALID_HANDLE_VALUE { + Err(io::Error::last_os_error())?; + } else if handle.is_null() { + Err(io::Error::new( + io::ErrorKind::Other, + "no stdio handle available for this process", + ))?; + } + Ok(handle) +} + +fn check(rc: BOOL) -> io::Result<()> { + if rc == FALSE { + Err(io::Error::last_os_error()) + } else { + Ok(()) + } +} + +fn get_win_size(handle: HANDLE) -> (usize, usize) { + let mut info = unsafe { mem::zeroed() }; + match unsafe { console::GetConsoleScreenBufferInfo(handle, &mut info) } { + FALSE => (80, 24), + _ => ( + info.dwSize.X as usize, + (1 + info.srWindow.Bottom - info.srWindow.Top) as usize, + ), // (info.srWindow.Right - info.srWindow.Left + 1) + } +} + +fn get_console_mode(handle: HANDLE) -> Result { + let mut original_mode = 0; + check(unsafe { console::GetConsoleMode(handle, &mut original_mode) })?; + Ok(original_mode) +} + +type ConsoleBuffer = (); +#[cfg(not(test))] +pub type Buffer = ConsoleBuffer; + +type ConsoleKeyMap = (); +#[cfg(not(test))] +pub type KeyMap = ConsoleKeyMap; + +#[cfg(not(test))] +pub type Mode = ConsoleMode; + +#[must_use = "You must restore default mode (disable_raw_mode)"] +#[derive(Clone, Debug)] +pub struct ConsoleMode { + original_conin_mode: console::CONSOLE_MODE, + conin: HANDLE, + original_conout_mode: Option, + conout: HANDLE, + raw_mode: Arc, +} + +impl RawMode for ConsoleMode { + /// Disable RAW mode for the terminal. + fn disable_raw_mode(&self) -> Result<()> { + check(unsafe { console::SetConsoleMode(self.conin, self.original_conin_mode) })?; + if let Some(original_stdstream_mode) = self.original_conout_mode { + check(unsafe { console::SetConsoleMode(self.conout, original_stdstream_mode) })?; + } + self.raw_mode.store(false, Ordering::SeqCst); + Ok(()) + } +} + +/// Console input reader +pub struct ConsoleRawReader { + conin: HANDLE, + // external print reader + pipe_reader: Option>, +} + +impl ConsoleRawReader { + fn create(conin: HANDLE, pipe_reader: Option>) -> Self { + Self { conin, pipe_reader } + } + + fn select(&mut self) -> Result { + use foundation::WAIT_OBJECT_0; + use threading::{WaitForMultipleObjects, INFINITE}; + + let pipe_reader = self.pipe_reader.as_ref().unwrap(); + let handles = [self.conin, pipe_reader.event.0]; + let n = handles.len().try_into().unwrap(); + loop { + let rc = unsafe { WaitForMultipleObjects(n, handles.as_ptr(), FALSE, INFINITE) }; + if rc == WAIT_OBJECT_0 { + let mut count = 0; + check(unsafe { console::GetNumberOfConsoleInputEvents(self.conin, &mut count) })?; + match read_input(self.conin, count)? { + KeyEvent(K::UnknownEscSeq, M::NONE) => continue, // no relevant + key => return Ok(Event::KeyPress(key)), + }; + } else if rc == WAIT_OBJECT_0 + 1 { + debug!(target: "rustyline", "ExternalPrinter::receive"); + check(unsafe { threading::ResetEvent(pipe_reader.event.0) })?; + match pipe_reader.receiver.recv() { + Ok(msg) => return Ok(Event::ExternalPrint(msg)), + Err(e) => Err(io::Error::new(io::ErrorKind::InvalidInput, e))?, + } + } else { + Err(io::Error::last_os_error())? + } + } + } +} + +impl RawReader for ConsoleRawReader { + type Buffer = ConsoleBuffer; + + fn wait_for_input(&mut self, single_esc_abort: bool) -> Result { + match self.pipe_reader { + Some(_) => self.select(), + None => self.next_key(single_esc_abort).map(Event::KeyPress), + } + } + + fn next_key(&mut self, _: bool) -> Result { + read_input(self.conin, u32::MAX) + } + + fn read_pasted_text(&mut self) -> Result { + Ok(clipboard_win::get_clipboard_string()?) + } + + fn find_binding(&self, _: &KeyEvent) -> Option { + None + } + + fn unbuffer(self) -> Option { + None + } +} + +fn read_input(handle: HANDLE, max_count: u32) -> Result { + use console::{ + LEFT_ALT_PRESSED, LEFT_CTRL_PRESSED, RIGHT_ALT_PRESSED, RIGHT_CTRL_PRESSED, SHIFT_PRESSED, + }; + use std::char::decode_utf16; + + let mut rec: console::INPUT_RECORD = unsafe { mem::zeroed() }; + let mut count = 0; + let mut total = 0; + let mut surrogate = 0; + loop { + if total >= max_count { + return Ok(KeyEvent(K::UnknownEscSeq, M::NONE)); + } + // TODO GetNumberOfConsoleInputEvents + check(unsafe { console::ReadConsoleInputW(handle, &mut rec, 1, &mut count) })?; + total += count; + + if u32::from(rec.EventType) == console::WINDOW_BUFFER_SIZE_EVENT { + debug!(target: "rustyline", "SIGWINCH"); + return Err(error::ReadlineError::WindowResized); + } else if u32::from(rec.EventType) != console::KEY_EVENT { + continue; + } + let key_event = unsafe { rec.Event.KeyEvent }; + // writeln!(io::stderr(), "key_event: {:?}", key_event).unwrap(); + if key_event.bKeyDown == 0 && key_event.wVirtualKeyCode != KeyboardAndMouse::VK_MENU { + continue; + } + // key_event.wRepeatCount seems to be always set to 1 (maybe because we only + // read one character at a time) + + let alt_gr = key_event.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_ALT_PRESSED) + == (LEFT_CTRL_PRESSED | RIGHT_ALT_PRESSED); + let mut mods = M::NONE; + if !alt_gr && key_event.dwControlKeyState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED) != 0 { + mods |= M::CTRL; + } + if !alt_gr && key_event.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED) != 0 { + mods |= M::ALT; + } + if key_event.dwControlKeyState & SHIFT_PRESSED != 0 { + mods |= M::SHIFT; + } + + let utf16 = unsafe { key_event.uChar.UnicodeChar }; + let key_code = match key_event.wVirtualKeyCode { + KeyboardAndMouse::VK_LEFT => K::Left, + KeyboardAndMouse::VK_RIGHT => K::Right, + KeyboardAndMouse::VK_UP => K::Up, + KeyboardAndMouse::VK_DOWN => K::Down, + KeyboardAndMouse::VK_DELETE => K::Delete, + KeyboardAndMouse::VK_HOME => K::Home, + KeyboardAndMouse::VK_END => K::End, + KeyboardAndMouse::VK_PRIOR => K::PageUp, + KeyboardAndMouse::VK_NEXT => K::PageDown, + KeyboardAndMouse::VK_INSERT => K::Insert, + KeyboardAndMouse::VK_F1 => K::F(1), + KeyboardAndMouse::VK_F2 => K::F(2), + KeyboardAndMouse::VK_F3 => K::F(3), + KeyboardAndMouse::VK_F4 => K::F(4), + KeyboardAndMouse::VK_F5 => K::F(5), + KeyboardAndMouse::VK_F6 => K::F(6), + KeyboardAndMouse::VK_F7 => K::F(7), + KeyboardAndMouse::VK_F8 => K::F(8), + KeyboardAndMouse::VK_F9 => K::F(9), + KeyboardAndMouse::VK_F10 => K::F(10), + KeyboardAndMouse::VK_F11 => K::F(11), + KeyboardAndMouse::VK_F12 => K::F(12), + KeyboardAndMouse::VK_BACK => K::Backspace, // vs Ctrl-h + KeyboardAndMouse::VK_RETURN => K::Enter, // vs Ctrl-m + KeyboardAndMouse::VK_ESCAPE => K::Esc, + KeyboardAndMouse::VK_TAB => { + if mods.contains(M::SHIFT) { + mods.remove(M::SHIFT); + K::BackTab + } else { + K::Tab // vs Ctrl-i + } + } + _ => { + if utf16 == 0 { + continue; + } + K::UnknownEscSeq + } + }; + + let key = if key_code != K::UnknownEscSeq { + KeyEvent(key_code, mods) + } else if utf16 == 27 { + KeyEvent(K::Esc, mods) // FIXME dead code ? + } else { + if (0xD800..0xDC00).contains(&utf16) { + surrogate = utf16; + continue; + } + let orc = if surrogate == 0 { + decode_utf16(Some(utf16)).next() + } else { + decode_utf16([surrogate, utf16].iter().copied()).next() + }; + let Some(rc) = orc else { + return Err(error::ReadlineError::Eof); + }; + let c = rc?; + KeyEvent::new(c, mods) + }; + debug!(target: "rustyline", "wVirtualKeyCode: {:#x}, utf16: {:#x}, dwControlKeyState: {:#x} => key: {:?}", key_event.wVirtualKeyCode, utf16, key_event.dwControlKeyState,key); + return Ok(key); + } +} + +pub struct ConsoleRenderer { + conout: HANDLE, + cols: usize, // Number of columns in terminal + buffer: String, + utf16: Vec, + colors_enabled: bool, + bell_style: BellStyle, +} + +impl ConsoleRenderer { + fn new(conout: HANDLE, colors_enabled: bool, bell_style: BellStyle) -> Self { + // Multi line editing is enabled by ENABLE_WRAP_AT_EOL_OUTPUT mode + let (cols, _) = get_win_size(conout); + Self { + conout, + cols, + buffer: String::with_capacity(1024), + utf16: Vec::with_capacity(1024), + colors_enabled, + bell_style, + } + } + + fn get_console_screen_buffer_info(&self) -> Result { + let mut info = unsafe { mem::zeroed() }; + check(unsafe { console::GetConsoleScreenBufferInfo(self.conout, &mut info) })?; + Ok(info) + } + + fn set_console_cursor_position( + &mut self, + mut pos: console::COORD, + size: console::COORD, + ) -> Result { + use std::cmp::{max, min}; + // https://docs.microsoft.com/en-us/windows/console/setconsolecursorposition + // > The coordinates must be within the boundaries of the console screen buffer. + // pos.X = max(0, min(size.X - 1, pos.X)); + pos.Y = max(0, min(size.Y - 1, pos.Y)); + check(unsafe { console::SetConsoleCursorPosition(self.conout, pos) })?; + Ok(pos) + } + + fn clear(&mut self, length: u32, pos: console::COORD, attr: u16) -> Result<()> { + let mut _count = 0; + check(unsafe { + console::FillConsoleOutputCharacterA(self.conout, b' ' as i8, length, pos, &mut _count) + })?; + Ok(check(unsafe { + console::FillConsoleOutputAttribute(self.conout, attr, length, pos, &mut _count) + })?) + } + + fn set_cursor_visibility(&mut self, visible: bool) -> Result> { + set_cursor_visibility(self.conout, visible) + } + + // You can't have both ENABLE_WRAP_AT_EOL_OUTPUT and + // ENABLE_VIRTUAL_TERMINAL_PROCESSING. So we need to wrap manually. + fn wrap_at_eol(&mut self, s: &str, mut col: usize) -> usize { + let mut esc_seq = 0; + for c in s.graphemes(true) { + if c == "\n" { + col = 0; + } else { + let cw = width(c, &mut esc_seq); + col += cw; + if col > self.cols { + self.buffer.push('\n'); + col = cw; + } + } + self.buffer.push_str(c); + } + if col == self.cols { + self.buffer.push('\n'); + col = 0; + } + col + } + + // position at the start of the prompt, clear to end of previous input + fn clear_old_rows( + &mut self, + info: &console::CONSOLE_SCREEN_BUFFER_INFO, + layout: &Layout, + ) -> Result<()> { + let current_row = layout.cursor.row; + let old_rows = layout.end.row; + let mut coord = info.dwCursorPosition; + coord.X = 0; + coord.Y -= current_row as i16; + let coord = self.set_console_cursor_position(coord, info.dwSize)?; + self.clear( + (info.dwSize.X * (old_rows as i16 + 1)) as u32, + coord, + info.wAttributes, + ) + } +} + +pub struct ConsoleCursorGuard(HANDLE); + +impl Drop for ConsoleCursorGuard { + fn drop(&mut self) { + let _ = set_cursor_visibility(self.0, true); + } +} + +fn set_cursor_visibility(handle: HANDLE, visible: bool) -> Result> { + let mut info = unsafe { mem::zeroed() }; + check(unsafe { console::GetConsoleCursorInfo(handle, &mut info) })?; + let b = if visible { TRUE } else { FALSE }; + if info.bVisible == b { + return Ok(None); + } + info.bVisible = b; + check(unsafe { console::SetConsoleCursorInfo(handle, &info) })?; + Ok(if visible { + None + } else { + Some(ConsoleCursorGuard(handle)) + }) +} + +impl Renderer for ConsoleRenderer { + type Reader = ConsoleRawReader; + + fn move_cursor(&mut self, old: Position, new: Position) -> Result<()> { + let info = self.get_console_screen_buffer_info()?; + let mut cursor = info.dwCursorPosition; + if new.row > old.row { + cursor.Y += (new.row - old.row) as i16; + } else { + cursor.Y -= (old.row - new.row) as i16; + } + if new.col > old.col { + cursor.X += (new.col - old.col) as i16; + } else { + cursor.X -= (old.col - new.col) as i16; + } + self.set_console_cursor_position(cursor, info.dwSize) + .map(|_| ()) + } + + fn refresh_line( + &mut self, + prompt: &str, + line: &LineBuffer, + hint: Option<&str>, + old_layout: &Layout, + new_layout: &Layout, + highlighter: Option<&dyn Highlighter>, + ) -> Result<()> { + let default_prompt = new_layout.default_prompt; + let cursor = new_layout.cursor; + let end_pos = new_layout.end; + + self.buffer.clear(); + let mut col = 0; + if let Some(highlighter) = highlighter { + // TODO handle ansi escape code (SetConsoleTextAttribute) + // append the prompt + col = self.wrap_at_eol(&highlighter.highlight_prompt(prompt, default_prompt), col); + // append the input line + col = self.wrap_at_eol(&highlighter.highlight(line, line.pos()), col); + } else if self.colors_enabled { + // append the prompt + col = self.wrap_at_eol(prompt, col); + // append the input line + col = self.wrap_at_eol(line, col); + } else { + // append the prompt + self.buffer.push_str(prompt); + // append the input line + self.buffer.push_str(line); + } + // append hint + if let Some(hint) = hint { + if let Some(highlighter) = highlighter { + self.wrap_at_eol(&highlighter.highlight_hint(hint), col); + } else if self.colors_enabled { + self.wrap_at_eol(hint, col); + } else { + self.buffer.push_str(hint); + } + } + let info = self.get_console_screen_buffer_info()?; + // just to avoid flickering + let mut guard = self.set_cursor_visibility(false)?; + // position at the start of the prompt, clear to end of previous input + self.clear_old_rows(&info, old_layout)?; + // display prompt, input line and hint + write_to_console(self.conout, self.buffer.as_str(), &mut self.utf16)?; + + // position the cursor + let info = self.get_console_screen_buffer_info()?; + let mut coord = info.dwCursorPosition; + coord.X = cursor.col as i16; + coord.Y -= (end_pos.row - cursor.row) as i16; + self.set_console_cursor_position(coord, info.dwSize)?; + guard.take(); + Ok(()) + } + + fn write_and_flush(&mut self, buf: &str) -> Result<()> { + write_to_console(self.conout, buf, &mut self.utf16) + } + + /// Characters with 2 column width are correctly handled (not split). + fn calculate_position(&self, s: &str, orig: Position) -> Position { + let mut pos = orig; + for c in s.graphemes(true) { + if c == "\n" { + pos.col = 0; + pos.row += 1; + } else { + let cw = c.width(); + pos.col += cw; + if pos.col > self.cols { + pos.row += 1; + pos.col = cw; + } + } + } + if pos.col == self.cols { + pos.col = 0; + pos.row += 1; + } + pos + } + + fn beep(&mut self) -> Result<()> { + match self.bell_style { + BellStyle::Audible => write_all(self.conout, &[7; 1]), + _ => Ok(()), + } + } + + /// Clear the screen. Used to handle ctrl+l + fn clear_screen(&mut self) -> Result<()> { + let info = self.get_console_screen_buffer_info()?; + let coord = console::COORD { X: 0, Y: 0 }; + check(unsafe { console::SetConsoleCursorPosition(self.conout, coord) })?; + let n = info.dwSize.X as u32 * info.dwSize.Y as u32; + self.clear(n, coord, info.wAttributes) + } + + fn clear_rows(&mut self, layout: &Layout) -> Result<()> { + let info = self.get_console_screen_buffer_info()?; + self.clear_old_rows(&info, layout) + } + + /// Try to get the number of columns in the current terminal, + /// or assume 80 if it fails. + fn update_size(&mut self) { + let (cols, _) = get_win_size(self.conout); + self.cols = cols; + } + + fn get_columns(&self) -> usize { + self.cols + } + + /// Try to get the number of rows in the current terminal, + /// or assume 24 if it fails. + fn get_rows(&self) -> usize { + let (_, rows) = get_win_size(self.conout); + rows + } + + fn colors_enabled(&self) -> bool { + self.colors_enabled + } + + fn move_cursor_at_leftmost(&mut self, _: &mut ConsoleRawReader) -> Result<()> { + let info = self.get_console_screen_buffer_info()?; + let mut cursor = info.dwCursorPosition; + if cursor.X == 0 { + return Ok(()); + } + debug!(target: "rustyline", "initial cursor location: {:?}, {:?}", cursor.X, cursor.Y); + cursor.X = 0; + cursor.Y += 1; + let res = self.set_console_cursor_position(cursor, info.dwSize); + if let Err(error::ReadlineError::Io(ref e)) = res { + if e.raw_os_error() == Some(foundation::ERROR_INVALID_PARAMETER as i32) { + warn!(target: "rustyline", "invalid cursor position: ({:?}, {:?}) in ({:?}, {:?})", cursor.X, cursor.Y, info.dwSize.X, info.dwSize.Y); + write_all(self.conout, &[10; 1])?; + return Ok(()); + } + } + res.map(|_| ()) + } +} + +fn write_to_console(handle: HANDLE, s: &str, utf16: &mut Vec) -> Result<()> { + utf16.clear(); + utf16.extend(s.encode_utf16()); + write_all(handle, utf16.as_slice()) +} + +// See write_valid_utf8_to_console +// /src/rust/library/std/src/sys/windows/stdio.rs:171 +fn write_all(handle: HANDLE, mut data: &[u16]) -> Result<()> { + use std::io::{Error, ErrorKind}; + while !data.is_empty() { + let slice = if data.len() < 8192 { + data + } else if (0xD800..0xDC00).contains(&data[8191]) { + &data[..8191] + } else { + &data[..8192] + }; + let mut written = 0; + check(unsafe { + console::WriteConsoleW( + handle, + slice.as_ptr(), + slice.len() as u32, + &mut written, + ptr::null_mut(), + ) + })?; + if written == 0 { + Err(Error::new(ErrorKind::WriteZero, "WriteConsoleW"))?; + } + data = &data[(written as usize)..]; + } + Ok(()) +} + +#[cfg(not(test))] +pub type Terminal = Console; + +#[derive(Clone, Debug)] +pub struct Console { + conin_isatty: bool, + conin: HANDLE, + conout_isatty: bool, + conout: HANDLE, + close_on_drop: bool, + pub(crate) color_mode: ColorMode, + ansi_colors_supported: bool, + bell_style: BellStyle, + raw_mode: Arc, + // external print reader + pipe_reader: Option>, + // external print writer + pipe_writer: Option>, +} + +impl Console { + fn colors_enabled(&self) -> bool { + // TODO ANSI Colors & Windows <10 + match self.color_mode { + ColorMode::Enabled => self.conout_isatty && self.ansi_colors_supported, + ColorMode::Forced => true, + ColorMode::Disabled => false, + } + } +} + +impl Term for Console { + type Buffer = ConsoleBuffer; + type CursorGuard = ConsoleCursorGuard; + type ExternalPrinter = ExternalPrinter; + type KeyMap = ConsoleKeyMap; + type Mode = ConsoleMode; + type Reader = ConsoleRawReader; + type Writer = ConsoleRenderer; + + fn new( + color_mode: ColorMode, + behavior: Behavior, + _tab_stop: usize, + bell_style: BellStyle, + _enable_bracketed_paste: bool, + _enable_signals: bool, + ) -> Result { + let (conin, conout, close_on_drop) = if behavior == Behavior::PreferTerm { + if let (Ok(conin), Ok(conout)) = ( + OpenOptions::new().read(true).write(true).open("CONIN$"), + OpenOptions::new().read(true).write(true).open("CONOUT$"), + ) { + ( + Ok(conin.into_raw_handle() as HANDLE), + Ok(conout.into_raw_handle() as HANDLE), + true, + ) + } else { + ( + get_std_handle(console::STD_INPUT_HANDLE), + get_std_handle(console::STD_OUTPUT_HANDLE), + false, + ) + } + } else { + ( + get_std_handle(console::STD_INPUT_HANDLE), + get_std_handle(console::STD_OUTPUT_HANDLE), + false, + ) + }; + let conin_isatty = match conin { + Ok(handle) => { + // If this function doesn't fail then fd is a TTY + get_console_mode(handle).is_ok() + } + Err(_) => false, + }; + + let conout_isatty = match conout { + Ok(handle) => { + // If this function doesn't fail then fd is a TTY + get_console_mode(handle).is_ok() + } + Err(_) => false, + }; + + Ok(Self { + conin_isatty, + conin: conin.unwrap_or(ptr::null_mut()), + conout_isatty, + conout: conout.unwrap_or(ptr::null_mut()), + close_on_drop, + color_mode, + ansi_colors_supported: false, + bell_style, + raw_mode: Arc::new(AtomicBool::new(false)), + pipe_reader: None, + pipe_writer: None, + }) + } + + /// Checking for an unsupported TERM in windows is a no-op + fn is_unsupported(&self) -> bool { + false + } + + fn is_input_tty(&self) -> bool { + self.conin_isatty + } + + fn is_output_tty(&self) -> bool { + self.conout_isatty + } + + // pub fn install_sigwinch_handler(&mut self) { + // See ReadConsoleInputW && WINDOW_BUFFER_SIZE_EVENT + // } + + /// Enable RAW mode for the terminal. + fn enable_raw_mode(&mut self) -> Result<(ConsoleMode, ConsoleKeyMap)> { + if !self.conin_isatty { + Err(io::Error::new( + io::ErrorKind::Other, + "no stdio handle available for this process", + ))?; + } + let original_conin_mode = get_console_mode(self.conin)?; + // Disable these modes + let mut raw = original_conin_mode + & !(console::ENABLE_LINE_INPUT + | console::ENABLE_ECHO_INPUT + | console::ENABLE_PROCESSED_INPUT); + // Enable these modes + raw |= console::ENABLE_EXTENDED_FLAGS; + raw |= console::ENABLE_INSERT_MODE; + raw |= console::ENABLE_QUICK_EDIT_MODE; + raw |= console::ENABLE_WINDOW_INPUT; + check(unsafe { console::SetConsoleMode(self.conin, raw) })?; + + let original_conout_mode = if self.conout_isatty { + let original_conout_mode = get_console_mode(self.conout)?; + + let mut mode = original_conout_mode; + if mode & console::ENABLE_WRAP_AT_EOL_OUTPUT == 0 { + mode |= console::ENABLE_WRAP_AT_EOL_OUTPUT; + debug!(target: "rustyline", "activate ENABLE_WRAP_AT_EOL_OUTPUT"); + unsafe { + assert_ne!(console::SetConsoleMode(self.conout, mode), 0); + } + } + // To enable ANSI colors (Windows 10 only): + // https://docs.microsoft.com/en-us/windows/console/setconsolemode + self.ansi_colors_supported = mode & console::ENABLE_VIRTUAL_TERMINAL_PROCESSING != 0; + if self.ansi_colors_supported { + if self.color_mode == ColorMode::Disabled { + mode &= !console::ENABLE_VIRTUAL_TERMINAL_PROCESSING; + debug!(target: "rustyline", "deactivate ENABLE_VIRTUAL_TERMINAL_PROCESSING"); + unsafe { + assert_ne!(console::SetConsoleMode(self.conout, mode), 0); + } + } else { + debug!(target: "rustyline", "ANSI colors already enabled"); + } + } else if self.color_mode != ColorMode::Disabled { + mode |= console::ENABLE_VIRTUAL_TERMINAL_PROCESSING; + self.ansi_colors_supported = + unsafe { console::SetConsoleMode(self.conout, mode) != 0 }; + debug!(target: "rustyline", "ansi_colors_supported: {}", self.ansi_colors_supported); + } + Some(original_conout_mode) + } else { + None + }; + + self.raw_mode.store(true, Ordering::SeqCst); + // when all ExternalPrinter are dropped there is no need to use `pipe_reader` + if Arc::strong_count(&self.raw_mode) == 1 { + self.pipe_writer = None; + self.pipe_reader = None; + } + + Ok(( + ConsoleMode { + original_conin_mode, + conin: self.conin, + original_conout_mode, + conout: self.conout, + raw_mode: self.raw_mode.clone(), + }, + (), + )) + } + + fn create_reader( + &self, + _: Option, + _: &Config, + _: ConsoleKeyMap, + ) -> ConsoleRawReader { + ConsoleRawReader::create(self.conin, self.pipe_reader.clone()) + } + + fn create_writer(&self) -> ConsoleRenderer { + ConsoleRenderer::new(self.conout, self.colors_enabled(), self.bell_style) + } + + fn writeln(&self) -> Result<()> { + write_all(self.conout, &[10; 1]) + } + + fn create_external_printer(&mut self) -> Result { + if let Some(ref sender) = self.pipe_writer { + return Ok(ExternalPrinter { + event: self.pipe_reader.as_ref().unwrap().event.0, + sender: sender.clone(), + raw_mode: self.raw_mode.clone(), + conout: self.conout, + }); + } + if !self.is_input_tty() || !self.is_output_tty() { + Err(io::Error::from(io::ErrorKind::Other))?; // FIXME + } + let event = unsafe { threading::CreateEventW(ptr::null_mut(), TRUE, FALSE, ptr::null()) }; + if event.is_null() { + Err(io::Error::last_os_error())?; + } + let (sender, receiver) = sync_channel(1); + + let reader = Rc::new(AsyncPipe { + event: Handle(event), + receiver, + }); + self.pipe_reader.replace(reader); + self.pipe_writer.replace(sender.clone()); + Ok(ExternalPrinter { + event, + sender, + raw_mode: self.raw_mode.clone(), + conout: self.conout, + }) + } + + fn set_cursor_visibility(&mut self, visible: bool) -> Result> { + if self.conout_isatty { + set_cursor_visibility(self.conout, visible) + } else { + Ok(None) + } + } +} + +impl Drop for Console { + fn drop(&mut self) { + if self.close_on_drop { + unsafe { foundation::CloseHandle(self.conin) }; + unsafe { foundation::CloseHandle(self.conout) }; + } + } +} + +unsafe impl Send for Console {} +unsafe impl Sync for Console {} + +#[derive(Debug)] +struct AsyncPipe { + event: Handle, + receiver: Receiver, +} + +#[derive(Debug)] +pub struct ExternalPrinter { + event: HANDLE, + sender: SyncSender, + raw_mode: Arc, + conout: HANDLE, +} + +unsafe impl Send for ExternalPrinter {} +unsafe impl Sync for ExternalPrinter {} + +impl super::ExternalPrinter for ExternalPrinter { + fn print(&mut self, msg: String) -> Result<()> { + // write directly to stdout/stderr while not in raw mode + if !self.raw_mode.load(Ordering::SeqCst) { + let mut utf16 = vec![]; + write_to_console(self.conout, msg.as_str(), &mut utf16) + } else { + self.sender + .send(msg) + .map_err(|_| io::Error::from(io::ErrorKind::Other))?; // FIXME + Ok(check(unsafe { threading::SetEvent(self.event) })?) + } + } +} + +#[derive(Debug)] +struct Handle(HANDLE); + +unsafe impl Send for Handle {} +unsafe impl Sync for Handle {} + +impl Drop for Handle { + fn drop(&mut self) { + unsafe { foundation::CloseHandle(self.0) }; + } +} + +#[cfg(test)] +mod test { + use super::Console; + + #[test] + fn test_send() { + fn assert_send() {} + assert_send::(); + } + + #[test] + fn test_sync() { + fn assert_sync() {} + assert_sync::(); + } +} diff --git a/rustyline-15.0.0/src/undo.rs b/rustyline-15.0.0/src/undo.rs new file mode 100644 index 0000000000..924319f240 --- /dev/null +++ b/rustyline-15.0.0/src/undo.rs @@ -0,0 +1,482 @@ +//! Undo API +use std::fmt::Debug; + +use crate::keymap::RepeatCount; +use crate::line_buffer::{ChangeListener, DeleteListener, Direction, LineBuffer, NoListener}; +use log::debug; +use unicode_segmentation::UnicodeSegmentation; + +enum Change { + Begin, + End, + Insert { + idx: usize, + text: String, + }, // QuotedInsert, SelfInsert, Yank + Delete { + idx: usize, + text: String, + }, /* BackwardDeleteChar, BackwardKillWord, DeleteChar, + * KillLine, KillWholeLine, KillWord, + * UnixLikeDiscard, ViDeleteTo */ + Replace { + idx: usize, + old: String, + new: String, + }, /* CapitalizeWord, Complete, DowncaseWord, Replace, TransposeChars, TransposeWords, + * UpcaseWord, YankPop */ +} + +impl Change { + fn undo(&self, line: &mut LineBuffer) { + match *self { + Self::Begin | Self::End => unreachable!(), + Self::Insert { idx, ref text } => { + line.delete_range(idx..idx + text.len(), &mut NoListener); + } + Self::Delete { idx, ref text } => { + line.insert_str(idx, text, &mut NoListener); + line.set_pos(idx + text.len()); + } + Self::Replace { + idx, + ref old, + ref new, + } => { + line.replace(idx..idx + new.len(), old, &mut NoListener); + } + } + } + + #[cfg(test)] + fn redo(&self, line: &mut LineBuffer) { + match *self { + Self::Begin | Self::End => unreachable!(), + Self::Insert { idx, ref text } => { + line.insert_str(idx, text, &mut NoListener); + } + Self::Delete { idx, ref text } => { + line.delete_range(idx..idx + text.len(), &mut NoListener); + } + Self::Replace { + idx, + ref old, + ref new, + } => { + line.replace(idx..idx + old.len(), new, &mut NoListener); + } + } + } + + fn insert_seq(&self, indx: usize) -> bool { + if let Self::Insert { idx, ref text } = *self { + idx + text.len() == indx + } else { + false + } + } + + fn delete_seq(&self, indx: usize, len: usize) -> bool { + if let Self::Delete { idx, .. } = *self { + // delete or backspace + idx == indx || idx == indx + len + } else { + false + } + } + + fn replace_seq(&self, indx: usize) -> bool { + if let Self::Replace { idx, ref new, .. } = *self { + idx + new.len() == indx + } else { + false + } + } +} + +/// Undo manager +pub struct Changeset { + undo_group_level: u32, + undos: Vec, // undoable changes + redos: Vec, // undone changes, redoable +} + +impl Changeset { + pub(crate) fn new() -> Self { + Self { + undo_group_level: 0, + undos: vec![], + redos: vec![], + } + } + + pub(crate) fn begin(&mut self) -> usize { + debug!(target: "rustyline", "Changeset::begin"); + self.redos.clear(); + let mark = self.undos.len(); + self.undos.push(Change::Begin); + self.undo_group_level += 1; + mark + } + + /// Returns `true` when changes happen between the last call to `begin` and + /// this `end`. + pub(crate) fn end(&mut self) -> bool { + debug!(target: "rustyline", "Changeset::end"); + self.redos.clear(); + let mut touched = false; + while self.undo_group_level > 0 { + self.undo_group_level -= 1; + if let Some(&Change::Begin) = self.undos.last() { + // empty Begin..End + self.undos.pop(); + } else { + self.undos.push(Change::End); + touched = true; + } + } + touched + } + + fn insert_char(idx: usize, c: char) -> Change { + let mut text = String::new(); + text.push(c); + Change::Insert { idx, text } + } + + pub(crate) fn insert(&mut self, idx: usize, c: char) { + debug!(target: "rustyline", "Changeset::insert({}, {:?})", idx, c); + self.redos.clear(); + if !c.is_alphanumeric() || !self.undos.last().map_or(false, |lc| lc.insert_seq(idx)) { + self.undos.push(Self::insert_char(idx, c)); + return; + } + // merge consecutive char insertions when char is alphanumeric + let mut last_change = self.undos.pop().unwrap(); + if let Change::Insert { ref mut text, .. } = last_change { + text.push(c); + } else { + unreachable!(); + } + self.undos.push(last_change); + } + + pub(crate) fn insert_str + Into + Debug>( + &mut self, + idx: usize, + string: S, + ) { + debug!(target: "rustyline", "Changeset::insert_str({}, {:?})", idx, string); + self.redos.clear(); + if string.as_ref().is_empty() { + return; + } + self.undos.push(Change::Insert { + idx, + text: string.into(), + }); + } + + pub(crate) fn delete + Into + Debug>(&mut self, indx: usize, string: S) { + debug!(target: "rustyline", "Changeset::delete({}, {:?})", indx, string); + self.redos.clear(); + if string.as_ref().is_empty() { + return; + } + + if !Self::single_char(string.as_ref()) + || !self + .undos + .last() + .map_or(false, |lc| lc.delete_seq(indx, string.as_ref().len())) + { + self.undos.push(Change::Delete { + idx: indx, + text: string.into(), + }); + return; + } + // merge consecutive char deletions when char is alphanumeric + let mut last_change = self.undos.pop().unwrap(); + if let Change::Delete { + ref mut idx, + ref mut text, + } = last_change + { + if *idx == indx { + text.push_str(string.as_ref()); + } else { + text.insert_str(0, string.as_ref()); + *idx = indx; + } + } else { + unreachable!(); + } + self.undos.push(last_change); + } + + fn single_char(s: &str) -> bool { + let mut graphemes = s.graphemes(true); + graphemes.next().map_or(false, |grapheme| { + grapheme.chars().all(char::is_alphanumeric) + }) && graphemes.next().is_none() + } + + pub(crate) fn replace + Into + Debug>( + &mut self, + indx: usize, + old_: S, + new_: S, + ) { + debug!(target: "rustyline", "Changeset::replace({}, {:?}, {:?})", indx, old_, new_); + self.redos.clear(); + + if !self.undos.last().map_or(false, |lc| lc.replace_seq(indx)) { + self.undos.push(Change::Replace { + idx: indx, + old: old_.into(), + new: new_.into(), + }); + return; + } + + // merge consecutive char replacements + let mut last_change = self.undos.pop().unwrap(); + if let Change::Replace { + ref mut old, + ref mut new, + .. + } = last_change + { + old.push_str(old_.as_ref()); + new.push_str(new_.as_ref()); + } else { + unreachable!(); + } + self.undos.push(last_change); + } + + pub(crate) fn undo(&mut self, line: &mut LineBuffer, n: RepeatCount) -> bool { + debug!(target: "rustyline", "Changeset::undo"); + let mut count = 0; + let mut waiting_for_begin = 0; + let mut undone = false; + while let Some(change) = self.undos.pop() { + match change { + Change::Begin => { + waiting_for_begin -= 1; + } + Change::End => { + waiting_for_begin += 1; + } + _ => { + change.undo(line); + undone = true; + } + }; + self.redos.push(change); + if waiting_for_begin <= 0 { + count += 1; + if count >= n { + break; + } + } + } + undone + } + + pub(crate) fn truncate(&mut self, len: usize) { + debug!(target: "rustyline", "Changeset::truncate({})", len); + self.undos.truncate(len); + } + + #[cfg(test)] + pub(crate) fn redo(&mut self, line: &mut LineBuffer) -> bool { + let mut waiting_for_end = 0; + let mut redone = false; + while let Some(change) = self.redos.pop() { + match change { + Change::Begin => { + waiting_for_end += 1; + } + Change::End => { + waiting_for_end -= 1; + } + _ => { + change.redo(line); + redone = true; + } + }; + self.undos.push(change); + if waiting_for_end <= 0 { + break; + } + } + redone + } + + pub(crate) fn last_insert(&self) -> Option { + for change in self.undos.iter().rev() { + match change { + Change::Insert { ref text, .. } => return Some(text.clone()), + Change::Replace { ref new, .. } => return Some(new.clone()), + Change::End => { + continue; + } + _ => { + return None; + } + } + } + None + } +} + +impl DeleteListener for Changeset { + fn delete(&mut self, idx: usize, string: &str, _: Direction) { + self.delete(idx, string); + } +} +impl ChangeListener for Changeset { + fn insert_char(&mut self, idx: usize, c: char) { + self.insert(idx, c); + } + + fn insert_str(&mut self, idx: usize, string: &str) { + self.insert_str(idx, string); + } + + fn replace(&mut self, idx: usize, old: &str, new: &str) { + self.replace(idx, old, new); + } +} + +#[cfg(test)] +mod tests { + use super::Changeset; + use crate::line_buffer::{LineBuffer, NoListener}; + + #[test] + fn test_insert_chars() { + let mut cs = Changeset::new(); + cs.insert(0, 'H'); + cs.insert(1, 'i'); + assert_eq!(1, cs.undos.len()); + assert_eq!(0, cs.redos.len()); + cs.insert(0, ' '); + assert_eq!(2, cs.undos.len()); + } + + #[test] + fn test_insert_strings() { + let mut cs = Changeset::new(); + cs.insert_str(0, "Hello"); + cs.insert_str(5, ", "); + assert_eq!(2, cs.undos.len()); + assert_eq!(0, cs.redos.len()); + } + + #[test] + fn test_undo_insert() { + let mut buf = LineBuffer::init("", 0); + buf.insert_str(0, "Hello", &mut NoListener); + buf.insert_str(5, ", world!", &mut NoListener); + let mut cs = Changeset::new(); + assert_eq!(buf.as_str(), "Hello, world!"); + + cs.insert_str(5, ", world!"); + + cs.undo(&mut buf, 1); + assert_eq!(0, cs.undos.len()); + assert_eq!(1, cs.redos.len()); + assert_eq!(buf.as_str(), "Hello"); + + cs.redo(&mut buf); + assert_eq!(1, cs.undos.len()); + assert_eq!(0, cs.redos.len()); + assert_eq!(buf.as_str(), "Hello, world!"); + } + + #[test] + fn test_undo_delete() { + let mut buf = LineBuffer::init("", 0); + buf.insert_str(0, "Hello", &mut NoListener); + let mut cs = Changeset::new(); + assert_eq!(buf.as_str(), "Hello"); + + cs.delete(5, ", world!"); + + cs.undo(&mut buf, 1); + assert_eq!(buf.as_str(), "Hello, world!"); + + cs.redo(&mut buf); + assert_eq!(buf.as_str(), "Hello"); + } + + #[test] + fn test_delete_chars() { + let mut buf = LineBuffer::init("", 0); + buf.insert_str(0, "Hlo", &mut NoListener); + + let mut cs = Changeset::new(); + cs.delete(1, "e"); + cs.delete(1, "l"); + assert_eq!(1, cs.undos.len()); + + cs.undo(&mut buf, 1); + assert_eq!(buf.as_str(), "Hello"); + } + + #[test] + fn test_backspace_chars() { + let mut buf = LineBuffer::init("", 0); + buf.insert_str(0, "Hlo", &mut NoListener); + + let mut cs = Changeset::new(); + cs.delete(2, "l"); + cs.delete(1, "e"); + assert_eq!(1, cs.undos.len()); + + cs.undo(&mut buf, 1); + assert_eq!(buf.as_str(), "Hello"); + } + + #[test] + fn test_undo_replace() { + let mut buf = LineBuffer::init("", 0); + buf.insert_str(0, "Hello, world!", &mut NoListener); + let mut cs = Changeset::new(); + assert_eq!(buf.as_str(), "Hello, world!"); + + buf.replace(1..5, "i", &mut NoListener); + assert_eq!(buf.as_str(), "Hi, world!"); + cs.replace(1, "ello", "i"); + + cs.undo(&mut buf, 1); + assert_eq!(buf.as_str(), "Hello, world!"); + + cs.redo(&mut buf); + assert_eq!(buf.as_str(), "Hi, world!"); + } + + #[test] + fn test_last_insert() { + let mut cs = Changeset::new(); + cs.begin(); + cs.delete(0, "Hello"); + cs.insert_str(0, "Bye"); + cs.end(); + let insert = cs.last_insert(); + assert_eq!(Some("Bye".to_owned()), insert); + } + + #[test] + fn test_end() { + let mut cs = Changeset::new(); + cs.begin(); + assert!(!cs.end()); + cs.begin(); + cs.insert_str(0, "Hi"); + assert!(cs.end()); + } +} diff --git a/rustyline-15.0.0/src/validate.rs b/rustyline-15.0.0/src/validate.rs new file mode 100644 index 0000000000..f1475cd472 --- /dev/null +++ b/rustyline-15.0.0/src/validate.rs @@ -0,0 +1,135 @@ +//! Input validation API (Multi-line editing) + +use crate::keymap::Invoke; +use crate::Result; + +/// Input validation result +#[non_exhaustive] +pub enum ValidationResult { + /// Incomplete input + Incomplete, + /// Validation fails with an optional error message. User must fix the + /// input. + Invalid(Option), + /// Validation succeeds with an optional message + Valid(Option), +} + +impl ValidationResult { + pub(crate) fn is_valid(&self) -> bool { + matches!(self, Self::Valid(_)) + } + + pub(crate) fn has_message(&self) -> bool { + matches!(self, Self::Valid(Some(_)) | Self::Invalid(Some(_))) + } +} + +/// Give access to user input. +pub struct ValidationContext<'i> { + i: &'i mut dyn Invoke, +} + +impl<'i> ValidationContext<'i> { + pub(crate) fn new(i: &'i mut dyn Invoke) -> Self { + ValidationContext { i } + } + + /// Returns user input. + #[must_use] + pub fn input(&self) -> &str { + self.i.input() + } + + // TODO + //fn invoke(&mut self, cmd: Cmd) -> Result { + // self.i.invoke(cmd) + //} +} + +/// This trait provides an extension interface for determining whether +/// the current input buffer is valid. +/// +/// Rustyline uses the method provided by this trait to decide whether hitting +/// the enter key will end the current editing session and return the current +/// line buffer to the caller of `Editor::readline` or variants. +pub trait Validator { + /// Takes the currently edited `input` and returns a + /// `ValidationResult` indicating whether it is valid or not along + /// with an option message to display about the result. The most + /// common validity check to implement is probably whether the + /// input is complete or not, for instance ensuring that all + /// delimiters are fully balanced. + /// + /// If you implement more complex validation checks it's probably + /// a good idea to also implement a `Hinter` to provide feedback + /// about what is invalid. + /// + /// For auto-correction like a missing closing quote or to reject invalid + /// char while typing, the input will be mutable (TODO). + fn validate(&self, ctx: &mut ValidationContext) -> Result { + let _ = ctx; + Ok(ValidationResult::Valid(None)) + } + + /// Configure whether validation is performed while typing or only + /// when user presses the Enter key. + /// + /// Default is `false`. + /// + /// This feature is not yet implemented, so this function is currently a + /// no-op + fn validate_while_typing(&self) -> bool { + false + } +} + +impl Validator for () {} + +/// Simple matching bracket validator. +#[derive(Default)] +pub struct MatchingBracketValidator { + _priv: (), +} + +impl MatchingBracketValidator { + /// Constructor + #[must_use] + pub fn new() -> Self { + Self { _priv: () } + } +} + +impl Validator for MatchingBracketValidator { + fn validate(&self, ctx: &mut ValidationContext) -> Result { + Ok(validate_brackets(ctx.input())) + } +} + +fn validate_brackets(input: &str) -> ValidationResult { + let mut stack = vec![]; + for c in input.chars() { + match c { + '(' | '[' | '{' => stack.push(c), + ')' | ']' | '}' => match (stack.pop(), c) { + (Some('('), ')') | (Some('['), ']') | (Some('{'), '}') => {} + (Some(wanted), _) => { + return ValidationResult::Invalid(Some(format!( + "Mismatched brackets: {wanted:?} is not properly closed" + ))) + } + (None, c) => { + return ValidationResult::Invalid(Some(format!( + "Mismatched brackets: {c:?} is unpaired" + ))) + } + }, + _ => {} + } + } + if stack.is_empty() { + ValidationResult::Valid(None) + } else { + ValidationResult::Incomplete + } +} diff --git a/wasm-bindgen-0.2.118/.cargo-checksum.json b/wasm-bindgen-0.2.118/.cargo-checksum.json deleted file mode 100644 index 9bd5729b42..0000000000 --- a/wasm-bindgen-0.2.118/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{".cargo_vcs_info.json":"ddfb81aa48f3a91e8932ad789628ede8d4983120039092c129eea2c9a6c2d3b4","Cargo.lock":"ff3316f5cd5deb9969332d034fc31716d9b846453c12a7feb3345968b44ff9a3","Cargo.toml":"190970836f839b35dc0e6c0f1bbb7c47fb83e46af947dd6da7144bfb32de13ae","Cargo.toml.orig":"ee629f769de496076e7bdecf14a600ddf3d53c9273f0f5b8fd91a61e4d0ef43a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"01fce2dac2c4e3900cc0ae75f9d5b5d5b55158bf3998e0fe05d8ba9fe7d86a03","build.rs":"670375b8c8670056265b25160727a339a9967abe5ec8ca74173ad027ddabeedb","src/cache/intern.rs":"b354990c27d418b201a918782f1aa736c2cafd31fcde694bb19aa58c5bc47449","src/cache/mod.rs":"8989143b55160dbc142cb20c6e066cf0a3f70d6c97fbc9aa0fac59bd62bd865b","src/cast.rs":"156a9b71bf9af03c5c378a1939032dfc628edbefce4aa8c37fb14948abf7a9f4","src/closure.rs":"eff939e17778c23ec4428bbdc0af9263f413e4c0809a3c1436965fc5df8ba785","src/convert/closures.rs":"affd61989621eda81e87e2135cbdbd17870460bedb9f07c0d3e682fb12837fd1","src/convert/impls.rs":"b13bd8fcf360781035828694ba6098d5492edf6ace286e357aae9b94b7710dc1","src/convert/mod.rs":"83abe862e77f8d5c92102fd1df4de0854193a1b5530ad1e15b439031d7897396","src/convert/slices.rs":"d333cd1fb726e69c09b8bbcfd20745afe6b53148fc406f47f1235ee5ddf079f0","src/convert/traits.rs":"66e7c0f91c7594923154785c81e681bbf9b58e0f916f0096551a38c8240485bc","src/describe.rs":"efb32293c9ec4df2b43ca2cbaf3a34d546c4af4479d07b37371f859c06c0e5e2","src/externref.rs":"589c292353a0355461aac8b8030205c97ee53b9e21b53dfde99d565790bda2df","src/handler.rs":"fd187aadf360c2d13e9153fd58a5b640b656dfa892e9bdbe726f96b0636a7f09","src/lib.rs":"7a293949783563c40831d33d78ab0b4ddc99be8cfbfbff3b9a2f1507d35149db","src/link.rs":"96fdb40e29ffae7b9621d78eec24437bdc6db2473f6d2f8eff1f987d2b566852","src/rt/marker.rs":"8054b0b009c480dcfb42e8649f67d8c9109540210349215e393688e28bed4a4f","src/rt/mod.rs":"ba7b10d30d857e47475988e04c8ca14e41ac1246d35c6ad53cbfbc9958897549","src/sys.rs":"e4b4dd9f3c625515c3844236620cb7c77544f3db6b380f5e98e1a7e38c3c8a94"},"package":"0bf938a0bacb0469e83c1e148908bd7d5a6010354cf4fb73279b7447422e3a89"} \ No newline at end of file diff --git a/wasm-bindgen-0.2.118/.cargo_vcs_info.json b/wasm-bindgen-0.2.118/.cargo_vcs_info.json deleted file mode 100644 index 6ce9106d55..0000000000 --- a/wasm-bindgen-0.2.118/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "753bb7ff4de2a00e30d2c6b56ee8e06a9e527f01" - }, - "path_in_vcs": "" -} \ No newline at end of file diff --git a/wasm-bindgen-0.2.121/.cargo-checksum.json b/wasm-bindgen-0.2.121/.cargo-checksum.json new file mode 100644 index 0000000000..a99e4fdc18 --- /dev/null +++ b/wasm-bindgen-0.2.121/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"fcc8c298b2bafc9152e58f748b4c414d3c6f5f0e6281a8bef3dc0448fcdbb008","Cargo.lock":"e0090553ec7bc7cb6d9ee6c432a87af7d8bb33ac70dd9e9b262de8ea7452794a","Cargo.toml":"1114297ac455f42ec269a3c84b5e56bee6d75aaa0f7638da916bfe06f6cecffe","Cargo.toml.orig":"3fcfe31e42b75722d7dbc51915cf882cd34a0d12bbf6365d42f297643522493c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"006f14ae5ec54943737bddd9342eb24975a0e95b808f76d4c98258d3fea75d2d","build.rs":"33c90a6eb1745c53f9047e0ecde135b249b0ea3d9e1a2a40c9610a33f225e6c9","src/cache/intern.rs":"b354990c27d418b201a918782f1aa736c2cafd31fcde694bb19aa58c5bc47449","src/cache/mod.rs":"8989143b55160dbc142cb20c6e066cf0a3f70d6c97fbc9aa0fac59bd62bd865b","src/cast.rs":"156a9b71bf9af03c5c378a1939032dfc628edbefce4aa8c37fb14948abf7a9f4","src/closure.rs":"ad59fb6c299055589ad7817b5d0e28d5f4817ea2f219a06b2f3cb6b6f29c0581","src/convert/closures.rs":"f1004f4a022f4d063414bc67720fbb04327955c02837241b37fb8298f5fd345e","src/convert/impls.rs":"5d4e3bfaf2e4a3152b8a1b0b2883ee3658317e3f70aa3426d3625dfadcb1b007","src/convert/mod.rs":"a284115f8080ee36ea60d6a111d4247856bdee76c4a5b738465f60a97c593eca","src/convert/slices.rs":"3d6ac72ff8e49c10d77878cc79678ce48f12af0d23cf753e3f76a1092c2cb2bb","src/convert/traits.rs":"42d5b337dfee47cedba5b274144fcc015068ee054faea00ae9ad17a4e3ad483b","src/describe.rs":"fe9fbef496f7908156a522d781f813cfc258e39ecdc15c40ba666a4ef24ea624","src/externref.rs":"40d3a6011ff7341c9b1a4bcecc7ddc459f8bf9e7ba37e6a523bcfc66a3ba87d3","src/handler.rs":"fd187aadf360c2d13e9153fd58a5b640b656dfa892e9bdbe726f96b0636a7f09","src/lib.rs":"eab94c94ba3057a6be3d5644f601c7260838971580b7884f2b17580969efc3f8","src/link.rs":"96fdb40e29ffae7b9621d78eec24437bdc6db2473f6d2f8eff1f987d2b566852","src/parent.rs":"d9f90c6eaa6bf00cae48858305eff077947e6558f02da493033f4e4fc09ac7ce","src/rt/marker.rs":"babb6deef8b79dc0e50e5a561d9768dae74da6e67d2005e50f3f91bbb2727345","src/rt/mod.rs":"60b040f80d1a964f86a8b2d8c506217e04a0a3475d0a98d96798d911684ab5b8","src/sys.rs":"0032e512abc66c69eef97ca5f3a892b2394b74b074b7bf024d130234f1fe12a6"},"package":"49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790"} \ No newline at end of file diff --git a/wasm-bindgen-0.2.121/.cargo_vcs_info.json b/wasm-bindgen-0.2.121/.cargo_vcs_info.json new file mode 100644 index 0000000000..b7af40e082 --- /dev/null +++ b/wasm-bindgen-0.2.121/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "49457f2db4465688cb597e9030ccfdefbd2b662e" + }, + "path_in_vcs": "" +} \ No newline at end of file diff --git a/wasm-bindgen-0.2.118/Cargo.lock b/wasm-bindgen-0.2.121/Cargo.lock similarity index 93% rename from wasm-bindgen-0.2.118/Cargo.lock rename to wasm-bindgen-0.2.121/Cargo.lock index 108832d276..9a646024df 100644 --- a/wasm-bindgen-0.2.118/Cargo.lock +++ b/wasm-bindgen-0.2.121/Cargo.lock @@ -123,7 +123,7 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "wasm-bindgen" -version = "0.2.118" +version = "0.2.121" dependencies = [ "cfg-if", "once_cell", @@ -138,9 +138,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.118" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed" +checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -148,9 +148,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.118" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" dependencies = [ "bumpalo", "proc-macro2", @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" dependencies = [ "unicode-ident", ] diff --git a/wasm-bindgen-0.2.118/Cargo.toml b/wasm-bindgen-0.2.121/Cargo.toml similarity index 90% rename from wasm-bindgen-0.2.118/Cargo.toml rename to wasm-bindgen-0.2.121/Cargo.toml index 03cc035f44..502ff3ac06 100644 --- a/wasm-bindgen-0.2.118/Cargo.toml +++ b/wasm-bindgen-0.2.121/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.77" name = "wasm-bindgen" -version = "0.2.118" +version = "0.2.121" authors = ["The wasm-bindgen Developers"] build = "build.rs" include = [ @@ -76,10 +76,10 @@ version = "1.0" optional = true [dependencies.wasm-bindgen-macro] -version = "=0.2.118" +version = "=0.2.121" [dependencies.wasm-bindgen-shared] -version = "=0.2.118" +version = "=0.2.121" [dev-dependencies.once_cell] version = "1" @@ -94,6 +94,12 @@ version = "1" [target.'cfg(target_arch = "wasm32")'.dev-dependencies.serde_derive] version = "1.0" +[target.'cfg(target_arch = "wasm64")'.dev-dependencies.paste] +version = "1" + +[target.'cfg(target_arch = "wasm64")'.dev-dependencies.serde_derive] +version = "1.0" + [lints.clippy] large_enum_variant = "allow" new_without_default = "allow" @@ -110,5 +116,6 @@ level = "warn" priority = 0 check-cfg = [ "cfg(wasm_bindgen_unstable_test_coverage)", + "cfg(wasm_bindgen_use_js_sys)", "cfg(xxx_debug_only_print_generated_code)", ] diff --git a/wasm-bindgen-0.2.118/Cargo.toml.orig b/wasm-bindgen-0.2.121/Cargo.toml.orig similarity index 89% rename from wasm-bindgen-0.2.118/Cargo.toml.orig rename to wasm-bindgen-0.2.121/Cargo.toml.orig index 9cb4475555..4abdfb945d 100644 --- a/wasm-bindgen-0.2.118/Cargo.toml.orig +++ b/wasm-bindgen-0.2.121/Cargo.toml.orig @@ -13,7 +13,7 @@ name = "wasm-bindgen" readme = "README.md" repository = "https://github.com/wasm-bindgen/wasm-bindgen" rust-version = "1.77" -version = "0.2.118" +version = "0.2.121" [package.metadata.docs.rs] features = ["serde-serialize"] @@ -46,8 +46,8 @@ cfg-if = "1.0.0" once_cell = { version = "1.12", default-features = false } serde = { version = "1.0", optional = true } serde_json = { version = "1.0", optional = true } -wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.118" } -wasm-bindgen-shared = { path = "crates/shared", version = "=0.2.118" } +wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.121" } +wasm-bindgen-shared = { path = "crates/shared", version = "=0.2.121" } [build-dependencies] # In older MSRVs, dependencies and crate features can't have the same name. @@ -65,12 +65,21 @@ wasm-bindgen-futures = { path = 'crates/futures' } wasm-bindgen-test-crate-a = { path = 'tests/crates/a' } wasm-bindgen-test-crate-b = { path = 'tests/crates/b' } +[target.'cfg(target_arch = "wasm64")'.dev-dependencies] +js-sys = { path = 'crates/js-sys', features = ["unsafe-eval"] } +paste = "1" +serde_derive = "1.0" +wasm-bindgen-futures = { path = 'crates/futures' } +wasm-bindgen-test-crate-a = { path = 'tests/crates/a' } +wasm-bindgen-test-crate-b = { path = 'tests/crates/b' } + [lints] workspace = true [workspace.lints.rust] unexpected_cfgs = { level = "warn", check-cfg = [ 'cfg(wasm_bindgen_unstable_test_coverage)', + 'cfg(wasm_bindgen_use_js_sys)', 'cfg(xxx_debug_only_print_generated_code)', ] } unused_lifetimes = "warn" diff --git a/wasm-bindgen-macro-0.2.118/LICENSE-APACHE b/wasm-bindgen-0.2.121/LICENSE-APACHE similarity index 100% rename from wasm-bindgen-macro-0.2.118/LICENSE-APACHE rename to wasm-bindgen-0.2.121/LICENSE-APACHE diff --git a/wasm-bindgen-0.2.118/LICENSE-MIT b/wasm-bindgen-0.2.121/LICENSE-MIT similarity index 100% rename from wasm-bindgen-0.2.118/LICENSE-MIT rename to wasm-bindgen-0.2.121/LICENSE-MIT diff --git a/wasm-bindgen-0.2.118/README.md b/wasm-bindgen-0.2.121/README.md similarity index 99% rename from wasm-bindgen-0.2.118/README.md rename to wasm-bindgen-0.2.121/README.md index b800096fed..9f0a9e5455 100644 --- a/wasm-bindgen-0.2.118/README.md +++ b/wasm-bindgen-0.2.121/README.md @@ -116,7 +116,7 @@ The project aims to maintain a 2-year MSRV policy for libraries (meaning we supp | Version | Library MSRV | CLI MSRV | Date | |---------|--------------|----------|------------| -| 0.2.117 | 1.77 | 1.86 | 2026-04-10 | +| 0.2.118 | 1.77 | 1.86 | 2026-04-10 | | 0.2.106 | 1.71 | 1.82 | 2025-11-27 | | 0.2.103 | 1.57 | 1.82 | 2025-09-17 | | 0.2.93 | 1.57 | 1.76 | 2024-08-13 | diff --git a/wasm-bindgen-0.2.118/build.rs b/wasm-bindgen-0.2.121/build.rs similarity index 96% rename from wasm-bindgen-0.2.118/build.rs rename to wasm-bindgen-0.2.121/build.rs index 833823e7af..c0d4a31076 100644 --- a/wasm-bindgen-0.2.118/build.rs +++ b/wasm-bindgen-0.2.121/build.rs @@ -34,7 +34,7 @@ fn main() { println!("cargo:rustc-check-cfg=cfg(wbg_reference_types)"); if target_features.contains(&"reference-types") - || (target_arch == "wasm32" + || ((target_arch == "wasm32" || target_arch == "wasm64") && target_os == "unknown" && rustversion::cfg!(all(since(1.82), before(1.84)))) { diff --git a/wasm-bindgen-0.2.118/src/cache/intern.rs b/wasm-bindgen-0.2.121/src/cache/intern.rs similarity index 100% rename from wasm-bindgen-0.2.118/src/cache/intern.rs rename to wasm-bindgen-0.2.121/src/cache/intern.rs diff --git a/wasm-bindgen-0.2.118/src/cache/mod.rs b/wasm-bindgen-0.2.121/src/cache/mod.rs similarity index 100% rename from wasm-bindgen-0.2.118/src/cache/mod.rs rename to wasm-bindgen-0.2.121/src/cache/mod.rs diff --git a/wasm-bindgen-0.2.118/src/cast.rs b/wasm-bindgen-0.2.121/src/cast.rs similarity index 100% rename from wasm-bindgen-0.2.118/src/cast.rs rename to wasm-bindgen-0.2.121/src/cast.rs diff --git a/wasm-bindgen-0.2.118/src/closure.rs b/wasm-bindgen-0.2.121/src/closure.rs similarity index 97% rename from wasm-bindgen-0.2.118/src/closure.rs rename to wasm-bindgen-0.2.121/src/closure.rs index fa78824e3f..002eb419a7 100644 --- a/wasm-bindgen-0.2.118/src/closure.rs +++ b/wasm-bindgen-0.2.121/src/closure.rs @@ -51,6 +51,7 @@ use core::mem::{self, ManuallyDrop}; use crate::__rt::marker::ErasableGeneric; use crate::__rt::marker::MaybeUnwindSafe; +use crate::__rt::WasmWord; use crate::describe::*; use crate::JsValue; use crate::{convert::*, JsCast}; @@ -59,6 +60,11 @@ use core::panic::AssertUnwindSafe; #[wasm_bindgen_macro::wasm_bindgen(wasm_bindgen = crate)] extern "C" { + // `no_into_js_generic` is required because closures are deliberately + // not `Clone`: duplicating the Rust wrapper over a JS callback would + // break the "owned once" destruction semantics the type is designed + // to enforce. + #[wasm_bindgen(no_into_js_generic)] type JsClosure; #[wasm_bindgen(method)] @@ -450,10 +456,10 @@ where F: IntoWasmClosureRef + ?Sized, { let t: &T = t.unsize_closure_ref(); - let (ptr, len): (u32, u32) = unsafe { mem::transmute_copy(&t) }; + let (ptr, len): (usize, usize) = unsafe { mem::transmute_copy(&t) }; ScopedClosure { js: crate::__rt::wbg_cast(BorrowedClosure:: { - data: WasmSlice { ptr, len }, + data: WasmSlice::from_usize(ptr, len), _marker: PhantomData, }), _marker: PhantomData, @@ -529,10 +535,10 @@ where F: IntoWasmClosureRefMut + ?Sized, { let t: &mut T = t.unsize_closure_ref(); - let (ptr, len): (u32, u32) = unsafe { mem::transmute_copy(&t) }; + let (ptr, len): (usize, usize) = unsafe { mem::transmute_copy(&t) }; ScopedClosure { js: crate::__rt::wbg_cast(BorrowedClosure:: { - data: WasmSlice { ptr, len }, + data: WasmSlice::from_usize(ptr, len), _marker: PhantomData, }), _marker: PhantomData, @@ -746,8 +752,8 @@ struct BorrowedClosure { /// `Box` closure, or `a` must be zero (in which case this /// is a no-op). #[no_mangle] -pub unsafe extern "C" fn __wbindgen_destroy_closure(a: usize, b: usize) { - if a == 0 { +pub unsafe extern "C" fn __wbindgen_destroy_closure(a: WasmWord, b: WasmWord) { + if a.is_zero() { return; } @@ -759,7 +765,7 @@ pub unsafe extern "C" fn __wbindgen_destroy_closure(a: usize, b: usize) { trait ErasedPlaceholderForDrop {} drop(mem::transmute_copy::<_, Box>( - &(a, b), + &(a.into_usize(), b.into_usize()), )); } @@ -797,10 +803,7 @@ where fn into_abi(self) -> WasmSlice { let (a, b): (usize, usize) = unsafe { mem::transmute_copy(&ManuallyDrop::new(self)) }; - WasmSlice { - ptr: a as u32, - len: b as u32, - } + WasmSlice::from_usize(a, b) } } diff --git a/wasm-bindgen-0.2.118/src/convert/closures.rs b/wasm-bindgen-0.2.121/src/convert/closures.rs similarity index 98% rename from wasm-bindgen-0.2.118/src/convert/closures.rs rename to wasm-bindgen-0.2.121/src/convert/closures.rs index d63f60d3a5..07fb4349e4 100644 --- a/wasm-bindgen-0.2.118/src/convert/closures.rs +++ b/wasm-bindgen-0.2.121/src/convert/closures.rs @@ -4,6 +4,7 @@ use core::panic::AssertUnwindSafe; use crate::__rt::marker::ErasableGeneric; use crate::__rt::maybe_catch_unwind; +use crate::__rt::WasmWord; use crate::closure::{ Closure, IntoWasmClosure, IntoWasmClosureRef, IntoWasmClosureRefMut, ScopedClosure, WasmClosure, WasmClosureFnOnce, WasmClosureFnOnceAbort, @@ -59,7 +60,7 @@ macro_rules! closures { fn into_abi(self) -> WasmSlice { unsafe { let (a, b): (usize, usize) = mem::transmute(self); - WasmSlice { ptr: a as u32, len: b as u32 } + WasmSlice::from_usize(a, b) } } } @@ -78,8 +79,8 @@ macro_rules! closures { // `UNWIND_SAFE` has no effect — panics always abort. #[allow(non_snake_case)] unsafe extern "C-unwind" fn invoke<$($var: $FromWasmAbi,)* R: ReturnWasmAbi, const UNWIND_SAFE: bool>( - a: usize, - b: usize, + a: WasmWord, + b: WasmWord, $( $arg1: <$var::Abi as WasmAbi>::Prim1, $arg2: <$var::Abi as WasmAbi>::Prim2, @@ -87,11 +88,12 @@ macro_rules! closures { $arg4: <$var::Abi as WasmAbi>::Prim4, )* ) -> WasmRet { - if a == 0 { + if a.is_zero() { throw_str("closure invoked recursively or after being dropped"); } let ret = { - let f: & $($mut)? dyn $Fn $FnArgs -> R = mem::transmute((a, b)); + let f: & $($mut)? dyn $Fn $FnArgs -> R = + mem::transmute((a.into_usize(), b.into_usize())); $( let $var = $var::Abi::join($arg1, $arg2, $arg3, $arg4); )* diff --git a/wasm-bindgen-0.2.118/src/convert/impls.rs b/wasm-bindgen-0.2.121/src/convert/impls.rs similarity index 89% rename from wasm-bindgen-0.2.118/src/convert/impls.rs rename to wasm-bindgen-0.2.121/src/convert/impls.rs index 194896666b..5b1ff0f151 100644 --- a/wasm-bindgen-0.2.118/src/convert/impls.rs +++ b/wasm-bindgen-0.2.121/src/convert/impls.rs @@ -5,6 +5,7 @@ use core::mem::{self, ManuallyDrop}; use core::ptr::NonNull; use crate::__rt::marker::ErasableGeneric; +use crate::__rt::{WasmSignedWordRepr, WasmWordRepr}; use crate::convert::traits::{WasmAbi, WasmPrimitive}; use crate::convert::{ FromWasmAbi, IntoWasmAbi, LongRefFromWasmAbi, OptionFromWasmAbi, OptionIntoWasmAbi, @@ -155,14 +156,16 @@ impl UpcastFrom for JsOption {} impl UpcastFrom for i128 {} impl UpcastFrom for JsOption {} -/// The sentinel value is 2^32 + 1 for 32-bit primitive types. +/// Sentinel value used to encode `None` for optional pointer-sized and +/// 32-bit numeric values transferred over the JS `number` ABI. /// -/// 2^32 + 1 is used, because it's the smallest positive integer that cannot be -/// represented by any 32-bit primitive. While any value >= 2^32 works as a -/// sentinel value for 32-bit integers, it's a bit more tricky for `f32`. `f32` -/// can represent all powers of 2 up to 2^127 exactly. And between 2^32 and 2^33, -/// `f32` can represent all integers 2^32+512*k exactly. -const F64_ABI_OPTION_SENTINEL: f64 = 4294967297_f64; +/// `2^53 - 1` (`Number.MAX_SAFE_INTEGER`) is chosen because it is: +/// - exactly representable as an `f64` (so JS round-trips it losslessly), +/// - outside the range of any valid `i32`/`u32`/`f32` value (so it can't +/// collide with a real `Some(...)` payload from those types), and +/// - far above any plausible wasm64 pointer (which is bounded by the +/// memory-64 address space limit, well below `2^53`). +const F64_ABI_OPTION_SENTINEL: f64 = 9007199254740991_f64; macro_rules! type_wasm_native_f64_option { ($($t:tt as $c:tt)*) => ($( @@ -218,10 +221,10 @@ macro_rules! type_wasm_native_f64_option { type_wasm_native_f64_option!( i32 as i32 - isize as i32 u32 as u32 - usize as u32 f32 as f32 + isize as WasmSignedWordRepr + usize as WasmWordRepr ); #[cfg(target_pointer_width = "32")] @@ -431,20 +434,20 @@ impl UpcastFrom for JsOption {} impl UpcastFrom for char {} impl IntoWasmAbi for *const T { - type Abi = u32; + type Abi = WasmWordRepr; #[inline] - fn into_abi(self) -> u32 { - self as u32 + fn into_abi(self) -> Self::Abi { + self as usize as WasmWordRepr } } impl FromWasmAbi for *const T { - type Abi = u32; + type Abi = WasmWordRepr; #[inline] - unsafe fn from_abi(js: u32) -> *const T { - js as *const T + unsafe fn from_abi(js: Self::Abi) -> *const T { + js as usize as *const T } } @@ -459,8 +462,8 @@ impl IntoWasmAbi for Option<*const T> { type Abi = f64; #[inline] - fn into_abi(self) -> f64 { - self.map(|ptr| ptr as u32 as f64) + fn into_abi(self) -> Self::Abi { + self.map(|ptr| ptr as usize as f64) .unwrap_or(F64_ABI_OPTION_SENTINEL) } } @@ -476,30 +479,30 @@ impl FromWasmAbi for Option<*const T> { type Abi = f64; #[inline] - unsafe fn from_abi(js: f64) -> Option<*const T> { + unsafe fn from_abi(js: Self::Abi) -> Option<*const T> { if js == F64_ABI_OPTION_SENTINEL { None } else { - Some(js as u32 as *const T) + Some(js as usize as *const T) } } } impl IntoWasmAbi for *mut T { - type Abi = u32; + type Abi = WasmWordRepr; #[inline] - fn into_abi(self) -> u32 { - self as u32 + fn into_abi(self) -> Self::Abi { + self as usize as WasmWordRepr } } impl FromWasmAbi for *mut T { - type Abi = u32; + type Abi = WasmWordRepr; #[inline] - unsafe fn from_abi(js: u32) -> *mut T { - js as *mut T + unsafe fn from_abi(js: Self::Abi) -> *mut T { + js as usize as *mut T } } @@ -507,8 +510,8 @@ impl IntoWasmAbi for Option<*mut T> { type Abi = f64; #[inline] - fn into_abi(self) -> f64 { - self.map(|ptr| ptr as u32 as f64) + fn into_abi(self) -> Self::Abi { + self.map(|ptr| ptr as usize as f64) .unwrap_or(F64_ABI_OPTION_SENTINEL) } } @@ -517,45 +520,45 @@ impl FromWasmAbi for Option<*mut T> { type Abi = f64; #[inline] - unsafe fn from_abi(js: f64) -> Option<*mut T> { + unsafe fn from_abi(js: Self::Abi) -> Option<*mut T> { if js == F64_ABI_OPTION_SENTINEL { None } else { - Some(js as u32 as *mut T) + Some(js as usize as *mut T) } } } impl IntoWasmAbi for NonNull { - type Abi = u32; + type Abi = WasmWordRepr; #[inline] - fn into_abi(self) -> u32 { - self.as_ptr() as u32 + fn into_abi(self) -> Self::Abi { + self.as_ptr() as usize as WasmWordRepr } } impl OptionIntoWasmAbi for NonNull { #[inline] - fn none() -> u32 { - 0 + fn none() -> Self::Abi { + 0 as WasmWordRepr } } impl FromWasmAbi for NonNull { - type Abi = u32; + type Abi = WasmWordRepr; #[inline] unsafe fn from_abi(js: Self::Abi) -> Self { // SAFETY: Checked in bindings. - NonNull::new_unchecked(js as *mut T) + NonNull::new_unchecked(js as usize as *mut T) } } impl OptionFromWasmAbi for NonNull { #[inline] - fn is_none(js: &u32) -> bool { - *js == 0 + fn is_none(js: &Self::Abi) -> bool { + *js == 0 as WasmWordRepr } } @@ -788,6 +791,18 @@ impl IntoWasmAbi for JsError { } } +// `JsError` is `#[repr(transparent)]` over `JsValue` +impl FromWasmAbi for JsError { + type Abi = ::Abi; + + #[inline] + unsafe fn from_abi(js: Self::Abi) -> Self { + JsError { + value: JsValue::from_abi(js), + } + } +} + impl Promising for JsError { type Resolution = JsError; } diff --git a/wasm-bindgen-0.2.118/src/convert/mod.rs b/wasm-bindgen-0.2.121/src/convert/mod.rs similarity index 82% rename from wasm-bindgen-0.2.118/src/convert/mod.rs rename to wasm-bindgen-0.2.121/src/convert/mod.rs index 02fa3d3170..1ad4d4e885 100644 --- a/wasm-bindgen-0.2.118/src/convert/mod.rs +++ b/wasm-bindgen-0.2.121/src/convert/mod.rs @@ -11,5 +11,5 @@ mod slices; mod traits; pub use self::impls::*; -pub use self::slices::WasmSlice; +pub use self::slices::{VectorRefIntoWasmAbi, WasmSlice}; pub use self::traits::*; diff --git a/wasm-bindgen-0.2.118/src/convert/slices.rs b/wasm-bindgen-0.2.121/src/convert/slices.rs similarity index 71% rename from wasm-bindgen-0.2.118/src/convert/slices.rs rename to wasm-bindgen-0.2.121/src/convert/slices.rs index e9ff006bcd..3926ef6c83 100644 --- a/wasm-bindgen-0.2.118/src/convert/slices.rs +++ b/wasm-bindgen-0.2.121/src/convert/slices.rs @@ -5,7 +5,7 @@ use core::mem::{self, MaybeUninit}; use core::ops::{Deref, DerefMut}; use core::str; -use crate::__rt::marker::ErasableGeneric; +use crate::__rt::{marker::ErasableGeneric, WasmWord}; use crate::__wbindgen_copy_to_typed_array; use crate::convert::{ js_value_vector_from_abi, js_value_vector_into_abi, FromWasmAbi, IntoWasmAbi, @@ -28,32 +28,45 @@ use cfg_if::cfg_if; #[repr(C)] #[derive(Clone, Copy)] pub struct WasmSlice { - pub ptr: u32, - pub len: u32, + pub ptr: WasmWord, + pub len: WasmWord, +} + +impl WasmSlice { + #[inline] + pub fn from_usize(ptr: usize, len: usize) -> Self { + Self { + ptr: WasmWord::from_usize(ptr), + len: WasmWord::from_usize(len), + } + } } impl WasmAbi for WasmSlice { /// `self.ptr` - type Prim1 = u32; + type Prim1 = ::Prim1; /// `self.len` - type Prim2 = u32; + type Prim2 = ::Prim1; type Prim3 = (); type Prim4 = (); #[inline] - fn split(self) -> (u32, u32, (), ()) { - (self.ptr, self.len, (), ()) + fn split(self) -> (Self::Prim1, Self::Prim2, (), ()) { + (self.ptr.split().0, self.len.split().0, (), ()) } #[inline] - fn join(ptr: u32, len: u32, _: (), _: ()) -> Self { - Self { ptr, len } + fn join(ptr: Self::Prim1, len: Self::Prim2, _: (), _: ()) -> Self { + Self { + ptr: WasmWord::join(ptr, (), (), ()), + len: WasmWord::join(len, (), (), ()), + } } } #[inline] fn null_slice() -> WasmSlice { - WasmSlice { ptr: 0, len: 0 } + WasmSlice::from_usize(0, 0) } pub struct WasmMutSlice { @@ -63,22 +76,23 @@ pub struct WasmMutSlice { impl WasmAbi for WasmMutSlice { /// `self.slice.ptr` - type Prim1 = u32; + type Prim1 = ::Prim1; /// `self.slice.len` - type Prim2 = u32; + type Prim2 = ::Prim2; /// `self.idx` type Prim3 = u32; type Prim4 = (); #[inline] - fn split(self) -> (u32, u32, u32, ()) { - (self.slice.ptr, self.slice.len, self.idx, ()) + fn split(self) -> (Self::Prim1, Self::Prim2, u32, ()) { + let (ptr, len, (), ()) = self.slice.split(); + (ptr, len, self.idx, ()) } #[inline] - fn join(ptr: u32, len: u32, idx: u32, _: ()) -> Self { + fn join(ptr: Self::Prim1, len: Self::Prim2, idx: u32, _: ()) -> Self { Self { - slice: WasmSlice { ptr, len }, + slice: WasmSlice::join(ptr, len, (), ()), idx, } } @@ -143,10 +157,7 @@ macro_rules! vectors_internal { let ptr = vector.as_ptr(); let len = vector.len(); mem::forget(vector); - WasmSlice { - ptr: ptr.into_abi(), - len: len as u32, - } + WasmSlice::from_usize(ptr as usize, len) } } @@ -155,8 +166,8 @@ macro_rules! vectors_internal { #[inline] unsafe fn vector_from_abi(js: WasmSlice) -> Box<[$t]> { - let ptr = <*mut $t>::from_abi(js.ptr); - let len = js.len as usize; + let ptr = js.ptr.into_usize() as *mut $t; + let len = js.len.into_usize(); Vec::from_raw_parts(ptr, len, len).into_boxed_slice() } } @@ -166,10 +177,7 @@ macro_rules! vectors_internal { #[inline] fn into_abi(self) -> WasmSlice { - WasmSlice { - ptr: self.as_ptr().into_abi(), - len: self.len() as u32, - } + WasmSlice::from_usize(self.as_ptr() as usize, self.len()) } } @@ -271,7 +279,7 @@ cfg_if! { #[inline] fn unsafe_get_cached_str(x: &str) -> Option { // This uses 0 for the ptr as an indication that it is a JsValue and not a str. - crate::cache::intern::unsafe_get_str(x).map(|x| WasmSlice { ptr: 0, len: x }) + crate::cache::intern::unsafe_get_str(x).map(|x| WasmSlice::from_usize(0, x as usize)) } } else { @@ -304,6 +312,80 @@ where } } +/// Internal trait used by the `slice_to_array` macro codegen. +/// +/// Produces the wire representation JS observes when an outgoing `&[T]` +/// argument is rendered as a plain `Array`. There are two impl shapes, +/// neither of which requires `T: Clone`: +/// +/// * For primitive numeric `T` (`u8`, `i32`, `f64`, ...) the wire is a +/// borrow of the slice memory directly — no allocation, no copy. The +/// JS-side shim performs `Array.from(typedArrayView)` to materialise +/// the JS `Array` and never frees the buffer. +/// * For everything else (`String`, `JsValue`, imported types, exported +/// types) the wire is a freshly allocated `Box<[u32]>` of externref +/// indices — one per element, constructed via `&T -> JsValue` (which +/// for handle-shaped types is a refcount bump on the existing JS +/// slot, and for `String` / value-shaped types creates a fresh JS +/// value). The JS-side shim reads the indices into a JS `Array` and +/// frees the index buffer. +/// +/// Both shapes carry the same `WasmSlice` (ptr + len) on the wire. The +/// cli-support side picks the right JS shim based on the element +/// `VectorKind` recovered from the descriptor. +/// +/// Not user-facing: users opt in via `#[wasm_bindgen(slice_to_array)]` +/// on an imported function or `extern "C"` block. +pub trait VectorRefIntoWasmAbi { + /// Construct the wire representation for `Some(slice)`. The returned + /// `WasmSlice` is either a borrow of the input slice (primitive + /// case) or a buffer JS owns and frees (handle-shaped case). + fn slice_into_abi(slice: &[Self]) -> WasmSlice + where + Self: Sized; + + /// Wire representation for `None` (used by `Option<&[T]>`). A null + /// `WasmSlice` (`ptr == 0`) is the convention shared with every + /// other vector-like ABI in the crate. + #[inline] + fn slice_none() -> WasmSlice + where + Self: Sized, + { + null_slice() + } +} + +macro_rules! vector_ref_into_wasm_abi_primitive { + ($($t:ty)*) => ($( + impl VectorRefIntoWasmAbi for $t { + #[inline] + fn slice_into_abi(slice: &[Self]) -> WasmSlice { + // Borrow of the slice memory; the JS shim does + // `Array.from(view)` and never frees. + WasmSlice::from_usize(slice.as_ptr() as usize, slice.len()) + } + } + )*); +} + +vector_ref_into_wasm_abi_primitive!(u8 i8 u16 i16 u32 i32 u64 i64 usize isize f32 f64); + +impl VectorRefIntoWasmAbi for T +where + for<'a> &'a T: Into, +{ + #[inline] + fn slice_into_abi(slice: &[Self]) -> WasmSlice { + // Build a fresh `[JsValue]` buffer one element at a time. The + // existing `Vec` ABI hands off the buffer to JS; the + // JS shim drops each externref slot it reads and frees the + // buffer. + let js_vals: Box<[JsValue]> = slice.iter().map(Into::into).collect(); + js_vals.into_abi() + } +} + impl FromWasmAbi for Vec where Box<[T]>: FromWasmAbi, @@ -322,7 +404,7 @@ where { #[inline] fn is_none(abi: &WasmSlice) -> bool { - abi.ptr == 0 + abi.ptr.is_zero() } } @@ -356,7 +438,7 @@ impl FromWasmAbi for String { impl OptionFromWasmAbi for String { #[inline] fn is_none(slice: &WasmSlice) -> bool { - slice.ptr == 0 + slice.ptr.is_zero() } } @@ -446,7 +528,7 @@ where Self: FromWasmAbi, { fn is_none(slice: &WasmSlice) -> bool { - slice.ptr == 0 + slice.ptr.is_zero() } } @@ -455,8 +537,8 @@ impl + WasmDescribe> VectorFromWasmAbi for T #[inline] unsafe fn vector_from_abi(js: WasmSlice) -> Box<[Self]> { - let ptr = <*mut T>::from_abi(js.ptr); - let len = js.len as usize; + let ptr = js.ptr.into_usize() as *mut T; + let len = js.len.into_usize(); Vec::from_raw_parts(ptr, len, len).into_boxed_slice() } } @@ -469,10 +551,7 @@ impl + WasmDescribe> VectorIntoWasmAbi for T let ptr = vector.as_ptr(); let len = vector.len(); mem::forget(vector); - WasmSlice { - ptr: ptr.into_abi(), - len: len as u32, - } + WasmSlice::from_usize(ptr as usize, len) } } @@ -490,10 +569,7 @@ impl + WasmDescribe> IntoWasmAbi for &[T] { #[inline] fn into_abi(self) -> WasmSlice { - WasmSlice { - ptr: self.as_ptr() as u32, - len: self.len() as u32, - } + WasmSlice::from_usize(self.as_ptr() as usize, self.len()) } } diff --git a/wasm-bindgen-0.2.118/src/convert/traits.rs b/wasm-bindgen-0.2.121/src/convert/traits.rs similarity index 89% rename from wasm-bindgen-0.2.118/src/convert/traits.rs rename to wasm-bindgen-0.2.121/src/convert/traits.rs index ff15744aa6..64a7a9c48f 100644 --- a/wasm-bindgen-0.2.118/src/convert/traits.rs +++ b/wasm-bindgen-0.2.121/src/convert/traits.rs @@ -543,3 +543,66 @@ impl + UpcastFrom + Upcast + JsCa JsGeneric for T { } + +/// Value conversion from a type into its canonical [`JsGeneric`] form. +/// +/// This trait allows types to be converted into JsGeneric supported types, which +/// are required to be erasably generic with JsValue. +/// +/// The single associated type — rather than a free type parameter bounded by +/// `AsRef` — is what makes collection-style APIs infer annotation-free. +/// Given an input `A`, there is exactly one `A::JsCanon`, so rustc never has +/// to search across multiple `AsRef` impls to pick a target element type. +/// +/// # Implementations +/// +/// Provided impls: +/// - [`JsValue`] in this crate. +/// - Every `#[wasm_bindgen]`-imported type (identity — emitted by the macro). +/// - Every generic `js_sys` container (`Array`, `Promise`, `Set`, …) +/// provides its own identity impl owned by `js_sys`. +/// - References to cloneable implementors, so borrowed iteration can still +/// produce owned JS-generic values. +/// +/// This trait is deliberately *not* blanket-implemented over all [`JsGeneric`] +/// types: each implementor explicitly opts in, which leaves room for future +/// wrapper types to pick a non-identity [`Self::JsCanon`]. +/// +/// # Example +/// +/// ```ignore +/// use js_sys::{Array, Number}; +/// +/// let arr: Array = (0..10).map(Number::from).collect(); +/// ``` +pub trait IntoJsGeneric { + /// The canonical [`JsGeneric`] form of this type. + type JsCanon: JsGeneric; + + /// Produce the canonical [`JsGeneric`] value for `self`. + fn to_js(self) -> Self::JsCanon; +} + +impl IntoJsGeneric for JsValue { + type JsCanon = JsValue; + #[inline] + fn to_js(self) -> JsValue { + self + } +} + +// Reference iteration clones the borrowed wrapper to produce an owned value, +// then delegates to that type's canonical conversion. +impl IntoJsGeneric for &T { + type JsCanon = T::JsCanon; + #[inline] + fn to_js(self) -> T::JsCanon { + self.clone().to_js() + } +} + +// Intentionally not a blanket `impl IntoJsGeneric for T`: +// that would lock in identity for every current and future `JsGeneric` type +// and prevent wrapper types from canonicalising to a different target. +// Instead, implementations are provided explicitly by each owning crate +// (macro-generated for user types; hand-written for `js_sys` containers). diff --git a/wasm-bindgen-0.2.118/src/describe.rs b/wasm-bindgen-0.2.121/src/describe.rs similarity index 90% rename from wasm-bindgen-0.2.118/src/describe.rs rename to wasm-bindgen-0.2.121/src/describe.rs index c2ddbcd86d..48e7cbf390 100644 --- a/wasm-bindgen-0.2.118/src/describe.rs +++ b/wasm-bindgen-0.2.121/src/describe.rs @@ -9,7 +9,7 @@ use alloc::vec::Vec; use core::panic::AssertUnwindSafe; use core::{mem::MaybeUninit, ptr::NonNull}; -use crate::{Clamped, JsError, JsValue, __rt::marker::ErasableGeneric}; +use crate::{__rt::marker::ErasableGeneric, Clamped, JsError, JsValue}; use cfg_if::cfg_if; pub use wasm_bindgen_shared::tys::*; @@ -50,8 +50,6 @@ simple! { u64 => U64 i128 => I128 u128 => U128 - isize => I32 - usize => U32 f32 => F32 f64 => F64 bool => BOOLEAN @@ -59,6 +57,21 @@ simple! { JsValue => EXTERNREF } +// isize/usize map to I32/U32 on wasm32 and direct *_AS_F64 descriptors on wasm64 +cfg_if! { + if #[cfg(target_arch = "wasm64")] { + simple! { + isize => I64_AS_F64 + usize => U64_AS_F64 + } + } else { + simple! { + isize => I32 + usize => U32 + } + } +} + cfg_if! { if #[cfg(feature = "enable-interning")] { simple! { @@ -75,14 +88,14 @@ cfg_if! { impl WasmDescribe for *const T { #[cfg_attr(wasm_bindgen_unstable_test_coverage, coverage(off))] fn describe() { - inform(U32) + inform(RAW_POINTER) } } impl WasmDescribe for *mut T { #[cfg_attr(wasm_bindgen_unstable_test_coverage, coverage(off))] fn describe() { - inform(U32) + inform(RAW_POINTER) } } diff --git a/wasm-bindgen-0.2.118/src/externref.rs b/wasm-bindgen-0.2.121/src/externref.rs similarity index 79% rename from wasm-bindgen-0.2.118/src/externref.rs rename to wasm-bindgen-0.2.121/src/externref.rs index e7cdee0130..4ee26fb7d8 100644 --- a/wasm-bindgen-0.2.118/src/externref.rs +++ b/wasm-bindgen-0.2.121/src/externref.rs @@ -1,5 +1,6 @@ -use crate::JsValue; use crate::__rt; +use crate::__rt::{WasmPtr, WasmWord}; +use crate::JsValue; use alloc::slice; use alloc::vec::Vec; @@ -9,8 +10,10 @@ use core::cmp::max; externs! { #[link(wasm_import_module = "__wbindgen_externref_xform__")] extern "C" { - fn __wbindgen_externref_table_grow(delta: usize) -> i32; - fn __wbindgen_externref_table_set_null(idx: usize) -> (); + // These intrinsics are replaced by the CLI with table.grow/table.set + // instructions, which always use i32 indices, even on wasm64. + fn __wbindgen_externref_table_grow(delta: i32) -> i32; + fn __wbindgen_externref_table_set_null(idx: u32) -> (); } } @@ -35,7 +38,7 @@ impl Slab { let curr_len = self.data.len(); if curr_len == self.data.capacity() { let extra = max(128, curr_len); - let r = unsafe { __wbindgen_externref_table_grow(extra) }; + let r = unsafe { __wbindgen_externref_table_grow(extra as i32) }; if r == -1 { internal_error("table grow failure") } @@ -105,8 +108,12 @@ fn internal_error(_msg: &str) -> ! { super::throw_str(_msg) } else if #[cfg(feature = "std")] { std::process::abort(); - } else if #[cfg(target_family = "wasm")] { + } else if #[cfg(target_arch = "wasm32")] { + // stable core::arch::wasm32::unreachable(); + } else if #[cfg(target_arch = "wasm64")] { + // unstable, need simd_wasm64 feature + core::arch::wasm64::unreachable(); } else { unreachable!() } @@ -120,27 +127,31 @@ static HEAP_SLAB: __rt::ThreadLocalWrapper> = __rt::ThreadLocalWrapper(RefCell::new(Slab::new())); #[no_mangle] -pub extern "C" fn __externref_table_alloc() -> usize { - HEAP_SLAB.0.borrow_mut().alloc() +pub extern "C" fn __externref_table_alloc() -> u32 { + // Table indices are always 32-bit, even on wasm64. + HEAP_SLAB.0.borrow_mut().alloc() as u32 } #[no_mangle] -pub extern "C" fn __externref_table_dealloc(idx: usize) { +pub extern "C" fn __externref_table_dealloc(idx: u32) { + let idx = idx as usize; if idx < __rt::JSIDX_RESERVED as usize { return; } // clear this value from the table so while the table slot is un-allocated // we don't keep around a strong reference to a potentially large object unsafe { - __wbindgen_externref_table_set_null(idx); + __wbindgen_externref_table_set_null(idx as u32); } HEAP_SLAB.0.borrow_mut().dealloc(idx) } #[no_mangle] -pub unsafe extern "C" fn __externref_drop_slice(ptr: *mut JsValue, len: usize) { +pub unsafe extern "C" fn __externref_drop_slice(ptr: WasmPtr, len: WasmWord) { + let ptr = ptr.into_ptr(); + let len = len.into_usize(); for slot in slice::from_raw_parts_mut(ptr, len) { - __externref_table_dealloc(slot.idx as usize); + __externref_table_dealloc(slot.idx); } } diff --git a/wasm-bindgen-0.2.118/src/handler.rs b/wasm-bindgen-0.2.121/src/handler.rs similarity index 100% rename from wasm-bindgen-0.2.118/src/handler.rs rename to wasm-bindgen-0.2.121/src/handler.rs diff --git a/wasm-bindgen-0.2.118/src/lib.rs b/wasm-bindgen-0.2.121/src/lib.rs similarity index 98% rename from wasm-bindgen-0.2.118/src/lib.rs rename to wasm-bindgen-0.2.121/src/lib.rs index b5d9bc8555..5f712a9507 100644 --- a/wasm-bindgen-0.2.118/src/lib.rs +++ b/wasm-bindgen-0.2.121/src/lib.rs @@ -46,6 +46,10 @@ feature(allow_internal_unstable), allow(internal_features) )] +#![cfg_attr( + all(not(debug_assertions), not(feature = "std"), target_arch = "wasm64"), + feature(simd_wasm64) +)] #![doc(html_root_url = "https://docs.rs/wasm-bindgen/0.2")] extern crate alloc; @@ -136,7 +140,7 @@ mod externref; use externref::__wbindgen_externref_heap_live_count; pub use crate::__rt::marker::ErasableGeneric; -pub use crate::convert::JsGeneric; +pub use crate::convert::{IntoJsGeneric, JsGeneric}; #[doc(hidden)] pub mod handler; @@ -144,6 +148,9 @@ pub mod handler; mod cast; pub use crate::cast::JsCast; +mod parent; +pub use crate::parent::Parent; + mod cache; pub use cache::intern::{intern, unintern}; @@ -1139,34 +1146,33 @@ impl TryFromJsValue for Option { } } -// `usize` and `isize` have to be treated a bit specially, because we know that -// they're 32-bit but the compiler conservatively assumes they might be bigger. -// So, we have to manually forward to the `u32`/`i32` versions. +// `usize` and `isize` use the public pointer-sized JS number ABI, which is +// `u32`/`i32` on wasm32 and `f64` on wasm64. impl PartialEq for JsValue { #[inline] fn eq(&self, other: &usize) -> bool { - *self == (*other as u32) + *self == (*other as crate::__rt::WasmWordRepr) } } impl From for JsValue { #[inline] fn from(n: usize) -> Self { - Self::from(n as u32) + Self::from(n as crate::__rt::WasmWordRepr) } } impl PartialEq for JsValue { #[inline] fn eq(&self, other: &isize) -> bool { - *self == (*other as i32) + *self == (*other as crate::__rt::WasmSignedWordRepr) } } impl From for JsValue { #[inline] fn from(n: isize) -> Self { - Self::from(n as i32) + Self::from(n as crate::__rt::WasmSignedWordRepr) } } @@ -1272,6 +1278,7 @@ extern "C" { fn __wbindgen_exports() -> JsValue; fn __wbindgen_memory() -> JsValue; fn __wbindgen_module() -> JsValue; + fn __wbindgen_instance() -> JsValue; fn __wbindgen_function_table() -> JsValue; fn __wbindgen_reinit(); @@ -1669,6 +1676,15 @@ pub fn module() -> JsValue { __wbindgen_module() } +/// Returns a handle to this Wasm instance's `WebAssembly.Instance`. +/// This is only available when the final Wasm app is built with +/// `--target no-modules`, `--target web`, `--target deno` or `--target nodejs`. +/// It is unavailable for `--target bundler`. +pub fn instance() -> JsValue { + __wbindgen_instance() +} + +// TODO: deprecate next major /// Returns a handle to this Wasm instance's `WebAssembly.Instance.prototype.exports` pub fn exports() -> JsValue { __wbindgen_exports() @@ -1771,6 +1787,7 @@ impl DerefMut for Clamped { /// /// ``` #[derive(Clone, Debug)] +#[repr(transparent)] pub struct JsError { value: JsValue, } diff --git a/wasm-bindgen-0.2.118/src/link.rs b/wasm-bindgen-0.2.121/src/link.rs similarity index 100% rename from wasm-bindgen-0.2.118/src/link.rs rename to wasm-bindgen-0.2.121/src/link.rs diff --git a/wasm-bindgen-0.2.121/src/parent.rs b/wasm-bindgen-0.2.121/src/parent.rs new file mode 100644 index 0000000000..46275eeced --- /dev/null +++ b/wasm-bindgen-0.2.121/src/parent.rs @@ -0,0 +1,95 @@ +//! `Parent` — storage wrapper that backs the auto-injected `parent` +//! field of an exported Rust type declared with +//! `#[wasm_bindgen(extends = Parent)]`. +//! +//! Each parent method's wasm shim takes a `*const WasmRefCell`, +//! while the child's `__wbg_ptr` points at a `WasmRefCell`. +//! The two pointers can't alias safely, so each JS instance carries a +//! separate `__wbg_ptr_` slot for every class in its inheritance +//! chain, and the parent data lives in its own `Rc>` +//! allocation that the wasm runtime can clone on demand. `Parent` is +//! that storage — a newtype around `Rc>`. +//! +//! Users do **not** declare a `Parent` field themselves. Writing +//! `#[wasm_bindgen(extends = Animal)] struct Dog { ... }` causes the macro +//! to inject `parent: wasm_bindgen::Parent` as the first field of +//! `Dog`; an explicit user-declared `Parent` field on any +//! `#[wasm_bindgen]` struct is rejected at macro time. In the child's +//! constructor the field is populated with `Animal::new(...).into()` (using +//! the [`From`] impl below) or with [`Parent::new`]. From inside method +//! bodies the parent value is reached as `self.parent.borrow()` / +//! `self.parent.borrow_mut()`. + +use crate::__rt::alloc::rc::Rc; +use crate::__rt::{Ref, RefMut, WasmRefCell}; + +/// Storage wrapper for the auto-injected `parent` field on a struct that +/// declares `#[wasm_bindgen(extends = Parent)]`. +/// +/// Under the hood this is an `Rc>` so that wasm-bindgen can +/// produce a separately-refcounted parent pointer for JS-side prototype +/// dispatch. Use [`Parent::borrow`] / [`Parent::borrow_mut`] to access the +/// inner value. You should not need to construct `Parent` directly +/// outside the child's constructor; the [`From`] impl is the typical way +/// to initialize the injected `parent` field. +/// +/// `Clone` is a cheap `Rc` clone — both copies point at the same parent +/// data. `Debug` prints the wrapper plus the inner `T` (when `T: Debug`). +pub struct Parent { + inner: Rc>, +} + +impl Clone for Parent { + fn clone(&self) -> Self { + Self { + inner: Rc::clone(&self.inner), + } + } +} + +impl core::fmt::Debug for Parent { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + f.debug_tuple("Parent") + .field(&*self.inner.borrow()) + .finish() + } +} + +impl Parent { + /// Wraps a value in a new `Parent`. + pub fn new(value: T) -> Self { + Self { + inner: Rc::new(WasmRefCell::new(value)), + } + } + + /// Immutably borrows the wrapped value. + /// + /// Panics (or throws on the wasm target) if the value is currently + /// mutably borrowed. + pub fn borrow(&self) -> Ref<'_, T> { + self.inner.borrow() + } + + /// Mutably borrows the wrapped value. + /// + /// Panics (or throws on the wasm target) if the value is currently + /// borrowed. + pub fn borrow_mut(&self) -> RefMut<'_, T> { + self.inner.borrow_mut() + } + + /// Internal accessor used by the `#[wasm_bindgen(extends = ...)]` + /// codegen to clone the inner `Rc` when producing an ancestor ABI + /// pointer for JS. Not part of the public API. + #[doc(hidden)] + pub fn __wbg_clone_rc(&self) -> Rc> { + Rc::clone(&self.inner) + } +} + +impl From for Parent { + fn from(value: T) -> Self { + Parent::new(value) + } +} diff --git a/wasm-bindgen-0.2.118/src/rt/marker.rs b/wasm-bindgen-0.2.121/src/rt/marker.rs similarity index 97% rename from wasm-bindgen-0.2.118/src/rt/marker.rs rename to wasm-bindgen-0.2.121/src/rt/marker.rs index 4aae65a9d4..96af2a7512 100644 --- a/wasm-bindgen-0.2.118/src/rt/marker.rs +++ b/wasm-bindgen-0.2.121/src/rt/marker.rs @@ -37,16 +37,16 @@ pub struct CheckSupportsInstanceProperty(T); pub trait SupportsStaticProperty {} pub struct CheckSupportsStaticProperty(T); -#[cfg(all(feature = "std", target_arch = "wasm32", panic = "unwind"))] +#[cfg(all(feature = "std", target_family = "wasm", panic = "unwind"))] use core::panic::UnwindSafe; /// Marker trait for types that are UnwindSafe only when building with panic unwind pub trait MaybeUnwindSafe {} -#[cfg(all(feature = "std", target_arch = "wasm32", panic = "unwind"))] +#[cfg(all(feature = "std", target_family = "wasm", panic = "unwind"))] impl MaybeUnwindSafe for T {} -#[cfg(not(all(feature = "std", target_arch = "wasm32", panic = "unwind")))] +#[cfg(not(all(feature = "std", target_family = "wasm", panic = "unwind")))] impl MaybeUnwindSafe for T {} /// Private marker trait for erasable generics - types with this trait have the same diff --git a/wasm-bindgen-0.2.118/src/rt/mod.rs b/wasm-bindgen-0.2.121/src/rt/mod.rs similarity index 83% rename from wasm-bindgen-0.2.118/src/rt/mod.rs rename to wasm-bindgen-0.2.121/src/rt/mod.rs index 6339ab72a3..d09186459d 100644 --- a/wasm-bindgen-0.2.118/src/rt/mod.rs +++ b/wasm-bindgen-0.2.121/src/rt/mod.rs @@ -1,13 +1,14 @@ use crate::convert::{FromWasmAbi, IntoWasmAbi, WasmAbi, WasmRet}; use crate::describe::inform; use crate::JsValue; -#[cfg(all(target_arch = "wasm32", feature = "std", panic = "unwind"))] +#[cfg(all(target_family = "wasm", feature = "std", panic = "unwind"))] use core::any::Any; use core::borrow::{Borrow, BorrowMut}; #[cfg(target_feature = "atomics")] use core::cell::UnsafeCell; use core::cell::{Cell, RefCell}; use core::convert::Infallible; +use core::marker::PhantomData; use core::ops::{Deref, DerefMut}; use core::panic::{RefUnwindSafe, UnwindSafe}; #[cfg(target_feature = "atomics")] @@ -277,6 +278,175 @@ pub fn assert_not_null(s: *mut T) { } } +#[cfg(target_arch = "wasm64")] +pub type WasmWordRepr = f64; +#[cfg(not(target_arch = "wasm64"))] +pub type WasmWordRepr = u32; + +/// Signed counterpart of [`WasmWordRepr`]. Used for `isize` ABI lowering so +/// that negative values sign-extend correctly when widening to `f64`. +#[cfg(target_arch = "wasm64")] +pub type WasmSignedWordRepr = f64; +#[cfg(not(target_arch = "wasm64"))] +pub type WasmSignedWordRepr = i32; + +/// A single pointer-sized machine word using the JS-number ABI on wasm64. +#[repr(transparent)] +#[derive(Copy, Clone, Default)] +pub struct WasmWord(WasmWordRepr); + +impl WasmWord { + #[inline] + pub fn from_usize(value: usize) -> Self { + #[cfg(target_arch = "wasm64")] + { + Self(value as f64) + } + #[cfg(not(target_arch = "wasm64"))] + { + Self(value as u32) + } + } + + #[inline] + pub fn into_usize(self) -> usize { + self.0 as usize + } + + #[inline] + pub fn from_isize(value: isize) -> Self { + #[cfg(target_arch = "wasm64")] + { + Self(value as f64) + } + #[cfg(not(target_arch = "wasm64"))] + { + Self(value as u32) + } + } + + #[inline] + pub fn into_isize(self) -> isize { + self.0 as isize + } + + #[inline] + pub fn is_zero(&self) -> bool { + #[cfg(target_arch = "wasm64")] + { + self.0 == 0.0 + } + #[cfg(not(target_arch = "wasm64"))] + { + self.0 == 0 + } + } +} + +impl WasmAbi for WasmWord { + type Prim1 = WasmWordRepr; + type Prim2 = (); + type Prim3 = (); + type Prim4 = (); + + #[inline] + fn split(self) -> (Self::Prim1, (), (), ()) { + (self.0, (), (), ()) + } + + #[inline] + fn join(prim1: Self::Prim1, _: (), _: (), _: ()) -> Self { + Self(prim1) + } +} + +/// A typed raw pointer using the JS-number ABI on wasm64. +#[repr(transparent)] +#[derive(Copy, Clone)] +pub struct WasmPtr { + word: WasmWord, + _marker: PhantomData<*mut T>, +} + +impl Default for WasmPtr { + #[inline] + fn default() -> Self { + Self::null() + } +} + +impl WasmPtr { + #[inline] + pub fn from_ptr(ptr: *mut T) -> Self { + Self::from_usize(ptr as usize) + } + + #[inline] + pub fn into_ptr(self) -> *mut T { + self.into_usize() as *mut T + } + + #[inline] + pub fn from_usize(value: usize) -> Self { + Self { + word: WasmWord::from_usize(value), + _marker: PhantomData, + } + } + + #[inline] + pub fn into_usize(self) -> usize { + self.word.into_usize() + } + + #[inline] + pub fn null() -> Self { + Self::from_usize(0) + } + + #[inline] + pub fn is_null(&self) -> bool { + self.word.is_zero() + } +} + +impl WasmAbi for WasmPtr { + type Prim1 = ::Prim1; + type Prim2 = (); + type Prim3 = (); + type Prim4 = (); + + #[inline] + fn split(self) -> (Self::Prim1, (), (), ()) { + self.word.split() + } + + #[inline] + fn join(prim1: Self::Prim1, _: (), _: (), _: ()) -> Self { + Self { + word: WasmWord::join(prim1, (), (), ()), + _marker: PhantomData, + } + } +} + +// The wasm64 representation of `WasmWord` is `f64`, which has enough +// mantissa precision to roundtrip any in-range pointer value. On wasm32 +// the representation is `u32`, so this test is only meaningful on wasm64. +#[cfg(all(test, target_arch = "wasm64"))] +mod tests { + use super::WasmWord; + + #[test] + fn wasm_word_roundtrips_large_pointer_values() { + let value = 1usize << 60; + assert_eq!(WasmWord::from_usize(value).into_usize(), value); + + let signed = -(1isize << 40); + assert_eq!(WasmWord::from_isize(signed).into_isize(), signed); + } +} + #[cold] #[inline(never)] fn throw_null() -> ! { @@ -504,16 +674,18 @@ impl BorrowMut for RcRefMut { } #[no_mangle] -pub extern "C" fn __wbindgen_malloc(size: usize, align: usize) -> *mut u8 { +pub extern "C" fn __wbindgen_malloc(size: WasmWord, align: WasmWord) -> WasmPtr { + let size = size.into_usize(); + let align = align.into_usize(); if let Ok(layout) = Layout::from_size_align(size, align) { unsafe { if layout.size() > 0 { let ptr = alloc(layout); if !ptr.is_null() { - return ptr; + return WasmPtr::from_ptr(ptr); } } else { - return align as *mut u8; + return WasmPtr::from_usize(align); } } } @@ -523,17 +695,21 @@ pub extern "C" fn __wbindgen_malloc(size: usize, align: usize) -> *mut u8 { #[no_mangle] pub unsafe extern "C" fn __wbindgen_realloc( - ptr: *mut u8, - old_size: usize, - new_size: usize, - align: usize, -) -> *mut u8 { + ptr: WasmPtr, + old_size: WasmWord, + new_size: WasmWord, + align: WasmWord, +) -> WasmPtr { + let ptr = ptr.into_ptr(); + let old_size = old_size.into_usize(); + let new_size = new_size.into_usize(); + let align = align.into_usize(); debug_assert!(old_size > 0); debug_assert!(new_size > 0); if let Ok(layout) = Layout::from_size_align(old_size, align) { let ptr = realloc(ptr, layout, new_size); if !ptr.is_null() { - return ptr; + return WasmPtr::from_ptr(ptr); } } malloc_failure(); @@ -546,11 +722,12 @@ fn malloc_failure() -> ! { super::throw_str("invalid malloc request") } else if #[cfg(feature = "std")] { std::process::abort(); - } else if #[cfg(all( - target_arch = "wasm32", - any(target_os = "unknown", target_os = "none") - ))] { + } else if #[cfg(target_arch = "wasm32")] { + // stable core::arch::wasm32::unreachable(); + } else if #[cfg(target_arch = "wasm64")] { + // unstable, need simd_wasm64 feature + core::arch::wasm64::unreachable(); } else { unreachable!() } @@ -558,12 +735,15 @@ fn malloc_failure() -> ! { } #[no_mangle] -pub unsafe extern "C" fn __wbindgen_free(ptr: *mut u8, size: usize, align: usize) { +pub unsafe extern "C" fn __wbindgen_free(ptr: WasmPtr, size: WasmWord, align: WasmWord) { + let size = size.into_usize(); // This happens for zero-length slices, and in that case `ptr` is // likely bogus so don't actually send this to the system allocator if size == 0 { return; } + let ptr = ptr.into_ptr(); + let align = align.into_usize(); let layout = Layout::from_size_align_unchecked(size, align); dealloc(ptr, layout); } @@ -818,13 +998,13 @@ pub const fn encode_u32_to_fixed_len_bytes(value: u32) -> [u8; 5] { result } -#[cfg(all(target_arch = "wasm32", feature = "std", panic = "unwind"))] +#[cfg(all(target_family = "wasm", feature = "std", panic = "unwind"))] #[wasm_bindgen_macro::wasm_bindgen(wasm_bindgen = crate, raw_module = "__wbindgen_placeholder__")] extern "C" { fn __wbindgen_panic_error(msg: &JsValue) -> JsValue; } -#[cfg(all(target_arch = "wasm32", feature = "std", panic = "unwind"))] +#[cfg(all(target_family = "wasm", feature = "std", panic = "unwind"))] pub fn panic_to_panic_error(val: std::boxed::Box) -> JsValue { #[cfg(not(target_feature = "atomics"))] { @@ -845,7 +1025,7 @@ pub fn panic_to_panic_error(val: std::boxed::Box) -> JsValue { err } -#[cfg(all(target_arch = "wasm32", feature = "std", panic = "unwind"))] +#[cfg(all(target_family = "wasm", feature = "std", panic = "unwind"))] pub fn maybe_catch_unwind R + std::panic::UnwindSafe, R>(f: F) -> R { let result = std::panic::catch_unwind(f); match result { @@ -856,7 +1036,7 @@ pub fn maybe_catch_unwind R + std::panic::UnwindSafe, R>(f: F) -> } } -#[cfg(not(all(target_arch = "wasm32", feature = "std", panic = "unwind")))] +#[cfg(not(all(target_family = "wasm", feature = "std", panic = "unwind")))] pub fn maybe_catch_unwind R, R>(f: F) -> R { f() } diff --git a/wasm-bindgen-0.2.118/src/sys.rs b/wasm-bindgen-0.2.121/src/sys.rs similarity index 99% rename from wasm-bindgen-0.2.118/src/sys.rs rename to wasm-bindgen-0.2.121/src/sys.rs index fd617e55e3..0f8e1598d2 100644 --- a/wasm-bindgen-0.2.118/src/sys.rs +++ b/wasm-bindgen-0.2.121/src/sys.rs @@ -2,7 +2,6 @@ //! //! These types represent fundamental JavaScript values and are designed to be //! used as generic type parameters in typed JavaScript collections and APIs. - use crate::convert::UpcastFrom; use crate::JsCast; use crate::JsGeneric; diff --git a/wasm-bindgen-macro-0.2.118/.cargo-checksum.json b/wasm-bindgen-macro-0.2.118/.cargo-checksum.json deleted file mode 100644 index d2cb1a2696..0000000000 --- a/wasm-bindgen-macro-0.2.118/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{".cargo_vcs_info.json":"ee0d236438f106b862785d397789e449cccd8a8dc8b1dc566b629abdfb001710","Cargo.lock":"0350d7799e86f0a6877742b650317b66fb6b198e31ac3c5d7602a091bbf1c228","Cargo.toml":"b79aa5ab1f5cd1e992d7d98f80bb5759748f9a43056ab8cf6c8f2f2448d285b6","Cargo.toml.orig":"ab9f1fefa9c010334f351c60fd28c6286c2b98ea44fe76d56d521418672858e6","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"5e8d81c7bfeb6d08e0781bf572b652f064af0bf82eb030ece7af3140b135b0ef","src/lib.rs":"1e0bcfc96e940ed67ec83895f987eb7cfb1e603435f3f9537ec0485154a9c8b5","src/worker.js":"cb5c33dd41cfad622abce5464a3ceae478904ea16ddc3c6c769ee33e0c086692"},"package":"eeff24f84126c0ec2db7a449f0c2ec963c6a49efe0698c4242929da037ca28ed"} \ No newline at end of file diff --git a/wasm-bindgen-macro-0.2.118/.cargo_vcs_info.json b/wasm-bindgen-macro-0.2.118/.cargo_vcs_info.json deleted file mode 100644 index 0710ab347f..0000000000 --- a/wasm-bindgen-macro-0.2.118/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "753bb7ff4de2a00e30d2c6b56ee8e06a9e527f01" - }, - "path_in_vcs": "crates/macro" -} \ No newline at end of file diff --git a/wasm-bindgen-macro-0.2.121/.cargo-checksum.json b/wasm-bindgen-macro-0.2.121/.cargo-checksum.json new file mode 100644 index 0000000000..fe9306e2cc --- /dev/null +++ b/wasm-bindgen-macro-0.2.121/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"525046304ab3c7c560d66774bea5323270eec3dfacd3beb446da0ce44c413d30","Cargo.lock":"60983d5937c7e9435325dc7cc81586fc0d77fe9b4c217079123a19fba83f760f","Cargo.toml":"045aa280edd9dae05b53fa2ee44057cfa2944099d6b1fcd4e508df58d4428d1b","Cargo.toml.orig":"c473710c7085f2ffd6b2784488f70a9bc90bffd2b1ae5fa052c9c4e16bb889ca","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"5e8d81c7bfeb6d08e0781bf572b652f064af0bf82eb030ece7af3140b135b0ef","src/lib.rs":"1e0bcfc96e940ed67ec83895f987eb7cfb1e603435f3f9537ec0485154a9c8b5","src/worker.js":"cb5c33dd41cfad622abce5464a3ceae478904ea16ddc3c6c769ee33e0c086692"},"package":"8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578"} \ No newline at end of file diff --git a/wasm-bindgen-macro-0.2.121/.cargo_vcs_info.json b/wasm-bindgen-macro-0.2.121/.cargo_vcs_info.json new file mode 100644 index 0000000000..b1828dd7ad --- /dev/null +++ b/wasm-bindgen-macro-0.2.121/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "49457f2db4465688cb597e9030ccfdefbd2b662e" + }, + "path_in_vcs": "crates/macro" +} \ No newline at end of file diff --git a/wasm-bindgen-macro-0.2.118/Cargo.lock b/wasm-bindgen-macro-0.2.121/Cargo.lock similarity index 95% rename from wasm-bindgen-macro-0.2.118/Cargo.lock rename to wasm-bindgen-macro-0.2.121/Cargo.lock index 8eb800391e..5bb75ef47e 100644 --- a/wasm-bindgen-macro-0.2.118/Cargo.lock +++ b/wasm-bindgen-macro-0.2.121/Cargo.lock @@ -205,7 +205,7 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "wasm-bindgen-macro" -version = "0.2.118" +version = "0.2.121" dependencies = [ "quote", "trybuild", @@ -214,9 +214,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.118" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904" +checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" dependencies = [ "bumpalo", "proc-macro2", @@ -227,9 +227,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" dependencies = [ "unicode-ident", ] @@ -260,9 +260,9 @@ dependencies = [ [[package]] name = "winnow" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" +checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" [[package]] name = "zmij" diff --git a/wasm-bindgen-macro-0.2.118/Cargo.toml b/wasm-bindgen-macro-0.2.121/Cargo.toml similarity index 95% rename from wasm-bindgen-macro-0.2.118/Cargo.toml rename to wasm-bindgen-macro-0.2.121/Cargo.toml index 6ca58b80f4..dad77330e8 100644 --- a/wasm-bindgen-macro-0.2.118/Cargo.toml +++ b/wasm-bindgen-macro-0.2.121/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.77" name = "wasm-bindgen-macro" -version = "0.2.118" +version = "0.2.121" authors = ["The wasm-bindgen Developers"] build = false include = [ @@ -46,7 +46,7 @@ proc-macro = true version = "1.0" [dependencies.wasm-bindgen-macro-support] -version = "=0.2.118" +version = "=0.2.121" [dev-dependencies.trybuild] version = "1.0" @@ -67,5 +67,6 @@ level = "warn" priority = 0 check-cfg = [ "cfg(wasm_bindgen_unstable_test_coverage)", + "cfg(wasm_bindgen_use_js_sys)", "cfg(xxx_debug_only_print_generated_code)", ] diff --git a/wasm-bindgen-macro-0.2.118/Cargo.toml.orig b/wasm-bindgen-macro-0.2.121/Cargo.toml.orig similarity index 95% rename from wasm-bindgen-macro-0.2.118/Cargo.toml.orig rename to wasm-bindgen-macro-0.2.121/Cargo.toml.orig index 69d211331f..2e16b4bdb0 100644 --- a/wasm-bindgen-macro-0.2.118/Cargo.toml.orig +++ b/wasm-bindgen-macro-0.2.121/Cargo.toml.orig @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0" name = "wasm-bindgen-macro" repository = "https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro" rust-version = "1.77" -version = "0.2.118" +version = "0.2.121" [lib] proc-macro = true @@ -21,7 +21,7 @@ strict-macro = ["wasm-bindgen-macro-support/strict-macro"] [dependencies] quote = "1.0" -wasm-bindgen-macro-support = { path = "../macro-support", version = "=0.2.118" } +wasm-bindgen-macro-support = { path = "../macro-support", version = "=0.2.121" } [dev-dependencies] js-sys = { path = "../js-sys" } diff --git a/wasm-bindgen-macro-support-0.2.118/LICENSE-APACHE b/wasm-bindgen-macro-0.2.121/LICENSE-APACHE similarity index 100% rename from wasm-bindgen-macro-support-0.2.118/LICENSE-APACHE rename to wasm-bindgen-macro-0.2.121/LICENSE-APACHE diff --git a/wasm-bindgen-macro-0.2.118/LICENSE-MIT b/wasm-bindgen-macro-0.2.121/LICENSE-MIT similarity index 100% rename from wasm-bindgen-macro-0.2.118/LICENSE-MIT rename to wasm-bindgen-macro-0.2.121/LICENSE-MIT diff --git a/wasm-bindgen-macro-0.2.118/README.md b/wasm-bindgen-macro-0.2.121/README.md similarity index 100% rename from wasm-bindgen-macro-0.2.118/README.md rename to wasm-bindgen-macro-0.2.121/README.md diff --git a/wasm-bindgen-macro-0.2.118/src/lib.rs b/wasm-bindgen-macro-0.2.121/src/lib.rs similarity index 100% rename from wasm-bindgen-macro-0.2.118/src/lib.rs rename to wasm-bindgen-macro-0.2.121/src/lib.rs diff --git a/wasm-bindgen-macro-0.2.118/src/worker.js b/wasm-bindgen-macro-0.2.121/src/worker.js similarity index 100% rename from wasm-bindgen-macro-0.2.118/src/worker.js rename to wasm-bindgen-macro-0.2.121/src/worker.js diff --git a/wasm-bindgen-macro-support-0.2.118/.cargo-checksum.json b/wasm-bindgen-macro-support-0.2.118/.cargo-checksum.json deleted file mode 100644 index 2ce484170c..0000000000 --- a/wasm-bindgen-macro-support-0.2.118/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{".cargo_vcs_info.json":"16dd8aa54cc978baaa220b5898a92fd42e73cf80b5315aab857a873fcdb3ceb1","Cargo.lock":"089866ea4b1c233215f4da9803dad63f7994056255eae6ebc6cbfdac59511849","Cargo.toml":"ae689b5870bc5f6ef127a99889a27e88cd5c57b1aa21192718b06c436dd76461","Cargo.toml.orig":"b908c38c3a12db73fc86c32e0c7ff6fb320e805d14893f5a9e95a98afdb8c254","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","src/ast.rs":"a81efe5b4e6130cd38b1d6024381fe5e43f795bb8e0d25b1997503d25d7b5767","src/codegen.rs":"b6cc878bd293418d5f5d3c1f97674f266d26b609add98d8195f40c3759f53c8a","src/encode.rs":"30bf0f3cfeded794fac0a29c90248aad2fa8b09318ad4ac9eab3058bdb9b1576","src/error.rs":"3ce79c73e831c77cd72dd140cce670a47bf3de362e9554fda03bfea9eb5fdee3","src/generics.rs":"f0a50750ae1c994d04c1daf0d3b68f6ec8896d5ae1d87c88196f52d8c1d07591","src/hash.rs":"6db19dbfbc0891d051bafe3c109e50a4f51bcd75d3eaf149d5999ac3f238cc2f","src/lib.rs":"16641765023d2ef429450372249c91d80329273f1909102da6c0a0d8b0c1ce8d","src/parser.rs":"fb4617284d63f2367252cb4947ff915917ddb22675ef77a97541a053304067a4"},"package":"9d08065faf983b2b80a79fd87d8254c409281cf7de75fc4b773019824196c904"} \ No newline at end of file diff --git a/wasm-bindgen-macro-support-0.2.121/.cargo-checksum.json b/wasm-bindgen-macro-support-0.2.121/.cargo-checksum.json new file mode 100644 index 0000000000..4735ea98bd --- /dev/null +++ b/wasm-bindgen-macro-support-0.2.121/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"12fbe303d3703ee94d4a96c9ef7917b7f325685c1f9cdeca81e244f54a73a4c7","Cargo.lock":"4c3bf43fd5085edfb9fcb442869b4f365bba9428c8b135033ec94ada190ed224","Cargo.toml":"ff798acf93bfc952e39378fd060896bb76a07aca4c4e9caccd8eb200f49d57eb","Cargo.toml.orig":"8e24158cbdeb3e4ef26a68f4041a92369e37259582691ba7efbffbe318cbc657","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","src/ast.rs":"96c987379fb1acf9efd4c964b53c888a32cf68f9df7ef660bb8ac969883ffba5","src/codegen.rs":"85c76669f8b8dc71bc5cec0a05c275bbee9320b19f6c09608daff002d8917351","src/encode.rs":"1dddff073e1cd961d10d173bbe20279656d32a39958bba8c63b101abd7fbed27","src/error.rs":"3ce79c73e831c77cd72dd140cce670a47bf3de362e9554fda03bfea9eb5fdee3","src/generics.rs":"68c72f9ce68a5bead0f404c31d41a9c782be40a000727cfe99eed3edc5e5fe8a","src/hash.rs":"6db19dbfbc0891d051bafe3c109e50a4f51bcd75d3eaf149d5999ac3f238cc2f","src/lib.rs":"a84bd0ce6b83fbc635b11d26b9085ef69daf1d07947104f58d3f735baca5c8bc","src/parser.rs":"945a287d4fae0f6c312cbabfe46b72766da6dbe70f8561d0156e9475ef2e1365"},"package":"d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2"} \ No newline at end of file diff --git a/wasm-bindgen-macro-support-0.2.118/.cargo_vcs_info.json b/wasm-bindgen-macro-support-0.2.121/.cargo_vcs_info.json similarity index 51% rename from wasm-bindgen-macro-support-0.2.118/.cargo_vcs_info.json rename to wasm-bindgen-macro-support-0.2.121/.cargo_vcs_info.json index b25c00ca91..95a537f5b5 100644 --- a/wasm-bindgen-macro-support-0.2.118/.cargo_vcs_info.json +++ b/wasm-bindgen-macro-support-0.2.121/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "753bb7ff4de2a00e30d2c6b56ee8e06a9e527f01" + "sha1": "49457f2db4465688cb597e9030ccfdefbd2b662e" }, "path_in_vcs": "crates/macro-support" } \ No newline at end of file diff --git a/wasm-bindgen-macro-support-0.2.118/Cargo.lock b/wasm-bindgen-macro-support-0.2.121/Cargo.lock similarity index 92% rename from wasm-bindgen-macro-support-0.2.118/Cargo.lock rename to wasm-bindgen-macro-support-0.2.121/Cargo.lock index f1b2479fd0..5e4a05b728 100644 --- a/wasm-bindgen-macro-support-0.2.118/Cargo.lock +++ b/wasm-bindgen-macro-support-0.2.121/Cargo.lock @@ -45,7 +45,7 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.118" +version = "0.2.121" dependencies = [ "bumpalo", "proc-macro2", @@ -56,9 +56,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129" +checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" dependencies = [ "unicode-ident", ] diff --git a/wasm-bindgen-macro-support-0.2.118/Cargo.toml b/wasm-bindgen-macro-support-0.2.121/Cargo.toml similarity index 96% rename from wasm-bindgen-macro-support-0.2.118/Cargo.toml rename to wasm-bindgen-macro-support-0.2.121/Cargo.toml index 4433b31c15..94900faa5d 100644 --- a/wasm-bindgen-macro-support-0.2.118/Cargo.toml +++ b/wasm-bindgen-macro-support-0.2.121/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.77" name = "wasm-bindgen-macro-support" -version = "0.2.118" +version = "0.2.121" authors = ["The wasm-bindgen Developers"] build = false include = [ @@ -59,7 +59,7 @@ features = [ ] [dependencies.wasm-bindgen-shared] -version = "=0.2.118" +version = "=0.2.121" [lints.clippy] large_enum_variant = "allow" @@ -77,5 +77,6 @@ level = "warn" priority = 0 check-cfg = [ "cfg(wasm_bindgen_unstable_test_coverage)", + "cfg(wasm_bindgen_use_js_sys)", "cfg(xxx_debug_only_print_generated_code)", ] diff --git a/wasm-bindgen-macro-support-0.2.118/Cargo.toml.orig b/wasm-bindgen-macro-support-0.2.121/Cargo.toml.orig similarity index 89% rename from wasm-bindgen-macro-support-0.2.118/Cargo.toml.orig rename to wasm-bindgen-macro-support-0.2.121/Cargo.toml.orig index 713e929d3d..14a2d00c11 100644 --- a/wasm-bindgen-macro-support-0.2.118/Cargo.toml.orig +++ b/wasm-bindgen-macro-support-0.2.121/Cargo.toml.orig @@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0" name = "wasm-bindgen-macro-support" repository = "https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro-support" rust-version = "1.77" -version = "0.2.118" +version = "0.2.121" [features] extra-traits = ["syn/extra-traits"] @@ -20,7 +20,7 @@ bumpalo = "3.0.0" proc-macro2 = "1.0" quote = '1.0' syn = { version = '2.0', features = ['visit', 'visit-mut', 'full', 'extra-traits'] } -wasm-bindgen-shared = { path = "../shared", version = "=0.2.118" } +wasm-bindgen-shared = { path = "../shared", version = "=0.2.121" } [lints] workspace = true diff --git a/wasm-bindgen-shared-0.2.118/LICENSE-APACHE b/wasm-bindgen-macro-support-0.2.121/LICENSE-APACHE similarity index 100% rename from wasm-bindgen-shared-0.2.118/LICENSE-APACHE rename to wasm-bindgen-macro-support-0.2.121/LICENSE-APACHE diff --git a/wasm-bindgen-macro-support-0.2.118/LICENSE-MIT b/wasm-bindgen-macro-support-0.2.121/LICENSE-MIT similarity index 100% rename from wasm-bindgen-macro-support-0.2.118/LICENSE-MIT rename to wasm-bindgen-macro-support-0.2.121/LICENSE-MIT diff --git a/wasm-bindgen-macro-support-0.2.118/src/ast.rs b/wasm-bindgen-macro-support-0.2.121/src/ast.rs similarity index 85% rename from wasm-bindgen-macro-support-0.2.118/src/ast.rs rename to wasm-bindgen-macro-support-0.2.121/src/ast.rs index b14522b195..1d806c8ad1 100644 --- a/wasm-bindgen-macro-support-0.2.118/src/ast.rs +++ b/wasm-bindgen-macro-support-0.2.121/src/ast.rs @@ -8,6 +8,10 @@ use std::hash::{Hash, Hasher}; use syn::Path; use wasm_bindgen_shared as shared; +pub fn use_js_sys_futures() -> bool { + cfg!(wasm_bindgen_use_js_sys) +} + /// Whether a function is a start function, and if so, whether it /// should be exported to JS. #[cfg_attr(feature = "extra-traits", derive(Debug))] @@ -115,6 +119,8 @@ pub struct Export { pub wasm_bindgen: Path, /// Path to wasm_bindgen_futures pub wasm_bindgen_futures: Path, + /// Path to js_sys + pub js_sys: Path, } /// The 3 types variations of `self`. @@ -177,8 +183,10 @@ pub enum ImportKind { String(ImportString), /// Importing a type/class Type(ImportType), - /// Importing a JS enum + /// Importing a JS string enum Enum(StringEnum), + /// Importing a dynamic union (with fallback variant support) + DynamicUnion(DynamicUnion), } /// A function being imported from JS @@ -212,6 +220,8 @@ pub struct ImportFunction { pub wasm_bindgen: Path, /// Path to wasm_bindgen_futures pub wasm_bindgen_futures: Path, + /// Path to js_sys + pub js_sys: Path, /// Generic parameters as validated simple type parameters for this function pub generics: syn::Generics, } @@ -354,6 +364,8 @@ pub struct ImportType { pub no_upcast: bool, /// If present, don't generate a `Promising` impl pub no_promising: bool, + /// If present, don't generate an `IntoJsGeneric` impl + pub no_into_js_generic: bool, /// Path to wasm_bindgen pub wasm_bindgen: Path, /// Validated generics @@ -380,12 +392,48 @@ pub struct StringEnum { pub rust_attrs: Vec, /// Whether to generate a typescript definition for this enum pub generate_typescript: bool, + /// Whether to suppress the `export` keyword on the generated TS type + /// alias (matches the existing flag on c-style enums and structs). + pub private: bool, /// The namespace to export the enum through, if any pub js_namespace: Option>, /// Path to wasm_bindgen pub wasm_bindgen: Path, } +/// The metadata for a Dynamic Union (an untagged JS-side union of string +/// literals and single-field tuple variants, dispatched at runtime). +#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] +#[derive(Clone)] +pub struct DynamicUnion { + /// The Rust enum's visibility + pub vis: syn::Visibility, + /// The Rust enum's identifiers + pub name: Ident, + /// The name of this enum in JS/TS code + pub js_name: String, + /// The Rust identifiers for the variants + pub variants: Vec, + /// The JS string values of the known string variants + pub variant_values: Vec, + /// The field types for each variant (empty for known string variants, one element for fallback variant) + pub variant_fields: Vec>, + /// The doc comments on this enum, if any + pub comments: Vec, + /// Attributes to apply to the Rust enum + pub rust_attrs: Vec, + /// Whether to generate a typescript definition for this enum + pub generate_typescript: bool, + /// Whether to suppress the `export` keyword on the generated TS type alias. + pub private: bool, + /// Whether the last tuple variant should act as an unconditional + /// fallback rather than a runtime-checked variant. Set via the + /// `#[wasm_bindgen(fallback)]` attribute on the enum. + pub fallback: bool, + /// Path to wasm_bindgen + pub wasm_bindgen: Path, +} + /// Information about a function being imported or exported #[cfg_attr(feature = "extra-traits", derive(Debug))] #[derive(Clone)] @@ -440,6 +488,11 @@ pub struct FunctionArgumentData { pub optional: bool, /// Specifies the argument description pub desc: Option, + /// When set, an `&[T]` (or `Option<&[T]>`) argument is converted to a + /// freshly-allocated buffer the JS side observes as a plain `Array` + /// rather than a typed array. Only meaningful for outgoing arguments + /// (Rust calling JS); ignored on exported functions. + pub slice_to_array: bool, } /// Information about a Struct being exported @@ -465,6 +518,11 @@ pub struct Struct { pub private: bool, /// The namespace to export the struct through, if any pub js_namespace: Option>, + /// The parent type this struct extends, if any. When set, the macro + /// auto-injects a `parent: wasm_bindgen::Parent` field at the + /// head of the struct; that field is used as the upcast projection + /// target. Users must not declare a `Parent` field themselves. + pub extends: Option, /// Path to wasm_bindgen pub wasm_bindgen: Path, } @@ -499,6 +557,11 @@ pub struct StructField { /// If this is `Some`, the auto-generated getter for this field must clone /// the field instead of copying it. pub getter_with_clone: Option, + /// Whether this field is the macro-injected parent field — i.e. has + /// type `wasm_bindgen::Parent` — for an `extends` relationship. + /// Parent fields are not exposed to JS as getters/setters; they exist + /// only for Rust-side upcast projection. + pub is_parent: bool, /// Path to wasm_bindgen pub wasm_bindgen: Path, } @@ -534,8 +597,10 @@ pub struct Enum { #[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] #[derive(Clone)] pub struct Variant { - /// The name of this variant - pub name: Ident, + /// The name of this variant in Rust + pub rust_name: Ident, + /// The name of this variant in JS + pub js_name: String, /// The backing value of this variant pub value: u32, /// The doc comments on this variant, if any @@ -562,7 +627,15 @@ impl Export { generated_name.push_str(class); } generated_name.push('_'); - generated_name.push_str(&self.function.name.to_string()); + // The JS-side name may contain characters that aren't valid in a + // Rust identifier (notably the `[Symbol.]` computed-key form + // accepted by `js_name`). Filter to a valid identifier suffix; this + // is a no-op for plain identifier names. + for c in self.function.name.chars() { + if c.is_ascii_alphanumeric() || c == '_' { + generated_name.push(c); + } + } Ident::new(&generated_name, Span::call_site()) } @@ -593,6 +666,7 @@ impl ImportKind { ImportKind::String(_) => false, ImportKind::Type(_) => false, ImportKind::Enum(_) => false, + ImportKind::DynamicUnion(_) => false, } } } diff --git a/wasm-bindgen-macro-support-0.2.118/src/codegen.rs b/wasm-bindgen-macro-support-0.2.121/src/codegen.rs similarity index 78% rename from wasm-bindgen-macro-support-0.2.118/src/codegen.rs rename to wasm-bindgen-macro-support-0.2.121/src/codegen.rs index d148749dc9..df0c3cbcb3 100644 --- a/wasm-bindgen-macro-support-0.2.118/src/codegen.rs +++ b/wasm-bindgen-macro-support-0.2.121/src/codegen.rs @@ -226,6 +226,9 @@ impl ToTokens for ast::Struct { let free_fn = Ident::new(&shared::free_function(&name_str), Span::call_site()); let unwrap_fn = Ident::new(&shared::unwrap_function(&name_str), Span::call_site()); let wasm_bindgen = &self.wasm_bindgen; + let class_abi = quote! { + #wasm_bindgen::__rt::WasmPtr<#wasm_bindgen::__rt::WasmRefCell<#name>> + }; (quote! { #[automatically_derived] impl #wasm_bindgen::__rt::marker::SupportsConstructor for #name {} @@ -246,25 +249,25 @@ impl ToTokens for ast::Struct { #[automatically_derived] impl #wasm_bindgen::convert::IntoWasmAbi for #name { - type Abi = u32; + type Abi = #class_abi; - fn into_abi(self) -> u32 { + fn into_abi(self) -> Self::Abi { use #wasm_bindgen::__rt::alloc::rc::Rc; - use #wasm_bindgen::__rt::WasmRefCell; - Rc::into_raw(Rc::new(WasmRefCell::new(self))) as u32 + use #wasm_bindgen::__rt::{WasmPtr, WasmRefCell}; + WasmPtr::from_ptr(Rc::into_raw(Rc::new(WasmRefCell::new(self))) as *mut WasmRefCell<#name>) } } #[automatically_derived] impl #wasm_bindgen::convert::FromWasmAbi for #name { - type Abi = u32; + type Abi = #class_abi; - unsafe fn from_abi(js: u32) -> Self { + unsafe fn from_abi(js: Self::Abi) -> Self { use #wasm_bindgen::__rt::alloc::rc::Rc; use #wasm_bindgen::__rt::core::result::Result::{Ok, Err}; use #wasm_bindgen::__rt::{assert_not_null, WasmRefCell}; - let ptr = js as *mut WasmRefCell<#name>; + let ptr = js.into_ptr(); assert_not_null(ptr); let rc = Rc::from_raw(ptr); match Rc::try_unwrap(rc) { @@ -286,11 +289,11 @@ impl ToTokens for ast::Struct { #[link(wasm_import_module = "__wbindgen_placeholder__")] #[cfg(target_family = "wasm")] extern "C" { - fn #new_fn(ptr: u32) -> u32; + fn #new_fn(ptr: #class_abi) -> u32; } #[cfg(not(target_family = "wasm"))] - unsafe fn #new_fn(_: u32) -> u32 { + unsafe fn #new_fn(_: #class_abi) -> u32 { panic!("cannot convert to JsValue outside of the Wasm target") } @@ -301,6 +304,8 @@ impl ToTokens for ast::Struct { } } + + #[cfg(target_family = "wasm")] #[automatically_derived] const _: () = { @@ -309,13 +314,13 @@ impl ToTokens for ast::Struct { #[doc(hidden)] // `allow_delayed` is whether it's ok to not actually free the `ptr` immediately // if it's still borrowed. - pub unsafe extern "C-unwind" fn #free_fn(ptr: u32, allow_delayed: u32) { + pub unsafe extern "C-unwind" fn #free_fn(ptr: #class_abi, allow_delayed: u32) { use #wasm_bindgen::__rt::alloc::rc::Rc; if allow_delayed != 0 { // Just drop the implicit `Rc` owned by JS, and then if the value is still // referenced it'll be kept alive by its other `Rc`s. - let ptr = ptr as *mut #wasm_bindgen::__rt::WasmRefCell<#name>; + let ptr = ptr.into_ptr(); #wasm_bindgen::__rt::assert_not_null(ptr); drop(Rc::from_raw(ptr)); } else { @@ -328,13 +333,13 @@ impl ToTokens for ast::Struct { #[automatically_derived] impl #wasm_bindgen::convert::RefFromWasmAbi for #name { - type Abi = u32; + type Abi = #class_abi; type Anchor = #wasm_bindgen::__rt::RcRef<#name>; unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor { use #wasm_bindgen::__rt::alloc::rc::Rc; - let js = js as *mut #wasm_bindgen::__rt::WasmRefCell<#name>; + let js = js.into_ptr(); #wasm_bindgen::__rt::assert_not_null(js); Rc::increment_strong_count(js); @@ -345,13 +350,13 @@ impl ToTokens for ast::Struct { #[automatically_derived] impl #wasm_bindgen::convert::RefMutFromWasmAbi for #name { - type Abi = u32; + type Abi = #class_abi; type Anchor = #wasm_bindgen::__rt::RcRefMut<#name>; unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor { use #wasm_bindgen::__rt::alloc::rc::Rc; - let js = js as *mut #wasm_bindgen::__rt::WasmRefCell<#name>; + let js = js.into_ptr(); #wasm_bindgen::__rt::assert_not_null(js); Rc::increment_strong_count(js); @@ -362,7 +367,7 @@ impl ToTokens for ast::Struct { #[automatically_derived] impl #wasm_bindgen::convert::LongRefFromWasmAbi for #name { - type Abi = u32; + type Abi = #class_abi; type Anchor = #wasm_bindgen::__rt::RcRef<#name>; unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor { @@ -373,13 +378,13 @@ impl ToTokens for ast::Struct { #[automatically_derived] impl #wasm_bindgen::convert::OptionIntoWasmAbi for #name { #[inline] - fn none() -> Self::Abi { 0 } + fn none() -> Self::Abi { <#class_abi>::null() } } #[automatically_derived] impl #wasm_bindgen::convert::OptionFromWasmAbi for #name { #[inline] - fn is_none(abi: &Self::Abi) -> bool { *abi == 0 } + fn is_none(abi: &Self::Abi) -> bool { abi.is_null() } } #[automatically_derived] @@ -393,16 +398,16 @@ impl ToTokens for ast::Struct { #[link(wasm_import_module = "__wbindgen_placeholder__")] #[cfg(target_family = "wasm")] extern "C" { - fn #unwrap_fn(ptr: u32) -> u32; + fn #unwrap_fn(ptr: u32) -> #class_abi; } #[cfg(not(target_family = "wasm"))] - unsafe fn #unwrap_fn(_: u32) -> u32 { + unsafe fn #unwrap_fn(_: u32) -> #class_abi { panic!("cannot convert from JsValue outside of the Wasm target") } let ptr = unsafe { #unwrap_fn(idx) }; - if ptr == 0 { + if ptr.is_null() { #wasm_bindgen::__rt::core::option::Option::None } else { unsafe { @@ -455,6 +460,69 @@ impl ToTokens for ast::Struct { }) .to_tokens(tokens); + // If this struct `extends` another exported Rust struct, emit: + // + // - `AsRef>` projecting to the wrapper field + // so generic code can accept any direct child where it expects + // a borrowed `Parent`. This impl is direct-parent + // only: `AsRef` returns `&Parent

` borrowed from `&self`, + // and ancestors at depth ≥ 2 live inside an `Rc` + // reachable only via a transient `borrow()` guard whose + // lifetime would not satisfy the `AsRef` contract. + // - The upcast wasm export used by the JS side to produce a + // separately-refcounted parent pointer when a child instance is + // constructed (or when wasm returns a child back to JS). The + // upcast clones the `Rc>` held by the + // child's `Parent` field. + // + // The JS-side of the extends relationship (class Child extends + // Parent, instanceof, prototype-chain dispatch) is wired up by + // cli-support using this export and the matching `extends` schema + // entry. + if let Some(parent_path) = &self.extends { + let parent_field = self.fields.iter().find(|f| f.is_parent); + if let Some(parent_field) = parent_field { + let field_name = &parent_field.rust_name; + let field_ty = &parent_field.ty; + let parent_js_name = parent_path + .segments + .last() + .map(|s| s.ident.to_string()) + .unwrap_or_default(); + let upcast_fn = Ident::new( + &shared::upcast_function(&name_str, &parent_js_name), + Span::call_site(), + ); + (quote! { + #[automatically_derived] + impl #wasm_bindgen::__rt::core::convert::AsRef<#field_ty> for #name { + #[inline] + fn as_ref(&self) -> &#field_ty { + &self.#field_name + } + } + + #[cfg(target_family = "wasm")] + #[automatically_derived] + const _: () = { + #[no_mangle] + #[doc(hidden)] + pub unsafe extern "C-unwind" fn #upcast_fn(ptr: u32) -> u32 { + use #wasm_bindgen::__rt::alloc::rc::Rc; + use #wasm_bindgen::__rt::{assert_not_null, WasmRefCell}; + + let ptr = ptr as *mut WasmRefCell<#name>; + assert_not_null(ptr); + let cell = &*ptr; + let rc_clone = cell.borrow().#field_name.__wbg_clone_rc(); + Rc::into_raw(rc_clone) as u32 + } + }; + }) + .to_tokens(tokens); + } + } + for field in self.fields.iter() { field.to_tokens(tokens); } @@ -463,6 +531,13 @@ impl ToTokens for ast::Struct { impl ToTokens for ast::StructField { fn to_tokens(&self, tokens: &mut TokenStream) { + // Parent fields exist solely to back the `extends` relationship + // (used by `AsRef`/`Deref` codegen above). They are not exposed to + // JS as a getter/setter. + if self.is_parent { + return; + } + let rust_name = &self.rust_name; let struct_name = &self.struct_name; let ty = &self.ty; @@ -489,6 +564,9 @@ impl ToTokens for ast::StructField { } let wasm_bindgen = &self.wasm_bindgen; + let struct_abi = quote! { + #wasm_bindgen::__rt::WasmPtr<#wasm_bindgen::__rt::WasmRefCell<#struct_name>> + }; (quote! { #[automatically_derived] @@ -496,7 +574,7 @@ impl ToTokens for ast::StructField { #wasm_bindgen::__wbindgen_coverage! { #[cfg_attr(target_family = "wasm", no_mangle)] #[doc(hidden)] - pub unsafe extern "C-unwind" fn #getter(js: u32) + pub unsafe extern "C-unwind" fn #getter(js: #struct_abi) -> #wasm_bindgen::convert::WasmRet<<#ty as #wasm_bindgen::convert::IntoWasmAbi>::Abi> { use #wasm_bindgen::__rt::{WasmRefCell, assert_not_null}; @@ -505,7 +583,7 @@ impl ToTokens for ast::StructField { fn assert_copy(){} #maybe_assert_copy; - let js = js as *mut WasmRefCell<#struct_name>; + let js = js.into_ptr(); assert_not_null(js); let val = #val; <#ty as IntoWasmAbi>::into_abi(val).into() @@ -540,13 +618,13 @@ impl ToTokens for ast::StructField { #[no_mangle] #[doc(hidden)] pub unsafe extern "C-unwind" fn #setter( - js: u32, + js: #struct_abi, #(#args,)* ) { use #wasm_bindgen::__rt::{WasmRefCell, assert_not_null}; use #wasm_bindgen::convert::FromWasmAbi; - let js = js as *mut WasmRefCell<#struct_name>; + let js = js.into_ptr(); assert_not_null(js); let val = <#abi as #wasm_bindgen::convert::WasmAbi>::join(#(#names),*); let val = <#ty as FromWasmAbi>::from_abi(val); @@ -568,16 +646,41 @@ impl TryToTokens for ast::Export { let mut converted_arguments = vec![]; let ret = Ident::new("_ret", Span::call_site()); + let name = &self.rust_name; + let wasm_bindgen = &self.wasm_bindgen; + let offset = if self.method_self.is_some() { - args.push(quote! { me: u32 }); + if matches!(self.method_self, Some(ast::MethodSelf::ByValue)) { + let class = self.rust_class.as_ref().unwrap(); + args.push(quote! { me: <#class as #wasm_bindgen::convert::FromWasmAbi>::Abi }); + } else { + let class = self.rust_class.as_ref().unwrap(); + let abi = match self.method_self { + Some(ast::MethodSelf::RefMutable) => { + quote! { <#class as #wasm_bindgen::convert::RefMutFromWasmAbi>::Abi } + } + Some(ast::MethodSelf::RefShared) => { + if self.function.r#async { + quote! { <#class as #wasm_bindgen::convert::LongRefFromWasmAbi>::Abi } + } else { + quote! { <#class as #wasm_bindgen::convert::RefFromWasmAbi>::Abi } + } + } + _ => unreachable!(), + }; + args.push(quote! { me: #abi }); + } 1 } else { 0 }; - - let name = &self.rust_name; - let wasm_bindgen = &self.wasm_bindgen; let wasm_bindgen_futures = &self.wasm_bindgen_futures; + let js_sys = &self.js_sys; + let futures = if ast::use_js_sys_futures() { + quote! { #js_sys::futures } + } else { + quote! { #wasm_bindgen_futures } + }; let receiver = match self.method_self { Some(ast::MethodSelf::ByValue) => { let class = self.rust_class.as_ref().unwrap(); @@ -765,13 +868,13 @@ impl TryToTokens for ast::Export { if self.function.r#async { if self.start.is_start() { call = quote! { - #wasm_bindgen_futures::spawn_local(async move { + #futures::spawn_local(async move { #call }) } } else { call = quote! { - #wasm_bindgen_futures::future_to_promise(async move { + #futures::future_to_promise(async move { #call }).into() } @@ -938,6 +1041,7 @@ impl TryToTokens for ast::ImportKind { ast::ImportKind::String(ref s) => s.to_tokens(tokens), ast::ImportKind::Type(ref t) => t.try_to_tokens(tokens)?, ast::ImportKind::Enum(ref e) => e.to_tokens(tokens), + ast::ImportKind::DynamicUnion(ref e) => e.to_tokens(tokens), } Ok(()) @@ -992,6 +1096,7 @@ impl TryToTokens for ast::ImportType { let no_deref = self.no_deref; let no_promising = self.no_promising; + let no_into_js_generic = self.no_into_js_generic; let doc = if doc_comment.is_empty() { quote! {} @@ -1043,6 +1148,56 @@ impl TryToTokens for ast::ImportType { phantom_init = quote! {}; } + // Identity implementation of `IntoJsGeneric`. Declaring this per-type, + // rather than via a blanket over `T: JsGeneric`, preserves the option + // for future wrapper types to pick a non-identity `JsCanon`. + // + // The body takes `self` by value and reinterprets the transparent JS + // handle wrapper into its canonical type. This lets the impl apply + // uniformly to types that do not implement Rust-level `Clone` (e.g. + // generic types whose parameters aren't `Clone`, or plain handle + // wrappers that simply don't derive `Clone`). + // + // Types whose Rust wrapper enforces owned-once destruction semantics + // (currently just `JsClosure`) opt out via the + // `#[wasm_bindgen(no_into_js_generic)]` attribute — producing a + // duplicate wrapper over the same handle would violate those semantics. + // + // The extra `Self: JsGeneric` predicate propagates any generic + // type-parameter requirements the `JsGeneric` blanket imposes + // through `ErasableGeneric` etc. + let into_js_generic_impl = if no_into_js_generic { + quote! {} + } else { + let mut clause = + self.generics + .where_clause + .clone() + .unwrap_or_else(|| syn::WhereClause { + where_token: Default::default(), + predicates: Default::default(), + }); + let self_ty_generics = &ty_generics; + let self_ty: syn::Type = syn::parse_quote!(#rust_name #self_ty_generics); + let wasm_bindgen_path: syn::Path = syn::parse_quote!(#wasm_bindgen); + clause.predicates.push(syn::parse_quote!( + #self_ty: #wasm_bindgen_path::JsGeneric + )); + quote! { + #[automatically_derived] + impl #impl_generics #wasm_bindgen::IntoJsGeneric + for #rust_name #ty_generics + #clause + { + type JsCanon = #rust_name #ty_generics; + #[inline] + fn to_js(self) -> #rust_name #ty_generics { + unsafe { core::mem::transmute_copy(&core::mem::ManuallyDrop::new(self)) } + } + } + } + }; + (quote! { #(#attrs)* #doc @@ -1166,6 +1321,8 @@ impl TryToTokens for ast::ImportType { fn as_ref(&self) -> &#rust_name #ty_generics { self } } + #into_js_generic_impl + // TODO: remove this on the next major version // Only include lifetime params here; type params use their // defaults so callers don't need turbofish annotations. @@ -1404,6 +1561,26 @@ impl TryToTokens for ast::ImportType { } } +// String enums predate dynamic unions and overlap structurally: a string +// enum is equivalent to a dynamic union with only string-literal variants, +// minus a few details. Future cleanup (separate PR) could subsume string +// enums into the dynamic-union codegen. Differences to reconcile first: +// +// * `__Invalid`: string enums silently accept unknown JS strings as a hidden +// `__Invalid` variant. Dynamic unions throw, or accept an explicit +// `#[wasm_bindgen(fallback)]` catch-all variant. Migrating means dropping +// `__Invalid` (telling users to switch to `fallback`). +// * Inherent helpers: `from_str` / `to_str` / `from_js_value` are emitted +// here as inherent methods. Dynamic unions don't generate equivalents. +// Either preserve them or document removal as breaking. +// * `TryFromJsValue`: string enums currently lack this impl, so they +// can't be `dyn_into` targets or dynamic-union variant payloads. +// Dynamic unions have it. Unification would gain this on the string +// enum path for free. +// * ABI: string enums use a u32 discriminant; dynamic unions use an +// externref. Benchmarks (see `benches/enum_roundtrip.rs`) show the +// round-trip cost is within ~1% on Node, so the perf argument for +// keeping the discriminant ABI is weak. impl ToTokens for ast::StringEnum { fn to_tokens(&self, tokens: &mut TokenStream) { let vis = &self.vis; @@ -1526,6 +1703,298 @@ impl ToTokens for ast::StringEnum { } } +impl ToTokens for ast::DynamicUnion { + fn to_tokens(&self, tokens: &mut TokenStream) { + let vis = &self.vis; + let enum_name = &self.name; + let wasm_bindgen = &self.wasm_bindgen; + let attrs = &self.rust_attrs; + + // Separate string-literal variants from tuple (typed payload) variants + let (known_variants, fallback_variants): (Vec<_>, Vec<_>) = self + .variants + .iter() + .zip(&self.variant_fields) + .partition(|(_, fields)| fields.is_empty()); + + let known_variant_names: Vec<_> = known_variants.iter().map(|(v, _)| v).collect(); + let known_variant_values: Vec<_> = known_variants + .iter() + .map(|(v, _)| { + let idx = self.variants.iter().position(|x| x == *v).unwrap(); + &self.variant_values[idx] + }) + .collect(); + + // Build enum definition with all variants + let fallback_variant_defs = fallback_variants.iter().map(|(name, fields)| { + let ty = &fields[0]; + quote! { #name(#ty) } + }); + + let enum_def = quote! { + #(#known_variant_names,)* + #(#fallback_variant_defs,)* + }; + + // IntoWasmAbi - convert everything to JsValue + let known_into_arms: Vec<_> = known_variant_names + .iter() + .zip(&known_variant_values) + .map(|(vname, value)| { + quote! { + #enum_name::#vname => #wasm_bindgen::JsValue::from_str(#value) + } + }) + .collect(); + + let fallback_into_arms: Vec<_> = fallback_variants + .iter() + .map(|(name, _)| { + quote! { + #enum_name::#name(value) => #wasm_bindgen::JsValue::from(value) + } + }) + .collect(); + + // FromWasmAbi - try to match JsValue to each variant. All string + // literal variants share a single `as_string` call coalesced into one + // `match`, so the worst-case dispatch cost is a single string read + // regardless of how many literal variants exist. + let known_from_block = if known_variant_names.is_empty() { + quote! {} + } else { + let arms = + known_variant_names + .iter() + .zip(&known_variant_values) + .map(|(vname, value)| { + quote! { #value => return #enum_name::#vname, } + }); + quote! { + if let Some(s) = js_value.as_string() { + match s.as_str() { + #(#arms)* + _ => {} + } + } + } + }; + + // When `#[wasm_bindgen(fallback)]` is set on the enum and there is + // at least one tuple variant, the *last* tuple variant becomes an + // unconditional catch-all: anything that didn't match an earlier + // variant is unconditionally accepted as that variant's payload via + // an unchecked cast. This lets unions terminate in a type whose + // `instanceof` check is meaningless (e.g., interface-only imports). + let last_fallback_idx = if self.fallback && !fallback_variants.is_empty() { + Some(fallback_variants.len() - 1) + } else { + None + }; + + let fallback_from_arms: Vec<_> = fallback_variants + .iter() + .enumerate() + .map(|(idx, (name, fields))| { + let ty = &fields[0]; + if Some(idx) == last_fallback_idx { + quote! { + return #enum_name::#name( + <#wasm_bindgen::JsValue as #wasm_bindgen::JsCast>::unchecked_into::<#ty>(js_value) + ); + } + } else { + quote! { + if let Ok(value) = <#ty as #wasm_bindgen::convert::TryFromJsValue>::try_from_js_value(js_value.clone()) { + return #enum_name::#name(value); + } + } + } + }) + .collect(); + + // Same dispatch as `fallback_from_arms` but for `TryFromJsValue`, + // which returns `Err(value)` on full failure rather than throwing. + // The same fallback rule applies. + let fallback_try_from_arms: Vec<_> = fallback_variants + .iter() + .enumerate() + .map(|(idx, (name, fields))| { + let ty = &fields[0]; + if Some(idx) == last_fallback_idx { + quote! { + return #wasm_bindgen::__rt::core::result::Result::Ok( + #enum_name::#name( + <#wasm_bindgen::JsValue as #wasm_bindgen::JsCast>::unchecked_into::<#ty>(value) + ) + ); + } + } else { + quote! { + if let Ok(inner) = <#ty as #wasm_bindgen::convert::TryFromJsValue>::try_from_js_value(value.clone()) { + return #wasm_bindgen::__rt::core::result::Result::Ok(#enum_name::#name(inner)); + } + } + } + }) + .collect(); + + // The dispatch chain ends with a throw / `Err` only when the enum + // does *not* have a fallback variant. With a fallback, the last + // tuple-variant arm always `return`s unconditionally, so any + // trailing expression would be unreachable. + let from_abi_tail = if last_fallback_idx.is_some() { + quote! {} + } else { + quote! { #wasm_bindgen::throw_str("invalid dynamic union value") } + }; + let try_from_tail = if last_fallback_idx.is_some() { + quote! {} + } else { + quote! { #wasm_bindgen::__rt::core::result::Result::Err(value) } + }; + + let name_str = &self.js_name; + let name_len = name_str.len() as u32; + let name_chars = name_str.chars().map(u32::from); + + let mut string_variants = Vec::new(); + let mut type_variants = Vec::new(); + for (idx, fields) in self.variant_fields.iter().enumerate() { + if fields.is_empty() { + string_variants.push(&self.variant_values[idx]); + } else { + type_variants.push(&fields[0]); + } + } + let type_count = type_variants.len() as u32; + + (quote! { + #(#attrs)* + #vis enum #enum_name { + #enum_def + } + + #[automatically_derived] + impl #wasm_bindgen::convert::IntoWasmAbi for #enum_name { + type Abi = u32; + + #[inline] + fn into_abi(self) -> u32 { + let js_value: #wasm_bindgen::JsValue = match self { + #(#known_into_arms,)* + #(#fallback_into_arms,)* + }; + #wasm_bindgen::convert::IntoWasmAbi::into_abi(js_value) + } + } + + #[automatically_derived] + impl #wasm_bindgen::convert::FromWasmAbi for #enum_name { + type Abi = u32; + + #[inline] + unsafe fn from_abi(js: u32) -> Self { + let js_value = <#wasm_bindgen::JsValue as #wasm_bindgen::convert::FromWasmAbi>::from_abi(js); + #known_from_block + #(#fallback_from_arms)* + #from_abi_tail + } + } + + // Despite the generic implementation, we still encode the type information for TypeScript output + #[automatically_derived] + impl #wasm_bindgen::describe::WasmDescribe for #enum_name { + fn describe() { + use #wasm_bindgen::describe::*; + inform(DYNAMIC_UNION); + inform(#name_len); + #(inform(#name_chars);)* + inform(#type_count); + #(<#type_variants as WasmDescribe>::describe();)* + } + } + + #[automatically_derived] + impl #wasm_bindgen::__rt::core::convert::From<#enum_name> for #wasm_bindgen::JsValue { + fn from(value: #enum_name) -> Self { + match value { + #(#known_into_arms,)* + #(#fallback_into_arms,)* + } + } + } + + // Allows this union to appear inside `Option<...>`. Reuses + // `JsValue`'s `undefined` sentinel since the union ABI is a + // single externref slot. This is sound only because dynamic + // unions cannot match `undefined` as a variant. + #[automatically_derived] + impl #wasm_bindgen::convert::OptionIntoWasmAbi for #enum_name { + #[inline] + fn none() -> u32 { + <#wasm_bindgen::JsValue as #wasm_bindgen::convert::OptionIntoWasmAbi>::none() + } + } + + #[automatically_derived] + impl #wasm_bindgen::convert::OptionFromWasmAbi for #enum_name { + #[inline] + fn is_none(js: &u32) -> bool { + <#wasm_bindgen::JsValue as #wasm_bindgen::convert::OptionFromWasmAbi>::is_none(js) + } + } + + // Allows this union to appear as a variant payload of another + // dynamic union (nested unions) and anywhere else the macro + // dispatches through `TryFromJsValue`. + #[automatically_derived] + impl #wasm_bindgen::convert::TryFromJsValue for #enum_name { + fn try_from_js_value( + value: #wasm_bindgen::JsValue, + ) -> #wasm_bindgen::__rt::core::result::Result { + if let Some(s) = value.as_string() { + #( + if s == #known_variant_values { + return #wasm_bindgen::__rt::core::result::Result::Ok( + #enum_name::#known_variant_names + ); + } + )* + } + #(#fallback_try_from_arms)* + #try_from_tail + } + + fn try_from_js_value_ref( + value: &#wasm_bindgen::JsValue, + ) -> #wasm_bindgen::__rt::core::option::Option { + Self::try_from_js_value(value.clone()).ok() + } + } + }) + .to_tokens(tokens); + + // Generate descriptor exports for each type variant so cli-support can look them up + for (idx, ty) in type_variants.iter().enumerate() { + let descriptor_name = Ident::new( + &shared::dynamic_union_variant(name_str, idx as u32), + Span::call_site(), + ); + Descriptor { + ident: &descriptor_name, + inner: quote! { + <#ty as WasmDescribe>::describe(); + }, + attrs: vec![], + wasm_bindgen: &self.wasm_bindgen, + } + .to_tokens(tokens); + } + } +} + impl TryToTokens for ast::ImportFunction { fn try_to_tokens(&self, tokens: &mut TokenStream) -> Result<(), Diagnostic> { let mut class = None; @@ -1576,6 +2045,17 @@ impl TryToTokens for ast::ImportFunction { let ret_ident = Ident::new("_ret", Span::call_site()); let wasm_bindgen = &self.wasm_bindgen; let wasm_bindgen_futures = &self.wasm_bindgen_futures; + let js_sys = &self.js_sys; + let futures = if ast::use_js_sys_futures() { + quote! { #js_sys::futures } + } else { + quote! { #wasm_bindgen_futures } + }; + let promise = if ast::use_js_sys_futures() { + quote! { #js_sys::Promise } + } else { + quote! { #wasm_bindgen_futures::js_sys::Promise } + }; for (i, arg) in self.function.arguments.iter().enumerate() { let ty = &*arg.pat_type.ty; @@ -1684,6 +2164,61 @@ impl TryToTokens for ast::ImportFunction { convert_arg = quote! { #var }; } + // `slice_to_array`: re-route an `&[T]` (or `Option<&[T]>`) + // outgoing argument through `` + // instead of the default `&[T]: IntoWasmAbi`. The user-facing + // parameter is unchanged; only the ABI / describe path + // changes. `VectorRefIntoWasmAbi`'s impls cover the two + // genuine ABI shapes (zero-copy primitive borrow, + // fresh-`Box<[u32]>` for handle-shaped element types) — no + // `T: Clone` bound is introduced. + // + // Wire format is `WasmSlice` either way; the cli-support + // side picks the right JS shim based on the element + // `VectorKind` recovered from the descriptor. + // `slice_to_array` is set per-fn or per-`extern "C"` block + // and applies to every `&[T]` / `Option<&[T]>` argument of + // every fn it covers. Args that aren't slice-shaped (e.g. + // the `this: &Foo` of a method, or any other non-slice + // argument of a slice_to_array fn) silently fall through to + // the default ABI path — there's no per-arg opt-out form + // in Rust attribute syntax to require, so silent no-op is + // the only sensible behaviour. + if arg.slice_to_array && detect_slice_or_option_slice(ty).is_some() { + let (elem_ty, is_option) = detect_slice_or_option_slice(ty).unwrap(); + + let abi = quote! { #wasm_bindgen::convert::WasmSlice }; + let (prim_args, prim_names) = splat(wasm_bindgen, &name, &abi); + abi_arguments.extend(prim_args); + abi_argument_names.extend(prim_names.iter().cloned()); + + let body = if is_option { + quote! { + match #var { + ::core::option::Option::Some(s) => + <#elem_ty as #wasm_bindgen::convert::VectorRefIntoWasmAbi> + ::slice_into_abi(s), + ::core::option::Option::None => + <#elem_ty as #wasm_bindgen::convert::VectorRefIntoWasmAbi> + ::slice_none(), + } + } + } else { + quote! { + <#elem_ty as #wasm_bindgen::convert::VectorRefIntoWasmAbi> + ::slice_into_abi(#var) + } + }; + + arg_conversions.push(quote! { + let #name: #wasm_bindgen::convert::WasmSlice = #body; + let (#(#prim_names),*) = + <#wasm_bindgen::convert::WasmSlice as #wasm_bindgen::convert::WasmAbi> + ::split(#name); + }); + continue; + } + let abi = quote! { <#abi_ty as #wasm_bindgen::convert::IntoWasmAbi>::Abi }; let (prim_args, prim_names) = splat(wasm_bindgen, &name, &abi); abi_arguments.extend(prim_args); @@ -1707,8 +2242,7 @@ impl TryToTokens for ast::ImportFunction { Some(ref original_ty) => { let maybe_async_wrapped; let ty = if self.function.r#async { - maybe_async_wrapped = - parse_quote!(wasm_bindgen_futures::js_sys::Promise<#original_ty>); + maybe_async_wrapped = parse_quote!(#promise<#original_ty>); &maybe_async_wrapped } else { original_ty @@ -1732,8 +2266,8 @@ impl TryToTokens for ast::ImportFunction { } if self.function.r#async { convert_ret = quote! { - #wasm_bindgen_futures::JsFuture::from( - <#wasm_bindgen_futures::js_sys::Promise<#original_ty> as #wasm_bindgen::convert::FromWasmAbi> + #futures::JsFuture::from( + <#promise<#original_ty> as #wasm_bindgen::convert::FromWasmAbi> ::from_abi(#ret_ident.join()) ).await }; @@ -1747,11 +2281,11 @@ impl TryToTokens for ast::ImportFunction { None => { if self.function.r#async { abi_ret = quote! { - #wasm_bindgen::convert::WasmRet<<#wasm_bindgen_futures::js_sys::Promise as #wasm_bindgen::convert::FromWasmAbi>::Abi> + #wasm_bindgen::convert::WasmRet<<#promise as #wasm_bindgen::convert::FromWasmAbi>::Abi> }; let future = quote! { - #wasm_bindgen_futures::JsFuture::from( - <#wasm_bindgen_futures::js_sys::Promise as #wasm_bindgen::convert::FromWasmAbi> + #futures::JsFuture::from( + <#promise as #wasm_bindgen::convert::FromWasmAbi> ::from_abi(#ret_ident.join()) ).await }; @@ -2230,29 +2764,28 @@ impl ast::ImportFunction { return None; } - // For static methods, only infer class hoisting when all type args are - // bare generic param idents — not associated types like `I::Item`. - if is_static { - if let syn::PathArguments::AngleBracketed(ref gen_args) = seg.arguments { - let fn_params: Vec<&Ident> = generics::generic_params(&self.generics) - .iter() - .map(|p| p.0) - .collect(); - for arg in &gen_args.args { - match arg { - syn::GenericArgument::Lifetime(_) => {} - syn::GenericArgument::Type(syn::Type::Path(syn::TypePath { - qself: None, - path: arg_path, - })) if arg_path.segments.len() == 1 - && matches!( - arg_path.segments[0].arguments, - syn::PathArguments::None - ) - && fn_params.iter().any(|p| *p == &arg_path.segments[0].ident) => {} - _ => return None, - } - } + // Only hoist fn generics onto the class impl header when every fn + // generic mentioned in the return type's args appears in a + // *structurally constraining* position (per E0207 / RFC 0447). + // + // Non-constraining positions — projections (`::Assoc`, + // `T::Item`), fn-ptr slots (`fn(T)` / `Fn(T)` sugar), associated-type + // binding RHS, etc. — would produce an `impl Ret<...>` whose `T` + // is not determinable from `Self`, yielding a borrow-check-level + // compilation error. When we detect such a shape, bail so the + // parameter stays function-level. + // + // This replaces the earlier "static methods must have only bare + // idents" heuristic, which was both too strict (rejected valid + // shapes like `Array>`) and too narrow (didn't apply to + // constructors, leading to E0207 for `Promise<::Resolution>`). + if let syn::PathArguments::AngleBracketed(ref gen_args) = seg.arguments { + let fn_params: Vec<&Ident> = generics::generic_params(&self.generics) + .iter() + .map(|p| p.0) + .collect(); + if !generics::args_are_constraining_for(&gen_args.args, &fn_params) { + return None; } } @@ -2268,6 +2801,7 @@ impl TryToTokens for DescribeImport<'_> { ast::ImportKind::String(_) => return Ok(()), ast::ImportKind::Type(_) => return Ok(()), ast::ImportKind::Enum(_) => return Ok(()), + ast::ImportKind::DynamicUnion(_) => return Ok(()), }; let fn_class_generics = f.get_fn_generics()?; let fn_lifetime_params = generics::lifetime_params(&f.generics); @@ -2276,11 +2810,31 @@ impl TryToTokens for DescribeImport<'_> { .arguments .iter() .map(|arg| { - generics::generic_to_concrete( + let ty = generics::generic_to_concrete( (*arg.pat_type.ty).clone(), &fn_class_generics.concrete_defaults, &fn_lifetime_params, - ) + )?; + // For `slice_to_array` args, describe through `&Vec` (or + // `Option<&Vec>`) to match the ABI rewrite in + // `ImportFunction::try_to_tokens` — the descriptor shape is + // `Ref(Vector(T))`, which the cli-support side recognises. + // Non-slice args (e.g. `this: &Foo` of a method) under a + // fn- or block-level `slice_to_array` silently fall through + // to their default describe — slice_to_array is a mode that + // only acts on slice-shaped args. + if arg.slice_to_array { + if let Some((elem_ty, is_option)) = detect_slice_or_option_slice(&ty) { + if is_option { + return Ok(parse_quote! { + ::core::option::Option<&::std::vec::Vec<#elem_ty>> + }); + } else { + return Ok(parse_quote! { &::std::vec::Vec<#elem_ty> }); + } + } + } + Ok(ty) }) .collect::, Diagnostic>>()?; let nargs = f.function.arguments.len() as u32; @@ -2319,7 +2873,7 @@ impl TryToTokens for DescribeImport<'_> { impl ToTokens for ast::Enum { fn to_tokens(&self, into: &mut TokenStream) { let enum_name = &self.rust_name; - let name_str = self.js_name.to_string(); + let name_str = shared::qualified_name(self.js_namespace.as_deref(), &self.js_name); let name_len = name_str.len() as u32; let name_chars = name_str.chars().map(|c| c as u32); let hole = &self.hole; @@ -2329,7 +2883,7 @@ impl ToTokens for ast::Enum { quote! { u32 } }; let cast_clauses = self.variants.iter().map(|variant| { - let variant_name = &variant.name; + let variant_name = &variant.rust_name; quote! { if js == #enum_name::#variant_name as #underlying { #enum_name::#variant_name @@ -2396,8 +2950,7 @@ impl ToTokens for ast::Enum { #[automatically_derived] impl #wasm_bindgen::convert::TryFromJsValue for #enum_name { fn try_from_js_value_ref(value: &#wasm_bindgen::JsValue) -> #wasm_bindgen::__rt::core::option::Option { - use #wasm_bindgen::__rt::core::convert::TryFrom; - let js = f64::try_from(value).ok()? as #underlying; + let js = value.as_f64()? as #underlying; #wasm_bindgen::__rt::core::option::Option::Some( #(#try_from_cast_clauses else)* { @@ -2723,6 +3276,36 @@ fn get_ty(mut ty: &syn::Type) -> &syn::Type { /// /// This is used by the import function codegen to auto-inject `MaybeUnwindSafe` /// bounds for closure arguments, ensuring unwind safety when `panic = "unwind"`. +/// Recognise `&[T]` and `Option<&[T]>` argument types. Returns the element +/// type plus a flag indicating whether the outer `Option` was present. Used +/// by the `slice_to_array` codegen to rewrite the ABI path. +fn detect_slice_or_option_slice(ty: &syn::Type) -> Option<(syn::Type, bool)> { + // Direct `&[T]` (mutability ignored — `&mut [T]` is intentionally + // accepted too; the ABI layer treats it the same as `&[T]`). + if let syn::Type::Reference(syn::TypeReference { elem, .. }) = ty { + if let syn::Type::Slice(syn::TypeSlice { elem: inner, .. }) = &**elem { + return Some(((**inner).clone(), false)); + } + } + // `Option<&[T]>` — match shape `Option<...>` and recurse once. + if let syn::Type::Path(syn::TypePath { qself: None, path }) = ty { + if let Some(seg) = path.segments.last() { + if seg.ident == "Option" { + if let syn::PathArguments::AngleBracketed(args) = &seg.arguments { + if args.args.len() == 1 { + if let syn::GenericArgument::Type(inner) = &args.args[0] { + if let Some((elem, false)) = detect_slice_or_option_slice(inner) { + return Some((elem, true)); + } + } + } + } + } + } + } + None +} + fn detect_raw_fn_trait_obj( ty: &syn::Type, ) -> Option<( diff --git a/wasm-bindgen-macro-support-0.2.118/src/encode.rs b/wasm-bindgen-macro-support-0.2.121/src/encode.rs similarity index 94% rename from wasm-bindgen-macro-support-0.2.118/src/encode.rs rename to wasm-bindgen-macro-support-0.2.121/src/encode.rs index 62782ad531..e8642a6bc9 100644 --- a/wasm-bindgen-macro-support-0.2.118/src/encode.rs +++ b/wasm-bindgen-macro-support-0.2.121/src/encode.rs @@ -274,9 +274,9 @@ fn shared_enum<'a>(e: &'a ast::Enum, intern: &'a Interner) -> Enum<'a> { } } -fn shared_variant<'a>(v: &'a ast::Variant, intern: &'a Interner) -> EnumVariant<'a> { +fn shared_variant<'a>(v: &'a ast::Variant, _intern: &'a Interner) -> EnumVariant<'a> { EnumVariant { - name: intern.intern(&v.name), + name: &v.js_name, value: v.value, comments: v.comments.iter().map(|s| &**s).collect(), } @@ -359,6 +359,9 @@ fn shared_import_kind<'a>( ast::ImportKind::String(f) => ImportKind::String(shared_import_string(f, intern)), ast::ImportKind::Type(f) => ImportKind::Type(shared_import_type(f, intern)), ast::ImportKind::Enum(f) => ImportKind::Enum(shared_import_enum(f, intern)), + ast::ImportKind::DynamicUnion(f) => { + ImportKind::DynamicUnion(shared_import_dynamic_union(f, intern)) + } }) } @@ -411,6 +414,7 @@ fn shared_import_enum<'a>(i: &'a ast::StringEnum, _intern: &'a Interner) -> Stri StringEnum { name: &i.export_name, generate_typescript: i.generate_typescript, + private: i.private, variant_values: i.variant_values.iter().map(|x| &**x).collect(), comments: i.comments.iter().map(|s| &**s).collect(), js_namespace: i @@ -420,6 +424,32 @@ fn shared_import_enum<'a>(i: &'a ast::StringEnum, _intern: &'a Interner) -> Stri } } +fn shared_import_dynamic_union<'a>( + i: &'a ast::DynamicUnion, + _intern: &'a Interner, +) -> DynamicUnion<'a> { + let mut variant_strings = Vec::new(); + let mut variant_type_cnt = 0; + + for (idx, fields) in i.variant_fields.iter().enumerate() { + if fields.is_empty() { + variant_strings.push(&*i.variant_values[idx]); + } else { + variant_type_cnt += 1; + } + } + + DynamicUnion { + name: &i.js_name, + generate_typescript: i.generate_typescript, + private: i.private, + fallback: i.fallback, + variant_strings, + variant_type_cnt, + comments: i.comments.iter().map(|s| &**s).collect(), + } +} + fn shared_struct<'a>(s: &'a ast::Struct, intern: &'a Interner) -> Struct<'a> { Struct { name: &s.js_name, @@ -427,6 +457,7 @@ fn shared_struct<'a>(s: &'a ast::Struct, intern: &'a Interner) -> Struct<'a> { fields: s .fields .iter() + .filter(|f| !f.is_parent) .map(|s| shared_struct_field(s, intern)) .collect(), comments: s.comments.iter().map(|s| &**s).collect(), @@ -437,6 +468,11 @@ fn shared_struct<'a>(s: &'a ast::Struct, intern: &'a Interner) -> Struct<'a> { .as_ref() .map(|ns| ns.iter().map(|s| &**s).collect()), private: s.private, + extends: s + .extends + .as_ref() + .and_then(|p| p.segments.last()) + .map(|seg| intern.intern_str(&seg.ident.to_string())), } } diff --git a/wasm-bindgen-macro-support-0.2.118/src/error.rs b/wasm-bindgen-macro-support-0.2.121/src/error.rs similarity index 100% rename from wasm-bindgen-macro-support-0.2.118/src/error.rs rename to wasm-bindgen-macro-support-0.2.121/src/error.rs diff --git a/wasm-bindgen-macro-support-0.2.118/src/generics.rs b/wasm-bindgen-macro-support-0.2.121/src/generics.rs similarity index 75% rename from wasm-bindgen-macro-support-0.2.118/src/generics.rs rename to wasm-bindgen-macro-support-0.2.121/src/generics.rs index 9ca549ad23..9024b25953 100644 --- a/wasm-bindgen-macro-support-0.2.118/src/generics.rs +++ b/wasm-bindgen-macro-support-0.2.121/src/generics.rs @@ -316,6 +316,140 @@ pub(crate) fn used_generic_params<'a>( used_params } +/// Checks whether every occurrence of each ident in `generic_names` that appears +/// anywhere inside `args` is in a *structurally constraining* position — +/// i.e. a position from which rustc can read the parameter off of the +/// constructed type. This mirrors the E0207 rule for type parameters on +/// `impl` blocks: a parameter must appear in `Self` (or a trait ref) in a +/// structurally determined slot, otherwise Rust can't infer it at use sites. +/// +/// Constraining positions (for a param appearing somewhere inside): +/// - Bare: `T` +/// - As a type argument of a nominal path `Foo<..., T, ...>` (recursive) +/// - Under references, arrays, slices, tuples, parens (recursive) +/// +/// Non-constraining positions: +/// - Under a QSelf / projection: `::X` or `T::X` +/// - Inside a `fn(T) -> U` / `dyn Fn(T)` / `impl Fn(T)` — function-pointer +/// and trait-object / `impl Trait` slots do not constrain. +/// - Inside an associated-type binding's RHS (those project through the +/// outer trait, so they are not injective). +/// +/// Returns `true` if the args are safe to hoist (all occurrences constraining, +/// or no occurrences at all), `false` if any occurrence is non-constraining. +pub(crate) fn args_are_constraining_for( + args: &syn::punctuated::Punctuated, + generic_names: &[&Ident], +) -> bool { + for arg in args { + match arg { + syn::GenericArgument::Type(ty) if !type_is_constraining(ty, generic_names) => { + return false; + } + // Associated type bindings (`Trait`) project through the + // outer trait, so any fn generics inside the RHS are behind a + // projection — not constraining. + syn::GenericArgument::AssocType(binding) + if type_mentions_any(&binding.ty, generic_names) => + { + return false; + } + // Anything else (lifetimes, consts, already-constraining types, + // future arg kinds) doesn't disqualify the args. + _ => {} + } + } + true +} + +/// A type is "constraining" for the fn generics it contains iff every +/// occurrence of any `generic_names` ident within it is in a constraining +/// position. See [`args_are_constraining_for`] for the rules. +fn type_is_constraining(ty: &syn::Type, generic_names: &[&Ident]) -> bool { + match ty { + syn::Type::Path(type_path) => { + // QSelf -> projection like `::Assoc`. Any fn generic + // appearing anywhere inside is behind a projection. + if type_path.qself.is_some() { + return !type_mentions_any(ty, generic_names); + } + + // Bare `T` where T is a fn generic: constraining. + if type_path.path.segments.len() == 1 { + let seg = &type_path.path.segments[0]; + if matches!(seg.arguments, syn::PathArguments::None) + && generic_names.contains(&&seg.ident) + { + return true; + } + } + + // `T::Foo...` (multi-segment path whose head is a fn generic) + // is a projection through the head's implicit trait — any fn + // generic inside is non-constraining. + if type_path.path.segments.len() > 1 { + if let Some(first) = type_path.path.segments.first() { + if generic_names.contains(&&first.ident) { + return !type_mentions_any(ty, generic_names); + } + } + } + + // Nominal path `Foo<..args..>`: recurse into the last segment's + // args. Leading segments (module path) don't carry generics that + // mention fn params. + for seg in &type_path.path.segments { + match &seg.arguments { + syn::PathArguments::None => {} + syn::PathArguments::AngleBracketed(a) => { + if !args_are_constraining_for(&a.args, generic_names) { + return false; + } + } + syn::PathArguments::Parenthesized(p) => { + // `Fn(T) -> U` sugar: function-pointer-like, + // non-constraining. + for input in &p.inputs { + if type_mentions_any(input, generic_names) { + return false; + } + } + if let syn::ReturnType::Type(_, ret) = &p.output { + if type_mentions_any(ret, generic_names) { + return false; + } + } + } + } + } + true + } + syn::Type::Reference(r) => type_is_constraining(&r.elem, generic_names), + syn::Type::Array(a) => type_is_constraining(&a.elem, generic_names), + syn::Type::Slice(s) => type_is_constraining(&s.elem, generic_names), + syn::Type::Group(g) => type_is_constraining(&g.elem, generic_names), + syn::Type::Paren(p) => type_is_constraining(&p.elem, generic_names), + syn::Type::Tuple(t) => t + .elems + .iter() + .all(|e| type_is_constraining(e, generic_names)), + // Pointer / BareFn / TraitObject / ImplTrait / Infer / Never / Macro: + // any fn-generic mention here is non-constraining (fn-ptr, dyn, impl + // Trait are explicitly non-constraining per RFC 0447; the rest are + // handled conservatively). + _ => !type_mentions_any(ty, generic_names), + } +} + +/// Whether `ty` mentions any of the given idents anywhere (constraining or not). +fn type_mentions_any(ty: &syn::Type, generic_names: &[&Ident]) -> bool { + let vec: Vec<&Ident> = generic_names.to_vec(); + let mut found = BTreeSet::new(); + let mut visitor = GenericNameVisitor::new(&vec, &mut found); + visitor.visit_type(ty); + !found.is_empty() +} + /// Usage visitor for generic bounds pub(crate) fn generics_predicate_uses( predicate: &syn::WherePredicate, @@ -723,9 +857,9 @@ mod tests { let lifetime_a: syn::Lifetime = syn::parse_quote!('a); let lifetimes = [&lifetime_a]; - let ty: syn::Type = syn::parse_quote!(ImmediateClosure<'a, dyn FnMut(T) -> R>); + let ty: syn::Type = syn::parse_quote!(ScopedClosure<'a, dyn FnMut(T) -> R>); let result = crate::generics::staticize_lifetimes(ty, &lifetimes); - let expected: syn::Type = syn::parse_quote!(ImmediateClosure<'static, dyn FnMut(T) -> R>); + let expected: syn::Type = syn::parse_quote!(ScopedClosure<'static, dyn FnMut(T) -> R>); assert_eq!( quote::quote!(#result).to_string(), quote::quote!(#expected).to_string() @@ -779,12 +913,12 @@ mod tests { let lifetime_a: syn::Lifetime = syn::parse_quote!('a); let lifetimes_to_staticize = [&lifetime_a]; - // ImmediateClosure<'a, dyn FnMut(T)> -> ImmediateClosure<'static, dyn FnMut(JsValue)> - let ty: syn::Type = syn::parse_quote!(ImmediateClosure<'a, dyn FnMut(T)>); + // ScopedClosure<'a, dyn FnMut(T)> -> ScopedClosure<'static, dyn FnMut(JsValue)> + let ty: syn::Type = syn::parse_quote!(ScopedClosure<'a, dyn FnMut(T)>); let result = crate::generics::generic_to_concrete(ty, &generic_names, &lifetimes_to_staticize) .unwrap(); - let expected: syn::Type = syn::parse_quote!(ImmediateClosure<'static, dyn FnMut(JsValue)>); + let expected: syn::Type = syn::parse_quote!(ScopedClosure<'static, dyn FnMut(JsValue)>); assert_eq!( quote::quote!(#result).to_string(), quote::quote!(#expected).to_string() @@ -802,4 +936,96 @@ mod tests { quote::quote!(#expected).to_string() ); } + + /// Parse a type whose last path segment carries generic args and hand them + /// to `args_are_constraining_for`. This mirrors how `class_return_path()` + /// feeds the gate. + fn args_are_constraining(ty_src: &str, params: &[&str]) -> bool { + let ty: syn::Type = syn::parse_str(ty_src).expect("valid type"); + let path = match ty { + syn::Type::Path(syn::TypePath { qself: None, path }) => path, + _ => panic!("test helper expects a bare path type"), + }; + let seg = path.segments.last().expect("at least one segment"); + let args = match &seg.arguments { + syn::PathArguments::AngleBracketed(a) => a.args.clone(), + syn::PathArguments::None => Default::default(), + syn::PathArguments::Parenthesized(_) => { + panic!("test helper doesn't handle paren-style args at the top") + } + }; + let idents: Vec = params + .iter() + .map(|p| syn::Ident::new(p, proc_macro2::Span::call_site())) + .collect(); + let refs: Vec<&syn::Ident> = idents.iter().collect(); + crate::generics::args_are_constraining_for(&args, &refs) + } + + #[test] + fn hoist_gate_accepts_bare_idents() { + // `Array` — bare param, trivially constraining. + assert!(args_are_constraining("Array", &["T"])); + // Multiple bare params. + assert!(args_are_constraining("Map", &["K", "V"])); + } + + #[test] + fn hoist_gate_accepts_nested_nominal() { + // `Array>` — T is nested inside a nominal path, still + // constraining. This was wrongly rejected by the old bare-ident gate. + assert!(args_are_constraining("Array>", &["T"])); + // Deeply nested. + assert!(args_are_constraining("Array>>", &["T"])); + // References, arrays, tuples preserve constraining-ness. + assert!(args_are_constraining("Foo<&T>", &["T"])); + assert!(args_are_constraining("Foo<[T; 4]>", &["T"])); + assert!(args_are_constraining("Foo<(T, U)>", &["T", "U"])); + } + + #[test] + fn hoist_gate_accepts_when_param_absent() { + // T doesn't appear at all → nothing to hoist → vacuously safe. + assert!(args_are_constraining("Array", &["T"])); + assert!(args_are_constraining("Promise", &["T"])); + } + + #[test] + fn hoist_gate_rejects_qself_projection() { + // `Promise<::Resolution>` — T only appears behind a + // projection, which is NOT constraining. This is the shape that + // produced E0207 before the fix. + assert!(!args_are_constraining( + "Promise<::Resolution>", + &["T"] + )); + } + + #[test] + fn hoist_gate_rejects_bare_projection() { + // `Array` — T appears as the head of a multi-segment path, + // which Rust resolves through an implicit projection. Non-constraining. + assert!(!args_are_constraining("Array", &["T"])); + // Even if U is constraining, T's non-constraining presence disqualifies + // the whole return path (partial hoisting would still be ill-formed). + assert!(!args_are_constraining("Foo", &["T", "U"])); + } + + #[test] + fn hoist_gate_rejects_fn_ptr_and_fn_sugar() { + // `fn(T) -> U` and `Fn(T) -> U` sugar are both non-constraining slots. + assert!(!args_are_constraining("Foo i32>", &["T"])); + assert!(!args_are_constraining("Foo i32>>", &["T"])); + // Return-position of the parenthesized sugar also counts. + assert!(!args_are_constraining("Foo T>>", &["T"])); + } + + #[test] + fn hoist_gate_rejects_assoc_type_binding_rhs() { + // `Trait` — T sits behind the outer trait's projection. + assert!(!args_are_constraining( + "Foo>>", + &["T"] + )); + } } diff --git a/wasm-bindgen-macro-support-0.2.118/src/hash.rs b/wasm-bindgen-macro-support-0.2.121/src/hash.rs similarity index 100% rename from wasm-bindgen-macro-support-0.2.118/src/hash.rs rename to wasm-bindgen-macro-support-0.2.121/src/hash.rs diff --git a/wasm-bindgen-macro-support-0.2.118/src/lib.rs b/wasm-bindgen-macro-support-0.2.121/src/lib.rs similarity index 86% rename from wasm-bindgen-macro-support-0.2.118/src/lib.rs rename to wasm-bindgen-macro-support-0.2.121/src/lib.rs index 4e32ccb4ea..6bc38043ca 100644 --- a/wasm-bindgen-macro-support-0.2.118/src/lib.rs +++ b/wasm-bindgen-macro-support-0.2.121/src/lib.rs @@ -29,13 +29,22 @@ pub fn expand(attr: TokenStream, input: TokenStream) -> Result(input)?; - if let syn::Item::Struct(s) = item { + if let syn::Item::Struct(mut s) = item { let opts: BindgenAttrs = syn::parse2(attr.clone())?; let wasm_bindgen = opts .wasm_bindgen() .cloned() .unwrap_or_else(|| syn::parse_quote! { ::wasm_bindgen }); + // Inject `parent: ::Parent` when the struct + // declares `#[wasm_bindgen(extends = Parent)]`, so users never write + // the field themselves. Also rejects user-declared `Parent` fields. + let extends_path = opts.attrs.iter().find_map(|(_, a)| match a { + parser::BindgenAttr::Extends(_, path) => Some(path.clone()), + _ => None, + }); + parser::inject_parent_field(&mut s, extends_path.as_ref(), &wasm_bindgen)?; + let item = quote! { #[derive(#wasm_bindgen::__rt::BindgenedStruct)] #[wasm_bindgen(#attr)] @@ -127,6 +136,7 @@ struct ClassMarker { js_class: String, wasm_bindgen: syn::Path, wasm_bindgen_futures: syn::Path, + js_sys: syn::Path, } impl Parse for ClassMarker { @@ -141,6 +151,7 @@ impl Parse for ClassMarker { let mut wasm_bindgen = None; let mut wasm_bindgen_futures = None; + let mut js_sys = None; loop { if input.parse::>()?.is_some() { @@ -166,10 +177,17 @@ impl Parse for ClassMarker { input.parse::()?; wasm_bindgen_futures = Some(input.parse::()?); + } else if ident == "js_sys" { + if js_sys.is_some() { + return Err(syn::Error::new(ident.span(), "found duplicate `js_sys`")); + } + + input.parse::()?; + js_sys = Some(input.parse::()?); } else { return Err(syn::Error::new( ident.span(), - "expected `wasm_bindgen` or `wasm_bindgen_futures`", + "expected `wasm_bindgen`, `wasm_bindgen_futures`, or `js_sys`", )); } } else { @@ -183,6 +201,7 @@ impl Parse for ClassMarker { wasm_bindgen: wasm_bindgen.unwrap_or_else(|| syn::parse_quote! { wasm_bindgen }), wasm_bindgen_futures: wasm_bindgen_futures .unwrap_or_else(|| syn::parse_quote! { wasm_bindgen_futures }), + js_sys: js_sys.unwrap_or_else(|| syn::parse_quote! { js_sys }), }) } } diff --git a/wasm-bindgen-macro-support-0.2.118/src/parser.rs b/wasm-bindgen-macro-support-0.2.121/src/parser.rs similarity index 78% rename from wasm-bindgen-macro-support-0.2.118/src/parser.rs rename to wasm-bindgen-macro-support-0.2.121/src/parser.rs index c55596ee04..6798e34dc6 100644 --- a/wasm-bindgen-macro-support-0.2.118/src/parser.rs +++ b/wasm-bindgen-macro-support-0.2.121/src/parser.rs @@ -99,18 +99,21 @@ macro_rules! attrgen { (no_deref, false, NoDeref(Span)), (no_upcast, false, NoUpcast(Span)), (no_promising, false, NoPromising(Span)), + (no_into_js_generic, false, NoIntoJsGeneric(Span)), (vendor_prefix, false, VendorPrefix(Span, Ident)), (variadic, false, Variadic(Span)), (typescript_custom_section, false, TypescriptCustomSection(Span)), (skip_typescript, false, SkipTypescript(Span)), (skip_jsdoc, false, SkipJsDoc(Span)), (private, false, Hide(Span)), + (fallback, false, Fallback(Span)), (main, false, Main(Span)), (start, false, Start(Span)), (wasm_bindgen, false, WasmBindgen(Span, syn::Path)), (js_sys, false, JsSys(Span, syn::Path)), (wasm_bindgen_futures, false, WasmBindgenFutures(Span, syn::Path)), (skip, false, Skip(Span)), + (slice_to_array, false, SliceToArray(Span)), (typescript_type, false, TypeScriptType(Span, String, Span)), (getter_with_clone, false, GetterWithClone(Span)), (static_string, false, StaticString(Span)), @@ -244,7 +247,7 @@ impl BindgenAttrs { .map(|a| a.0); let pos = match pos { Some(i) => i, - None => return Ok(ret), + None => break, }; let attr = attrs.remove(pos); let tokens = match attr.meta { @@ -262,6 +265,17 @@ impl BindgenAttrs { ret.attrs.append(&mut attrs.attrs); attrs.check_used(); } + // Validate the shape of any computed-key (`[Symbol.]`) value + // appearing in `js_name`. Position-specific rejection (e.g. on + // structs) happens later at the convert sites; here we only enforce + // the global shape so that an unrelated attribute typo is reported at + // the value's span. + for (_, attr) in &ret.attrs { + if let BindgenAttr::JsName(_, value, span) = attr { + validate_computed_key("js_name", value, *span)?; + } + } + Ok(ret) } fn get_thread_local(&self) -> Result, Diagnostic> { @@ -281,6 +295,21 @@ impl BindgenAttrs { Ok(thread_local) } + /// Like [`Self::js_name`], but rejects computed-key (`[Symbol.]`) + /// values with a position-specific error message. Used by syntactic + /// positions that don't make sense as a JS-side symbol property + /// (structs, enums, types, statics, free functions, function args). + fn js_name_no_symbol(&self, position: &str) -> Result, Diagnostic> { + match self.js_name() { + Some((value, span)) if is_computed_key(value) => Err(Diagnostic::span_error( + span, + format!("{position} do not support symbols in js_name"), + )), + Some((value, _)) => Ok(Some(value)), + None => Ok(None), + } + } + attrgen!(methods); } @@ -345,7 +374,17 @@ impl Parse for BindgenAttr { (@parser $variant:ident(Span, Ident)) => ({ input.parse::()?; - let ident = input.parse::()?.0; + // Accept either a bare ident or a string literal containing one. + // The string-literal form lets `rustfmt` format the surrounding + // attribute, since rustfmt only handles `name = ` arms. + let ident = if input.peek(syn::LitStr) { + let litstr = input.parse::()?; + syn::parse_str::(&litstr.value()).map_err(|e| { + syn::Error::new(litstr.span(), format!("expected an identifier: {e}")) + })? + } else { + input.parse::()?.0 + }; return Ok(BindgenAttr::$variant(attr_span, ident)) }); @@ -365,7 +404,18 @@ impl Parse for BindgenAttr { (@parser $variant:ident(Span, syn::Path)) => ({ input.parse::()?; - return Ok(BindgenAttr::$variant(attr_span, input.parse()?)); + // Accept either a bare path or a string literal containing one. + // The string-literal form lets `rustfmt` format the surrounding + // attribute, since rustfmt only handles `name = ` arms. + let path = if input.peek(syn::LitStr) { + let litstr = input.parse::()?; + syn::parse_str::(&litstr.value()).map_err(|e| { + syn::Error::new(litstr.span(), format!("expected a path: {e}")) + })? + } else { + input.parse()? + }; + return Ok(BindgenAttr::$variant(attr_span, path)); }); (@parser $variant:ident(Span, syn::Expr)) => ({ @@ -440,6 +490,37 @@ impl Parse for BindgenAttr { } } +/// Returns whether `name` is a computed-property-key form, i.e. it +/// starts with `[` and ends with `]`. The renderer treats such names +/// as a JS expression to splice in directly (e.g. `[Symbol.iterator]`). +pub(crate) fn is_computed_key(name: &str) -> bool { + let bytes = name.as_bytes(); + bytes.len() >= 2 && bytes[0] == b'[' && bytes[bytes.len() - 1] == b']' +} + +/// Validate a string-literal value used in `js_name`. If it looks like a +/// computed key (`[...]`) we require it to be of the form +/// `[Symbol.]`. Plain identifier-shaped or dotted-path values are +/// passed through unchanged. +fn validate_computed_key(attr: &str, value: &str, span: Span) -> Result<(), Diagnostic> { + if !is_computed_key(value) { + return Ok(()); + } + let inner = &value[1..value.len() - 1]; + let symbol_name = inner.strip_prefix("Symbol."); + let ok = symbol_name + .map(|n| !n.is_empty() && n.chars().all(|c| c.is_ascii_alphanumeric() || c == '_')) + .unwrap_or(false); + if ok { + Ok(()) + } else { + Err(Diagnostic::span_error( + span, + format!("the only computed-key form supported in `{attr}` is `\"[Symbol.]\"`"), + )) + } +} + struct AnyIdent(Ident); impl Parse for AnyIdent { @@ -480,10 +561,37 @@ impl ConvertToAst<&ast::Program> for &mut syn::ItemStruct { // the `wasm_bindgen` option has been used before let _ = attrs.wasm_bindgen(); + // Collect any `extends = Path` attributes on the struct. For Rust + // exports we only support a single parent in this first pass, and + // we reject self-extends (`extends = Foo` on `struct Foo`) — the + // injected `parent: Parent` field is infinitely-sized at the + // type level, and the emitted JS would be `class Foo extends Foo` + // which fails at module load with a TDZ ReferenceError. + let mut extends: Option = None; + for (used, attr) in attrs.attrs.iter() { + if let BindgenAttr::Extends(span, path) = attr { + if extends.is_some() { + return Err(Diagnostic::span_error( + *span, + "`extends` may only be specified once on an exported struct", + )); + } + if path.is_ident(&self.ident) || path.is_ident("Self") { + return Err(Diagnostic::span_error( + *span, + "`extends = Self` (or naming the same struct) is not allowed; \ + a class cannot inherit from itself", + )); + } + extends = Some(path.clone()); + used.set(true); + } + } + let mut fields = Vec::new(); let js_name = attrs - .js_name() - .map(|s| s.0.to_string()) + .js_name_no_symbol("structs with #[wasm_bindgen]")? + .map(|s| s.to_string()) .unwrap_or(self.ident.unraw().to_string()); if is_js_keyword(&js_name) && js_name != "default" { bail_span!( @@ -497,23 +605,35 @@ impl ConvertToAst<&ast::Program> for &mut syn::ItemStruct { let getter_with_clone = attrs.getter_with_clone(); let js_namespace = attrs.js_namespace().map(|(ns, _)| ns.0); let qualified_name = wasm_bindgen_shared::qualified_name(js_namespace.as_deref(), &js_name); + let mut parent_count = 0usize; for (i, field) in self.fields.iter_mut().enumerate() { - match field.vis { - syn::Visibility::Public(..) => {} - _ => continue, + let field_attrs = BindgenAttrs::find(&mut field.attrs)?; + // The parent field is identified purely by its type being + // `Parent` — no dedicated attribute is required. The inner + // `T` is verified by the Rust type checker when the upcast + // helper is compiled. + let is_parent = is_parent_wrapper_type(&field.ty); + if is_parent { + parent_count += 1; + } + + let is_public = matches!(field.vis, syn::Visibility::Public(..)); + if !is_public && !is_parent { + field_attrs.check_used(); + continue; } + let (js_field_name, member) = match &field.ident { Some(ident) => (ident.unraw().to_string(), syn::Member::Named(ident.clone())), None => (i.to_string(), syn::Member::Unnamed(i.into())), }; - let attrs = BindgenAttrs::find(&mut field.attrs)?; - if attrs.skip().is_some() { - attrs.check_used(); + if field_attrs.skip().is_some() && !is_parent { + field_attrs.check_used(); continue; } - let js_field_name = match attrs.js_name() { + let js_field_name = match field_attrs.js_name() { Some((name, _)) => name.to_string(), None => js_field_name, }; @@ -526,18 +646,40 @@ impl ConvertToAst<&ast::Program> for &mut syn::ItemStruct { rust_name: member, js_name: js_field_name, struct_name: self.ident.clone(), - readonly: attrs.readonly().is_some(), + readonly: field_attrs.readonly().is_some(), ty: field.ty.clone(), getter: Ident::new(&getter, Span::call_site()), setter: Ident::new(&setter, Span::call_site()), comments, - generate_typescript: attrs.skip_typescript().is_none(), - generate_jsdoc: attrs.skip_jsdoc().is_none(), - getter_with_clone: attrs.getter_with_clone().or(getter_with_clone).copied(), + generate_typescript: field_attrs.skip_typescript().is_none(), + generate_jsdoc: field_attrs.skip_jsdoc().is_none(), + getter_with_clone: field_attrs + .getter_with_clone() + .or(getter_with_clone) + .copied(), + is_parent, wasm_bindgen: program.wasm_bindgen.clone(), }); - attrs.check_used(); + field_attrs.check_used(); + } + + // The `parent: Parent` field is injected by `inject_parent_field` + // before the struct reaches this point, so a struct with `extends` + // should always have exactly one `Parent` field. A struct without + // `extends` can never have one — `inject_parent_field` rejects + // user-declared `Parent` fields. + match (&extends, parent_count) { + (Some(_), 1) => {} + (None, 0) => {} + _ => { + return Err(Diagnostic::span_error( + self.ident.span(), + "internal error: inconsistent Parent field state; \ + this should have been caught by inject_parent_field", + )); + } } + let generate_typescript = attrs.skip_typescript().is_none(); let private = attrs.private().is_some(); let comments: Vec = extract_doc_comments(&self.attrs); @@ -552,6 +694,7 @@ impl ConvertToAst<&ast::Program> for &mut syn::ItemStruct { generate_typescript, private, js_namespace, + extends, wasm_bindgen: program.wasm_bindgen.clone(), }) } @@ -565,6 +708,157 @@ fn get_ty(mut ty: &syn::Type) -> &syn::Type { ty } +/// Injects a hidden `parent: ::Parent` field into +/// a struct that declares `#[wasm_bindgen(extends = ParentType)]`, and +/// rejects any user-declared `Parent` field on any struct — the macro +/// owns that field. +/// +/// Called from the macro entry point before the struct tokens are re-emitted, +/// so downstream type-checking sees the injected field. +pub fn inject_parent_field( + s: &mut syn::ItemStruct, + extends_path: Option<&syn::Path>, + wasm_bindgen: &syn::Path, +) -> Result<(), Diagnostic> { + for field in s.fields.iter() { + if is_parent_wrapper_type(&field.ty) { + let path_str = path_to_string(field_type_path(&field.ty)); + let msg = if extends_path.is_some() { + format!( + "do not declare a `{path_str}` field; the \ + `#[wasm_bindgen(extends = ...)]` macro injects \ + `parent: wasm_bindgen::Parent<...>` automatically" + ) + } else { + format!( + "`{path_str}` looks like `wasm_bindgen::Parent`, \ + which is reserved for the \ + `#[wasm_bindgen(extends = ...)]` macro. If you intended \ + a different `Parent` type, qualify it (e.g. \ + `my_crate::tree::Parent`) so this check skips it." + ) + }; + bail_span!(&field.ty, "{}", msg); + } + } + + let Some(parent_path) = extends_path else { + return Ok(()); + }; + + for field in s.fields.iter() { + if let Some(ident) = &field.ident { + if ident == "parent" { + bail_span!( + ident, + "struct with `#[wasm_bindgen(extends = ...)]` cannot \ + have a field named `parent`; the macro injects one" + ); + } + } + } + + let injected: syn::Field = syn::parse_quote! { + parent: #wasm_bindgen::Parent<#parent_path> + }; + + match &mut s.fields { + syn::Fields::Named(named) => { + named.named.insert(0, injected); + } + syn::Fields::Unit => { + let mut named = syn::FieldsNamed { + brace_token: Default::default(), + named: syn::punctuated::Punctuated::new(), + }; + named.named.push(injected); + s.fields = syn::Fields::Named(named); + s.semi_token = None; + } + syn::Fields::Unnamed(_) => { + bail_span!( + &s.ident, + "tuple structs cannot use `#[wasm_bindgen(extends = ...)]`; \ + use a named-field struct" + ); + } + } + + Ok(()) +} + +/// Returns true if `ty` looks like `wasm_bindgen::Parent`. We can't +/// fully resolve paths at macro-expansion time, so we accept a small set +/// of unambiguous spellings that name `wasm_bindgen::Parent`: +/// +/// * `Parent` — the unqualified form (assumes the user has imported it, +/// or hasn't defined a different type with the same name in scope). +/// * `wasm_bindgen::Parent` and `::wasm_bindgen::Parent` — the +/// canonical fully-qualified spellings. +/// * `crate::Parent` — re-export from the crate root, plausible only +/// in user crates that re-export `wasm_bindgen::Parent`. +/// +/// This is intentionally conservative: a user with their own +/// `my_crate::tree::Parent` field is left alone. +fn is_parent_wrapper_type(ty: &syn::Type) -> bool { + let path = match field_type_path(ty) { + Some(p) => p, + None => return false, + }; + let last = match path.segments.last() { + Some(seg) => seg, + None => return false, + }; + if last.ident != "Parent" { + return false; + } + let one_type_arg = match &last.arguments { + syn::PathArguments::AngleBracketed(args) => { + args.args + .iter() + .filter(|a| matches!(a, syn::GenericArgument::Type(_))) + .count() + == 1 + } + _ => false, + }; + if !one_type_arg { + return false; + } + // Match only the unambiguous spellings that name wasm_bindgen::Parent. + let segs: Vec = path.segments.iter().map(|s| s.ident.to_string()).collect(); + let leading_colon = path.leading_colon.is_some(); + match (leading_colon, segs.as_slice()) { + (false, [only]) if only == "Parent" => true, + (false, [first, last]) if first == "wasm_bindgen" && last == "Parent" => true, + (true, [first, last]) if first == "wasm_bindgen" && last == "Parent" => true, + (false, [first, last]) if first == "crate" && last == "Parent" => true, + _ => false, + } +} + +/// Extract the path of a `Type::Path`, peeling off any leading groups. +fn field_type_path(ty: &syn::Type) -> Option<&syn::Path> { + match get_ty(ty) { + syn::Type::Path(p) => Some(&p.path), + _ => None, + } +} + +/// Stringify a path's segment idents (without generic args) for diagnostics. +fn path_to_string(path: Option<&syn::Path>) -> String { + let Some(path) = path else { + return String::from(""); + }; + let mut out = String::new(); + if path.leading_colon.is_some() { + out.push_str("::"); + } + let segs: Vec = path.segments.iter().map(|s| s.ident.to_string()).collect(); + out.push_str(&segs.join("::")); + out +} + fn get_expr(mut expr: &syn::Expr) -> &syn::Expr { while let syn::Expr::Group(g) = expr { expr = &g.expr; @@ -573,15 +867,32 @@ fn get_expr(mut expr: &syn::Expr) -> &syn::Expr { expr } -impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option)> - for syn::ForeignItemFn +impl<'a> + ConvertToAst<( + &ast::Program, + BindgenAttrs, + &'a Option, + bool, + )> for syn::ForeignItemFn { type Target = ast::ImportKind; fn convert( - self, - (program, opts, module): (&ast::Program, BindgenAttrs, &'a Option), + mut self, + (program, opts, module, block_slice_to_array): ( + &ast::Program, + BindgenAttrs, + &'a Option, + bool, + ), ) -> Result { + // `slice_to_array` is inherited from the enclosing `extern "C"` + // block, optionally OR'd with a fn-level attribute, which then + // applies to every `&[T]` / `Option<&[T]>` argument unless an + // individual arg overrides it via its own attribute (the + // attribute is additive — you can only opt in, not out). + let fn_slice_to_array = block_slice_to_array || opts.slice_to_array().is_some(); + let args_attrs = extract_args_attrs(&mut self.sig, fn_slice_to_array)?; let (mut wasm, _) = function_from_decl( &self.sig.ident, &opts, @@ -589,7 +900,7 @@ impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option bail_span!(class_ty, "first argument of method must be a path"), }; - let class_name_str = js_class - .map(Ok) - .unwrap_or_else(|| extract_path_ident(class_name, true).map(|i| i.to_string()))?; + let class_name_str = js_class.map(Ok).unwrap_or_else(|| { + extract_path_ident(class_name, true).map(|i| i.unraw().to_string()) + })?; ast::ImportFunctionKind::Method { class: class_name_str, @@ -651,7 +962,7 @@ impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option for syn::ForeignItemType { (program, attrs): (&ast::Program, BindgenAttrs), ) -> Result { let js_name = attrs - .js_name() - .map(|s| s.0) - .map_or_else(|| self.ident.to_string(), |s| s.to_string()); + .js_name_no_symbol("extern types with #[wasm_bindgen]")? + .map_or_else(|| self.ident.unraw().to_string(), |s| s.to_string()); let typescript_type = attrs.typescript_type().map(|s| s.0.to_string()); let is_type_of = attrs.is_type_of().cloned(); - let shim = format!( - "__wbg_instanceof_{}_{}", - self.ident, - ShortHash((attrs.js_namespace().map(|(ns, _)| ns.0), &self.ident)) - ); + let unraw_ident = self.ident.unraw(); + let hash = ShortHash((attrs.js_namespace().map(|(ns, _)| ns.0), &unraw_ident)); + let shim = format!("__wbg_instanceof_{unraw_ident}_{hash}"); let mut extends = Vec::new(); let mut vendor_prefixes = Vec::new(); let no_deref = attrs.no_deref().is_some(); let no_upcast = attrs.no_upcast().is_some(); let no_promising = attrs.no_promising().is_some(); + let no_into_js_generic = attrs.no_into_js_generic().is_some(); for (used, attr) in attrs.attrs.iter() { match attr { BindgenAttr::Extends(_, e) => { @@ -870,6 +1180,7 @@ impl ConvertToAst<(&ast::Program, BindgenAttrs)> for syn::ForeignItemType { no_deref, no_upcast, no_promising, + no_into_js_generic, wasm_bindgen: program.wasm_bindgen.clone(), generics: generics.unwrap_or(self.generics), })) @@ -896,17 +1207,14 @@ impl<'a> ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option ConvertToAst<(&ast::Program, BindgenAttrs, &'a Option "set_", @@ -1231,6 +1547,7 @@ fn function_from_decl( js_type: attrs.js_type, optional: attrs.optional, desc: attrs.desc, + slice_to_array: attrs.slice_to_array, }) .collect(), }, @@ -1245,10 +1562,21 @@ struct FnArgAttrs { js_type: Option, optional: bool, desc: Option, + /// When set, an `&[T]` (or `Option<&[T]>`) argument is converted to a + /// freshly-allocated buffer that JS receives as a plain `Array` rather + /// than a typed array (for primitive element kinds). The wire format + /// matches `Vec` (ownership transferred + freed by JS) but the + /// JS-visible type is always a plain `Array`. + slice_to_array: bool, } -/// Extracts function arguments attributes -fn extract_args_attrs(sig: &mut syn::Signature) -> Result, Diagnostic> { +/// Extracts function arguments attributes. `default_slice_to_array` is the +/// inherited flag from the enclosing function / `extern "C"` block; per-arg +/// `#[wasm_bindgen(slice_to_array)]` ORs on top of it. +fn extract_args_attrs( + sig: &mut syn::Signature, + default_slice_to_array: bool, +) -> Result, Diagnostic> { let mut args_attrs = vec![]; let mut seen_optional: Option = None; for input in sig.inputs.iter_mut() { @@ -1324,6 +1652,12 @@ fn extract_args_attrs(sig: &mut syn::Signature) -> Result, Diagn js_name: attrs .js_name() .map_or(Ok(None), |(js_name_override, span)| { + if is_computed_key(js_name_override) { + return Err(Diagnostic::span_error( + span, + "function arguments do not support symbols in js_name", + )); + } if is_js_keyword(js_name_override) || !is_valid_ident(js_name_override) { return Err(Diagnostic::span_error(span, "invalid JS identifier")); } @@ -1337,6 +1671,7 @@ fn extract_args_attrs(sig: &mut syn::Signature) -> Result, Diagn check_js_comment_close(description, span)?; Ok(Some(description.to_string())) })?, + slice_to_array: default_slice_to_array || attrs.slice_to_array().is_some(), }; // throw error for any unused attrs attrs.enforce_used()?; @@ -1386,8 +1721,9 @@ impl<'a> MacroParse<(Option, &'a mut TokenStream)> for syn::Item { if let Some((i, _)) = no_mangle { f.attrs.remove(i); } - // extract fn args attributes before parsing to tokens stream - let args_attrs = extract_args_attrs(&mut f.sig)?; + // extract fn args attributes before parsing to tokens stream; + // `slice_to_array` is irrelevant for exported free functions. + let args_attrs = extract_args_attrs(&mut f.sig, false)?; let comments = extract_doc_comments(&f.attrs); // If the function isn't used for anything other than being exported to JS, // it'll be unused when not building for the Wasm target and produce a @@ -1437,6 +1773,7 @@ impl<'a> MacroParse<(Option, &'a mut TokenStream)> for syn::Item { start, wasm_bindgen: program.wasm_bindgen.clone(), wasm_bindgen_futures: program.wasm_bindgen_futures.clone(), + js_sys: program.js_sys.clone(), }); } syn::Item::Impl(mut i) => { @@ -1565,17 +1902,18 @@ fn prepare_for_impl_recursion( let js_class = impl_opts .js_class() .map(|s| s.0.to_string()) - .unwrap_or(ident.to_string()); + .unwrap_or(ident.unraw().to_string()); let wasm_bindgen = &program.wasm_bindgen; let wasm_bindgen_futures = &program.wasm_bindgen_futures; + let js_sys = &program.js_sys; method.attrs.insert( 0, syn::Attribute { pound_token: Default::default(), style: syn::AttrStyle::Outer, bracket_token: Default::default(), - meta: syn::parse_quote! { #wasm_bindgen::prelude::__wasm_bindgen_class_marker(#class = #js_class, wasm_bindgen = #wasm_bindgen, wasm_bindgen_futures = #wasm_bindgen_futures) }, + meta: syn::parse_quote! { #wasm_bindgen::prelude::__wasm_bindgen_class_marker(#class = #js_class, wasm_bindgen = #wasm_bindgen, wasm_bindgen_futures = #wasm_bindgen_futures, js_sys = #js_sys) }, }, ); @@ -1591,10 +1929,12 @@ impl MacroParse<&ClassMarker> for &mut syn::ImplItemFn { js_class, wasm_bindgen, wasm_bindgen_futures, + js_sys, }: &ClassMarker, ) -> Result<(), Diagnostic> { program.wasm_bindgen = wasm_bindgen.clone(); program.wasm_bindgen_futures = wasm_bindgen_futures.clone(); + program.js_sys = js_sys.clone(); match self.vis { syn::Visibility::Public(_) => {} @@ -1621,7 +1961,10 @@ impl MacroParse<&ClassMarker> for &mut syn::ImplItemFn { } let comments = extract_doc_comments(&self.attrs); - let args_attrs: Vec = extract_args_attrs(&mut self.sig)?; + // `slice_to_array` is meaningless on exported impl-block methods (the + // attribute only changes the outgoing-argument codegen for imported + // functions), so we always pass `false` here. + let args_attrs: Vec = extract_args_attrs(&mut self.sig, false)?; let (function, method_self) = function_from_decl( &self.sig.ident, &opts, @@ -1660,6 +2003,7 @@ impl MacroParse<&ClassMarker> for &mut syn::ImplItemFn { start: ast::StartKind::None, wasm_bindgen: program.wasm_bindgen.clone(), wasm_bindgen_futures: program.wasm_bindgen_futures.clone(), + js_sys: program.js_sys.clone(), }); opts.check_used(); Ok(()) @@ -1671,6 +2015,7 @@ fn string_enum( program: &mut ast::Program, js_name: String, generate_typescript: bool, + private: bool, comments: Vec, js_namespace: Option>, ) -> Result<(), Diagnostic> { @@ -1712,6 +2057,7 @@ fn string_enum( comments, rust_attrs: enum_.attrs, generate_typescript, + private, js_namespace, wasm_bindgen: program.wasm_bindgen.clone(), }), @@ -1720,6 +2066,87 @@ fn string_enum( Ok(()) } +fn dynamic_union( + enum_: syn::ItemEnum, + program: &mut ast::Program, + js_name: String, + generate_typescript: bool, + private: bool, + fallback: bool, + comments: Vec, +) -> Result<(), Diagnostic> { + let mut variants = vec![]; + let mut variant_values = vec![]; + let mut variant_fields = vec![]; + + for v in enum_.variants.iter() { + // Check if this is a fallback variant (has fields) + match &v.fields { + syn::Fields::Unit => { + // Regular string enum variant - must have a discriminant + let (_, expr) = match &v.discriminant { + Some(pair) => pair, + None => { + bail_span!( + v, + "all unit variants of a string enum must have a string value" + ); + } + }; + match get_expr(expr) { + syn::Expr::Lit(syn::ExprLit { + attrs: _, + lit: syn::Lit::Str(str_lit), + }) => { + variants.push(v.ident.clone()); + variant_values.push(str_lit.value()); + variant_fields.push(Vec::new()); + } + expr => bail_span!( + expr, + "enums with #[wasm_bindgen] cannot mix string and non-string values", + ), + } + } + syn::Fields::Unnamed(fields) if fields.unnamed.len() == 1 => { + // Fallback variant - add it with an empty string value and the field type + // (we'll handle this specially in codegen) + variants.push(v.ident.clone()); + variant_values.push(String::new()); + variant_fields.push(vec![fields.unnamed.first().unwrap().ty.clone()]); + } + _ => { + bail_span!( + v.fields, + "string enum variants with fields must have exactly one unnamed field" + ); + } + } + } + + program.imports.push(ast::Import { + module: None, + js_namespace: None, + reexport: None, + kind: ast::ImportKind::DynamicUnion(ast::DynamicUnion { + vis: enum_.vis, + name: enum_.ident, + js_name, + variants, + variant_values, + variant_fields, + comments, + rust_attrs: enum_.attrs, + generate_typescript, + private, + fallback, + wasm_bindgen: program.wasm_bindgen.clone(), + }), + }); + + Ok(()) +} + /// Represents a possibly negative numeric value as base 10 digits. struct NumericValue<'a> { negative: bool, @@ -1769,23 +2196,14 @@ impl<'a> MacroParse<(&'a mut TokenStream, BindgenAttrs)> for syn::ItemEnum { if self.variants.is_empty() { bail_span!(self, "cannot export empty enums to JS"); } - for variant in self.variants.iter() { - match variant.fields { - syn::Fields::Unit => (), - _ => bail_span!( - variant.fields, - "enum variants with associated data are not supported with #[wasm_bindgen]" - ), - } - } let generate_typescript = opts.skip_typescript().is_none(); let private = opts.private().is_some(); + let fallback = opts.fallback().is_some(); let comments = extract_doc_comments(&self.attrs); let js_name = opts - .js_name() - .map(|s| s.0) - .map_or_else(|| self.ident.to_string(), |s| s.to_string()); + .js_name_no_symbol("enums with #[wasm_bindgen]")? + .map_or_else(|| self.ident.unraw().to_string(), |s| s.to_string()); if is_js_keyword(&js_name) && js_name != "default" { bail_span!( self.ident, @@ -1797,6 +2215,44 @@ impl<'a> MacroParse<(&'a mut TokenStream, BindgenAttrs)> for syn::ItemEnum { let js_namespace = opts.js_namespace().map(|(ns, _)| ns.0); opts.check_used(); + // Check if the enum is a dynamic union, based on having singular unnamed variants + let mut has_unnamed_fields = false; + for variant in self.variants.iter() { + match &variant.fields { + syn::Fields::Unit => (), // Unit variants are always allowed + syn::Fields::Unnamed(fields) if fields.unnamed.len() == 1 => { + has_unnamed_fields = true; + } + syn::Fields::Unnamed(_) => bail_span!( + variant.fields, + "enum variants with fields must have exactly one unnamed field" + ), + syn::Fields::Named(_) => { + bail_span!(variant.fields, "enum variants cannot have named fields") + } + } + } + if has_unnamed_fields { + return dynamic_union( + self, + program, + js_name, + generate_typescript, + private, + fallback, + comments, + ); + } + + // The `fallback` attribute only applies to dynamic unions. + if fallback { + bail_span!( + self, + "the `fallback` attribute is only supported on dynamic unions \ + (enums with at least one tuple variant)" + ); + } + // Check if the enum is a string enum, by checking whether any variant has a string discriminant. let is_string_enum = self.variants.iter().any(|v| { if let Some((_, expr)) = &v.discriminant { @@ -1816,6 +2272,7 @@ impl<'a> MacroParse<(&'a mut TokenStream, BindgenAttrs)> for syn::ItemEnum { program, js_name, generate_typescript, + private, comments, js_namespace, ); @@ -1903,7 +2360,8 @@ impl<'a> MacroParse<(&'a mut TokenStream, BindgenAttrs)> for syn::ItemEnum { let comments = extract_doc_comments(&v.attrs); Ok(ast::Variant { - name: v.ident.clone(), + rust_name: v.ident.clone(), + js_name: v.ident.unraw().to_string(), // due to the above checks, we know that the value fits // within 32 bits, so this cast doesn't lose any information value: value as u32, @@ -1974,10 +2432,12 @@ impl MacroParse for syn::ItemForeignMod { let module = module_from_opts(program, &opts) .map_err(|e| errors.push(e)) .unwrap_or_default(); + let slice_to_array = opts.slice_to_array().is_some(); for item in self.items.into_iter() { let ctx = ForeignItemCtx { module: module.clone(), js_namespace: js_namespace.clone(), + slice_to_array, }; if let Err(e) = item.macro_parse(program, ctx) { errors.push(e); @@ -1992,6 +2452,10 @@ impl MacroParse for syn::ItemForeignMod { struct ForeignItemCtx { module: Option, js_namespace: Option, + /// Block-level `slice_to_array` flag inherited by every foreign + /// function inside the `extern "C"` block. Per-fn / per-arg + /// `slice_to_array` ORs on top of this. + slice_to_array: bool, } impl MacroParse for syn::ForeignItem { @@ -2032,10 +2496,36 @@ impl MacroParse for syn::ForeignItem { .or(ctx.js_namespace) .map(|s| s.0); let module = ctx.module; + let block_slice_to_array = ctx.slice_to_array; let reexport = item_opts.reexport().cloned(); + // Symbol-form `js_name` on a free imported function only makes sense + // when there is a containing `js_namespace`, because the macro emits + // accesses like `[Symbol.]`. Without a namespace there + // is no object to read the symbol-keyed property off, so reject early + // with a position-specific error. + if let syn::ForeignItem::Fn(_) = &self { + let is_method_like = item_opts.method().is_some() + || item_opts.constructor().is_some() + || item_opts.static_method_of().is_some() + || item_opts.getter().is_some() + || item_opts.setter().is_some(); + if !is_method_like && js_namespace.is_none() { + if let Some((value, span)) = item_opts.js_name() { + if is_computed_key(value) { + return Err(Diagnostic::span_error( + span, + "free imported functions do not support symbols in js_name unless a js_namespace is specified", + )); + } + } + } + } + let kind = match self { - syn::ForeignItem::Fn(f) => f.convert((program, item_opts, &module))?, + syn::ForeignItem::Fn(f) => { + f.convert((program, item_opts, &module, block_slice_to_array))? + } syn::ForeignItem::Type(t) => t.convert((program, item_opts))?, syn::ForeignItem::Static(s) => s.convert((program, item_opts, &module))?, _ => panic!("only foreign functions/types allowed for now"), @@ -2085,6 +2575,9 @@ impl MacroParse for syn::ForeignItem { ast::ImportKind::Enum(_) => { // string enums aren't possible here } + ast::ImportKind::DynamicUnion(_) => { + // dynamic unions aren't possible here + } } } @@ -2439,12 +2932,18 @@ fn main(program: &ast::Program, mut f: ItemFn, tokens: &mut TokenStream) -> Resu let wasm_bindgen = &program.wasm_bindgen; let wasm_bindgen_futures = &program.wasm_bindgen_futures; + let js_sys = &program.js_sys; + let futures = if ast::use_js_sys_futures() { + quote::quote! { #js_sys::futures } + } else { + quote::quote! { #wasm_bindgen_futures } + }; if f.sig.asyncness.take().is_some() { *f.block = syn::parse2(quote::quote! { { async fn __wasm_bindgen_generated_main() #r#return #body - #wasm_bindgen_futures::spawn_local( + #futures::spawn_local( async move { use #wasm_bindgen::__rt::Main; let __ret = __wasm_bindgen_generated_main(); diff --git a/wasm-bindgen-shared-0.2.118/.cargo-checksum.json b/wasm-bindgen-shared-0.2.118/.cargo-checksum.json deleted file mode 100644 index 95f370fda7..0000000000 --- a/wasm-bindgen-shared-0.2.118/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{".cargo_vcs_info.json":"d672c79bafd4e6b9d69e4c62ac6fa5144c0405fb0f77290caf6c49e51e8b5a0c","Cargo.lock":"120b877a1d8fc2feccf78289458f81112a2ecb649cfe606789be4a597d08b15a","Cargo.toml":"840d79184df77f0dc81030a6d29e23afe1f5f7767561d2df4099113e5f63aea3","Cargo.toml.orig":"315e1e90b9b4dca45dcd2dc6fdedcff010a81d80ca12cccdf4889267656eee6a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","build.rs":"cc562769f4d55da465e081bb3187502bab20beb4704f22cc7d07be5ba4b765ae","src/identifier.rs":"05ce1e3dbaaa2c5a9be7ab66ccb11c924c46c75df214fa7477aed9b35152b10f","src/lib.rs":"5ce5b880c2912bc82cbc6399548d40777d701d6cea5960a845a8560399c893b1","src/schema_hash_approval.rs":"9e8a741e5f3214aaf9471ce71cbe4e65d411303dbd24740e8a982df2512060ad","src/tys.rs":"5c770fca9243824c822e2ea3412b65381ab9eb3ae199bca802cebc3b376cefd8"},"package":"5fd04d9e306f1907bd13c6361b5c6bfc7b3b3c095ed3f8a9246390f8dbdee129"} \ No newline at end of file diff --git a/wasm-bindgen-shared-0.2.118/.cargo_vcs_info.json b/wasm-bindgen-shared-0.2.118/.cargo_vcs_info.json deleted file mode 100644 index 04403b0446..0000000000 --- a/wasm-bindgen-shared-0.2.118/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "753bb7ff4de2a00e30d2c6b56ee8e06a9e527f01" - }, - "path_in_vcs": "crates/shared" -} \ No newline at end of file diff --git a/wasm-bindgen-shared-0.2.121/.cargo-checksum.json b/wasm-bindgen-shared-0.2.121/.cargo-checksum.json new file mode 100644 index 0000000000..16fd4fe600 --- /dev/null +++ b/wasm-bindgen-shared-0.2.121/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"37c3bf3ef6425a208fe0ed4901f3361008141dd6d08f4612c1f52b8c856baa26","Cargo.lock":"c87115aebf668e584c1ca944b73e07c42433bec25d0e949b3409f7e66aadb2cc","Cargo.toml":"ee31c03b4067dd82143377ddd1155c295570344aab5dc01743c7c624e7a58faf","Cargo.toml.orig":"258b4309afa4a5a54a4e59d1a389d24d2a9107ed3f5a0f01af6532bdb1e40411","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","build.rs":"cc562769f4d55da465e081bb3187502bab20beb4704f22cc7d07be5ba4b765ae","src/identifier.rs":"05ce1e3dbaaa2c5a9be7ab66ccb11c924c46c75df214fa7477aed9b35152b10f","src/lib.rs":"00540b0b91ee085a492823b76eedb72bf3ecd693ceac63c977548d8beb1edea7","src/schema_hash_approval.rs":"5d3491451b32c09585ffc1045149addb3e44e9015bfb0ed08353a3b900ea376a","src/tys.rs":"35d93e50402556c531a6c205618f78da2eb15c4b7877a39f636de667c1fb58ea"},"package":"c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441"} \ No newline at end of file diff --git a/wasm-bindgen-shared-0.2.121/.cargo_vcs_info.json b/wasm-bindgen-shared-0.2.121/.cargo_vcs_info.json new file mode 100644 index 0000000000..f62a229eec --- /dev/null +++ b/wasm-bindgen-shared-0.2.121/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "49457f2db4465688cb597e9030ccfdefbd2b662e" + }, + "path_in_vcs": "crates/shared" +} \ No newline at end of file diff --git a/wasm-bindgen-shared-0.2.118/Cargo.lock b/wasm-bindgen-shared-0.2.121/Cargo.lock similarity index 95% rename from wasm-bindgen-shared-0.2.118/Cargo.lock rename to wasm-bindgen-shared-0.2.121/Cargo.lock index cbefc17245..05b1fa40fd 100644 --- a/wasm-bindgen-shared-0.2.118/Cargo.lock +++ b/wasm-bindgen-shared-0.2.121/Cargo.lock @@ -10,7 +10,7 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.121" dependencies = [ "unicode-ident", ] diff --git a/wasm-bindgen-shared-0.2.118/Cargo.toml b/wasm-bindgen-shared-0.2.121/Cargo.toml similarity index 96% rename from wasm-bindgen-shared-0.2.118/Cargo.toml rename to wasm-bindgen-shared-0.2.121/Cargo.toml index df80b81de5..9eadc25e24 100644 --- a/wasm-bindgen-shared-0.2.118/Cargo.toml +++ b/wasm-bindgen-shared-0.2.121/Cargo.toml @@ -13,7 +13,7 @@ edition = "2021" rust-version = "1.77" name = "wasm-bindgen-shared" -version = "0.2.118" +version = "0.2.121" authors = ["The wasm-bindgen Developers"] build = "build.rs" links = "wasm_bindgen" @@ -60,5 +60,6 @@ level = "warn" priority = 0 check-cfg = [ "cfg(wasm_bindgen_unstable_test_coverage)", + "cfg(wasm_bindgen_use_js_sys)", "cfg(xxx_debug_only_print_generated_code)", ] diff --git a/wasm-bindgen-shared-0.2.118/Cargo.toml.orig b/wasm-bindgen-shared-0.2.121/Cargo.toml.orig similarity index 97% rename from wasm-bindgen-shared-0.2.118/Cargo.toml.orig rename to wasm-bindgen-shared-0.2.121/Cargo.toml.orig index 5f222e7bbf..fdc57f2434 100644 --- a/wasm-bindgen-shared-0.2.118/Cargo.toml.orig +++ b/wasm-bindgen-shared-0.2.121/Cargo.toml.orig @@ -12,7 +12,7 @@ license = "MIT OR Apache-2.0" name = "wasm-bindgen-shared" repository = "https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/shared" rust-version = "1.77" -version = "0.2.118" +version = "0.2.121" # Because only a single `wasm_bindgen` version can be used in a dependency # graph, pretend we link a native library so that `cargo` will provide better diff --git a/wasm-encoder-0.247.0/LICENSE-APACHE b/wasm-bindgen-shared-0.2.121/LICENSE-APACHE similarity index 100% rename from wasm-encoder-0.247.0/LICENSE-APACHE rename to wasm-bindgen-shared-0.2.121/LICENSE-APACHE diff --git a/wasm-bindgen-shared-0.2.118/LICENSE-MIT b/wasm-bindgen-shared-0.2.121/LICENSE-MIT similarity index 100% rename from wasm-bindgen-shared-0.2.118/LICENSE-MIT rename to wasm-bindgen-shared-0.2.121/LICENSE-MIT diff --git a/wasm-bindgen-shared-0.2.118/build.rs b/wasm-bindgen-shared-0.2.121/build.rs similarity index 100% rename from wasm-bindgen-shared-0.2.118/build.rs rename to wasm-bindgen-shared-0.2.121/build.rs diff --git a/wasm-bindgen-shared-0.2.118/src/identifier.rs b/wasm-bindgen-shared-0.2.121/src/identifier.rs similarity index 100% rename from wasm-bindgen-shared-0.2.118/src/identifier.rs rename to wasm-bindgen-shared-0.2.121/src/identifier.rs diff --git a/wasm-bindgen-shared-0.2.118/src/lib.rs b/wasm-bindgen-shared-0.2.121/src/lib.rs similarity index 76% rename from wasm-bindgen-shared-0.2.118/src/lib.rs rename to wasm-bindgen-shared-0.2.121/src/lib.rs index 299fe18f9d..2b0f6242b8 100644 --- a/wasm-bindgen-shared-0.2.118/src/lib.rs +++ b/wasm-bindgen-shared-0.2.121/src/lib.rs @@ -13,7 +13,7 @@ pub mod tys; // This gets changed whenever our schema changes. // At this time versions of wasm-bindgen and wasm-bindgen-cli are required to have the exact same // SCHEMA_VERSION in order to work together. -pub const SCHEMA_VERSION: &str = "0.2.118"; +pub const SCHEMA_VERSION: &str = "0.2.121"; #[macro_export] macro_rules! shared_api { @@ -61,6 +61,7 @@ macro_rules! shared_api { String(ImportString<'a>), Type(ImportType<'a>), Enum(StringEnum<'a>), + DynamicUnion(DynamicUnion<'a>), } struct ImportFunction<'a> { @@ -119,6 +120,7 @@ macro_rules! shared_api { variant_values: Vec<&'a str>, comments: Vec<&'a str>, generate_typescript: bool, + private: bool, js_namespace: Option>, } @@ -128,6 +130,17 @@ macro_rules! shared_api { Private, } + struct DynamicUnion<'a> { + name: &'a str, + variant_strings: Vec<&'a str>, + variant_type_cnt: u32, + comments: Vec<&'a str>, + generate_typescript: bool, + private: bool, + fallback: bool, + } + + struct Export<'a> { class: Option<&'a str>, comments: Vec<&'a str>, @@ -181,6 +194,7 @@ macro_rules! shared_api { generate_typescript: bool, js_namespace: Option>, private: bool, + extends: Option<&'a str>, } struct StructField<'a> { @@ -242,8 +256,46 @@ pub fn unwrap_function(struct_name: &str) -> String { name } +/// Convert a JS-side name into a form suitable as a wasm-side export +/// symbol suffix. Plain identifier names pass through unchanged. The +/// bracket form `"[Symbol.]"` collapses to `Symbol_`. Any +/// other non-alphanumeric characters are replaced with `_` so that the +/// result is always a valid C identifier suffix. +fn export_name_suffix(name: &str) -> alloc::borrow::Cow<'_, str> { + if name.bytes().all(|b| b.is_ascii_alphanumeric() || b == b'_') { + return alloc::borrow::Cow::Borrowed(name); + } + let mut out = String::with_capacity(name.len()); + for c in name.chars() { + if c.is_ascii_alphanumeric() || c == '_' { + out.push(c); + } else if c == '.' || c == '[' || c == ']' { + // Bracket / dotted forms collapse cleanly; we represent + // `[Symbol.iterator]` as `Symbol_iterator` (the `[` and `]` + // drop, the `.` becomes `_`). + if c == '.' { + out.push('_'); + } + } else { + out.push('_'); + } + } + alloc::borrow::Cow::Owned(out) +} + +/// Symbol name of the wasm export that upcasts a `*const WasmRefCell` +/// pointer to a cloned `Rc>` raw pointer. Used by the +/// macro codegen and by cli-support's JS emission to call each other. +pub fn upcast_function(child_struct: &str, parent_struct: &str) -> String { + let mut name = "__wbg_upcast_".to_string(); + name.extend(child_struct.chars().flat_map(|s| s.to_lowercase())); + name.push_str("_to_"); + name.extend(parent_struct.chars().flat_map(|s| s.to_lowercase())); + name +} + pub fn free_function_export_name(function_name: &str) -> String { - function_name.to_string() + export_name_suffix(function_name).into_owned() } pub fn struct_function_export_name(struct_: &str, f: &str) -> String { @@ -252,7 +304,7 @@ pub fn struct_function_export_name(struct_: &str, f: &str) -> String { .flat_map(|s| s.to_lowercase()) .collect::(); name.push('_'); - name.push_str(f); + name.push_str(&export_name_suffix(f)); name } @@ -260,7 +312,7 @@ pub fn struct_field_get(struct_: &str, f: &str) -> String { let mut name = String::from("__wbg_get_"); name.extend(struct_.chars().flat_map(|s| s.to_lowercase())); name.push('_'); - name.push_str(f); + name.push_str(&export_name_suffix(f)); name } @@ -268,7 +320,15 @@ pub fn struct_field_set(struct_: &str, f: &str) -> String { let mut name = String::from("__wbg_set_"); name.extend(struct_.chars().flat_map(|s| s.to_lowercase())); name.push('_'); - name.push_str(f); + name.push_str(&export_name_suffix(f)); + name +} + +pub fn dynamic_union_variant(union_name: &str, variant_idx: u32) -> String { + let mut name = String::from("__wbg_dynamic_union_"); + name.extend(union_name.chars().flat_map(|s| s.to_lowercase())); + name.push('_'); + name.push_str(&variant_idx.to_string()); name } diff --git a/wasm-bindgen-shared-0.2.118/src/schema_hash_approval.rs b/wasm-bindgen-shared-0.2.121/src/schema_hash_approval.rs similarity index 89% rename from wasm-bindgen-shared-0.2.118/src/schema_hash_approval.rs rename to wasm-bindgen-shared-0.2.121/src/schema_hash_approval.rs index aa33eb2066..58508b1466 100644 --- a/wasm-bindgen-shared-0.2.118/src/schema_hash_approval.rs +++ b/wasm-bindgen-shared-0.2.121/src/schema_hash_approval.rs @@ -8,7 +8,7 @@ // If the schema in this library has changed then: // 1. Bump the version in `crates/shared/Cargo.toml` // 2. Change the `SCHEMA_VERSION` in this library to this new Cargo.toml version -const APPROVED_SCHEMA_FILE_HASH: &str = "5165210117105331182"; +const APPROVED_SCHEMA_FILE_HASH: &str = "18105850795781353992"; #[test] fn schema_version() { diff --git a/wasm-bindgen-shared-0.2.118/src/tys.rs b/wasm-bindgen-shared-0.2.121/src/tys.rs similarity index 89% rename from wasm-bindgen-shared-0.2.118/src/tys.rs rename to wasm-bindgen-shared-0.2.121/src/tys.rs index 7708393f46..70265fd92e 100644 --- a/wasm-bindgen-shared-0.2.118/src/tys.rs +++ b/wasm-bindgen-shared-0.2.121/src/tys.rs @@ -16,6 +16,8 @@ tys! { U32 I64 U64 + I64_AS_F64 + U64_AS_F64 I128 U128 F32 @@ -34,6 +36,7 @@ tys! { NAMED_EXTERNREF ENUM STRING_ENUM + DYNAMIC_UNION RUST_STRUCT CHAR OPTIONAL @@ -41,4 +44,5 @@ tys! { UNIT CLAMPED NONNULL + RAW_POINTER } diff --git a/wasm-encoder-0.247.0/.cargo-checksum.json b/wasm-encoder-0.249.0/.cargo-checksum.json similarity index 71% rename from wasm-encoder-0.247.0/.cargo-checksum.json rename to wasm-encoder-0.249.0/.cargo-checksum.json index a991b773b7..42f5ec45c5 100644 --- a/wasm-encoder-0.247.0/.cargo-checksum.json +++ b/wasm-encoder-0.249.0/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo_vcs_info.json":"af50edbbcaaa810445832442f340842f1791ea72cc9f7dfde59a1fde644642f6","Cargo.lock":"d0947a4b7e2a802cf87a829f46343c98051f50c386480a007b33fc44fe8d5191","Cargo.toml":"7ed58278447510b9225bcca72008ec1453678d196391e25ef9558223e0bd5576","Cargo.toml.orig":"cbc7701481816ad7d94b36c1045b98e26d4253c78ba70a3a94143d7d0ecbb129","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c65cc523cd46516311fca22c82284fa0979a4638aa1cb7a02268856f43a017a8","src/component.rs":"992de8b4a14190f0a7d65aca8de28a37207fadb31a55e90e4e1bc4565eb38e08","src/component/aliases.rs":"686100ebe50004fecfc0d99467bea4ea28a222d683eb1b746653fd334dbac92e","src/component/builder.rs":"4fcd459e0f483ea5452075de545a3f0647661e159e6c66e1bdf3dc1e76286e8b","src/component/canonicals.rs":"03764bb3e61fe0e9c8f0dd421011a23b3931bd02b991b59b32540f95306bfcb1","src/component/components.rs":"8f21463b58cf06246085a055c363c4aca58a896e6b3cf2e4bc9ee4198b31fa8f","src/component/exports.rs":"de627907c12170a0f54e3ef9907a5d852ccff597f6a0bd6efe625714c2be09a6","src/component/imports.rs":"c6aac83b734faa352ab9b1cd6ce6f4f7e3ee66cdb545892f74eff8f4d4d9e401","src/component/instances.rs":"a88158647c3563f5a59e3797c493549622f737cd4b28f34bdd055afebe22f9ad","src/component/modules.rs":"2b5aa5add7b0e0c3f792cd48a2e7e5f9b145bd7330f7b4ba8b3f3af2205e4f9b","src/component/names.rs":"3ae30371d6434730b3e7fe62bc0401c6ea4770d29194dfd2d03751ce02038f14","src/component/start.rs":"adcb7a8ec26f7a29caf474c2657ea7bfa40e53cccfe517e91b804e4bee7a8089","src/component/types.rs":"577c3c8330479d19c6af602a4b6fff142202b6874be6a1e812df902a8bc03f00","src/core.rs":"f160cb63ebfc932b754ac1b053af9979911f27837b31e2983635a60a9eb8db2c","src/core/branch_hints.rs":"cf897a5e852e7d54456bad08fa4b0cfb4ce22d3ffd81bea966d3babe1ead0d1b","src/core/code.rs":"954fa01871419398aab015d3383e693246242dcc06f68d57238653e916c7d2d1","src/core/custom.rs":"0b890bf723b1c36666a91c81dcc038d97accd3a144ebb376f8fccafbd9245390","src/core/data.rs":"daddfd16fc4d48a1e7e30a45692beb35605b5e7dfc5cc6a0cf8a3c4af6186f4b","src/core/dump.rs":"bb1c9eb1a30ff30124c96a3b30aa6aaf84e35c52d22fc69395313cf234d7ae78","src/core/elements.rs":"af86d9753c7b6a99ee6f8fa14d6c30e8d70d4c66ea8c767571409b9f17281b6c","src/core/exports.rs":"0192d49fe212a49c49c7f30f7e33d05223ce86e36a12f5eccbc9559e56613f46","src/core/functions.rs":"b709633764dab1da900afe888f63a246fe86951314ab61c676d5c62c4eebe38f","src/core/globals.rs":"52096365d4985be9fd7f296ea423933529b43028179d923eb8dfe3cd96ae9a87","src/core/imports.rs":"2dfce6578ecc9c799bc9a0b965323316f3b19d335ce1aed528bfc47a8ece4abd","src/core/instructions.rs":"d44d9d7af3c3a72f15d40023e15c1ef3ee416a8018f126ff5c0ecf4cb4dd5ac2","src/core/linking.rs":"ef62831b6464f66cc6fdb2cf4f104bb61d734b51deac0c00dedf259b9b9f4ac0","src/core/memories.rs":"fff08289128ed99164d1460d245d32636f575218e4d95723ea1872c4472b925d","src/core/names.rs":"c97127ccbf52d0046fecd429e69276a87125339a2f07492555f5c2e28e59b5f1","src/core/producers.rs":"4ce134f6eed15eb319df777c7e2f9ed5a5e5868c32a84bf8229110aceaf6f80b","src/core/start.rs":"58968f4ddfc2b3ded079838df394d450075a261eb76f43c0c54ac15e33e7fe21","src/core/tables.rs":"5d3524f539cb03f555485dc4da7b44bf61aeb19d9b15fcb96d365d01266e2b3e","src/core/tags.rs":"29d18182f4ed035b2f2f0a2390ff0c2d51e434250cbcff062a3cf8b40c27ba13","src/core/types.rs":"fc4ecc8a10f0e1d45c4184d2bd0316db60afbccf02874e931126866f4ef3f62a","src/lib.rs":"71a1f77f892a29fb5fbf7fad48415b76cad0c4c9b815de234f797ed2555a43fb","src/raw.rs":"5813a426bcef495f89c4744e0cca1fe20db3150998ce591d7b3c01dc30ca9e13","src/reencode.rs":"342fe89b6bbadd5fceb223ddcd1da33330a9b39a8a052bdcaaa8a537228bc074","src/reencode/component.rs":"f243d5d627b93f9abbf9f4764b1502b5e8e70d1e50bc2a1fb336d16217e3a37e"},"package":"30b6733b8b91d010a6ac5b0fb237dc46a19650bc4c67db66857e2e787d437204"} \ No newline at end of file +{"files":{".cargo_vcs_info.json":"7bcd5951a1daab4acf68864396680d191c4e6e4ba7a4a3af54e8521e8bf71969","Cargo.lock":"fa89bd8c13931a92c70ebb30aa3b4abba6b93c2038180eaa2587381869148dee","Cargo.toml":"e8db222afb6ff9c0ac30260572aee1549274ed38020c1c11fc6e9cf6db966407","Cargo.toml.orig":"cbc7701481816ad7d94b36c1045b98e26d4253c78ba70a3a94143d7d0ecbb129","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"c65cc523cd46516311fca22c82284fa0979a4638aa1cb7a02268856f43a017a8","src/component.rs":"992de8b4a14190f0a7d65aca8de28a37207fadb31a55e90e4e1bc4565eb38e08","src/component/aliases.rs":"686100ebe50004fecfc0d99467bea4ea28a222d683eb1b746653fd334dbac92e","src/component/builder.rs":"b2f7d42469908f64d35863cbd890e8648971974ecf906050f41a50da49eee062","src/component/canonicals.rs":"3be211d15407cb300daa5b80943cd00b5d8dd63513d3b521f99c8bfe37f69ecc","src/component/components.rs":"8f21463b58cf06246085a055c363c4aca58a896e6b3cf2e4bc9ee4198b31fa8f","src/component/exports.rs":"f4fa2b0692b652c65c5199e7d859033f6af1051558cd8160a566f6b356d85a59","src/component/imports.rs":"51b162076cb9e360aa023d57f260a9417e94df9ed9e2c48b8e654764f2147999","src/component/instances.rs":"59e98159b14cfd90ecb8bb7c7132272b4c3697ae64defee51d6d78ccdfa886c0","src/component/modules.rs":"2b5aa5add7b0e0c3f792cd48a2e7e5f9b145bd7330f7b4ba8b3f3af2205e4f9b","src/component/names.rs":"3ae30371d6434730b3e7fe62bc0401c6ea4770d29194dfd2d03751ce02038f14","src/component/start.rs":"adcb7a8ec26f7a29caf474c2657ea7bfa40e53cccfe517e91b804e4bee7a8089","src/component/types.rs":"03bd6a547674132e8f3ca6942bdc40a9539850543d4cd2c42d83d9aa4906dcb2","src/core.rs":"f160cb63ebfc932b754ac1b053af9979911f27837b31e2983635a60a9eb8db2c","src/core/branch_hints.rs":"cf897a5e852e7d54456bad08fa4b0cfb4ce22d3ffd81bea966d3babe1ead0d1b","src/core/code.rs":"954fa01871419398aab015d3383e693246242dcc06f68d57238653e916c7d2d1","src/core/custom.rs":"0b890bf723b1c36666a91c81dcc038d97accd3a144ebb376f8fccafbd9245390","src/core/data.rs":"daddfd16fc4d48a1e7e30a45692beb35605b5e7dfc5cc6a0cf8a3c4af6186f4b","src/core/dump.rs":"bb1c9eb1a30ff30124c96a3b30aa6aaf84e35c52d22fc69395313cf234d7ae78","src/core/elements.rs":"af86d9753c7b6a99ee6f8fa14d6c30e8d70d4c66ea8c767571409b9f17281b6c","src/core/exports.rs":"0192d49fe212a49c49c7f30f7e33d05223ce86e36a12f5eccbc9559e56613f46","src/core/functions.rs":"b709633764dab1da900afe888f63a246fe86951314ab61c676d5c62c4eebe38f","src/core/globals.rs":"52096365d4985be9fd7f296ea423933529b43028179d923eb8dfe3cd96ae9a87","src/core/imports.rs":"2dfce6578ecc9c799bc9a0b965323316f3b19d335ce1aed528bfc47a8ece4abd","src/core/instructions.rs":"d44d9d7af3c3a72f15d40023e15c1ef3ee416a8018f126ff5c0ecf4cb4dd5ac2","src/core/linking.rs":"ef62831b6464f66cc6fdb2cf4f104bb61d734b51deac0c00dedf259b9b9f4ac0","src/core/memories.rs":"fff08289128ed99164d1460d245d32636f575218e4d95723ea1872c4472b925d","src/core/names.rs":"c97127ccbf52d0046fecd429e69276a87125339a2f07492555f5c2e28e59b5f1","src/core/producers.rs":"4ce134f6eed15eb319df777c7e2f9ed5a5e5868c32a84bf8229110aceaf6f80b","src/core/start.rs":"58968f4ddfc2b3ded079838df394d450075a261eb76f43c0c54ac15e33e7fe21","src/core/tables.rs":"5d3524f539cb03f555485dc4da7b44bf61aeb19d9b15fcb96d365d01266e2b3e","src/core/tags.rs":"29d18182f4ed035b2f2f0a2390ff0c2d51e434250cbcff062a3cf8b40c27ba13","src/core/types.rs":"fc4ecc8a10f0e1d45c4184d2bd0316db60afbccf02874e931126866f4ef3f62a","src/lib.rs":"71a1f77f892a29fb5fbf7fad48415b76cad0c4c9b815de234f797ed2555a43fb","src/raw.rs":"5813a426bcef495f89c4744e0cca1fe20db3150998ce591d7b3c01dc30ca9e13","src/reencode.rs":"342fe89b6bbadd5fceb223ddcd1da33330a9b39a8a052bdcaaa8a537228bc074","src/reencode/component.rs":"6aae973ac984f35d8f8fc33552b35d5e2674f42d7361e177435ce9bbe2388bb2"},"package":"69830ccbbf41c55eb585991659fb70867ef628193af3a495f09a6956f7615e59"} \ No newline at end of file diff --git a/wasm-encoder-0.247.0/.cargo_vcs_info.json b/wasm-encoder-0.249.0/.cargo_vcs_info.json similarity index 51% rename from wasm-encoder-0.247.0/.cargo_vcs_info.json rename to wasm-encoder-0.249.0/.cargo_vcs_info.json index a75c6a3217..9a9d49e1ea 100644 --- a/wasm-encoder-0.247.0/.cargo_vcs_info.json +++ b/wasm-encoder-0.249.0/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "0285a4680738439cb884d2674bec8be1e8beac5c" + "sha1": "efeee7cafa5a3dcdddb5aab27bc0c05f279929ed" }, "path_in_vcs": "crates/wasm-encoder" } \ No newline at end of file diff --git a/wasm-encoder-0.247.0/Cargo.lock b/wasm-encoder-0.249.0/Cargo.lock similarity index 97% rename from wasm-encoder-0.247.0/Cargo.lock rename to wasm-encoder-0.249.0/Cargo.lock index a9d82b39b4..67491a6044 100644 --- a/wasm-encoder-0.247.0/Cargo.lock +++ b/wasm-encoder-0.249.0/Cargo.lock @@ -152,7 +152,7 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.247.0" +version = "0.249.0" dependencies = [ "anyhow", "leb128fmt", @@ -163,9 +163,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.247.0" +version = "0.249.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6fb4c2bee46c5ea4d40f8cdb5c131725cd976718ec56f1c8e82fbde5fa2a80" +checksum = "30538cae9a794215f490b532df01c557e2e2bfac92569482554acd0992a102ea" dependencies = [ "bitflags", "indexmap", @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "wasmprinter" -version = "0.247.0" +version = "0.249.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11b221eaf3943d2f562f022ccee3d8c631e144b41cb7c8850c24b437923ee64e" +checksum = "a4e227e800fc74c0d60117391f71d60e4c956333cfc3be796ae72d269002aa52" dependencies = [ "anyhow", "termcolor", diff --git a/wasm-encoder-0.247.0/Cargo.toml b/wasm-encoder-0.249.0/Cargo.toml similarity index 97% rename from wasm-encoder-0.247.0/Cargo.toml rename to wasm-encoder-0.249.0/Cargo.toml index e3586e69ec..5028db924b 100644 --- a/wasm-encoder-0.247.0/Cargo.toml +++ b/wasm-encoder-0.249.0/Cargo.toml @@ -10,10 +10,10 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2021" +edition = "2024" rust-version = "1.85.0" name = "wasm-encoder" -version = "0.247.0" +version = "0.249.0" authors = ["Nick Fitzgerald "] build = false autolib = false @@ -50,7 +50,7 @@ version = "0.1.0" default-features = false [dependencies.wasmparser] -version = "0.247.0" +version = "0.249.0" features = [ "simd", "simd", @@ -66,7 +66,7 @@ default-features = false version = "3.2.0" [dev-dependencies.wasmprinter] -version = "0.247.0" +version = "0.249.0" default-features = false [lints.clippy] diff --git a/wasm-encoder-0.247.0/Cargo.toml.orig b/wasm-encoder-0.249.0/Cargo.toml.orig similarity index 100% rename from wasm-encoder-0.247.0/Cargo.toml.orig rename to wasm-encoder-0.249.0/Cargo.toml.orig diff --git a/wasmparser-0.247.0/LICENSE-APACHE b/wasm-encoder-0.249.0/LICENSE-APACHE similarity index 100% rename from wasmparser-0.247.0/LICENSE-APACHE rename to wasm-encoder-0.249.0/LICENSE-APACHE diff --git a/wasm-encoder-0.247.0/LICENSE-Apache-2.0_WITH_LLVM-exception b/wasm-encoder-0.249.0/LICENSE-Apache-2.0_WITH_LLVM-exception similarity index 100% rename from wasm-encoder-0.247.0/LICENSE-Apache-2.0_WITH_LLVM-exception rename to wasm-encoder-0.249.0/LICENSE-Apache-2.0_WITH_LLVM-exception diff --git a/wasm-encoder-0.247.0/LICENSE-MIT b/wasm-encoder-0.249.0/LICENSE-MIT similarity index 100% rename from wasm-encoder-0.247.0/LICENSE-MIT rename to wasm-encoder-0.249.0/LICENSE-MIT diff --git a/wasm-encoder-0.247.0/README.md b/wasm-encoder-0.249.0/README.md similarity index 100% rename from wasm-encoder-0.247.0/README.md rename to wasm-encoder-0.249.0/README.md diff --git a/wasm-encoder-0.247.0/src/component.rs b/wasm-encoder-0.249.0/src/component.rs similarity index 100% rename from wasm-encoder-0.247.0/src/component.rs rename to wasm-encoder-0.249.0/src/component.rs diff --git a/wasm-encoder-0.247.0/src/component/aliases.rs b/wasm-encoder-0.249.0/src/component/aliases.rs similarity index 100% rename from wasm-encoder-0.247.0/src/component/aliases.rs rename to wasm-encoder-0.249.0/src/component/aliases.rs diff --git a/wasm-encoder-0.247.0/src/component/builder.rs b/wasm-encoder-0.249.0/src/component/builder.rs similarity index 96% rename from wasm-encoder-0.247.0/src/component/builder.rs rename to wasm-encoder-0.249.0/src/component/builder.rs index 9a4099d7f7..c971a2bd42 100644 --- a/wasm-encoder-0.247.0/src/component/builder.rs +++ b/wasm-encoder-0.249.0/src/component/builder.rs @@ -327,14 +327,19 @@ impl ComponentBuilder { } /// Imports a new item into this component with the `name` and `ty` specified. - pub fn import(&mut self, name: &str, ty: ComponentTypeRef) -> u32 { + pub fn import<'a>( + &mut self, + name: impl Into>, + ty: ComponentTypeRef, + ) -> u32 { + let name = name.into(); let ret = match &ty { - ComponentTypeRef::Instance(_) => self.instances.add(Some(name)), - ComponentTypeRef::Func(_) => self.funcs.add(Some(name)), - ComponentTypeRef::Type(..) => self.types.add(Some(name)), - ComponentTypeRef::Component(_) => self.components.add(Some(name)), - ComponentTypeRef::Module(_) => self.core_modules.add(Some(name)), - ComponentTypeRef::Value(_) => self.values.add(Some(name)), + ComponentTypeRef::Instance(_) => self.instances.add(Some(&name.name)), + ComponentTypeRef::Func(_) => self.funcs.add(Some(&name.name)), + ComponentTypeRef::Type(..) => self.types.add(Some(&name.name)), + ComponentTypeRef::Component(_) => self.components.add(Some(&name.name)), + ComponentTypeRef::Module(_) => self.core_modules.add(Some(&name.name)), + ComponentTypeRef::Value(_) => self.values.add(Some(&name.name)), }; self.imports().import(name, ty); ret @@ -345,15 +350,16 @@ impl ComponentBuilder { /// /// The `idx` is the item to export and the `ty` is an optional type to /// ascribe to the export. - pub fn export( + pub fn export<'a>( &mut self, - name: &str, + name: impl Into>, kind: ComponentExportKind, idx: u32, ty: Option, ) -> u32 { - self.exports().export(name, kind, idx, ty); - self.inc_kind(Some(name), kind) + let name = name.into(); + self.exports().export(name.clone(), kind, idx, ty); + self.inc_kind(Some(&name.name), kind) } /// Creates a new encoder for the next core type in this component. @@ -507,14 +513,14 @@ impl ComponentBuilder { } /// Declares a new `context.get` intrinsic. - pub fn context_get(&mut self, i: u32) -> u32 { - self.canonical_functions().context_get(i); + pub fn context_get(&mut self, ty: ValType, i: u32) -> u32 { + self.canonical_functions().context_get(ty, i); self.core_funcs.add(Some(&format!("context.get {i}"))) } /// Declares a new `context.set` intrinsic. - pub fn context_set(&mut self, i: u32) -> u32 { - self.canonical_functions().context_set(i); + pub fn context_set(&mut self, ty: ValType, i: u32) -> u32 { + self.canonical_functions().context_set(ty, i); self.core_funcs.add(Some(&format!("context.set {i}"))) } diff --git a/wasm-encoder-0.247.0/src/component/canonicals.rs b/wasm-encoder-0.249.0/src/component/canonicals.rs similarity index 97% rename from wasm-encoder-0.247.0/src/component/canonicals.rs rename to wasm-encoder-0.249.0/src/component/canonicals.rs index b2fed82933..1e89d9cd62 100644 --- a/wasm-encoder-0.247.0/src/component/canonicals.rs +++ b/wasm-encoder-0.249.0/src/component/canonicals.rs @@ -1,4 +1,6 @@ -use crate::{ComponentSection, ComponentSectionId, ComponentValType, Encode, encode_section}; +use crate::{ + ComponentSection, ComponentSectionId, ComponentValType, Encode, ValType, encode_section, +}; use alloc::vec::Vec; /// Represents options for canonical function definitions. @@ -234,19 +236,21 @@ impl CanonicalFunctionSection { self } - /// Defines a new `context.get` intrinsic of the ith slot. - pub fn context_get(&mut self, i: u32) -> &mut Self { + /// Defines a new `context.get` intrinsic of the ith slot with the given + /// value type. + pub fn context_get(&mut self, ty: ValType, i: u32) -> &mut Self { self.bytes.push(0x0a); - self.bytes.push(0x7f); + ty.encode(&mut self.bytes); i.encode(&mut self.bytes); self.num_added += 1; self } - /// Defines a new `context.set` intrinsic of the ith slot. - pub fn context_set(&mut self, i: u32) -> &mut Self { + /// Defines a new `context.set` intrinsic of the ith slot with the given + /// value type. + pub fn context_set(&mut self, ty: ValType, i: u32) -> &mut Self { self.bytes.push(0x0b); - self.bytes.push(0x7f); + ty.encode(&mut self.bytes); i.encode(&mut self.bytes); self.num_added += 1; self diff --git a/wasm-encoder-0.247.0/src/component/components.rs b/wasm-encoder-0.249.0/src/component/components.rs similarity index 100% rename from wasm-encoder-0.247.0/src/component/components.rs rename to wasm-encoder-0.249.0/src/component/components.rs diff --git a/wasm-encoder-0.247.0/src/component/exports.rs b/wasm-encoder-0.249.0/src/component/exports.rs similarity index 88% rename from wasm-encoder-0.247.0/src/component/exports.rs rename to wasm-encoder-0.249.0/src/component/exports.rs index ef4745bda7..a1333fa070 100644 --- a/wasm-encoder-0.247.0/src/component/exports.rs +++ b/wasm-encoder-0.249.0/src/component/exports.rs @@ -2,7 +2,10 @@ use super::{ COMPONENT_SORT, CORE_MODULE_SORT, CORE_SORT, FUNCTION_SORT, INSTANCE_SORT, TYPE_SORT, VALUE_SORT, }; -use crate::{ComponentSection, ComponentSectionId, ComponentTypeRef, Encode, encode_section}; +use crate::{ + ComponentExternName, ComponentSection, ComponentSectionId, ComponentTypeRef, Encode, + encode_section, +}; use alloc::vec::Vec; /// Represents the kind of an export from a WebAssembly component. @@ -87,14 +90,14 @@ impl ComponentExportSection { } /// Define an export in the export section. - pub fn export( + pub fn export<'a>( &mut self, - name: &str, + name: impl Into>, kind: ComponentExportKind, index: u32, ty: Option, ) -> &mut Self { - crate::encode_component_export_name(&mut self.bytes, name); + name.into().encode(&mut self.bytes); kind.encode(&mut self.bytes); index.encode(&mut self.bytes); match ty { @@ -122,9 +125,3 @@ impl ComponentSection for ComponentExportSection { ComponentSectionId::Export.into() } } - -/// For more information on this see `encode_component_import_name`. -pub(crate) fn encode_component_export_name(bytes: &mut Vec, name: &str) { - bytes.push(0x00); - name.encode(bytes); -} diff --git a/wasm-encoder-0.247.0/src/component/imports.rs b/wasm-encoder-0.249.0/src/component/imports.rs similarity index 58% rename from wasm-encoder-0.247.0/src/component/imports.rs rename to wasm-encoder-0.249.0/src/component/imports.rs index 4134ac5433..26adc807a4 100644 --- a/wasm-encoder-0.247.0/src/component/imports.rs +++ b/wasm-encoder-0.249.0/src/component/imports.rs @@ -2,6 +2,8 @@ use crate::{ ComponentExportKind, ComponentSection, ComponentSectionId, ComponentValType, Encode, encode_section, }; +use alloc::borrow::Cow; +use alloc::string::String; use alloc::vec::Vec; /// Represents the possible type bounds for type references. @@ -131,8 +133,12 @@ impl ComponentImportSection { } /// Define an import in the component import section. - pub fn import(&mut self, name: &str, ty: ComponentTypeRef) -> &mut Self { - encode_component_import_name(&mut self.bytes, name); + pub fn import<'a>( + &mut self, + name: impl Into>, + ty: ComponentTypeRef, + ) -> &mut Self { + name.into().encode(&mut self.bytes); ty.encode(&mut self.bytes); self.num_added += 1; self @@ -151,20 +157,91 @@ impl ComponentSection for ComponentImportSection { } } -/// Prior to WebAssembly/component-model#263 import and export names were -/// discriminated with a leading byte indicating what kind of import they are. -/// After that PR though names are always prefixed with a 0x00 byte. -/// -/// On 2023-10-28 in bytecodealliance/wasm-tools#1262 was landed to start -/// transitioning to "always lead with 0x00". That updated the validator/parser -/// to accept either 0x00 or 0x01 but the encoder wasn't updated at the time. -/// -/// On 2024-09-03 in bytecodealliance/wasm-tools#TODO this encoder was updated -/// to always emit 0x00 as a leading byte. -/// -/// This function corresponds with the `importname'` production in the -/// specification. -pub(crate) fn encode_component_import_name(bytes: &mut Vec, name: &str) { - bytes.push(0x00); - name.encode(bytes); +/// Full options for encoding a component name. +#[derive(Debug, Clone)] +pub struct ComponentExternName<'a> { + /// The name to encode. + pub name: Cow<'a, str>, + /// An optional `(implements ...)` directive (See 🏷️ in the component model + /// explainer). + pub implements: Option>, +} + +impl Encode for ComponentExternName<'_> { + fn encode(&self, bytes: &mut Vec) { + let mut options = Vec::new(); + + if let Some(s) = &self.implements { + options.push((0x00, s.as_bytes())); + } + + if options.is_empty() { + // Prior to WebAssembly/component-model#263 import and export names + // were discriminated with a leading byte indicating what kind of + // import they are. After that PR though names are always prefixed + // with a 0x00 byte. + // + // On 2023-10-28 in bytecodealliance/wasm-tools#1262 was landed to + // start transitioning to "always lead with 0x00". That updated the + // validator/parser to accept either 0x00 or 0x01 but the encoder + // wasn't updated at the time. + // + // On 2024-09-03 in bytecodealliance/wasm-tools#TODO this encoder + // was updated to always emit 0x00 as a leading byte. + // + // This corresponds with the `importname'` production in the + // specification. + bytes.push(0x00); + } else { + bytes.push(0x02); + } + + self.name.encode(bytes); + + if !options.is_empty() { + options.len().encode(bytes); + for (kind, val) in options { + bytes.push(kind); + val.encode(bytes); + } + } + } +} + +impl<'a> From<&'a str> for ComponentExternName<'a> { + fn from(name: &'a str) -> Self { + ComponentExternName { + name: Cow::Borrowed(name), + implements: None, + } + } +} + +impl<'a> From<&'a String> for ComponentExternName<'a> { + fn from(name: &'a String) -> Self { + ComponentExternName { + name: Cow::Borrowed(name), + implements: None, + } + } +} + +impl<'a> From for ComponentExternName<'a> { + fn from(name: String) -> Self { + ComponentExternName { + name: Cow::Owned(name), + implements: None, + } + } +} + +#[cfg(feature = "wasmparser")] +impl<'a> From> for ComponentExternName<'a> { + fn from(name: wasmparser::ComponentExternName<'a>) -> Self { + let wasmparser::ComponentExternName { name, implements } = name; + ComponentExternName { + name: name.into(), + implements: implements.map(|s| s.into()), + } + } } diff --git a/wasm-encoder-0.247.0/src/component/instances.rs b/wasm-encoder-0.249.0/src/component/instances.rs similarity index 93% rename from wasm-encoder-0.247.0/src/component/instances.rs rename to wasm-encoder-0.249.0/src/component/instances.rs index ac3aaf9b19..ced69db459 100644 --- a/wasm-encoder-0.247.0/src/component/instances.rs +++ b/wasm-encoder-0.249.0/src/component/instances.rs @@ -1,6 +1,7 @@ use super::CORE_INSTANCE_SORT; use crate::{ - ComponentExportKind, ComponentSection, ComponentSectionId, Encode, ExportKind, encode_section, + ComponentExportKind, ComponentExternName, ComponentSection, ComponentSectionId, Encode, + ExportKind, encode_section, }; use alloc::vec::Vec; @@ -169,16 +170,17 @@ impl ComponentInstanceSection { } /// Define an instance by exporting items. - pub fn export_items<'a, E>(&mut self, exports: E) -> &mut Self + pub fn export_items<'a, N, E>(&mut self, exports: E) -> &mut Self where - E: IntoIterator, + E: IntoIterator, E::IntoIter: ExactSizeIterator, + N: Into>, { let exports = exports.into_iter(); self.bytes.push(0x01); exports.len().encode(&mut self.bytes); for (name, kind, index) in exports { - crate::encode_component_export_name(&mut self.bytes, name); + name.into().encode(&mut self.bytes); kind.encode(&mut self.bytes); index.encode(&mut self.bytes); } diff --git a/wasm-encoder-0.247.0/src/component/modules.rs b/wasm-encoder-0.249.0/src/component/modules.rs similarity index 100% rename from wasm-encoder-0.247.0/src/component/modules.rs rename to wasm-encoder-0.249.0/src/component/modules.rs diff --git a/wasm-encoder-0.247.0/src/component/names.rs b/wasm-encoder-0.249.0/src/component/names.rs similarity index 100% rename from wasm-encoder-0.247.0/src/component/names.rs rename to wasm-encoder-0.249.0/src/component/names.rs diff --git a/wasm-encoder-0.247.0/src/component/start.rs b/wasm-encoder-0.249.0/src/component/start.rs similarity index 100% rename from wasm-encoder-0.247.0/src/component/start.rs rename to wasm-encoder-0.249.0/src/component/start.rs diff --git a/wasm-encoder-0.247.0/src/component/types.rs b/wasm-encoder-0.249.0/src/component/types.rs similarity index 96% rename from wasm-encoder-0.247.0/src/component/types.rs rename to wasm-encoder-0.249.0/src/component/types.rs index cda73d5a31..924336c3c1 100644 --- a/wasm-encoder-0.247.0/src/component/types.rs +++ b/wasm-encoder-0.249.0/src/component/types.rs @@ -1,7 +1,8 @@ use super::CORE_TYPE_SORT; use crate::{ - Alias, ComponentExportKind, ComponentOuterAliasKind, ComponentSection, ComponentSectionId, - ComponentTypeRef, CoreTypeEncoder, Encode, EntityType, ValType, encode_section, + Alias, ComponentExportKind, ComponentExternName, ComponentOuterAliasKind, ComponentSection, + ComponentSectionId, ComponentTypeRef, CoreTypeEncoder, Encode, EntityType, ValType, + encode_section, }; use alloc::vec::Vec; @@ -225,9 +226,13 @@ impl ComponentType { } /// Defines an import in this component type. - pub fn import(&mut self, name: &str, ty: ComponentTypeRef) -> &mut Self { + pub fn import<'a>( + &mut self, + name: impl Into>, + ty: ComponentTypeRef, + ) -> &mut Self { self.bytes.push(0x03); - crate::encode_component_import_name(&mut self.bytes, name); + name.into().encode(&mut self.bytes); ty.encode(&mut self.bytes); self.num_added += 1; match ty { @@ -239,9 +244,13 @@ impl ComponentType { } /// Defines an export in this component type. - pub fn export(&mut self, name: &str, ty: ComponentTypeRef) -> &mut Self { + pub fn export<'a>( + &mut self, + name: impl Into>, + ty: ComponentTypeRef, + ) -> &mut Self { self.bytes.push(0x04); - crate::encode_component_export_name(&mut self.bytes, name); + name.into().encode(&mut self.bytes); ty.encode(&mut self.bytes); self.num_added += 1; match ty { @@ -310,7 +319,11 @@ impl InstanceType { } /// Defines an export in this instance type. - pub fn export(&mut self, name: &str, ty: ComponentTypeRef) -> &mut Self { + pub fn export<'a>( + &mut self, + name: impl Into>, + ty: ComponentTypeRef, + ) -> &mut Self { self.0.export(name, ty); self } diff --git a/wasm-encoder-0.247.0/src/core.rs b/wasm-encoder-0.249.0/src/core.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core.rs rename to wasm-encoder-0.249.0/src/core.rs diff --git a/wasm-encoder-0.247.0/src/core/branch_hints.rs b/wasm-encoder-0.249.0/src/core/branch_hints.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/branch_hints.rs rename to wasm-encoder-0.249.0/src/core/branch_hints.rs diff --git a/wasm-encoder-0.247.0/src/core/code.rs b/wasm-encoder-0.249.0/src/core/code.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/code.rs rename to wasm-encoder-0.249.0/src/core/code.rs diff --git a/wasm-encoder-0.247.0/src/core/custom.rs b/wasm-encoder-0.249.0/src/core/custom.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/custom.rs rename to wasm-encoder-0.249.0/src/core/custom.rs diff --git a/wasm-encoder-0.247.0/src/core/data.rs b/wasm-encoder-0.249.0/src/core/data.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/data.rs rename to wasm-encoder-0.249.0/src/core/data.rs diff --git a/wasm-encoder-0.247.0/src/core/dump.rs b/wasm-encoder-0.249.0/src/core/dump.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/dump.rs rename to wasm-encoder-0.249.0/src/core/dump.rs diff --git a/wasm-encoder-0.247.0/src/core/elements.rs b/wasm-encoder-0.249.0/src/core/elements.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/elements.rs rename to wasm-encoder-0.249.0/src/core/elements.rs diff --git a/wasm-encoder-0.247.0/src/core/exports.rs b/wasm-encoder-0.249.0/src/core/exports.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/exports.rs rename to wasm-encoder-0.249.0/src/core/exports.rs diff --git a/wasm-encoder-0.247.0/src/core/functions.rs b/wasm-encoder-0.249.0/src/core/functions.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/functions.rs rename to wasm-encoder-0.249.0/src/core/functions.rs diff --git a/wasm-encoder-0.247.0/src/core/globals.rs b/wasm-encoder-0.249.0/src/core/globals.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/globals.rs rename to wasm-encoder-0.249.0/src/core/globals.rs diff --git a/wasm-encoder-0.247.0/src/core/imports.rs b/wasm-encoder-0.249.0/src/core/imports.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/imports.rs rename to wasm-encoder-0.249.0/src/core/imports.rs diff --git a/wasm-encoder-0.247.0/src/core/instructions.rs b/wasm-encoder-0.249.0/src/core/instructions.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/instructions.rs rename to wasm-encoder-0.249.0/src/core/instructions.rs diff --git a/wasm-encoder-0.247.0/src/core/linking.rs b/wasm-encoder-0.249.0/src/core/linking.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/linking.rs rename to wasm-encoder-0.249.0/src/core/linking.rs diff --git a/wasm-encoder-0.247.0/src/core/memories.rs b/wasm-encoder-0.249.0/src/core/memories.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/memories.rs rename to wasm-encoder-0.249.0/src/core/memories.rs diff --git a/wasm-encoder-0.247.0/src/core/names.rs b/wasm-encoder-0.249.0/src/core/names.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/names.rs rename to wasm-encoder-0.249.0/src/core/names.rs diff --git a/wasm-encoder-0.247.0/src/core/producers.rs b/wasm-encoder-0.249.0/src/core/producers.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/producers.rs rename to wasm-encoder-0.249.0/src/core/producers.rs diff --git a/wasm-encoder-0.247.0/src/core/start.rs b/wasm-encoder-0.249.0/src/core/start.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/start.rs rename to wasm-encoder-0.249.0/src/core/start.rs diff --git a/wasm-encoder-0.247.0/src/core/tables.rs b/wasm-encoder-0.249.0/src/core/tables.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/tables.rs rename to wasm-encoder-0.249.0/src/core/tables.rs diff --git a/wasm-encoder-0.247.0/src/core/tags.rs b/wasm-encoder-0.249.0/src/core/tags.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/tags.rs rename to wasm-encoder-0.249.0/src/core/tags.rs diff --git a/wasm-encoder-0.247.0/src/core/types.rs b/wasm-encoder-0.249.0/src/core/types.rs similarity index 100% rename from wasm-encoder-0.247.0/src/core/types.rs rename to wasm-encoder-0.249.0/src/core/types.rs diff --git a/wasm-encoder-0.247.0/src/lib.rs b/wasm-encoder-0.249.0/src/lib.rs similarity index 100% rename from wasm-encoder-0.247.0/src/lib.rs rename to wasm-encoder-0.249.0/src/lib.rs diff --git a/wasm-encoder-0.247.0/src/raw.rs b/wasm-encoder-0.249.0/src/raw.rs similarity index 100% rename from wasm-encoder-0.247.0/src/raw.rs rename to wasm-encoder-0.249.0/src/raw.rs diff --git a/wasm-encoder-0.247.0/src/reencode.rs b/wasm-encoder-0.249.0/src/reencode.rs similarity index 100% rename from wasm-encoder-0.247.0/src/reencode.rs rename to wasm-encoder-0.249.0/src/reencode.rs diff --git a/wasm-encoder-0.247.0/src/reencode/component.rs b/wasm-encoder-0.249.0/src/reencode/component.rs similarity index 99% rename from wasm-encoder-0.247.0/src/reencode/component.rs rename to wasm-encoder-0.249.0/src/reencode/component.rs index 464c28a20e..48396e2670 100644 --- a/wasm-encoder-0.247.0/src/reencode/component.rs +++ b/wasm-encoder-0.249.0/src/reencode/component.rs @@ -661,7 +661,7 @@ pub mod component_utils { } wasmparser::InstanceTypeDeclaration::Export { name, ty } => { let ty = reencoder.component_type_ref(ty)?; - instance.export(name.0, ty); + instance.export(name, ty); Ok(()) } } @@ -715,12 +715,12 @@ pub mod component_utils { } wasmparser::ComponentTypeDeclaration::Export { name, ty } => { let ty = reencoder.component_type_ref(ty)?; - component.export(name.0, ty); + component.export(name, ty); Ok(()) } wasmparser::ComponentTypeDeclaration::Import(import) => { let ty = reencoder.component_type_ref(import.ty)?; - component.import(import.name.0, ty); + component.import(import.name, ty); Ok(()) } } @@ -903,7 +903,7 @@ pub mod component_utils { ) -> Result<(), Error> { for import in section { let import = import?; - imports.import(import.name.0, reencoder.component_type_ref(import.ty)?); + imports.import(import.name, reencoder.component_type_ref(import.ty)?); } Ok(()) } @@ -996,11 +996,11 @@ pub mod component_utils { wasmparser::CanonicalFunction::TaskCancel => { section.task_cancel(); } - wasmparser::CanonicalFunction::ContextGet(i) => { - section.context_get(i); + wasmparser::CanonicalFunction::ContextGet { ty, slot } => { + section.context_get(reencoder.val_type(ty)?, slot); } - wasmparser::CanonicalFunction::ContextSet(i) => { - section.context_set(i); + wasmparser::CanonicalFunction::ContextSet { ty, slot } => { + section.context_set(reencoder.val_type(ty)?, slot); } wasmparser::CanonicalFunction::ThreadYield { cancellable } => { section.thread_yield(cancellable); @@ -1183,7 +1183,7 @@ pub mod component_utils { wasmparser::ComponentInstance::FromExports(exports) => { instances.export_items(exports.iter().map(|export| { ( - export.name.0, + export.name, export.kind.into(), reencoder.component_external_index(export.kind, export.index), ) @@ -1266,7 +1266,7 @@ pub mod component_utils { export: wasmparser::ComponentExport<'_>, ) -> Result<(), Error> { exports.export( - export.name.0, + export.name, export.kind.into(), reencoder.component_external_index(export.kind, export.index), export diff --git a/wasmparser-0.247.0/.cargo-checksum.json b/wasmparser-0.249.0/.cargo-checksum.json similarity index 80% rename from wasmparser-0.247.0/.cargo-checksum.json rename to wasmparser-0.249.0/.cargo-checksum.json index 59d4e5c323..59168ba8dc 100644 --- a/wasmparser-0.247.0/.cargo-checksum.json +++ b/wasmparser-0.249.0/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo_vcs_info.json":"3055ef067c4e65ea25c704a8345fc9c22d800ed9ed30b5e76e902cccf977b0df","Cargo.lock":"af6991463dac49d322941324121bea2ff4413f9a52f2e84f95f2eea7a6e8b5ef","Cargo.toml":"4370b7f5a8ae53d1b5be377c5122f45d1ea23270e7889cd54838783ec0db75b4","Cargo.toml.orig":"09d79bbfeb0e648ec3718a5e7ceb0d34c29c1f4fbc48f762f396c27ee70363dc","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"aabf3b5930893b2a89d0114d8cd97e9b980f3c6f758b960484e06b69a504b823","benches/benchmark.rs":"c69fd76e74644188f25d03beac288f094b22735db58daf00019f812f9400f604","examples/simple.rs":"dc847c55627d346cee20f1415fde9be36a8e93d0ba0929d3fd8eef9d69e3541f","src/arity.rs":"f2b23b274beb55c682496e455c45dab3e6149de49e64e1815ba3288317415d09","src/binary_reader.rs":"14684674cc11c192d1114c1341a68638a519ae3ba29fbfc49583519e04a70a3a","src/collections/hash.rs":"4146765fe03ff2e3456ad713283713c8614d9605a0f9c22c710b95508de7da89","src/collections/index_map.rs":"70823e5d27ca3abd193e0f18a163e3cbcef6f969b212b870b439b341278f1c32","src/collections/index_map/detail.rs":"2e9c56ff3ebf0473704b8bf304d8cca4dd39fa6c5973e06b5493a45332bb656a","src/collections/index_map/tests.rs":"7761fda67a871bcef24579f0cbe4762e40fb8e7ca5147c67187da510c545c016","src/collections/index_set.rs":"f53bcbfbbeccd9bf62406f08565f5ac57af58cf962484a91d4efcd7431d37310","src/collections/map.rs":"f239038e622dd95eb5ee5dbbfb67cd0e4cafe18c750cc0c46b1013809e0ec643","src/collections/mod.rs":"b80b8f49039ef403b9515c994aa2512db5dc905f083c876a41d8ca705d7add6e","src/collections/set.rs":"b9680f5c2f0cb7c52a935ce80f1ec3f5c6239913c1b621556f289a708e0f373b","src/features.rs":"f914f8e942f668507e4a87f1fbc8ab3d3adc4def2e910498b3dddbcfabf5fd3a","src/lib.rs":"d218bec68bafcfc187af44e655ebf1f0e57506ccc07492c7c4251cc88bbe7378","src/limits.rs":"ac608007fb4e7c45c99159230230e0ab35739055980259920e3e4ad71b87ed61","src/parser.rs":"8abb0c08909f78418eb8a1a48b96185cdab67817afc5793dd1da7f87e57404ff","src/readers.rs":"bf43b91c1ad97d9d67eaa8fc63381428dc300c97b21ce1ede89ab6b628625da7","src/readers/component.rs":"c259628ca3f09ff904f7e920aeec261b657f7a197c99b520a6a7d3e918b9fb3b","src/readers/component/aliases.rs":"97398d9fdcb7b4227b8bb68a6677ebf09c62f6a43b9aa7591b37a2413848e759","src/readers/component/canonicals.rs":"8a63a4c01b4fcd57f02d6f338b8e77cc69043ce803a801871dd7624f04d02f36","src/readers/component/exports.rs":"de6482715680b63fc0969225b6c634c5f5c2fa5b763511628a313af4748df347","src/readers/component/imports.rs":"8d2947817bd1a91956d33a8e723f5af325f73cc6eb2903264a6dd594b3deeb46","src/readers/component/instances.rs":"8ab1254ce1e66528d37a61bcde4cabb2c7c87ccc2740be03d539c064ed544d29","src/readers/component/names.rs":"1bfdffe04b15760ab573359c864ead0c45a0afe42811d16af535d9e19125daa6","src/readers/component/start.rs":"9c37d1eea486ee951547a328693bcf9f2a27f48e2207478daf23c1cd9e9f95f3","src/readers/component/types.rs":"457937f8370f423673edde76bedb3d0ed79b91ecf04ecb41cfb77b884d7bf4d1","src/readers/core.rs":"f77e1eb46e1d05abeabb9be2bd7bdd66acadfc4c651912f2a67b7e5f7d29d041","src/readers/core/branch_hinting.rs":"29210720e08e3a558fd96ac857038c9b87732a265ff1bfbd7f0bf3312ea3e949","src/readers/core/code.rs":"96b4f12b666576100bfa9807e087792ec96b4d315317475180c086f18fe86b4d","src/readers/core/coredumps.rs":"75c1c5ad6a85cb90bc39eb4b22b22a512f5ee98b363565f7262c1c176a10bbef","src/readers/core/custom.rs":"f3c965fcd044576a2c0f3ee87c78e4f9f345ce87899a76d609e5a8709f5d7d9e","src/readers/core/data.rs":"da78898a19accca90f05ee762cf3388c0f8a40a3d60cb78acaa3f0eb71a0cb3c","src/readers/core/dylink0.rs":"c92d75e417eb444673408c00311da3f59427b6f966009f4830be8b518a8bda21","src/readers/core/elements.rs":"16342061fef1f04b68b99db7767e11608fec2922f07831df60922d6a9500e2dc","src/readers/core/exports.rs":"dd13793edf9edcbb857288c5adb273a8231ead5dbad2e39d0f9abd23ed189151","src/readers/core/functions.rs":"b5bbc7f7b7a429187376f63c695a9f1cbf92e515dba840ac876fa60f7290da34","src/readers/core/globals.rs":"19ea22f5c4ae3c1d6d4c62dbd163c503f05117210fa4b029094a1927e2c30b7a","src/readers/core/imports.rs":"b8c9ad9a48211c4d1a076861a1f8b68905981100379f198e5152e79a294678eb","src/readers/core/init.rs":"53831f0d4b9e6c4de65816363787b863ce49850b32a821bd4b3891889b2e3ba6","src/readers/core/linking.rs":"02b1eb463b516fff4fa9f1ba06c623dd8e6b2ea3e632669415074d9ee4ac9968","src/readers/core/memories.rs":"a36d626d167569ee28feddbbfacd5d4211834bb2c8c3c522251a28ca15d229c0","src/readers/core/names.rs":"722dc47fcd523fb75987ae501fb893002978b207e31b3bc054901e66737540f6","src/readers/core/operators.rs":"43d57f761cdde3b02dd617cd5fee8cccf02740b20b4cd4000c89f66b6c17936f","src/readers/core/producers.rs":"25bbdd1385d26ba4dbc0814c516834f2ab7c0aad697a576b714d3dbe8dc2d7cc","src/readers/core/reloc.rs":"244f29411a0e4cceb09e0a9b9ec05a64bcc2d2c0f783f23227f33f91d2fbee3f","src/readers/core/tables.rs":"a0b3676cdd7c8a5f56ba7fcc0e5c0b3079755dc932e00caf5c37af176288d602","src/readers/core/tags.rs":"c1dcfeb973195da9708549bcc2df4dd8ff282fe802c15a603bebc8a856f70949","src/readers/core/types.rs":"b1fff7f8eafbe890b82214b8308d34ebd720910357ad0a049a309f141a654579","src/readers/core/types/matches.rs":"0df58b38f94f3281b91d1edbb568b9b1d3484ea717fcbc8e353459447ded2d13","src/resources.rs":"eaf203d9b99e167ead8fc8ed8861851bdc1288bc5fe6c435f1ee7cf69e8f9fa5","src/validator.rs":"f932e06804e064f93d1546e5292fb40aba6ff0bd368397a2da2c3b9bd1a6b508","src/validator/component.rs":"d98cb2e0044bf437d6ad7829d067ebcc3356b005ca3d1825cfc88e6c33eb0dec","src/validator/component_types.rs":"b44cbd63fac82d85c9f989c45ab2ed54e037e549144860711eac94af856d8b3c","src/validator/core.rs":"89ca13668ab45ee7c90274a0e4cc5e333f974641ef0e77f0be4080546a008f78","src/validator/core/canonical.rs":"1b67e8cd9dfdab40bab41506f320ab5084a2602665cf344c7a1d6c72a09b720c","src/validator/func.rs":"3a4f29f72f61ce5602c7474f1b0f1896c66aa2a34a44f26a8d2276723c5ca8d3","src/validator/names.rs":"8f75bef3ac6d1a3d025c8a74743b63820e67ae0f6779ca3e5254d1e0f6e9394a","src/validator/operators.rs":"3ea4ad31201772a266905b780b65def468c91b49721b8c819799f6be1d46cce6","src/validator/operators/simd.rs":"a338d3f82be1246a14cb96e5d99a99de0c728256703be36e4caf8142042693a2","src/validator/operators/transaction.rs":"ff5c6353f2591a6d48ee334e74700b2c0299070892ab15e087d3b4f41f7e73df","src/validator/operators/transaction_disabled.rs":"8a6d35a89a45af0f57282f9cf1e25146e18ac495e114c181e82988d52e5eac6d","src/validator/types.rs":"802c04e769e01dd028803a22d0c07e0bca91781036f8cb38c36701841db7f62d","tests/big-module.rs":"114d250505a2a3daf2e778bd4b2c14b7fc6b6be842055fa6b9389167fa430dca"},"package":"8e6fb4c2bee46c5ea4d40f8cdb5c131725cd976718ec56f1c8e82fbde5fa2a80"} \ No newline at end of file +{"files":{".cargo_vcs_info.json":"fd1557bd2d4d62076cf10eef51fa3e49252931d7dee525d1cfc31b4e333fe54a","Cargo.lock":"f744c1337ecf01627d20934a7f9183d348db08a442d6bd8499348a6dc8d044a4","Cargo.toml":"2dfdc6d415ca8c07132c2903848099d66e7b227a8bc255044b2148b600864af3","Cargo.toml.orig":"09d79bbfeb0e648ec3718a5e7ceb0d34c29c1f4fbc48f762f396c27ee70363dc","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"aabf3b5930893b2a89d0114d8cd97e9b980f3c6f758b960484e06b69a504b823","benches/benchmark.rs":"c69fd76e74644188f25d03beac288f094b22735db58daf00019f812f9400f604","examples/simple.rs":"dc847c55627d346cee20f1415fde9be36a8e93d0ba0929d3fd8eef9d69e3541f","src/arity.rs":"f2b23b274beb55c682496e455c45dab3e6149de49e64e1815ba3288317415d09","src/binary_reader.rs":"14684674cc11c192d1114c1341a68638a519ae3ba29fbfc49583519e04a70a3a","src/collections/hash.rs":"4146765fe03ff2e3456ad713283713c8614d9605a0f9c22c710b95508de7da89","src/collections/index_map.rs":"70823e5d27ca3abd193e0f18a163e3cbcef6f969b212b870b439b341278f1c32","src/collections/index_map/detail.rs":"2e9c56ff3ebf0473704b8bf304d8cca4dd39fa6c5973e06b5493a45332bb656a","src/collections/index_map/tests.rs":"7761fda67a871bcef24579f0cbe4762e40fb8e7ca5147c67187da510c545c016","src/collections/index_set.rs":"f53bcbfbbeccd9bf62406f08565f5ac57af58cf962484a91d4efcd7431d37310","src/collections/map.rs":"f239038e622dd95eb5ee5dbbfb67cd0e4cafe18c750cc0c46b1013809e0ec643","src/collections/mod.rs":"b80b8f49039ef403b9515c994aa2512db5dc905f083c876a41d8ca705d7add6e","src/collections/set.rs":"b9680f5c2f0cb7c52a935ce80f1ec3f5c6239913c1b621556f289a708e0f373b","src/features.rs":"64b2bd64e30059282d320fb94b957b3e4cc9087dd77de714504fad44024b686f","src/lib.rs":"d218bec68bafcfc187af44e655ebf1f0e57506ccc07492c7c4251cc88bbe7378","src/limits.rs":"ac608007fb4e7c45c99159230230e0ab35739055980259920e3e4ad71b87ed61","src/parser.rs":"8abb0c08909f78418eb8a1a48b96185cdab67817afc5793dd1da7f87e57404ff","src/readers.rs":"bf43b91c1ad97d9d67eaa8fc63381428dc300c97b21ce1ede89ab6b628625da7","src/readers/component.rs":"c259628ca3f09ff904f7e920aeec261b657f7a197c99b520a6a7d3e918b9fb3b","src/readers/component/aliases.rs":"97398d9fdcb7b4227b8bb68a6677ebf09c62f6a43b9aa7591b37a2413848e759","src/readers/component/canonicals.rs":"7b31f979220fea9c3e81a56c9cf468e7276792a1dc9f58826bd838ebab3fa620","src/readers/component/exports.rs":"ff6cac09a756be842dba7b3661a5579af063646e16dec4abe6d8cb310ff7ce10","src/readers/component/imports.rs":"4a76fb2ffde548f16829219d228510063d7739b0e3bdad2ef180e2d2fbc960fa","src/readers/component/instances.rs":"8ab1254ce1e66528d37a61bcde4cabb2c7c87ccc2740be03d539c064ed544d29","src/readers/component/names.rs":"1bfdffe04b15760ab573359c864ead0c45a0afe42811d16af535d9e19125daa6","src/readers/component/start.rs":"9c37d1eea486ee951547a328693bcf9f2a27f48e2207478daf23c1cd9e9f95f3","src/readers/component/types.rs":"0396e49080670013691fe42012443c9f9162c86beac9b64f288cb0cf34e1b2cb","src/readers/core.rs":"f77e1eb46e1d05abeabb9be2bd7bdd66acadfc4c651912f2a67b7e5f7d29d041","src/readers/core/branch_hinting.rs":"29210720e08e3a558fd96ac857038c9b87732a265ff1bfbd7f0bf3312ea3e949","src/readers/core/code.rs":"96b4f12b666576100bfa9807e087792ec96b4d315317475180c086f18fe86b4d","src/readers/core/coredumps.rs":"75c1c5ad6a85cb90bc39eb4b22b22a512f5ee98b363565f7262c1c176a10bbef","src/readers/core/custom.rs":"f3c965fcd044576a2c0f3ee87c78e4f9f345ce87899a76d609e5a8709f5d7d9e","src/readers/core/data.rs":"da78898a19accca90f05ee762cf3388c0f8a40a3d60cb78acaa3f0eb71a0cb3c","src/readers/core/dylink0.rs":"c92d75e417eb444673408c00311da3f59427b6f966009f4830be8b518a8bda21","src/readers/core/elements.rs":"16342061fef1f04b68b99db7767e11608fec2922f07831df60922d6a9500e2dc","src/readers/core/exports.rs":"dd13793edf9edcbb857288c5adb273a8231ead5dbad2e39d0f9abd23ed189151","src/readers/core/functions.rs":"b5bbc7f7b7a429187376f63c695a9f1cbf92e515dba840ac876fa60f7290da34","src/readers/core/globals.rs":"19ea22f5c4ae3c1d6d4c62dbd163c503f05117210fa4b029094a1927e2c30b7a","src/readers/core/imports.rs":"b8c9ad9a48211c4d1a076861a1f8b68905981100379f198e5152e79a294678eb","src/readers/core/init.rs":"53831f0d4b9e6c4de65816363787b863ce49850b32a821bd4b3891889b2e3ba6","src/readers/core/linking.rs":"02b1eb463b516fff4fa9f1ba06c623dd8e6b2ea3e632669415074d9ee4ac9968","src/readers/core/memories.rs":"a36d626d167569ee28feddbbfacd5d4211834bb2c8c3c522251a28ca15d229c0","src/readers/core/names.rs":"722dc47fcd523fb75987ae501fb893002978b207e31b3bc054901e66737540f6","src/readers/core/operators.rs":"43d57f761cdde3b02dd617cd5fee8cccf02740b20b4cd4000c89f66b6c17936f","src/readers/core/producers.rs":"25bbdd1385d26ba4dbc0814c516834f2ab7c0aad697a576b714d3dbe8dc2d7cc","src/readers/core/reloc.rs":"0e22e51978374e9cdb5e690ac5bc79c49e92f1540d179549d5cfcf558a120f16","src/readers/core/tables.rs":"a0b3676cdd7c8a5f56ba7fcc0e5c0b3079755dc932e00caf5c37af176288d602","src/readers/core/tags.rs":"c1dcfeb973195da9708549bcc2df4dd8ff282fe802c15a603bebc8a856f70949","src/readers/core/types.rs":"b1fff7f8eafbe890b82214b8308d34ebd720910357ad0a049a309f141a654579","src/readers/core/types/matches.rs":"0df58b38f94f3281b91d1edbb568b9b1d3484ea717fcbc8e353459447ded2d13","src/resources.rs":"eaf203d9b99e167ead8fc8ed8861851bdc1288bc5fe6c435f1ee7cf69e8f9fa5","src/validator.rs":"f932e06804e064f93d1546e5292fb40aba6ff0bd368397a2da2c3b9bd1a6b508","src/validator/component.rs":"c82e2dd7cbcc7e0cc299bea34763e306269bb6af78429055370a84d5d2a9a82d","src/validator/component_types.rs":"7eae32506f504cd0eedef95f6d39fefe03050c0f70ada885170f0aa4f034a14b","src/validator/core.rs":"89ca13668ab45ee7c90274a0e4cc5e333f974641ef0e77f0be4080546a008f78","src/validator/core/canonical.rs":"1b67e8cd9dfdab40bab41506f320ab5084a2602665cf344c7a1d6c72a09b720c","src/validator/func.rs":"3a4f29f72f61ce5602c7474f1b0f1896c66aa2a34a44f26a8d2276723c5ca8d3","src/validator/names.rs":"8f75bef3ac6d1a3d025c8a74743b63820e67ae0f6779ca3e5254d1e0f6e9394a","src/validator/operators.rs":"3ea4ad31201772a266905b780b65def468c91b49721b8c819799f6be1d46cce6","src/validator/operators/simd.rs":"a338d3f82be1246a14cb96e5d99a99de0c728256703be36e4caf8142042693a2","src/validator/operators/transaction.rs":"ff5c6353f2591a6d48ee334e74700b2c0299070892ab15e087d3b4f41f7e73df","src/validator/operators/transaction_disabled.rs":"8a6d35a89a45af0f57282f9cf1e25146e18ac495e114c181e82988d52e5eac6d","src/validator/types.rs":"802c04e769e01dd028803a22d0c07e0bca91781036f8cb38c36701841db7f62d","tests/big-module.rs":"114d250505a2a3daf2e778bd4b2c14b7fc6b6be842055fa6b9389167fa430dca"},"package":"30538cae9a794215f490b532df01c557e2e2bfac92569482554acd0992a102ea"} \ No newline at end of file diff --git a/wasmparser-0.247.0/.cargo_vcs_info.json b/wasmparser-0.249.0/.cargo_vcs_info.json similarity index 50% rename from wasmparser-0.247.0/.cargo_vcs_info.json rename to wasmparser-0.249.0/.cargo_vcs_info.json index eb0d2bfc45..a8fa7e2a22 100644 --- a/wasmparser-0.247.0/.cargo_vcs_info.json +++ b/wasmparser-0.249.0/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "0285a4680738439cb884d2674bec8be1e8beac5c" + "sha1": "efeee7cafa5a3dcdddb5aab27bc0c05f279929ed" }, "path_in_vcs": "crates/wasmparser" } \ No newline at end of file diff --git a/wasmparser-0.247.0/Cargo.lock b/wasmparser-0.249.0/Cargo.lock similarity index 99% rename from wasmparser-0.247.0/Cargo.lock rename to wasmparser-0.249.0/Cargo.lock index f704d1acab..92f619457c 100644 --- a/wasmparser-0.247.0/Cargo.lock +++ b/wasmparser-0.249.0/Cargo.lock @@ -560,7 +560,7 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.247.0" +version = "0.249.0" dependencies = [ "anyhow", "bitflags", diff --git a/wasmparser-0.247.0/Cargo.toml b/wasmparser-0.249.0/Cargo.toml similarity index 98% rename from wasmparser-0.247.0/Cargo.toml rename to wasmparser-0.249.0/Cargo.toml index 1449d06a57..c24322dfc9 100644 --- a/wasmparser-0.247.0/Cargo.toml +++ b/wasmparser-0.249.0/Cargo.toml @@ -10,10 +10,10 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2021" +edition = "2024" rust-version = "1.85.0" name = "wasmparser" -version = "0.247.0" +version = "0.249.0" authors = ["Yury Delendik "] build = false exclude = ["benches/*.wasm"] diff --git a/wasmparser-0.247.0/Cargo.toml.orig b/wasmparser-0.249.0/Cargo.toml.orig similarity index 100% rename from wasmparser-0.247.0/Cargo.toml.orig rename to wasmparser-0.249.0/Cargo.toml.orig diff --git a/wast-247.0.0/LICENSE-APACHE b/wasmparser-0.249.0/LICENSE-APACHE similarity index 100% rename from wast-247.0.0/LICENSE-APACHE rename to wasmparser-0.249.0/LICENSE-APACHE diff --git a/wasmparser-0.247.0/LICENSE-Apache-2.0_WITH_LLVM-exception b/wasmparser-0.249.0/LICENSE-Apache-2.0_WITH_LLVM-exception similarity index 100% rename from wasmparser-0.247.0/LICENSE-Apache-2.0_WITH_LLVM-exception rename to wasmparser-0.249.0/LICENSE-Apache-2.0_WITH_LLVM-exception diff --git a/wasmparser-0.247.0/LICENSE-MIT b/wasmparser-0.249.0/LICENSE-MIT similarity index 100% rename from wasmparser-0.247.0/LICENSE-MIT rename to wasmparser-0.249.0/LICENSE-MIT diff --git a/wasmparser-0.247.0/README.md b/wasmparser-0.249.0/README.md similarity index 100% rename from wasmparser-0.247.0/README.md rename to wasmparser-0.249.0/README.md diff --git a/wasmparser-0.247.0/benches/benchmark.rs b/wasmparser-0.249.0/benches/benchmark.rs similarity index 100% rename from wasmparser-0.247.0/benches/benchmark.rs rename to wasmparser-0.249.0/benches/benchmark.rs diff --git a/wasmparser-0.247.0/examples/simple.rs b/wasmparser-0.249.0/examples/simple.rs similarity index 100% rename from wasmparser-0.247.0/examples/simple.rs rename to wasmparser-0.249.0/examples/simple.rs diff --git a/wasmparser-0.247.0/src/arity.rs b/wasmparser-0.249.0/src/arity.rs similarity index 100% rename from wasmparser-0.247.0/src/arity.rs rename to wasmparser-0.249.0/src/arity.rs diff --git a/wasmparser-0.247.0/src/binary_reader.rs b/wasmparser-0.249.0/src/binary_reader.rs similarity index 100% rename from wasmparser-0.247.0/src/binary_reader.rs rename to wasmparser-0.249.0/src/binary_reader.rs diff --git a/wasmparser-0.247.0/src/collections/hash.rs b/wasmparser-0.249.0/src/collections/hash.rs similarity index 100% rename from wasmparser-0.247.0/src/collections/hash.rs rename to wasmparser-0.249.0/src/collections/hash.rs diff --git a/wasmparser-0.247.0/src/collections/index_map.rs b/wasmparser-0.249.0/src/collections/index_map.rs similarity index 100% rename from wasmparser-0.247.0/src/collections/index_map.rs rename to wasmparser-0.249.0/src/collections/index_map.rs diff --git a/wasmparser-0.247.0/src/collections/index_map/detail.rs b/wasmparser-0.249.0/src/collections/index_map/detail.rs similarity index 100% rename from wasmparser-0.247.0/src/collections/index_map/detail.rs rename to wasmparser-0.249.0/src/collections/index_map/detail.rs diff --git a/wasmparser-0.247.0/src/collections/index_map/tests.rs b/wasmparser-0.249.0/src/collections/index_map/tests.rs similarity index 100% rename from wasmparser-0.247.0/src/collections/index_map/tests.rs rename to wasmparser-0.249.0/src/collections/index_map/tests.rs diff --git a/wasmparser-0.247.0/src/collections/index_set.rs b/wasmparser-0.249.0/src/collections/index_set.rs similarity index 100% rename from wasmparser-0.247.0/src/collections/index_set.rs rename to wasmparser-0.249.0/src/collections/index_set.rs diff --git a/wasmparser-0.247.0/src/collections/map.rs b/wasmparser-0.249.0/src/collections/map.rs similarity index 100% rename from wasmparser-0.247.0/src/collections/map.rs rename to wasmparser-0.249.0/src/collections/map.rs diff --git a/wasmparser-0.247.0/src/collections/mod.rs b/wasmparser-0.249.0/src/collections/mod.rs similarity index 100% rename from wasmparser-0.247.0/src/collections/mod.rs rename to wasmparser-0.249.0/src/collections/mod.rs diff --git a/wasmparser-0.247.0/src/collections/set.rs b/wasmparser-0.249.0/src/collections/set.rs similarity index 100% rename from wasmparser-0.247.0/src/collections/set.rs rename to wasmparser-0.249.0/src/collections/set.rs diff --git a/wasmparser-0.247.0/src/features.rs b/wasmparser-0.249.0/src/features.rs similarity index 96% rename from wasmparser-0.247.0/src/features.rs rename to wasmparser-0.249.0/src/features.rs index 7fb2d2b66a..d7b1044a43 100644 --- a/wasmparser-0.247.0/src/features.rs +++ b/wasmparser-0.249.0/src/features.rs @@ -259,12 +259,12 @@ define_wasm_features! { /// Corresponds to the 🚟 character in /// . pub cm_async_stackful: CM_ASYNC_STACKFUL(1 << 28) = false; - /// Gates some intrinsics being marked with `async` in the component + /// Gates some intrinsics and options on intrinsics in the component /// model async proposal. /// /// Corresponds to the 🚝 character in /// . - pub cm_async_builtins: CM_ASYNC_BUILTINS(1 << 29) = false; + pub cm_more_async_builtins: CM_MORE_ASYNC_BUILTINS(1 << 29) = false; /// Support for threading in the component model proposal. /// /// Corresponds to the 🧵 character in @@ -312,6 +312,18 @@ define_wasm_features! { /// Corresponds to the 🗺️ character in /// . pub cm_map: CM_MAP(1 << 38) = false; + + /// Support for 64-bit contexts in the component model proposal. + /// + /// Corresponds to the 🐘 character in + /// . + pub cm64: CM64(1 << 39) = false; + + /// Support for the `(implements "...")` directive in the component model + /// + /// Corresponds to the 🏷️ character in + /// . + pub cm_implements: CM_IMPLEMENTS(1 << 40) = false; } } diff --git a/wasmparser-0.247.0/src/lib.rs b/wasmparser-0.249.0/src/lib.rs similarity index 100% rename from wasmparser-0.247.0/src/lib.rs rename to wasmparser-0.249.0/src/lib.rs diff --git a/wasmparser-0.247.0/src/limits.rs b/wasmparser-0.249.0/src/limits.rs similarity index 100% rename from wasmparser-0.247.0/src/limits.rs rename to wasmparser-0.249.0/src/limits.rs diff --git a/wasmparser-0.247.0/src/parser.rs b/wasmparser-0.249.0/src/parser.rs similarity index 100% rename from wasmparser-0.247.0/src/parser.rs rename to wasmparser-0.249.0/src/parser.rs diff --git a/wasmparser-0.247.0/src/readers.rs b/wasmparser-0.249.0/src/readers.rs similarity index 100% rename from wasmparser-0.247.0/src/readers.rs rename to wasmparser-0.249.0/src/readers.rs diff --git a/wasmparser-0.247.0/src/readers/component.rs b/wasmparser-0.249.0/src/readers/component.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/component.rs rename to wasmparser-0.249.0/src/readers/component.rs diff --git a/wasmparser-0.247.0/src/readers/component/aliases.rs b/wasmparser-0.249.0/src/readers/component/aliases.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/component/aliases.rs rename to wasmparser-0.249.0/src/readers/component/aliases.rs diff --git a/wasmparser-0.247.0/src/readers/component/canonicals.rs b/wasmparser-0.249.0/src/readers/component/canonicals.rs similarity index 94% rename from wasmparser-0.247.0/src/readers/component/canonicals.rs rename to wasmparser-0.249.0/src/readers/component/canonicals.rs index 26df1257cd..11bc3ac307 100644 --- a/wasmparser-0.247.0/src/readers/component/canonicals.rs +++ b/wasmparser-0.249.0/src/readers/component/canonicals.rs @@ -1,6 +1,6 @@ use crate::limits::MAX_WASM_CANONICAL_OPTIONS; use crate::prelude::*; -use crate::{BinaryReader, ComponentValType, FromReader, Result, SectionLimited}; +use crate::{BinaryReader, ComponentValType, FromReader, Result, SectionLimited, ValType}; /// Represents options for component functions. #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -18,7 +18,8 @@ pub enum CanonicalOption { /// The realloc function to use if the lifting or lowering of a function requires memory /// allocation. /// - /// The value is an index to a core function of type `(func (param i32 i32 i32 i32) (result i32))`. + /// The value is an index to a core function of type `(func (param $T $T $T $T) (result $T))` where + /// `$T` is the index type of the memory, i.e., either `i32` or `i64`. Realloc(u32), /// The post-return function to use if the lifting of a function requires /// cleanup after the function returns. @@ -108,9 +109,23 @@ pub enum CanonicalFunction { /// A function to acknowledge cancellation of the current task. TaskCancel, /// A `context.get` intrinsic for the `i`th slot of task-local storage. - ContextGet(u32), + ContextGet { + /// The type of the slot. Currently only `ValType::I32` and + /// `ValType::I64` are accepted by the validator (with `I64` gated on + /// the component-model 64-bit feature). + ty: ValType, + /// The index of the task-local storage slot. + slot: u32, + }, /// A `context.set` intrinsic for the `i`th slot of task-local storage. - ContextSet(u32), + ContextSet { + /// The type of the slot. Currently only `ValType::I32` and + /// `ValType::I64` are accepted by the validator (with `I64` gated on + /// the component-model 64-bit feature). + ty: ValType, + /// The index of the task-local storage slot. + slot: u32, + }, /// A function which yields control to the host so that other tasks are able /// to make progress, if any. ThreadYield { @@ -337,13 +352,13 @@ impl<'a> FromReader<'a> for CanonicalFunction { result: crate::read_resultlist(reader)?, options: read_opts(reader)?, }, - 0x0a => match reader.read_u8()? { - 0x7f => CanonicalFunction::ContextGet(reader.read_var_u32()?), - x => return reader.invalid_leading_byte(x, "context.get intrinsic type"), + 0x0a => CanonicalFunction::ContextGet { + ty: reader.read()?, + slot: reader.read_var_u32()?, }, - 0x0b => match reader.read_u8()? { - 0x7f => CanonicalFunction::ContextSet(reader.read_var_u32()?), - x => return reader.invalid_leading_byte(x, "context.set intrinsic type"), + 0x0b => CanonicalFunction::ContextSet { + ty: reader.read()?, + slot: reader.read_var_u32()?, }, 0x0c => CanonicalFunction::ThreadYield { cancellable: reader.read()?, diff --git a/wasmparser-0.247.0/src/readers/component/exports.rs b/wasmparser-0.249.0/src/readers/component/exports.rs similarity index 79% rename from wasmparser-0.247.0/src/readers/component/exports.rs rename to wasmparser-0.249.0/src/readers/component/exports.rs index e00d0391b4..2b7a6be588 100644 --- a/wasmparser-0.247.0/src/readers/component/exports.rs +++ b/wasmparser-0.249.0/src/readers/component/exports.rs @@ -1,4 +1,6 @@ -use crate::{BinaryReader, ComponentTypeRef, FromReader, Result, SectionLimited}; +use crate::{ + BinaryReader, ComponentExternName, ComponentTypeRef, FromReader, Result, SectionLimited, +}; /// Represents the kind of an external items of a WebAssembly component. #[derive(Clone, Copy, Debug, Eq, PartialEq)] @@ -67,7 +69,7 @@ impl ComponentExternalKind { #[derive(Debug, Clone, Eq, PartialEq)] pub struct ComponentExport<'a> { /// The name of the exported item. - pub name: ComponentExportName<'a>, + pub name: ComponentExternName<'a>, /// The kind of the export. pub kind: ComponentExternalKind, /// The index of the exported item. @@ -113,23 +115,3 @@ impl<'a> FromReader<'a> for ComponentExternalKind { ComponentExternalKind::from_bytes(byte1, byte2, offset) } } - -/// Represents the name of a component export. -#[derive(Debug, Copy, Clone, Eq, PartialEq)] -#[allow(missing_docs)] -pub struct ComponentExportName<'a>(pub &'a str); - -impl<'a> FromReader<'a> for ComponentExportName<'a> { - fn from_reader(reader: &mut BinaryReader<'a>) -> Result { - match reader.read_u8()? { - 0x00 => {} - // Historically export names used a discriminator byte of 0x01 to - // indicate an "interface" of the form `a:b/c` but nowadays that's - // inferred from string syntax. Ignore 0-vs-1 to continue to parse - // older binaries. Eventually this will go away. - 0x01 => {} - x => return reader.invalid_leading_byte(x, "export name"), - } - Ok(ComponentExportName(reader.read_string()?)) - } -} diff --git a/wasmparser-0.247.0/src/readers/component/imports.rs b/wasmparser-0.249.0/src/readers/component/imports.rs similarity index 75% rename from wasmparser-0.247.0/src/readers/component/imports.rs rename to wasmparser-0.249.0/src/readers/component/imports.rs index a24f873241..5c45e663e4 100644 --- a/wasmparser-0.247.0/src/readers/component/imports.rs +++ b/wasmparser-0.249.0/src/readers/component/imports.rs @@ -79,7 +79,7 @@ impl<'a> FromReader<'a> for ComponentTypeRef { #[derive(Debug, Copy, Clone, Eq, PartialEq)] pub struct ComponentImport<'a> { /// The name of the imported item. - pub name: ComponentImportName<'a>, + pub name: ComponentExternName<'a>, /// The type reference for the import. pub ty: ComponentTypeRef, } @@ -112,13 +112,16 @@ pub type ComponentImportSectionReader<'a> = SectionLimited<'a, ComponentImport<' /// Represents the name of a component import. #[derive(Debug, Copy, Clone, Eq, PartialEq)] #[allow(missing_docs)] -pub struct ComponentImportName<'a>(pub &'a str); +pub struct ComponentExternName<'a> { + pub name: &'a str, + pub implements: Option<&'a str>, +} -impl<'a> FromReader<'a> for ComponentImportName<'a> { +impl<'a> FromReader<'a> for ComponentExternName<'a> { fn from_reader(reader: &mut BinaryReader<'a>) -> Result { - match reader.read_u8()? { + let has_options = match reader.read_u8()? { // This is the spec-required byte as of this time. - 0x00 => {} + 0x00 => false, // Prior to WebAssembly/component-model#263 export names used a // discriminator byte of 0x01 to indicate an "interface" of the @@ -136,10 +139,51 @@ impl<'a> FromReader<'a> for ComponentImportName<'a> { // time has passed this case may be able to be removed. When // removing this it's probably best to do it with a `WasmFeatures` // flag first to ensure there's an opt-in way of fixing things. - 0x01 => {} + 0x01 => false, + + 0x02 => { + if reader.cm_implements() { + true + } else { + bail!( + reader.original_position() - 1, + "the `cm-implements` feature is not active" + ) + } + } - x => return reader.invalid_leading_byte(x, "import name"), + x => return reader.invalid_leading_byte(x, "component name"), + }; + let mut ret = ComponentExternName { + name: reader.read_string()?, + implements: None, + }; + if has_options { + for _ in 0..reader.read_var_u32()? { + let pos = reader.original_position(); + match reader.read()? { + ComponentNameOpt::Implements(name) => { + if ret.implements.is_some() { + bail!(pos, "duplicate 'implements' option in name"); + } + ret.implements = Some(name); + } + } + } + } + Ok(ret) + } +} + +enum ComponentNameOpt<'a> { + Implements(&'a str), +} + +impl<'a> FromReader<'a> for ComponentNameOpt<'a> { + fn from_reader(reader: &mut BinaryReader<'a>) -> Result { + match reader.read_u8()? { + 0x00 => Ok(ComponentNameOpt::Implements(reader.read()?)), + x => return reader.invalid_leading_byte(x, "name option"), } - Ok(ComponentImportName(reader.read_string()?)) } } diff --git a/wasmparser-0.247.0/src/readers/component/instances.rs b/wasmparser-0.249.0/src/readers/component/instances.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/component/instances.rs rename to wasmparser-0.249.0/src/readers/component/instances.rs diff --git a/wasmparser-0.247.0/src/readers/component/names.rs b/wasmparser-0.249.0/src/readers/component/names.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/component/names.rs rename to wasmparser-0.249.0/src/readers/component/names.rs diff --git a/wasmparser-0.247.0/src/readers/component/start.rs b/wasmparser-0.249.0/src/readers/component/start.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/component/start.rs rename to wasmparser-0.249.0/src/readers/component/start.rs diff --git a/wasmparser-0.247.0/src/readers/component/types.rs b/wasmparser-0.249.0/src/readers/component/types.rs similarity index 99% rename from wasmparser-0.247.0/src/readers/component/types.rs rename to wasmparser-0.249.0/src/readers/component/types.rs index 5dbc2e5544..7e914cb7fc 100644 --- a/wasmparser-0.247.0/src/readers/component/types.rs +++ b/wasmparser-0.249.0/src/readers/component/types.rs @@ -1,7 +1,7 @@ use crate::limits::*; use crate::prelude::*; use crate::{ - BinaryReader, ComponentAlias, ComponentExportName, ComponentImport, ComponentTypeRef, + BinaryReader, ComponentAlias, ComponentExternName, ComponentImport, ComponentTypeRef, FromReader, Import, RecGroup, Result, SectionLimited, TypeRef, ValType, }; use core::fmt; @@ -326,7 +326,7 @@ pub enum ComponentTypeDeclaration<'a> { /// The component type declaration is for an export. Export { /// The name of the export. - name: ComponentExportName<'a>, + name: ComponentExternName<'a>, /// The type reference for the export. ty: ComponentTypeRef, }, @@ -367,7 +367,7 @@ pub enum InstanceTypeDeclaration<'a> { /// The instance type declaration is for an export. Export { /// The name of the export. - name: ComponentExportName<'a>, + name: ComponentExternName<'a>, /// The type reference for the export. ty: ComponentTypeRef, }, diff --git a/wasmparser-0.247.0/src/readers/core.rs b/wasmparser-0.249.0/src/readers/core.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core.rs rename to wasmparser-0.249.0/src/readers/core.rs diff --git a/wasmparser-0.247.0/src/readers/core/branch_hinting.rs b/wasmparser-0.249.0/src/readers/core/branch_hinting.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/branch_hinting.rs rename to wasmparser-0.249.0/src/readers/core/branch_hinting.rs diff --git a/wasmparser-0.247.0/src/readers/core/code.rs b/wasmparser-0.249.0/src/readers/core/code.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/code.rs rename to wasmparser-0.249.0/src/readers/core/code.rs diff --git a/wasmparser-0.247.0/src/readers/core/coredumps.rs b/wasmparser-0.249.0/src/readers/core/coredumps.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/coredumps.rs rename to wasmparser-0.249.0/src/readers/core/coredumps.rs diff --git a/wasmparser-0.247.0/src/readers/core/custom.rs b/wasmparser-0.249.0/src/readers/core/custom.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/custom.rs rename to wasmparser-0.249.0/src/readers/core/custom.rs diff --git a/wasmparser-0.247.0/src/readers/core/data.rs b/wasmparser-0.249.0/src/readers/core/data.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/data.rs rename to wasmparser-0.249.0/src/readers/core/data.rs diff --git a/wasmparser-0.247.0/src/readers/core/dylink0.rs b/wasmparser-0.249.0/src/readers/core/dylink0.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/dylink0.rs rename to wasmparser-0.249.0/src/readers/core/dylink0.rs diff --git a/wasmparser-0.247.0/src/readers/core/elements.rs b/wasmparser-0.249.0/src/readers/core/elements.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/elements.rs rename to wasmparser-0.249.0/src/readers/core/elements.rs diff --git a/wasmparser-0.247.0/src/readers/core/exports.rs b/wasmparser-0.249.0/src/readers/core/exports.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/exports.rs rename to wasmparser-0.249.0/src/readers/core/exports.rs diff --git a/wasmparser-0.247.0/src/readers/core/functions.rs b/wasmparser-0.249.0/src/readers/core/functions.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/functions.rs rename to wasmparser-0.249.0/src/readers/core/functions.rs diff --git a/wasmparser-0.247.0/src/readers/core/globals.rs b/wasmparser-0.249.0/src/readers/core/globals.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/globals.rs rename to wasmparser-0.249.0/src/readers/core/globals.rs diff --git a/wasmparser-0.247.0/src/readers/core/imports.rs b/wasmparser-0.249.0/src/readers/core/imports.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/imports.rs rename to wasmparser-0.249.0/src/readers/core/imports.rs diff --git a/wasmparser-0.247.0/src/readers/core/init.rs b/wasmparser-0.249.0/src/readers/core/init.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/init.rs rename to wasmparser-0.249.0/src/readers/core/init.rs diff --git a/wasmparser-0.247.0/src/readers/core/linking.rs b/wasmparser-0.249.0/src/readers/core/linking.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/linking.rs rename to wasmparser-0.249.0/src/readers/core/linking.rs diff --git a/wasmparser-0.247.0/src/readers/core/memories.rs b/wasmparser-0.249.0/src/readers/core/memories.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/memories.rs rename to wasmparser-0.249.0/src/readers/core/memories.rs diff --git a/wasmparser-0.247.0/src/readers/core/names.rs b/wasmparser-0.249.0/src/readers/core/names.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/names.rs rename to wasmparser-0.249.0/src/readers/core/names.rs diff --git a/wasmparser-0.247.0/src/readers/core/operators.rs b/wasmparser-0.249.0/src/readers/core/operators.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/operators.rs rename to wasmparser-0.249.0/src/readers/core/operators.rs diff --git a/wasmparser-0.247.0/src/readers/core/producers.rs b/wasmparser-0.249.0/src/readers/core/producers.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/producers.rs rename to wasmparser-0.249.0/src/readers/core/producers.rs diff --git a/wasmparser-0.247.0/src/readers/core/reloc.rs b/wasmparser-0.249.0/src/readers/core/reloc.rs similarity index 93% rename from wasmparser-0.247.0/src/readers/core/reloc.rs rename to wasmparser-0.249.0/src/readers/core/reloc.rs index 42a2037854..600840298a 100644 --- a/wasmparser-0.247.0/src/readers/core/reloc.rs +++ b/wasmparser-0.249.0/src/readers/core/reloc.rs @@ -242,8 +242,12 @@ pub struct RelocationEntry { impl RelocationEntry { /// Byte range relative to the start of the section indicated by /// `RelocSectionReader::section` targeted by this relocation. - pub fn relocation_range(&self) -> Range { - (self.offset as usize)..(self.offset as usize + self.ty.extent()) + pub fn relocation_range(&self) -> Result> { + let start = self.offset as usize; + let end = start + .checked_add(self.ty.extent()) + .ok_or_else(|| crate::BinaryReaderError::new("relocation range end overflow", start))?; + Ok(start..end) } } @@ -298,3 +302,21 @@ impl<'a> FromReader<'a> for RelocationEntry { }) } } + +// Assert that `relocation_range` does not wrap when `offset + extent` exceeds `usize::MAX`. +#[test] +fn relocation_range_does_not_overflow() { + let entry = RelocationEntry { + ty: RelocationType::FunctionIndexLeb, + offset: 0xFFFF_FFFC, + index: 0, + addend: 0, + }; + if cfg!(target_pointer_width = "32") { + assert!(entry.relocation_range().is_err()); + } else { + let range = entry.relocation_range().unwrap(); + assert_eq!(range.start, 0xFFFF_FFFC); + assert_eq!(range.end, 0xFFFF_FFFC + 5); + } +} diff --git a/wasmparser-0.247.0/src/readers/core/tables.rs b/wasmparser-0.249.0/src/readers/core/tables.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/tables.rs rename to wasmparser-0.249.0/src/readers/core/tables.rs diff --git a/wasmparser-0.247.0/src/readers/core/tags.rs b/wasmparser-0.249.0/src/readers/core/tags.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/tags.rs rename to wasmparser-0.249.0/src/readers/core/tags.rs diff --git a/wasmparser-0.247.0/src/readers/core/types.rs b/wasmparser-0.249.0/src/readers/core/types.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/types.rs rename to wasmparser-0.249.0/src/readers/core/types.rs diff --git a/wasmparser-0.247.0/src/readers/core/types/matches.rs b/wasmparser-0.249.0/src/readers/core/types/matches.rs similarity index 100% rename from wasmparser-0.247.0/src/readers/core/types/matches.rs rename to wasmparser-0.249.0/src/readers/core/types/matches.rs diff --git a/wasmparser-0.247.0/src/resources.rs b/wasmparser-0.249.0/src/resources.rs similarity index 100% rename from wasmparser-0.247.0/src/resources.rs rename to wasmparser-0.249.0/src/resources.rs diff --git a/wasmparser-0.247.0/src/validator.rs b/wasmparser-0.249.0/src/validator.rs similarity index 100% rename from wasmparser-0.247.0/src/validator.rs rename to wasmparser-0.249.0/src/validator.rs diff --git a/wasmparser-0.247.0/src/validator/component.rs b/wasmparser-0.249.0/src/validator/component.rs similarity index 94% rename from wasmparser-0.247.0/src/validator/component.rs rename to wasmparser-0.249.0/src/validator/component.rs index 8111d48fae..e1d4ab5bfd 100644 --- a/wasmparser-0.247.0/src/validator/component.rs +++ b/wasmparser-0.249.0/src/validator/component.rs @@ -6,9 +6,9 @@ use super::{ Abi, AliasableResourceId, ComponentAnyTypeId, ComponentCoreInstanceTypeId, ComponentCoreModuleTypeId, ComponentCoreTypeId, ComponentDefinedType, ComponentDefinedTypeId, ComponentEntityType, ComponentFuncType, ComponentFuncTypeId, - ComponentInstanceType, ComponentInstanceTypeId, ComponentType, ComponentTypeId, - ComponentValType, Context, CoreInstanceTypeKind, InstanceType, ModuleType, RecordType, - Remap, Remapping, ResourceId, SubtypeCx, TupleType, VariantCase, VariantType, + ComponentInstanceType, ComponentInstanceTypeId, ComponentItem, ComponentType, + ComponentTypeId, ComponentValType, Context, CoreInstanceTypeKind, InstanceType, ModuleType, + RecordType, Remap, Remapping, ResourceId, SubtypeCx, TupleType, VariantCase, VariantType, }, core::{InternRecGroup, Module}, types::{CoreTypeId, EntityType, TypeAlloc, TypeInfo, TypeList}, @@ -18,7 +18,7 @@ use crate::limits::*; use crate::prelude::*; use crate::validator::names::{ComponentName, ComponentNameKind, KebabStr, KebabString}; use crate::{ - BinaryReaderError, CanonicalFunction, CanonicalOption, ComponentExportName, + BinaryReaderError, CanonicalFunction, CanonicalOption, ComponentExternName, ComponentExternalKind, ComponentOuterAliasKind, ComponentTypeRef, CompositeInnerType, ExternalKind, FuncType, GlobalType, InstantiationArgKind, MemoryType, PackedIndex, RefType, Result, SubType, TableType, TypeBounds, ValType, WasmFeatures, @@ -61,9 +61,9 @@ pub(crate) struct ComponentState { pub instances: Vec, pub components: Vec, - pub imports: IndexMap, + pub imports: IndexMap, pub import_names: IndexSet, - pub exports: IndexMap, + pub exports: IndexMap, pub export_names: IndexSet, has_start: bool, @@ -169,6 +169,10 @@ pub(crate) struct ComponentState { /// Same as `toplevel_exported_resources`, but for imports. toplevel_imported_resources: ComponentNameContext, + + /// The type that's been assigned to slots of `context.{get,set}` by this + /// component. This is `None` until the first intrinsic is seen. + context_type: Option, } #[derive(Copy, Clone, Debug, PartialEq, Eq)] @@ -395,6 +399,18 @@ impl CanonicalOptions { Ok(self) } + fn check_asyncness(&self, ty: &ComponentFuncType, offset: usize) -> Result<()> { + // The `async` canonical ABI option is only allowed with `async`-typed + // functions. + if self.concurrency.is_async() && !ty.async_ { + bail!( + offset, + "the `async` canonical option requires an async function type", + ); + } + Ok(()) + } + pub(crate) fn check_core_type( &self, types: &mut TypeAlloc, @@ -462,6 +478,7 @@ impl ComponentState { imported_types: Default::default(), toplevel_exported_resources: Default::default(), toplevel_imported_resources: Default::default(), + context_type: None, } } @@ -588,8 +605,17 @@ impl ComponentState { } // Current MVP restriction of the component model. - if rep != ValType::I32 { - bail!(offset, "resources can only be represented by `i32`"); + if rep == ValType::I64 && !component.features.cm64() { + bail!( + offset, + "resources with `i64` require the `cm64` feature to be enabled" + ) + } + if rep != ValType::I32 && rep != ValType::I64 { + bail!( + offset, + "resources can only be represented by `i32` or `i64`" + ); } // If specified validate that the destructor is both a valid @@ -627,19 +653,19 @@ impl ComponentState { pub fn add_import( &mut self, - import: crate::ComponentImport, + import: crate::ComponentImport<'_>, types: &mut TypeAlloc, offset: usize, ) -> Result<()> { let mut entity = self.check_type_ref(&import.ty, types, offset)?; self.add_entity( &mut entity, - Some((import.name.0, ExternKind::Import)), + Some((import.name.name, ExternKind::Import)), types, offset, )?; self.toplevel_imported_resources.validate_extern( - import.name.0, + &import.name, ExternKind::Import, &entity, types, @@ -846,10 +872,9 @@ impl ComponentState { // itself are valid to import/export, recursive instances are // captured, and everything is appropriately added to the right // imported/exported set. - ComponentEntityType::Instance(i) => types[*i] - .exports - .iter() - .all(|(_name, ty)| self.validate_and_register_named_types(None, kind, ty, types)), + ComponentEntityType::Instance(i) => types[*i].exports.iter().all(|(_name, ty)| { + self.validate_and_register_named_types(None, kind, &ty.ty, types) + }), // All types referred to by a function must be named. ComponentEntityType::Func(id) => self.all_valtypes_named_in_func(types, *id, set), @@ -895,17 +920,17 @@ impl ComponentState { ) -> bool { // Instances must recursively have all referenced types named. let ty = &types[id]; - ty.exports.values().all(|ty| match ty { + ty.exports.values().all(|ty| match ty.ty { ComponentEntityType::Module(_) => true, - ComponentEntityType::Func(id) => self.all_valtypes_named_in_func(types, *id, set), + ComponentEntityType::Func(id) => self.all_valtypes_named_in_func(types, id, set), ComponentEntityType::Type { created: id, .. } => { - self.all_valtypes_named(types, *id, set) + self.all_valtypes_named(types, id, set) } ComponentEntityType::Value(ComponentValType::Type(id)) => { - self.all_valtypes_named_in_defined(types, *id, set) + self.all_valtypes_named_in_defined(types, id, set) } ComponentEntityType::Instance(id) => { - self.all_valtypes_named_in_instance(types, *id, set) + self.all_valtypes_named_in_instance(types, id, set) } ComponentEntityType::Component(_) | ComponentEntityType::Value(ComponentValType::Primitive(_)) => return true, @@ -1047,7 +1072,7 @@ impl ComponentState { // Using the old-to-new resource mapping perform a substitution on // the `exports` and `explicit_resources` fields of `new_ty` for ty in new_ty.exports.values_mut() { - types.remap_component_entity(ty, &mut mapping); + types.remap_component_entity(&mut ty.ty, &mut mapping); } for (id, path) in mem::take(&mut new_ty.explicit_resources) { let id = *mapping.resources.get(&id).unwrap_or(&id); @@ -1101,7 +1126,7 @@ impl ComponentState { self.defined_resources.insert(new.resource(), None); } for ty in new_ty.exports.values_mut() { - types.remap_component_entity(ty, &mut mapping); + types.remap_component_entity(&mut ty.ty, &mut mapping); } for (id, path) in mem::take(&mut new_ty.explicit_resources) { let id = mapping.resources.get(&id).copied().unwrap_or(id); @@ -1126,7 +1151,7 @@ impl ComponentState { pub fn add_export( &mut self, - name: ComponentExportName<'_>, + name: ComponentExternName<'_>, mut ty: ComponentEntityType, types: &mut TypeAlloc, offset: usize, @@ -1135,9 +1160,14 @@ impl ComponentState { if check_limit { check_max(self.exports.len(), 1, MAX_WASM_EXPORTS, "exports", offset)?; } - self.add_entity(&mut ty, Some((name.0, ExternKind::Export)), types, offset)?; + self.add_entity( + &mut ty, + Some((name.name, ExternKind::Export)), + types, + offset, + )?; self.toplevel_exported_resources.validate_extern( - name.0, + &name, ExternKind::Export, &ty, types, @@ -1194,8 +1224,8 @@ impl ComponentState { self.task_return(&result, &options, types, offset) } CanonicalFunction::TaskCancel => self.task_cancel(types, offset), - CanonicalFunction::ContextGet(i) => self.context_get(i, types, offset), - CanonicalFunction::ContextSet(i) => self.context_set(i, types, offset), + CanonicalFunction::ContextGet { ty, slot } => self.context_get(ty, slot, types, offset), + CanonicalFunction::ContextSet { ty, slot } => self.context_set(ty, slot, types, offset), CanonicalFunction::ThreadYield { cancellable: _ } => self.thread_yield(types, offset), CanonicalFunction::SubtaskDrop => self.subtask_drop(types, offset), CanonicalFunction::SubtaskCancel { async_ } => { @@ -1225,7 +1255,7 @@ impl ComponentState { self.future_read(ty, &options, types, offset) } CanonicalFunction::FutureWrite { ty, options } => { - self.future_write(ty, options.into_vec(), types, offset) + self.future_write(ty, &options, types, offset) } CanonicalFunction::FutureCancelRead { ty, async_ } => { self.future_cancel_read(ty, async_, types, offset) @@ -1294,6 +1324,7 @@ impl ComponentState { // export signature let mut options = self.check_options(types, options, offset)?; options.check_lift(types, self, core_ty_id, offset)?; + options.check_asyncness(ty, offset)?; let func_ty = ty.lower(types, &options, Abi::Lift, offset)?; let lowered_core_ty_id = func_ty.intern(types, offset); @@ -1350,6 +1381,8 @@ impl ComponentState { // the expected canonical ABI import signature. let options = self.check_options(types, options, offset)?; options.check_lower(offset)?; + options.check_asyncness(ty, offset)?; + let func_ty = ty.lower(types, &options, Abi::Lower, offset)?; let ty_id = func_ty.intern(types, offset); @@ -1377,10 +1410,10 @@ impl ComponentState { types: &mut TypeAlloc, offset: usize, ) -> Result<()> { - if !self.features.cm_async_builtins() { + if !self.features.cm_more_async_builtins() { bail!( offset, - "`resource.drop` as `async` requires the component model async builtins feature" + "`resource.drop` as `async` requires the component model more async builtins feature" ) } self.resource_at(resource, types, offset)?; @@ -1508,31 +1541,74 @@ impl ComponentState { Ok(()) } - fn context_get(&mut self, i: u32, types: &mut TypeAlloc, offset: usize) -> Result<()> { + fn context_get( + &mut self, + ty: ValType, + i: u32, + types: &mut TypeAlloc, + offset: usize, + ) -> Result<()> { if !self.features.cm_async() { bail!( offset, "`context.get` requires the component model async feature" ) } + self.validate_context_type(ty, "context.get", offset)?; self.validate_context_immediate(i, "context.get", offset)?; self.core_funcs - .push(types.intern_func_type(FuncType::new([], [ValType::I32]), offset)); + .push(types.intern_func_type(FuncType::new([], [ty]), offset)); Ok(()) } - fn context_set(&mut self, i: u32, types: &mut TypeAlloc, offset: usize) -> Result<()> { + fn context_set( + &mut self, + ty: ValType, + i: u32, + types: &mut TypeAlloc, + offset: usize, + ) -> Result<()> { if !self.features.cm_async() { bail!( offset, "`context.set` requires the component model async feature" ) } + self.validate_context_type(ty, "context.set", offset)?; self.validate_context_immediate(i, "context.set", offset)?; self.core_funcs - .push(types.intern_func_type(FuncType::new([ValType::I32], []), offset)); + .push(types.intern_func_type(FuncType::new([ty], []), offset)); + Ok(()) + } + + fn validate_context_type(&mut self, ty: ValType, intrinsic: &str, offset: usize) -> Result<()> { + match ty { + ValType::I32 => {} + ValType::I64 => { + if !self.features.cm64() { + bail!( + offset, + "64-bit `{intrinsic}` requires the component model 64-bit feature" + ) + } + {} + } + _ => bail!(offset, "`{intrinsic}` only supports `i32` or `i64`"), + } + + match self.context_type { + None => self.context_type = Some(ty), + Some(other) => { + if other != ty { + bail!( + offset, + "`{intrinsic}` type must match previous context type" + ) + } + } + } Ok(()) } @@ -1569,10 +1645,10 @@ impl ComponentState { "`subtask.cancel` requires the component model async feature" ) } - if async_ && !self.features.cm_async_builtins() { + if async_ && !self.features.cm_more_async_builtins() { bail!( offset, - "async `subtask.cancel` requires the component model async builtins feature" + "async `subtask.cancel` requires the component model more async builtins feature" ) } @@ -1618,8 +1694,14 @@ impl ComponentState { bail!(offset, "`stream.read` requires a stream type") }; - let ty_id = self - .check_options(types, options, offset)? + let options = self.check_options(types, options, offset)?; + if options.concurrency.is_sync() && !self.features.cm_more_async_builtins() { + bail!( + offset, + "synchronous `stream.read` requires the component model more async builtins feature" + ); + } + let ty_id = options .require_memory_if(offset, || elem_ty.is_some())? .require_realloc_if(offset, || elem_ty.is_some_and(|ty| ty.contains_ptr(types)))? .check_lower(offset)? @@ -1652,8 +1734,14 @@ impl ComponentState { bail!(offset, "`stream.write` requires a stream type") }; - let ty_id = self - .check_options(types, options, offset)? + let options = self.check_options(types, options, offset)?; + if options.concurrency.is_sync() && !self.features.cm_more_async_builtins() { + bail!( + offset, + "synchronous `stream.write` requires the component model more async builtins feature" + ); + } + let ty_id = options .require_memory_if(offset, || elem_ty.is_some())? .check_lower(offset)? .check_core_type( @@ -1679,10 +1767,10 @@ impl ComponentState { "`stream.cancel-read` requires the component model async feature" ) } - if cancellable && !self.features.cm_async_builtins() { + if cancellable && !self.features.cm_more_async_builtins() { bail!( offset, - "async `stream.cancel-read` requires the component model async builtins feature" + "async `stream.cancel-read` requires the component model more async builtins feature" ) } @@ -1709,10 +1797,10 @@ impl ComponentState { "`stream.cancel-write` requires the component model async feature" ) } - if cancellable && !self.features.cm_async_builtins() { + if cancellable && !self.features.cm_more_async_builtins() { bail!( offset, - "async `stream.cancel-write` requires the component model async builtins feature" + "async `stream.cancel-write` requires the component model more async builtins feature" ) } @@ -1809,8 +1897,14 @@ impl ComponentState { bail!(offset, "`future.read` requires a future type") }; - let ty_id = self - .check_options(types, options, offset)? + let options = self.check_options(types, options, offset)?; + if options.concurrency.is_sync() && !self.features.cm_more_async_builtins() { + bail!( + offset, + "synchronous `future.read` requires the component model more async builtins feature" + ); + } + let ty_id = options .require_memory_if(offset, || elem_ty.is_some())? .require_realloc_if(offset, || elem_ty.is_some_and(|ty| ty.contains_ptr(types)))? .check_lower(offset)? @@ -1827,7 +1921,7 @@ impl ComponentState { fn future_write( &mut self, ty: u32, - options: Vec, + options: &[CanonicalOption], types: &mut TypeAlloc, offset: usize, ) -> Result<()> { @@ -1843,8 +1937,14 @@ impl ComponentState { bail!(offset, "`future.write` requires a future type") }; - let ty_id = self - .check_options(types, &options, offset)? + let options = self.check_options(types, &options, offset)?; + if options.concurrency.is_sync() && !self.features.cm_more_async_builtins() { + bail!( + offset, + "synchronous `future.write` requires the component model more async builtins feature" + ); + } + let ty_id = options .require_memory_if(offset, || elem_ty.is_some())? .check_core_type( types, @@ -1869,10 +1969,10 @@ impl ComponentState { "`future.cancel-read` requires the component model async feature" ) } - if cancellable && !self.features.cm_async_builtins() { + if cancellable && !self.features.cm_more_async_builtins() { bail!( offset, - "async `future.cancel-read` requires the component model async builtins feature" + "async `future.cancel-read` requires the component model more async builtins feature" ) } @@ -1899,10 +1999,10 @@ impl ComponentState { "`future.cancel-write` requires the component model async feature" ) } - if cancellable && !self.features.cm_async_builtins() { + if cancellable && !self.features.cm_more_async_builtins() { bail!( offset, - "async `future.cancel-write` requires the component model async builtins feature" + "async `future.cancel-write` requires the component model more async builtins feature" ) } @@ -2626,17 +2726,7 @@ impl ComponentState { CanonicalOption::Realloc(idx) => { realloc = match realloc { None => { - let ty_id = self.core_function_at(*idx, offset)?; - let func_ty = types[ty_id].unwrap_func(); - if func_ty.params() - != [ValType::I32, ValType::I32, ValType::I32, ValType::I32] - || func_ty.results() != [ValType::I32] - { - return Err(BinaryReaderError::new( - "canonical option `realloc` uses a core function with an incorrect signature", - offset, - )); - } + // Validation deferred because it may depend on the memory option. Some(*idx) } Some(_) => { @@ -2762,6 +2852,33 @@ impl ComponentState { bail!(offset, "cannot specify `core-type` without `gc`") } + // Validate `realloc` + if let Some(realloc_idx) = realloc { + let mty = match memory { + Some(i) => self.memory_at(i, offset)?, + None => { + return Err(BinaryReaderError::new( + "canonical option `realloc` requires `memory` to also be specified", + offset, + )); + } + }; + let addr_type = match mty.memory64 { + true => ValType::I64, + false => ValType::I32, + }; + let ty_id = self.core_function_at(realloc_idx, offset)?; + let func_ty = types[ty_id].unwrap_func(); + if func_ty.params() != [addr_type, addr_type, addr_type, addr_type] + || func_ty.results() != [addr_type] + { + return Err(BinaryReaderError::new( + "canonical option `realloc` uses a core function with an incorrect signature", + offset, + )); + } + } + Ok(CanonicalOptions { string_encoding, memory, @@ -3314,7 +3431,7 @@ impl ComponentState { let mut exports = component_type.exports.clone(); let mut info = TypeInfo::new(); for (_, ty) in component_type.exports.iter() { - info.combine(ty.info(types), offset)?; + info.combine(ty.ty.info(types), offset)?; } // Perform the subtype check that `args` matches the imports of @@ -3376,7 +3493,7 @@ impl ComponentState { // references to the component's defined resources are rebound to the // fresh ones introduced just above. for entity in exports.values_mut() { - types.remap_component_entity(entity, &mut mapping); + types.remap_component_entity(&mut entity.ty, &mut mapping); } let component_type = &types[component_type_id]; let explicit_resources = component_type @@ -3412,7 +3529,7 @@ impl ComponentState { if cfg!(debug_assertions) { let mut free = IndexSet::default(); for ty in exports.values() { - types.free_variables_component_entity(ty, &mut free); + types.free_variables_component_entity(&ty.ty, &mut free); } assert!(fresh_defined_resources.is_subset(&free)); for resource in fresh_defined_resources.iter() { @@ -3517,7 +3634,7 @@ impl ComponentState { }; names.validate_extern( - export.name.0, + &export.name, ExternKind::Export, &ty, types, @@ -3753,14 +3870,14 @@ impl ComponentState { .exports .get(name) { - Some(ty) => *ty, + Some(ty) => ty.ty, None => bail!( offset, "instance {instance_index} has no export named `{name}`" ), }; - let ok = match (&ty, kind) { + let ok = match (ty, kind) { (ComponentEntityType::Module(_), ComponentExternalKind::Module) => true, (ComponentEntityType::Module(_), _) => false, (ComponentEntityType::Component(_), ComponentExternalKind::Component) => true, @@ -4351,25 +4468,24 @@ impl ComponentState { /// Validates that the linear memory at `idx` is valid to use as a canonical /// ABI memory. /// - /// At this time this requires that the memory is a plain 32-bit linear - /// memory. Notably this disallows shared memory and 64-bit linear memories. + /// At this time this requires that the memory is a plain 32-bit or 64-bit linear + /// memory. Notably this disallows shared memory. fn cabi_memory_at(&self, idx: u32, offset: usize) -> Result<()> { let ty = self.memory_at(idx, offset)?; - SubtypeCx::memory_type( - ty, - &MemoryType { - initial: 0, - maximum: None, - memory64: false, - shared: false, - page_size_log2: None, - }, - offset, - ) - .map_err(|mut e| { - e.add_context("canonical ABI memory is not a 32-bit linear memory".into()); - e - }) + let valid_memory_type = MemoryType { + initial: 0, + maximum: None, + memory64: ty.memory64, + shared: false, + page_size_log2: None, + }; + if ty.memory64 && !self.features.cm64() { + bail!( + offset, + "64-bit memories require the `cm64` feature to be enabled" + ); + } + SubtypeCx::memory_type(ty, &valid_memory_type, offset) } /// Completes the translation of this component, performing final @@ -4405,7 +4521,7 @@ impl ComponentState { // of `self.defined_resources` which show up. let mut free = IndexSet::default(); for ty in ty.imports.values() { - types.free_variables_component_entity(ty, &mut free); + types.free_variables_component_entity(&ty.ty, &mut free); } for (resource, _path) in self.defined_resources.iter() { // FIXME: this error message is quite opaque and doesn't indicate @@ -4444,7 +4560,7 @@ impl ComponentState { // abundance of caution. free.clear(); for ty in ty.exports.values() { - types.free_variables_component_entity(ty, &mut free); + types.free_variables_component_entity(&ty.ty, &mut free); } for (id, _rep) in mem::take(&mut self.defined_resources) { if !free.contains(&id) { @@ -4530,20 +4646,26 @@ impl ComponentNameContext { fn validate_extern( &self, - name: &str, + name: &ComponentExternName<'_>, kind: ExternKind, ty: &ComponentEntityType, types: &TypeAlloc, offset: usize, kind_names: &mut IndexSet, - items: &mut IndexMap, + items: &mut IndexMap, info: &mut TypeInfo, features: &WasmFeatures, ) -> Result<()> { // First validate that `name` is even a valid kebab name, meaning it's // in kebab-case, is an ID, etc. - let kebab = ComponentName::new_with_features(name, offset, *features) - .with_context(|| format!("{} name `{name}` is not a valid extern name", kind.desc()))?; + let kebab = + ComponentName::new_with_features(name.name, offset, *features).with_context(|| { + format!( + "{} name `{}` is not a valid extern name", + kind.desc(), + name.name + ) + })?; if let ExternKind::Export = kind { match kebab.kind() { @@ -4556,11 +4678,37 @@ impl ComponentNameContext { ComponentNameKind::Hash(_) | ComponentNameKind::Url(_) | ComponentNameKind::Dependency(_) => { - bail!(offset, "name `{name}` is not a valid export name") + bail!(offset, "name `{}` is not a valid export name", name.name) } } } + if let Some(implements) = name.implements { + if !features.cm_implements() { + bail!(offset, "the `cm-implements` feature is not active"); + } + match kebab.kind() { + ComponentNameKind::Label(_) => {} + _ => bail!( + offset, + "name `{}` is not valid with `implements`", + name.name + ), + } + + match ty { + ComponentEntityType::Instance(_) => {} + _ => bail!(offset, "only instance names can have an `implements`"), + } + + let implements = ComponentName::new_with_features(implements, offset, *features) + .with_context(|| format!("`{implements}` is not a valid name"))?; + match implements.kind() { + ComponentNameKind::Interface(_) => {} + _ => bail!(offset, "name `{implements}` must be an interface"), + } + } + // Validate that the kebab name, if it has structure such as // `[method]a.b`, is indeed valid with respect to known resources. self.validate(&kebab, ty, types, offset) @@ -4580,17 +4728,21 @@ impl ComponentNameContext { // Otherwise all strings must be unique, regardless of their name, so // consult the `items` set to ensure that we're not for example // importing the same interface ID twice. - match items.entry(name.to_string()) { + match items.entry(name.name.to_string()) { Entry::Occupied(e) => { bail!( offset, "{kind} name `{name}` conflicts with previous name `{prev}`", + name = name.name, kind = kind.desc(), prev = e.key(), ); } Entry::Vacant(e) => { - e.insert(*ty); + e.insert(ComponentItem { + ty: *ty, + implements: name.implements.map(|s| s.to_string()), + }); info.combine(ty.info(types), offset)?; } } diff --git a/wasmparser-0.247.0/src/validator/component_types.rs b/wasmparser-0.249.0/src/validator/component_types.rs similarity index 98% rename from wasmparser-0.247.0/src/validator/component_types.rs rename to wasmparser-0.249.0/src/validator/component_types.rs index 147f10ace0..32deb68c2a 100644 --- a/wasmparser-0.247.0/src/validator/component_types.rs +++ b/wasmparser-0.249.0/src/validator/component_types.rs @@ -969,13 +969,13 @@ pub struct ComponentType { /// /// Each import has its own kebab-name and an optional URL listed. Note that /// the set of import names is disjoint with the set of export names. - pub imports: IndexMap, + pub imports: IndexMap, /// The exports of the component type. /// /// Each export has its own kebab-name and an optional URL listed. Note that /// the set of export names is disjoint with the set of import names. - pub exports: IndexMap, + pub exports: IndexMap, /// Universally quantified resources required to be provided when /// instantiating this component type. @@ -1015,6 +1015,16 @@ pub struct ComponentType { pub explicit_resources: IndexMap>, } +/// Either an import or an export within [`ComponentType`] or +/// [`ComponentInstanceType`]. +#[derive(Debug, Clone)] +pub struct ComponentItem { + /// The type of this item. + pub ty: ComponentEntityType, + /// The optional `(implements "...")` metadata, if specified. + pub implements: Option, +} + impl TypeData for ComponentType { type Id = ComponentTypeId; const IS_CORE_SUB_TYPE: bool = false; @@ -1032,7 +1042,7 @@ pub struct ComponentInstanceType { /// The list of exports, keyed by name, that this instance has. /// /// An optional URL and type of each export is provided as well. - pub exports: IndexMap, + pub exports: IndexMap, /// The list of "defined resources" or those which are closed over in /// this instance type. @@ -2023,18 +2033,18 @@ impl<'a> TypesRef<'a> { } /// Gets the component entity type for the given component import. - pub fn component_entity_type_of_import(&self, name: &str) -> Option { + pub fn component_item_for_import(&self, name: &str) -> Option<&'a ComponentItem> { match &self.kind { TypesRefKind::Module(_) => None, - TypesRefKind::Component(component) => Some(*component.imports.get(name)?), + TypesRefKind::Component(component) => Some(component.imports.get(name)?), } } /// Gets the component entity type for the given component export. - pub fn component_entity_type_of_export(&self, name: &str) -> Option { + pub fn component_item_for_export(&self, name: &str) -> Option<&'a ComponentItem> { match &self.kind { TypesRefKind::Module(_) => None, - TypesRefKind::Component(component) => Some(*component.exports.get(name)?), + TypesRefKind::Component(component) => Some(component.exports.get(name)?), } } @@ -2187,13 +2197,13 @@ impl Types { } /// Gets the component entity type for the given component import name. - pub fn component_entity_type_of_import(&self, name: &str) -> Option { - self.as_ref().component_entity_type_of_import(name) + pub fn component_item_for_import(&self, name: &str) -> Option<&ComponentItem> { + self.as_ref().component_item_for_import(name) } /// Gets the component entity type for the given component export name. - pub fn component_entity_type_of_export(&self, name: &str) -> Option { - self.as_ref().component_entity_type_of_export(name) + pub fn component_item_for_export(&self, name: &str) -> Option<&ComponentItem> { + self.as_ref().component_item_for_export(name) } /// Attempts to lookup the type id that `ty` is an alias of. @@ -2571,7 +2581,7 @@ impl TypeAlloc { // defined resources, so doing this all in one go should be // equivalent. for ty in i.imports.values().chain(i.exports.values()) { - self.free_variables_component_entity(ty, set); + self.free_variables_component_entity(&ty.ty, set); } for (id, _path) in i.imported_resources.iter().chain(&i.defined_resources) { set.swap_remove(id); @@ -2588,7 +2598,7 @@ impl TypeAlloc { // types but then remove those defined by this component instance // itself. for ty in i.exports.values() { - self.free_variables_component_entity(ty, set); + self.free_variables_component_entity(&ty.ty, set); } for id in i.defined_resources.iter() { set.swap_remove(id); @@ -2811,7 +2821,7 @@ where let mut any_changed = false; let mut ty = self[*id].clone(); for ty in ty.imports.values_mut().chain(ty.exports.values_mut()) { - any_changed |= self.remap_component_entity(ty, map); + any_changed |= self.remap_component_entity(&mut ty.ty, map); } for (id, _) in ty .imported_resources @@ -2906,7 +2916,7 @@ where let mut any_changed = false; let mut tmp = self[*id].clone(); for ty in tmp.exports.values_mut() { - any_changed |= self.remap_component_entity(ty, map); + any_changed |= self.remap_component_entity(&mut ty.ty, map); } for id in tmp.defined_resources.iter_mut() { if let Some(new) = map.resources.get(id) { @@ -3208,7 +3218,7 @@ impl<'a> SubtypeCx<'a> { let b_imports = self.b[b] .imports .iter() - .map(|(name, ty)| (name.clone(), *ty)) + .map(|(name, ty)| (name.clone(), ty.ty)) .collect(); self.swap(); let mut import_mapping = @@ -3218,7 +3228,7 @@ impl<'a> SubtypeCx<'a> { let mut a_exports = this.a[a] .exports .iter() - .map(|(name, ty)| (name.clone(), *ty)) + .map(|(name, ty)| (name.clone(), ty.ty)) .collect::>(); for ty in a_exports.values_mut() { this.a.remap_component_entity(ty, &mut import_mapping); @@ -3247,7 +3257,7 @@ impl<'a> SubtypeCx<'a> { let mut exports = Vec::with_capacity(b.exports.len()); for (k, b) in b.exports.iter() { match a.exports.get(k) { - Some(a) => exports.push((*a, *b)), + Some(a) => exports.push((a.ty, b.ty)), None => bail!(offset, "missing expected export `{k}`"), } } @@ -3510,7 +3520,7 @@ impl<'a> SubtypeCx<'a> { // Lookup the first path item in `imports` and the corresponding // entry in `args` by name. let (name, ty) = entities.get_index(path[0]).unwrap(); - let mut ty = *ty; + let mut ty = ty.ty; let mut arg = a.get(name); // Lookup all the subsequent `path` entries, if any, by index in @@ -3522,9 +3532,11 @@ impl<'a> SubtypeCx<'a> { _ => unreachable!(), }; let (name, next_ty) = self.b[id].exports.get_index(i).unwrap(); - ty = *next_ty; + ty = next_ty.ty; arg = match arg { - Some(ComponentEntityType::Instance(id)) => self.a[*id].exports.get(name), + Some(ComponentEntityType::Instance(id)) => { + self.a[*id].exports.get(name).map(|t| &t.ty) + } _ => continue 'outer, }; } @@ -3566,7 +3578,7 @@ impl<'a> SubtypeCx<'a> { let mut to_typecheck = Vec::new(); for (name, expected) in entities.iter() { match a.get(name) { - Some(arg) => to_typecheck.push((*arg, *expected)), + Some(arg) => to_typecheck.push((*arg, expected.ty)), None => bail!(offset, "missing {} named `{name}`", kind.desc()), } } @@ -3920,8 +3932,8 @@ impl<'a> SubtypeCx<'a> { (ComponentEntityType::Instance(expected), ComponentEntityType::Instance(actual)) => { let actual = &self.a[actual]; for (name, expected) in self.b[expected].exports.iter() { - let actual = actual.exports[name]; - self.register_type_renamings(actual, *expected, type_map); + let actual = actual.exports[name].ty; + self.register_type_renamings(actual, expected.ty, type_map); } } _ => {} diff --git a/wasmparser-0.247.0/src/validator/core.rs b/wasmparser-0.249.0/src/validator/core.rs similarity index 100% rename from wasmparser-0.247.0/src/validator/core.rs rename to wasmparser-0.249.0/src/validator/core.rs diff --git a/wasmparser-0.247.0/src/validator/core/canonical.rs b/wasmparser-0.249.0/src/validator/core/canonical.rs similarity index 100% rename from wasmparser-0.247.0/src/validator/core/canonical.rs rename to wasmparser-0.249.0/src/validator/core/canonical.rs diff --git a/wasmparser-0.247.0/src/validator/func.rs b/wasmparser-0.249.0/src/validator/func.rs similarity index 100% rename from wasmparser-0.247.0/src/validator/func.rs rename to wasmparser-0.249.0/src/validator/func.rs diff --git a/wasmparser-0.247.0/src/validator/names.rs b/wasmparser-0.249.0/src/validator/names.rs similarity index 100% rename from wasmparser-0.247.0/src/validator/names.rs rename to wasmparser-0.249.0/src/validator/names.rs diff --git a/wasmparser-0.247.0/src/validator/operators.rs b/wasmparser-0.249.0/src/validator/operators.rs similarity index 100% rename from wasmparser-0.247.0/src/validator/operators.rs rename to wasmparser-0.249.0/src/validator/operators.rs diff --git a/wasmparser-0.247.0/src/validator/operators/simd.rs b/wasmparser-0.249.0/src/validator/operators/simd.rs similarity index 100% rename from wasmparser-0.247.0/src/validator/operators/simd.rs rename to wasmparser-0.249.0/src/validator/operators/simd.rs diff --git a/wasmparser-0.247.0/src/validator/operators/transaction.rs b/wasmparser-0.249.0/src/validator/operators/transaction.rs similarity index 100% rename from wasmparser-0.247.0/src/validator/operators/transaction.rs rename to wasmparser-0.249.0/src/validator/operators/transaction.rs diff --git a/wasmparser-0.247.0/src/validator/operators/transaction_disabled.rs b/wasmparser-0.249.0/src/validator/operators/transaction_disabled.rs similarity index 100% rename from wasmparser-0.247.0/src/validator/operators/transaction_disabled.rs rename to wasmparser-0.249.0/src/validator/operators/transaction_disabled.rs diff --git a/wasmparser-0.247.0/src/validator/types.rs b/wasmparser-0.249.0/src/validator/types.rs similarity index 100% rename from wasmparser-0.247.0/src/validator/types.rs rename to wasmparser-0.249.0/src/validator/types.rs diff --git a/wasmparser-0.247.0/tests/big-module.rs b/wasmparser-0.249.0/tests/big-module.rs similarity index 100% rename from wasmparser-0.247.0/tests/big-module.rs rename to wasmparser-0.249.0/tests/big-module.rs diff --git a/wast-247.0.0/.cargo_vcs_info.json b/wast-247.0.0/.cargo_vcs_info.json deleted file mode 100644 index 9d9343136c..0000000000 --- a/wast-247.0.0/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "0285a4680738439cb884d2674bec8be1e8beac5c" - }, - "path_in_vcs": "crates/wast" -} \ No newline at end of file diff --git a/wast-247.0.0/.cargo-checksum.json b/wast-249.0.0/.cargo-checksum.json similarity index 93% rename from wast-247.0.0/.cargo-checksum.json rename to wast-249.0.0/.cargo-checksum.json index 927538afe5..38d3915389 100644 --- a/wast-247.0.0/.cargo-checksum.json +++ b/wast-249.0.0/.cargo-checksum.json @@ -1 +1 @@ -{"files":{".cargo_vcs_info.json":"2a0d78c5035d28ed5e7ac5c5933e5fd767fdcb4aaa3b30b77bf5bc3a7e16b552","Cargo.lock":"a67261b8a456a47ba526318d7e45c2450b9966215c78e59bb70a258d803ae8aa","Cargo.toml":"5a3daa35d85641ed125bc1452d959df50b7ef910ae852f5493a246ea604b89cd","Cargo.toml.orig":"43358f0790e870af6df148f471e8a6dbce81b6cd9e8237417b24eaa1f63d9b21","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"5a0d2b894a3ac74ee2be74715a2f22c40a08520cb4ac59183f4e7356f34ac566","src/component.rs":"154cdef2003b1607ab21a50a821b455da854b78d353d573586351c2593ed70a2","src/component/alias.rs":"e332dfa40bd8990c5b38de468e47a10a00390126ae87f713085ae1c126ee6ff9","src/component/binary.rs":"e2d7bf1e78a9744f02050c3690f497c0784ed4abdf88f724c103485dec47ed5e","src/component/component.rs":"8115ecb0b97d904eccc1e2dbbe09dbaec7068fb587e4f17d0eba3e15e29d9cf3","src/component/custom.rs":"f5b23c34b73a716a986fd999fc8d8c9e24c341e83292088fe83325cd82dab4f5","src/component/expand.rs":"912adffd1d0ca93c98e6c96208a305fcf83efa492e9df1ad3a12db2944dc68b1","src/component/export.rs":"f51e824c839d8bb0884eca509622f376c8cce3335be324b2b25033af6216fd2a","src/component/func.rs":"e2a24c3fc53a899cbe94fed7076b663bc258703b01c21a358481b3684947d2a5","src/component/import.rs":"add63978787f5bfad1faeb1ce6b121fa60bbcd9a736afd7ae81ddc9f5b031107","src/component/instance.rs":"e550a7ee9af092ae084dd41e2c0ae756b7dca8da4b91d672d90265a6a15dff83","src/component/item_ref.rs":"e9c426ccc0210dc0c37bb0448468f5f4d9e52656b72d4ff0f2dc65c89957fe60","src/component/module.rs":"d27a28199d1dea1c64294a514329a524432319288515b0a0e3091fa7d3a33f74","src/component/resolve.rs":"5aa0b2cf510177f2e58d4b43afbabd8bd249df8976a8f91fb801d374a4dfcf8e","src/component/types.rs":"a407172a35079363cdff5c2da46b68f59f12c87076d57a285a578e1f9eb8d6da","src/component/wast.rs":"aa39db0ea0acd38744dc3cbd35903c9b00b5de90a5bfc8b76e6b6a7581d7c4c0","src/component_disabled.rs":"20e2d9c28efe2ecf14f96f8d8971eddc23d0df9494fb527e79ed64b449f2de72","src/core.rs":"c82d7356515f675f9173f9bf5d7c0f4e56ca7a3eebc92b5f95a2d04882ca470c","src/core/binary.rs":"6d70532de69218cc44a187534a363613c45a134f311e1f9483c41f8125bc46d8","src/core/binary/dwarf.rs":"90c02e25e2dc33b972fabfa31ed014d13a7ddf48d1c103182c4e82ba87ca77cd","src/core/binary/dwarf_disabled.rs":"67ad94dd4307fb6af9757f427267193b758b8ca34c3f69bed87a65be04b09c13","src/core/custom.rs":"b3ff3aa5073826b04e0dc0eef80e34bb2c44223fc121e26267de411f45e140b2","src/core/export.rs":"1322a120d9e1dd6f3aa1485ee0bbc4294961028ae8a7584a24170af5823b73b1","src/core/expr.rs":"3ebd763d2ff000489790d93e6b4b82c833b970f8fafa3e89861d2bb55ad03b47","src/core/func.rs":"2f9fca12d160fdce9cf569fc868c2fd4acee2c4508f559ea33c5a41c0fbf06a5","src/core/global.rs":"dec0abecadd2fde9298acb729259deba1ef3c4733ae5afcb4fe8cd4a633f5349","src/core/import.rs":"1e51e9e64825b5c1ae593464b2377e4ebfce22f354f5d3462480a7c2edc6b4c3","src/core/memory.rs":"68fa3317cdb9e099cdcfb5e6750d3427e7146dc4fdecf48982d7a2a43462dc7f","src/core/module.rs":"8ea3f9c4b1d35f84800e0ef385b8ac5fff184c32703b2c81650db8edf5b23c27","src/core/resolve/deinline_import_export.rs":"22c818d461ea5899c47c4f50a2d836da2c7d8ff40d22424902f5cf763bc00180","src/core/resolve/mod.rs":"4d248d3142f4c07021e4cb460ef9e07c77dc0666568a161fa654bb1d6e6c9755","src/core/resolve/names.rs":"3e7ccbcacf40e53327383ca34de8d0c45dd927d0a44ff2a9d64c42868efff970","src/core/resolve/types.rs":"64b46cf12b0ffe72cc8b00f8e371b7bd7e8993706c8c6a1e1c8f82048766987e","src/core/table.rs":"97ffb7a572f35710c8948a1d4dee7706aa18a41a92c6f2b11252495fe4dca29e","src/core/tag.rs":"8a3d4fcdb86dedd68cdaf25abd930ef52a461cf2a0e9393bb9cb6f425afaaf2e","src/core/types.rs":"2becc668864259d5896a9b10ff7df520b6bd7bcb683a0db70416fa3e35fc5fc9","src/core/wast.rs":"a2748b92bb9789cb0314ca973c30d4eb09125cc40a57de916c096124530b397b","src/encode.rs":"610c9c4f0da9f6078c68a0164518869bfb6fe8e408b43db8718da0c01cdcf992","src/error.rs":"d7670875d91283990c5bf596d655602fed8ae8ec276ca256952c64962299c4ac","src/gensym.rs":"14a9b1d2c24a9d4ce5d99b50d01147de335ae6393292581014f7905d54ec4949","src/lexer.rs":"a3e35c379db17e1d7262d34d467b613cc61993e6f42b09231ce1dae7e3d7b46d","src/lib.rs":"87fe21c17471b0252d81a0dd5f4b7ee4e26bd78075010439f99085b19a68ba3e","src/names.rs":"1f1d1a256c9554bb64efb6e790993708360609f7a31ecf3af0ca5fd9d85471ca","src/parser.rs":"6b730cd9c881a4d1657e9f9c323560380ef5d4d224086e83b3911fa96e4afaa4","src/token.rs":"6c58e1098ece3967690d931799c2359761cc71f47b05ddeec005153092f9fd2c","src/wast.rs":"1529718bf60dee1ca49cf0afde994bd9a24c5d9abf37fc02e5a714cfe4b43822","src/wat.rs":"5a4e3f2ad49d6bdca6f2ad1ae2c7ac25dc649398e1c0320edc4419698d232cc6","tests/annotations.rs":"de6ab2a4e15c0bc683482436bed27e37ab45bc374d99f2fcc031c7947506e581","tests/comments.rs":"c068034817774cc94aa06fa09de453132d063335775002aa694fc60889a4ee04","tests/parse-fail.rs":"c13a3aa974429c84ed4423ef00daeb5312c681a1dd93aa6e5ec9c3452a4ea674","tests/parse-fail/bad-core-func-alias.wat":"b71372064c3fce9d4a616418605040fe5e1356030a709b798b4769d3619cbbfb","tests/parse-fail/bad-core-func-alias.wat.err":"bb63274c26d3a21209bad794767f48372834bdc10cfbebf568a0c65d52803c90","tests/parse-fail/bad-func-alias.wat":"237c07149e1e74afe3b991a1fee6acb63167c1ca8931341614c435000339b887","tests/parse-fail/bad-func-alias.wat.err":"4a4bfc691b06d20fdf71e1dbac04649a52c76787048415599978987d761308fa","tests/parse-fail/bad-index.wat":"d21489daeec3a35327dcc9e2ba2d0acdd05f4aeaff2272cca608fda4d2338497","tests/parse-fail/bad-index.wat.err":"dc11070de0c9160573006ea4e5fa3c4d28e71bc39b24b1938cf6ff3b03ea7154","tests/parse-fail/bad-name.wat":"e5ff5d410007779a0de6609ea4cc693f0e603d36a106b8f5098c1980dd9f8124","tests/parse-fail/bad-name.wat.err":"fb5638476c1b85d9d1919e3dbcb0f16f82d088a4a22d4a0c186d7b8ba6e1902b","tests/parse-fail/bad-name2.wat":"5a6a4d0c19e5f2e48d7cebf361aca9b9000b7ef0c652997b5bd0ffaadbd2ca8a","tests/parse-fail/bad-name2.wat.err":"129707cce45f1e3cfb3e2ca5c702182e16ca5eeb2dbb2edd0710b004a8e194a5","tests/parse-fail/bad-name3.wat":"c19133d738cc84e9174301f27d4050c216bda81c7e9918d03ac792b088f24a05","tests/parse-fail/bad-name3.wat.err":"84ea63d40a619a0782ec6e94fce63921188ab87b1c3875eacae0a371144ed83a","tests/parse-fail/block1.wat":"91e74b5c3b43be692e7a6ae74fbfa674c4b6197299eb61338c4eccf282b18f17","tests/parse-fail/block1.wat.err":"40a083ae496b41dee7002cc6a664c5db0c5e4d904ae03b815773a769c4493fca","tests/parse-fail/block2.wat":"a8c07b4c09d51f10a8ffdf19806586022552398701cd90eb6d09816d45df06e5","tests/parse-fail/block2.wat.err":"33c842ec5dd0f2fdd3a9ce8187dd98b45ceee48c12810802af809d05b9cd25e9","tests/parse-fail/block3.wat":"29739abfbabd7c55f00ddfbbb9ebd818b4a114ef2336d50514f0842f7e075905","tests/parse-fail/block3.wat.err":"fc667ae2e71a260f62a3c7393bc97272e7c0ff38b17594f4370847b8a5019060","tests/parse-fail/confusing-block-comment0.wat":"8f27c9d0d212bbb1862ea89ffd7cbeafde5dfd755d695c1ba696cd520aba1a1d","tests/parse-fail/confusing-block-comment0.wat.err":"b53cbaef7bcec3862c64e09c084b92cd61bd29b954125482b2d083db250cd9e2","tests/parse-fail/confusing-block-comment1.wat":"b1a0447c9a8eaab8938d15cd33bd4adbb8bb69c2d710209b604023991a4347cb","tests/parse-fail/confusing-block-comment1.wat.err":"2fc3b3e4f98416326e1e5ec034026301069b6a98fa24451bc7573e16b8cb3811","tests/parse-fail/confusing-block-comment2.wat":"e3f49c7a388fba81081beb25d87bbd7db0acce5dd8e3eaa04574905ed7ec420c","tests/parse-fail/confusing-block-comment2.wat.err":"2183231d6acd0b5a117f9aea747c3d5c12e758450a6cd74027bb954a3134cf19","tests/parse-fail/confusing-block-comment3.wat":"d83f89c582501eb8833e772b8462c8974984a2f7fbb80b1452dc399fac74e5ed","tests/parse-fail/confusing-block-comment3.wat.err":"8b2096a4833627905c63f49cdabe44be24336646578dcfbdc67e9bfb35cbc601","tests/parse-fail/confusing-block-comment4.wat":"b7c6c68844d918e9ef6dd5ab9c40c7de7b38f04f94fadad630eda4e596f3e0f8","tests/parse-fail/confusing-block-comment4.wat.err":"2f790cc511edfcd89a12c9207901be16039fc1a06a584d73095e77a52f861cd9","tests/parse-fail/confusing-block-comment5.wat":"a159808032638cc914fa80ac4354a68b0af4f435a09cbe3e2d577582e183eb0a","tests/parse-fail/confusing-block-comment5.wat.err":"6fe0d99894307442f83fe93beaa5da706e06c9bdaf8e39d7cbae4c4fffafcb94","tests/parse-fail/confusing-block-comment6.wat":"abe48bcba2587dca98bc80ddde4e813f94fbc8a3538704a0775ea85bca0f8466","tests/parse-fail/confusing-block-comment6.wat.err":"3c97b9bf1112bbb7335d7fe4be5befb6f91eea7bec7dd3e6b543792231003c56","tests/parse-fail/confusing-block-comment7.wat":"e125c416ea5fa0ac35a58295a83a6f345438e2d7ddc6a39bd76c8e89885b3f0e","tests/parse-fail/confusing-block-comment7.wat.err":"5c34528ff2019cd3f0b3df34fd42523c0b66120706321da2c88ec05793478d2e","tests/parse-fail/confusing-block-comment8.wat":"200cc4c0e5af21a25529d7a81633a03642cff807255d6cd72eb45cdccc605cec","tests/parse-fail/confusing-block-comment8.wat.err":"9b81237d150a784b71791eee88fb6264a8bd6412862660f7392945203809e517","tests/parse-fail/confusing-line-comment0.wat":"bcec4c5a1e52b3e392e07c6711c979aa8d7db8baaf2bcdf270ba16d1aa528d26","tests/parse-fail/confusing-line-comment0.wat.err":"41ec5a075dc6b73afe1aec6b3198c5c4ae3a1a900e1610115879058ce034d6f6","tests/parse-fail/confusing-line-comment1.wat":"a2afbcab00ec957dfd9e9bf21fa4238852247b27f0b054f4a00f6b172dddf853","tests/parse-fail/confusing-line-comment1.wat.err":"f19a645e6fb5cbd7a0dd2308732741edcf83dbae0ef62549972029856a9e7fc6","tests/parse-fail/confusing-line-comment2.wat":"7f2a68229d02aac56ec4dfccf139bf2d617a0e89430357b30444dc4239d8aa89","tests/parse-fail/confusing-line-comment2.wat.err":"08add3d33e10e1ab6b4f3ae431f5db61d6f6c0a2b7d6828482a1e51b3a2d3851","tests/parse-fail/confusing-line-comment3.wat":"61173ae54782f6de86685f9555ffb94bbe2cf20b234daf660abb69ba3326f1ff","tests/parse-fail/confusing-line-comment3.wat.err":"4a5333dc02efa3c1eeab9cafa7c707f78abe92defdb01a71d6fe20944e4785f0","tests/parse-fail/confusing-line-comment4.wat":"9ecbbbe82c750e6475af1bfb46fe7a06115e4446a437d19fc08ca3d002f2a1c9","tests/parse-fail/confusing-line-comment4.wat.err":"ddb8aee8006265253b09c313cf5eb5c2dc4da66f502b4f6d3e2e1de77b35aec9","tests/parse-fail/confusing-line-comment5.wat":"8a4c8d342111bc9d37c16dbdf67c52027e1a42632abc9f359b3e4f07a85748b5","tests/parse-fail/confusing-line-comment5.wat.err":"34e368719fc0eab2f1a43c9f8e6f1b31aa9be9f971085d72374e49bde39cbfe5","tests/parse-fail/confusing-line-comment6.wat":"15f0dcdec23736ce92db84b3a7cdfe8689c97f2a7d0b9b0bfb0dcd2675163ed1","tests/parse-fail/confusing-line-comment6.wat.err":"0570be2ede803f071925d249f3858d3a417b5a6d678c9da40fc851d788d12983","tests/parse-fail/confusing-line-comment7.wat":"c7ee59301a701dd52d56cad02df78b0ad3584460bc18efa42ee137fe0c35aef6","tests/parse-fail/confusing-line-comment7.wat.err":"feebbeee8c85d8b3b85cec89435ae18f3ade9f754ca180d747a41406b64ca07a","tests/parse-fail/confusing-line-comment8.wat":"17632a8142154624de88b3cf93516147ed3419d785200bcd7049499eca8e8f04","tests/parse-fail/confusing-line-comment8.wat.err":"9c209285f2295cd2bc999aa7a9534a654932493308ab1f102839ed15a4d04d17","tests/parse-fail/confusing-string0.wat":"497b679b32baddcd6a158f4cadd3d9a9dea3457bac2a8c2c3d4e09b7c2d80842","tests/parse-fail/confusing-string0.wat.err":"cb3d737f2319346675a038716694354cd3b272453daa8a96e32e9861a9277f7b","tests/parse-fail/confusing-string1.wat":"46654cbed1ea6aab5019aef3d20098a391e40dacafa1ad5e83bf4ec384109fce","tests/parse-fail/confusing-string1.wat.err":"de7e7da516dc6c244bd0e4f012577b69f0cacbcc10f727fadb4b50bb04e0e2b4","tests/parse-fail/confusing-string2.wat":"11938f217c14387c05312735130f00c91d9df2d3ff9df7f13395e0f2b81dad54","tests/parse-fail/confusing-string2.wat.err":"e7bd08b146a855d681fefaf9e0576a9c333a2d10044f8e268b916b22a54227c9","tests/parse-fail/confusing-string3.wat":"e0ca4903fcafb9a54a91cf99e5eac95d25c6d2eb67b076f88191ad396f839cb6","tests/parse-fail/confusing-string3.wat.err":"b88d5db9e445c798eb24f95b7661b9c0368934d27ee8208477cd1c99351b939a","tests/parse-fail/confusing-string4.wat":"3ee2aee7f77604d051519c6f1795634469c12e98ae347a98f0c8445eecf1ff3d","tests/parse-fail/confusing-string4.wat.err":"1edc65bb09d8d3eed6ff69e7d9a7a4b5941dc823fa3436fa375657510255f6f4","tests/parse-fail/confusing-string5.wat":"024e50943128840d53f17e31a9b9332ce4f0ee70a847a043015f435b1c3c6e76","tests/parse-fail/confusing-string5.wat.err":"a0f13ec40d596ea2d8b0c4292b0d28775a5116ab7e11d7de88b295d25428c661","tests/parse-fail/confusing-string6.wat":"79cf157e29319800d2652c5a7f3dc90e07ebe2145c9904a70fc12027cdee84b7","tests/parse-fail/confusing-string6.wat.err":"860555e7aa13e3de3639cc2a530d6a42b974b629c4659593e972cbb0f306abae","tests/parse-fail/confusing-string7.wat":"7d8e403766dfb4e569754160d31ed0f9a27f908ed6cff96be43ab3d37f5975d5","tests/parse-fail/confusing-string7.wat.err":"658b6a02ba6d769254485f35c20984e7135d914b4266929963d723f26a40be4a","tests/parse-fail/confusing-string8.wat":"5a9b222e578655d57ee6e9f19bc1ea8e29aa52d652975fac685213444ed6458f","tests/parse-fail/confusing-string8.wat.err":"9a4e1a510330c800a1df7966998ebc3cde931eda20b249e5360f5e9a905dce11","tests/parse-fail/inline1.wat":"4e9767d67207aace2ac5e6f63a30e7510e4aa245ba35420539509e2254470272","tests/parse-fail/inline1.wat.err":"0143017a9825e518baa6009bae2c8d63520051dedd3437705bbe36b038a57f41","tests/parse-fail/newline-in-string.wat":"5c01cf709544ade0a6cdfcc39a3836a3bc018b633dc42a6cd872b6defc763ea7","tests/parse-fail/newline-in-string.wat.err":"1504209cc37a78b2aee778f23eacf78606daf964cf7bff251f5700efcd27ffd7","tests/parse-fail/string1.wat":"620d46d585ce94b382b5fde628c1399f3e562014b7a44af46e92f7bd045ca86e","tests/parse-fail/string1.wat.err":"fc53f3a1c4a65d8f25e5af51dec7699f45cecba114ca9c7871781bc70f664320","tests/parse-fail/string10.wat":"f7409dd45e153a1b11cb23e38f4ed87da12bedde38f8f0ccfe91037b0a4d97bd","tests/parse-fail/string10.wat.err":"ce677db5e37e0ed81ca357ed6b5edb21d85c27303ee194855bea7a88457efb6a","tests/parse-fail/string11.wat":"f6e0400b8c6a2014efa1ac676c567e140d8f86b5f4d5129773e6d67af537b615","tests/parse-fail/string11.wat.err":"4c6a550d29eda38a4e1bf7a589596f11655dc779479d7b8d466cfc53f815a742","tests/parse-fail/string12.wat":"23e30070eef22271651cce096a801fc4f79f3c37343c88bb8d2fc99b32d3b8b9","tests/parse-fail/string12.wat.err":"b5ec59f2996b88b2ee157e22d1774dc3e36fc08ed5bfc621aea830d30f66f586","tests/parse-fail/string13.wat":"81a305b981159ee10e140749ea3220c9edaaff53605e63c21995de47382b5faf","tests/parse-fail/string13.wat.err":"959f26c6b54e0d367b51d11d1addd8a53b5b8ff3caf70ebdd46bbea8ccfa2418","tests/parse-fail/string14.wat":"c45c2cc9f7afbfbd4be8e513106d22f7e5e817091448576c6bdf0701b81d95dd","tests/parse-fail/string14.wat.err":"50b5bccba905ddbe275938edb7ed0b09a5ca53dcdad36a7ff736ce9bc8e7a338","tests/parse-fail/string15.wat":"b5e0d5ade40de53b2d767a132e28376bb8c7a6f6238c4d8c248ae717c41d7f1f","tests/parse-fail/string15.wat.err":"0e9fc502cc90f96d1f592a3f63369fd2a3574bc4a2345a70365dbb76804e870f","tests/parse-fail/string16.wat":"38c3688cee80a9d089d239aa06eb1d27c5364ad2bd270aca57d05997c20aa682","tests/parse-fail/string16.wat.err":"4274b3bbe4df4cf0373619b1fcd082d0c802990817d2aca26ed885168c80e489","tests/parse-fail/string2.wat":"1172964aed31537b8c466d1f045f3e756926e7b221f80b2aff4a9a6721ea0beb","tests/parse-fail/string2.wat.err":"4618d3b20a78a077337eb5d6cae14ac39d9853762f011fbd23cff8921618dbde","tests/parse-fail/string3.wat":"07e0fbcd6270c1db100917c151ee4ac3f935e4ee1b27bce3c453b22b4b74f4d6","tests/parse-fail/string3.wat.err":"08ffc6158a9e030b2e211d53bdb8aeacfd879815c7b284d6a83b030566e35928","tests/parse-fail/string4.wat":"c970da2051b0613bdd1de4664f10424e14f2ebabe604175d4fb9b763b37af577","tests/parse-fail/string4.wat.err":"406706594d305c560fabd66417ad4fc276939990b5e701bd9d13fc223d207219","tests/parse-fail/string5.wat":"386cf314bb05acdaaabdf4da1caf140167271a26bd08bf34c3a7427d4bc4431f","tests/parse-fail/string5.wat.err":"1e56b44a23a37b2b2ad05aa9dd7e1e18191b5cc22151f93bbcf9d618779a57bd","tests/parse-fail/string6.wat":"8f1fe2825ff96f2acee9130a7721f86fcc93c221baa9411bf1fb6f0870d38ccb","tests/parse-fail/string6.wat.err":"d55dfd84d94e893f167ae73b7a080aefb2bfb05cc8a1ec201c4d3066fb8549b4","tests/parse-fail/string7.wat":"b12f8c75313d7f834489d3c353422f90bc945b37139586446eda82e334a97cde","tests/parse-fail/string7.wat.err":"4cee0ca61992c249dd0faaf2529a073cf8deeb36111a3f69b43695e5682560a2","tests/parse-fail/string8.wat":"4c2e0e1f883bb4e8cba9313497ed792130e5848e62bde7716102788d7467be10","tests/parse-fail/string8.wat.err":"840c6def7c60dd7c2b7261549cab435ba78c9b3a937adf6d5d9595ff8af01c91","tests/parse-fail/string9.wat":"2b7670caed2b0688d535de6e4e416f35fa717cfbe096a6cc764a669085c8f52f","tests/parse-fail/string9.wat.err":"37b5a9c3af9631500f31f9e5e3efa821b8d96063c57d60fd01df6be6a5c323e1","tests/parse-fail/unbalanced.wat":"f664fbef53a0308f864ba496d38044eb90482636e32586512939d4930729f3fe","tests/parse-fail/unbalanced.wat.err":"aba579f7b836856e69afe05da8328aabe0643d94e369898e686aa7bb0b07e9c9","tests/recursive.rs":"ad8a2b07bf955121a7c9e326ed35f9b2bc56b440c8cc0bbde24d423a79945c1a"},"package":"579d2d47eb33b0cdf9b14723cb115f1e1b7d6e77aac6f0816e5b7c7aeaa418ff"} \ No newline at end of file +{"files":{".cargo_vcs_info.json":"696e0c5d6b3950daab1a9ae749eb9d00da29be86574d7f99a0e4905f44e3d036","Cargo.lock":"10d531b4c0fffa5eb718788f59df948ad9a246f12960828ca10b81a482f6d09b","Cargo.toml":"00b6c145d39675bd3a8d84ea75bb0275c89305cf2bf95fd8c53e3671498106e8","Cargo.toml.orig":"9f9e4413bb0a7030b3f5d434c67e3ae0a068751795b786a574dce12f4e497a10","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"5a0d2b894a3ac74ee2be74715a2f22c40a08520cb4ac59183f4e7356f34ac566","src/component.rs":"154cdef2003b1607ab21a50a821b455da854b78d353d573586351c2593ed70a2","src/component/alias.rs":"e332dfa40bd8990c5b38de468e47a10a00390126ae87f713085ae1c126ee6ff9","src/component/binary.rs":"33ddd23f4bf6bb0bf7fa44f205237b2c9dc0f0fb31e00967fa877fd223279381","src/component/component.rs":"8115ecb0b97d904eccc1e2dbbe09dbaec7068fb587e4f17d0eba3e15e29d9cf3","src/component/custom.rs":"f5b23c34b73a716a986fd999fc8d8c9e24c341e83292088fe83325cd82dab4f5","src/component/expand.rs":"912adffd1d0ca93c98e6c96208a305fcf83efa492e9df1ad3a12db2944dc68b1","src/component/export.rs":"f51e824c839d8bb0884eca509622f376c8cce3335be324b2b25033af6216fd2a","src/component/func.rs":"1c812928d4c5f32c239d9c6b3e0eb2552e52928dc59bf0db33f4e35d7922a70e","src/component/import.rs":"aff34be9d2b7ac6ca070d7ee983ae91d076629829cf7966c618fddf3ad77773b","src/component/instance.rs":"e550a7ee9af092ae084dd41e2c0ae756b7dca8da4b91d672d90265a6a15dff83","src/component/item_ref.rs":"e9c426ccc0210dc0c37bb0448468f5f4d9e52656b72d4ff0f2dc65c89957fe60","src/component/module.rs":"d27a28199d1dea1c64294a514329a524432319288515b0a0e3091fa7d3a33f74","src/component/resolve.rs":"70962139b11b506aa0987028063ef8f44f5607d95abe820e07d4ba7d4a90c3ef","src/component/types.rs":"a407172a35079363cdff5c2da46b68f59f12c87076d57a285a578e1f9eb8d6da","src/component/wast.rs":"aa39db0ea0acd38744dc3cbd35903c9b00b5de90a5bfc8b76e6b6a7581d7c4c0","src/component_disabled.rs":"20e2d9c28efe2ecf14f96f8d8971eddc23d0df9494fb527e79ed64b449f2de72","src/core.rs":"c82d7356515f675f9173f9bf5d7c0f4e56ca7a3eebc92b5f95a2d04882ca470c","src/core/binary.rs":"6d70532de69218cc44a187534a363613c45a134f311e1f9483c41f8125bc46d8","src/core/binary/dwarf.rs":"90c02e25e2dc33b972fabfa31ed014d13a7ddf48d1c103182c4e82ba87ca77cd","src/core/binary/dwarf_disabled.rs":"67ad94dd4307fb6af9757f427267193b758b8ca34c3f69bed87a65be04b09c13","src/core/custom.rs":"b3ff3aa5073826b04e0dc0eef80e34bb2c44223fc121e26267de411f45e140b2","src/core/export.rs":"1322a120d9e1dd6f3aa1485ee0bbc4294961028ae8a7584a24170af5823b73b1","src/core/expr.rs":"3ebd763d2ff000489790d93e6b4b82c833b970f8fafa3e89861d2bb55ad03b47","src/core/func.rs":"2f9fca12d160fdce9cf569fc868c2fd4acee2c4508f559ea33c5a41c0fbf06a5","src/core/global.rs":"dec0abecadd2fde9298acb729259deba1ef3c4733ae5afcb4fe8cd4a633f5349","src/core/import.rs":"1e51e9e64825b5c1ae593464b2377e4ebfce22f354f5d3462480a7c2edc6b4c3","src/core/memory.rs":"68fa3317cdb9e099cdcfb5e6750d3427e7146dc4fdecf48982d7a2a43462dc7f","src/core/module.rs":"8ea3f9c4b1d35f84800e0ef385b8ac5fff184c32703b2c81650db8edf5b23c27","src/core/resolve/deinline_import_export.rs":"22c818d461ea5899c47c4f50a2d836da2c7d8ff40d22424902f5cf763bc00180","src/core/resolve/mod.rs":"4d248d3142f4c07021e4cb460ef9e07c77dc0666568a161fa654bb1d6e6c9755","src/core/resolve/names.rs":"3e7ccbcacf40e53327383ca34de8d0c45dd927d0a44ff2a9d64c42868efff970","src/core/resolve/types.rs":"64b46cf12b0ffe72cc8b00f8e371b7bd7e8993706c8c6a1e1c8f82048766987e","src/core/table.rs":"97ffb7a572f35710c8948a1d4dee7706aa18a41a92c6f2b11252495fe4dca29e","src/core/tag.rs":"8a3d4fcdb86dedd68cdaf25abd930ef52a461cf2a0e9393bb9cb6f425afaaf2e","src/core/types.rs":"2becc668864259d5896a9b10ff7df520b6bd7bcb683a0db70416fa3e35fc5fc9","src/core/wast.rs":"a2748b92bb9789cb0314ca973c30d4eb09125cc40a57de916c096124530b397b","src/encode.rs":"610c9c4f0da9f6078c68a0164518869bfb6fe8e408b43db8718da0c01cdcf992","src/error.rs":"d7670875d91283990c5bf596d655602fed8ae8ec276ca256952c64962299c4ac","src/gensym.rs":"14a9b1d2c24a9d4ce5d99b50d01147de335ae6393292581014f7905d54ec4949","src/lexer.rs":"a3e35c379db17e1d7262d34d467b613cc61993e6f42b09231ce1dae7e3d7b46d","src/lib.rs":"daca1d03c356acdda4f6d5ba083672018fa24959514fe1cee0e13c6532ab8ad9","src/names.rs":"1f1d1a256c9554bb64efb6e790993708360609f7a31ecf3af0ca5fd9d85471ca","src/parser.rs":"6b730cd9c881a4d1657e9f9c323560380ef5d4d224086e83b3911fa96e4afaa4","src/token.rs":"6c58e1098ece3967690d931799c2359761cc71f47b05ddeec005153092f9fd2c","src/wast.rs":"1529718bf60dee1ca49cf0afde994bd9a24c5d9abf37fc02e5a714cfe4b43822","src/wat.rs":"5a4e3f2ad49d6bdca6f2ad1ae2c7ac25dc649398e1c0320edc4419698d232cc6","tests/annotations.rs":"de6ab2a4e15c0bc683482436bed27e37ab45bc374d99f2fcc031c7947506e581","tests/comments.rs":"c068034817774cc94aa06fa09de453132d063335775002aa694fc60889a4ee04","tests/parse-fail.rs":"c13a3aa974429c84ed4423ef00daeb5312c681a1dd93aa6e5ec9c3452a4ea674","tests/parse-fail/bad-core-func-alias.wat":"b71372064c3fce9d4a616418605040fe5e1356030a709b798b4769d3619cbbfb","tests/parse-fail/bad-core-func-alias.wat.err":"bb63274c26d3a21209bad794767f48372834bdc10cfbebf568a0c65d52803c90","tests/parse-fail/bad-func-alias.wat":"237c07149e1e74afe3b991a1fee6acb63167c1ca8931341614c435000339b887","tests/parse-fail/bad-func-alias.wat.err":"4a4bfc691b06d20fdf71e1dbac04649a52c76787048415599978987d761308fa","tests/parse-fail/bad-index.wat":"d21489daeec3a35327dcc9e2ba2d0acdd05f4aeaff2272cca608fda4d2338497","tests/parse-fail/bad-index.wat.err":"dc11070de0c9160573006ea4e5fa3c4d28e71bc39b24b1938cf6ff3b03ea7154","tests/parse-fail/bad-name.wat":"e5ff5d410007779a0de6609ea4cc693f0e603d36a106b8f5098c1980dd9f8124","tests/parse-fail/bad-name.wat.err":"fb5638476c1b85d9d1919e3dbcb0f16f82d088a4a22d4a0c186d7b8ba6e1902b","tests/parse-fail/bad-name2.wat":"5a6a4d0c19e5f2e48d7cebf361aca9b9000b7ef0c652997b5bd0ffaadbd2ca8a","tests/parse-fail/bad-name2.wat.err":"129707cce45f1e3cfb3e2ca5c702182e16ca5eeb2dbb2edd0710b004a8e194a5","tests/parse-fail/bad-name3.wat":"c19133d738cc84e9174301f27d4050c216bda81c7e9918d03ac792b088f24a05","tests/parse-fail/bad-name3.wat.err":"84ea63d40a619a0782ec6e94fce63921188ab87b1c3875eacae0a371144ed83a","tests/parse-fail/block1.wat":"91e74b5c3b43be692e7a6ae74fbfa674c4b6197299eb61338c4eccf282b18f17","tests/parse-fail/block1.wat.err":"40a083ae496b41dee7002cc6a664c5db0c5e4d904ae03b815773a769c4493fca","tests/parse-fail/block2.wat":"a8c07b4c09d51f10a8ffdf19806586022552398701cd90eb6d09816d45df06e5","tests/parse-fail/block2.wat.err":"33c842ec5dd0f2fdd3a9ce8187dd98b45ceee48c12810802af809d05b9cd25e9","tests/parse-fail/block3.wat":"29739abfbabd7c55f00ddfbbb9ebd818b4a114ef2336d50514f0842f7e075905","tests/parse-fail/block3.wat.err":"fc667ae2e71a260f62a3c7393bc97272e7c0ff38b17594f4370847b8a5019060","tests/parse-fail/confusing-block-comment0.wat":"8f27c9d0d212bbb1862ea89ffd7cbeafde5dfd755d695c1ba696cd520aba1a1d","tests/parse-fail/confusing-block-comment0.wat.err":"b53cbaef7bcec3862c64e09c084b92cd61bd29b954125482b2d083db250cd9e2","tests/parse-fail/confusing-block-comment1.wat":"b1a0447c9a8eaab8938d15cd33bd4adbb8bb69c2d710209b604023991a4347cb","tests/parse-fail/confusing-block-comment1.wat.err":"2fc3b3e4f98416326e1e5ec034026301069b6a98fa24451bc7573e16b8cb3811","tests/parse-fail/confusing-block-comment2.wat":"e3f49c7a388fba81081beb25d87bbd7db0acce5dd8e3eaa04574905ed7ec420c","tests/parse-fail/confusing-block-comment2.wat.err":"2183231d6acd0b5a117f9aea747c3d5c12e758450a6cd74027bb954a3134cf19","tests/parse-fail/confusing-block-comment3.wat":"d83f89c582501eb8833e772b8462c8974984a2f7fbb80b1452dc399fac74e5ed","tests/parse-fail/confusing-block-comment3.wat.err":"8b2096a4833627905c63f49cdabe44be24336646578dcfbdc67e9bfb35cbc601","tests/parse-fail/confusing-block-comment4.wat":"b7c6c68844d918e9ef6dd5ab9c40c7de7b38f04f94fadad630eda4e596f3e0f8","tests/parse-fail/confusing-block-comment4.wat.err":"2f790cc511edfcd89a12c9207901be16039fc1a06a584d73095e77a52f861cd9","tests/parse-fail/confusing-block-comment5.wat":"a159808032638cc914fa80ac4354a68b0af4f435a09cbe3e2d577582e183eb0a","tests/parse-fail/confusing-block-comment5.wat.err":"6fe0d99894307442f83fe93beaa5da706e06c9bdaf8e39d7cbae4c4fffafcb94","tests/parse-fail/confusing-block-comment6.wat":"abe48bcba2587dca98bc80ddde4e813f94fbc8a3538704a0775ea85bca0f8466","tests/parse-fail/confusing-block-comment6.wat.err":"3c97b9bf1112bbb7335d7fe4be5befb6f91eea7bec7dd3e6b543792231003c56","tests/parse-fail/confusing-block-comment7.wat":"e125c416ea5fa0ac35a58295a83a6f345438e2d7ddc6a39bd76c8e89885b3f0e","tests/parse-fail/confusing-block-comment7.wat.err":"5c34528ff2019cd3f0b3df34fd42523c0b66120706321da2c88ec05793478d2e","tests/parse-fail/confusing-block-comment8.wat":"200cc4c0e5af21a25529d7a81633a03642cff807255d6cd72eb45cdccc605cec","tests/parse-fail/confusing-block-comment8.wat.err":"9b81237d150a784b71791eee88fb6264a8bd6412862660f7392945203809e517","tests/parse-fail/confusing-line-comment0.wat":"bcec4c5a1e52b3e392e07c6711c979aa8d7db8baaf2bcdf270ba16d1aa528d26","tests/parse-fail/confusing-line-comment0.wat.err":"41ec5a075dc6b73afe1aec6b3198c5c4ae3a1a900e1610115879058ce034d6f6","tests/parse-fail/confusing-line-comment1.wat":"a2afbcab00ec957dfd9e9bf21fa4238852247b27f0b054f4a00f6b172dddf853","tests/parse-fail/confusing-line-comment1.wat.err":"f19a645e6fb5cbd7a0dd2308732741edcf83dbae0ef62549972029856a9e7fc6","tests/parse-fail/confusing-line-comment2.wat":"7f2a68229d02aac56ec4dfccf139bf2d617a0e89430357b30444dc4239d8aa89","tests/parse-fail/confusing-line-comment2.wat.err":"08add3d33e10e1ab6b4f3ae431f5db61d6f6c0a2b7d6828482a1e51b3a2d3851","tests/parse-fail/confusing-line-comment3.wat":"61173ae54782f6de86685f9555ffb94bbe2cf20b234daf660abb69ba3326f1ff","tests/parse-fail/confusing-line-comment3.wat.err":"4a5333dc02efa3c1eeab9cafa7c707f78abe92defdb01a71d6fe20944e4785f0","tests/parse-fail/confusing-line-comment4.wat":"9ecbbbe82c750e6475af1bfb46fe7a06115e4446a437d19fc08ca3d002f2a1c9","tests/parse-fail/confusing-line-comment4.wat.err":"ddb8aee8006265253b09c313cf5eb5c2dc4da66f502b4f6d3e2e1de77b35aec9","tests/parse-fail/confusing-line-comment5.wat":"8a4c8d342111bc9d37c16dbdf67c52027e1a42632abc9f359b3e4f07a85748b5","tests/parse-fail/confusing-line-comment5.wat.err":"34e368719fc0eab2f1a43c9f8e6f1b31aa9be9f971085d72374e49bde39cbfe5","tests/parse-fail/confusing-line-comment6.wat":"15f0dcdec23736ce92db84b3a7cdfe8689c97f2a7d0b9b0bfb0dcd2675163ed1","tests/parse-fail/confusing-line-comment6.wat.err":"0570be2ede803f071925d249f3858d3a417b5a6d678c9da40fc851d788d12983","tests/parse-fail/confusing-line-comment7.wat":"c7ee59301a701dd52d56cad02df78b0ad3584460bc18efa42ee137fe0c35aef6","tests/parse-fail/confusing-line-comment7.wat.err":"feebbeee8c85d8b3b85cec89435ae18f3ade9f754ca180d747a41406b64ca07a","tests/parse-fail/confusing-line-comment8.wat":"17632a8142154624de88b3cf93516147ed3419d785200bcd7049499eca8e8f04","tests/parse-fail/confusing-line-comment8.wat.err":"9c209285f2295cd2bc999aa7a9534a654932493308ab1f102839ed15a4d04d17","tests/parse-fail/confusing-string0.wat":"497b679b32baddcd6a158f4cadd3d9a9dea3457bac2a8c2c3d4e09b7c2d80842","tests/parse-fail/confusing-string0.wat.err":"cb3d737f2319346675a038716694354cd3b272453daa8a96e32e9861a9277f7b","tests/parse-fail/confusing-string1.wat":"46654cbed1ea6aab5019aef3d20098a391e40dacafa1ad5e83bf4ec384109fce","tests/parse-fail/confusing-string1.wat.err":"de7e7da516dc6c244bd0e4f012577b69f0cacbcc10f727fadb4b50bb04e0e2b4","tests/parse-fail/confusing-string2.wat":"11938f217c14387c05312735130f00c91d9df2d3ff9df7f13395e0f2b81dad54","tests/parse-fail/confusing-string2.wat.err":"e7bd08b146a855d681fefaf9e0576a9c333a2d10044f8e268b916b22a54227c9","tests/parse-fail/confusing-string3.wat":"e0ca4903fcafb9a54a91cf99e5eac95d25c6d2eb67b076f88191ad396f839cb6","tests/parse-fail/confusing-string3.wat.err":"b88d5db9e445c798eb24f95b7661b9c0368934d27ee8208477cd1c99351b939a","tests/parse-fail/confusing-string4.wat":"3ee2aee7f77604d051519c6f1795634469c12e98ae347a98f0c8445eecf1ff3d","tests/parse-fail/confusing-string4.wat.err":"1edc65bb09d8d3eed6ff69e7d9a7a4b5941dc823fa3436fa375657510255f6f4","tests/parse-fail/confusing-string5.wat":"024e50943128840d53f17e31a9b9332ce4f0ee70a847a043015f435b1c3c6e76","tests/parse-fail/confusing-string5.wat.err":"a0f13ec40d596ea2d8b0c4292b0d28775a5116ab7e11d7de88b295d25428c661","tests/parse-fail/confusing-string6.wat":"79cf157e29319800d2652c5a7f3dc90e07ebe2145c9904a70fc12027cdee84b7","tests/parse-fail/confusing-string6.wat.err":"860555e7aa13e3de3639cc2a530d6a42b974b629c4659593e972cbb0f306abae","tests/parse-fail/confusing-string7.wat":"7d8e403766dfb4e569754160d31ed0f9a27f908ed6cff96be43ab3d37f5975d5","tests/parse-fail/confusing-string7.wat.err":"658b6a02ba6d769254485f35c20984e7135d914b4266929963d723f26a40be4a","tests/parse-fail/confusing-string8.wat":"5a9b222e578655d57ee6e9f19bc1ea8e29aa52d652975fac685213444ed6458f","tests/parse-fail/confusing-string8.wat.err":"9a4e1a510330c800a1df7966998ebc3cde931eda20b249e5360f5e9a905dce11","tests/parse-fail/inline1.wat":"4e9767d67207aace2ac5e6f63a30e7510e4aa245ba35420539509e2254470272","tests/parse-fail/inline1.wat.err":"0143017a9825e518baa6009bae2c8d63520051dedd3437705bbe36b038a57f41","tests/parse-fail/newline-in-string.wat":"5c01cf709544ade0a6cdfcc39a3836a3bc018b633dc42a6cd872b6defc763ea7","tests/parse-fail/newline-in-string.wat.err":"1504209cc37a78b2aee778f23eacf78606daf964cf7bff251f5700efcd27ffd7","tests/parse-fail/string1.wat":"620d46d585ce94b382b5fde628c1399f3e562014b7a44af46e92f7bd045ca86e","tests/parse-fail/string1.wat.err":"fc53f3a1c4a65d8f25e5af51dec7699f45cecba114ca9c7871781bc70f664320","tests/parse-fail/string10.wat":"f7409dd45e153a1b11cb23e38f4ed87da12bedde38f8f0ccfe91037b0a4d97bd","tests/parse-fail/string10.wat.err":"ce677db5e37e0ed81ca357ed6b5edb21d85c27303ee194855bea7a88457efb6a","tests/parse-fail/string11.wat":"f6e0400b8c6a2014efa1ac676c567e140d8f86b5f4d5129773e6d67af537b615","tests/parse-fail/string11.wat.err":"4c6a550d29eda38a4e1bf7a589596f11655dc779479d7b8d466cfc53f815a742","tests/parse-fail/string12.wat":"23e30070eef22271651cce096a801fc4f79f3c37343c88bb8d2fc99b32d3b8b9","tests/parse-fail/string12.wat.err":"b5ec59f2996b88b2ee157e22d1774dc3e36fc08ed5bfc621aea830d30f66f586","tests/parse-fail/string13.wat":"81a305b981159ee10e140749ea3220c9edaaff53605e63c21995de47382b5faf","tests/parse-fail/string13.wat.err":"959f26c6b54e0d367b51d11d1addd8a53b5b8ff3caf70ebdd46bbea8ccfa2418","tests/parse-fail/string14.wat":"c45c2cc9f7afbfbd4be8e513106d22f7e5e817091448576c6bdf0701b81d95dd","tests/parse-fail/string14.wat.err":"50b5bccba905ddbe275938edb7ed0b09a5ca53dcdad36a7ff736ce9bc8e7a338","tests/parse-fail/string15.wat":"b5e0d5ade40de53b2d767a132e28376bb8c7a6f6238c4d8c248ae717c41d7f1f","tests/parse-fail/string15.wat.err":"0e9fc502cc90f96d1f592a3f63369fd2a3574bc4a2345a70365dbb76804e870f","tests/parse-fail/string16.wat":"38c3688cee80a9d089d239aa06eb1d27c5364ad2bd270aca57d05997c20aa682","tests/parse-fail/string16.wat.err":"4274b3bbe4df4cf0373619b1fcd082d0c802990817d2aca26ed885168c80e489","tests/parse-fail/string2.wat":"1172964aed31537b8c466d1f045f3e756926e7b221f80b2aff4a9a6721ea0beb","tests/parse-fail/string2.wat.err":"4618d3b20a78a077337eb5d6cae14ac39d9853762f011fbd23cff8921618dbde","tests/parse-fail/string3.wat":"07e0fbcd6270c1db100917c151ee4ac3f935e4ee1b27bce3c453b22b4b74f4d6","tests/parse-fail/string3.wat.err":"08ffc6158a9e030b2e211d53bdb8aeacfd879815c7b284d6a83b030566e35928","tests/parse-fail/string4.wat":"c970da2051b0613bdd1de4664f10424e14f2ebabe604175d4fb9b763b37af577","tests/parse-fail/string4.wat.err":"406706594d305c560fabd66417ad4fc276939990b5e701bd9d13fc223d207219","tests/parse-fail/string5.wat":"386cf314bb05acdaaabdf4da1caf140167271a26bd08bf34c3a7427d4bc4431f","tests/parse-fail/string5.wat.err":"1e56b44a23a37b2b2ad05aa9dd7e1e18191b5cc22151f93bbcf9d618779a57bd","tests/parse-fail/string6.wat":"8f1fe2825ff96f2acee9130a7721f86fcc93c221baa9411bf1fb6f0870d38ccb","tests/parse-fail/string6.wat.err":"d55dfd84d94e893f167ae73b7a080aefb2bfb05cc8a1ec201c4d3066fb8549b4","tests/parse-fail/string7.wat":"b12f8c75313d7f834489d3c353422f90bc945b37139586446eda82e334a97cde","tests/parse-fail/string7.wat.err":"4cee0ca61992c249dd0faaf2529a073cf8deeb36111a3f69b43695e5682560a2","tests/parse-fail/string8.wat":"4c2e0e1f883bb4e8cba9313497ed792130e5848e62bde7716102788d7467be10","tests/parse-fail/string8.wat.err":"840c6def7c60dd7c2b7261549cab435ba78c9b3a937adf6d5d9595ff8af01c91","tests/parse-fail/string9.wat":"2b7670caed2b0688d535de6e4e416f35fa717cfbe096a6cc764a669085c8f52f","tests/parse-fail/string9.wat.err":"37b5a9c3af9631500f31f9e5e3efa821b8d96063c57d60fd01df6be6a5c323e1","tests/parse-fail/unbalanced.wat":"f664fbef53a0308f864ba496d38044eb90482636e32586512939d4930729f3fe","tests/parse-fail/unbalanced.wat.err":"aba579f7b836856e69afe05da8328aabe0643d94e369898e686aa7bb0b07e9c9","tests/recursive.rs":"ad8a2b07bf955121a7c9e326ed35f9b2bc56b440c8cc0bbde24d423a79945c1a"},"package":"2474a321bf9ae2808e9fa23ac4ec2b27300e70985e30bcb5a38d43b76bfc901a"} \ No newline at end of file diff --git a/wast-249.0.0/.cargo_vcs_info.json b/wast-249.0.0/.cargo_vcs_info.json new file mode 100644 index 0000000000..08bdb778cb --- /dev/null +++ b/wast-249.0.0/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "efeee7cafa5a3dcdddb5aab27bc0c05f279929ed" + }, + "path_in_vcs": "crates/wast" +} \ No newline at end of file diff --git a/wast-247.0.0/Cargo.lock b/wast-249.0.0/Cargo.lock similarity index 98% rename from wast-247.0.0/Cargo.lock rename to wast-249.0.0/Cargo.lock index 84140c7ff9..7d15963c34 100644 --- a/wast-247.0.0/Cargo.lock +++ b/wast-249.0.0/Cargo.lock @@ -460,12 +460,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.247.0" +version = "0.249.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b6733b8b91d010a6ac5b0fb237dc46a19650bc4c67db66857e2e787d437204" +checksum = "69830ccbbf41c55eb585991659fb70867ef628193af3a495f09a6956f7615e59" dependencies = [ "leb128fmt", - "wasmparser 0.247.0", + "wasmparser 0.249.0", ] [[package]] @@ -494,9 +494,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.247.0" +version = "0.249.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6fb4c2bee46c5ea4d40f8cdb5c131725cd976718ec56f1c8e82fbde5fa2a80" +checksum = "30538cae9a794215f490b532df01c557e2e2bfac92569482554acd0992a102ea" dependencies = [ "bitflags", "indexmap", @@ -505,7 +505,7 @@ dependencies = [ [[package]] name = "wast" -version = "247.0.0" +version = "249.0.0" dependencies = [ "anyhow", "bumpalo", @@ -515,7 +515,7 @@ dependencies = [ "memchr", "rand", "unicode-width", - "wasm-encoder 0.247.0", + "wasm-encoder 0.249.0", ] [[package]] diff --git a/wast-247.0.0/Cargo.toml b/wast-249.0.0/Cargo.toml similarity index 97% rename from wast-247.0.0/Cargo.toml rename to wast-249.0.0/Cargo.toml index c5e2b3f6ba..18c7902ffa 100644 --- a/wast-247.0.0/Cargo.toml +++ b/wast-249.0.0/Cargo.toml @@ -10,10 +10,10 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2021" +edition = "2024" rust-version = "1.85.0" name = "wast" -version = "247.0.0" +version = "249.0.0" authors = ["Alex Crichton "] build = false autolib = false @@ -67,7 +67,7 @@ name = "recursive" path = "tests/recursive.rs" [dependencies.bumpalo] -version = "3.14.0" +version = "3.20" [dependencies.gimli] version = "0.32.0" @@ -84,7 +84,7 @@ version = "2.4.1" version = "0.2.0" [dependencies.wasm-encoder] -version = "0.247.0" +version = "0.249.0" features = ["std"] default-features = false diff --git a/wast-247.0.0/Cargo.toml.orig b/wast-249.0.0/Cargo.toml.orig similarity index 97% rename from wast-247.0.0/Cargo.toml.orig rename to wast-249.0.0/Cargo.toml.orig index 1f3c75315b..73ac8798b1 100644 --- a/wast-247.0.0/Cargo.toml.orig +++ b/wast-249.0.0/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "wast" -version = "247.0.0" +version = "249.0.0" authors = ["Alex Crichton "] edition.workspace = true license.workspace = true @@ -20,7 +20,7 @@ all-features = true workspace = true [dependencies] -bumpalo = "3.14.0" +bumpalo = "3.20" gimli = { workspace = true, optional = true } leb128fmt = { workspace = true } memchr = "2.4.1" diff --git a/wat-1.247.0/LICENSE-APACHE b/wast-249.0.0/LICENSE-APACHE similarity index 100% rename from wat-1.247.0/LICENSE-APACHE rename to wast-249.0.0/LICENSE-APACHE diff --git a/wast-247.0.0/LICENSE-Apache-2.0_WITH_LLVM-exception b/wast-249.0.0/LICENSE-Apache-2.0_WITH_LLVM-exception similarity index 100% rename from wast-247.0.0/LICENSE-Apache-2.0_WITH_LLVM-exception rename to wast-249.0.0/LICENSE-Apache-2.0_WITH_LLVM-exception diff --git a/wast-247.0.0/LICENSE-MIT b/wast-249.0.0/LICENSE-MIT similarity index 100% rename from wast-247.0.0/LICENSE-MIT rename to wast-249.0.0/LICENSE-MIT diff --git a/wast-247.0.0/README.md b/wast-249.0.0/README.md similarity index 100% rename from wast-247.0.0/README.md rename to wast-249.0.0/README.md diff --git a/wast-247.0.0/src/component.rs b/wast-249.0.0/src/component.rs similarity index 100% rename from wast-247.0.0/src/component.rs rename to wast-249.0.0/src/component.rs diff --git a/wast-247.0.0/src/component/alias.rs b/wast-249.0.0/src/component/alias.rs similarity index 100% rename from wast-247.0.0/src/component/alias.rs rename to wast-249.0.0/src/component/alias.rs diff --git a/wast-247.0.0/src/component/binary.rs b/wast-249.0.0/src/component/binary.rs similarity index 97% rename from wast-247.0.0/src/component/binary.rs rename to wast-249.0.0/src/component/binary.rs index 658f238c3f..a0c8c2eee1 100644 --- a/wast-247.0.0/src/component/binary.rs +++ b/wast-249.0.0/src/component/binary.rs @@ -279,7 +279,7 @@ impl<'a> Encoder<'a> { InstanceKind::BundleOfExports(exports) => { self.instances.export_items(exports.iter().map(|e| { let (kind, index) = (&e.kind).into(); - (e.name.0, kind, index) + (e.name, kind, index) })); } } @@ -392,13 +392,13 @@ impl<'a> Encoder<'a> { self.core_func_names.push(name); self.funcs.task_cancel(); } - CoreFuncKind::ContextGet(i) => { + CoreFuncKind::ContextGet(ty, i) => { self.core_func_names.push(name); - self.funcs.context_get(*i); + self.funcs.context_get((*ty).into(), *i); } - CoreFuncKind::ContextSet(i) => { + CoreFuncKind::ContextSet(ty, i) => { self.core_func_names.push(name); - self.funcs.context_set(*i); + self.funcs.context_set((*ty).into(), *i); } CoreFuncKind::ThreadYield(info) => { self.core_func_names.push(name); @@ -546,8 +546,7 @@ impl<'a> Encoder<'a> { fn encode_import(&mut self, import: &ComponentImport<'a>) { let name = get_name(&import.item.id, &import.item.name); self.names_for_item_kind(&import.item.kind).push(name); - self.imports - .import(import.name.0, (&import.item.kind).into()); + self.imports.import(import.name, (&import.item.kind).into()); self.flush(Some(self.imports.id())); } @@ -555,7 +554,7 @@ impl<'a> Encoder<'a> { let name = get_name(&export.id, &export.debug_name); let (kind, index) = (&export.kind).into(); self.exports.export( - export.name.0, + export.name, kind, index, export.ty.as_ref().map(|ty| (&ty.0.kind).into()), @@ -863,10 +862,10 @@ impl From<&ComponentType<'_>> for wasm_encoder::ComponentType { encoded.alias((&a.target).into()); } ComponentTypeDecl::Import(i) => { - encoded.import(i.name.0, (&i.item.kind).into()); + encoded.import(i.name, (&i.item.kind).into()); } ComponentTypeDecl::Export(e) => { - encoded.export(e.name.0, (&e.item.kind).into()); + encoded.export(e.name, (&e.item.kind).into()); } } } @@ -891,7 +890,7 @@ impl From<&InstanceType<'_>> for wasm_encoder::InstanceType { encoded.alias((&a.target).into()); } InstanceTypeDecl::Export(e) => { - encoded.export(e.name.0, (&e.item.kind).into()); + encoded.export(e.name, (&e.item.kind).into()); } } } @@ -1047,3 +1046,12 @@ impl<'a> From<&AliasTarget<'a>> for wasm_encoder::Alias<'a> { } } } + +impl<'a> From> for wasm_encoder::ComponentExternName<'a> { + fn from(name: ComponentExternName<'a>) -> Self { + wasm_encoder::ComponentExternName { + name: name.name.into(), + implements: name.implements.map(|i| i.into()), + } + } +} diff --git a/wast-247.0.0/src/component/component.rs b/wast-249.0.0/src/component/component.rs similarity index 100% rename from wast-247.0.0/src/component/component.rs rename to wast-249.0.0/src/component/component.rs diff --git a/wast-247.0.0/src/component/custom.rs b/wast-249.0.0/src/component/custom.rs similarity index 100% rename from wast-247.0.0/src/component/custom.rs rename to wast-249.0.0/src/component/custom.rs diff --git a/wast-247.0.0/src/component/expand.rs b/wast-249.0.0/src/component/expand.rs similarity index 100% rename from wast-247.0.0/src/component/expand.rs rename to wast-249.0.0/src/component/expand.rs diff --git a/wast-247.0.0/src/component/export.rs b/wast-249.0.0/src/component/export.rs similarity index 100% rename from wast-247.0.0/src/component/export.rs rename to wast-249.0.0/src/component/export.rs diff --git a/wast-247.0.0/src/component/func.rs b/wast-249.0.0/src/component/func.rs similarity index 99% rename from wast-247.0.0/src/component/func.rs rename to wast-249.0.0/src/component/func.rs index bb995117a7..17d31b5f90 100644 --- a/wast-247.0.0/src/component/func.rs +++ b/wast-249.0.0/src/component/func.rs @@ -58,8 +58,8 @@ pub enum CoreFuncKind<'a> { BackpressureDec, TaskReturn(CanonTaskReturn<'a>), TaskCancel, - ContextGet(u32), - ContextSet(u32), + ContextGet(crate::core::ValType<'a>, u32), + ContextSet(crate::core::ValType<'a>, u32), ThreadYield(CanonThreadYield), SubtaskDrop, SubtaskCancel(CanonSubtaskCancel), @@ -139,12 +139,12 @@ impl<'a> CoreFuncKind<'a> { Ok(CoreFuncKind::TaskCancel) } else if l.peek::()? { parser.parse::()?; - parser.parse::()?; - Ok(CoreFuncKind::ContextGet(parser.parse()?)) + let ty = parser.parse()?; + Ok(CoreFuncKind::ContextGet(ty, parser.parse()?)) } else if l.peek::()? { parser.parse::()?; - parser.parse::()?; - Ok(CoreFuncKind::ContextSet(parser.parse()?)) + let ty = parser.parse()?; + Ok(CoreFuncKind::ContextSet(ty, parser.parse()?)) } else if l.peek::()? { Ok(CoreFuncKind::ThreadYield(parser.parse()?)) } else if l.peek::()? { diff --git a/wast-247.0.0/src/component/import.rs b/wast-249.0.0/src/component/import.rs similarity index 92% rename from wast-247.0.0/src/component/import.rs rename to wast-249.0.0/src/component/import.rs index 81c8e5e406..cf2a9f5b1a 100644 --- a/wast-247.0.0/src/component/import.rs +++ b/wast-249.0.0/src/component/import.rs @@ -23,9 +23,14 @@ impl<'a> Parse<'a> for ComponentImport<'a> { } } -/// The different ways an import can be named. +/// Identifiers, and metadata, for component imports and exports. #[derive(Debug, Copy, Clone)] -pub struct ComponentExternName<'a>(pub &'a str); +pub struct ComponentExternName<'a> { + /// The string name this is referring to. + pub name: &'a str, + /// For imports, an optional `(implements "...")` directive. + pub implements: Option<&'a str>, +} impl<'a> Parse<'a> for ComponentExternName<'a> { fn parse(parser: Parser<'a>) -> Result { @@ -43,7 +48,15 @@ impl<'a> Parse<'a> for ComponentExternName<'a> { } else { parser.parse()? }; - Ok(ComponentExternName(name)) + let implements = if parser.peek2::()? { + Some(parser.parens(|p| { + p.parse::()?; + p.parse() + })?) + } else { + None + }; + Ok(ComponentExternName { name, implements }) } } diff --git a/wast-247.0.0/src/component/instance.rs b/wast-249.0.0/src/component/instance.rs similarity index 100% rename from wast-247.0.0/src/component/instance.rs rename to wast-249.0.0/src/component/instance.rs diff --git a/wast-247.0.0/src/component/item_ref.rs b/wast-249.0.0/src/component/item_ref.rs similarity index 100% rename from wast-247.0.0/src/component/item_ref.rs rename to wast-249.0.0/src/component/item_ref.rs diff --git a/wast-247.0.0/src/component/module.rs b/wast-249.0.0/src/component/module.rs similarity index 100% rename from wast-247.0.0/src/component/module.rs rename to wast-249.0.0/src/component/module.rs diff --git a/wast-247.0.0/src/component/resolve.rs b/wast-249.0.0/src/component/resolve.rs similarity index 98% rename from wast-247.0.0/src/component/resolve.rs rename to wast-249.0.0/src/component/resolve.rs index ca290fafe8..cca50c4f11 100644 --- a/wast-247.0.0/src/component/resolve.rs +++ b/wast-249.0.0/src/component/resolve.rs @@ -408,7 +408,8 @@ impl<'a> Resolver<'a> { } self.canon_opts(&mut info.opts)?; } - CoreFuncKind::ContextGet(_) | CoreFuncKind::ContextSet(_) => {} + CoreFuncKind::ContextGet(ty, _) => self.ref_type(ty)?, + CoreFuncKind::ContextSet(ty, _) => self.ref_type(ty)?, CoreFuncKind::StreamNew(info) => { self.resolve_ns(&mut info.ty, Ns::Type)?; } @@ -486,6 +487,18 @@ impl<'a> Resolver<'a> { Ok(()) } + fn ref_type(&mut self, ty: &mut ValType<'a>) -> Result<(), Error> { + Ok(match ty { + ValType::I32 | ValType::I64 | ValType::F32 | ValType::F64 | ValType::V128 => {} + ValType::Ref(r) => match &mut r.heap { + core::HeapType::Abstract { .. } => {} + core::HeapType::Concrete(id) | core::HeapType::Exact(id) => { + self.resolve_ns(id, Ns::Type)?; + } + }, + }) + } + fn canon_opts(&mut self, opts: &mut [CanonOpt<'a>]) -> Result<(), Error> { for opt in opts { match opt { @@ -658,15 +671,7 @@ impl<'a> Resolver<'a> { self.stack.pop(); } TypeDef::Resource(r) => { - match &mut r.rep { - ValType::I32 | ValType::I64 | ValType::F32 | ValType::F64 | ValType::V128 => {} - ValType::Ref(r) => match &mut r.heap { - core::HeapType::Abstract { .. } => {} - core::HeapType::Concrete(id) | core::HeapType::Exact(id) => { - self.resolve_ns(id, Ns::Type)?; - } - }, - } + self.ref_type(&mut r.rep)?; if let Some(dtor) = &mut r.dtor { self.core_item_ref(dtor)?; } diff --git a/wast-247.0.0/src/component/types.rs b/wast-249.0.0/src/component/types.rs similarity index 100% rename from wast-247.0.0/src/component/types.rs rename to wast-249.0.0/src/component/types.rs diff --git a/wast-247.0.0/src/component/wast.rs b/wast-249.0.0/src/component/wast.rs similarity index 100% rename from wast-247.0.0/src/component/wast.rs rename to wast-249.0.0/src/component/wast.rs diff --git a/wast-247.0.0/src/component_disabled.rs b/wast-249.0.0/src/component_disabled.rs similarity index 100% rename from wast-247.0.0/src/component_disabled.rs rename to wast-249.0.0/src/component_disabled.rs diff --git a/wast-247.0.0/src/core.rs b/wast-249.0.0/src/core.rs similarity index 100% rename from wast-247.0.0/src/core.rs rename to wast-249.0.0/src/core.rs diff --git a/wast-247.0.0/src/core/binary.rs b/wast-249.0.0/src/core/binary.rs similarity index 100% rename from wast-247.0.0/src/core/binary.rs rename to wast-249.0.0/src/core/binary.rs diff --git a/wast-247.0.0/src/core/binary/dwarf.rs b/wast-249.0.0/src/core/binary/dwarf.rs similarity index 100% rename from wast-247.0.0/src/core/binary/dwarf.rs rename to wast-249.0.0/src/core/binary/dwarf.rs diff --git a/wast-247.0.0/src/core/binary/dwarf_disabled.rs b/wast-249.0.0/src/core/binary/dwarf_disabled.rs similarity index 100% rename from wast-247.0.0/src/core/binary/dwarf_disabled.rs rename to wast-249.0.0/src/core/binary/dwarf_disabled.rs diff --git a/wast-247.0.0/src/core/custom.rs b/wast-249.0.0/src/core/custom.rs similarity index 100% rename from wast-247.0.0/src/core/custom.rs rename to wast-249.0.0/src/core/custom.rs diff --git a/wast-247.0.0/src/core/export.rs b/wast-249.0.0/src/core/export.rs similarity index 100% rename from wast-247.0.0/src/core/export.rs rename to wast-249.0.0/src/core/export.rs diff --git a/wast-247.0.0/src/core/expr.rs b/wast-249.0.0/src/core/expr.rs similarity index 100% rename from wast-247.0.0/src/core/expr.rs rename to wast-249.0.0/src/core/expr.rs diff --git a/wast-247.0.0/src/core/func.rs b/wast-249.0.0/src/core/func.rs similarity index 100% rename from wast-247.0.0/src/core/func.rs rename to wast-249.0.0/src/core/func.rs diff --git a/wast-247.0.0/src/core/global.rs b/wast-249.0.0/src/core/global.rs similarity index 100% rename from wast-247.0.0/src/core/global.rs rename to wast-249.0.0/src/core/global.rs diff --git a/wast-247.0.0/src/core/import.rs b/wast-249.0.0/src/core/import.rs similarity index 100% rename from wast-247.0.0/src/core/import.rs rename to wast-249.0.0/src/core/import.rs diff --git a/wast-247.0.0/src/core/memory.rs b/wast-249.0.0/src/core/memory.rs similarity index 100% rename from wast-247.0.0/src/core/memory.rs rename to wast-249.0.0/src/core/memory.rs diff --git a/wast-247.0.0/src/core/module.rs b/wast-249.0.0/src/core/module.rs similarity index 100% rename from wast-247.0.0/src/core/module.rs rename to wast-249.0.0/src/core/module.rs diff --git a/wast-247.0.0/src/core/resolve/deinline_import_export.rs b/wast-249.0.0/src/core/resolve/deinline_import_export.rs similarity index 100% rename from wast-247.0.0/src/core/resolve/deinline_import_export.rs rename to wast-249.0.0/src/core/resolve/deinline_import_export.rs diff --git a/wast-247.0.0/src/core/resolve/mod.rs b/wast-249.0.0/src/core/resolve/mod.rs similarity index 100% rename from wast-247.0.0/src/core/resolve/mod.rs rename to wast-249.0.0/src/core/resolve/mod.rs diff --git a/wast-247.0.0/src/core/resolve/names.rs b/wast-249.0.0/src/core/resolve/names.rs similarity index 100% rename from wast-247.0.0/src/core/resolve/names.rs rename to wast-249.0.0/src/core/resolve/names.rs diff --git a/wast-247.0.0/src/core/resolve/types.rs b/wast-249.0.0/src/core/resolve/types.rs similarity index 100% rename from wast-247.0.0/src/core/resolve/types.rs rename to wast-249.0.0/src/core/resolve/types.rs diff --git a/wast-247.0.0/src/core/table.rs b/wast-249.0.0/src/core/table.rs similarity index 100% rename from wast-247.0.0/src/core/table.rs rename to wast-249.0.0/src/core/table.rs diff --git a/wast-247.0.0/src/core/tag.rs b/wast-249.0.0/src/core/tag.rs similarity index 100% rename from wast-247.0.0/src/core/tag.rs rename to wast-249.0.0/src/core/tag.rs diff --git a/wast-247.0.0/src/core/types.rs b/wast-249.0.0/src/core/types.rs similarity index 100% rename from wast-247.0.0/src/core/types.rs rename to wast-249.0.0/src/core/types.rs diff --git a/wast-247.0.0/src/core/wast.rs b/wast-249.0.0/src/core/wast.rs similarity index 100% rename from wast-247.0.0/src/core/wast.rs rename to wast-249.0.0/src/core/wast.rs diff --git a/wast-247.0.0/src/encode.rs b/wast-249.0.0/src/encode.rs similarity index 100% rename from wast-247.0.0/src/encode.rs rename to wast-249.0.0/src/encode.rs diff --git a/wast-247.0.0/src/error.rs b/wast-249.0.0/src/error.rs similarity index 100% rename from wast-247.0.0/src/error.rs rename to wast-249.0.0/src/error.rs diff --git a/wast-247.0.0/src/gensym.rs b/wast-249.0.0/src/gensym.rs similarity index 100% rename from wast-247.0.0/src/gensym.rs rename to wast-249.0.0/src/gensym.rs diff --git a/wast-247.0.0/src/lexer.rs b/wast-249.0.0/src/lexer.rs similarity index 100% rename from wast-247.0.0/src/lexer.rs rename to wast-249.0.0/src/lexer.rs diff --git a/wast-247.0.0/src/lib.rs b/wast-249.0.0/src/lib.rs similarity index 99% rename from wast-247.0.0/src/lib.rs rename to wast-249.0.0/src/lib.rs index be157314f4..ad3cc46e03 100644 --- a/wast-247.0.0/src/lib.rs +++ b/wast-249.0.0/src/lib.rs @@ -454,6 +454,7 @@ pub mod kw { custom_keyword!(i8); custom_keyword!(i8x16); custom_keyword!(import); + custom_keyword!(implements); custom_keyword!(instance); custom_keyword!(instantiate); custom_keyword!(interface); diff --git a/wast-247.0.0/src/names.rs b/wast-249.0.0/src/names.rs similarity index 100% rename from wast-247.0.0/src/names.rs rename to wast-249.0.0/src/names.rs diff --git a/wast-247.0.0/src/parser.rs b/wast-249.0.0/src/parser.rs similarity index 100% rename from wast-247.0.0/src/parser.rs rename to wast-249.0.0/src/parser.rs diff --git a/wast-247.0.0/src/token.rs b/wast-249.0.0/src/token.rs similarity index 100% rename from wast-247.0.0/src/token.rs rename to wast-249.0.0/src/token.rs diff --git a/wast-247.0.0/src/wast.rs b/wast-249.0.0/src/wast.rs similarity index 100% rename from wast-247.0.0/src/wast.rs rename to wast-249.0.0/src/wast.rs diff --git a/wast-247.0.0/src/wat.rs b/wast-249.0.0/src/wat.rs similarity index 100% rename from wast-247.0.0/src/wat.rs rename to wast-249.0.0/src/wat.rs diff --git a/wast-247.0.0/tests/annotations.rs b/wast-249.0.0/tests/annotations.rs similarity index 100% rename from wast-247.0.0/tests/annotations.rs rename to wast-249.0.0/tests/annotations.rs diff --git a/wast-247.0.0/tests/comments.rs b/wast-249.0.0/tests/comments.rs similarity index 100% rename from wast-247.0.0/tests/comments.rs rename to wast-249.0.0/tests/comments.rs diff --git a/wast-247.0.0/tests/parse-fail.rs b/wast-249.0.0/tests/parse-fail.rs similarity index 100% rename from wast-247.0.0/tests/parse-fail.rs rename to wast-249.0.0/tests/parse-fail.rs diff --git a/wast-247.0.0/tests/parse-fail/bad-core-func-alias.wat b/wast-249.0.0/tests/parse-fail/bad-core-func-alias.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-core-func-alias.wat rename to wast-249.0.0/tests/parse-fail/bad-core-func-alias.wat diff --git a/wast-247.0.0/tests/parse-fail/bad-core-func-alias.wat.err b/wast-249.0.0/tests/parse-fail/bad-core-func-alias.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-core-func-alias.wat.err rename to wast-249.0.0/tests/parse-fail/bad-core-func-alias.wat.err diff --git a/wast-247.0.0/tests/parse-fail/bad-func-alias.wat b/wast-249.0.0/tests/parse-fail/bad-func-alias.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-func-alias.wat rename to wast-249.0.0/tests/parse-fail/bad-func-alias.wat diff --git a/wast-247.0.0/tests/parse-fail/bad-func-alias.wat.err b/wast-249.0.0/tests/parse-fail/bad-func-alias.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-func-alias.wat.err rename to wast-249.0.0/tests/parse-fail/bad-func-alias.wat.err diff --git a/wast-247.0.0/tests/parse-fail/bad-index.wat b/wast-249.0.0/tests/parse-fail/bad-index.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-index.wat rename to wast-249.0.0/tests/parse-fail/bad-index.wat diff --git a/wast-247.0.0/tests/parse-fail/bad-index.wat.err b/wast-249.0.0/tests/parse-fail/bad-index.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-index.wat.err rename to wast-249.0.0/tests/parse-fail/bad-index.wat.err diff --git a/wast-247.0.0/tests/parse-fail/bad-name.wat b/wast-249.0.0/tests/parse-fail/bad-name.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-name.wat rename to wast-249.0.0/tests/parse-fail/bad-name.wat diff --git a/wast-247.0.0/tests/parse-fail/bad-name.wat.err b/wast-249.0.0/tests/parse-fail/bad-name.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-name.wat.err rename to wast-249.0.0/tests/parse-fail/bad-name.wat.err diff --git a/wast-247.0.0/tests/parse-fail/bad-name2.wat b/wast-249.0.0/tests/parse-fail/bad-name2.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-name2.wat rename to wast-249.0.0/tests/parse-fail/bad-name2.wat diff --git a/wast-247.0.0/tests/parse-fail/bad-name2.wat.err b/wast-249.0.0/tests/parse-fail/bad-name2.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-name2.wat.err rename to wast-249.0.0/tests/parse-fail/bad-name2.wat.err diff --git a/wast-247.0.0/tests/parse-fail/bad-name3.wat b/wast-249.0.0/tests/parse-fail/bad-name3.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-name3.wat rename to wast-249.0.0/tests/parse-fail/bad-name3.wat diff --git a/wast-247.0.0/tests/parse-fail/bad-name3.wat.err b/wast-249.0.0/tests/parse-fail/bad-name3.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/bad-name3.wat.err rename to wast-249.0.0/tests/parse-fail/bad-name3.wat.err diff --git a/wast-247.0.0/tests/parse-fail/block1.wat b/wast-249.0.0/tests/parse-fail/block1.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/block1.wat rename to wast-249.0.0/tests/parse-fail/block1.wat diff --git a/wast-247.0.0/tests/parse-fail/block1.wat.err b/wast-249.0.0/tests/parse-fail/block1.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/block1.wat.err rename to wast-249.0.0/tests/parse-fail/block1.wat.err diff --git a/wast-247.0.0/tests/parse-fail/block2.wat b/wast-249.0.0/tests/parse-fail/block2.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/block2.wat rename to wast-249.0.0/tests/parse-fail/block2.wat diff --git a/wast-247.0.0/tests/parse-fail/block2.wat.err b/wast-249.0.0/tests/parse-fail/block2.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/block2.wat.err rename to wast-249.0.0/tests/parse-fail/block2.wat.err diff --git a/wast-247.0.0/tests/parse-fail/block3.wat b/wast-249.0.0/tests/parse-fail/block3.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/block3.wat rename to wast-249.0.0/tests/parse-fail/block3.wat diff --git a/wast-247.0.0/tests/parse-fail/block3.wat.err b/wast-249.0.0/tests/parse-fail/block3.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/block3.wat.err rename to wast-249.0.0/tests/parse-fail/block3.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment0.wat b/wast-249.0.0/tests/parse-fail/confusing-block-comment0.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment0.wat rename to wast-249.0.0/tests/parse-fail/confusing-block-comment0.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment0.wat.err b/wast-249.0.0/tests/parse-fail/confusing-block-comment0.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment0.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-block-comment0.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment1.wat b/wast-249.0.0/tests/parse-fail/confusing-block-comment1.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment1.wat rename to wast-249.0.0/tests/parse-fail/confusing-block-comment1.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment1.wat.err b/wast-249.0.0/tests/parse-fail/confusing-block-comment1.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment1.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-block-comment1.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment2.wat b/wast-249.0.0/tests/parse-fail/confusing-block-comment2.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment2.wat rename to wast-249.0.0/tests/parse-fail/confusing-block-comment2.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment2.wat.err b/wast-249.0.0/tests/parse-fail/confusing-block-comment2.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment2.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-block-comment2.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment3.wat b/wast-249.0.0/tests/parse-fail/confusing-block-comment3.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment3.wat rename to wast-249.0.0/tests/parse-fail/confusing-block-comment3.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment3.wat.err b/wast-249.0.0/tests/parse-fail/confusing-block-comment3.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment3.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-block-comment3.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment4.wat b/wast-249.0.0/tests/parse-fail/confusing-block-comment4.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment4.wat rename to wast-249.0.0/tests/parse-fail/confusing-block-comment4.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment4.wat.err b/wast-249.0.0/tests/parse-fail/confusing-block-comment4.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment4.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-block-comment4.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment5.wat b/wast-249.0.0/tests/parse-fail/confusing-block-comment5.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment5.wat rename to wast-249.0.0/tests/parse-fail/confusing-block-comment5.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment5.wat.err b/wast-249.0.0/tests/parse-fail/confusing-block-comment5.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment5.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-block-comment5.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment6.wat b/wast-249.0.0/tests/parse-fail/confusing-block-comment6.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment6.wat rename to wast-249.0.0/tests/parse-fail/confusing-block-comment6.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment6.wat.err b/wast-249.0.0/tests/parse-fail/confusing-block-comment6.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment6.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-block-comment6.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment7.wat b/wast-249.0.0/tests/parse-fail/confusing-block-comment7.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment7.wat rename to wast-249.0.0/tests/parse-fail/confusing-block-comment7.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment7.wat.err b/wast-249.0.0/tests/parse-fail/confusing-block-comment7.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment7.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-block-comment7.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment8.wat b/wast-249.0.0/tests/parse-fail/confusing-block-comment8.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment8.wat rename to wast-249.0.0/tests/parse-fail/confusing-block-comment8.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-block-comment8.wat.err b/wast-249.0.0/tests/parse-fail/confusing-block-comment8.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-block-comment8.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-block-comment8.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment0.wat b/wast-249.0.0/tests/parse-fail/confusing-line-comment0.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment0.wat rename to wast-249.0.0/tests/parse-fail/confusing-line-comment0.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment0.wat.err b/wast-249.0.0/tests/parse-fail/confusing-line-comment0.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment0.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-line-comment0.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment1.wat b/wast-249.0.0/tests/parse-fail/confusing-line-comment1.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment1.wat rename to wast-249.0.0/tests/parse-fail/confusing-line-comment1.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment1.wat.err b/wast-249.0.0/tests/parse-fail/confusing-line-comment1.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment1.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-line-comment1.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment2.wat b/wast-249.0.0/tests/parse-fail/confusing-line-comment2.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment2.wat rename to wast-249.0.0/tests/parse-fail/confusing-line-comment2.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment2.wat.err b/wast-249.0.0/tests/parse-fail/confusing-line-comment2.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment2.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-line-comment2.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment3.wat b/wast-249.0.0/tests/parse-fail/confusing-line-comment3.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment3.wat rename to wast-249.0.0/tests/parse-fail/confusing-line-comment3.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment3.wat.err b/wast-249.0.0/tests/parse-fail/confusing-line-comment3.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment3.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-line-comment3.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment4.wat b/wast-249.0.0/tests/parse-fail/confusing-line-comment4.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment4.wat rename to wast-249.0.0/tests/parse-fail/confusing-line-comment4.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment4.wat.err b/wast-249.0.0/tests/parse-fail/confusing-line-comment4.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment4.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-line-comment4.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment5.wat b/wast-249.0.0/tests/parse-fail/confusing-line-comment5.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment5.wat rename to wast-249.0.0/tests/parse-fail/confusing-line-comment5.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment5.wat.err b/wast-249.0.0/tests/parse-fail/confusing-line-comment5.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment5.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-line-comment5.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment6.wat b/wast-249.0.0/tests/parse-fail/confusing-line-comment6.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment6.wat rename to wast-249.0.0/tests/parse-fail/confusing-line-comment6.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment6.wat.err b/wast-249.0.0/tests/parse-fail/confusing-line-comment6.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment6.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-line-comment6.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment7.wat b/wast-249.0.0/tests/parse-fail/confusing-line-comment7.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment7.wat rename to wast-249.0.0/tests/parse-fail/confusing-line-comment7.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment7.wat.err b/wast-249.0.0/tests/parse-fail/confusing-line-comment7.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment7.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-line-comment7.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment8.wat b/wast-249.0.0/tests/parse-fail/confusing-line-comment8.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment8.wat rename to wast-249.0.0/tests/parse-fail/confusing-line-comment8.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-line-comment8.wat.err b/wast-249.0.0/tests/parse-fail/confusing-line-comment8.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-line-comment8.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-line-comment8.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-string0.wat b/wast-249.0.0/tests/parse-fail/confusing-string0.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string0.wat rename to wast-249.0.0/tests/parse-fail/confusing-string0.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-string0.wat.err b/wast-249.0.0/tests/parse-fail/confusing-string0.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string0.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-string0.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-string1.wat b/wast-249.0.0/tests/parse-fail/confusing-string1.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string1.wat rename to wast-249.0.0/tests/parse-fail/confusing-string1.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-string1.wat.err b/wast-249.0.0/tests/parse-fail/confusing-string1.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string1.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-string1.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-string2.wat b/wast-249.0.0/tests/parse-fail/confusing-string2.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string2.wat rename to wast-249.0.0/tests/parse-fail/confusing-string2.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-string2.wat.err b/wast-249.0.0/tests/parse-fail/confusing-string2.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string2.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-string2.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-string3.wat b/wast-249.0.0/tests/parse-fail/confusing-string3.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string3.wat rename to wast-249.0.0/tests/parse-fail/confusing-string3.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-string3.wat.err b/wast-249.0.0/tests/parse-fail/confusing-string3.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string3.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-string3.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-string4.wat b/wast-249.0.0/tests/parse-fail/confusing-string4.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string4.wat rename to wast-249.0.0/tests/parse-fail/confusing-string4.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-string4.wat.err b/wast-249.0.0/tests/parse-fail/confusing-string4.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string4.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-string4.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-string5.wat b/wast-249.0.0/tests/parse-fail/confusing-string5.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string5.wat rename to wast-249.0.0/tests/parse-fail/confusing-string5.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-string5.wat.err b/wast-249.0.0/tests/parse-fail/confusing-string5.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string5.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-string5.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-string6.wat b/wast-249.0.0/tests/parse-fail/confusing-string6.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string6.wat rename to wast-249.0.0/tests/parse-fail/confusing-string6.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-string6.wat.err b/wast-249.0.0/tests/parse-fail/confusing-string6.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string6.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-string6.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-string7.wat b/wast-249.0.0/tests/parse-fail/confusing-string7.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string7.wat rename to wast-249.0.0/tests/parse-fail/confusing-string7.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-string7.wat.err b/wast-249.0.0/tests/parse-fail/confusing-string7.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string7.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-string7.wat.err diff --git a/wast-247.0.0/tests/parse-fail/confusing-string8.wat b/wast-249.0.0/tests/parse-fail/confusing-string8.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string8.wat rename to wast-249.0.0/tests/parse-fail/confusing-string8.wat diff --git a/wast-247.0.0/tests/parse-fail/confusing-string8.wat.err b/wast-249.0.0/tests/parse-fail/confusing-string8.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/confusing-string8.wat.err rename to wast-249.0.0/tests/parse-fail/confusing-string8.wat.err diff --git a/wast-247.0.0/tests/parse-fail/inline1.wat b/wast-249.0.0/tests/parse-fail/inline1.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/inline1.wat rename to wast-249.0.0/tests/parse-fail/inline1.wat diff --git a/wast-247.0.0/tests/parse-fail/inline1.wat.err b/wast-249.0.0/tests/parse-fail/inline1.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/inline1.wat.err rename to wast-249.0.0/tests/parse-fail/inline1.wat.err diff --git a/wast-247.0.0/tests/parse-fail/newline-in-string.wat b/wast-249.0.0/tests/parse-fail/newline-in-string.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/newline-in-string.wat rename to wast-249.0.0/tests/parse-fail/newline-in-string.wat diff --git a/wast-247.0.0/tests/parse-fail/newline-in-string.wat.err b/wast-249.0.0/tests/parse-fail/newline-in-string.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/newline-in-string.wat.err rename to wast-249.0.0/tests/parse-fail/newline-in-string.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string1.wat b/wast-249.0.0/tests/parse-fail/string1.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string1.wat rename to wast-249.0.0/tests/parse-fail/string1.wat diff --git a/wast-247.0.0/tests/parse-fail/string1.wat.err b/wast-249.0.0/tests/parse-fail/string1.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string1.wat.err rename to wast-249.0.0/tests/parse-fail/string1.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string10.wat b/wast-249.0.0/tests/parse-fail/string10.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string10.wat rename to wast-249.0.0/tests/parse-fail/string10.wat diff --git a/wast-247.0.0/tests/parse-fail/string10.wat.err b/wast-249.0.0/tests/parse-fail/string10.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string10.wat.err rename to wast-249.0.0/tests/parse-fail/string10.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string11.wat b/wast-249.0.0/tests/parse-fail/string11.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string11.wat rename to wast-249.0.0/tests/parse-fail/string11.wat diff --git a/wast-247.0.0/tests/parse-fail/string11.wat.err b/wast-249.0.0/tests/parse-fail/string11.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string11.wat.err rename to wast-249.0.0/tests/parse-fail/string11.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string12.wat b/wast-249.0.0/tests/parse-fail/string12.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string12.wat rename to wast-249.0.0/tests/parse-fail/string12.wat diff --git a/wast-247.0.0/tests/parse-fail/string12.wat.err b/wast-249.0.0/tests/parse-fail/string12.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string12.wat.err rename to wast-249.0.0/tests/parse-fail/string12.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string13.wat b/wast-249.0.0/tests/parse-fail/string13.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string13.wat rename to wast-249.0.0/tests/parse-fail/string13.wat diff --git a/wast-247.0.0/tests/parse-fail/string13.wat.err b/wast-249.0.0/tests/parse-fail/string13.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string13.wat.err rename to wast-249.0.0/tests/parse-fail/string13.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string14.wat b/wast-249.0.0/tests/parse-fail/string14.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string14.wat rename to wast-249.0.0/tests/parse-fail/string14.wat diff --git a/wast-247.0.0/tests/parse-fail/string14.wat.err b/wast-249.0.0/tests/parse-fail/string14.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string14.wat.err rename to wast-249.0.0/tests/parse-fail/string14.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string15.wat b/wast-249.0.0/tests/parse-fail/string15.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string15.wat rename to wast-249.0.0/tests/parse-fail/string15.wat diff --git a/wast-247.0.0/tests/parse-fail/string15.wat.err b/wast-249.0.0/tests/parse-fail/string15.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string15.wat.err rename to wast-249.0.0/tests/parse-fail/string15.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string16.wat b/wast-249.0.0/tests/parse-fail/string16.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string16.wat rename to wast-249.0.0/tests/parse-fail/string16.wat diff --git a/wast-247.0.0/tests/parse-fail/string16.wat.err b/wast-249.0.0/tests/parse-fail/string16.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string16.wat.err rename to wast-249.0.0/tests/parse-fail/string16.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string2.wat b/wast-249.0.0/tests/parse-fail/string2.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string2.wat rename to wast-249.0.0/tests/parse-fail/string2.wat diff --git a/wast-247.0.0/tests/parse-fail/string2.wat.err b/wast-249.0.0/tests/parse-fail/string2.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string2.wat.err rename to wast-249.0.0/tests/parse-fail/string2.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string3.wat b/wast-249.0.0/tests/parse-fail/string3.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string3.wat rename to wast-249.0.0/tests/parse-fail/string3.wat diff --git a/wast-247.0.0/tests/parse-fail/string3.wat.err b/wast-249.0.0/tests/parse-fail/string3.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string3.wat.err rename to wast-249.0.0/tests/parse-fail/string3.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string4.wat b/wast-249.0.0/tests/parse-fail/string4.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string4.wat rename to wast-249.0.0/tests/parse-fail/string4.wat diff --git a/wast-247.0.0/tests/parse-fail/string4.wat.err b/wast-249.0.0/tests/parse-fail/string4.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string4.wat.err rename to wast-249.0.0/tests/parse-fail/string4.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string5.wat b/wast-249.0.0/tests/parse-fail/string5.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string5.wat rename to wast-249.0.0/tests/parse-fail/string5.wat diff --git a/wast-247.0.0/tests/parse-fail/string5.wat.err b/wast-249.0.0/tests/parse-fail/string5.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string5.wat.err rename to wast-249.0.0/tests/parse-fail/string5.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string6.wat b/wast-249.0.0/tests/parse-fail/string6.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string6.wat rename to wast-249.0.0/tests/parse-fail/string6.wat diff --git a/wast-247.0.0/tests/parse-fail/string6.wat.err b/wast-249.0.0/tests/parse-fail/string6.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string6.wat.err rename to wast-249.0.0/tests/parse-fail/string6.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string7.wat b/wast-249.0.0/tests/parse-fail/string7.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string7.wat rename to wast-249.0.0/tests/parse-fail/string7.wat diff --git a/wast-247.0.0/tests/parse-fail/string7.wat.err b/wast-249.0.0/tests/parse-fail/string7.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string7.wat.err rename to wast-249.0.0/tests/parse-fail/string7.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string8.wat b/wast-249.0.0/tests/parse-fail/string8.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string8.wat rename to wast-249.0.0/tests/parse-fail/string8.wat diff --git a/wast-247.0.0/tests/parse-fail/string8.wat.err b/wast-249.0.0/tests/parse-fail/string8.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string8.wat.err rename to wast-249.0.0/tests/parse-fail/string8.wat.err diff --git a/wast-247.0.0/tests/parse-fail/string9.wat b/wast-249.0.0/tests/parse-fail/string9.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/string9.wat rename to wast-249.0.0/tests/parse-fail/string9.wat diff --git a/wast-247.0.0/tests/parse-fail/string9.wat.err b/wast-249.0.0/tests/parse-fail/string9.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/string9.wat.err rename to wast-249.0.0/tests/parse-fail/string9.wat.err diff --git a/wast-247.0.0/tests/parse-fail/unbalanced.wat b/wast-249.0.0/tests/parse-fail/unbalanced.wat similarity index 100% rename from wast-247.0.0/tests/parse-fail/unbalanced.wat rename to wast-249.0.0/tests/parse-fail/unbalanced.wat diff --git a/wast-247.0.0/tests/parse-fail/unbalanced.wat.err b/wast-249.0.0/tests/parse-fail/unbalanced.wat.err similarity index 100% rename from wast-247.0.0/tests/parse-fail/unbalanced.wat.err rename to wast-249.0.0/tests/parse-fail/unbalanced.wat.err diff --git a/wast-247.0.0/tests/recursive.rs b/wast-249.0.0/tests/recursive.rs similarity index 100% rename from wast-247.0.0/tests/recursive.rs rename to wast-249.0.0/tests/recursive.rs diff --git a/wat-1.247.0/.cargo-checksum.json b/wat-1.247.0/.cargo-checksum.json deleted file mode 100644 index 788b529c9f..0000000000 --- a/wat-1.247.0/.cargo-checksum.json +++ /dev/null @@ -1 +0,0 @@ -{"files":{".cargo_vcs_info.json":"6dff49cd129323b1ae9abb69e1288d329dd223b58792cf293e73f40fcc6d0d18","Cargo.lock":"bef2aa59e403ef8fd6e56dd161d63f786e8cae6f9d040a83e434a6e7e907565e","Cargo.toml":"f5ce467297c003d38f2adf8d1c231f94d9970f7a5ab81dcd12e1a74caa4c5f06","Cargo.toml.orig":"41420c966b8741a2a34b7b02c7172c8daad45a9537f6aa350ecdcfdcab0914db","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"e3b0392305a38f5576d85611a17c84917ac9508adfa41693c895f65b6240d257","src/lib.rs":"d1ff13a2abbb51dd993f3a27a24edb5822ff5898bab7115ab7fff6b4eb52d330"},"package":"f3f4091c56437e86f2b57fa2fac72c4f528957a605b3f44f7c0b3b19a17ac5ee"} \ No newline at end of file diff --git a/wat-1.247.0/.cargo_vcs_info.json b/wat-1.247.0/.cargo_vcs_info.json deleted file mode 100644 index 24a30a379f..0000000000 --- a/wat-1.247.0/.cargo_vcs_info.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "git": { - "sha1": "0285a4680738439cb884d2674bec8be1e8beac5c" - }, - "path_in_vcs": "crates/wat" -} \ No newline at end of file diff --git a/wat-1.249.0/.cargo-checksum.json b/wat-1.249.0/.cargo-checksum.json new file mode 100644 index 0000000000..9d0e604743 --- /dev/null +++ b/wat-1.249.0/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".cargo_vcs_info.json":"9d280aeeb38b0e272d0ef7a8150e60dab170a34e475e515cf324889aed640325","Cargo.lock":"9c65298aedcb58b0f072c33eb6ba01827381ec1e2bfbd4b907ff5daa74cde3bf","Cargo.toml":"6a0564e6505438f2e7a644ffa8bf46a76373db77b32ad71e09a0cc0a4a09a340","Cargo.toml.orig":"a3257d77ed196b5cf30e711513bdefd36d129d080987dc3f156dc18e01c5629e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-Apache-2.0_WITH_LLVM-exception":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"e3b0392305a38f5576d85611a17c84917ac9508adfa41693c895f65b6240d257","src/lib.rs":"d1ff13a2abbb51dd993f3a27a24edb5822ff5898bab7115ab7fff6b4eb52d330"},"package":"28af699d0a9c7e4e250b7b8e36167ae5215fbb4b7ae526bb4ce7b234ba0afc90"} \ No newline at end of file diff --git a/wat-1.249.0/.cargo_vcs_info.json b/wat-1.249.0/.cargo_vcs_info.json new file mode 100644 index 0000000000..0a79279574 --- /dev/null +++ b/wat-1.249.0/.cargo_vcs_info.json @@ -0,0 +1,6 @@ +{ + "git": { + "sha1": "efeee7cafa5a3dcdddb5aab27bc0c05f279929ed" + }, + "path_in_vcs": "crates/wat" +} \ No newline at end of file diff --git a/wat-1.247.0/Cargo.lock b/wat-1.249.0/Cargo.lock similarity index 90% rename from wat-1.247.0/Cargo.lock rename to wat-1.249.0/Cargo.lock index 8354aef23a..149913b76b 100644 --- a/wat-1.247.0/Cargo.lock +++ b/wat-1.249.0/Cargo.lock @@ -85,9 +85,9 @@ checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c" [[package]] name = "wasm-encoder" -version = "0.247.0" +version = "0.249.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b6733b8b91d010a6ac5b0fb237dc46a19650bc4c67db66857e2e787d437204" +checksum = "69830ccbbf41c55eb585991659fb70867ef628193af3a495f09a6956f7615e59" dependencies = [ "leb128fmt", "wasmparser", @@ -95,9 +95,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.247.0" +version = "0.249.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6fb4c2bee46c5ea4d40f8cdb5c131725cd976718ec56f1c8e82fbde5fa2a80" +checksum = "30538cae9a794215f490b532df01c557e2e2bfac92569482554acd0992a102ea" dependencies = [ "bitflags", "indexmap", @@ -106,9 +106,9 @@ dependencies = [ [[package]] name = "wast" -version = "247.0.0" +version = "249.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579d2d47eb33b0cdf9b14723cb115f1e1b7d6e77aac6f0816e5b7c7aeaa418ff" +checksum = "2474a321bf9ae2808e9fa23ac4ec2b27300e70985e30bcb5a38d43b76bfc901a" dependencies = [ "bumpalo", "gimli", @@ -120,7 +120,7 @@ dependencies = [ [[package]] name = "wat" -version = "1.247.0" +version = "1.249.0" dependencies = [ "wast", ] diff --git a/wat-1.247.0/Cargo.toml b/wat-1.249.0/Cargo.toml similarity index 97% rename from wat-1.247.0/Cargo.toml rename to wat-1.249.0/Cargo.toml index e765f61542..7602bac38a 100644 --- a/wat-1.247.0/Cargo.toml +++ b/wat-1.249.0/Cargo.toml @@ -10,10 +10,10 @@ # See Cargo.toml.orig for the original contents. [package] -edition = "2021" +edition = "2024" rust-version = "1.85.0" name = "wat" -version = "1.247.0" +version = "1.249.0" authors = ["Alex Crichton "] build = false autolib = false @@ -43,7 +43,7 @@ name = "wat" path = "src/lib.rs" [dependencies.wast] -version = "247.0.0" +version = "249.0.0" features = ["wasm-module"] default-features = false diff --git a/wat-1.247.0/Cargo.toml.orig b/wat-1.249.0/Cargo.toml.orig similarity index 97% rename from wat-1.247.0/Cargo.toml.orig rename to wat-1.249.0/Cargo.toml.orig index 0c14119a42..20770ff06d 100644 --- a/wat-1.247.0/Cargo.toml.orig +++ b/wat-1.249.0/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "wat" -version = "1.247.0" +version = "1.249.0" authors = ["Alex Crichton "] edition.workspace = true license.workspace = true diff --git a/wat-1.249.0/LICENSE-APACHE b/wat-1.249.0/LICENSE-APACHE new file mode 100644 index 0000000000..16fe87b06e --- /dev/null +++ b/wat-1.249.0/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/wat-1.247.0/LICENSE-Apache-2.0_WITH_LLVM-exception b/wat-1.249.0/LICENSE-Apache-2.0_WITH_LLVM-exception similarity index 100% rename from wat-1.247.0/LICENSE-Apache-2.0_WITH_LLVM-exception rename to wat-1.249.0/LICENSE-Apache-2.0_WITH_LLVM-exception diff --git a/wat-1.247.0/LICENSE-MIT b/wat-1.249.0/LICENSE-MIT similarity index 100% rename from wat-1.247.0/LICENSE-MIT rename to wat-1.249.0/LICENSE-MIT diff --git a/wat-1.247.0/README.md b/wat-1.249.0/README.md similarity index 100% rename from wat-1.247.0/README.md rename to wat-1.249.0/README.md diff --git a/wat-1.247.0/src/lib.rs b/wat-1.249.0/src/lib.rs similarity index 100% rename from wat-1.247.0/src/lib.rs rename to wat-1.249.0/src/lib.rs