From 1a18481d8ba01e844f9d16479c6de0d06157e685 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 24 Sep 2018 12:04:26 +0100 Subject: Fix context assignment with selector expressions --- src/types.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/types.cpp') diff --git a/src/types.cpp b/src/types.cpp index fa30b228b..7c526989f 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -254,6 +254,15 @@ void selection_add_index(Selection *s, isize index) { array_add(&s->index, cast(i32)index); } +Selection selection_combine(Selection const &lhs, Selection const &rhs) { + Selection new_sel = lhs; + new_sel.indirect = lhs.indirect || rhs.indirect; + new_sel.index = array_make(heap_allocator(), lhs.index.count+rhs.index.count); + array_copy(&new_sel.index, lhs.index, 0); + array_copy(&new_sel.index, rhs.index, lhs.index.count); + return new_sel; +} + gb_global Type basic_types[] = { -- cgit v1.2.3