diff --git a/interpreter.cpp b/interpreter.cpp index 3a3d2e6..1b1b71f 100644 --- a/interpreter.cpp +++ b/interpreter.cpp @@ -46,7 +46,13 @@ std::string interpreter::eval(std::istream& in, bool& done) { while (_pc < _prog.size() && !done) { // fetch next instruction std::string code {_prog[_pc]}; - + + // check comment + if (code[0] == '#') { + _pc++; + continue; + } + // check literal int if (std::isdigit(code[0])) { _stack.push_back(code);