Skip to content

Commit

Permalink
stage --> step
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Jan 10, 2025
1 parent 76432fc commit 4a1fb5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions compiler/main.jou
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class CompileState:
self->parse(path, NULL)
free(path)

# Each stage of type checking produces exported symbols that other files can import.
# Each step of type checking produces exported symbols that other files can import.
# This method hands them over to the importing files.
def exports_to_imports(self, pending_exports: ExportSymbol**) -> None:
for to = self->files; to < &self->files[self->nfiles]; to++:
Expand Down Expand Up @@ -402,21 +402,21 @@ class CompileState:

for i = 0; i < self->nfiles; i++:
if command_line_args.verbosity >= 1:
printf(" stage 1: %s\n", self->files[i].path)
printf(" step 1: %s\n", self->files[i].path)
pending_exports[i] = typecheck_step1_create_types(&self->files[i].types, &self->files[i].ast)

self->exports_to_imports(pending_exports)

for i = 0; i < self->nfiles; i++:
if command_line_args.verbosity >= 1:
printf(" stage 2: %s\n", self->files[i].path)
printf(" step 2: %s\n", self->files[i].path)
pending_exports[i] = typecheck_step2_populate_types(&self->files[i].types, &self->files[i].ast)

self->exports_to_imports(pending_exports)

for i = 0; i < self->nfiles; i++:
if command_line_args.verbosity >= 1:
printf(" stage 3: %s\n", self->files[i].path)
printf(" step 3: %s\n", self->files[i].path)
typecheck_step3_function_and_method_bodies(&self->files[i].types, &self->files[i].ast)

free(pending_exports)
Expand Down
4 changes: 2 additions & 2 deletions compiler/typecheck/step2_populate_types.jou
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def handle_signature(ft: FileTypes*, astsig: AstSignature*, self_class: Type*) -


def handle_class_members_step2(ft: FileTypes*, classdef: AstClassDef*) -> None:
# Previous type-checking stage created an opaque struct.
# Previous type-checking step created an opaque struct.
type: Type* = NULL
for s = ft->owned_types; s < &ft->owned_types[ft->n_owned_types]; s++:
if strcmp((*s)->name, classdef->name) == 0:
Expand Down Expand Up @@ -162,7 +162,7 @@ def handle_class_members_step2(ft: FileTypes*, classdef: AstClassDef*) -> None:
type->classdata.fields[type->classdata.nfields++] = f

elif m->kind == AstClassMemberKind::Method:
# Don't handle the method body yet: that is a part of stage 3, not stage 2
# Don't handle the method body yet: that is a part of step 3, not step 2
sig = handle_signature(ft, &m->method.signature, type)

type->classdata.methods = realloc(type->classdata.methods, sizeof(type->classdata.methods[0]) * (type->classdata.nmethods + 1))
Expand Down

0 comments on commit 4a1fb5e

Please sign in to comment.