diff --git a/src/protocol/parser/pass_definitions.rs b/src/protocol/parser/pass_definitions.rs index 7f9817270909d65c1cfc3c9fa702aef204e1506e..17b71cecd9f6981c66bf39a4775d6a55a9f83c6d 100644 --- a/src/protocol/parser/pass_definitions.rs +++ b/src/protocol/parser/pass_definitions.rs @@ -376,6 +376,7 @@ impl PassDefinitions { ("std.global", "length") => ProcedureSource::FuncLength, ("std.global", "assert") => ProcedureSource::FuncAssert, ("std.global", "print") => ProcedureSource::FuncPrint, + ("std.random", "random_u32") => ProcedureSource::CompRandomU32, _ => panic!( "compiler error: unknown builtin procedure '{}' in module '{}'", procedure_name, module_name @@ -825,10 +826,8 @@ impl PassDefinitions { if let Expression::Call(expression) = expression { // Allow both components and functions, as it makes more sense to // check their correct use in the validation and linking pass - if expression.method == Method::UserComponent || expression.method == Method::UserFunction { - call_id = expression.this; - valid = true; - } + call_id = expression.this; + valid = true; } if !valid { @@ -1658,7 +1657,8 @@ impl PassDefinitions { ProcedureSource::FuncLength => Method::Length, ProcedureSource::FuncAssert => Method::Assert, ProcedureSource::FuncPrint => Method::Print, - _ => todo!("other proc sources") + ProcedureSource::CompRandomU32 => Method::ComponentRandomU32, + _ => todo!("other procedure sources"), }; // Function call: consume the arguments