mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-08-03 04:50:05 +02:00
Merge the 2.063 frontend.
This commit is contained in:
17
dmd2/apply.c
17
dmd2/apply.c
@@ -36,12 +36,7 @@ int Expression::apply(fp_t fp, void *param)
|
||||
/******************************
|
||||
* Perform apply() on an t if not null
|
||||
*/
|
||||
template<typename T>
|
||||
int condApply(T* t, fp_t fp, void* param)
|
||||
{
|
||||
return t ? t->apply(fp, param) : 0;
|
||||
}
|
||||
|
||||
#define condApply(t, fp, param) (t ? t->apply(fp, param) : 0)
|
||||
|
||||
int NewExp::apply(int (*fp)(Expression *, void *), void *param)
|
||||
{
|
||||
@@ -129,14 +124,20 @@ int AssocArrayLiteralExp::apply(fp_t fp, void *param)
|
||||
|
||||
int StructLiteralExp::apply(fp_t fp, void *param)
|
||||
{
|
||||
return condApply(elements, fp, param) ||
|
||||
if(stageflags & stageApply) return 0;
|
||||
int old = stageflags;
|
||||
stageflags |= stageApply;
|
||||
int ret = condApply(elements, fp, param) ||
|
||||
(*fp)(this, param);
|
||||
stageflags = old;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int TupleExp::apply(fp_t fp, void *param)
|
||||
{
|
||||
return condApply(exps, fp, param) ||
|
||||
return (e0 ? (*fp)(e0, param) : 0) ||
|
||||
condApply(exps, fp, param) ||
|
||||
(*fp)(this, param);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user