فهرست منبع

[typer] remove obsolete `-D format-warning` support

Jens Fischer 6 سال پیش
والد
کامیت
b37068d26c
2فایلهای تغییر یافته به همراه0 افزوده شده و 9 حذف شده
  1. 0 2
      src/core/define.ml
  2. 0 7
      src/typing/typer.ml

+ 0 - 2
src/core/define.ml

@@ -39,7 +39,6 @@ type strict_defined =
 	| FlashUseStage
 	| ForceLibCheck
 	| ForceNativeProperty
-	| FormatWarning
 	| GencommonDebug
 	| Haxe3Compat
 	| HaxeBoot
@@ -152,7 +151,6 @@ let infos = function
 	(* force_lib_check is only here as a debug facility - compiler checking allows errors to be found more easily *)
 	| ForceLibCheck -> "force_lib_check",("Force the compiler to check -net-lib and -java-lib added classes (internal)",[Platforms [Cs;Java]])
 	| ForceNativeProperty -> "force_native_property",("Tag all properties with :nativeProperty metadata for 3.1 compatibility",[Platform Cpp])
-	| FormatWarning -> "format_warning",("Print a warning for each formatted string, for 2.x compatibility",[])
 	| GencommonDebug -> "gencommon_debug",("GenCommon internal",[Platforms [Cs;Java]])
 	| Haxe3Compat -> "haxe3compat", ("Gives warnings about transition from Haxe 3.x to Haxe 4.0",[])
 	| HaxeBoot -> "haxe_boot",("Given the name 'haxe' to the flash boot class instead of a generated name",[Platform Flash])

+ 0 - 7
src/typing/typer.ml

@@ -1475,10 +1475,6 @@ and format_string ctx s p =
 		let len = pos - start in
 		if len > 0 || !e = None then add (EConst (String (String.sub s start len))) len
 	in
-	let warn_escape = Common.defined ctx.com Define.FormatWarning in
-	let warn pos len =
-		ctx.com.warning "This string is formatted" { p with pmin = !pmin + 1 + pos; pmax = !pmin + 1 + pos + len }
-	in
 	let len = String.length s in
 	let rec parse start pos =
 		if pos = len then add_sub start pos else
@@ -1491,7 +1487,6 @@ and format_string ctx s p =
 		if c <> '$' || pos = len then parse start pos else
 		match String.unsafe_get s pos with
 		| '$' ->
-			if warn_escape then warn pos 1;
 			(* double $ *)
 			add_sub start pos;
 			parse (pos + 1) (pos + 1)
@@ -1509,7 +1504,6 @@ and format_string ctx s p =
 			in
 			let iend = loop (pos + 1) in
 			let len = iend - pos in
-			if warn_escape then warn pos len;
 			add (EConst (Ident (String.sub s pos len))) len;
 			parse (pos + len) (pos + len)
 		| _ ->
@@ -1535,7 +1529,6 @@ and format_string ctx s p =
 		let send = loop [pos] (pos + 1) in
 		let slen = send - pos - 1 in
 		let scode = String.sub s (pos + 1) slen in
-		if warn_escape then warn (pos + 1) slen;
 		min := !min + 2;
 		if slen > 0 then begin
 			let e =