aboutsummaryrefslogtreecommitdiffstats
path: root/src/resp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resp.cpp')
-rw-r--r--src/resp.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/resp.cpp b/src/resp.cpp
index c37fd3d..704c864 100644
--- a/src/resp.cpp
+++ b/src/resp.cpp
@@ -157,11 +157,11 @@ main(int argc, char** argv)
fs.open(output.c_str());
ostream& os = (output == "") ? std::cout : fs;
- for (Files::iterator f = files.begin(); f != files.end(); ++f) {
- ifstream is(*f);
+ for (auto f : files) {
+ ifstream is(f);
try {
while (is.good() && !is.eof()) {
- Cursor loc(*f, 1, 1);
+ Cursor loc(f, 1, 1);
const AST* exp = cenv->penv.parse(loc, is);
if (!exp || (exp->to_tuple() && exp->to_tuple()->empty()))
break;
@@ -193,17 +193,16 @@ main(int argc, char** argv)
ret = repl(*cenv);
} else { // Evalute (or just type check if -T, or just compile if -S all files
- for (Files::iterator f = files.begin(); f != files.end(); ++f) {
- const string filename = *f;
+ for (std::string filename : files) {
if (!batch)
output = filename + ".out";
- ifstream is(*f);
+ ifstream is(filename);
if (is.good()) {
Cursor cursor(filename, 1, 1);
ret = ret | eval(*cenv, cursor, is, !batch);
} else {
- cerr << argv[0] << ": " << *f << ": " << strerror(errno) << endl;
+ cerr << argv[0] << ": " << filename << ": " << strerror(errno) << endl;
++ret;
}
is.close();