mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 16:16:09 +03:00
Format unions
This commit is contained in:
parent
d6f6650945
commit
0e2a0941cd
@ -67,6 +67,14 @@ formatAlias alias_ =
|
||||
}"""
|
||||
|
||||
|
||||
formatUnion union =
|
||||
"{ name = " ++ stringify union.name ++ """
|
||||
, args = """ ++ listOfThings stringify union.args ++ """
|
||||
, comment = """ ++ stringify union.comment ++ """
|
||||
, tags = """ ++ listOfThings (\( name, types ) -> "( " ++ stringify name ++ ", " ++ listOfThings formatType types ++ ")") union.tags ++ """
|
||||
}"""
|
||||
|
||||
|
||||
formatType : Elm.Type.Type -> String
|
||||
formatType type_ =
|
||||
case type_ of
|
||||
@ -125,7 +133,7 @@ formatModule mod =
|
||||
"{ name = " ++ stringify mod.name ++ """
|
||||
, comment = """ ++ stringify mod.comment ++ """
|
||||
, aliases = """ ++ listOfThings formatAlias mod.aliases ++ """
|
||||
, unions = []
|
||||
, unions = """ ++ listOfThings formatUnion mod.unions ++ """
|
||||
, binops = []
|
||||
, values = []
|
||||
}"""
|
||||
|
Loading…
Reference in New Issue
Block a user