From dccce46d5b89344703b153921869606e10b01318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Sat, 7 Oct 2023 11:32:51 -0300 Subject: [PATCH] allow "&" instead of "out" in function pointer parameters --- src/common/scripting/frontend/zcc-parse.lemon | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/scripting/frontend/zcc-parse.lemon b/src/common/scripting/frontend/zcc-parse.lemon index a222afa608..347fddcc1e 100644 --- a/src/common/scripting/frontend/zcc-parse.lemon +++ b/src/common/scripting/frontend/zcc-parse.lemon @@ -1045,6 +1045,14 @@ func_ptr_param(X) ::= func_param_flags(A) type(B). X = parm; } +func_ptr_param(X) ::= func_param_flags(A) type(B) AND. +{ + NEW_AST_NODE(FuncPtrParamDecl,parm,A.SourceLoc ? A.SourceLoc : B->SourceLoc); + parm->Type = B; + parm->Flags = A.Int | ZCC_Out; + X = parm; +} + aggregate_type(X) ::= CLASS(T) class_restrictor(A). /* class */ { NEW_AST_NODE(ClassType,cls,T);