瀏覽代碼

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");