Changeset 1287

Show
Ignore:
Timestamp:
10/12/08 21:26:46 (3 months ago)
Author:
asterite
Message:
  • Fixed a bug that led to a StackOverflow?
  • Now non-static members are not suggested inside a static method.
Files:

Legend:

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

    r1265 r1287  
    9999import descent.internal.compiler.parser.Package; 
    100100import descent.internal.compiler.parser.PtrExp; 
     101import descent.internal.compiler.parser.STC; 
    101102import descent.internal.compiler.parser.Scope; 
    102103import descent.internal.compiler.parser.ScopeDsymbol; 
     
    16121613                ScopeDsymbol scopeDsymbol = ((ScopeDsymbol) sym).unlazy(semanticContext); 
    16131614                if (scopeDsymbol.members != null) { 
    1614                     completeScopeDsymbol(scopeDsymbol, false /* not only statics */, includes); 
     1615                    boolean onlyStatics = false; 
     1616                     
     1617                    // If the completion is inside a method, and this is the time 
     1618                    // to suggest class members, if the class is the one defining the method, 
     1619                    // and the method is static, then only suggest static stuff 
     1620                    if (rootScope.func != null && rootScope.func.storage_class == STC.STCstatic 
     1621                            && rootScope.func.parent == scopeDsymbol) { 
     1622                        onlyStatics = true; 
     1623                    } 
     1624                     
     1625                    completeScopeDsymbol(scopeDsymbol, onlyStatics, includes); 
    16151626                } 
    16161627                if (scopeDsymbol.imports != null) { 
  • trunk/descent.core/src/descent/internal/compiler/parser/TemplateInstance.java

    r1236 r1287  
    551551    public void semantic(Scope sc, SemanticContext context) { 
    552552        // Comment in Descent, we want template instances resolved when possible 
    553 //        if (context.global.errors > 0) { 
    554 //            if (0 == context.global.gag) { 
    555 //                /* Trying to soldier on rarely generates useful messages 
    556 //                 * at this point. 
    557 //                 */ 
    558 //                fatal(context); 
    559 //            } 
    560 //            return; 
    561 //        } 
     553      if (context.global.errors > 0) { 
     554          if (0 == context.global.gag) { 
     555              /* Trying to soldier on rarely generates useful messages 
     556               * at this point. 
     557               */ 
     558              fatal(context); 
     559          } 
     560          return; 
     561      } 
    562562 
    563563        if (null != inst) // if semantic() was already run