Changeset 338

Show
Ignore:
Timestamp:
05/03/07 18:22:21 (2 years ago)
Author:
keinfarbton
Message:

tioport can rename methods in the writer, this is for replacing them with a mixed in code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tioport/DModWriter.d

    r309 r338  
    676676            w.write(p.mModifiers.getString()); 
    677677            w.write(p.mReturnType.getString()); 
    678             w.write(p.mName); 
     678 
     679            // probably write another name for the method, 
     680            // this will make it possible to exchange it with a 
     681            // method decl from the mixin 
     682            char[] name = p.mName; 
     683            if( name in p.mModule.mExchangeFuncs ){ 
     684                name = p.mModule.mExchangeFuncs[ name ]; 
     685            } 
     686            w.write(name); 
     687 
    679688            w.write("("); 
    680689            bool first = true; 
  • trunk/tioport/Parts.d

    r324 r338  
    358358    bool         mIsStub; // stubs are not written to D targets. 
    359359    bool         mIsNowrite; // Do not write any output file for this module. 
     360 
     361    char[][ char[] ] mExchangeFuncs; 
    360362 
    361363    public this(){ 
  • trunk/tioport/tioport.d

    r312 r338  
    189189        if (e.hasAttribute("stub") && e.getAttribute("stub") == "true") { 
    190190            mod.mIsStub = true; 
     191        } 
     192 
     193        foreach (Element xch; e.getChilds( "exchange" )) { 
     194            char[] funcname = xch.getAttribute( "funcname" ); 
     195            char[] text     = xch.getAttribute( "text" ); 
     196            mod.mExchangeFuncs[ funcname.dup ] = text.dup; 
    191197        } 
    192198