Changeset 233

Show
Ignore:
Timestamp:
04/07/08 13:22:18 (4 years ago)
Author:
Kuan Hsu
Message:

Add TemplateMixin?, now autocompletion can import it.
Add autocomplete list show return type.
Add with(){} autocompletion.
Move *.ana to tools dir.
fixed bugs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/current/poseidon/CodeAnalyzer/syntax/baseExpressions.d

    r223 r233  
    9696        else 
    9797        { 
    98             if( activeNode.DType & D_WITH ) 
     98            // Kuan Hsu 
     99            if( activeNode.DType & D_BLOCK ) 
    99100            { 
    100                 if( tokenText.length > 2 ) 
    101                     if( tokenText[length-3..length] == "new" ) tokenText = tokenText[0..length-3]; 
     101                if( activeNode.baseClass == "with" ) 
     102                    tokenText = tokenText ~ " "; 
     103                else 
     104                    tokenText = ""; 
    102105            } 
    103106            else 
  • trunk/current/poseidon/CodeAnalyzer/syntax/decldefs.d

    r213 r233  
    219219    { 
    220220        parseTerminal( TOK.Tinvariant ); 
     221        if( ts.next( TOK.Openparen, TOK.Closeparen ) ) 
     222        { 
     223            parseTerminal( TOK.Openparen ); 
     224            parseTerminal( TOK.Closeparen ); 
     225        } 
    221226        activeNode = activeNode.addLeaf( globalProt, D_INVARIANT, "invariant", null, ts.peek().lineNumber ); // Kuan Hsu 
    222227        parseR!(FunctionBody); 
  • trunk/current/poseidon/CodeAnalyzer/syntax/nodeHsu.d

    r232 r233  
    2525const int D_UNITTEST = 512; 
    2626const int D_VARIABLE = 1024;        //* 
    27 const int D_WITH = 2048;          //* 
     27const int D_ANONYMOUSBLOCK = 2048;    //* 
    2828const int D_UNION = 4096;           //* 
    2929const int D_INTERFACE = 8192;       //* 
     
    6565 
    6666const int D_ALL = 0  | D_CLASS | D_STRUCT | D_ENUM | D_ENUMMEMBER | D_ALIAS | D_TYPEDEF | D_CONDITIONSPEC | D_FUNLITERALS |  
    67           D_UNITTEST | D_VARIABLE | D_WITH | D_UNION | D_INTERFACE | D_INVARIANT | D_VERSION | D_DEBUG | 
     67          D_UNITTEST | D_VARIABLE | D_ANONYMOUSBLOCK | D_UNION | D_INTERFACE | D_INVARIANT | D_VERSION | D_DEBUG | 
    6868          D_PARAMETER | D_PRAGMA | D_CTOR | D_DTOR | D_STATICCTOR | D_STATICDTOR | D_FUNCTION | D_TEMPLATE | 
    6969          D_IMPORT | D_MIXIN | D_UNKNOWN | D_MODULE | D_MAINROOT | D_BLOCK; 
     
    8989        case D_UNITTEST : return "D_UNITTEST"; 
    9090        case D_VARIABLE : return "D_VARIABLE"; 
    91         case D_WITH : return "D_WITH"; 
     91        case D_ANONYMOUSBLOCK : return "D_ANONYMOUSBLOCK"; 
    9292        case D_UNION : return "D_UNION"; 
    9393        case D_INTERFACE : return "D_INTERFACE"; 
  • trunk/current/poseidon/CodeAnalyzer/syntax/statements.d

    r222 r233  
    9090        parseTerminal( TOK.Tif ); 
    9191 
    92         activeNode = activeNode.addLeaf( 0, D_BLOCK, "if", "if", ts.peek().lineNumber ); // Kuan Hsu 
     92        activeNode = activeNode.addLeaf( 0, D_BLOCK, "if", "if", ts.peek().lineNumber, null, "if" ); // Kuan Hsu 
    9393 
    9494        parseTerminal( TOK.Openparen ); 
     
    112112            { 
    113113                activeNode = activeNode.getRoot(); // Kuan Hsu 
    114                 activeNode = activeNode.addLeaf( 0, D_BLOCK, "else", "else", ts.peek().lineNumber ); // Kuan Hsu 
     114                activeNode = activeNode.addLeaf( 0, D_BLOCK, "else", "else", ts.peek().lineNumber, null, "else" ); // Kuan Hsu 
    115115                parseR!(Statement); 
    116116                activeNode = activeNode.getRoot(); // Kuan Hsu 
     
    225225    public void parse() 
    226226    { 
     227        bool    bAnonymous; 
     228        int     prevAttribute = globalProt; // Kuan Hsu 
     229 
     230        TOK t = ts.peektype( 0 ); 
     231 
     232        if( t != TOK.Closeparen && t != TOK.Tdo && t != TOK.Telse && t != TOK.Ttry && t != TOK.Tcatch &&  
     233            t != TOK.Tfinally && t != TOK.Tunittest && t != TOK.Tin && t != TOK.Tout && t != TOK.Tbody ) 
     234        { 
     235            bAnonymous = true; 
     236            globalProt = D_Private; 
     237            activeNode = activeNode.addLeaf( globalProt, D_ANONYMOUSBLOCK, null, null, ts.peek().lineNumber ); 
     238        } 
     239         
    227240        parseTerminal( TOK.Opencurly ); 
    228241        if( !ts.next( TOK.Closecurly ) ) 
     
    231244        } 
    232245        parseTerminal( TOK.Closecurly ); 
     246 
     247        if( bAnonymous ) 
     248        { 
     249            globalProt = prevAttribute; 
     250            activeNode = activeNode.getRoot(); 
     251        } 
    233252    } 
    234253} 
     
    248267        parseTerminal( TOK.Tdo ); 
    249268 
    250         activeNode = activeNode.addLeaf( 0, D_BLOCK, "do", "do", ts.peek().lineNumber ); // Kuan Hsu 
     269        activeNode = activeNode.addLeaf( 0, D_BLOCK, "do", "do", ts.peek().lineNumber, null, "do" ); // Kuan Hsu 
    251270        parseR!(Statement); 
    252271        activeNode = activeNode.getRoot(); // Kuan Hsu 
     
    276295        parseTerminal( TOK.Closeparen ); 
    277296 
    278         activeNode = activeNode.addLeaf( 0, D_BLOCK, "while", "while", ts.peek().lineNumber ); // Kuan Hsu 
     297        activeNode = activeNode.addLeaf( 0, D_BLOCK, "while", "while", ts.peek().lineNumber, null, "while" ); // Kuan Hsu 
    279298        parseR!(Statement); 
    280299        activeNode = activeNode.getRoot(); // Kuan Hsu 
     
    313332        parseTerminal( TOK.Tfor ); 
    314333        parseTerminal( TOK.Openparen ); 
    315         activeNode = activeNode.addLeaf( 0, D_BLOCK, "for", "for", ts.peek().lineNumber ); // Kuan Hsu 
     334        activeNode = activeNode.addLeaf( 0, D_BLOCK, "for", "for", ts.peek().lineNumber, null, "for" ); // Kuan Hsu 
    316335        parseR!(ForParameters); 
    317336        parseTerminal( TOK.Closeparen ); 
     
    340359        parseTerminal(); 
    341360        parseTerminal( TOK.Openparen ); 
    342         activeNode = activeNode.addLeaf( 0, D_BLOCK, "foreach", "foreach", ts.peek().lineNumber ); // Kuan Hsu 
     361        activeNode = activeNode.addLeaf( 0, D_BLOCK, "foreach", "foreach", ts.peek().lineNumber, null, "foreach" ); // Kuan Hsu 
    343362        parseR!(ForEachParameters); 
    344363        parseTerminal( TOK.Closeparen ); 
     
    534553    public void parse() 
    535554    { 
    536         activeNode = activeNode.addLeaf( 0, D_BLOCK, "switch", "switch", ts.peek().lineNumber ); // Kuan Hsu 
     555        activeNode = activeNode.addLeaf( 0, D_BLOCK, "switch", "switch", ts.peek().lineNumber, null, "switch" ); // Kuan Hsu 
    537556        parseTerminal( TOK.Tswitch ); 
    538557        parseTerminal( TOK.Openparen ); 
     
    543562        // Kuan Hsu 
    544563        if( activeNode.DType & D_BLOCK ) 
    545             if( activeNode.typeIdentifier == "case" ) activeNode = activeNode.getRoot(); 
     564            if( activeNode.baseClass == "case" ) activeNode = activeNode.getRoot(); 
    546565 
    547566        activeNode = activeNode.getRoot();  
     
    587606        // Kuan Hsu 
    588607        if( activeNode.DType & D_BLOCK ) 
    589             if( activeNode.typeIdentifier == "case" ) activeNode = activeNode.getRoot(); 
     608            if( activeNode.baseClass == "case" ) activeNode = activeNode.getRoot(); 
    590609        // End of Kuan Hsu       
    591610    } 
     
    614633        if( activeNode.DType & D_BLOCK ) 
    615634        { 
    616             if( activeNode.typeIdentifier == "switch" ) 
    617                 activeNode = activeNode.addLeaf( 0, D_BLOCK, "case", "case", ln ); 
     635            if( activeNode.baseClass == "switch" ) 
     636                activeNode = activeNode.addLeaf( 0, D_BLOCK, "case", "case", ln, null, "case" ); 
    618637            else 
    619638            { 
    620                 if( activeNode.typeIdentifier == "case" ) 
     639                if( activeNode.baseClass == "case" ) 
    621640                { 
    622641                    activeNode = activeNode.getRoot(); 
    623                     activeNode = activeNode.addLeaf( 0, D_BLOCK, "case", "case", ln ); 
     642                    activeNode = activeNode.addLeaf( 0, D_BLOCK, "case", "case", ln, null, "case" ); 
    624643                } 
    625644            } 
     
    650669        if( activeNode.DType & D_BLOCK ) 
    651670        { 
    652             if( activeNode.typeIdentifier == "switch" ) 
    653                 activeNode = activeNode.addLeaf( 0, D_BLOCK, "case", "case", ln ); 
     671            if( activeNode.baseClass == "switch" ) 
     672                activeNode = activeNode.addLeaf( 0, D_BLOCK, "case", "case", ln, null, "case" ); 
    654673            else 
    655674            { 
    656                 if( activeNode.typeIdentifier == "case" ) 
     675                if( activeNode.baseClass == "case" ) 
    657676                { 
    658677                    activeNode = activeNode.getRoot(); 
    659                     activeNode = activeNode.addLeaf( 0, D_BLOCK, "case", "case", ln ); 
     678                    activeNode = activeNode.addLeaf( 0, D_BLOCK, "case", "case", ln, null, "case" ); 
    660679                } 
    661680            } 
     
    686705        // Kuan Hsu 
    687706        if( activeNode.DType == D_BLOCK ) 
    688             if( activeNode.typeIdentifier == "case" ) activeNode = activeNode.getRoot(); 
     707            if( activeNode.baseClass == "case" ) activeNode = activeNode.getRoot(); 
    689708        // End of Kuan Hsu       
    690709    } 
     
    713732        // Kuan Hsu 
    714733        if( activeNode.DType == D_BLOCK ) 
    715             if( activeNode.typeIdentifier == "case" ) activeNode = activeNode.getRoot(); 
     734            if( activeNode.baseClass == "case" ) activeNode = activeNode.getRoot(); 
    716735        // End of Kuan Hsu 
    717736    } 
     
    740759        // Kuan Hsu 
    741760        if( activeNode.DType == D_BLOCK ) 
    742             if( activeNode.typeIdentifier == "case" ) activeNode = activeNode.getRoot(); 
     761            if( activeNode.baseClass == "case" ) activeNode = activeNode.getRoot(); 
    743762        // End of Kuan Hsu 
    744763    } 
     
    785804        // Kuan Hsu 
    786805        if( activeNode.DType == D_BLOCK ) 
    787             if( activeNode.typeIdentifier == "case" ) activeNode = activeNode.getRoot(); 
     806            if( activeNode.baseClass == "case" ) activeNode = activeNode.getRoot(); 
    788807        // End of Kuan Hsu        
    789808     } 
     
    830849    { 
    831850        parseTerminal( TOK.Ttry ); 
    832         activeNode = activeNode.addLeaf( 0, D_BLOCK, "try", "try", ts.peek().lineNumber ); // Kuan Hsu 
     851        activeNode = activeNode.addLeaf( 0, D_BLOCK, "try", "try", ts.peek().lineNumber, null, "try" ); // Kuan Hsu 
    833852        parseR!(Statement); 
    834853        activeNode = activeNode.getRoot(); // Kuan Hsu 
     
    864883        ts.unwind(); 
    865884 
    866         activeNode = activeNode.addLeaf( 0, D_BLOCK, "catch", "catch", ts.peek().lineNumber ); // Kuan Hsu 
     885        activeNode = activeNode.addLeaf( 0, D_BLOCK, "catch", "catch", ts.peek().lineNumber, null, "catch" ); // Kuan Hsu 
    867886 
    868887        if( lastCatch ) 
     
    960979    { 
    961980        parseTerminal( TOK.Tfinally ); 
    962         activeNode = activeNode.addLeaf( 0, D_BLOCK, "finally", "finally", ts.peek().lineNumber ); // Kuan Hsu 
     981        activeNode = activeNode.addLeaf( 0, D_BLOCK, "finally", "finally", ts.peek().lineNumber, null, "finally" ); // Kuan Hsu 
    963982        parseR!(Statement); 
    964983        activeNode = activeNode.getRoot(); // Kuan Hsu 
     
    10031022        tokenText = ""; 
    10041023        //activeNode = activeNode.addLeaf( 0, D_WITH, "with", "with", ts.peek().lineNumber ); 
    1005         activeNode = activeNode.addLeaf( 0, D_BLOCK, "with", "with", ts.peek().lineNumber ); 
     1024        activeNode = activeNode.addLeaf( 0, D_BLOCK, "with", "with", ts.peek().lineNumber, null, "with" ); 
    10061025        // End of Kuan Hsu 
    10071026        
     
    10091028 
    10101029        // Kuan Hsu 
    1011         int assignPos = std.string.find( tokenText, "=" ); 
    1012         if( assignPos > 0 ) 
    1013             tokenText = tokenText[0..assignPos]; 
     1030        char[] ident, typeIdent; 
     1031         
     1032        char[][] nameAndType = std.string.split( tokenText, "new " ); 
     1033        if( nameAndType.length == 1 ) 
     1034        { 
     1035            ident = tokenText; 
     1036        } 
    10141037        else 
    10151038        { 
    1016             int openparenPos = std.string.find( tokenText, "(" ); 
    1017             if( openparenPos > 0 ) tokenText = tokenText[0..openparenPos]; 
     1039            ident = nameAndType[0]; 
     1040            if( nameAndType[0].length ) 
     1041                if( nameAndType[0][length-1] == '=' ) ident = nameAndType[0][0..length-1]; 
     1042 
     1043            typeIdent = nameAndType[1]; 
     1044            if( nameAndType[1].length ) 
     1045            { 
     1046                int openparenPos = std.string.find( nameAndType[1], "(" ); 
     1047                if( openparenPos > 0 ) typeIdent = nameAndType[1][0..openparenPos]; 
     1048            } 
    10181049        } 
    10191050 
    1020         activeNode.identifier = tokenText; 
     1051        activeNode.identifier = ident; 
     1052        activeNode.typeIdentifier = typeIdent; 
    10211053        // End of Kuan Hsu 
    10221054 
  • trunk/current/poseidon/CodeAnalyzer/syntax/templates.d

    r219 r233  
    416416    public void parse() 
    417417    { 
     418        int lineNum = ts.peek().lineNumber; // Kuan Hsu 
     419         
    418420        parseTerminal( TOK.Tmixin ); 
    419421         
     
    424426        else 
    425427        { 
     428            tokenText = null; // Kuan Hsu 
    426429            parseR!(IdentifierSequence); 
     430 
     431            int notPos = std.string.find( tokenText, "!(" ); 
     432            char[] ident = tokenText, params; 
     433             
     434            if( notPos > -1 ) 
     435            { 
     436                ident = tokenText[0..notPos]; 
     437                if( tokenText.length > notPos + 2 ) params = tokenText[notPos+2..length-1]; 
     438            } 
     439 
     440            activeNode.addLeaf( globalProt, D_MIXIN, ident, null, lineNum, params ); // Kuan Hsu 
     441             
    427442            if( ts.next( TOK.Identifier ) ) 
    428443            { 
     444                tokenText = null; // Kuan Hsu 
    429445                parseR!(MixinIdentifier); 
     446                activeNode.getLeaf( activeNode.getLeafCount() - 1 ).typeIdentifier = tokenText; // Kuan Hsu 
    430447            } 
    431448        } 
     
    447464    public void parse() 
    448465    { 
    449         tokenText = null; // Kuan Hsu 
    450466        parseR!(Identifier); 
    451         activeNode.addLeaf( globalProt, D_MIXIN, tokenText ); // Kuan Hsu 
    452     } 
    453 
     467    } 
     468
  • trunk/current/poseidon/lexer/SCLEX_D.xml

    r201 r233  
    88            <keywords id="3" value="class struct interface enum new this null delete invariant super union template" /> 
    99            <keywords id="4" value="if for foreach while do assert return unittest try catch else throw switch case break continue default finally goto synchronized" /> 
    10             <keywords id="5" value="is import module alias typedef with cast package typeof typeid classinfo" /> 
     10            <keywords id="5" value="is import module alias typedef with cast package typeof typeid classinfo mixin" /> 
    1111            <keywords id="6" value="in out const static inout lazy ref extern export auto align scope" /> 
    1212        </keywords> 
  • trunk/current/poseidon/nls/english.ini

    r231 r233  
    284284pap.update = Update Parser Live( In Testing ) 
    285285pap.show = Show All UDT Members 
     286pap.showlisttype = Show AutoComplete List Member Type 
    286287pap.case = Case Sensitive 
    287288pap.load_default = Load Default Parser 
  • trunk/current/poseidon/poseidon/controller/dialog/aboutbox.d

    r232 r233  
    3838        with(label = new CLabel(top, DWT.CENTER)){ 
    3939            //setText("Poseidon Editor for D v " ~ Globals.getVersionS()); 
    40             setText("Poseidon Editor for D rev.232" ); 
     40            setText("Poseidon Editor for D rev.233" ); 
    4141            setForeground(color); 
    4242        } 
  • trunk/current/poseidon/poseidon/controller/edititem.d

    r232 r233  
    659659            try 
    660660            { 
    661                 if( fileParser !is null ) delete fileParser; 
     661                //if( fileParser !is null ) delete fileParser; 
    662662                fileParser = syntax.core.parseTextHSU( scintilla.getText(), filePath ); 
    663663                //fileParser = parsing.core.parseFileHSU( filePath ); 
     
    11741174    } 
    11751175 
    1176     private void _forceAutoComplete(){ DStyle.performAutoComplete( this.scintilla, true ); }   
     1176    private void _forceAutoComplete(){ /*DStyle.performAutoComplete( this.scintilla, true );*/ }   
    11771177 
    11781178    public void updateFileTime() 
  • trunk/current/poseidon/poseidon/controller/outline.d

    r232 r233  
    5353            break; 
    5454 
     55        case D_MIXIN: 
     56            image = Globals.getImage( "D_MIXIN" ); 
     57            break; 
     58 
     59        case D_ANONYMOUSBLOCK: 
     60            image = Globals.getImage( "D_ANONYMOUSBLOCK" ); 
     61            break; 
     62 
    5563        default: 
    5664            image = Globals.getImage( dTypeToChars( l.DType ) ); 
     
    122130    private void addTreeItem( CAnalyzerTreeNode analyzerNode, TreeItem treeItem ) 
    123131    { 
     132        int skipDTYPE = D_MODULE | D_PARAMETER; 
     133         
     134        version( SHOWBLOCK ) 
     135        { 
     136        } 
     137        else 
     138        { 
     139            skipDTYPE = skipDTYPE | D_BLOCK; 
     140        } 
     141         
    124142        // 有子節點 
    125143        foreach( CAnalyzerTreeNode t; analyzerNode.getAllLeaf() ) 
    126144        { 
    127             if( !( t.DType & ( D_MODULE | D_BLOCK | D_PARAMETER ) ) ) 
     145            if( !( t.DType & skipDTYPE ) ) 
    128146            { 
    129147                TreeItem tItem; 
     
    197215            } 
    198216 
     217            int skipDTYPE = D_MODULE | D_PARAMETER; 
     218             
     219            version( SHOWBLOCK ) 
     220            { 
     221            } 
     222            else 
     223            { 
     224                skipDTYPE = skipDTYPE | D_BLOCK; 
     225            }        
     226 
    199227            foreach( CAnalyzerTreeNode t; newLeafs ) 
    200228            { 
    201                 if( !( t.DType & ( D_MODULE | D_BLOCK | D_PARAMETER ) ) ) 
     229                if( !( t.DType & skipDTYPE ) ) 
    202230                { 
    203231                    TreeItem tItem; 
     
    269297            title = ( l.typeIdentifier.length ? l.typeIdentifier ~ " = " : "" ) ~ l.identifier ~ 
    270298                    ( l.parameterString.length ? " : " ~ l.parameterString : "" ); 
    271         }        
     299        } 
     300        else if( t & D_MIXIN ) 
     301        { 
     302            title = l.identifier ~ ( l.parameterString.length ? " !(" ~ l.parameterString ~ ")" : "" ); 
     303        } 
     304        else if( t & D_ANONYMOUSBLOCK ) 
     305        { 
     306            title = "-anonymous-"; 
     307        } 
    272308        else 
    273309        { 
  • trunk/current/poseidon/poseidon/controller/property/parserpage.d

    r231 r233  
    1818class ParserPage : AbstractPage 
    1919{ 
    20     private Button btnUseCodeCompletion, btnOnlyClassBorwser, btnAutoAll, btnShowAllMember, btnUseDefaultParser, 
    21                     btnCaseSensitive, btnBackgroundLoad, btnUpdateParserLive; 
    22     private Shell shell; 
    23     private List  listDefaultParsers; 
    24     private Text  txtLetters, txtMakeDefaultParser; 
     20    private Button     chkUseCodeCompletion, chkOnlyClassBorwser, chkAutoAll, chkShowAllMember, chkUseDefaultParser, 
     21                    chkShowType, chkCaseSensitive, chkBackgroundLoad, chkUpdateParserLive; 
     22    private Shell shell; 
     23    private List  listDefaultParsers; 
     24    private Text  txtLetters, txtMakeDefaultParser; 
    2525 
    2626    this( Composite parent, IPropertyPage parentPage, void delegate(bool) dirtyListener ) 
     
    3333    public void applyChanges() 
    3434    { 
    35         Globals.useCodeCompletion = btnUseCodeCompletion.getSelection(); 
     35        Globals.useCodeCompletion = chkUseCodeCompletion.getSelection(); 
    3636        if( !Globals.useCodeCompletion ) 
    3737        { 
    3838            Globals.parseAllModule = 0; 
    39             btnAutoAll.setSelection( false ); 
     39            chkAutoAll.setSelection( false ); 
    4040            Globals.updateParseLive = 0; 
    41             btnUpdateParserLive.setSelection( false ); 
     41            chkUpdateParserLive.setSelection( false ); 
    4242            Globals.useDefaultParser = 0; 
    43             btnUseDefaultParser.setSelection( false ); 
     43            chkUseDefaultParser.setSelection( false ); 
    4444        } 
    4545        else 
    4646        { 
    47             Globals.parseAllModule = btnAutoAll.getSelection(); 
    48             Globals.updateParseLive = btnUpdateParserLive.getSelection(); 
    49             Globals.useDefaultParser = btnUseDefaultParser.getSelection(); 
     47            Globals.parseAllModule = chkAutoAll.getSelection(); 
     48            Globals.updateParseLive = chkUpdateParserLive.getSelection(); 
     49            Globals.useDefaultParser = chkUseDefaultParser.getSelection(); 
    5050        } 
    5151 
     
    5757 
    5858        Globals.lanchLetterCount = count; 
    59         Globals.showOnlyClassBrowser = btnOnlyClassBorwser.getSelection(); 
    60         Globals.backLoadParser = btnBackgroundLoad.getSelection(); 
    61         Globals.parserCaseSensitive = btnCaseSensitive.getSelection(); 
    62         Globals.showAllMember = btnShowAllMember.getSelection(); 
     59        Globals.showOnlyClassBrowser = chkOnlyClassBorwser.getSelection(); 
     60        Globals.backLoadParser = chkBackgroundLoad.getSelection(); 
     61        Globals.parserCaseSensitive = chkCaseSensitive.getSelection(); 
     62        Globals.showAllMember = chkShowAllMember.getSelection(); 
     63        Globals.showType = chkShowType.getSelection(); 
     64         
    6365 
    6466        setDirty( false ); 
     
    98100        setLayout( LayoutShop.createGridLayout( 1 ) ); 
    99101 
    100         with( btnUseCodeCompletion = new Button( this, DWT.CHECK ) ) 
     102        with( chkUseCodeCompletion = new Button( this, DWT.CHECK ) ) 
    101103        { 
    102104            setData( LANG_ID, "pap.use" ); 
     
    106108        } 
    107109 
    108         with( btnOnlyClassBorwser = new Button( this, DWT.CHECK ) ) 
     110        with( chkOnlyClassBorwser = new Button( this, DWT.CHECK ) ) 
    109111        { 
    110112            setData( LANG_ID, "pap.only" ); 
     
    114116        } 
    115117         
    116         with( btnAutoAll = new Button( this, DWT.CHECK ) ) 
     118        with( chkAutoAll = new Button( this, DWT.CHECK ) ) 
    117119        { 
    118120            setData( LANG_ID, "pap.all" ); 
     
    122124        } 
    123125 
    124         with( btnUpdateParserLive = new Button( this, DWT.CHECK ) ) 
     126        with( chkUpdateParserLive = new Button( this, DWT.CHECK ) ) 
    125127        { 
    126128            setData( LANG_ID, "pap.update" ); 
     
    130132        }        
    131133 
    132         with( btnShowAllMember = new Button( this, DWT.CHECK ) ) 
     134        with( chkShowAllMember = new Button( this, DWT.CHECK ) ) 
    133135        { 
    134136            setData( LANG_ID, "pap.show" ); 
     
    138140        } 
    139141 
    140         with( btnCaseSensitive = new Button( this, DWT.CHECK ) ) 
     142        with( chkShowType = new Button( this, DWT.CHECK ) ) 
     143        { 
     144            setData( LANG_ID, "pap.showlisttype" ); 
     145            setSelection( Globals.showType ); 
     146            //setLayoutData( LayoutDataShop.createGridData( GridData.GRAB_HORIZONTAL, 1 ) ); 
     147            handleEvent(null, DWT.Selection, &onAction); 
     148        }        
     149 
     150        with( chkCaseSensitive = new Button( this, DWT.CHECK ) ) 
    141151        { 
    142152            setData( LANG_ID, "pap.case" ); 
     
    146156        }        
    147157 
    148         with( btnUseDefaultParser = new Button( this, DWT.CHECK ) ) 
     158        with( chkUseDefaultParser = new Button( this, DWT.CHECK ) ) 
    149159        { 
    150160            setData( LANG_ID, "pap.load_default" ); 
     
    154164        } 
    155165 
    156         with( btnBackgroundLoad = new Button( this, DWT.CHECK ) ) 
     166        with( chkBackgroundLoad = new Button( this, DWT.CHECK ) ) 
    157167        { 
    158168            setData( LANG_ID, "pap.thread" ); 
     
    196206            setFont( font ); 
    197207             
    198             int ListHeight = getItemHeight() * 8
     208            int ListHeight = getItemHeight() * 7
    199209            Rectangle trim = computeTrim( 0, 0, 0, ListHeight ); 
    200210            innergridData.heightHint = trim.height; 
     
    256266    public void restoreDefaults() 
    257267    { 
    258         btnUseCodeCompletion.setSelection( true ); 
    259         btnAutoAll.setSelection( false ); 
    260         btnOnlyClassBorwser.setSelection( false ); 
    261         btnUpdateParserLive.setSelection( false ); 
    262         btnShowAllMember.setSelection( false ); 
    263         btnUseDefaultParser.setSelection( true ); 
    264         btnBackgroundLoad.setSelection( false ); 
    265         btnCaseSensitive.setSelection( false ); 
     268        chkUseCodeCompletion.setSelection( true ); 
     269        chkAutoAll.setSelection( false ); 
     270        chkOnlyClassBorwser.setSelection( false ); 
     271        chkUpdateParserLive.setSelection( false ); 
     272        chkShowAllMember.setSelection( false ); 
     273        chkShowType.setSelection( false ); 
     274        chkUseDefaultParser.setSelection( true ); 
     275        chkBackgroundLoad.setSelection( false ); 
     276        chkCaseSensitive.setSelection( false ); 
    266277        txtLetters.setText( "2" ); 
    267278        listDefaultParsers.add( "std" ); 
  • trunk/current/poseidon/poseidon/globals.d

    r232 r233  
    4444    static public int       updateParseLive = 1; 
    4545    static public int       showAllMember; 
     46    static public int       showType; 
    4647    static public int       useDefaultParser; 
    4748    static public int       parserCaseSensitive; 
     
    282283            images["D_INTERFACE-PRIVATE"]   = DWTResourceManager.getImage("interface_private_obj.gif"); 
    283284            images["D_INTERFACE-PROTECTED"] = DWTResourceManager.getImage("interface_protected_obj.gif"); 
    284             images["D_MIXIN"]               = DWTResourceManager.getImage("mixin_obj.gif"); 
     285            images["D_MIXIN"]               = DWTResourceManager.getImage("mixin_template_obj.gif"); 
    285286            images["D_MODULE"]              = DWTResourceManager.getImage("module_obj.gif"); 
    286287            images["D_STATICCTOR"]          = DWTResourceManager.getImage("static_ctor_obj.gif"); 
     
    302303            images["D_VERSIONSPEC"]         = DWTResourceManager.getImage("version_spec_obj.gif"); 
    303304            images["D_DEBUGSPEC"]           = DWTResourceManager.getImage("debug_spec_obj.gif"); 
     305            images["D_ANONYMOUSBLOCK"]      = DWTResourceManager.getImage("anonymousblock_obj.gif"); 
    304306        } 
    305307 
     
    564566                if( at && at.GetValue().length > 0 ) showAllMember = std.string.atoi( at.GetValue() ); 
    565567 
     568                at = child.getAttrib("showtype"); 
     569                if( at && at.GetValue().length > 0 ) showType = std.string.atoi( at.GetValue() ); 
     570 
    566571                at = child.getAttrib("casesensitive"); 
    567572                if( at && at.GetValue().length > 0 ) parserCaseSensitive = std.string.atoi( at.GetValue() ); 
     
    699704            node.addAttrib( "live", std.string.toString( updateParseLive ) ); 
    700705            node.addAttrib( "member", std.string.toString( showAllMember ) ); 
     706            node.addAttrib( "showtype", std.string.toString( showType ) ); 
    701707            node.addAttrib( "casesensitive", std.string.toString( parserCaseSensitive ) ); 
    702708            node.addAttrib( "lettercount", std.string.toString( lanchLetterCount ) ); 
  • trunk/current/poseidon/poseidon/intellisense/autocomplete.d

    r232 r233  
    1111} 
    1212 
    13 const char[][] keywords_d = [ /*"Pascal", "Windows",*/ "abstract", "alias", "align", "asm", "assert", "auto", "body", "bool", "break", "byte", 
    14                               "case", "cast", "catch", "cdouble", "cent", "cfloat", "char", "class", "const", "continue", 
    15                               "creal", "dchar", "debug", "default", "delegate", "delete", "deprecated", "do", "double",  
    16                               "else", "enum", "export", "extern", "false", "final", "finally", "float", "for", "foreach", "function", 
    17                               "goto", "idouble", "if", "ifloat", "import", "inout", "int", "interface", "invariant", 
    18                               "ireal", "is", "lazy", "long", "mixin", "module", "new", "null",/* 
    19                               "opAddAssign", "opAndAssign", "opApply", "opCall", "opCast", "opCatAssign", "opDivAssign", 
    20                               "opIndex", "opIndexAssign", "opMulAssign", "opModAssign", "opOrAssign", "opPostInc", 
    21                               "opPostDec", "opSubAssign", "opXorAssign", "opSlice", "opShlAssign", "opShrAssign", "opUShrAssign",*/ 
    22                               "out", "override", "package", "pragma", "private", "protected", "public", 
    23                               "real", "ref", "return", "scope", "short", "static", "struct", "super", "switch", "synchronized", 
    24                               "template", "this", "throw", "true", "try", "typedef", "typeid", "typeof", 
    25                               "ubyte", "ucent", "uint", "ulong", "union", "unittest", "ushort", 
    26                               "version", "void", "volatile", "wchar", "while", "with" ]; 
    27  
    2813/* 
    2914interface IComplete 
     
    3520// KeywordComplete 
    3621class KeywordComplete//:IComplete 
    37 {    
     22
     23    const char[][] keywords_d = [ /*"Pascal", "Windows",*/ "abstract", "alias", "align", "asm", "assert", "auto", "body", "bool", "break", "byte", 
     24                                  "case", "cast", "catch", "cdouble", "cent", "cfloat", "char", "class", "const", "continue", 
     25                                  "creal", "dchar", "debug", "default", "delegate", "delete", "deprecated", "do", "double",  
     26                                  "else", "enum", "export", "extern", "false", "final", "finally", "float", "for", "foreach", "function", 
     27                                  "goto", "idouble", "if", "ifloat", "import", "inout", "int", "interface", "invariant", 
     28                                  "ireal", "is", "lazy", "long", "mixin", "module", "new", "null",/* 
     29                                  "opAddAssign", "opAndAssign", "opApply", "opCall", "opCast", "opCatAssign", "opDivAssign", 
     30                                  "opIndex", "opIndexAssign", "opMulAssign", "opModAssign", "opOrAssign", "opPostInc", 
     31                                  "opPostDec", "opSubAssign", "opXorAssign", "opSlice", "opShlAssign", "opShrAssign", "opUShrAssign",*/ 
     32                                  "out", "override", "package", "pragma", "private", "protected", "public", 
     33                                  "real", "ref", "return", "scope", "short", "static", "struct", "super", "switch", "synchronized", 
     34                                  "template", "this", "throw", "true", "try", "typedef", "typeid", "typeof", 
     35                                  "ubyte", "ucent", "uint", "ulong", "union", "unittest", "ushort", 
     36                                  "version", "void", "volatile", "wchar", "while", "with" ];     
     37 
    3838    char[][] rootSearch( char[] root ) 
    3939    { 
     
    4242 
    4343        return results; 
    44     }  
     44    } 
     45 
     46    /* 
     47    public char[][] rootSearch( char[] root ) 
     48    { 
     49        char[][] matches; 
     50 
     51        foreach( char[] s; keywords_d ) 
     52        { 
     53            if( s.length >= root.length ) 
     54            { 
     55                if( Globals.parserCaseSensitive ) 
     56                { 
     57                    if( root == s[0..root.length] ) matches ~= s; 
     58                } 
     59                else 
     60                { 
     61                    if( root == std.string.tolower( s[0..root.length] ) ) matches ~= s; 
     62                } 
     63            } 
     64        } 
     65 
     66        return matches; 
     67    } 
     68    */   
    4569} 
    4670 
     
    405429        } 
    406430 
    407         if( Globals.parseAllModule ) setAdditionImportModules(); 
     431        if( Globals.parseAllModule && paths.length ) setAdditionImportModules(); 
    408432    } 
    409433 
     
    637661    } 
    638662 
    639     char[][] setMemberImage( CAnalyzerTreeNode[] nodes
    640     { 
    641         if( !nodes.length ) return null; 
     663    char[][] setMemberImage( CAnalyzerTreeNode[] nodes, char[][] mixinWords = null
     664    { 
     665        if( !nodes.length && !mixinWords.length ) return null; 
    642666         
    643667        char[][] words; 
     
    657681                case D_ENUM:        m = 6; break; 
    658682                case D_PARAMETER: 
    659                     words ~= ( t.identifier ~ "?24" ); 
     683                    words ~= ( t.identifier ~ ( Globals.showType ? "::" ~ t.typeIdentifier : null ) ~ "?24" ); 
    660684                    continue; 
    661685                    break; 
     
    697721                v = 2; 
    698722 
    699             words ~= ( t.identifier ~ "?" ~ std.string.toString( m * 3 + v ) ); 
    700         } 
     723            if( m < 2 ) 
     724                words ~= ( t.identifier ~ ( Globals.showType ? "::" ~ t.typeIdentifier : null ) ~ "?" ~ std.string.toString( m * 3 + v ) ); 
     725            else 
     726                words ~= ( t.identifier ~ "?" ~ std.string.toString( m * 3 + v ) ); 
     727        } 
     728 
     729        if( mixinWords.length ) words ~= mixinWords; 
    701730 
    702731        if( !words.length ) return null; 
    703732 
    704         scope CCharsSort!( char[] ) sortList = new CCharsSort!( char[] )( words ); 
    705         words = sortList.pop(); 
    706  
    707         char[]      prevWord = words[0]; 
    708         char[][]    newWords; 
    709         newWords ~= words[0]; 
    710  
    711         for( int i = 1; i < words.length; ++ i ) 
    712         { 
    713             if( words[i] != prevWord ) 
    714             { 
    715                 prevWord = words[i]; 
    716                 newWords ~= words[i]; 
    717             } 
    718         }        
    719  
    720         return newWords; 
     733        scope sortList = new CCharsSort!( char[] )( words ); 
     734        words = sortList.scintillaPop(); 
     735 
     736        return words; 
    721737    } 
    722738 
     
    727743        char[]      ret; 
    728744 
    729         //words = mruParser.rootSearch( word ); 
     745        /* 
     746        words = mruParser.rootSearch( word ); 
    730747        words ~= keywordParser.rootSearch( word ); 
    731748 
     
    736753            ret = std.string.join( uniques, "?21 " ) ~ "?21"; 
    737754        } 
    738              
     755        */ 
     756        foreach( char[] s; keywordParser.rootSearch( word ) ) 
     757            words ~= ( s ~ "?21" ); 
    739758 
    740759        if( fileParser ) 
     
    751770                     
    752771                CAnalyzerTreeNode[]         importModules;       
    753                 //if( getImport( "dummy", D_ALL, headNode, importModules, true ) !is null ) 
    754                 //{ 
    755                     getImport( "dummy", D_ALL, headNode, importModules, true ); 
    756                     int DType = D_UDTS | D_FUNCTION | D_ALIAS | D_TYPEDEF | D_VARIABLE | D_IMPORT; 
    757                     foreach( CAnalyzerTreeNode a; importModules ) 
    758                     { 
    759                         foreach( CAnalyzerTreeNode t; getMembers( DType, a ) ) 
    760                             if( !( t.prot & ( D_Private | D_Protected ) ) ) treeNodesSum ~= t; 
    761                         /* 
    762                         foreach( CAnalyzerTreeNode t; a.getAllLeaf() ) 
    763                         { 
    764                             if( !( t.prot & D_Private ) && !( t.prot & D_Protected ) ) 
    765                                 if( t.DType & DType ) treeNodesSum ~= t; 
    766                         } 
    767                         */ 
    768                     } 
    769                 //} 
    770             } 
    771  
    772             if( treeNodesSum.length ) 
    773             { 
    774                 CAnalyzerTreeNode[] treeNodes = rootSearch( word, treeNodesSum ); 
    775                 treeWords = setMemberImage( treeNodes ); 
    776                  
    777                 if( treeWords.length ) 
    778                 { 
    779                     if( words.length )  
    780                         ret = ret ~ " " ~ std.string.join( treeWords, " " ); 
    781                     else 
    782                         ret = std.string.join( treeWords, " " ); 
    783                 } 
     772 
     773                getImport( "dummy", D_ALL, headNode, importModules, true ); 
     774                int DType = D_UDTS | D_FUNCTION | D_ALIAS | D_TYPEDEF | D_VARIABLE | D_IMPORT; 
     775                foreach( CAnalyzerTreeNode a; importModules ) 
     776                { 
     777                    foreach( CAnalyzerTreeNode t; getMembers( DType, a ) ) 
     778                        if( !( t.prot & ( D_Private | D_Protected ) ) ) treeNodesSum ~= t; 
     779                } 
     780            } 
     781 
     782            CAnalyzerTreeNode[] treeNodes; 
     783            if( treeNodesSum.length ) treeNodes = rootSearch( word, treeNodesSum ); 
     784            treeWords = setMemberImage( treeNodes, words ); 
     785            if( treeWords.length ) ret = std.string.join( treeWords, " " ); 
     786        } 
     787        else 
     788        { 
     789            if( words.length ) 
     790            { 
     791                TArray!(char[]).sort( words, &icharCompare ); 
     792                char[][] uniques = TArray!(char[]).array_unique( words ); 
     793                ret = std.string.join( uniques, " " ); 
    784794            } 
    785795        } 
     
    863873        } 
    864874 
    865         CAnalyzerTreeNode rootNode = treeNode.getRoot(); 
    866  
    867         while( rootNode ) 
    868         { 
    869             foreach( CAnalyzerTreeNode t; getMembers( DType, rootNode ) ) 
    870                 if( t.identifier == ident ) return t; 
    871  
    872             rootNode = rootNode.getRoot; 
     875        CAnalyzerTreeNode node = treeNode.getRoot(); 
     876 
     877        while( node ) 
     878        { 
     879            for( int i = 0; i < node.getLeafCount(); ++i ) 
     880            { 
     881                if( node[i].DType & ( D_VERSION | D_DEBUG ) ) 
     882                { 
     883                    if( !( node.DType & ( D_VERSION | D_DEBUG ) ) ) 
     884                    { 
     885                        CAnalyzerTreeNode[] dummyClasses; 
     886                        CAnalyzerTreeNode resultNode = getMemberAnalyzerTreeNode( ident, DType, node[i], dummyClasses ); 
     887                        if( resultNode ) return resultNode; 
     888                    } 
     889                } 
     890                else 
     891                { 
     892                    if( node[i].DType & DType ) 
     893                        if( node[i].identifier == ident ) return node[i]; 
     894                } 
     895            } 
     896            node = node.getRoot; 
    873897        } 
    874898 
     
    885909        { 
    886910            if( !node.baseClass.length ) return; 
    887              
    888             char[][]            className = std.string.split( treeNode.baseClass, "," ); 
    889             CAnalyzerTreeNode[] nestClasses; 
     911 
     912            char[][]            className = std.string.split( node.baseClass, "," ); 
     913            CAnalyzerTreeNode[] gotClasses; 
    890914 
    891915 
     
    918942                            } 
    919943                        } 
    920                         baseClassNodes ~= activeTreeNode; 
    921                         nestClasses ~= activeTreeNode; 
     944 
     945                        if( !MiscUtil.inArray( activeTreeNode, baseClassNodes ) )  
     946                        { 
     947                            baseClassNodes ~= activeTreeNode; 
     948                            gotClasses ~= activeTreeNode; 
     949                        } 
    922950                    } 
    923951                }else 
     
    932960                        } 
    933961                    } 
    934                     baseClassNodes ~= activeTreeNode; 
    935                 } 
    936             } 
    937  
    938             foreach( CAnalyzerTreeNode t; nestClasses ) 
    939             { 
    940                 if( t.DType & D_INTERFACE ) _getNode( t ); 
     962 
     963                    if( !MiscUtil.inArray( activeTreeNode, baseClassNodes ) )  
     964                    {                    
     965                        baseClassNodes ~= activeTreeNode; 
     966                        gotClasses ~= activeTreeNode; 
     967                    } 
     968                } 
     969            } 
     970 
     971            foreach( CAnalyzerTreeNode t; gotClasses ) 
     972            { 
     973                _getNode( t ); 
    941974            } 
    942975                 
     
    9691002                continue; 
    9701003            } 
     1004            else if( node[i].DType & D_MIXIN ) 
     1005            { 
     1006                CAnalyzerTreeNode mixinNode = getAnalyzerTreeNode( node[i].identifier, D_TEMPLATE, node[i], false ); 
     1007                if( mixinNode is null ) 
     1008                { 
     1009                    CAnalyzerTreeNode[] dummyAnalyzers; 
     1010                    mixinNode = getImport( node[i].identifier, D_TEMPLATE, node[i], dummyAnalyzers ); 
     1011                } 
     1012 
     1013                if( mixinNode !is null ) 
     1014                { 
     1015                    results ~= getMembers( D_VARIABLE | D_UDTS | D_FUNCTION, mixinNode ); 
     1016                    //bNotFriendClass = true; 
     1017                } 
     1018 
     1019                continue; 
     1020            } 
    9711021 
    9721022            if( node[i].DType & DType ) results ~= node[i]; 
     
    9981048                continue; 
    9991049            } 
     1050            else if( node[i].DType & D_MIXIN ) 
     1051            { 
     1052                CAnalyzerTreeNode mixinNode = getAnalyzerTreeNode( node[i].identifier, D_TEMPLATE, node[i], false ); 
     1053                if( mixinNode is null ) 
     1054                { 
     1055                    CAnalyzerTreeNode[] dummyAnalyzers; 
     1056                    mixinNode = getImport( node[i].identifier, D_TEMPLATE, node[i], dummyAnalyzers ); 
     1057                } 
     1058 
     1059                if( mixinNode !is null ) 
     1060                { 
     1061                    mixinNode = getMemberAnalyzerTreeNode( ident, DType, mixinNode, baseClasses ); 
     1062                    if( mixinNode !is null ) return mixinNode; 
     1063                } 
     1064 
     1065                continue; 
     1066            }            
    10001067 
    10011068            if( node[i].DType & DType ) 
     
    10621129                    if( !( node.DType & ( D_VERSION | D_DEBUG ) ) ) 
    10631130                        results ~= getMembers( DType, node[i] ); 
     1131                } 
     1132                else if( node[i].DType & D_MIXIN ) 
     1133                { 
     1134                    if( !( node.DType & ( D_VERSION | D_DEBUG ) ) ) 
     1135                    { 
     1136                        CAnalyzerTreeNode mixinNode = getAnalyzerTreeNode( node[i].identifier, D_TEMPLATE, node[i], false ); 
     1137                        if( mixinNode is null ) 
     1138                        { 
     1139                            CAnalyzerTreeNode[] dummyAnalyzers; 
     1140                            mixinNode = getImport( node[i].identifier, D_TEMPLATE, node[i], dummyAnalyzers ); 
     1141                        } 
     1142 
     1143                        if( mixinNode !is null ) 
     1144                        { 
     1145                            results ~= getMembers( D_VARIABLE | D_UDTS | D_FUNCTION, mixinNode ); 
     1146                        } 
     1147                    } 
    10641148                } 
    10651149                else 
     
    16711755    } 
    16721756 
    1673     private CAnalyzerTreeNode[] rootSearch( char[] root, CAnalyzerTreeNode[] allListings, int DType = D_ALL ) 
     1757    public CAnalyzerTreeNode[] rootSearch( char[] root, CAnalyzerTreeNode[] allListings, int DType = D_ALL ) 
    16741758    { 
    16751759        CAnalyzerTreeNode[] matches; 
  • trunk/current/poseidon/poseidon/intellisense/search.d

    r188 r233  
    340340     
    341341    this( T[] elements ){ super( elements ); } 
     342 
     343    T[]     scintillaPop() 
     344    { 
     345        T       prevT = container[0]; 
     346        T[]     newContainer; 
     347 
     348        newContainer ~= container[0]; 
     349 
     350        for( int i = 1; i < container.length; ++ i ) 
     351        { 
     352            if( container[i] != prevT ) 
     353            { 
     354                prevT = container[i]; 
     355                newContainer ~= container[i]; 
     356            } 
     357        } 
     358 
     359        // move underline-head words to tail 
     360        container = newContainer; 
     361        int i; 
     362        for( i = 0; i < container.length; ++ i ) 
     363        { 
     364            if( container[i].length ) 
     365                if( container[i][0] != '_' ) break; 
     366        } 
     367 
     368        if( i > 0 && i < container.length ) 
     369            newContainer = container[i..length] ~ container[0..i]; 
     370 
     371        return newContainer; 
     372    }    
    342373} 
    343374 
  • trunk/current/poseidon/poseidon/style/dstyle.d

    r232 r233  
    138138    // 加入mruParser 
    139139    private void onAutoCSelection( SCNotifyEvent e ) 
    140     {/* 
     140    { 
     141        if( Globals.showType ) 
     142        { 
     143            ScintillaEx sc = cast(ScintillaEx) e.cData; 
     144 
     145            if( sc ) 
     146            { 
     147                sc.autoCCancel(); 
     148                int posColon = std.string.rfind( e.text, "::" ); 
     149                if( posColon > 0 ) 
     150                { 
     151                    e.text = e.text[0..posColon]; 
     152                } 
     153                 
     154                sc.setAnchor( e.lParam ); 
     155                sc.replaceSel( e.text ); 
     156            } 
     157        } 
     158         
     159         
     160        /* 
    141161        Scintilla sc = cast(Scintilla) e.cData; 
    142162 
     
    168188            if( ch == '.' )  
    169189            { 
    170                 /+ 
    171                 CAnalyzerTreeNode t = searchFunctionHead( sc ); 
    172                 if( t ) 
    173                     sGUI.toolMan.txtFunctionHead.setText( t.typeIdentifier ~ " " ~ t.identifier ~ "(" ~ t.parameterString ~ ")" ); 
    174                 else 
    175                     sGUI.toolMan.txtFunctionHead.setText( null ); 
    176                 +/ 
    177                  
    178                 performDotCompletionAndFunctionToolTip( sc, false ); 
     190                sc.autoCCancel(); 
     191                //performDotCompletionAndFunctionToolTip( sc, false ); 
    179192            } 
    180193            else if( ch == '(' ) 
     
    192205                if( Globals.updateParseLive ) addAnalyzerNodeLive( sc ); 
    193206            } 
    194          
    195             performAutoComplete( sc ); 
     207 
     208            if( sc.autoCActive() ) return; 
     209            performDotCompletionAndFunctionToolTip( sc, false ); 
     210            //performAutoComplete( sc ); 
    196211        } 
    197212        catch( Exception e ) 
     
    204219    } 
    205220 
    206     static void performAutoComplete( ScintillaEx sc, bool forceComplete = false ) 
     221    /+ 
     222    void performAutoComplete( ScintillaEx sc, bool forceComplete = false ) 
    207223    { 
    208224        char[] word = readCurrentWord( sc ); 
     
    221237            { 
    222238                CAnalyzerTreeNode headNode = searchFunctionHead( sc );//findFunctionHead( sc ); 
     239 
     240                /* 
     241                if( headNode !is null ) 
     242                    if( headNode.DType & D_BLOCK ) 
     243                        if( headNode.baseClass == "with" ) performDotCompletionAndFunctionToolTip( sc, false ); 
     244                */ 
     245 
     246                char[][] currentWords = readCurrentWholeWord( sc ); 
     247                sGUI.outputPanel.appendLine( std.string.join( currentWords, "." ) ); 
     248                 
     249                 
    223250                list = sAutoComplete.autoCSearch( word, headNode ); 
    224251            } 
     
    227254        } 
    228255    } 
     256    +/ 
     257    private char[] getWithName( CAnalyzerTreeNode functionHeadNode ) 
     258    { 
     259        if( functionHeadNode !is null ) 
     260            if( functionHeadNode.DType & D_BLOCK ) 
     261                if( functionHeadNode.baseClass == "with" ) 
     262                { 
     263                    if( functionHeadNode.typeIdentifier.length ) 
     264                        return functionHeadNode.typeIdentifier; 
     265                    else 
     266                        return functionHeadNode.identifier; 
     267                } 
     268 
     269        return null; 
     270    } 
     271     
    229272 
    230273    private void performDotCompletionAndFunctionToolTip( Scintilla sc, bool bFunctionToolTip ) 
    231274    { 
    232         char[][] currentWords = readCurrentWholeWord( sc ); 
     275        bool                bDotEnd; 
     276        char[]              typedWord, preList, withName, list, listToolTip; 
     277        char[][]            currentWords = readCurrentWholeWord( sc, bFunctionToolTip, bDotEnd ); 
     278        CAnalyzerTreeNode   functionHeadNode; 
     279 
    233280 
    234281        if( !currentWords.length ) return; 
    235282 
    236         char[]  list, listToolTip; 
     283        if( !bFunctionToolTip ) 
     284        { 
     285            if( !bDotEnd ) 
     286            { 
     287                if( currentWords.length == 1 ) 
     288                { 
     289                    // maybe "with" 
     290                    if ( currentWords[0].length >= Globals.lanchLetterCount ) 
     291                    { 
     292                        functionHeadNode = searchFunctionHead( sc ); 
     293                        preList = sAutoComplete.autoCSearch( currentWords[0], functionHeadNode ); 
     294                    } 
     295 
     296                    withName = getWithName( functionHeadNode ); 
     297                    if( !withName.length ) 
     298                    { 
     299                        if( preList.length ) sc.autoCShow( currentWords[0].length, preList ); 
     300                        return; 
     301                    } 
     302                    else 
     303                    { 
     304                        typedWord = currentWords[0]; 
     305                        currentWords.length = 0; 
     306                    } 
     307                } 
     308                else 
     309                { 
     310                    typedWord = currentWords[length-1]; 
     311                    currentWords.length = currentWords.length - 1; 
     312                } 
     313            } 
     314        } 
     315 
    237316        bool    bIsImport = haveImportKeyWord( sc ); 
    238317 
    239318        if( !bIsImport ) 
    240319        { 
    241             CAnalyzerTreeNode functionHeadNode = searchFunctionHead( sc ); 
    242             performAnalyzer( currentWords, functionHeadNode, list, listToolTip, bFunctionToolTip ); 
     320            if( functionHeadNode is null ) functionHeadNode = searchFunctionHead( sc ); 
     321 
     322            withName = getWithName( functionHeadNode ); 
     323            if( withName.length ) currentWords = withName ~ currentWords; 
     324         
     325            performAnalyzer( currentWords, typedWord, functionHeadNode, list, listToolTip, bFunctionToolTip ); 
    243326        } 
    244327 
     
    360443                    list = sAutoComplete.projectImportParsers[sGUI.packageExp.getActiveProjectDir].perform( word ); 
    361444                } 
    362                 /+ 
    363                 char[] word = readImportWord( sc ); 
    364                 word = word.replace( ".", "\\" ); 
    365                 word.strip(); 
    366                 // TODO: Array out of bounds 
    367                 try 
    368                 { 
    369                     if( word[--$] == '\\' ) 
    370                     {  
    371                         word = word[0..$-1]; 
    372                         //MessageBox.showMsg(word); 
    373                     } 
    374                     list = sAutoComplete.importParser.autoCSearch(word); 
    375                 } 
    376                 catch( Exception e ) 
    377                 { 
    378                     Util.trace( e.toString() ); 
    379                 } 
    380                 +/ 
    381             } 
    382  
    383             if( list.length ) sc.autoCShow( 0, list ); 
     445            } 
     446 
     447            if( list.length ) 
     448            { 
     449                if( preList.length ) 
     450                { 
     451                    list = list ~ " " ~ preList; 
     452                    char[][] lists = std.string.split( list ); 
     453                    scope sortList = new CCharsSort!( char[] )( lists ); 
     454                    list = std.string.join( sortList.scintillaPop(), " " ); 
     455                } 
     456                 
     457                sc.autoCShow( typedWord.length, list ); 
     458                if( typedWord.length ) sc.autoCSelect( typedWord ); 
     459            } 
    384460        } 
    385461         
     
    387463 
    388464     
    389     private CAnalyzerTreeNode performAnalyzer( char[][] currentWords, CAnalyzerTreeNode functionHeadNode,  
    390                                                 inout char[] list, inout char[] listToolTip, bool bFunctionToolTip ) 
     465    private CAnalyzerTreeNode performAnalyzer( char[][] currentWords, char[] typedWord, CAnalyzerTreeNode functionHeadNode,  
     466                                                inout char[] list, inout char[] listToolTip,  
     467                                                bool bFunctionToolTip ) 
    391468    { 
    392469        bool                bIsArray, bIsFunction, bIsTemplateFunction, bNotFriendClass, bUseFunTip; 
     
    513590                                    { 
    514591                                        if( type.baseClass.length ) 
    515                                             list = symbolsToAutoCShow( type, bNotFriendClass, sAutoComplete.getBaseClassNode( type ) ); 
     592                                            list = symbolsToAutoCShow( typedWord, type, bNotFriendClass, sAutoComplete.getBaseClassNode( type ) ); 
    516593                                        else 
    517                                             list = symbolsToAutoCShow( type, bNotFriendClass, baseClasses ); 
     594                                            list = symbolsToAutoCShow( typedWord, type, bNotFriendClass, baseClasses ); 
    518595                                    } 
    519596 
     
    527604 
    528605 
    529                     //if( !bIsFunction ) 
    530                     //{ 
    531                         //if( bFunctionToolTip ) 
    532                         if( bUseFunTip ) 
    533                         { 
    534                             CAnalyzerTreeNode father = treeNode.getRoot(); 
    535                             char[] oriIdentifier = treeNode.identifier; 
    536                             if( father ) 
     606                    if( bUseFunTip ) 
     607                    { 
     608                        CAnalyzerTreeNode father = treeNode.getRoot(); 
     609                        char[] oriIdentifier = treeNode.identifier; 
     610                        if( father ) 
     611                        {   // maybe function overload 
     612                            foreach( CAnalyzerTreeNode t; father.getAllLeaf() ) 
    537613                            { 
    538                                 foreach( CAnalyzerTreeNode t; father.getAllLeaf() ) 
    539                                 { 
    540                                     if( t.identifier == oriIdentifier ) 
    541                                         listToolTip ~= ( t.typeIdentifier ~ " " ~ t.identifier ~ "(" ~ t.parameterString ~ ")\n" ); 
    542                                 } 
     614                                if( t.identifier == oriIdentifier ) 
     615                                    listToolTip ~= ( t.typeIdentifier ~ " " ~ t.identifier ~ "(" ~ t.parameterString ~ ")\n" ); 
    543616                            } 
    544                             else 
    545                                 listToolTip ~= ( treeNode.typeIdentifier ~ " " ~ treeNode.identifier ~ "(" ~ treeNode.parameterString ~ ")\n" ); 
    546617                        } 
    547618                        else 
    548                             return _getReturnType(); 
    549                            //if( !treeNode.parameterString.length ) return _getReturnType(); 
    550                     //} 
    551                     //else 
    552                     // return _getReturnType(); 
     619                            listToolTip ~= ( treeNode.typeIdentifier ~ " " ~ treeNode.identifier ~ "(" ~ treeNode.parameterString ~ ")\n" ); 
     620                    } 
     621                    else 
     622                       return _getReturnType(); 
     623                        
    553624                } 
    554625                else if( treeNode.DType & D_UDTS ) 
     
    583654                    else if( treeNode.DType & D_ENUM ) 
    584655                    { 
    585                         char[][] enumWords; 
    586                          
    587                         list = " min?21 max?21 sizeof?21"; 
     656                        char[][] enumWords = [ "min?21", "max?21", "sizeof?21" ]; 
    588657 
    589658                        foreach( CAnalyzerTreeNode t; treeNode.getAllLeaf() ) 
    590659                            enumWords ~= ( t.identifier ~ "?25" ); 
    591660 
    592                         scope CCharsSort!( char[] ) sortList = new CCharsSort!( char[] )( enumWords ); 
    593                         enumWords = sortList.pop(); 
    594                         list = std.string.join( enumWords, " " ) ~ list
     661                        scope sortList = new CCharsSort!( char[] )( enumWords ); 
     662                        enumWords = sortList.scintillaPop(); 
     663                        list = std.string.join( enumWords, " " )
    595664 
    596665                        return null; 
     
    630699                    } 
    631700                 
    632                     list = symbolsToAutoCShow( treeNode, bNotFriendClass, baseClasses ); 
     701                    list = symbolsToAutoCShow( typedWord, treeNode, bNotFriendClass, baseClasses ); 
    633702                    return treeNode; 
    634703                     
     
    736805                            if( type.baseClass.length ) baseClasses = sAutoComplete.getBaseClassNode( type ); 
    737806 
    738                             list = symbolsToAutoCShow( type, bNotFriendClass, baseClasses ); 
     807                            list = symbolsToAutoCShow( typedWord, type, bNotFriendClass, baseClasses ); 
    739808                            return type; 
    740809                        } 
     
    745814                            { 
    746815                                char[] _list, _listToolTip; 
    747                                 CAnalyzerTreeNode typeTreeNode = performAnalyzer( splitTypeIdents, treeNode, _list, _listToolTip, bFunctionToolTip ); 
     816                                CAnalyzerTreeNode typeTreeNode = performAnalyzer( splitTypeIdents, typedWord, treeNode, _list, _listToolTip, bFunctionToolTip ); 
    748817                                if( typeTreeNode !is null ) 
    749818                                { 
    750819                                    if( typeTreeNode.baseClass.length ) baseClasses = sAutoComplete.getBaseClassNode( typeTreeNode ); 
    751                                     list = symbolsToAutoCShow( typeTreeNode, bNotFriendClass, baseClasses ); 
     820                                    list = symbolsToAutoCShow( typedWord, typeTreeNode, bNotFriendClass, baseClasses ); 
    752821                                    listToolTip = _listToolTip; 
    753822                                    //MessageBox.showMessage( "ffff" ); 
     
    785854            foreach( CAnalyzerTreeNode t; treeNode.getAllLeaf() ) 
    786855            { 
    787                 /+ 
    788                 version( Windows ) 
    789                 { 
    790                     if( t.DType & D_VERSION ) 
    791                     { 
    792                         if( t.identifier == "Windows" || t.identifier == "Win32" ) 
    793                         { 
    794                             activeTreeNode = sAutoComplete.getMemberAnalyzerTreeNode( word, D_ALL - D_BLOCK, t, baseClasses ); 
    795                             baseClasses.length = 0; 
    796                         } 
    797  
    798                         if( activeTreeNode ) return activeTreeNode; 
    799                     } 
    800                 } 
    801                 +/ 
    802  
    803                  
    804856                if( t.DType == D_BLOCK ) 
    805857                { 
     
    871923                        if( !( splitedModuleName[j] in bAlreadyImported ) ) 
    872924                        { 
    873                             words ~= splitedModuleName[j]; 
     925                            if( typedWord.length ) 
     926                            { 
     927                                if( std.string.find( splitedModuleName[j], typedWord ) > -1 ) words ~= splitedModuleName[j]; 
     928                            } 
     929                            else 
     930                                words ~= splitedModuleName[j]; 
     931                                 
    874932                            bAlreadyImported[splitedModuleName[j]] = true; 
    875933                        }    
     
    916974            } 
    917975 
    918  
    919             /+ 
    920             foreach( CAnalyzerTreeNode t; importModules ) 
    921             { 
    922                 if( t.getLeafCount() ) 
    923                 { 
    924                     char[] moduleName = t.getLeaf( 0 ).identifier; 
    925  
    926                     foreach( CAnalyzerTreeNode tt; _getCurrentImport() ) 
    927                     { 
    928                         if( tt.identifier == moduleName ) 
    929                             if( tt.typeIdentifier.length ) 
    930                             { 
    931                                 moduleName = tt.typeIdentifier; 
    932                                 break; 
    933                             } 
    934                     } 
    935  
    936                     char[][] splitedModuleName = std.string.split( moduleName, "." ); 
    937  
    938                      
    939                     if( splitedModuleName.length == 1 ) 
    940                     { 
    941                         if( word == moduleName ) 
    942                         { 
    943                             list ~= moduleToAutoCShow( t ); 
    944                             bModuleImportCall = true; 
    945                             if( currentWords.length == 1 ) return null;else list.length = 0; 
    946                         } 
    947                     } 
    948  
    949                     if( currentWords.length < splitedModuleName.length ) 
    950                     { 
    951                         int j; 
    952                         for( j = 0; j < currentWords.length; ++ j ) 
    953                         { 
    954                             if( currentWords[j] != splitedModuleName[j] ) break; 
    955                         } 
    956  
    957                         if( j == currentWords.length ) 
    958                         { 
    959                             if( !( splitedModuleName[j] in bAlreadyImported ) ) 
    960                             { 
    961                                 words ~= splitedModuleName[j]; 
    962                                 bAlreadyImported[splitedModuleName[j]] = true; 
    963                             }    
    964                         } 
    965                     } 
    966                     else 
    967                     { 
    968                         int j; 
    969                         for( j = 0; j < splitedModuleName.length; ++ j ) 
    970                         { 
    971                             if( currentWords[j] != splitedModuleName[j] ) break; 
    972                         } 
    973  
    974                         //words.length = 0; 
    975                         if( currentWords.length == splitedModuleName.length ) 
    976                         { 
    977                             if( j == splitedModuleName.length ) 
    978                             { 
    979                                 list ~= moduleToAutoCShow( t ); 
    980                                 return null; 
    981                             } 
    982                         } 
    983                         else if( currentWords.length > splitedModuleName.length ) 
    984                         { 
    985                             if( index < splitedModuleName.length ) 
    986                             { 
    987                                 bContinue = true; 
    988                                 continue; 
    989                             } 
    990                                              
    991                             if( j == splitedModuleName.length ) 
    992                             { 
    993                                 bModuleImportCall = false; 
    994                                 CAnalyzerTreeNode[] _dummyClasses; 
    995                                 CAnalyzerTreeNode treeNode = sAutoComplete.getMemberAnalyzerTreeNode( word, D_VARIABLE | D_UDTS | D_FUNCTION, t, _dummyClasses ); 
    996                                 bNotFriendClass = true; 
    997                                 return _getType( treeNode ); 
    998                             } 
    999                         } 
    1000                     } 
    1001                 } 
    1002             } 
    1003             +/ 
    1004              
    1005976             
    1006977            if( words.length ) 
    1007978            { 
    1008                 scope CCharsSort!( char[] ) sortList = new CCharsSort!( char[] )( words ); 
    1009                 words = sortList.pop(); 
     979                scope sortList = new CCharsSort!( char[] )( words ); 
     980                words = sortList.scintillaPop(); 
    1010981                list = std.string.join( words, "?22 " ) ~ "?22"; 
    1011982                //if( index == 0 ) bContinue = true; 
     
    10371008                int DType; 
    10381009                //if( bIsFunction ) DType = D_FUNCTION;else  
    1039                 DType = D_ALL - D_IMPORT - D_MAINROOT - D_MODULE - D_UNITTEST -D_UNKNOWN; 
     1010                DType = D_ALL - D_IMPORT - D_MAINROOT - D_MODULE - D_UNITTEST -D_UNKNOWN - D_BLOCK -  
     1011                        D_FUNLITERALS - D_CONDITIONSPEC - D_ANONYMOUSBLOCK - D_MIXIN; 
    10401012 
    10411013                baseClasses.length = 0; 
     
    10481020                    activeTreeNode = sAutoComplete.getAnalyzerTreeNode( word, DType, functionHeadNode, true ); 
    10491021 
    1050                     /+   
    1051                     // 找function內的內容 
    1052                     if( !activeTreeNode ) 
    1053                     { 
    1054                         activeTreeNode = _lookBLOCK( functionHeadNode ); // Not Cool........ 
    1055                     } 
    1056                     else 
    1057                     { 
    1058                         if( word == "this" ) activeTreeNode = null; // for class/interface pointer or ctor 
    1059                     } 
    1060                     +/ 
    1061  
    10621022                    if( activeTreeNode && word == "this" ) activeTreeNode = null; // for class/interface pointer or ctor 
    10631023 
    1064                      
    10651024                    // 找繼承的BaseClass 
    10661025                    if( !activeTreeNode ) 
     
    13561315    } 
    13571316 
    1358     private char[][] readCurrentWholeWord( Scintilla sc
     1317    private char[][] readCurrentWholeWord( Scintilla sc, bool bFunctionToolTip, inout bool bDotEnd
    13591318    { 
    13601319        char[]  word; 
    13611320        dchar[] dword; 
    13621321        int     pos = sc.getCurrentPos() - 2; 
     1322 
     1323        if( !bFunctionToolTip ) 
     1324        { 
     1325            if( sc.getCharAt( pos + 1 ) != '.' ) 
     1326            { 
     1327                pos ++; 
     1328                bDotEnd = false; 
     1329            } 
     1330            else 
     1331                bDotEnd = true; 
     1332        } 
     1333         
    13631334        dchar   ch  = sc.getCharAt( pos ); 
    13641335 
    13651336        int     parenCount, hCount; 
    13661337        bool    bBlockCommet, bResetCommet; 
     1338 
     1339         
    13671340 
    13681341        bool _wordBreak() 
     
    17131686                    if( t.DType & D_VARIABLE ) 
    17141687                    { 
    1715                         activeTreeNode.addLeaf( t.prot, t.DType, t.identifier, t.typeIdentifier, sc.lineFromPosition( sc.getCurrentPos() ), 
    1716                                                 t.parameterString, t.baseClass ); 
     1688                        if( validateVariable( t.identifier ) ) 
     1689                        { 
     1690                            activeTreeNode.addLeaf( t.prot, t.DType, t.identifier, t.typeIdentifier, sc.lineFromPosition( sc.getCurrentPos() ), 
     1691                                                    t.parameterString, t.baseClass ); 
     1692                        } 
    17171693                         
    17181694                        //activeTreeNode = activeTreeNode.getLeaf( activeTreeNode.getLeafCount() - 1 ); 
     
    20001976 
    20011977 
    2002     private char[] symbolsToAutoCShow( CAnalyzerTreeNode treeNode, bool bNotFriendClass, CAnalyzerTreeNode[] baseClasses  )  
     1978    private char[] symbolsToAutoCShow( char[] typedWord, CAnalyzerTreeNode treeNode, bool bNotFriendClass, CAnalyzerTreeNode[] baseClasses  )  
    20031979    { 
    20041980        CAnalyzerTreeNode[] nodes; 
    20051981 
    2006         /+ 
    2007         void _getName( CAnalyzerTreeNode treeNode, bool bNotFriendClass ) 
    2008         { 
    2009             int DType = D_VARIABLE | D_UDTS | D_FUNCTION; 
    2010  
    2011             char[][]    projectVersions = sGUI.packageExp.activeProject.getVersionCondition(); 
    2012             char[][]    projectDebugs   = sGUI.packageExp.activeProject.getDebugCondition(); 
    2013              
    2014             for( int i = 0; i < treeNode.getLeafCount; ++ i ) 
    2015             { 
    2016                 if( treeNode[i].DType & ( D_VERSION | D_DEBUG ) ) 
    2017                 { 
    2018                     if( sAutoComplete.checkCondition( treeNode[i], ( i > 0 ? treeNode[i-1] : null ), projectVersions, projectDebugs ) ) 
    2019                     { 
    2020                         _getName( treeNode[i], bNotFriendClass ); 
    2021                     } 
    2022  
    2023                     continue; 
    2024                 } 
    2025  
    2026                 if( treeNode[i].DType & DType ) 
    2027                 { 
    2028                     if( Globals.showAllMember ) 
    2029                         nodes ~= treeNode[i]; 
    2030                     else 
    2031                     { 
    2032                         if( !bNotFriendClass ) 
    2033                             nodes ~= treeNode[i]; 
    2034                         else 
    2035                             if( !( treeNode[i].prot & ( D_Private | D_Protected ) ) ) nodes ~= treeNode[i]; 
    2036                     } 
    2037                 }                
    2038             } 
    2039         } 
    2040  
    2041         _getName( treeNode, bNotFriendClass ); 
    2042  
    2043  
    2044         if( baseClasses.length ) 
    2045         { 
    2046             foreach( CAnalyzerTreeNode t; baseClasses ) 
    2047             { 
    2048                 _getName( t, true ); 
    2049             } 
    2050         } 
    2051         +/ 
    2052  
    20531982        CAnalyzerTreeNode[] memberNodes = sAutoComplete.getMembers( D_VARIABLE | D_UDTS | D_FUNCTION, treeNode ); 
    2054         foreach( CAnalyzerTreeNode t; sAutoComplete.getBaseClassNode( treeNode ) ) 
    2055         { 
    2056             memberNodes ~= sAutoComplete.getMembers( D_VARIABLE | D_UDTS | D_FUNCTION, treeNode ); 
    2057         } 
     1983 
     1984        foreach( CAnalyzerTreeNode t; baseClasses ) 
     1985            memberNodes ~=  sAutoComplete.getMembers( D_VARIABLE | D_UDTS | D_FUNCTION, t ); 
    20581986 
    20591987        foreach( CAnalyzerTreeNode t; memberNodes ) 
     
    20691997            } 
    20701998        } 
     1999 
     2000        if( typedWord.length ) 
     2001            nodes = sAutoComplete.rootSearch( typedWord, nodes ); 
    20712002         
    20722003        char[][] words = sAutoComplete.setMemberImage( nodes ); 
     
    21932124            char[]  semiWord; 
    21942125                     
    2195             while( semiChar != ';' &&  semiChar != '}' && semiChar != '{' && semiChar != ':' ) 
    2196             { 
     2126            while( semiChar != ';' &&  semiChar != '}' && semiChar != '{' ) 
     2127            { 
     2128                if( types != 0 )   
     2129                    if( semiChar == ':' ) break; 
     2130                 
    21972131                if( semiChar != '\n' && semiChar !='\t' &&  semiChar != '\r' )  
    21982132                    if( semiChar < 128 ) semiWord ~= semiChar; 
     
    22382172                                if( treeNodes.length ) return treeNodes[0];else return null; 
    22392173                            } 
    2240                             else if( s == "else" || s == "try" || s == "catch" || s == "finally" || s == "debug"
     2174                            else if( s == "else" || s == "try" || s == "catch" || s == "finally" || s == "debug" || s == "do"
    22412175                            { 
    22422176                                lineBlocks ~= sc.lineFromPosition( posLeftParen ) + 1; 
     
    23712305                } 
    23722306            } 
     2307            else 
     2308            { 
     2309                if( types == 0 ) lineBlocks ~= sc.lineFromPosition( posLeftParen ) + 1; 
     2310            } 
     2311             
    23732312            return null; 
    23742313        } 
     
    23782317            foreach( CAnalyzerTreeNode t; node.getAllLeaf() ) 
    23792318            { 
    2380                 if( t.DType & D_BLOCK || t.DType & D_FUNLITERALS
     2319                if( t.DType & ( D_BLOCK | D_FUNLITERALS | D_ANONYMOUSBLOCK )
    23812320                    if( t.lineNumber == lineNum ) return t; 
    23822321            } 
     
    25372476    } 
    25382477 
     2478    private bool validateVariable( char[] var ) 
     2479    { 
     2480        foreach( char c; var ) 
     2481        { 
     2482            if( c < 64 || c > 122 ) return false; 
     2483            if( c > 90 && c < 97 ) 
     2484                if( c != 95 ) return false; 
     2485        } 
     2486 
     2487        return true; 
     2488    } 
     2489 
     2490    private CAnalyzerTreeNode getOverloadFunction( CAnalyzerTreeNode oneFunctionNode ) 
     2491    { 
     2492        if( oneFunctionNode is null ) return null; 
     2493         
     2494        // check if function overload 
     2495        CAnalyzerTreeNode aboveNode = oneFunctionNode.getRoot; 
     2496        if( aboveNode !is null ) 
     2497        { 
     2498            CAnalyzerTreeNode[] overloadFunctionNodes; 
     2499            foreach( CAnalyzerTreeNode t; aboveNode.getAllLeaf() ) 
     2500            { 
     2501                if( t.identifier == oneFunctionNode.identifier && ( t.DType & D_FUNCTION ) ) 
     2502                { 
     2503                    if( t.typeIdentifier != "void" ) overloadFunctionNodes ~= t; 
     2504                } 
     2505            } 
     2506 
     2507            if( !overloadFunctionNodes.length ) 
     2508                return oneFunctionNode; 
     2509            else if( !overloadFunctionNodes.length == 1 ) 
     2510                return overloadFunctionNodes[0]; 
     2511            else 
     2512            { 
     2513 
     2514 
     2515            } 
     2516        } 
     2517 
     2518        return oneFunctionNode; 
     2519    } 
     2520 
    25392521} // end of class DStyle