From d97c1a6497cc41c30edb6d5322a6deac56fd2293 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Tue, 30 May 2023 14:02:35 -0400 Subject: rewrite compiler, add for/rof support --- include/lib94/lib94.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') 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 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 load_warrior(const std::filesystem::path &from); -- cgit v1.2.3