Changeset 1296

Show
Ignore:
Timestamp:
11/16/08 17:19:22 (2 months ago)
Author:
asterite
Message:

Some minor bug fixes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/descent.core/src/descent/internal/codeassist/CompletionEngine.java

    r1295 r1296  
    17331733                        false /* not only statics */,  
    17341734                        new HashtableOfCharArrayAndObject(), INCLUDE_ALL); 
     1735            } else if (se.sds instanceof ClassDeclaration) { 
     1736                currentName = computePrefixAndSourceRange(ident); 
     1737                suggestMembers((((ClassDeclaration) se.sds)).unlazy(semanticContext).members,  
     1738                        false /* not only statics */,  
     1739                        new HashtableOfCharArrayAndObject(), INCLUDE_ALL); 
     1740            } else if (se.sds instanceof StructDeclaration) { 
     1741                currentName = computePrefixAndSourceRange(ident); 
     1742                suggestMembers((((StructDeclaration) se.sds)).unlazy(semanticContext).members,  
     1743                        false /* not only statics */,  
     1744                        new HashtableOfCharArrayAndObject(), INCLUDE_ALL); 
    17351745            } else if (se.sds instanceof Package) { 
    17361746                char[] name = ident.ident; 
  • trunk/descent.core/src/descent/internal/compiler/lookup/ILazy.java

    r1203 r1296  
    1919     
    2020    IdentifierExp getIdent(); 
     21     
     22    boolean isRunningSemantic(); 
    2123 
    2224} 
  • trunk/descent.core/src/descent/internal/compiler/lookup/LazyAggregateDeclaration.java

    r1246 r1296  
    6565                     
    6666                    s = lazy.members().get(lazy.members().size() - 1); 
    67                     s.addMember(lazy.semanticScope(), lazy.asScopeDsymbol(), 0, context); 
    68                     lazy.runMissingSemantic(s, context); 
     67                     
     68                    if (!lazy.isRunningSemantic()) { 
     69                        s.addMember(lazy.semanticScope(), lazy.asScopeDsymbol(), 0, context); 
     70                        lazy.runMissingSemantic(s, context); 
     71                    } 
    6972                } else { 
    7073                    Dsymbols symbols = new Dsymbols(); 
     
    8083                        s = lazy.members().get(lazy.members().size() - 1); 
    8184                        if (lazy.semanticScope() != null) { 
    82                             s.addMember(lazy.semanticScope(), lazy.asScopeDsymbol(), 0, context); 
     85                            if (!lazy.isRunningSemantic()) { 
     86                                s.addMember(lazy.semanticScope(), lazy.asScopeDsymbol(), 0, context); 
     87                            } 
    8388                        } 
    8489                         
     
    8691                    } 
    8792                     
    88                     for(Dsymbol sym : symbols) { 
    89                         lazy.runMissingSemantic(sym, context); 
     93                    if (!lazy.isRunningSemantic()) { 
     94                        for(Dsymbol sym : symbols) { 
     95                            lazy.runMissingSemantic(sym, context); 
     96                        } 
    9097                    } 
    9198                     
     
    161168            int size = lazy.members().size(); 
    162169             
    163             for (int i = 0; i < size; i++) { 
    164                 Dsymbol sym = lazy.members().get(i); 
    165                 sym.addMember(lazy.semanticScope(), lazy.asScopeDsymbol(), 0, context); 
    166                 lazy.runMissingSemantic(sym, context); 
     170            if (!lazy.isRunningSemantic()) { 
     171                for (int i = 0; i < size; i++) { 
     172                    Dsymbol sym = lazy.members().get(i); 
     173 
     174                    sym.addMember(lazy.semanticScope(), lazy.asScopeDsymbol(), 0, context); 
     175                    lazy.runMissingSemantic(sym, context); 
     176                } 
    167177            } 
    168178        } 
  • trunk/descent.core/src/descent/internal/compiler/lookup/LazyClassDeclaration.java

    r1231 r1296  
    134134        this.symtab = table; 
    135135    } 
     136     
     137    private int isRunningSemantic; 
     138     
     139    @Override 
     140    public void semantic(Scope sc, SemanticContext context) { 
     141        isRunningSemantic++; 
     142         
     143        super.semantic(sc, context); 
     144         
     145        isRunningSemantic--; 
     146    } 
     147     
     148    @Override 
     149    public void semantic2(Scope sc, SemanticContext context) { 
     150        isRunningSemantic++; 
     151         
     152        super.semantic2(sc, context); 
     153         
     154        isRunningSemantic--; 
     155    } 
     156     
     157    @Override 
     158    public void semantic3(Scope sc, SemanticContext context) { 
     159        isRunningSemantic++; 
     160         
     161        super.semantic3(sc, context); 
     162         
     163        isRunningSemantic--; 
     164    } 
     165     
     166    public boolean isRunningSemantic() { 
     167        return isRunningSemantic != 0; 
     168    } 
    136169 
    137170} 
  • trunk/descent.core/src/descent/internal/compiler/lookup/LazyInterfaceDeclaration.java

    r1231 r1296  
    133133        this.symtab = table; 
    134134    } 
     135     
     136    private int isRunningSemantic; 
     137     
     138    @Override 
     139    public void semantic(Scope sc, SemanticContext context) { 
     140        isRunningSemantic++; 
     141         
     142        super.semantic(sc, context); 
     143         
     144        isRunningSemantic--; 
     145    } 
     146     
     147    @Override 
     148    public void semantic2(Scope sc, SemanticContext context) { 
     149        isRunningSemantic++; 
     150         
     151        super.semantic2(sc, context); 
     152         
     153        isRunningSemantic--; 
     154    } 
     155     
     156    @Override 
     157    public void semantic3(Scope sc, SemanticContext context) { 
     158        isRunningSemantic++; 
     159         
     160        super.semantic3(sc, context); 
     161         
     162        isRunningSemantic--; 
     163    } 
     164     
     165    public boolean isRunningSemantic() { 
     166        return isRunningSemantic != 0; 
     167    } 
    135168 
    136169} 
  • trunk/descent.core/src/descent/internal/compiler/lookup/LazyModule.java

    r1246 r1296  
    361361            } 
    362362             
    363             s.addMember(this.semanticScope, this, 0, context); 
    364             runMissingSemantic(s, context); 
     363            if (!isRunningSemantic()) { 
     364                s.addMember(this.semanticScope, this, 0, context); 
     365                runMissingSemantic(s, context); 
     366            } 
    365367             
    366368            if (ad != null) { 
     
    431433        return ident; 
    432434    } 
     435     
     436    private int isRunningSemantic; 
     437     
     438    @Override 
     439    public void semantic(Scope sc, SemanticContext context) { 
     440        isRunningSemantic++; 
     441         
     442        super.semantic(sc, context); 
     443         
     444        isRunningSemantic--; 
     445    } 
     446     
     447    @Override 
     448    public void semantic2(Scope sc, SemanticContext context) { 
     449        isRunningSemantic++; 
     450         
     451        super.semantic2(sc, context); 
     452         
     453        isRunningSemantic--; 
     454    } 
     455     
     456    @Override 
     457    public void semantic3(Scope sc, SemanticContext context) { 
     458        isRunningSemantic++; 
     459         
     460        super.semantic3(sc, context); 
     461         
     462        isRunningSemantic--; 
     463    } 
     464     
     465    public boolean isRunningSemantic() { 
     466        return isRunningSemantic != 0; 
     467    } 
    433468 
    434469} 
  • trunk/descent.core/src/descent/internal/compiler/lookup/LazyStructDeclaration.java

    r1246 r1296  
    134134        this.symtab = table; 
    135135    } 
     136     
     137    private int isRunningSemantic; 
     138     
     139    @Override 
     140    public void semantic(Scope sc, SemanticContext context) { 
     141        isRunningSemantic++; 
     142         
     143        super.semantic(sc, context); 
     144         
     145        isRunningSemantic--; 
     146    } 
     147     
     148    @Override 
     149    public void semantic2(Scope sc, SemanticContext context) { 
     150        isRunningSemantic++; 
     151         
     152        super.semantic2(sc, context); 
     153         
     154        isRunningSemantic--; 
     155    } 
     156     
     157    @Override 
     158    public void semantic3(Scope sc, SemanticContext context) { 
     159        isRunningSemantic++; 
     160         
     161        super.semantic3(sc, context); 
     162         
     163        isRunningSemantic--; 
     164    } 
     165     
     166    public boolean isRunningSemantic() { 
     167        return isRunningSemantic != 0; 
     168    } 
    136169 
    137170} 
  • trunk/descent.core/src/descent/internal/compiler/parser/SemanticContext.java

    r1265 r1296  
    1515import descent.core.dom.AST; 
    1616import descent.internal.compiler.env.IModuleFinder; 
     17import descent.internal.compiler.lookup.DmdModuleFinder; 
    1718import descent.internal.core.CompilerConfiguration; 
    1819import descent.internal.core.util.Util; 
     
    129130         
    130131        // for debugging purposes 
    131 //      global.path.add("c:\\ary\\programacion\\d\\1.020\\dmd\\src\\phobos"); 
    132132//      this.moduleFinder = new DmdModuleFinder(global); 
    133133 
  • trunk/descent.core/src/descent/internal/compiler/parser/TypeTypeof.java

    r1223 r1296  
    4444            exp = exp.semantic(sc, context); 
    4545            sc.intypeof--; 
    46             if (exp.op == TOK.TOKtype) { 
    47                 if (context.acceptsErrors()) { 
    48                     context.acceptProblem(Problem.newSemanticTypeError( 
    49                             IProblem.ArgumentToTypeofIsNotAnExpression, this, 
    50                             exp.toChars(context))); 
    51                 } 
    52             } 
    5346            t = exp.type; 
    5447            if (null == t) { 
  • trunk/descent.tests/descent/tests/dstress/DstressTestGeneratorBase.java

    r918 r1296  
    13011301        failures.add("template_61_C.d"); 
    13021302        failures.add("template_63_C.d"); 
     1303        failures.add("template_66_C.d"); 
     1304        failures.add("template_66_D.d"); 
     1305        failures.add("template_66_E.d"); 
    13031306        failures.add("template_class_04.d"); 
    13041307        failures.add("template_class_05.d"); 
     
    13441347        failures.add("this_14_J.d"); 
    13451348        failures.add("this_15_A.d"); 
     1349        failures.add("this_16_B.d"); 
    13461350        failures.add("throw_07_A.d"); 
    13471351        failures.add("throw_07_B.d"); 
     
    13601364        failures.add("tuple_06_E.d"); 
    13611365        failures.add("tuple_06_F.d"); 
     1366        failures.add("tuple_09_A.d"); 
     1367        failures.add("tuple_09_B.d"); 
    13621368        failures.add("tuple_09_C.d"); 
     1369        failures.add("tuple_09_D.d"); 
     1370        failures.add("tuple_09_E.d"); 
     1371        failures.add("tuple_09_F.d"); 
    13631372        failures.add("tuple_09_G.d"); 
    13641373        failures.add("tuple_09_H.d"); 
  • trunk/descent.ui/src/descent/internal/ui/text/java/GenericJavaTypeProposal.java

    r1295 r1296  
    252252    private TypeArgumentProposal[] computeTypeArgumentProposals() throws JavaModelException { 
    253253        if (fTypeArgumentProposals == null) { 
    254              
    255             getJavaElement().toString(); 
    256254             
    257255            IType type= (IType) getJavaElement();