Modify implicit semicolon rules

This commit is contained in:
gingerBill
2018-01-18 17:28:07 +00:00
parent 386f5f596d
commit b03ce0e9b4
2 changed files with 6 additions and 3 deletions

View File

@@ -63,7 +63,6 @@ GB_ALLOCATOR_PROC(heap_allocator_proc) {
#else
case gbAllocation_Alloc:
// TODO(bill): Make sure this is aligned correctly
// ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, align_formula_isize(size, alignment));
ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, align_formula_isize(size, alignment));
break;
case gbAllocation_Free:

View File

@@ -1371,8 +1371,12 @@ void expect_semicolon(AstFile *f, AstNode *s) {
if (is_semicolon_optional_for_node(f, s)) {
return;
}
} else if (f->curr_token.kind == Token_CloseBrace) {
return;
} else {
switch (f->curr_token.kind) {
case Token_CloseBrace:
case Token_CloseParen:
return;
}
}
String node_string = ast_node_strings[s->kind];
syntax_error(prev_token, "Expected ';' after %.*s, got %.*s",