Skip to content

Commit

Permalink
update to 0.6.0 added new language + quality of life
Browse files Browse the repository at this point in the history
  • Loading branch information
sn99 committed Sep 16, 2020
1 parent 0bb3aab commit 8d614dc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "brainhug"
version = "0.5.0"
version = "0.6.0"
authors = ["sn99 <[email protected]>"]
edition = "2018"
description = "A simple brainf*ck translator"
Expand All @@ -9,6 +9,7 @@ license = "MIT"
readme = "README.md"
homepage = "https://sn99.github.io/brainhug/"
keywords = ["brainfuck", "interpreter"]
documentation = "https://docs.rs/brainhug"

[badges]
travis-ci = { repository = "sn99/brainhug", branch = "master" }
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,4 @@ pub fn brains(input: &str) -> String {
let tokens = tokenize(input);

generate(&tokens)
}
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub fn generate(lang: Lang, input: &str) -> String {
}
Lua => {
use crate::lua::brains;
brains(input).to_string()
brains(input)
}
}
}
4 changes: 2 additions & 2 deletions src/lua/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ fn push_aritms(out: &mut String, aritms: isize) {
if aritms > 0 {
out.push_str(format!("tape[idx] = tape[idx] + {}\n", aritms).as_str());
} else {
out.push_str(format!("tape[idx] = tape[idx] - {}\n", aritms * -1).as_str());
out.push_str(format!("tape[idx] = tape[idx] - {}\n", -aritms).as_str());
}
}

fn push_arrows(out: &mut String, arrows: isize) {
if arrows > 0 {
out.push_str(format!("idx = idx + {};\n", arrows).as_str());
} else {
out.push_str(format!("idx = idx - {};\n", arrows * -1).as_str());
out.push_str(format!("idx = idx - {};\n", -arrows).as_str());
}
}

Expand Down

0 comments on commit 8d614dc

Please sign in to comment.