Skip to content

Commit

Permalink
Merge pull request #15 from Hack-n-Leap/dev
Browse files Browse the repository at this point in the history
Ajout de l'assignation des calculs aux variables
  • Loading branch information
Thotoman authored May 17, 2024
2 parents 0884478 + a915a3f commit 7789d5c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Interpreter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,14 @@ public void EvaluateVariable(string line)
{
varType = Variables[var[1]].Type;
var[1] = Variables[var[1]].Value;
} else if (varType == Type.OPERATION_NUMBER)
{
var[1] = EvaluateOperations(var[1]).ToString();
varType = EvaluateType(var[1]);
} else if (varType == Type.OPERATION_BOOL)
{
var[1] = EvaluateBooleanOperations(var[1]).ToString();
varType = Type.BOOLEAN;
}

Variables[var[0]] = new Variable(var[0], var[1], varType);
Expand Down

0 comments on commit 7789d5c

Please sign in to comment.