From 13715dbda94d6d130440a36362cc62b75f1d27eb Mon Sep 17 00:00:00 2001 From: lyken Date: Tue, 20 Aug 2024 14:51:40 +0800 Subject: [PATCH] core/irrt: add List Needed for implementing np_array() --- nac3core/irrt/irrt.cpp | 2 +- nac3core/irrt/irrt/list.hpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/nac3core/irrt/irrt.cpp b/nac3core/irrt/irrt.cpp index b586ce57..aa25667d 100644 --- a/nac3core/irrt/irrt.cpp +++ b/nac3core/irrt/irrt.cpp @@ -8,4 +8,4 @@ #include "irrt/ndarray/basic.hpp" #include "irrt/ndarray/def.hpp" #include "irrt/ndarray/iter.hpp" -#include "irrt/ndarray/indexing.hpp" +#include "irrt/ndarray/indexing.hpp" \ No newline at end of file diff --git a/nac3core/irrt/irrt/list.hpp b/nac3core/irrt/irrt/list.hpp index b389197f..3404fb8f 100644 --- a/nac3core/irrt/irrt/list.hpp +++ b/nac3core/irrt/irrt/list.hpp @@ -2,6 +2,21 @@ #include "irrt/int_types.hpp" #include "irrt/math_util.hpp" +#include "irrt/slice.hpp" + +namespace { +/** + * @brief A list in NAC3. + * + * The `items` field is opaque. You must rely on external contexts to + * know how to interpret it. + */ +template +struct List { + uint8_t* items; + SizeT len; +}; +} // namespace extern "C" { // Handle list assignment and dropping part of the list when