Commit b7cba4b1 authored by Paul's avatar Paul
Browse files

Add begin/end functions for instruction stream

parent cf11f657
...@@ -52,6 +52,9 @@ struct program ...@@ -52,6 +52,9 @@ struct program
bool has_instruction(instruction_ref ins) const; bool has_instruction(instruction_ref ins) const;
instruction_ref begin();
instruction_ref end();
private: private:
std::unique_ptr<program_impl> impl; std::unique_ptr<program_impl> impl;
}; };
......
...@@ -59,6 +59,15 @@ bool program::has_instruction(instruction_ref ins) const ...@@ -59,6 +59,15 @@ bool program::has_instruction(instruction_ref ins) const
}) != impl->instructions.end(); }) != impl->instructions.end();
} }
instruction_ref program::begin()
{
return impl->instructions.begin();
}
instruction_ref program::end()
{
return impl->instructions.end();
}
literal program::eval(std::unordered_map<std::string, argument> params) const literal program::eval(std::unordered_map<std::string, argument> params) const
{ {
std::unordered_map<const instruction*, argument> results; std::unordered_map<const instruction*, argument> results;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment