diff --git a/interpreter.cpp b/interpreter.cpp index 5599ccb..632f492 100644 --- a/interpreter.cpp +++ b/interpreter.cpp @@ -9,7 +9,7 @@ #include "interpreter.hpp" #include #include -#include +#include int to_int(const std::string& val) { std::istringstream iss {val}; diff --git a/interpreter.hpp b/interpreter.hpp index 3415dfb..1601962 100644 --- a/interpreter.hpp +++ b/interpreter.hpp @@ -14,7 +14,6 @@ #include #include #include -#include class syntax_error : public std::runtime_error { public: @@ -34,11 +33,11 @@ class interpreter { private: std::vector _prog; // program lines without label defs or comments std::vector _values; // value stack - std::map _labels; // label name => prog line index - std::map _vars; // var name => string value std::vector _calls; // call stack + std::map _labels; // label name => prog line index + std::map _vars; // variable name => string value size_t _pc {0}; // current program counter (index into _prog) - std::vector _pc_offsets; // removed line indices for prog index => source line + std::vector _pc_offsets; // removed line indices for: prog index => source line void reset(); void exec_instruction(const std::string& code, bool& done);