Sfoglia il codice sorgente

changed directory names for old flash (become flash8) and flash9 (become flash)

Nicolas Cannasse 13 anni fa
parent
commit
c44b0f048b
65 ha cambiato i file con 26 aggiunte e 26 eliminazioni
  1. 1 1
      codegen.ml
  2. 6 6
      common.ml
  3. 13 13
      main.ml
  4. 1 1
      optimizer.ml
  5. 0 0
      std/flash8/Accessibility.hx
  6. 0 0
      std/flash8/Boot.hx
  7. 0 0
      std/flash8/Button.hx
  8. 0 0
      std/flash8/Camera.hx
  9. 0 0
      std/flash8/Color.hx
  10. 0 0
      std/flash8/ContextMenu.hx
  11. 0 0
      std/flash8/ContextMenuItem.hx
  12. 0 0
      std/flash8/ExtendedKey.hx
  13. 0 0
      std/flash8/Key.hx
  14. 0 0
      std/flash8/Lib.hx
  15. 0 0
      std/flash8/LoadVars.hx
  16. 0 0
      std/flash8/LocalConnection.hx
  17. 0 0
      std/flash8/Microphone.hx
  18. 0 0
      std/flash8/Mouse.hx
  19. 0 0
      std/flash8/MovieClip.hx
  20. 0 0
      std/flash8/MovieClipLoader.hx
  21. 0 0
      std/flash8/NetConnection.hx
  22. 0 0
      std/flash8/NetStream.hx
  23. 0 0
      std/flash8/PrintJob.hx
  24. 0 0
      std/flash8/Selection.hx
  25. 0 0
      std/flash8/SharedObject.hx
  26. 0 0
      std/flash8/Sound.hx
  27. 0 0
      std/flash8/Stage.hx
  28. 0 0
      std/flash8/System.hx
  29. 0 0
      std/flash8/TextField.hx
  30. 0 0
      std/flash8/TextFormat.hx
  31. 0 0
      std/flash8/TextSnapshot.hx
  32. 0 0
      std/flash8/Video.hx
  33. 0 0
      std/flash8/XMLRequest.hx
  34. 0 0
      std/flash8/XMLSocket.hx
  35. 0 0
      std/flash8/_std/Hash.hx
  36. 0 0
      std/flash8/_std/IntHash.hx
  37. 0 0
      std/flash8/_std/Reflect.hx
  38. 0 0
      std/flash8/_std/Std.hx
  39. 0 0
      std/flash8/_std/Type.hx
  40. 0 0
      std/flash8/_std/Xml.hx
  41. 0 0
      std/flash8/display/BitmapData.hx
  42. 0 0
      std/flash8/external/ExternalInterface.hx
  43. 0 0
      std/flash8/filters/BevelFilter.hx
  44. 0 0
      std/flash8/filters/BitmapFilter.hx
  45. 0 0
      std/flash8/filters/BlurFilter.hx
  46. 0 0
      std/flash8/filters/ColorMatrixFilter.hx
  47. 0 0
      std/flash8/filters/ConvolutionFilter.hx
  48. 0 0
      std/flash8/filters/DisplacementMapFilter.hx
  49. 0 0
      std/flash8/filters/DropShadowFilter.hx
  50. 0 0
      std/flash8/filters/GlowFilter.hx
  51. 0 0
      std/flash8/filters/GradientBevelFilter.hx
  52. 0 0
      std/flash8/filters/GradientGlowFilter.hx
  53. 0 0
      std/flash8/geom/ColorTransform.hx
  54. 0 0
      std/flash8/geom/Matrix.hx
  55. 0 0
      std/flash8/geom/Point.hx
  56. 0 0
      std/flash8/geom/Rectangle.hx
  57. 0 0
      std/flash8/geom/Transform.hx
  58. 0 0
      std/flash8/net/FileReference.hx
  59. 0 0
      std/flash8/net/FileReferenceList.hx
  60. 0 0
      std/flash8/system/Capabilities.hx
  61. 0 0
      std/flash8/system/IME.hx
  62. 0 0
      std/flash8/system/Security.hx
  63. 0 0
      std/flash8/text/StyleSheet.hx
  64. 0 0
      std/flash8/text/TextRenderer.hx
  65. 5 5
      typer.ml

