Skip to content

Commit

Permalink
Band-Aid "go vet" error with Go codegen template.
Browse files Browse the repository at this point in the history
Signed-off-by: Sean P. Miller <[email protected]>
  • Loading branch information
Sean P. Miller committed Oct 17, 2023
1 parent 487cb28 commit 469eedc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tool/resources/org/antlr/v4/tool/templates/codegen/Go/Go.stg
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,10 @@ errorExit:
<finallyAction>
<endif>
p.ExitRule()
if false {
goto errorExit // Trick to prevent compiler error if the label is not used
}
return localctx
goto errorExit // Trick to prevent compiler error if the label is not used
}
>>

Expand Down Expand Up @@ -500,8 +502,10 @@ func (p *<parser.name>) <currentRule.escapedName>(_p int<args:{a | , <a.escapedN
<finallyAction>
<endif>
p.UnrollRecursionContexts(_parentctx)
if false {
goto errorExit // Trick to prevent compiler error if the label is not used
}
return localctx
goto errorExit // Trick to prevent compiler error if the label is not used
}
>>

Expand Down

0 comments on commit 469eedc

Please sign in to comment.