Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
buttercrab committed Sep 5, 2020
1 parent b4f4c6c commit 624da0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hyeong"
version = "0.1.3"
version = "0.2.0"
authors = ["buttercrab <[email protected]>"]
edition = "2018"
license = "MIT"
Expand All @@ -12,6 +12,7 @@ include = [
"Cargo.toml",
"README.md"
]
readme = "README.md"

[badges]
travis-ci = { repository = "buttercrab/hyeo-ung-lang" }
Expand Down
2 changes: 2 additions & 0 deletions src/core/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ fn command(indent: usize, c: &impl Code) -> String {
\n{0}for _ in 0..{1} {{\
\n{0} v.push(stack.pop(cur));\
\n{0}}}\
\n{0}v.reverse();\
\n{0}for mut x in v {{\
\n{0} x.minus();\
\n{0} n += &x;\
Expand All @@ -89,6 +90,7 @@ fn command(indent: usize, c: &impl Code) -> String {
\n{0}for _ in 0..{1} {{\
\n{0} v.push(stack.pop(cur));\
\n{0}}}\
\n{0}v.reverse();\
\n{0}for mut x in v {{\
\n{0} x.flip();\
\n{0} n *= &x;\
Expand Down
4 changes: 4 additions & 0 deletions src/core/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ where
v.push(pop_stack_wrap(ipt, out, err, &mut state, cur_stack)?);
}

v.reverse();

for mut x in v {
x.minus();
n += &x;
Expand All @@ -190,6 +192,8 @@ where
v.push(pop_stack_wrap(ipt, out, err, &mut state, cur_stack)?);
}

v.reverse();

for mut x in v {
x.flip();
n *= &x;
Expand Down

0 comments on commit 624da0a

Please sign in to comment.