Skip to content

Commit

Permalink
added enums __name__
Browse files Browse the repository at this point in the history
git-svn-id: http://haxe.googlecode.com/svn/trunk@579 f16182fa-f095-11de-8f43-4547254af6c6
  • Loading branch information
ncannasse committed May 1, 2006
1 parent 440495f commit 9429a54
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion genneko.ml
Expand Up @@ -544,7 +544,11 @@ let gen_boot hres =

let gen_name acc t =
match t with
| TEnumDecl _ -> acc
| TEnumDecl e ->
let p = pos e.e_pos in
let name = fst e.e_path @ [snd e.e_path] in
let arr = call p (field p (ident p "Array") "new1") [array p (List.map (fun n -> gen_constant p (TString n)) name); int p (List.length name)] in
(EBinop ("=",field p (gen_type_path p e.e_path) "__name__",arr),p) :: acc
| TClassDecl c ->
if c.cl_extern then
acc
Expand Down

0 comments on commit 9429a54

Please sign in to comment.