1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

Pattern match functions in MethodCalls better in toTermName

This commit is contained in:
joshvera 2016-06-14 14:01:52 -07:00
parent a0f415dece
commit a911515456

View File

@ -30,7 +30,8 @@ toTermName term = case unwrap term of
(Syntax.FunctionCall{}, _) -> toTermName base <> "()." <> toTermName property (Syntax.FunctionCall{}, _) -> toTermName base <> "()." <> toTermName property
(_, Syntax.FunctionCall{}) -> toTermName base <> "." <> toTermName property <> "()" (_, Syntax.FunctionCall{}) -> toTermName base <> "." <> toTermName property <> "()"
(_, _) -> toTermName base <> "." <> toTermName property (_, _) -> toTermName base <> "." <> toTermName property
Syntax.MethodCall targetId methodId _ -> toTermName targetId <> "." <> toTermName methodId <> "()" Syntax.MethodCall targetId methodId _ -> let sep = case unwrap targetId of Syntax.FunctionCall{} -> "()."; _ -> "." in
toTermName targetId <> sep <> toTermName methodId <> "()"
class HasCategory a where class HasCategory a where
toCategoryName :: a -> Text toCategoryName :: a -> Text