Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions c/gen_c_binding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ and abstract_param_conv name = function
| _ -> paramname name

and abstract_member = function
String
| SecretString | String
| Ref _ -> "string"
| Enum _ -> "enum"
| Int -> "int"
Expand Down Expand Up @@ -532,7 +532,7 @@ and abstract_result_type typ =


and abstract_type record = function
| String -> "abstract_type_string"
| SecretString | String -> "abstract_type_string"
| Enum(n, _) ->
sprintf "%s_abstract_type_" (typename n)
| Ref _ ->
Expand Down Expand Up @@ -1206,7 +1206,7 @@ and find_needed' needed message =


and find_needed'' needed = function
| String
| SecretString | String
| Int
| Float
| Bool
Expand Down Expand Up @@ -1238,7 +1238,7 @@ and record_free_impl prefix = function


and free_impl val_name record = function
| String -> sprintf "free(%s);" val_name
| SecretString | String -> sprintf "free(%s);" val_name
| Int
| Float
| Bool
Expand Down Expand Up @@ -1274,7 +1274,7 @@ and add_enum_map_internal needed l r =


and c_type_of_ty needed record = function
| String -> "char *"
| SecretString|String -> "char *"
| Int -> "int64_t "
| Float -> "double "
| Bool -> "bool "
Expand Down Expand Up @@ -1341,7 +1341,7 @@ and c_type_of_enum name =


and initialiser_of_ty = function
| String
| SecretString | String
| Ref _
| Set _
| Map _
Expand All @@ -1354,7 +1354,7 @@ and mapname l r =


and name_of_ty = function
| String -> "string"
| SecretString | String -> "string"
| Int -> "int"
| Float -> "float"
| Bool -> "bool"
Expand Down
16 changes: 8 additions & 8 deletions csharp/gen_csharp_binding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ and proxy_type_opt = function


and proxy_type = function
| String -> "string"
| SecretString|String -> "string"
| Int -> "string"
| Float -> "double"
| Bool -> "bool"
Expand All @@ -1086,7 +1086,7 @@ and exposed_type_opt = function
| None -> "void"

and exposed_type = function
| String -> "string"
| SecretString | String -> "string"
| Int -> "long"
| Float -> "double"
| Bool -> "bool"
Expand Down Expand Up @@ -1128,7 +1128,7 @@ and convert_from_proxy_opt thing = function
and convert_from_proxy_hashtable_value thing ty =
match ty with
| Int -> sprintf "%s == null ? 0 : long.Parse((string)%s)" thing thing
| String -> sprintf "%s == null ? null : (string)%s" thing thing
| SecretString|String -> sprintf "%s == null ? null : (string)%s" thing thing
| Set(String) -> sprintf "%s == null ? new string[] {} : Array.ConvertAll<object, string>((object[])%s, Convert.ToString)" thing thing
| _ -> convert_from_proxy thing ty

