1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

Add Case/Switch to toTermName

This commit is contained in:
joshvera 2016-06-15 15:51:17 -07:00
parent f28e50da8a
commit 212c0cc1a8

View File

@ -36,9 +36,13 @@ toTermName term = case unwrap term of
_ -> "."
Syntax.VarAssignment varId _ -> toTermName varId
Syntax.VarDecl decl -> toTermName decl
-- TODO: We should remove Args from Syntax since I don't think we shouldn ever
-- TODO: We should remove Args from Syntax since I don't think we should ever
-- evaluate Args as a single toTermName Text - joshvera
Syntax.Args args -> mconcat $ toTermName <$> args
-- TODO: We should remove Case from Syntax since I don't think we should ever
-- evaluate Case as a single toTermName Text - joshvera
Syntax.Case expr _ -> toTermName expr
Syntax.Switch expr cases -> toTermName expr
class HasCategory a where
toCategoryName :: a -> Text