diff --git a/Rez/Expression.cc b/Rez/Expression.cc index e93bec695a..259cde21f3 100644 --- a/Rez/Expression.cc +++ b/Rez/Expression.cc @@ -130,12 +130,26 @@ int IdentifierExpr::evaluateInt(ResourceCompiler *ctx) } else { - ExprPtr val = ctx->lookupIdentifier(id); + Subscripts sub; + for(auto arg : arguments) + sub.addSubscript(arg->evaluateInt(ctx)); + ExprPtr val = ctx->lookupIdentifier(id, sub); assert(val); return val->evaluateInt(ctx); } } +std::string IdentifierExpr::evaluateString(ResourceCompiler *ctx) +{ + assert(!isFunction); + Subscripts sub; + for(auto arg : arguments) + sub.addSubscript(arg->evaluateInt(ctx)); + ExprPtr val = ctx->lookupIdentifier(id, sub); + assert(val); + return val->evaluateString(ctx); +} + CaseExpr::CaseExpr(const std::string &tag, CompoundExprPtr expr) : tag(tag), expr(expr) diff --git a/Rez/Expression.h b/Rez/Expression.h index 9b4ec6b444..acc417e759 100644 --- a/Rez/Expression.h +++ b/Rez/Expression.h @@ -111,6 +111,7 @@ public: void addArgument(ExprPtr e); virtual int evaluateInt(ResourceCompiler *ctx); + virtual std::string evaluateString(ResourceCompiler *ctx); }; #endif // EXPRESSION_H