+ 1 - 1
codegen.ml

@@ -789,7 +789,7 @@ let captured_vars com e =
 		e
 	| Cpp ->
 		do_wrap (all_vars e) e
-	| Flash | Flash9 ->
+	| Flash8 | Flash ->
 		let used = all_vars e in
 		PMap.iter (fun _ v -> v.v_capture <- true) used;
 		out_loop e

+ 6 - 6
common.ml

@@ -25,10 +25,10 @@ type package_rule =
 
 type platform =
 	| Cross
-	| Flash
+	| Flash8
 	| Js
 	| Neko
-	| Flash9
+	| Flash
 	| Php
 	| Cpp
 
@@ -152,20 +152,20 @@ let get_signature com =
 		s
 
 let platforms = [
-	Flash;
+	Flash8;
 	Js;
 	Neko;
-	Flash9;
+	Flash;
 	Php;
 	Cpp
 ]
 
 let platform_name = function
 	| Cross -> "cross"
-	| Flash -> "flash"
+	| Flash8 -> "flash8"
 	| Js -> "js"
 	| Neko -> "neko"
-	| Flash9 -> "flash9"
+	| Flash -> "flash"
 	| Php -> "php"
 	| Cpp -> "cpp"
 

+ 13 - 13
main.ml

@@ -590,7 +590,7 @@ try
 		com.file <- file;
 		Unix.putenv "__file__" file;
 		Unix.putenv "__platform__" file;
-		if (pf = Flash || pf = Flash9) && file_extension file = "swc" then Common.define com "swc";
+		if (pf = Flash8 || pf = Flash) && file_extension file = "swc" then Common.define com "swc";
 	in
 	let define f = Arg.Unit (fun () -> Common.define com f) in
 	let basic_args_spec = [
@@ -600,10 +600,9 @@ try
 			com.class_path <- normalize_path (expand_env path) :: com.class_path
 		),"<path> : add a directory to find source files");
 		("-js",Arg.String (set_platform Js),"<file> : compile code to JavaScript file");
-		("-swf",Arg.String (set_platform Flash),"<file> : compile code to Flash SWF file");
+		("-swf",Arg.String (set_platform Flash8),"<file> : compile code to Flash SWF file");
 		("-as3",Arg.String (fun dir ->
 			set_platform Flash dir;
-			if com.flash_version < 9. then com.flash_version <- 9.;
 			gen_as3 := true;
 			Common.define com "as3";
 			Common.define com "no_inline";
@@ -775,7 +774,6 @@ try
 		),"<dir> : set current working directory");
 		("-swf9",Arg.String (fun file ->
 			set_platform Flash file;
-			if com.flash_version < 9. then com.flash_version <- 9.;
 		),"<file> : [deprecated] compile code to Flash9 SWF file");
 	] in
 	let current = ref 0 in
@@ -800,7 +798,7 @@ try
 			(* no platform selected *)
 			set_platform Cross "";
 			"?"
-		| Flash | Flash9 ->
+		| Flash8 | Flash ->
 			if com.flash_version >= 9. then begin
 				let rec loop = function
 					| [] -> ()
@@ -810,13 +808,14 @@ try
 						loop l
 				in
 				loop Common.flash_versions;
-				com.package_rules <- PMap.add "flash" (Directory "flash9") com.package_rules;
-				com.package_rules <- PMap.add "flash9" Forbidden com.package_rules;
-				com.platform <- Flash9;
-				add_std "flash9";
+				add_std "flash";
 			end else begin
+				com.package_rules <- PMap.add "flash" (Directory "flash8") com.package_rules;
+				com.package_rules <- PMap.add "flash8" Forbidden com.package_rules;
+				Common.define com "flash";
 				Common.define com ("flash" ^ string_of_int (int_of_float com.flash_version));
