From 0f72bc981939d05abfeb964f8c68f9d030de977b Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 5 Jul 2021 11:31:32 +0300 Subject: [PATCH] parser: temporary [c2v_variadic] fn attr for c2v'ed code --- vlib/v/parser/fn.v | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vlib/v/parser/fn.v b/vlib/v/parser/fn.v index 8a8d289bd3..8da2637b1f 100644 --- a/vlib/v/parser/fn.v +++ b/vlib/v/parser/fn.v @@ -186,6 +186,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl { mut is_unsafe := false mut is_trusted := false mut is_noreturn := false + mut is_c2v_variadic := false for fna in p.attrs { match fna.name { 'noreturn' { is_noreturn = true } @@ -196,6 +197,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl { 'export' { is_exported = true } 'unsafe' { is_unsafe = true } 'trusted' { is_trusted = true } + 'c2v_variadic' { is_c2v_variadic = true } else {} } } @@ -309,7 +311,10 @@ fn (mut p Parser) fn_decl() ast.FnDecl { } } // 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 if !are_args_type_only { for param in params {