From 5f3000693ea37f10fdd1d9af08473972f7ce7678 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Mon, 2 Mar 2026 23:21:10 +1100 Subject: [PATCH] xo-interpreter2 stack: parse literal lists (w/ implicit types) --- include/xo/object2/DList.hpp | 3 +++ include/xo/object2/List.hpp | 13 +++++++++++++ include/xo/object2/ListOps.hpp | 3 +-- src/object2/DList.cpp | 8 ++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 include/xo/object2/List.hpp diff --git a/include/xo/object2/DList.hpp b/include/xo/object2/DList.hpp index 611fb66..39e0b58 100644 --- a/include/xo/object2/DList.hpp +++ b/include/xo/object2/DList.hpp @@ -49,6 +49,9 @@ namespace xo { /** return element at 0-based index @p ix **/ obj at(size_type ix) const; + /** assign rest-pointer **/ + void assign_rest(DList * r); + /** pretty-printing driver; combine layout+printing **/ bool pretty(const ppindentinfo & ppii) const; diff --git a/include/xo/object2/List.hpp b/include/xo/object2/List.hpp new file mode 100644 index 0000000..872956c --- /dev/null +++ b/include/xo/object2/List.hpp @@ -0,0 +1,13 @@ +/** @file List.hpp + * + * @author Roland Conybeare, Mar 2026 + **/ + +#pragma once + +#include "DList.hpp" +#include "list/IGCObject_DList.hpp" +#include "list/IPrintable_DList.hpp" +#include "list/ISequence_DList.hpp" + +/* end List.hpp */ diff --git a/include/xo/object2/ListOps.hpp b/include/xo/object2/ListOps.hpp index 9816111..25ddf77 100644 --- a/include/xo/object2/ListOps.hpp +++ b/include/xo/object2/ListOps.hpp @@ -5,8 +5,7 @@ #pragma once -#include "list/IGCObject_DList.hpp" -#include "DList.hpp" +#include "List.hpp" namespace xo { namespace scm { diff --git a/src/object2/DList.cpp b/src/object2/DList.cpp index 35cb722..01d01d6 100644 --- a/src/object2/DList.cpp +++ b/src/object2/DList.cpp @@ -105,6 +105,14 @@ namespace xo { return l->head_; } + void + DList::assign_rest(DList * r) + { + scope log(XO_DEBUG(true), "need write barrier"); + + this->rest_ = r; + } + bool DList::pretty(const ppindentinfo & ppii) const {