fixed label position calculation
This commit is contained in:
parent
344f26b05f
commit
41c83877a7
@ -34,7 +34,7 @@ std::string interpreter::eval(std::istream& in, bool& done) {
|
|||||||
// first pass: read program & resolve labels
|
// first pass: read program & resolve labels
|
||||||
for (std::string line; std::getline(in, line); ++_pc) {
|
for (std::string line; std::getline(in, line); ++_pc) {
|
||||||
if (line[0] == ':') {
|
if (line[0] == ':') {
|
||||||
_labels.emplace(line.substr(1), _pc);
|
_labels.emplace(line.substr(1), _pc--);
|
||||||
} else {
|
} else {
|
||||||
_prog.push_back(line);
|
_prog.push_back(line);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user