Variable declaration and assign, unary operators

This commit is contained in:
gingerBill
2016-07-31 23:01:42 +01:00
parent 776dc0e8f1
commit 70f6282f41
7 changed files with 273 additions and 93 deletions
+1 -1
View File
@@ -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;
}
+6
View File
@@ -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[] = {