Selaa lähdekoodia

generate final fields without access modifiers in --gen-hx-classes

Dan Korostelev 6 vuotta sitten
vanhempi
commit
9e8d6263e0
1 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. 6 2
      src/codegen/genxml.ml

+ 6 - 2
src/codegen/genxml.ml

@@ -445,8 +445,12 @@ let generate_type com t =
 		in
 		(match f.cf_kind with
 		| Var v ->
-			p "var %s" name;
-			if v.v_read <> AccNormal || v.v_write <> AccNormal then p "(%s,%s)" (access true v.v_read) (access false v.v_write);
+			if has_class_field_flag f CfFinal then
+				p "final %s" name
+			else begin
+				p "var %s" name;
+				if v.v_read <> AccNormal || v.v_write <> AccNormal then p "(%s,%s)" (access true v.v_read) (access false v.v_write);
+			end;
 			p " : %s" (stype f.cf_type);
 		| Method m ->
 			let params, ret = (match follow f.cf_type with