Browse Source

allow macros-in-macros in interp mode (use -D interp instead of -D macro), fixed issue #837

Nicolas Cannasse 13 years ago
parent
commit
fbeaaadbe1
4 changed files with 6 additions and 6 deletions
  1. 1 1
      main.ml
  2. 2 2
      std/DateTools.hx
  3. 1 1
      std/neko/_std/Array.hx
  4. 2 2
      tests/unit/Test.hx

+ 1 - 1
main.ml

@@ -895,7 +895,7 @@ try
 			com.package_rules <- PMap.add pack (Remap target) com.package_rules;
 			com.package_rules <- PMap.add pack (Remap target) com.package_rules;
 		),"<package:target> : remap a package to another one");
 		),"<package:target> : remap a package to another one");
 		("--interp", Arg.Unit (fun() ->
 		("--interp", Arg.Unit (fun() ->
-			Common.define com "macro";
+			Common.define com "interp";
 			set_platform Neko "";
 			set_platform Neko "";
 			no_output := true;
 			no_output := true;
 			interp := true;
 			interp := true;

+ 2 - 2
std/DateTools.hx

@@ -32,7 +32,7 @@
 class DateTools {
 class DateTools {
 
 
 	#if php
 	#if php
-	#elseif (neko && !macro)
+	#elseif (neko && !(macro || interp))
 	static var date_format = neko.Lib.load("std","date_format",2);
 	static var date_format = neko.Lib.load("std","date_format",2);
 	#else
 	#else
 	private static function __format_get( d : Date, e : String ) : String {
 	private static function __format_get( d : Date, e : String ) : String {
@@ -114,7 +114,7 @@ class DateTools {
 		formats are not supported.
 		formats are not supported.
 	**/
 	**/
 	public static function format( d : Date, f : String ) : String {
 	public static function format( d : Date, f : String ) : String {
-		#if (neko && !macro)
+		#if (neko && !(macro || interp))
 			return new String(untyped date_format(d.__t, f.__s));
 			return new String(untyped date_format(d.__t, f.__s));
 		#elseif php
 		#elseif php
 			return untyped __call__("strftime",f,d.__t);
 			return untyped __call__("strftime",f,d.__t);

+ 1 - 1
std/neko/_std/Array.hx

@@ -287,7 +287,7 @@
 		return a;
 		return a;
 	}
 	}
 
 
-	#if !macro
+	#if !(macro || interp)
 	static function __init__() : Void {
 	static function __init__() : Void {
 		try {
 		try {
 			var msort : Dynamic = neko.Lib.load("std","merge_sort",3);
 			var msort : Dynamic = neko.Lib.load("std","merge_sort",3);

+ 2 - 2
tests/unit/Test.hx

@@ -195,7 +195,7 @@ package unit;
 			new TestXML(),
 			new TestXML(),
 			new TestMisc(),
 			new TestMisc(),
 			new TestResource(),
 			new TestResource(),
-			new TestInt64(),			
+			new TestInt64(),
 			new TestReflect(),
 			new TestReflect(),
 			new TestSerialize(),
 			new TestSerialize(),
 			new TestMeta(),
 			new TestMeta(),
@@ -211,7 +211,7 @@ package unit;
 		];
 		];
 		var current = null;
 		var current = null;
 		#if (!fail_eager)
 		#if (!fail_eager)
-		try 
+		try
 		#end
 		#end
 		{
 		{
 			asyncWaits.push(null);
 			asyncWaits.push(null);