aboutsummaryrefslogtreecommitdiffstats
path: root/src/resp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resp.cpp')
-rw-r--r--src/resp.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/resp.cpp b/src/resp.cpp
index 4da92e3..96df3b7 100644
--- a/src/resp.cpp
+++ b/src/resp.cpp
@@ -39,9 +39,9 @@ print_usage(char* name, bool error)
os << " -r Enter REPL after evaluating files" << endl;
os << " -b BACKEND Use backend (llvm or c)" << endl;
os << " -g Debug (disable optimisation)" << endl;
- os << " -d Dump generated code during compilation" << endl;
os << " -P Parse and pretty-print only" << endl;
os << " -T Type check and annotate only" << endl;
+ os << " -L Lambda lift only" << endl;
os << " -S Compile to assembly only (do not evaluate)" << endl;
os << " -e EXPRESSION Evaluate EXPRESSION" << endl;
os << " -o FILE Compile output to FILE (don't run)" << endl;
@@ -61,9 +61,9 @@ main(int argc, char** argv)
files.push_back(argv[i]);
} else if (!strncmp(argv[i], "-r", 3)
|| !strncmp(argv[i], "-g", 3)
- || !strncmp(argv[i], "-d", 3)
|| !strncmp(argv[i], "-P", 3)
|| !strncmp(argv[i], "-T", 3)
+ || !strncmp(argv[i], "-L", 3)
|| !strncmp(argv[i], "-S", 3)) {
args.insert(make_pair(argv[i], ""));
} else if (i == argc-1 || argv[i+1][0] == '-') {
@@ -116,6 +116,9 @@ main(int argc, char** argv)
while (is.good() && !is.eof()) {
Cursor loc(*f);
AST* exp = readExpression(loc, is);
+ if (!exp || (exp->as<ATuple*>() && exp->as<ATuple*>()->tup_len() == 1))
+ break;
+
AST* ast = penv.parse(exp);
pprint(os, ast, cenv, false);
is.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); // Skip newlines