mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 06:38:47 +00:00
Improve error handling for invalid syntax doing [*]T
This commit is contained in:
+9
-3
@@ -2454,9 +2454,15 @@ gb_internal i64 check_array_count(CheckerContext *ctx, Operand *o, Ast *e) {
|
|||||||
if (e == nullptr) {
|
if (e == nullptr) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (e->kind == Ast_UnaryExpr &&
|
if (e->kind == Ast_UnaryExpr) {
|
||||||
e->UnaryExpr.op.kind == Token_Question) {
|
Token op = e->UnaryExpr.op;
|
||||||
return -1;
|
if (op.kind == Token_Question) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (e->UnaryExpr.expr == nullptr) {
|
||||||
|
error(op, "Invalid array count '[%.*s]'", LIT(op.string));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
check_expr_or_type(ctx, o, e);
|
check_expr_or_type(ctx, o, e);
|
||||||
|
|||||||
Reference in New Issue
Block a user