Fixed bug on call tag scope check. Added keyword duplicate check to Tag processing.

This commit is contained in:
Brad Arant 2024-11-11 08:57:17 -08:00
parent 069fb9c9f3
commit 858d073d63
2 changed files with 5 additions and 2 deletions

View File

@ -50,7 +50,10 @@ namespace jet {
if(!finished) { if(!finished) {
coreutils::ZString keywordName = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"); coreutils::ZString keywordName = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_");
if(in.ifNext("=\"")) { if(in.ifNext("=\"")) {
if(variables.count(keywordName) == 0)
variables[keywordName] = in.getTokenExclude("\""); variables[keywordName] = in.getTokenExclude("\"");
else
throw coreutils::Exception("keyword name must be unique for tag.");
} }
if(!in.ifNext("\"")) {} if(!in.ifNext("\"")) {}
} }

View File

@ -51,7 +51,7 @@ namespace jet {
close(fdo[1]); close(fdo[1]);
if(variableDefined("name")) { if(variableDefined("name")) {
resolveKeyword("name"); resolveKeyword("name");
if(!variableDefined("scope") && (variables["scope"] == "global")) if(!variableDefined("scope") || (variables["scope"] == "global"))
global.variables[variables["name"]].read(fdo[0]); global.variables[variables["name"]].read(fdo[0]);
else if(variables["scope"] == "local") else if(variables["scope"] == "local")
parent->variables[variables["name"]].read(fdo[0]); parent->variables[variables["name"]].read(fdo[0]);