1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +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 (Ternary, condition : cases) -> Just $ S.Ternary condition cases
(VarAssignment, [ x, y ]) -> Just $ S.VarAssignment x y (VarAssignment, [ x, y ]) -> Just $ S.VarAssignment x y
(VarDecl, _) -> Just . S.Indexed $ toVarDecl <$> children (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 (Object, _) -> Just . S.Object Nothing $ foldMap toTuple children
(Pair, _) -> Just $ S.Fixed children (Pair, _) -> Just $ S.Fixed children
(DoWhile, [ expr, body ]) -> Just $ S.DoWhile expr body (DoWhile, [ expr, body ]) -> Just $ S.DoWhile expr body