aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/main.cpp b/main.cpp
index e51f702..697f2d2 100644
--- a/main.cpp
+++ b/main.cpp
@@ -23,7 +23,7 @@
#include <span>
#include <string>
-constinit static sforth::forth<4096> forth {sforth::initialize<&forth>()};
+constinit static sforth::forth<8192> forth {sforth::initialize<&forth>()};
static bool parse_stream(auto&, std::istream&, bool say_okay = false);
@@ -71,11 +71,18 @@ bool parse_stream(auto &fth, std::istream& str, bool say_okay)
if (sforth::isequal(line, "bye"))
return true;
- try {
- fth.parse_line(line);
- } catch (sforth::error e) {
- std::cerr << sforth::error_string(e) << " in " << line << std::endl;
- continue;
+ if constexpr (sforth::enable_exceptions) {
+ try {
+ fth.parse_line(line);
+ } catch (sforth::error e) {
+ std::cerr << sforth::error_string(e) << " in " << line << std::endl;
+ continue;
+ }
+ } else {
+ if (auto e = fth.parse_line(line); e) {
+ std::cerr << sforth::error_string(*e) << " in " << line << std::endl;
+ continue;
+ }
}
}