partial start of implementation for interpreter
This commit is contained in:
parent
00d0eac893
commit
df283d562d
12
main.cpp
12
main.cpp
@ -10,9 +10,11 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <getopt.h>
|
||||
#include <libsclogging.hpp>
|
||||
#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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user