Browse Source

StringTools.isEOF -> isEof

Simon Krajewski 12 years ago
parent
commit
d51fe7a10c

+ 2 - 2
std/haxe/Json.hx

@@ -154,7 +154,7 @@ class Json {
 		var i = 0;
 		var i = 0;
 		while( true ) {
 		while( true ) {
 			var c = StringTools.fastCodeAt(s,i++);
 			var c = StringTools.fastCodeAt(s,i++);
-			if( StringTools.isEOF(c) ) break;
+			if( StringTools.isEof(c) ) break;
 			switch( c ) {
 			switch( c ) {
 			case '"'.code: add('\\"');
 			case '"'.code: add('\\"');
 			case '\\'.code: add('\\\\');
 			case '\\'.code: add('\\\\');
@@ -340,7 +340,7 @@ class Json {
 				else if( c >= 0xE0 ) pos++;
 				else if( c >= 0xE0 ) pos++;
 			}
 			}
 			#end
 			#end
-			else if( StringTools.isEOF(c) )
+			else if( StringTools.isEof(c) )
 				throw "Unclosed string";
 				throw "Unclosed string";
 		}
 		}
 		buf.addSub(str,start, pos - start - 1);
 		buf.addSub(str,start, pos - start - 1);

+ 1 - 1
std/haxe/Unserializer.hx

@@ -99,7 +99,7 @@ class Unserializer {
  		var fpos = pos;
  		var fpos = pos;
  		while( true ) {
  		while( true ) {
  			var c = get(pos);
  			var c = get(pos);
-			if( StringTools.isEOF(c) )
+			if( StringTools.isEof(c) )
 				break;
 				break;
  			if( c == "-".code ) {
  			if( c == "-".code ) {
  				if( pos != fpos )
  				if( pos != fpos )

+ 1 - 1
std/haxe/xml/Parser.hx

@@ -65,7 +65,7 @@ class Parser
 		var nbrackets = 0;
 		var nbrackets = 0;
 		var c = str.fastCodeAt(p);
 		var c = str.fastCodeAt(p);
 
 
-		while (!c.isEOF())
+		while (!c.isEof())
 		{
 		{
 			switch(state)
 			switch(state)
 			{
 			{

+ 1 - 1
std/php/_std/StringTools.hx

@@ -88,7 +88,7 @@
 		return untyped s.cca(index);
 		return untyped s.cca(index);
 	}
 	}
 
 
-	public static inline function isEOF( c : Int ) : Bool {
+	public static inline function isEof( c : Int ) : Bool {
 		return untyped __physeq__(c, 0);
 		return untyped __physeq__(c, 0);
 	}
 	}
 
 

+ 23 - 0
tests/unit/TestSpecification.hx

@@ -1,5 +1,28 @@
 package unit;
 package unit;
 
 
+typedef T = {
+	function func():Void;
+	var v:String;
+	public var prop(default, null):String;
+}
+
+@:keep class C {
+	public function func() { }
+	public var v:String;
+	public var prop(default, null):String;
+	
+	static function staticFunc() { }
+	static var staticVar:String;
+	static var staticProp(default, null):String;
+	
+	public function new() {
+		v = "var";
+		prop = "prop";
+		staticVar = "staticVar";
+		staticProp = "staticProp";
+	}
+}
+
 private class EmptyClass {
 private class EmptyClass {
 	public function new() { }
 	public function new() { }
 }
 }

+ 3 - 3
tests/unit/TestStringTools.hx

@@ -22,10 +22,10 @@ class TestStringTools extends Test
 		eq( StringTools.fastCodeAt(str, 2), "c".code );
 		eq( StringTools.fastCodeAt(str, 2), "c".code );
 		eq(StringTools.fastCodeAt(String.fromCharCode(128), 0), 128);
 		eq(StringTools.fastCodeAt(String.fromCharCode(128), 0), 128);
 		eq(StringTools.fastCodeAt(String.fromCharCode(255), 0), 255);
 		eq(StringTools.fastCodeAt(String.fromCharCode(255), 0), 255);
-		f( StringTools.isEOF(StringTools.fastCodeAt(str, 2)) );
-		t( StringTools.isEOF(StringTools.fastCodeAt(str, 3)) );
+		f( StringTools.isEof(StringTools.fastCodeAt(str, 2)) );
+		t( StringTools.isEof(StringTools.fastCodeAt(str, 3)) );
 		
 		
-		t( StringTools.isEOF(StringTools.fastCodeAt("", 0)) );
+		t( StringTools.isEof(StringTools.fastCodeAt("", 0)) );
 	}
 	}
 		
 		
 	
 	

+ 3 - 3
tests/unit/unitstd/StringTools.unit.hx

@@ -118,11 +118,11 @@ StringTools.fastCodeAt(s, 6) == 114;
 
 
 // isEOF
 // isEOF
 #if neko
 #if neko
-StringTools.isEOF(null) == true;
+StringTools.isEof(null) == true;
 #elseif (cs || java)
 #elseif (cs || java)
-StringTools.isEOF( -1) == true;
+StringTools.isEof( -1) == true;
 #elseif js
 #elseif js
 // how do I test this here?
 // how do I test this here?
 #else
 #else
-StringTools.isEOF(0) == true;
+StringTools.isEof(0) == true;
 #end
 #end