Changeset 212

Show
Ignore:
Timestamp:
07/06/06 16:33:03 (2 years ago)
Author:
Don Clugston
Message:

More refactoring of demangle. There's still a latent bug in how it deals with embedded D names; but it still works for all cases that I know of.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/meta/demangle.d

    r211 r212  
    181181        const char [] pretty_Dfunction =  
    182182            demangleFunctionOrDelegate!(str[2 + dotnameconsumed .. 3 + dotnameconsumed + paramlistconsumed], 
    183                 getQualifiedName!(str[2..$], wantQualifiedNames), wantQualifiedNames) 
     183                getQualifiedName!(str[2..2+dotnameconsumed], wantQualifiedNames), wantQualifiedNames) 
     184                // BUG: This shouldn't be necessary, the string length is wrong somewhere 
    184185            ~ getQualifiedName!(str[3 + dotnameconsumed + paramlistconsumed .. $], wantQualifiedNames, "."); 
    185186    } else static if (wantQualifiedNames == MangledNameType.QualifiedName) { 
    186187        // Qualified name     
    187         const char [] pretty_Dfunction = getQualifiedName!(str[2..$], wantQualifiedNames) 
     188        const char [] pretty_Dfunction = getQualifiedName!(str[2..2+dotnameconsumed], wantQualifiedNames) 
    188189            ~ getQualifiedName!(str[3 + dotnameconsumed + paramlistconsumed .. $], wantQualifiedNames, "."); 
    189     } else { // symbol name 
     190    } else { // symbol name 
    190191        static if (3 + dotnameconsumed + paramlistconsumed == str.length) 
    191             const char [] pretty_Dfunction = getQualifiedName!(str[2..$], wantQualifiedNames); 
     192            const char [] pretty_Dfunction = getQualifiedName!(str[2..2+dotnameconsumed], wantQualifiedNames); 
    192193        else const char [] pretty_Dfunction = getQualifiedName!( 
    193194            str[3 + dotnameconsumed + paramlistconsumed .. $], wantQualifiedNames); 
     
    201202        + demangleTypeConsumed!(str[2+getQualifedNameConsumed!(str[2..$])..$]); 
    202203} 
    203  
    204204 
    205205// If Lname is a template, shows it as a template 
     
    240240{ 
    241241    static if (str.length==0) const char [] getQualifiedName=""; 
    242     else static if (str.length>2 && str[0]=='_' && str[1]=='D') 
    243         const char [] getDotName = getQualifiedName!(str[2..$], wantQualifiedNames); 
     242//    else static if (str.length>2 && str[0]=='_' && str[1]=='D') 
     243//        const char [] getDotName = getQualifiedName!(str[2..$], wantQualifiedNames); 
    244244    else { 
    245245        static assert (isdigit!(( str[0] ))); 
     
    270270            const int getQualifiedNameConsumed = getLnameConsumed!(str); 
    271271        } 
    272     } else static if (str.length>1 && str[0]=='_' && str[1]=='D') { 
     272    } /*else static if (str.length>1 && str[0]=='_' && str[1]=='D') { 
    273273        const int getQualifiedNameConsumed = get_DnameConsumed!(str) 
    274             + getQualifiedNameConsumed!(str[get_DnameConsumed!(str)..$]); 
    275     } else static assert(0); 
     274            + getQualifiedNameConsumed!(str[1+get_DnameConsumed!(str)..$]); 
     275    }*/ else static assert(0); 
    276276} 
    277277 
     
    475475static assert( demangleType!((ComplexTemplate!(1.23, 4.56+3.2i)).mangleof) == "class " ~ THISFILE ~ ".ComplexTemplate!(double = 0xa4703d0ad7a3709dff3f, cdouble = 0x85eb51b81e85eb910140c + 0xcdcccccccccccccc0040i).ComplexTemplate"); 
    476476 
    477 //static assert( (ComplexTemplate!(1.23, 4.56+3.2i)).mangleof == (WinFunc).mangleof); 
    478  
    479 
    480 
     477
     478