@@ -451,15 +451,7 @@ extern (C++) abstract class Expression : ASTNode
451451 inout (IdentityExp) isIdentityExp () { return (op == EXP .identity || op == EXP .notIdentity) ? cast (typeof (return ))this : null ; }
452452 inout (CondExp) isCondExp () { return op == EXP .question ? cast (typeof (return ))this : null ; }
453453 inout (GenericExp) isGenericExp () { return op == EXP ._Generic ? cast (typeof (return ))this : null ; }
454- inout (DefaultInitExp) isDefaultInitExp () { return
455- (op == EXP .prettyFunction || op == EXP .functionString ||
456- op == EXP .line || op == EXP .moduleString ||
457- op == EXP .file || op == EXP .fileFullPath ) ? cast (typeof (return ))this : null ; }
458- inout (FileInitExp) isFileInitExp () { return (op == EXP .file || op == EXP .fileFullPath) ? cast (typeof (return ))this : null ; }
459- inout (LineInitExp) isLineInitExp () { return op == EXP .line ? cast (typeof (return ))this : null ; }
460- inout (ModuleInitExp) isModuleInitExp () { return op == EXP .moduleString ? cast (typeof (return ))this : null ; }
461- inout (FuncInitExp) isFuncInitExp () { return op == EXP .functionString ? cast (typeof (return ))this : null ; }
462- inout (PrettyFuncInitExp) isPrettyFuncInitExp () { return op == EXP .prettyFunction ? cast (typeof (return ))this : null ; }
454+ inout (DefaultInitExp) isDefaultInitExp () { return op == EXP .defaultInit ? cast (typeof (return ))this : null ; }
463455 inout (ObjcClassReferenceExp) isObjcClassReferenceExp () { return op == EXP .objcClassReference ? cast (typeof (return ))this : null ; }
464456 inout (ClassReferenceExp) isClassReferenceExp () { return op == EXP .classReference ? cast (typeof (return ))this : null ; }
465457 inout (ThrownExceptionExp) isThrownExceptionExp () { return op == EXP .thrownException ? cast (typeof (return ))this : null ; }
@@ -3791,120 +3783,12 @@ extern (C++) final class CondExp : BinExp
37913783 */
37923784extern (C++ ) class DefaultInitExp : Expression
37933785{
3794- /* ************************
3795- * Params:
3796- * loc = location
3797- * op = EXP.prettyFunction, EXP.functionString, EXP.moduleString,
3798- * EXP.line, EXP.file, EXP.fileFullPath
3799- */
3800- extern (D ) this (Loc loc, EXP op) @safe
3801- {
3802- super (loc, op);
3803- }
3804-
3805- override void accept (Visitor v)
3806- {
3807- v.visit(this );
3808- }
3809-
3810- override Expression syntaxCopy ()
3811- {
3812- return new DefaultInitExp(loc, op);
3813- }
3814- }
3815-
3816- /* **********************************************************
3817- * The `__FILE__` token as a default argument
3818- */
3819- extern (C++ ) final class FileInitExp : DefaultInitExp
3820- {
3821- extern (D ) this (Loc loc, EXP tok) @safe
3822- {
3823- super (loc, tok);
3824- }
3825-
3826- override void accept (Visitor v)
3827- {
3828- v.visit(this );
3829- }
3830-
3831- override Expression syntaxCopy ()
3832- {
3833- return new FileInitExp(loc, op);
3834- }
3835- }
3836-
3837- /* **********************************************************
3838- * The `__LINE__` token as a default argument
3839- */
3840- extern (C++ ) final class LineInitExp : DefaultInitExp
3841- {
3842- extern (D ) this (Loc loc) @safe
3843- {
3844- super (loc, EXP .line);
3845- }
3846-
3847- override void accept (Visitor v)
3848- {
3849- v.visit(this );
3850- }
3786+ TOK tok; // / which special token this is
38513787
3852- override Expression syntaxCopy ()
3853- {
3854- return new LineInitExp(loc);
3855- }
3856- }
3857-
3858- /* **********************************************************
3859- * The `__MODULE__` token as a default argument
3860- */
3861- extern (C++ ) final class ModuleInitExp : DefaultInitExp
3862- {
3863- extern (D ) this (Loc loc) @safe
3864- {
3865- super (loc, EXP .moduleString);
3866- }
3867-
3868- override void accept (Visitor v)
3869- {
3870- v.visit(this );
3871- }
3872-
3873- override Expression syntaxCopy ()
3874- {
3875- return new ModuleInitExp(loc);
3876- }
3877- }
3878-
3879- /* **********************************************************
3880- * The `__FUNCTION__` token as a default argument
3881- */
3882- extern (C++ ) final class FuncInitExp : DefaultInitExp
3883- {
3884- extern (D ) this (Loc loc) @safe
3885- {
3886- super (loc, EXP .functionString);
3887- }
3888-
3889- override void accept (Visitor v)
3890- {
3891- v.visit(this );
3892- }
3893-
3894- override Expression syntaxCopy ()
3788+ extern (D ) this (Loc loc, TOK tok) @safe
38953789 {
3896- return new FuncInitExp(loc);
3897- }
3898- }
3899-
3900- /* **********************************************************
3901- * The `__PRETTY_FUNCTION__` token as a default argument
3902- */
3903- extern (C++ ) final class PrettyFuncInitExp : DefaultInitExp
3904- {
3905- extern (D ) this (Loc loc) @safe
3906- {
3907- super (loc, EXP .prettyFunction);
3790+ super (loc, EXP .defaultInit);
3791+ this .tok = tok;
39083792 }
39093793
39103794 override void accept (Visitor v)
@@ -3914,7 +3798,7 @@ extern (C++) final class PrettyFuncInitExp : DefaultInitExp
39143798
39153799 override Expression syntaxCopy ()
39163800 {
3917- return new PrettyFuncInitExp (loc);
3801+ return new DefaultInitExp (loc, tok );
39183802 }
39193803}
39203804
@@ -4251,12 +4135,7 @@ private immutable ubyte[EXP.max+1] expSize = [
42514135 EXP .scope_: __traits (classInstanceSize, ScopeExp),
42524136 EXP .traits: __traits (classInstanceSize, TraitsExp),
42534137 EXP .overloadSet: __traits (classInstanceSize, OverExp),
4254- EXP .line: __traits (classInstanceSize, LineInitExp),
4255- EXP .file: __traits (classInstanceSize, FileInitExp),
4256- EXP .fileFullPath: __traits (classInstanceSize, FileInitExp),
4257- EXP .moduleString: __traits (classInstanceSize, ModuleInitExp),
4258- EXP .functionString: __traits (classInstanceSize, FuncInitExp),
4259- EXP .prettyFunction: __traits (classInstanceSize, PrettyFuncInitExp),
4138+ EXP .defaultInit: __traits (classInstanceSize, DefaultInitExp),
42604139 EXP .pow: __traits (classInstanceSize, PowExp),
42614140 EXP .powAssign: __traits (classInstanceSize, PowAssignExp),
42624141 EXP .vector: __traits (classInstanceSize, VectorExp),
0 commit comments