Skip to content

Commit

Permalink
Make atdj fail with a useful error message instead of an assert failure
Browse files Browse the repository at this point in the history
when an unsupported type name such as `abstract` is found in the atd
file.
  • Loading branch information
mjambon committed Oct 31, 2017
1 parent d19a99d commit 214474b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions atdj/src/atdj_trans.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let json_of_atd env atd_ty =
| "int" -> "int"
| "float" -> "double"
| "string" -> "String"
| _ -> assert false
| _ -> type_not_supported atd_ty
)
| x -> type_not_supported x

Expand Down Expand Up @@ -68,7 +68,7 @@ let rec assign env opt_dst src java_ty atd_ty indent =
| `Name (_, (_, ty, _), _) ->
(match ty with
| "bool" | "int" | "float" | "string" -> src
| _ -> assert false
| _ -> type_not_supported atd_ty
)
| x -> type_not_supported x
)
Expand Down Expand Up @@ -96,7 +96,7 @@ let rec assign env opt_dst src java_ty atd_ty indent =
(match ty with
| "bool" | "int" | "float" | "string" ->
sprintf "%s%s = %s;\n" indent dst src
| _ -> assert false
| _ -> type_not_supported atd_ty
)
| x -> type_not_supported x
)
Expand Down

0 comments on commit 214474b

Please sign in to comment.