2013-07-17 05:10:18 +00:00
|
|
|
#include <iostream>
|
2013-08-18 23:23:29 +00:00
|
|
|
#include <fstream>
|
2013-07-17 05:10:18 +00:00
|
|
|
#include "version.h"
|
2013-08-19 01:25:34 +00:00
|
|
|
#include "printer.h"
|
2013-08-21 16:04:49 +00:00
|
|
|
#include "lean_parser.h"
|
2013-08-18 17:37:00 +00:00
|
|
|
using namespace lean;
|
2013-07-17 21:24:35 +00:00
|
|
|
|
2013-08-18 23:23:29 +00:00
|
|
|
int main(int argc, char ** argv) {
|
2013-07-17 05:10:18 +00:00
|
|
|
std::cout << "Lean (version " << LEAN_VERSION_MAJOR << "." << LEAN_VERSION_MINOR << ")\n";
|
2013-08-21 23:43:59 +00:00
|
|
|
std::cout << "Type Ctrl-D to exit or 'Help.' for help."<< std::endl;
|
2013-08-18 17:37:00 +00:00
|
|
|
frontend f;
|
2013-08-18 23:23:29 +00:00
|
|
|
if (argc == 1) {
|
2013-08-22 01:24:26 +00:00
|
|
|
return parse_commands(f, std::cin, false, true) ? 0 : 1;
|
2013-08-18 23:23:29 +00:00
|
|
|
} else {
|
|
|
|
bool ok = true;
|
|
|
|
for (int i = 1; i < argc; i++) {
|
|
|
|
std::ifstream in(argv[i]);
|
|
|
|
if (!parse_commands(f, in))
|
|
|
|
ok = false;
|
|
|
|
}
|
|
|
|
return ok ? 0 : 1;
|
|
|
|
}
|
2013-07-17 05:10:18 +00:00
|
|
|
}
|