Laid ground work for resolveKeyword method on Tag and to not resolve automatically.

This commit is contained in:
brad Arant committed 2024-11-10 13:07:53 -08:00
1 parent 169ad1aa11
commit d7936de84f
5 files changed
+22 -9

No files matched your search

+7 -2
View File
@@ -1,6 +1,7 @@
#include "__set.h"
#include "Exception.h"
#include "Operand.h"
#include "KeywordValue.h"
#include <iostream>
namespace jet {
@@ -20,7 +21,10 @@ namespace jet {
if(variableDefined("expr") && variableDefined("eval"))
throw coreutils::Exception("Cannot use eval with expr.");
if(variableDefined("expr")) {
resolveKeyword("name");
if(variableDefined("expr")) {
resolveKeyword("eval");
if(!variableDefined("scope") || (variables["scope"] == "global"))
global.variables[variables["name"]] = Operand(variables["expr"]).string;
else if(variables["scope"] == "local")
@@ -44,7 +48,8 @@ namespace jet {
else if(variables["scope"] == "parent")
parent->parent->variables[variables["name"]] = container;
}
} else {
} else {
resolveKeyword("value");
if(!variableDefined("scope") || (variables["scope"] == "global"))
global.variables[variables["name"]] = variables["value"];
else if(variables["scope"] == "local")