X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=java_strings.py;h=c0eddca110ad91fdae9271ca41fd825e3e21a848;hb=2fbce30ea96ee95caf277587afc5db863e9b26af;hp=8338bc176156b056c77c367674faa9b37ff32996;hpb=153c5653d39ca5dc40e4cd9bfbab41936b850768;p=ldk-java diff --git a/java_strings.py b/java_strings.py index 8338bc17..c0eddca1 100644 --- a/java_strings.py +++ b/java_strings.py @@ -652,6 +652,14 @@ import javax.annotation.Nullable; def var_decl_statement(self, ty_string, var_name, statement): return ty_string + " " + var_name + " = " + statement + def constr_hu_array(self, ty_info, arr_len): + base_ty = ty_info.subty.java_hu_ty.split("[")[0].split("<")[0] + conv = "new " + base_ty + "[" + arr_len + "]" + if "[" in ty_info.subty.java_hu_ty.split("<")[0]: + # Do a bit of a dance to move any excess [] to the end + conv += "[" + ty_info.subty.java_hu_ty.split("<")[0].split("[")[1] + return conv + def for_n_in_range(self, n, minimum, maximum): return "for (int " + n + " = " + minimum + "; " + n + " < " + maximum + "; " + n + "++) {" def for_n_in_arr(self, n, arr_name, arr_elem_ty):