STL rework

- fixed lots of bugs
- overlay libraries work correctly and reliably
- the STL is an overlay library
- examples updated
This commit is contained in:
2023-06-17 21:12:23 +01:00
parent 5bb8a12fc2
commit aebbf51228
91 changed files with 1444 additions and 1395 deletions

2
src/bin/cli/mod.rs Normal file
View File

@@ -0,0 +1,2 @@
mod prompt;
pub use prompt::cmd_prompt;

11
src/bin/cli/prompt.rs Normal file
View File

@@ -0,0 +1,11 @@
use std::io::{self, Error, Write};
pub fn cmd_prompt(prompt: &str) -> Result<(String, Vec<String>), Error> {
print!("{}", prompt);
io::stdout().flush()?;
let mut cmdln = String::new();
io::stdin().read_line(&mut cmdln)?;
let mut segments = cmdln.split(' ');
let cmd = if let Some(cmd) = segments.next() { cmd } else { "" };
Ok((cmd.to_string(), segments.map(str::to_string).collect()))
}