Skip to content

Commit

Permalink
variants: hack around numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisgio committed Jan 21, 2025
1 parent a485bdb commit 2ff0045
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ let type_name = sanitize_name
let variant_name str =
match str with
| "" -> "None"
| _ -> String.capitalize_ascii (sanitize_name str)
| _ ->
match str.[0] with
| '0'..'9' -> "N_" ^ (sanitize_name str)
| _ -> String.capitalize_ascii (sanitize_name str)

module Fresh (T : sig
type t
Expand Down

0 comments on commit 2ff0045

Please sign in to comment.