parser: temporary [c2v_variadic] fn attr for c2v'ed code

pull/10666/head
Alexander Medvednikov 2021-07-05 11:31:32 +03:00
parent c4b5805890
commit 0f72bc9819
1 changed files with 6 additions and 1 deletions

View File

@ -186,6 +186,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl {
mut is_unsafe := false mut is_unsafe := false
mut is_trusted := false mut is_trusted := false
mut is_noreturn := false mut is_noreturn := false
mut is_c2v_variadic := false
for fna in p.attrs { for fna in p.attrs {
match fna.name { match fna.name {
'noreturn' { is_noreturn = true } 'noreturn' { is_noreturn = true }
@ -196,6 +197,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl {
'export' { is_exported = true } 'export' { is_exported = true }
'unsafe' { is_unsafe = true } 'unsafe' { is_unsafe = true }
'trusted' { is_trusted = true } 'trusted' { is_trusted = true }
'c2v_variadic' { is_c2v_variadic = true }
else {} else {}
} }
} }
@ -309,7 +311,10 @@ fn (mut p Parser) fn_decl() ast.FnDecl {
} }
} }
// Args // Args
args2, are_args_type_only, is_variadic := p.fn_args() args2, are_args_type_only, mut is_variadic := p.fn_args()
if is_c2v_variadic {
is_variadic = true
}
params << args2 params << args2
if !are_args_type_only { if !are_args_type_only {
for param in params { for param in params {