Skip to content

Commit 81448a5

Browse files
committed
Fix documentation and typeof decl printing
1 parent fbea3d1 commit 81448a5

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

printer/metac_printer.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,7 @@ static inline void PrintType(metac_printer_t* self, decl_type_t* type)
316316
case decl_type_typeof:
317317
{
318318
decl_type_typeof_t *typeofType = (decl_type_typeof_t*) type;
319-
PrintString(self, "typeof (", sizeof("typeof (") - 1);
320319
PrintExpr(self, typeofType->Expr);
321-
PrintChar(self, ')');
322320
} break;
323321
case decl_type_array:
324322
{

semantic/metac_expr_semantic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ void MetaCSemantic_doCallSemantic(metac_sema_state_t* self,
375375

376376
if (func->Function)
377377

378-
printf("function call with: %u arguments\n", nArgs);
378+
xprintf("function call with: %u arguments\n", nArgs);
379379

380380
STACK_ARENA_ARRAY_TO_HEAP(arguments, &self->Allocator);
381381

semantic/metac_semantic.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,9 @@ metac_type_index_t MetaCSemantic_GetType(metac_sema_state_t* self, metac_node_t
419419
}
420420

421421
metac_sema_stmt_t* MetaCSemantic_doStmtSemantic_(metac_sema_state_t* self,
422-
metac_stmt_t* stmt,
423-
const char* callFile,
424-
uint32_t callLine)
422+
metac_stmt_t* stmt,
423+
const char* callFile,
424+
uint32_t callLine)
425425
{
426426
metac_sema_stmt_t* result = 0;
427427

@@ -496,6 +496,8 @@ metac_sema_stmt_t* MetaCSemantic_doStmtSemantic_(metac_sema_state_t* self,
496496
metac_scope_owner_t owner = {
497497
SCOPE_OWNER_V(scope_owner_statement, StmtIndex(self, semaDeclStmt))
498498
};
499+
// We need to remember to close the decl-scopes so we need to keep track of how many we have opend.
500+
// As the decl scopes are invisble to the user and have no closing syntax.
499501
metac_scope_t* declScope =
500502
MetaCScope_PushNewScope(self, self->CurrentScope, owner);
501503

@@ -1063,7 +1065,7 @@ void SetTypeIndex(metac_type_t typeNode,
10631065
(cast(metac_type_enum_t*) typeNode)->TypeIndex = typeIndex;
10641066
break;
10651067
case type_index_basic:
1066-
(cast(metac_type_basic_t*)typeNode)->TypeIndex = typeIndex;
1068+
// for basic types the type index is always set.
10671069
break;
10681070
case type_index_tuple:
10691071
(cast(metac_type_tuple_t*)typeNode)->TypeIndex = typeIndex;
@@ -1156,7 +1158,7 @@ metac_sema_decl_t* MetaCSemantic_declSemantic(metac_sema_state_t* self,
11561158
sema_decl_variable_t* var = AllocNewSemaVariable(self, v, &result);
11571159
/// XXX FIXME we want to assign a variable serial
11581160
/// after we have determined the storage location ideally.
1159-
/// to keep stuff wokring though we just assign the decl hash
1161+
/// to keep stuff working though we just assign the decl hash
11601162

11611163
var->Hash = v->Hash;
11621164
var->TypeIndex = MetaCSemantic_doTypeSemantic(self, v->VarType);

0 commit comments

Comments
 (0)