|
@@ -2792,6 +2792,20 @@ let generate con =
|
|
|
| TClassDecl cl ->
|
|
|
if not cl.cl_extern then begin
|
|
|
(if requires_root then write w "using haxe.root;\n"; newline w;);
|
|
|
+ (if (Meta.has Meta.CsUsing cl.cl_meta) then
|
|
|
+ match (Meta.get Meta.CsUsing cl.cl_meta) with
|
|
|
+ | _,_,p when not file_start ->
|
|
|
+ gen.gcon.error "@:cs.using can only be used on the first type of a module" p
|
|
|
+ | _,[],p ->
|
|
|
+ gen.gcon.error "One or several string constants expected" p
|
|
|
+ | _,e,_ ->
|
|
|
+ (List.iter (fun e ->
|
|
|
+ match e with
|
|
|
+ | (EConst(String(s,_))),_ -> write w (Printf.sprintf "using %s;\n" s)
|
|
|
+ | _,p -> gen.gcon.error "One or several string constants expected" p
|
|
|
+ ) e);
|
|
|
+ newline w
|
|
|
+ );
|
|
|
gen_class w cl;
|
|
|
newline w;
|
|
|
newline w
|