JetCore/jet-2.0.cpp
2024-11-18 16:59:32 -08:00

33 lines
797 B
C++

#include <iostream>
#include <sstream>
#include "File.h"
#include "Global.h"
#include "Exception.h"
#include "__jet.h"
int main(int argc, char **argv, char **envp) {
coreutils::File script(argv[1]);
script.read();
coreutils::ZString data = script.asZString();
data.goeol();
jet::Global global(envp);
try {
coreutils::MString out;
jet::__jet *jet = new jet::__jet(data, out, global, NULL);
delete jet;
global.outputHeaders();
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();
}
}