Skip to content

Commit

Permalink
Add pls/printlns, update dtsh for interpreting stdin, add dtsh dev link
Browse files Browse the repository at this point in the history
  • Loading branch information
booniepepper committed Sep 12, 2022
1 parent da67894 commit 99b031d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions dt-src/stdlib/display.dt
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[ p ] [ print ] def
[ pl ] [ println ] def
[ [ pl ] each ] [ pls ] def

[ p ] [ print ] def
[ pl ] [ println ] def
[ pls ] [ printlns ] def
1 change: 1 addition & 0 deletions dtsh
5 changes: 2 additions & 3 deletions src/bin/dtsh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ pub fn main() {
let state = DtState::new_with_libs(args.no_stdlib, args.lib_list);

match args.mode {
Some(Mode::Interactive) | None => DtPrompt::default().run(state),
Some(Mode::Interactive) | Some(Mode::RunStdin) | None => DtPrompt::default().run(state),
Some(Mode::Run { file }) => {
let tokens = loading::from_dt_source_file(file);
state.run_tokens(tokens);
}
Some(Mode::RunStdin) => unimplemented!("I don't know how to run stdin yet"),
}
}

Expand Down Expand Up @@ -45,6 +44,6 @@ enum Mode {
Run { file: String },

#[clap(name = "-")]
/// Read from standard input.
/// Interpret code from standard input.
RunStdin,
}

0 comments on commit 99b031d

Please sign in to comment.