-				add_std "flash";
+				com.platform <- Flash8;
+				add_std "flash8";
 			end;
 			"swf"
 		| Neko -> add_std "neko"; "n"
@@ -835,6 +834,7 @@ try
 		if !cmds = [] && not !did_something then Arg.usage basic_args_spec usage;
 	end else begin
 		Common.log com ("Classpath : " ^ (String.concat ";" com.class_path));
+		Common.log com ("Defines : " ^ (String.concat ";" (PMap.foldi (fun v _ acc -> v :: acc) com.defines [])));
 		let t = Common.timer "typing" in
 		Typecore.type_expr_ref := (fun ctx e need_val -> Typer.type_expr ~need_val ctx e);
 		let tctx = Typer.create com in
@@ -864,7 +864,7 @@ try
 		| Some file ->
 			Common.log com ("Generating xml : " ^ com.file);
 			Genxml.generate com file);
-		if com.platform = Flash9 || com.platform = Cpp then List.iter (Codegen.fix_overrides com) com.types;
+		if com.platform = Flash || com.platform = Cpp then List.iter (Codegen.fix_overrides com) com.types;
 		if Common.defined com "dump" then Codegen.dump_types com;
 		t();
 		(match com.platform with
@@ -878,10 +878,10 @@ try
 			end;
 		| Cross ->
 			()
-		| Flash | Flash9 when !gen_as3 ->
+		| Flash8 | Flash when !gen_as3 ->
 			Common.log com ("Generating AS3 in : " ^ com.file);
 			Genas3.generate com;
-		| Flash | Flash9 ->
+		| Flash8 | Flash ->
 			Common.log com ("Generating swf : " ^ com.file);
 			Genswf.generate com !swf_header;
 		| Neko ->

+ 1 - 1
optimizer.ml

@@ -125,7 +125,7 @@ let rec type_inline ctx cf f ethis params tret p force =
 				if we pass a Null<T> var to an inlined method that needs a T.
 				we need to force a local var to be created on some platforms.
 			*)
-			if is_nullable v.v_type && is_null e.etype && (match ctx.com.platform with Flash9 | Cpp -> true | _ -> false) then (local v).i_write <- true;
+			if is_nullable v.v_type && is_null e.etype && (match ctx.com.platform with Flash | Cpp -> true | _ -> false) then (local v).i_write <- true;
 			(match e.eexpr, opt with
 			| TConst TNull , Some c -> mk (TConst c) v.v_type e.epos
 			| _ -> e) :: loop pl al

+ 0 - 0
std/flash/Accessibility.hx → std/flash8/Accessibility.hx


+ 0 - 0
std/flash/Boot.hx → std/flash8/Boot.hx


+ 0 - 0
std/flash/Button.hx → std/flash8/Button.hx


+ 0 - 0
std/flash/Camera.hx → std/flash8/Camera.hx


+ 0 - 0
std/flash/Color.hx → std/flash8/Color.hx


+ 0 - 0
std/flash/ContextMenu.hx → std/flash8/ContextMenu.hx


+ 0 - 0
std/flash/ContextMenuItem.hx → std/flash8/ContextMenuItem.hx


+ 0 - 0
std/flash/ExtendedKey.hx → std/flash8/ExtendedKey.hx


+ 0 - 0
std/flash/Key.hx → std/flash8/Key.hx


+ 0 - 0
std/flash/Lib.hx → std/flash8/Lib.hx


+ 0 - 0
std/flash/LoadVars.hx → std/flash8/LoadVars.hx


+ 0 - 0
std/flash/LocalConnection.hx → std/flash8/LocalConnection.hx


+ 0 - 0
std/flash/Microphone.hx → std/flash8/Microphone.hx


+ 0 - 0
std/flash/Mouse.hx → std/flash8/Mouse.hx


+ 0 - 0
std/flash/MovieClip.hx → std/flash8/MovieClip.hx


