# HG changeset patch # User Aziz K?ksal # Date 1201010352 -3600 # Node ID 8e38774d562b085e21779e825a520fbdc31942b3 # Parent 839c0c61af2b456c13aadef29e0998f16d9e20ef Added some methods to ArrayType. diff -r 839c0c61af2b -r 8e38774d562b trunk/src/dil/ast/DefaultVisitor.d --- a/trunk/src/dil/ast/DefaultVisitor.d Tue Jan 22 14:37:46 2008 +0100 +++ b/trunk/src/dil/ast/DefaultVisitor.d Tue Jan 22 14:59:12 2008 +0100 @@ -303,8 +303,8 @@ visitT(t.next); if (t.assocType) visitT(t.assocType); - else if (t.e) - visitE(t.e), t.e2 && visitE(t.e2); + else if (t.e1) + visitE(t.e1), t.e2 && visitE(t.e2); } static if (is(T == FunctionType) || is(T == DelegateType)) visitT(t.returnType), visitN(t.params); diff -r 839c0c61af2b -r 8e38774d562b trunk/src/dil/ast/Types.d --- a/trunk/src/dil/ast/Types.d Tue Jan 22 14:37:46 2008 +0100 +++ b/trunk/src/dil/ast/Types.d Tue Jan 22 14:59:12 2008 +0100 @@ -138,7 +138,7 @@ /// Associative array: T[T] class ArrayType : TypeNode { - Expression e, e2; + Expression e1, e2; TypeNode assocType; this(TypeNode t) @@ -147,12 +147,12 @@ mixin(set_kind); } - this(TypeNode t, Expression e, Expression e2) + this(TypeNode t, Expression e1, Expression e2) { this(t); - addChild(e); + addChild(e1); addOptChild(e2); - this.e = e; + this.e1 = e1; this.e2 = e2; } @@ -162,6 +162,26 @@ addChild(assocType); this.assocType = assocType; } + + bool isDynamic() + { + return !assocType && !e1; + } + + bool isStatic() + { + return e1 && !e2; + } + + bool isSlice() + { + return e1 && e2; + } + + bool isAssociative() + { + return assocType !is null; + } } /// ReturnType "function" "(" Parameters? ")" diff -r 839c0c61af2b -r 8e38774d562b trunk/src/dil/translator/German.d --- a/trunk/src/dil/translator/German.d Tue Jan 22 14:37:46 2008 +0100 +++ b/trunk/src/dil/translator/German.d Tue Jan 22 14:59:12 2008 +0100 @@ -289,7 +289,7 @@ if (n.assocType) put.format("assoziative{} Array{} von ", c1, c2); // visitT(n.assocType); - else if (n.e) + else if (n.e1) { if (n.e2) put.format("gescheibte{} Array{} von ", c1, c2);