Browse Source

added ; after function values (except prototype/static ones)

Nicolas Cannasse 14 năm trước cách đây
mục cha
commit
871a18a385
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      genjs.ml

+ 3 - 0
genjs.ml

@@ -271,6 +271,7 @@ and gen_expr ctx e =
 		ctx.curmethod <- old_meth;
 		ctx.curmethod <- old_meth;
 		ctx.in_value <- fst old;
 		ctx.in_value <- fst old;
 		ctx.in_loop <- snd old;
 		ctx.in_loop <- snd old;
+		ctx.separator <- true
 	| TCall (e,el) ->
 	| TCall (e,el) ->
 		gen_call ctx e el
 		gen_call ctx e el
 	| TArrayDecl el ->
 	| TArrayDecl el ->
@@ -660,6 +661,7 @@ let gen_class_static_field ctx c f =
 			ctx.id_counter <- 0;
 			ctx.id_counter <- 0;
 			print ctx "%s%s = " (s_path ctx c.cl_path) (field f.cf_name);
 			print ctx "%s%s = " (s_path ctx c.cl_path) (field f.cf_name);
 			gen_value ctx e;
 			gen_value ctx e;
+			ctx.separator <- false;
 			newline ctx
 			newline ctx
 		| _ ->
 		| _ ->
 			ctx.statics <- (c,f.cf_name,e) :: ctx.statics
 			ctx.statics <- (c,f.cf_name,e) :: ctx.statics
@@ -675,6 +677,7 @@ let gen_class_field ctx c f =
 		ctx.curmethod <- (f.cf_name,false);
 		ctx.curmethod <- (f.cf_name,false);
 		ctx.id_counter <- 0;
 		ctx.id_counter <- 0;
 		gen_value ctx e;
 		gen_value ctx e;
+		ctx.separator <- false;
 		newline ctx
 		newline ctx
 
 
 let gen_constructor ctx e =
 let gen_constructor ctx e =