Skip to content

Commit

Permalink
Update Interpreter.cs
Browse files Browse the repository at this point in the history
Fixed the bloody increment bug.
  • Loading branch information
JacobMisirian committed Sep 19, 2015
1 parent df6620c commit c903854
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Hassium/Interpreter/Interpreter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -921,10 +921,10 @@ public object Accept(MentalNode node)
switch (mnode.OpType)
{
case "++":
SetVariable(mnode.Name, Convert.ToDouble((object)GetVariable(mnode.Name, mnode)) + 1, mnode);
SetVariable(mnode.Name, Convert.ToInt32((object)GetVariable(mnode.Name, mnode)) + 1, mnode);
break;
case "--":
SetVariable(mnode.Name, Convert.ToDouble((object)GetVariable(mnode.Name, mnode)) - 1, mnode);
SetVariable(mnode.Name, Convert.ToInt32((object)GetVariable(mnode.Name, mnode)) - 1, mnode);
break;
default:
throw new ParseException("Unknown operation " + mnode.OpType, mnode);
Expand Down

0 comments on commit c903854

Please sign in to comment.