diff --git a/Tag.cpp b/Tag.cpp index aa91d8f..50012b0 100644 --- a/Tag.cpp +++ b/Tag.cpp @@ -50,7 +50,10 @@ namespace jet { if(!finished) { coreutils::ZString keywordName = in.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"); if(in.ifNext("=\"")) { - variables[keywordName] = in.getTokenExclude("\""); + if(variables.count(keywordName) == 0) + variables[keywordName] = in.getTokenExclude("\""); + else + throw coreutils::Exception("keyword name must be unique for tag."); } if(!in.ifNext("\"")) {} } diff --git a/__call.cpp b/__call.cpp index d960edf..f3e8b5d 100644 --- a/__call.cpp +++ b/__call.cpp @@ -51,7 +51,7 @@ namespace jet { close(fdo[1]); if(variableDefined("name")) { resolveKeyword("name"); - if(!variableDefined("scope") && (variables["scope"] == "global")) + if(!variableDefined("scope") || (variables["scope"] == "global")) global.variables[variables["name"]].read(fdo[0]); else if(variables["scope"] == "local") parent->variables[variables["name"]].read(fdo[0]);