diff options
author | Benji Dial <benji@benjidial.net> | 2023-05-30 14:02:35 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2023-05-30 14:02:35 -0400 |
commit | d97c1a6497cc41c30edb6d5322a6deac56fd2293 (patch) | |
tree | 07920c6b83e687b75b268db44937f5fa362febd0 /include | |
parent | 6678dccccdfffb9c40f64a828fd769c53bb2d29f (diff) | |
download | lib94-d97c1a6497cc41c30edb6d5322a6deac56fd2293.tar.gz |
rewrite compiler, add for/rof support
Diffstat (limited to 'include')
-rw-r--r-- | include/lib94/lib94.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/lib94/lib94.hpp b/include/lib94/lib94.hpp index 3ca0c7b..eeb53ec 100644 --- a/include/lib94/lib94.hpp +++ b/include/lib94/lib94.hpp @@ -59,7 +59,12 @@ namespace lib94 { std::string instruction_to_string(const instruction &instr); - std::variant<warrior *, std::string> compile_warrior(std::string source); + struct compiler_exception : public std::exception { + unsigned line_number; + std::string message; + }; + + warrior *compile_warrior(std::string source); bool save_warrior(const warrior &w, const std::filesystem::path &to); std::optional<warrior *> load_warrior(const std::filesystem::path &from); |