Skip to content

Commit

Permalink
add experimental flag to uiua eval
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Nov 12, 2024
1 parent 8925407 commit 6528187
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This version is not yet released. If you are reading this on the website, then t
- This should not affect any language semantics
- Improve pattern matching error messages
- Optimize the "root" pattern `ⁿ%:1`
- Add an `-e`/`--experimental` flag to the `uiua eval` command to enable experimental features
### Website
- Add a new pad setting to show line values to the right of the code

Expand Down
5 changes: 5 additions & 0 deletions src/compile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ impl Compiler {
self.mode = mode;
self
}
/// Enable experimental features
pub fn experimental(&mut self, experimental: bool) -> &mut Self {
self.scope.experimental = experimental;
self
}
/// Get the backend
pub fn backend(&self) -> Arc<dyn SysBackend> {
self.macro_env.rt.backend.clone()
Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ fn main() {
App::Eval {
code,
no_color,
experimental,
#[cfg(feature = "audio")]
audio_options,
args,
Expand All @@ -191,6 +192,7 @@ fn main() {
let mut rt = Uiua::with_native_sys().with_args(args);
rt.compile_run(|comp| {
comp.mode(RunMode::Normal)
.experimental(experimental)
.print_diagnostics(true)
.load_str(&code)
})
Expand Down Expand Up @@ -710,6 +712,8 @@ enum App {
code: String,
#[clap(long, help = "Don't colorize stack output")]
no_color: bool,
#[clap(short, long, help = "Enable experimental features")]
experimental: bool,
#[cfg(feature = "audio")]
#[clap(flatten)]
audio_options: AudioOptions,
Expand Down

0 comments on commit 6528187

Please sign in to comment.