aboutsummaryrefslogtreecommitdiff
path: root/src/gui/main-window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/main-window.cc')
-rw-r--r--src/gui/main-window.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/main-window.cc b/src/gui/main-window.cc
index 1ef6ec56..9c4969b0 100644
--- a/src/gui/main-window.cc
+++ b/src/gui/main-window.cc
@@ -54,8 +54,16 @@ namespace OpenAxiom {
const auto& fs = server()->system_root();
Memory::FileMapping db { fs.dbdir() + "/interp.daase" };
Sexpr::Reader rd { db.begin(), db.end() };
- while (rd.read())
- ;
+ auto header = server()->lisp()->make_value(rd.read());
+ if (auto p = Lisp::to_pair_if_can(header)) {
+ auto offset = Lisp::retract_to_fixnum(p->head);
+ rd.position(offset);
+ auto table = server()->lisp()->toplevel_form(rd.read());
+ }
+ else {
+ QMessageBox::critical(this, tr("Malformed Database Header"),
+ QString(Lisp::show(header).c_str()));
+ }
}
catch(const Diagnostics::BasicError& e) {
display_error(e.message());