aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-09-24 12:04:26 +0100
committergingerBill <bill@gingerbill.org>2018-09-24 12:04:26 +0100
commit1a18481d8ba01e844f9d16479c6de0d06157e685 (patch)
tree7e7be4b687bb1f4d35e0c873ed86f7ffbc9835b0 /src/types.cpp
parent28c61c0f5d3faa6dfa55ffe15a3243d7e2083b58 (diff)
Fix context assignment with selector expressions
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp9
1 files changed, 9 insertions, 0 deletions
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<i32>(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[] = {