Skip to content

Commit

Permalink
fix #43 (#44)
Browse files Browse the repository at this point in the history
bump to 2.13.2
  • Loading branch information
vanilla-extracts authored May 14, 2024
1 parent 720ca8c commit c584fa0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
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

0 comments on commit c584fa0

Please sign in to comment.