1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 18:23:44 +03:00

Slightly more lenient handling of Case.

This commit is contained in:
Rob Rix 2017-01-23 15:12:12 -05:00
parent 122a34452a
commit e88e4c81ff

View File

@ -30,7 +30,7 @@ termAssignment _ (_ :. category :. _ :. Nil) children
(Ternary, condition : cases) -> Just $ S.Ternary condition cases
(VarAssignment, [ x, y ]) -> Just $ S.VarAssignment x y
(VarDecl, _) -> Just . S.Indexed $ toVarDecl <$> children
(Case, [ expr, body ]) -> Just $ S.Case expr [body]
(Case, expr : body) -> Just $ S.Case expr body
(Object, _) -> Just . S.Object Nothing $ foldMap toTuple children
(Pair, _) -> Just $ S.Fixed children
(DoWhile, [ expr, body ]) -> Just $ S.DoWhile expr body