Skip to content

Commit

Permalink
Hash -> haxe.ds.StringMap
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Feb 3, 2013
1 parent 09d379c commit 3348f99
Show file tree
Hide file tree
Showing 59 changed files with 693 additions and 193 deletions.
2 changes: 1 addition & 1 deletion interp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3438,7 +3438,7 @@ let enc_array l =
]

let enc_string s =
enc_inst ["String"] [
enc_inst ["haxe";"ds";"String"] [
"__s", VString s;
"length", VInt (String.length s)
]
Expand Down
2 changes: 1 addition & 1 deletion parser.ml
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ and parse_type_decl s =
d_flags = flags @ sl;
d_data = fl;
},punion p1 p2)

and parse_class meta cflags need_name s =
let opt_name = if need_name then type_name else (fun s -> match popt type_name s with None -> "" | Some n -> n) in
match s with parser
Expand Down
6 changes: 3 additions & 3 deletions std/Map.hx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ typedef IMap < K, V > = {
abstract Map(IMap < K, V > )<K,V> {
public function new();

@:to static inline function toHash(t:IMap < String, V > ):Hash<V> {
return new Hash<V>();
@:to static inline function toHash(t:IMap < String, V > ):haxe.ds.StringMap<V> {
return new haxe.ds.StringMap<V>();
}

@:to static inline function toIntHash(t:IMap < Int, V > ):haxe.ds.IntMap<V> {
return new haxe.ds.IntMap<V>();
}

@:to static inline function toHashMap<K:{ function hashCode():Int; }>(t:IMap < K, V >):haxe.ds.HashMap<K,V> {
return new haxe.ds.HashMap<K, V>();
}
Expand Down
2 changes: 1 addition & 1 deletion std/Sys.hx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ extern class Sys {
/**
Returns the whole environement variables.
**/
static function environment() : Hash<String>;
static function environment() : haxe.ds.StringMap<String>;

/**
Suspend the current execution for the given time (in seconds).
Expand Down
4 changes: 2 additions & 2 deletions std/cpp/_std/Sys.hx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@
return new String(sys_exe_path());
}

public static function environment() : Hash<String> {
public static function environment() : haxe.ds.StringMap<String> {
var vars:Array<String> = sys_env();
var result = new Hash<String>();
var result = new haxe.ds.StringMap<String>();
var i = 0;
while(i<vars.length) {
result.set( vars[i], vars[i+1] );
Expand Down
4 changes: 3 additions & 1 deletion std/cpp/_std/Hash.hx → std/cpp/_std/haxe/ds/StringMap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
@:coreApi class Hash<T> {
package haxe.ds;

@:coreApi class StringMap<T> {
private var __Internal : Dynamic;

public function new() : Void {
Expand Down
2 changes: 1 addition & 1 deletion std/cs/_std/Hash.hx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import cs.NativeArray;
* DAMAGE.
*/

@:coreApi class Hash<T>
@:coreApi class StringMap<T>
{
@:extern private static inline var HASH_UPPER = 0.77;
@:extern private static inline var FLAG_EMPTY = 0;
Expand Down
6 changes: 3 additions & 3 deletions std/cs/_std/Sys.hx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import cs.system.threading.Thread;
**/
@:coreApi
class Sys {
private static var _env:Hash<String>;
private static var _env:haxe.ds.StringMap<String>;
private static var _args:Array<String>;

/**
Expand Down Expand Up @@ -106,11 +106,11 @@ class Sys {
/**
Returns the whole environement variables.
**/
public static function environment() : Hash<String>
public static function environment() : haxe.ds.StringMap<String>
{
if (_env == null)
{
var e = _env = new Hash();
var e = _env = new haxe.ds.StringMap();
var nenv = Environment.GetEnvironmentVariables().GetEnumerator();
while (nenv.MoveNext())
{
Expand Down
4 changes: 2 additions & 2 deletions std/cs/_std/Xml.hx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private enum RealXmlType {

var _nodeName : String;
var _nodeValue : String;
var _attributes : Hash<String>;
var _attributes : haxe.ds.StringMap<String>;
var _children : Array<Xml>;
var _parent : Xml;

Expand All @@ -65,7 +65,7 @@ private enum RealXmlType {
var r = new Xml();
r.nodeType = Xml.Element;
r._children = new Array();
r._attributes = new Hash();
r._attributes = new haxe.ds.StringMap();
r.set_nodeName( name );
return r;
}
Expand Down
Loading

0 comments on commit 3348f99

Please sign in to comment.