mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 22:58:46 +00:00
Variable declaration and assign, unary operators
This commit is contained in:
@@ -631,7 +631,7 @@ void check_statement(Checker *c, AstNode *node, u32 flags) {
|
||||
error(&c->error_collector, op, "Assignment operation `%.*s` requires single-valued expressions", LIT(op.string));
|
||||
return;
|
||||
}
|
||||
if (!gb_is_between(op.kind, Token_AddEq, Token_ModEq)) {
|
||||
if (!gb_is_between(op.kind, Token__AssignOpBegin+1, Token__AssignOpEnd-1)) {
|
||||
error(&c->error_collector, op, "Unknown Assignment operation `%.*s`", LIT(op.string));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -208,6 +208,12 @@ Type *make_type_procedure(gbAllocator a, Scope *scope, Type *params, isize param
|
||||
}
|
||||
|
||||
|
||||
Type *type_deref(Type *t) {
|
||||
if (t != NULL && t->kind == Type_Pointer)
|
||||
return t->pointer.element;
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
#define STR_LIT(x) {cast(u8 *)(x), gb_size_of(x)-1}
|
||||
gb_global Type basic_types[] = {
|
||||
|
||||
Reference in New Issue
Block a user