From 64a2610b76be95dfac800edb47509671db9af3b3 Mon Sep 17 00:00:00 2001 From: Zachary Snow Date: Wed, 6 Mar 2019 15:07:22 -0500 Subject: [PATCH] explicitly default function input types to --- src/Language/SystemVerilog/Parser/Parse.y | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Language/SystemVerilog/Parser/Parse.y b/src/Language/SystemVerilog/Parser/Parse.y index c16af73..85104bd 100644 --- a/src/Language/SystemVerilog/Parser/Parse.y +++ b/src/Language/SystemVerilog/Parser/Parse.y @@ -322,7 +322,7 @@ ModuleItem :: { [ModuleItem] } | "genvar" Identifiers ";" { map Genvar $2 } | "generate" GenItems "endgenerate" { [Generate $2] } | "modport" ModportItems ";" { map (uncurry Modport) $2 } - | "function" opt(Lifetime) FuncRetAndName FunctionItems DeclsAndStmts "endfunction" opt(Tag) { [Function $2 (fst $3) (snd $3) ($4 ++ fst $5) (snd $5)] } + | "function" opt(Lifetime) FuncRetAndName FunctionItems DeclsAndStmts "endfunction" opt(Tag) { [Function $2 (fst $3) (snd $3) (map defaultFuncInput $ $4 ++ fst $5) (snd $5)] } FuncRetAndName :: { (Type, Identifier) } : {- empty -} Identifier { (Implicit [], $1) } @@ -616,4 +616,9 @@ makeInput :: Decl -> Decl makeInput (Variable _ t x a me) = Variable Input t x a me makeInput other = error $ "unexpected non-var decl: " ++ (show other) +defaultFuncInput :: Decl -> Decl +defaultFuncInput (Variable Input (Implicit rs) x a me) = + Variable Input (Logic rs) x a me +defaultFuncInput other = other + }