From df283d562dd893664512f0795b7a122453a0589a Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Sun, 6 Sep 2020 12:57:55 +0200 Subject: [PATCH] partial start of implementation for interpreter --- main.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 188da8b..9ae0a4a 100644 --- a/main.cpp +++ b/main.cpp @@ -10,9 +10,11 @@ #include #include #include +#include #include #include #include "requester.hpp" +#include "interpreter.hpp" sc::logger logger {"curly", sc::loglevel::info}; @@ -63,10 +65,14 @@ int main(int argc, const char * argv[]) { std::cerr << "curly: " << ex.what() << '\n'; } } - std::cout << "hello, curly\n"; + requester req; - std::cout << req.get("https://www.swiftcoder.nl/") << '\n'; - std::cout << req.get("https://www.swiftcoder.nl/moneydance/") << '\n'; + std::string code {req.get("https://www.swiftcoder.nl/cpp1/start.txt")}; + std::cerr << code << '\n'; + std::istringstream in {code}; + interpreter proc; + std::string result {proc.eval(in)}; + std::cerr << result << '\n'; } catch (const std::exception& ex) { std::cerr << "curly: " << ex.what() << '\n';