瀏覽代碼

added 'override'

Nicolas Cannasse 18 年之前
父節點
當前提交
41a806abf7
共有 2 個文件被更改,包括 11 次插入0 次删除
  1. 1 0
      doc/CHANGES.txt
  2. 10 0
      genas3.ml

+ 1 - 0
doc/CHANGES.txt

@@ -1,6 +1,7 @@
 2007-??-??: 1.13
 2007-??-??: 1.13
 	fixed bug with local variable masking package in catch type
 	fixed bug with local variable masking package in catch type
 	fixed "Not_found" when enum params differs
 	fixed "Not_found" when enum params differs
+	added "override" for AS3 generator
 
 
 2007-03-06: 1.12
 2007-03-06: 1.12
 	added flash lite support with -D flash_lite
 	added flash lite support with -D flash_lite

+ 10 - 0
genas3.ml

@@ -711,6 +711,16 @@ let generate_field ctx static f =
 	match f.cf_expr with
 	match f.cf_expr with
 	| Some { eexpr = TFunction fd } when f.cf_set = F9MethodAccess ->
 	| Some { eexpr = TFunction fd } when f.cf_set = F9MethodAccess ->
 		print ctx "%s " rights;
 		print ctx "%s " rights;
+		let rec loop c =
+			match c.cl_super with
+			| None -> ()
+			| Some (c,_) ->
+				if PMap.mem f.cf_name c.cl_fields then
+					spr ctx "override "
+				else
+					loop c
+		in
+		if not static then loop ctx.curclass;
 		let h = gen_function_header ctx (Some (s_ident f.cf_name)) fd f.cf_params p in
 		let h = gen_function_header ctx (Some (s_ident f.cf_name)) fd f.cf_params p in
 		gen_expr ctx (block fd.tf_expr);
 		gen_expr ctx (block fd.tf_expr);
 		h()
 		h()