comparison dmd/Expression.d @ 109:ceda59b4d255

expression.c changes, now only ddoc should be left
author Trass3r
date Tue, 31 Aug 2010 22:08:52 +0200
parents ae5b11064a9a
children e28b18c23469
comparison
equal deleted inserted replaced
108:6da99741178e 109:ceda59b4d255
133 { 133 {
134 Type t = e.type.toBasetype(); 134 Type t = e.type.toBasetype();
135 135
136 if (t.ty == TY.Tfunction || e.op == TOK.TOKoverloadset) 136 if (t.ty == TY.Tfunction || e.op == TOK.TOKoverloadset)
137 { 137 {
138 static if(false)
139 {
140 if (t.ty == Tfunction && !(cast(TypeFunction)t).isproperty)
141 error(e.loc, "not a property %s\n", e.toChars());
142 }
138 e = new CallExp(e.loc, e); 143 e = new CallExp(e.loc, e);
139 e = e.semantic(sc); 144 e = e.semantic(sc);
140 } 145 }
141 146
142 /* Look for e being a lazy parameter; rewrite as delegate call 147 /* Look for e being a lazy parameter; rewrite as delegate call
735 return this; 740 return this;
736 } 741 }
737 742
738 Expression checkToPointer() 743 Expression checkToPointer()
739 { 744 {
740 Expression e; 745 //writef("Expression::checkToPointer()\n");
741 Type tb; 746 Expression e = this;
742 747
743 //printf("Expression::checkToPointer()\n"); 748 version(SARRAYVALUE) {} else
744 e = this; 749 {
745
746 // If C static array, convert to pointer 750 // If C static array, convert to pointer
747 tb = type.toBasetype(); 751 Type tb = type.toBasetype();
748 if (tb.ty == Tsarray) 752 if (tb.ty == Tsarray)
749 { 753 {
750 TypeSArray ts = cast(TypeSArray)tb; 754 TypeSArray ts = cast(TypeSArray)tb;
751 if (ts.size(loc) == 0) 755 if (ts.size(loc) == 0)
752 e = new NullExp(loc); 756 e = new NullExp(loc);
753 else 757 else
754 e = new AddrExp(loc, this); 758 e = new AddrExp(loc, this);
755 e.type = ts.next.pointerTo(); 759 e.type = ts.next.pointerTo();
756 } 760 }
761 }
757 return e; 762 return e;
758 } 763 }
759 764
760 Expression addressOf(Scope sc) 765 Expression addressOf(Scope sc)
761 { 766 {