Skip to content

Commit

Permalink
Add more type exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboris committed Oct 13, 2024
1 parent af77a06 commit 49a23d5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion generate/dune
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(executable
(name main)
(public_name generate-ml)
; (flags :standard -ccopt "-framework UIKit")
(flags :standard -ccopt "-framework Cocoa")
(libraries camlkit-base.runtime lib))
14 changes: 9 additions & 5 deletions lib/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,16 @@ let method_binding m =
if is_private sel then
Option.none
else
let name, args = split_selector sel in
if unsupported_method name then
try
let name, args = split_selector sel in
if unsupported_method name then
Option.none
else
Option.some
{name; args = disambiguate_args args; sel; typ = method_type m}
with ex ->
Printf.eprintf "Non-fatal exn: %s\n%!" (Printexc.to_string ex);
Option.none
else
Option.some
{name; args = disambiguate_args args; sel; typ = method_type m}
;;

let eq_name mb {name; _} = String.equal mb.name name
Expand Down
6 changes: 4 additions & 2 deletions lib/util.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ let apply_type_exceptions ?(allow_underscore = true) = function
| "OpaqueEventRef" | "OpaqueMenuRef" | "TISInputSource" | "WorkspaceKVOData_t"
| "OpaqueHIPresentationInstanceRef" | "OpaqueATSUStyle" | "AXUIElement"
| "SLMPopUpMenuContext_t" | "RXRecognizer" | "GSEvent" | "GSKeyboard"
| "IOHIDEvent" | "UIWebTouchEvent"
| "IOHIDEvent" | "UIWebTouchEvent" | "OpaqueCFHTTPCookie" | "CNPluginCommand"
| "CFNetService" | "SecIdentity" | "SecAccess" | "CFHSTSPolicy"
| "sqlite3" | "sqlite3_stmt" | "sqlite3_value" ->
"void"
| "va_list_tag" ->
Expand All @@ -57,7 +58,8 @@ let apply_type_exceptions ?(allow_underscore = true) = function
| "ITColor" | "mach_right_send" | "PUSimpleIndexPath" | "PXSimpleIndexPath"
| "PHDisplayVelocity" | "PXAssetMediaTypeCount" | "PXAssetBadgeInfo"
| "PUGridCoordinates" | "PUDisplayVelocity" | "CTGlyphStorage"
| "MIORange" | "IMFileSize" | "AKQuadrilateral" as ty ->
| "MIORange" | "IMFileSize" | "AKQuadrilateral"| "InternalInit"
| "HTTPConnectionCacheLimits" as ty ->
raise (Unsupported_type ty)
| ty ->
if not allow_underscore && String.contains ty '_' then
Expand Down

0 comments on commit 49a23d5

Please sign in to comment.