xo-interpreter2 stack: wrap TokenizerError as DRuntimeError

Also fix _read_eval_print() to report them!
This commit is contained in:
Roland Conybeare 2026-03-27 11:16:28 -04:00
commit ff471bbc72
4 changed files with 22 additions and 0 deletions

View file

@ -8,6 +8,8 @@
#include "TkInputState.hpp"
#include "tokentype.hpp"
#include "span.hpp"
#include <xo/stringtable2/String.hpp>
#include <xo/alloc2/Allocator.hpp>
#include <iomanip>
namespace xo {
@ -19,6 +21,7 @@ namespace xo {
**/
class TokenizerError {
public:
using AAllocator = xo::mm::AAllocator;
using CharT = char;
using span_type = xo::mm::span<const CharT>;
@ -89,6 +92,9 @@ namespace xo {
/** Print human-oriented error report on @p os. **/
void report(std::ostream & os) const;
/** Similar to report, but capture as string, allocated from @p mm **/
DString * report_to_string(obj<AAllocator> mm) const;
///@}
private: