Skip to content

fix(codegen): fix immutable function paramiters#11

Merged
blazejOz merged 1 commit into
mainfrom
fix/8-functionParamiters
Mar 28, 2026
Merged

fix(codegen): fix immutable function paramiters#11
blazejOz merged 1 commit into
mainfrom
fix/8-functionParamiters

Conversation

@blazejOz

Copy link
Copy Markdown
Owner

in FunctionAST::codegen(...)

moved entry for basic block above argument parsing

and added args allocation on stack and into namedValues map

now code like:
fn factorial(int n): int {
int res = 1;
while (n > 1) {
res = res * n;
n = n - 1;
}
return res;
}

works without extra variables.

@blazejOz blazejOz merged commit f677c3a into main Mar 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant