Skip to content

Commit

Permalink
Revert "Print the type of self"
Browse files Browse the repository at this point in the history
This reverts commit d2c0f6d.
  • Loading branch information
Akuli committed Jan 5, 2025
1 parent 02bcaa0 commit f0ea623
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion self_hosted/ast.jou
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,10 @@ class AstSignature:
for i = 0; i < self->nargs; i++:
if i != 0:
printf(", ")
self->args[i].print_with_tree_printer(NULL)
if strcmp(self->args[i].name, "self") == 0:
printf("self")
else:
self->args[i].print_with_tree_printer(NULL)

if self->takes_varargs:
if self->nargs != 0:
Expand Down
8 changes: 6 additions & 2 deletions src/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,12 @@ static void print_ast_function_signature(const AstSignature *sig)
printf("%s(", sig->name);
for (const AstNameTypeValue *ntv = sig->args.ptr; ntv < End(sig->args); ntv++) {
if (ntv > sig->args.ptr) printf(", ");
printf("%s: ", ntv->name);
print_ast_type(&ntv->type);
if (!strcmp(ntv->name, "self"))
printf("self");
else{
printf("%s: ", ntv->name);
print_ast_type(&ntv->type);
}
assert(!ntv->value);
}
if (sig->takes_varargs) {
Expand Down

0 comments on commit f0ea623

Please sign in to comment.