-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gentype: propagate more comments #6334
Changes from 4 commits
cfbe53e
98776b5
23fd956
cc6210e
387e5cf
31d4224
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,23 @@ module StringMap = Map.Make (String) | |
module StringSet = Set.Make (String) | ||
module Config = GenTypeConfig | ||
|
||
module DocString : sig | ||
type t | ||
val make : string option -> t | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this abstraction? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can probably do without it. It was mostly a way to make sense of all the places where we had docstrings, where they would occasionally be formatted as comments already, and occasionally not. But I can probably just make it a string option now again. Let me give it a shot. |
||
val render : t -> string | ||
val hasContent : t -> bool | ||
val empty : t | ||
end = struct | ||
type t = string option | ||
let make str = str | ||
let render t = | ||
match t with | ||
| None | Some "" -> "" | ||
| Some docString -> "/** " ^ String.trim docString ^ " */\n" | ||
let empty = make None | ||
let hasContent docString = Option.is_some docString | ||
end | ||
|
||
let logNotImplemented x = | ||
if !Debug.notImplemented then Log_.item "Not Implemented: %s\n" x | ||
|
||
|
@@ -78,7 +95,7 @@ and field = { | |
nameJS: string; | ||
optional: optional; | ||
type_: type_; | ||
docString: string option; | ||
docString: DocString.t; | ||
} | ||
|
||
and function_ = {argTypes: argType list; retType: type_; typeVars: string list} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice