diff --git a/interpreter.cpp b/interpreter.cpp index bd3db0e..aa91e31 100644 --- a/interpreter.cpp +++ b/interpreter.cpp @@ -33,7 +33,7 @@ std::string interpreter::eval(std::istream& in, bool& done) { reset(); done = false; - // first pass: read program & resolve labels + // first pass: read program & resolve labels, ignore comments for (std::string line; std::getline(in, line);) { if (line[0] == ':') { // check label definition _labels.emplace(line.substr(1), _prog.size()); @@ -46,7 +46,6 @@ std::string interpreter::eval(std::istream& in, bool& done) { } // second pass: run program - _pc = 0; while (_pc < _prog.size() && !done) { // fetch next instruction std::string code {_prog[_pc]};