Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #43 #44

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Version 2.13.2 : Bug fix
Fix #43

# Version 2.13.1 : Bug fix
Fix the issue of the function never used (moved implementation to the test
module)
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.13.1"
version = "2.13.2"
license = "GPL-3.0-or-later"
description = "A fully-featured minimalistic configurable rust calculator"
homepage = "https://calc.nwa2coco.fr"
Expand Down
2 changes: 1 addition & 1 deletion src/configuration/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub fn load_color(string: String) -> Color {

pub fn replace_variable(str: String) -> String {
str.replace("%author%", "Charlotte Thomas")
.replace("%version%", "v2.13.1")
.replace("%version%", "v2.13.2")
.to_string()
}

Expand Down
10 changes: 9 additions & 1 deletion src/lexing/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,15 @@ pub fn lex(input: String) -> Vec<Token> {

let length = input.len();
while current_pos < input.len() {
let current_character: char = chars.get(current_pos).unwrap().to_ascii_lowercase();
let peeking_char = chars.get(current_pos);
let current_character: char;
match peeking_char {
None => {
current_pos += 1;
continue;
}
Some(t) => current_character = t.to_ascii_lowercase(),
}
if !is_an_allowed_char(current_character) {
current_pos += 1;
continue;
Expand Down
4 changes: 1 addition & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ fn handle_config(line: &str, config: Config) -> (String, Option<Config>) {
fn main() {
let mut args: Args = env::args();

let version: String = "v2.13.1".to_string();
let version: String = "v2.13.2".to_string();
if args.len() > 1 || !atty::is(Stream::Stdin) {
let mut a = vec![];

Expand Down Expand Up @@ -293,7 +293,6 @@ fn main() {
exit(0);
}


if arg_final == "-u" || arg_final == "--update" {
if cfg!(target_os = "windows") {
Command::new("cmd")
Expand All @@ -311,7 +310,6 @@ fn main() {
exit(0);
}


let lexed = lex(arg_final);
let mut parser = init_calc_parser(&lexed);
let parsed = parser.parse();
Expand Down
2 changes: 1 addition & 1 deletion src/parsing/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl Parameters {
#[cfg(test)]
mod test {
use crate::parsing::ast::{Ast, Parameters};

impl Ast {
pub fn new(p: Parameters) -> Self {
Ast::Node {
Expand Down
Loading