33 个版本

0.17.2 2021 年 1 月 9 日
0.17.1 2020 年 7 月 23 日
0.16.0 2020 年 4 月 21 日
0.15.0 2020 年 2 月 23 日
0.6.1 2018 年 11 月 29 日

#923 in 开发工具

MIT 许可证

280KB
6K SLoC

Build Status Latest Version Rust Documentation codecov Rustc Version 1.42+

Papyrus - 一个 Rust REPL 和脚本运行工具。

该项目不再维护。

请参阅 rs 文档指南。在 github 上查看进度并贡献。

papyrus=> 2+2
papyrus [out0]: 4

概览

Papyrus 在您的终端中创建一个 Rust REPL。代码可以逐行输入,并得到评估反馈,或者可以通过 stdin 处理器注入代码。每个代码片段都在基于表达式的系统上进行评估,因此以分号终止需要更多输入。

示例

[lib] papyrus=> 2+2
papyrus [out0]: 4
[lib] papyrus=> println!("Hello, world!");
[lib] papyrus.> out0 * out0
Hello, world!
papyrus [out1]: 16
[lib] papyrus=> :help
help -- prints the help messages
cancel | c -- returns to the root class
exit -- sends the exit signal to end the interactive loop
Classes:
  edit -- Edit previous input
  mod -- Handle modules
Actions:
  mut -- Begin a mutable block of code
[lib] papyrus=> :exit
[lib] papyrus=> Thanks for using papyrus!

安装

Papyrus 可以从 crates.io 安装,或者从 github 上构建源代码。默认的安装功能集需要 nightly 工具链,但可以使用 stable 以启用较少的功能。

要安装所有功能

rustup toolchain add nightly
cargo +nightly install papyrus

要在不使用 racer 补全的情况下在稳定版上安装

cargo +stable install papyrus --no-default-features --features="format,runnable"

要求

功能

Papyrus 有功能集

  • format: 使用 rustfmt 格式化代码片段
  • racer-completion: 启用使用 racer 的代码补全。 需要 nightly 编译器
  • runnable: Papyrus 可以 运行,无需手动处理 repl 状态和输出

默认启用所有功能。

Cargo

Papyrus 利用已安装的 cargorustc 的二进制文件。这个要求可能在将来取消,但到目前为止,任何想要使用 Papyrus 的用户都需要安装 Rust。

依赖

~8–20MB
~266K SLoC