1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

Allow empty blocks for type switch statements

This commit is contained in:
Rick Winfrey 2017-11-20 19:08:26 -08:00
parent 0cfe57713d
commit b750b8f423

View File

@ -454,7 +454,7 @@ expressionSwitchStatement = makeTerm <$> symbol ExpressionSwitchStatement <*> ch
typeSwitchStatement :: Assignment
typeSwitchStatement = makeTerm <$> symbol TypeSwitchStatement <*> children (Go.Syntax.TypeSwitch <$> _typeSwitchSubject <*> expressions)
where
_typeSwitchSubject = makeTerm <$> location <*> manyTermsTill expression (void (symbol TypeCaseClause))
_typeSwitchSubject = makeTerm <$> location <*> manyTermsTill expression (void (symbol TypeCaseClause)) <|> emptyTerm
typeSwitchGuard :: Assignment
typeSwitchGuard = makeTerm <$> symbol Grammar.TypeSwitchGuard <*> children (Go.Syntax.TypeSwitchGuard <$> expressions)