+ 0 - 0
std/flash/MovieClipLoader.hx → std/flash8/MovieClipLoader.hx


+ 0 - 0
std/flash/NetConnection.hx → std/flash8/NetConnection.hx


+ 0 - 0
std/flash/NetStream.hx → std/flash8/NetStream.hx


+ 0 - 0
std/flash/PrintJob.hx → std/flash8/PrintJob.hx


+ 0 - 0
std/flash/Selection.hx → std/flash8/Selection.hx


+ 0 - 0
std/flash/SharedObject.hx → std/flash8/SharedObject.hx


+ 0 - 0
std/flash/Sound.hx → std/flash8/Sound.hx


+ 0 - 0
std/flash/Stage.hx → std/flash8/Stage.hx


+ 0 - 0
std/flash/System.hx → std/flash8/System.hx


+ 0 - 0
std/flash/TextField.hx → std/flash8/TextField.hx


+ 0 - 0
std/flash/TextFormat.hx → std/flash8/TextFormat.hx


+ 0 - 0
std/flash/TextSnapshot.hx → std/flash8/TextSnapshot.hx


+ 0 - 0
std/flash/Video.hx → std/flash8/Video.hx


+ 0 - 0
std/flash/XMLRequest.hx → std/flash8/XMLRequest.hx


+ 0 - 0
std/flash/XMLSocket.hx → std/flash8/XMLSocket.hx


+ 0 - 0
std/flash/_std/Hash.hx → std/flash8/_std/Hash.hx


+ 0 - 0
std/flash/_std/IntHash.hx → std/flash8/_std/IntHash.hx


+ 0 - 0
std/flash/_std/Reflect.hx → std/flash8/_std/Reflect.hx


+ 0 - 0
std/flash/_std/Std.hx → std/flash8/_std/Std.hx


+ 0 - 0
std/flash/_std/Type.hx → std/flash8/_std/Type.hx


+ 0 - 0
std/flash/_std/Xml.hx → std/flash8/_std/Xml.hx


+ 0 - 0
std/flash/display/BitmapData.hx → std/flash8/display/BitmapData.hx


+ 0 - 0
std/flash/external/ExternalInterface.hx → std/flash8/external/ExternalInterface.hx


+ 0 - 0
std/flash/filters/BevelFilter.hx → std/flash8/filters/BevelFilter.hx


+ 0 - 0
std/flash/filters/BitmapFilter.hx → std/flash8/filters/BitmapFilter.hx


+ 0 - 0
std/flash/filters/BlurFilter.hx → std/flash8/filters/BlurFilter.hx


+ 0 - 0
std/flash/filters/ColorMatrixFilter.hx → std/flash8/filters/ColorMatrixFilter.hx


+ 0 - 0
std/flash/filters/ConvolutionFilter.hx → std/flash8/filters/ConvolutionFilter.hx


+ 0 - 0
std/flash/filters/DisplacementMapFilter.hx → std/flash8/filters/DisplacementMapFilter.hx


+ 0 - 0
std/flash/filters/DropShadowFilter.hx → std/flash8/filters/DropShadowFilter.hx


+ 0 - 0
std/flash/filters/GlowFilter.hx → std/flash8/filters/GlowFilter.hx


+ 0 - 0
std/flash/filters/GradientBevelFilter.hx → std/flash8/filters/GradientBevelFilter.hx


+ 0 - 0
std/flash/filters/GradientGlowFilter.hx → std/flash8/filters/GradientGlowFilter.hx


+ 0 - 0
std/flash/geom/ColorTransform.hx → std/flash8/geom/ColorTransform.hx


+ 0 - 0
std/flash/geom/Matrix.hx → std/flash8/geom/Matrix.hx


+ 0 - 0
std/flash/geom/Point.hx → std/flash8/geom/Point.hx


+ 0 - 0
std/flash/geom/Rectangle.hx → std/flash8/geom/Rectangle.hx


