mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 21:41:03 +00:00
allow "&" instead of "out" in function parameters
This commit is contained in:
parent
7a9ca1ad3f
commit
a13b19815c
1 changed files with 20 additions and 0 deletions
|
@ -1285,6 +1285,26 @@ func_param(X) ::= func_param_flags(A) type(B) IDENTIFIER(C) EQ expr(D).
|
|||
X = parm;
|
||||
}
|
||||
|
||||
func_param(X) ::= func_param_flags(A) type(B) AND IDENTIFIER(C).
|
||||
{
|
||||
NEW_AST_NODE(FuncParamDecl,parm,A.SourceLoc ? A.SourceLoc : B->SourceLoc);
|
||||
parm->Type = B;
|
||||
parm->Name = C.Name();
|
||||
parm->Flags = A.Int | ZCC_Out;
|
||||
parm->Default = nullptr;
|
||||
X = parm;
|
||||
}
|
||||
|
||||
func_param(X) ::= func_param_flags(A) type(B) AND IDENTIFIER(C) EQ expr(D).
|
||||
{
|
||||
NEW_AST_NODE(FuncParamDecl,parm,A.SourceLoc ? A.SourceLoc : B->SourceLoc);
|
||||
parm->Type = B;
|
||||
parm->Name = C.Name();
|
||||
parm->Flags = A.Int | ZCC_Out;
|
||||
parm->Default = D;
|
||||
X = parm;
|
||||
}
|
||||
|
||||
func_param_flags(X) ::= . { X.Int = 0; X.SourceLoc = 0; }
|
||||
func_param_flags(X) ::= func_param_flags(A) IN(T). { X.Int = A.Int | ZCC_In; X.SourceLoc = T.SourceLoc; }
|
||||
func_param_flags(X) ::= func_param_flags(A) OUT(T). { X.Int = A.Int | ZCC_Out; X.SourceLoc = T.SourceLoc; }
|
||||
|
|
Loading…
Reference in a new issue