Skip to content

Commit

Permalink
Pretty printer for JavaClass indicates static methods.
Browse files Browse the repository at this point in the history
This addresses part of #885.
  • Loading branch information
Brian Huffman committed Nov 16, 2020
1 parent 2947d87 commit b131726
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/SAWScript/JavaPretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ prettyField f = hsep $

prettyMethod :: Method -> Doc
prettyMethod m =
hsep [ maybe (text "void") prettyType ret
, text name
, (parens . commas . map prettyType) params
]
hsep $
(if methodIsStatic m then [text "static"] else []) ++
[ maybe (text "void") prettyType ret
, text name
, (parens . commas . map prettyType) params
]
where (MethodKey name params ret) = methodKey m
prettyType = text . show . ppType -- TODO: Ick.

Expand Down

0 comments on commit b131726

Please sign in to comment.