From 3679644f6463facd26c832a0443ee41f827fa384 Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Mon, 23 Sep 2024 17:07:32 -0700 Subject: [PATCH] More work on Global getVariabke. --- Global.cpp | 5 +++++ testjet.cpp | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Global.cpp b/Global.cpp index d8c8160..51e158d 100644 --- a/Global.cpp +++ b/Global.cpp @@ -55,6 +55,11 @@ namespace jet { coreutils::MString name = variable.getTokenInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-"); if(variable.ifNext("]")) return name; + if(variable.startsWith("$[")) { + name << getVariable(variable); + return name; + } + return coreutils::MString(""); } } diff --git a/testjet.cpp b/testjet.cpp index 2d258b9..919614d 100644 --- a/testjet.cpp +++ b/testjet.cpp @@ -41,9 +41,10 @@ int main(int argc, char **argv) { " \n" "\n"); - coreutils::ZString data("\n" - " \n" - " $[test]\n" + coreutils::ZString data("\n" + " \n" + " \n" + " $[test$[ix]]\n" "\n"); // coreutils::ZString data("ABCHIJXYZ\n");