+ 0 - 0
std/flash/geom/Transform.hx → std/flash8/geom/Transform.hx


+ 0 - 0
std/flash/net/FileReference.hx → std/flash8/net/FileReference.hx


+ 0 - 0
std/flash/net/FileReferenceList.hx → std/flash8/net/FileReferenceList.hx


+ 0 - 0
std/flash/system/Capabilities.hx → std/flash8/system/Capabilities.hx


+ 0 - 0
std/flash/system/IME.hx → std/flash8/system/IME.hx


+ 0 - 0
std/flash/system/Security.hx → std/flash8/system/Security.hx


+ 0 - 0
std/flash/text/StyleSheet.hx → std/flash8/text/StyleSheet.hx


+ 0 - 0
std/flash/text/TextRenderer.hx → std/flash8/text/TextRenderer.hx


+ 5 - 5
typer.ml

@@ -185,7 +185,7 @@ let rec unify_call_params ctx name el args r p inline =
 	let rec loop acc l l2 skip =
 		match l , l2 with
 		| [] , [] ->
-			if not (inline && ctx.g.doinline) && (match ctx.com.platform with Flash | Flash9 | Js -> true | _ -> false) then
+			if not (inline && ctx.g.doinline) && (match ctx.com.platform with Flash8 | Flash | Js -> true | _ -> false) then
 				List.rev (no_opt acc), r
 			else
 				List.rev (List.map fst acc), r
@@ -413,7 +413,7 @@ let field_access ctx mode f t e p =
 				normal()
 		| AccCall m ->
 			if m = ctx.curmethod && (match e.eexpr with TConst TThis -> true | TTypeExpr (TClassDecl c) when c == ctx.curclass -> true | _ -> false) then
-				let prefix = (match ctx.com.platform with Flash9 when Common.defined ctx.com "as3" -> "$" | _ -> "") in
+				let prefix = (match ctx.com.platform with Flash when Common.defined ctx.com "as3" -> "$" | _ -> "") in
 				AKExpr (mk (TField (e,prefix ^ f.cf_name)) t p)
 			else if mode = MSet then
 				AKSet (e,m,t,f.cf_name)
@@ -577,7 +577,7 @@ let rec type_field ctx e i p mode =
 		in
 		(try
 			let t , f = class_field c i in
-			if e.eexpr = TConst TSuper && (match f.cf_kind with Var _ -> true | _ -> false) && Common.platform ctx.com Flash9 then error "Cannot access superclass variable for calling : needs to be a proper method" p;
+			if e.eexpr = TConst TSuper && (match f.cf_kind with Var _ -> true | _ -> false) && Common.platform ctx.com Flash then error "Cannot access superclass variable for calling : needs to be a proper method" p;
 			if not f.cf_public && not (is_parent c ctx.curclass) && not ctx.untyped then display_error ctx ("Cannot access to private field " ^ i) p;
 			field_access ctx mode f (apply_params c.cl_types params t) e p
 		with Not_found -> try
@@ -623,7 +623,7 @@ let rec type_field ctx e i p mode =
 			field_access ctx mode f (field_type f) e p
 		)
 	| TMono r ->
-		if ctx.untyped && (match ctx.com.platform with Flash -> Common.defined ctx.com "swf-mark" | _ -> false) then ctx.com.warning "Mark" p;
+		if ctx.untyped && (match ctx.com.platform with Flash8 -> Common.defined ctx.com "swf-mark" | _ -> false) then ctx.com.warning "Mark" p;
 		let f = {
 			cf_name = i;
 			cf_type = mk_mono();
@@ -2683,7 +2683,7 @@ let rec create com =
 		| TTypeDecl td ->
 			(match snd td.t_path with
 			| "Null" ->
-				let f9 = platform com Flash9 in
+				let f9 = platform com Flash in
 				let cpp = platform com Cpp in
 				ctx.t.tnull <- if not (f9 || cpp) then (fun t -> t) else (fun t -> if is_nullable t then TType (td,[t]) else t);
 			| _ -> ());