Transparently support multiline input in the Tvix REPL, by handling the
UnexpectedEOF error returned by the parser and using it to progressively
build up an input expr over multiple iterations of the REPL's outer
loop.
This works quite nicely:
❯ cargo r --bin tvix
Compiling tvix-cli v0.1.0 (/home/aspen/code/depot/tvix/cli)
Finished dev [unoptimized + debuginfo] target(s) in 1.72s
Running `target/debug/tvix`
tvix-repl> { foo
> =
> 1;
> }
=> { foo = 1; } :: set
<press up arrow>
tvix-repl> { foo
=
1;
}
=> { foo = 1; } :: set
Change-Id: Ib0ed4766b13e8231d696cdc27281ac158e20a777
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11732
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: aspen <root@gws.fyi>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
28 lines
736 B
TOML
28 lines
736 B
TOML
[package]
|
|
name = "tvix-cli"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[[bin]]
|
|
name = "tvix"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
nix-compat = { path = "../nix-compat" }
|
|
tvix-build = { path = "../build" }
|
|
tvix-castore = { path = "../castore" }
|
|
tvix-store = { path = "../store", default-features = false, features = []}
|
|
tvix-eval = { path = "../eval" }
|
|
tvix-glue = { path = "../glue" }
|
|
bytes = "1.4.0"
|
|
clap = { version = "4.0", features = ["derive", "env"] }
|
|
dirs = "4.0.0"
|
|
rustyline = "10.0.0"
|
|
rnix = "0.11.0"
|
|
thiserror = "1.0.38"
|
|
tokio = "1.28.0"
|
|
tracing = { version = "0.1.37", features = ["max_level_trace", "release_max_level_info"] }
|
|
tracing-subscriber = "0.3.16"
|
|
|
|
[dependencies.wu-manber]
|
|
git = "https://github.com/tvlfyi/wu-manber.git"
|