forked from ground/ground
Ground REPL
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "compiler.h"
|
||||
#include "types.h"
|
||||
#include "serialize.h"
|
||||
#include "repl.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -43,9 +44,8 @@ char* getFileContents(const char* filename) {
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if (argc < 2) {
|
||||
printf("Usage: %s <file> [-c] [--compile] [-h] [--help]\n", argv[0]);
|
||||
exit(1);
|
||||
if (argc == 1) {
|
||||
exit(repl());
|
||||
}
|
||||
|
||||
bool compile = false;
|
||||
@@ -71,7 +71,7 @@ int main(int argc, char** argv) {
|
||||
printf(" -w <output> or --writebytecode <output>: Outputs binary Ground bytecode");
|
||||
printf(" -b <output> or --bytecode <output>: Inputs binary Ground bytecode");
|
||||
exit(0);
|
||||
} else if (strcmp("--writebytecode", argv[i]) == 0 || strcmp("-w", argv[i]) == 0) {
|
||||
} else if (strcmp("--writeBytecode", argv[i]) == 0 || strcmp("-w", argv[i]) == 0) {
|
||||
if (compile) {
|
||||
printf("Cannot choose both bytecode and compilation");
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user