Fixed expressions to be able to do math with nested expressions.

This commit is contained in:
Brad Arant committed 2024-09-30 14:20:59 -07:00
1 parent 0b9f2354a3
commit aa090c8a73
11 files changed
+86 -98

No files matched your search

+3 -4
View File
@@ -1,7 +1,7 @@
#include "__if.h"
#include "Exception.h"
#include <iostream>
#include "Expression.h"
#include "Operand.h"
namespace jet {
@@ -15,7 +15,7 @@ namespace jet {
throw coreutils::Exception("Either value1 or expr can be specified but not both.");
if(variableDefined("value2")) {
if(variableDefined("type")) {
result = Expression(variables["expr"]);
} else
throw coreutils::Exception("type expected if value1 and value2 specified.");
} else
@@ -37,8 +37,7 @@ namespace jet {
throw coreutils::Exception("value2 should not be specified with expr.");
if(variableDefined("type"))
throw coreutils::Exception("type should not be specified with expr.");
result = Expression(variables["expr"]);
booleanResult = true;
booleanResult = Operand(variables["expr"]).boolean;
}
if(booleanResult)
processContainer(container);