added recognition of # at start of line as comment desginator

This commit is contained in:
Bob Polis 2020-09-21 10:45:49 +02:00
parent 98602abb9e
commit 49626f9925

View File

@ -47,6 +47,12 @@ std::string interpreter::eval(std::istream& in, bool& 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);