Changeset 409
- Timestamp:
- 03/06/10 01:31:05 (2 years ago)
- Files:
-
- trunk/src/expression.c (modified) (1 diff)
- trunk/src/expression.h (modified) (1 diff)
- trunk/src/linux.mak (modified) (3 diffs)
- trunk/src/osx.mak (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/expression.c
r408 r409 5542 5542 } 5543 5543 5544 #if DMDV2 5545 int BinAssignExp::isLvalue() 5546 { 5547 return 1; 5548 } 5549 5550 Expression *BinAssignExp::toLvalue(Scope *sc, Expression *ex) 5551 { Expression *e; 5552 5553 if (e1->op == TOKvar) 5554 { 5555 /* Convert (e1 op= e2) to 5556 * e1 op= e2; 5557 * e1 5558 */ 5559 e = e1->copy(); 5560 e = new CommaExp(loc, this, e); 5561 e = e->semantic(sc); 5562 } 5563 else 5564 { 5565 /* Convert (e1 op= e2) to 5566 * ref v = e1; 5567 * v op= e2; 5568 * v 5569 */ 5570 5571 // ref v = e1; 5572 Identifier *id = Lexer::uniqueId("__assignop"); 5573 ExpInitializer *ei = new ExpInitializer(loc, e1); 5574 VarDeclaration *v = new VarDeclaration(loc, e1->type, id, ei); 5575 v->storage_class |= STCref | STCforeach; 5576 Expression *de = new DeclarationExp(loc, v); 5577 5578 // v op= e2 5579 e1 = new VarExp(e1->loc, v); 5580 5581 e = new CommaExp(loc, de, this); 5582 e = new CommaExp(loc, e, new VarExp(loc, v)); 5583 e = e->semantic(sc); 5584 } 5585 return e; 5586 } 5587 5588 Expression *BinAssignExp::modifiableLvalue(Scope *sc, Expression *e) 5589 { 5590 return toLvalue(sc, this); 5591 } 5592 5593 #endif 5594 5544 5595 /************************************************************/ 5545 5596 trunk/src/expression.h
r403 r409 792 792 793 793 Expression *op_overload(Scope *sc); 794 795 int isLvalue(); 796 Expression *toLvalue(Scope *sc, Expression *ex); 797 Expression *modifiableLvalue(Scope *sc, Expression *e); 794 798 }; 795 799 trunk/src/linux.mak
r259 r409 38 38 hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 39 39 builtin.o clone.o aliasthis.o \ 40 man.o arrayop.o port.o response.o async.o json.o \40 man.o arrayop.o port.o response.o async.o json.o speller.o \ 41 41 libelf.o elfobj.o 42 42 … … 81 81 $(ROOT)/gnuc.h $(ROOT)/gnuc.c $(ROOT)/man.c \ 82 82 $(ROOT)/stringtable.h $(ROOT)/stringtable.c \ 83 $(ROOT)/response.c $(ROOT)/async.h $(ROOT)/async.c 83 $(ROOT)/response.c $(ROOT)/async.h $(ROOT)/async.c \ 84 $(ROOT)/speller.h $(ROOT)/speller.c 84 85 85 86 … … 433 434 scope.o: scope.c 434 435 $(CC) -c $(CFLAGS) $< 436 437 speller.o: $(ROOT)/speller.c 438 $(CC) -c $(GFLAGS) -I$(ROOT) $< 435 439 436 440 statement.o: statement.c trunk/src/osx.mak
r275 r409 46 46 hdrgen.o delegatize.o aa.o ti_achar.o toir.o interpret.o traits.o \ 47 47 builtin.o clone.o aliasthis.o \ 48 man.o arrayop.o port.o response.o async.o json.o \48 man.o arrayop.o port.o response.o async.o json.o speller.o \ 49 49 libmach.o machobj.o 50 50 … … 89 89 $(ROOT)/gnuc.h $(ROOT)/gnuc.c $(ROOT)/man.c \ 90 90 $(ROOT)/stringtable.h $(ROOT)/stringtable.c \ 91 $(ROOT)/response.c $(ROOT)/async.h $(ROOT)/async.c 91 $(ROOT)/response.c $(ROOT)/async.h $(ROOT)/async.c \ 92 $(ROOT)/speller.h $(ROOT)/speller.c 92 93 93 94 … … 441 442 scope.o: scope.c 442 443 $(CC) -c $(CFLAGS) $< 444 445 speller.o: $(ROOT)/speller.c 446 $(CC) -c $(GFLAGS) -I$(ROOT) $< 443 447 444 448 statement.o: statement.c
