From 738c2b9efc220f2cad2b8904ca2cb8bc92bd92fa Mon Sep 17 00:00:00 2001 From: Zachary Snow Date: Sun, 17 Feb 2019 02:59:41 -0500 Subject: [PATCH] support for functions with no block decls; fix parse of block reg decls --- Language/SystemVerilog/Parser/Parse.y | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Language/SystemVerilog/Parser/Parse.y b/Language/SystemVerilog/Parser/Parse.y index de36740..440e7bb 100644 --- a/Language/SystemVerilog/Parser/Parse.y +++ b/Language/SystemVerilog/Parser/Parse.y @@ -228,6 +228,7 @@ ModuleItem :: { [ModuleItem] } FunctionItems :: { [(Bool, BlockItemDeclaration)] } : "(" FunctionPortList ";" BlockItemDeclarations { (map ((,) True) $2) ++ (map ((,) False) $4) } + | "(" FunctionPortList ";" { (map ((,) True) $2) } | ";" FunctionItemDeclarations { $2 } FunctionPortList :: { [BlockItemDeclaration] } : FunctionInputDeclaration(")") { $1 } @@ -339,10 +340,10 @@ BlockItemDeclarations :: { [BlockItemDeclaration] } | BlockItemDeclarations BlockItemDeclaration { $1 ++ $2 } BlockItemDeclaration :: { [BlockItemDeclaration] } - : "reg" opt(Range) BlockVariableIdentifiers { map (uncurry $ BIDReg $2) $3 } - | ParameterDeclaration { map BIDParameter $1 } - | LocalparamDeclaration { map BIDLocalparam $1 } - | IntegerDeclaration { map BIDIntegerV $1 } + : "reg" opt(Range) BlockVariableIdentifiers ";" { map (uncurry $ BIDReg $2) $3 } + | ParameterDeclaration { map BIDParameter $1 } + | LocalparamDeclaration { map BIDLocalparam $1 } + | IntegerDeclaration { map BIDIntegerV $1 } BlockVariableIdentifiers :: { [(Identifier, [Range])] } : BlockVariableType { [$1] } | BlockVariableIdentifiers "," BlockVariableType { $1 ++ [$3] }