From b0453fe0cb890f86bffa76fb95798d00c98e6b69 Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Mon, 18 Nov 2024 16:59:32 -0800 Subject: [PATCH] worked on error output just a little. --- Global.cpp | 2 +- __jet.cpp | 16 ++-------------- jet-2.0.cpp | 3 +++ tests/testexpr.jet | 3 +++ tests/testjet.jet | 4 ++-- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Global.cpp b/Global.cpp index 49e6847..9917c94 100644 --- a/Global.cpp +++ b/Global.cpp @@ -108,7 +108,7 @@ namespace jet { name << getVariable(variable, lvariables); else if(variable.ifNext("]")) return; - else if(!variable.ifNextInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-")) + else if(!variable.ifNextInclude("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-")) throw coreutils::Exception("invalid variable name."); } return; diff --git a/__jet.cpp b/__jet.cpp index 275e515..5ad4385 100644 --- a/__jet.cpp +++ b/__jet.cpp @@ -19,26 +19,14 @@ namespace jet { coreutils::IMFRequest request(postdata); coreutils::IMFMessage message(postdata); - - - + if(contentType == "multipart/form-data") std::cout << "output multipart variables to global" << std::endl; else if(contentType == "application/x-www-form-urlencoded") std::cout << "output urlencoded variables to global" << std::endl; } } - - try { - processContainer(container); - } - catch(coreutils::Exception e) { - std::cout << container.parsed() << std::endl; - std::cout << "***** " << e.text << std::endl; - std::cout << container.unparsed() << std::endl; - throw e; - } - + processContainer(container); } } diff --git a/jet-2.0.cpp b/jet-2.0.cpp index 0ea6de0..59191cb 100644 --- a/jet-2.0.cpp +++ b/jet-2.0.cpp @@ -22,6 +22,9 @@ int main(int argc, char **argv, char **envp) { std::cout << out; } catch(coreutils::Exception e) { + std::cout << data.parsed() << std::endl; + std::cout << "******** Error caught: " << e.text << std::endl; + std::cout << data.unparsed() << std::endl; std::cout << "Error caught: " << e.text << std::endl; global.dump(); } diff --git a/tests/testexpr.jet b/tests/testexpr.jet index 220ae99..f159e5a 100755 --- a/tests/testexpr.jet +++ b/tests/testexpr.jet @@ -3,4 +3,7 @@ $[test2] +0123456789 + +$[lefty] diff --git a/tests/testjet.jet b/tests/testjet.jet index 90a1e25..27e7a6d 100755 --- a/tests/testjet.jet +++ b/tests/testjet.jet @@ -19,9 +19,9 @@ - $[nested] + $[$nested] 0123456789 - + lefty=[$[lefty]] substring('abcdefg', 1, 3)=[$[theexpr]] 5+3=($[addition])