aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-10-20 00:40:03 +0100
committergingerBill <bill@gingerbill.org>2021-10-20 00:40:03 +0100
commit82b6772ea4fa9872a1fb98305814be8cf7f2c7c4 (patch)
tree2a10e6b99987750e655af2843dc288f4c6eb6a83 /src/check_expr.cpp
parent662cbaf425a54127dea206c3a35d776853bac169 (diff)
Support matrix literals
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 73e1a7e51..eb6040320 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -7369,6 +7369,7 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
case Type_Array:
case Type_DynamicArray:
case Type_SimdVector:
+ case Type_Matrix:
{
Type *elem_type = nullptr;
String context_name = {};
@@ -7395,6 +7396,10 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
elem_type = t->SimdVector.elem;
context_name = str_lit("simd vector literal");
max_type_count = t->SimdVector.count;
+ } else if (t->kind == Type_Matrix) {
+ elem_type = t->Matrix.elem;
+ context_name = str_lit("matrix literal");
+ max_type_count = t->Matrix.row_count*t->Matrix.column_count;
} else {
GB_PANIC("unreachable");
}