Procházet zdrojové kódy

Allow enums to haxe keyword names

Hugh Sanderson před 14 roky
rodič
revize
aa8dd83dc7
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      gencpp.ml

+ 1 - 1
gencpp.ml

@@ -2183,7 +2183,7 @@ let generate_enum_files common_ctx enum_def super_deps meta =
 		match constructor.ef_type with
 		| TFun (_,_) -> ()
 		| _ ->
-			output_cpp ( "Static(" ^ name ^ ") = hx::CreateEnum< " ^ class_name ^ " >(" ^ (str name) ^  "," ^
+			output_cpp ( "Static(" ^ (keyword_remap name) ^ ") = hx::CreateEnum< " ^ class_name ^ " >(" ^ (str name) ^  "," ^
 				(string_of_int constructor.ef_index) ^ ");\n" )
 	) enum_def.e_constrs;
 	output_cpp ("}\n\n");