constinit static sforth::native_word<"emit", [](auto) {
std::cout << static_cast<char>(forth.pop());
}, &dot> emit;
+constinit static sforth::native_word<"type", [](auto) {
+ const unsigned u = forth.pop();
+ const auto caddr = reinterpret_cast<const char *>(forth.pop());
+ std::cout << std::string_view{caddr, u};
+}, &emit> type;
static bool parse_stream(auto&, std::istream&, bool say_okay = false);
{
std::span args (argv + 1, argc - 1);
- dot.next = std::exchange(forth.next, &emit);
+ dot.next = std::exchange(forth.next, &type);
for (auto arg : args) {
if (std::ifstream file {arg}; parse_stream(forth, file))
if (line == "bye")
return true;
+ for (auto& ch : line) {
+ if (ch >= 'A' && ch <= 'Z')
+ ch = ch - 'A' + 'a';
+ }
+
try {
fth.parse_line(line);
} catch (sforth::error e) {