Skip to content

Commit

Permalink
restore distinction between generate and non-generate items
Browse files Browse the repository at this point in the history
  • Loading branch information
zachjs committed Aug 1, 2023
1 parent 0102e4a commit 519dbbe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Language/SystemVerilog/Parser/Parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ ModuleItems :: { [ModuleItem] }

ModuleItem :: { [ModuleItem] }
: NonGenerateModuleItem { $1 }
| ConditionalGenerateConstruct { [Generate [$1]] }
| LoopGenerateConstruct { [Generate [$1]] }
| AttributeInstance ModuleItem { map (addMIAttr $1) $2 }
| "generate" GenItems endgenerate { [Generate $2] }
NonGenerateModuleItemA :: { [ModuleItem] }
Expand All @@ -718,8 +720,6 @@ NonGenerateModuleItem :: { [ModuleItem] }
| NInputGateKW NInputGates ";" { map (\(a, b, c, d) -> NInputGate $1 a b c d) $2 }
| NOutputGateKW NOutputGates ";" { map (\(a, b, c, d) -> NOutputGate $1 a b c d) $2 }
| AssertionItem { [AssertionItem $1] }
| ConditionalGenerateConstruct { [Generate [$1]] }
| LoopGenerateConstruct { [Generate [$1]] }

AssignOption :: { AssignOption }
: {- empty -} { AssignOptionNone }
Expand Down Expand Up @@ -1453,6 +1453,8 @@ GenItems :: { [GenItem] }
GenItem :: { GenItem }
: MITrace GenBlock { uncurry GenBlock $2 }
| MITrace NonGenerateModuleItemA { genItemsToGenItem $ map GenModuleItem $ addMITrace $1 $2 }
| MITrace ConditionalGenerateConstruct { $2 }
| MITrace LoopGenerateConstruct { $2 }
ConditionalGenerateConstruct :: { GenItem }
: "if" "(" Expr ")" GenItemOrNull "else" GenItemOrNull { GenIf $3 $5 $7 }
| "if" "(" Expr ")" GenItemOrNull %prec NoElse { GenIf $3 $5 GenNull }
Expand Down

0 comments on commit 519dbbe

Please sign in to comment.