File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,18 @@ debug = dartStringDoc . show
150
150
comment : String -> Doc
151
151
comment c = " /* " <+> text c <+> " */"
152
152
153
+ surroundWith : Doc -> Doc -> Doc
154
+ surroundWith s d = s <+> d <+> s
155
+
156
+ mdCode : Doc -> Doc
157
+ mdCode = surroundWith " `"
158
+
159
+ mdItalic : Doc -> Doc
160
+ mdItalic = surroundWith " _"
161
+
162
+ docCommentFor : FC -> Name -> Doc
163
+ docCommentFor fc n = " /// " <+> mdCode (shown n) <+> " from " <+> mdItalic (shown fc) <+> " ." <+> line
164
+
153
165
argList : List Doc -> Doc
154
166
argList [] = text " ()"
155
167
argList args = paren (commaSep args <+> " ," )
@@ -939,7 +951,7 @@ mutual
939
951
-> Core Doc
940
952
dartStatement s = case s of
941
953
FunDecl fc n ps body =>
942
- pure (line <+> dartName n <+> ! (dartLambda ps body))
954
+ pure (line <+> docCommentFor fc n <+> dartName n <+> ! (dartLambda ps body))
943
955
ForeignDecl fc n ss args ret =>
944
956
pure (line <+> ! (foreignDecl n ss args ret))
945
957
SwitchStatement e cases@((IEConstant (BI _ ), _ ) :: _ ) maybeDefault =>
You can’t perform that action at this time.
0 commit comments