From 10db0e9c708f3be25ec9ae45f821109047aeba00 Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Tue, 4 Feb 2025 09:28:28 -0800 Subject: [PATCH 1/2] created INTEGER function on operand. --- Operand.cpp | 8 +++++++- __jet.cpp | 6 +++--- tests/testexpr.jet | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Operand.cpp b/Operand.cpp index 8916ab6..6cad9fb 100644 --- a/Operand.cpp +++ b/Operand.cpp @@ -94,7 +94,13 @@ namespace jet { } else if(in.ifNextIgnoreCase("CONCAT")) { } else if(in.ifNextIgnoreCase("INTEGER")) { - + if(!in.ifNext("(")) + throw coreutils::Exception("Expecting ( for INTEGER parameters."); + Operand parm1(in, tag); + if(in.ifNext(")")) { + string = parm1.string.asInteger(); + } else + throw coreutils::Exception("Expecting ) at end of INTEGER expression."); } else if(in.ifNextIgnoreCase("ROUND")) { } else if(in.ifNextIgnoreCase("RANDOM")) { diff --git a/__jet.cpp b/__jet.cpp index 64e0fd1..bcb8377 100644 --- a/__jet.cpp +++ b/__jet.cpp @@ -9,7 +9,7 @@ namespace jet { if(keywordDefined("cgi") && (resolveKeyword("cgi") == "true")) { global.cgi = true; - cookies = getenv("HTTP_COOKIE"); +// cookies = getenv("HTTP_COOKIE"); if(keywordDefined("sessiondir")) { global.session = true; @@ -20,7 +20,7 @@ namespace jet { // else // generate new session id. // create session cookie in response. - char hashit[64]; +/* char hashit[64]; char hash[32]; sprintf(hashit, "JETSESSION%ld", time(0)); SHA1(hashit, strlen(hashit), hash); @@ -32,7 +32,7 @@ namespace jet { if(keywordDefined("sessiontimeout")) { time_t timeout = time(0) + keywords["sessiontimeout"].asInteger(); } - +*/ // also save last activity time in session file. } diff --git a/tests/testexpr.jet b/tests/testexpr.jet index 3cc7da4..15a5e21 100755 --- a/tests/testexpr.jet +++ b/tests/testexpr.jet @@ -10,4 +10,6 @@ $[lefty]=01234 $[righty]=56789 $[trim]=this is a test + +$[integer]=12430 From 6e097d84332c7dc7e38dd61cc59931e7385f8b34 Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Thu, 6 Feb 2025 16:06:41 -0800 Subject: [PATCH 2/2] some small testvar updates. --- Operand.cpp | 1 + tests/testvar.jet | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Operand.cpp b/Operand.cpp index 6cad9fb..d2bd0b5 100644 --- a/Operand.cpp +++ b/Operand.cpp @@ -87,6 +87,7 @@ namespace jet { throw coreutils::Exception("Expecting ) at end of TRIM expression."); } else if(in.ifNextIgnoreCase("TOUPPER")) { + } else if(in.ifNextIgnoreCase("TOLOWER")) { } else if(in.ifNextIgnoreCase("REVERSE")) { diff --git a/tests/testvar.jet b/tests/testvar.jet index ba457b0..89c02b4 100755 --- a/tests/testvar.jet +++ b/tests/testvar.jet @@ -19,4 +19,6 @@ $[var$[i$[letterx]]$[i$[letterx]]] $[ix] $[ix] + +$[test64;tobase64]