Skip to content

Commit

Permalink
bump to 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vanilla-extracts committed Nov 14, 2023
1 parent 15d53a0 commit c600bf8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mini-calc"
version = "2.0.0"
version = "2.1.0"
license = "GPL-3.0-or-later"
description = "A minimalistic configurable rust calculator"
homepage = "https://calc.nwa2coco.fr"
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ cargo install mini-calc
- [X] Basic operation interpreter
- [X] Advanced operation interpreter
- [X] Identifiers (variable) interpreter
- [ ] Built-in
- [ ] ans
- [X] Built-in
- [X] pi
- [X] e
- [ ] Config
Expand Down
2 changes: 0 additions & 2 deletions src/interpreting/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ pub fn interpret(ast: Ast, mut ram: &mut HashMap<String, Parameters>) -> Paramet
Parameters::Identifier(s) => Parameters::Identifier(s),
Parameters::Null => Parameters::Null,
};
ram.remove("ans");
ram.insert("ans".to_string(),last.clone());
last.clone()
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,21 @@ fn main() {
let mut ram: HashMap<String, Parameters> = HashMap::new();
ram.insert("pi".to_string(),Parameters::Float(PI));
ram.insert("e".to_string(), Parameters::Float(E));
ram.insert("ans".to_string(), Parameters::Null);
while let ReadResult::Input(line) = interface.read_line().unwrap() {
match line.as_str().trim() {
"info" => {
let message = Color::Purple.paint(" Calc v2.0.0 \n Author: Charlotte Thomas \n Written in Rust \n Repo: https://github.com/coco33920/calc\n");
let message = Color::Purple.paint(" Calc v2.1.0 \n Author: Charlotte Thomas \n Written in Rust \n Repo: https://github.com/coco33920/calc\n");
println!("{}", message)
}
"exit" => break,
"help" => {
let message = Color::Purple.paint(
" Calc v2.0.0 Help \n > info : show infos \n > exit : exit the program \n > help : print this help \n > verbose : toggle the verbose \n > version : prints the version \n"
" Calc v2.1.0 Help \n > info : show infos \n > exit : exit the program \n > help : print this help \n > verbose : toggle the verbose \n > version : prints the version \n"
);
println!("{}", message)
}
"version" => {
let message = Color::Purple.paint(" Calc v2.0.0\n");
let message = Color::Purple.paint(" Calc v2.1.0\n");
println!("{}", message)
}
"verbose" => {
Expand Down

0 comments on commit c600bf8

Please sign in to comment.