#include "sdl/InitSDL.h"
#include <cstdlib>
+#include <cstring>
#include <ctime>
#include <exception>
#include <iostream>
switch (args.DetectRunLevel()) {
case Arguments::COMPILE:
{
- std::ofstream testOut(args.OutfilePath());
- Compiler(intp).Write(testOut);
+ int length(std::strlen(args.OutfilePath()));
+ switch (args.OutfilePath()[length - 1]) {
+ case 'h': {
+ std::ofstream outstream(args.OutfilePath());
+ source.WriteHeader(outstream);
+ break;
+ }
+ default:
+ case 'o': {
+ std::ofstream outstream(args.OutfilePath());
+ Compiler(intp).Write(outstream);
+ break;
+ }
+ }
return 0;
}
- case Arguments::DUMP:
- {
+ case Arguments::DUMP: {
std::cout << source << std::endl;
return 0;
}