Преглед на файлове

Allow enums to haxe keyword names

Hugh Sanderson преди 14 години
родител
ревизия
aa8dd83dc7
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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");