std json parser

This commit is contained in:
2026-07-05 15:22:50 +02:00
parent 873aa3e1cc
commit aea9ce911a
14 changed files with 275 additions and 84 deletions

View File

@@ -812,7 +812,6 @@ _builtin_environ:
if *use_heap {
emit!(&mut self.output, " mov rdi, {}", memory_size);
emit!(&mut self.output, " call mem.alloc");
emit!(&mut self.output, " push rax");
} else {
let aligned_size = (memory_size + 15) & !15;
emit!(&mut self.output, " sub rsp, {}", aligned_size);

View File

@@ -596,6 +596,15 @@ impl<'a> TypeChecker<'a> {
match &func_type.params {
FnParams::Normal(params) => {
if params.is_empty() || params[0] != receiver_type {
return error!(
method.loc,
format!(
"first parameter of the method must be of type {}",
receiver_type
)
);
}
if params.len() != args.len() + 1 {
return error!(
method.loc,
@@ -606,15 +615,6 @@ impl<'a> TypeChecker<'a> {
)
);
}
if params[0] != receiver_type {
return error!(
method.loc,
format!(
"first parameter of the method must be of type {}",
receiver_type
)
);
}
for (i, arg) in args.iter().enumerate() {
expect_type!(self.typecheck_expr(env, arg)?, params[i + 1], method.loc);
}