diff options
-rw-r--r-- | src/resp.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/resp.cpp b/src/resp.cpp index 3f9766c..e3c956f 100644 --- a/src/resp.cpp +++ b/src/resp.cpp @@ -39,11 +39,11 @@ is_form(const AST* ast, const std::string& form) const ATuple* call = ast->to_tuple(); if (!call) return false; - + const ASymbol* const sym = call->head()->to_symbol(); if (!sym) return false; - + return form == sym->sym(); } @@ -151,7 +151,7 @@ main(int argc, char** argv) const AST* exp = cenv->penv.parse(loc, is); if (!exp || (exp->to_tuple() && exp->to_tuple()->tup_len() == 1)) break; - + const AST* ast = penv.expand(exp); pprint(os, ast, cenv, false); is.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); // Skip newlines @@ -161,7 +161,7 @@ main(int argc, char** argv) is.close(); } ret = 0; - + } else if (args.find("-e") != args.end()) { // Evaluate argument as expression if (files.size() > 0) { std::cerr << "Illegal options: both -e and files given" << std::endl; @@ -169,20 +169,20 @@ main(int argc, char** argv) delete engine; return print_usage(argv[0], true); } - + std::istringstream is(a->second); Cursor cursor("(command line)"); ret = eval(*cenv, cursor, is, !batch); - + } else if (files.size() == 0) { // Neither -e nor files given, run repl ret = repl(*cenv); - + } else { // Evalute (or just type check if -T, or just compile if -S all files for (list<string>::iterator f = files.begin(); f != files.end(); ++f) { const string& filename = *f; if (!batch) output = filename + ".out"; - + ifstream is(f->c_str()); if (is.good()) { Cursor cursor(*f); |