diff --git a/src/protocol/parser/mod.rs b/src/protocol/parser/mod.rs index 4688c9fe5e963e7877606b9384ae685762c2521c..3dca61f0109c63bbe526e10dfd69e8e9cbf6feeb 100644 --- a/src/protocol/parser/mod.rs +++ b/src/protocol/parser/mod.rs @@ -282,23 +282,24 @@ fn insert_builtin_function (Vec<(&'static str, Pa span: InputSpan::new(), identifier: Identifier{ span: InputSpan::new(), value: func_ident_ref.clone() }, poly_vars, - return_types: Vec::new(), + return_type: ParserType{ elements: Vec::new(), full_span: InputSpan::new() }, parameters: Vec::new(), + scope: ScopeId::new_invalid(), body: BlockStatementId::new_invalid(), num_expressions_in_body: -1, }); - let (args, ret) = arg_and_return_fn(func_id); + let (arguments, return_type) = arg_and_return_fn(func_id); - let mut parameters = Vec::with_capacity(args.len()); - for (arg_name, arg_type) in args { + let mut parameters = Vec::with_capacity(arguments.len()); + for (arg_name, arg_type) in arguments { let identifier = Identifier{ span: InputSpan::new(), value: p.string_pool.intern(arg_name.as_bytes()) }; let param_id = p.heap.alloc_variable(|this| Variable{ this, kind: VariableKind::Parameter, parser_type: arg_type.clone(), identifier, - relative_pos_in_block: 0, + relative_pos_in_parent: 0, unique_id_in_scope: 0 }); parameters.push(param_id); @@ -306,7 +307,7 @@ fn insert_builtin_function (Vec<(&'static str, Pa let func = &mut p.heap[func_id]; func.parameters = parameters; - func.return_types.push(ret); + func.return_type = return_type; p.symbol_table.insert_symbol(SymbolScope::Global, Symbol{ name: func_ident_ref,