Expand All @@ -1151,7 +1151,7 @@ and convert_from_hashtable fname ty =
| Float -> sprintf "Marshalling.ParseDouble(table, %s)" field
| Int -> sprintf "Marshalling.ParseLong(table, %s)" field
| Ref name -> sprintf "Marshalling.ParseRef<%s>(table, %s)" (exposed_class_name name) field
| String -> sprintf "Marshalling.ParseString(table, %s)" field
| SecretString|String -> sprintf "Marshalling.ParseString(table, %s)" field
| Set(String) -> sprintf "Marshalling.ParseStringArray(table, %s)" field
| Set(Ref name) -> sprintf "Marshalling.ParseSetRef<%s>(table, %s)" (exposed_class_name name) field
| Set(Enum(name, _)) -> sprintf "Helper.StringArrayToEnumList<%s>(Marshalling.ParseStringArray(table, %s))" name field
Expand Down Expand Up @@ -1182,7 +1182,7 @@ and simple_convert_from_proxy thing ty =
| Bool -> sprintf "(bool)%s" thing
| Float -> sprintf "Convert.ToDouble(%s)" thing
| Ref name -> sprintf "XenRef<%s>.Create(%s)" (exposed_class_name name) thing
| String -> thing
| SecretString|String -> thing
| Set(String) -> sprintf "(string [])%s" thing
| Set(Ref name) -> sprintf "XenRef<%s>.Create(%s)" (exposed_class_name name) thing
| Set(Enum(name, _)) -> sprintf "Helper.StringArrayToEnumList<%s>(%s)" name thing
Expand Down Expand Up @@ -1210,7 +1210,7 @@ and convert_to_proxy thing ty =
| Float
| DateTime -> thing
| Ref _ -> sprintf "%s ?? \"\"" thing
| String -> sprintf "%s ?? \"\"" thing
| SecretString | String -> sprintf "%s ?? \"\"" thing
| Enum (name,_) -> sprintf "%s_helper.ToString(%s)" name thing
| Set (Ref _) -> sprintf "%s == null ? new string[] {} : Helper.RefListToStringArray(%s)" thing thing
| Set(String) -> thing
Expand Down Expand Up @@ -1261,7 +1261,7 @@ and json_param p =
| Float
| Bool
| DateTime -> sprintf "_%s" thing
| String
| SecretString | String
| Ref _ -> sprintf "_%s ?? \"\"" thing
| Enum _ -> sprintf "_%s.StringOf()" thing
| Set (Ref _) -> sprintf "_%s == null ? new JArray() : JArray.FromObject(_%s, serializer)" thing thing
Expand Down Expand Up @@ -1340,7 +1340,7 @@ and get_default_value_per_type ty thing =
| Bool
| Float -> if thing = [] then "" else sprintf " = %s" (String.concat ", " thing)
| Ref _ -> sprintf " = new %s(%s)" (exposed_type ty) (if thing = [] then "Helper.NullOpaqueRef" else (String.concat ", " thing))
| String -> sprintf " = %s" (if thing = [] then "\"\"" else (String.concat ", " thing))
| SecretString | String -> sprintf " = %s" (if thing = [] then "\"\"" else (String.concat ", " thing))
| Enum (name,_) -> if thing = [] then "" else sprintf " = %s.%s" name (String.concat ", " thing)
| Set(Int)
| Set(String) -> sprintf " = {%s}" (String.concat ", " thing)
Expand Down
8 changes: 4 additions & 4 deletions java/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ let types = ref TypeSet.empty
let rec get_java_type ty =
types := TypeSet.add ty !types;
match ty with
| String -> "String"
| SecretString | String -> "String"
| Int -> "Long"
| Float -> "Double"
| Bool -> "Boolean"
Expand All @@ -166,7 +166,7 @@ let _ = (get_java_type switch_enum);;

(*Helper function for get_marshall_function*)
let rec get_marshall_function_rec = function
| String -> "String"
| SecretString | String -> "String"
| Int -> "Long"
| Float -> "Double"
| Bool -> "Boolean"
Expand Down Expand Up @@ -388,7 +388,7 @@ and gen_record_tostring_contents file prefix = function


let field_default = function
| String -> "\"\""
| SecretString | String -> "\"\""
| Int -> "0"
| Float -> "0.0"
| Bool -> "false"
Expand Down Expand Up @@ -611,7 +611,7 @@ let gen_task_result_func file = function
;;

let rec gen_marshall_body file = function
| String -> fprintf file " return (String) object;\n"
| SecretString | String -> fprintf file " return (String) object;\n"
| Int -> fprintf file " return Long.valueOf((String) object);\n"
| Float -> fprintf file " return (Double) object;\n"
| Bool -> fprintf file " return (Boolean) object;\n"
Expand Down
4 changes: 2 additions & 2 deletions powershell/common_functions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ and qualified_class_name classname =
and type_default ty =
match ty with
| Int -> ""
| String -> ""
| SecretString | String -> ""
| Float -> ""
| Bool -> ""
| Enum _ -> ""
Expand All @@ -121,7 +121,7 @@ and exposed_type_opt = function
| None -> "void"

and exposed_type = function
| String -> "string"
| SecretString | String -> "string"
| Int -> "long"
| Float -> "double"
| Bool -> "bool"
Expand Down
2 changes: 1 addition & 1 deletion powershell/gen_powershell_binding.ml
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ and convert_from_hashtable fname ty =
| Int -> sprintf "Marshalling.ParseLong(HashTable, %s)" field
| Ref name -> sprintf "Marshalling.ParseRef<%s>(HashTable, %s)"
(exposed_class_name name) field
| String -> sprintf "Marshalling.ParseString(HashTable, %s)" field
| SecretString|String -> sprintf "Marshalling.ParseString(HashTable, %s)" field
| Set(String) -> sprintf "Marshalling.ParseStringArray(HashTable, %s)" field
| Set(Ref x) -> sprintf "Marshalling.ParseSetRef<%s>(HashTable, %s)"
(exposed_class_name x) field
Expand Down