Changeset 1200

Show
Ignore:
Timestamp:
06/30/08 20:43:22 (2 months ago)
Author:
asterite
Message:

Fixed some bugs, Tango errors dropped to 13 without activating any optimization. Now if you hover over an alias of an import, you get to know which import it is, and you can go to it's definition

Files:

Legend:

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

    r1195 r1200  
    343343                if (isLocal(sym)) { 
    344344                    addLocal((Declaration) sym, sym.getFlags()); 
    345                 } else if (!(sym instanceof descent.internal.compiler.parser.Package) 
    346                         && !(sym instanceof descent.internal.compiler.parser.Import)) { 
     345                } else if (!(sym instanceof descent.internal.compiler.parser.Package)) { 
    347346                    addBinarySearch(sym); 
    348347                } 
  • trunk/descent.core/src/descent/internal/compiler/parser/ASTDmdNode.java

    r1189 r1200  
    623623     */ 
    624624    public Dsymbol creator; 
    625  
     625     
    626626    public void accessCheck(Scope sc, Expression e, Declaration d, 
    627627            SemanticContext context) { 
     628        accessCheck(sc, e, d, context, null); 
     629    } 
     630 
     631    public void accessCheck(Scope sc, Expression e, Declaration d, 
     632            SemanticContext context, ASTDmdNode reference) { 
    628633        if (e == null) { 
    629634            if ((d.prot() == PROTprivate && d.getModule() != sc.module 
     
    647652                } 
    648653            } 
    649             cd.accessCheck(sc, d, context, e); 
     654            cd.accessCheck(sc, d, context, reference != null ? reference : e); 
    650655        } else if (e.type.ty == Tstruct) { // Do access check 
    651656            StructDeclaration cd; 
    652657 
    653658            cd = (((TypeStruct) e.type).sym); 
    654             cd.accessCheck(sc, d, context, e); 
     659            cd.accessCheck(sc, d, context, reference != null ? reference : e); 
    655660        } 
    656661    } 
  • trunk/descent.core/src/descent/internal/compiler/parser/ArrayInitializer.java

    r1199 r1200  
    3232 
    3333    public void addInit(Expression index, Initializer value) { 
    34         if (value == null) { 
    35             System.out.println(123456); 
    36         } 
    37          
    3834        if (this.index == null) { 
    3935            this.index = new Expressions(); 
     
    173169 
    174170            Initializer init = value.get(i); 
    175             if (init == null) { 
    176                 System.out.println(123456); 
    177             } 
    178171            init = init.syntaxCopy(context); 
    179172            ai.value.set(i, init); 
  • trunk/descent.core/src/descent/internal/compiler/parser/ClassDeclaration.java

    r1198 r1200  
    145145            for (i = 0; i < this.baseclasses.size(); i++) { 
    146146                BaseClass b = this.baseclasses.get(i); 
    147  
    148                 if (b == null || b.base == null) { 
    149                     System.out.println(123456); 
    150                 } 
    151147                access = b.base.getAccess(smember); 
    152148                switch (access) { 
     
    353349    @Override 
    354350    public void semantic(Scope sc, SemanticContext context) { 
    355         if ("FilePath".equals(new String(ident.ident))) { 
    356             System.out.println(123456); 
    357         } 
    358          
    359351        if (rest != null && !rest.isConsumed()) { 
    360352            if (rest.getScope() == null) {  
  • trunk/descent.core/src/descent/internal/compiler/parser/DotVarExp.java

    r1189 r1200  
    1616    public Declaration var; 
    1717    public int hasOverloads; 
     18    public IdentifierExp ident; // Descent: for better error reporting 
    1819     
    1920    public DotVarExp(Loc loc, Expression e, Declaration var) { 
     
    129130                        .isAggregateDeclaration(); 
    130131                e1 = getRightThis(loc, sc, ad, e1, var, context); 
    131                 accessCheck(sc, e1, var, context); 
     132                accessCheck(sc, e1, var, context, ident); 
    132133            } 
    133134        } 
  • trunk/descent.core/src/descent/internal/compiler/parser/ForeachStatement.java

    r1188 r1200  
    673673                    } 
    674674                } 
    675                 if (!arg.type.equals(taa.nextOf())) { 
     675                if (!arg.type.equals(taa.index)) { 
    676676                    if (context.acceptsProblems()) { 
    677677                        context.acceptProblem(Problem.newSemanticTypeError( 
    678                                 IProblem.ForeachIndexMustBeType, this, new String[] { taa.index.toChars(context), arg.type.toChars(context) })); 
     678                                IProblem.ForeachIndexMustBeType, arg, new String[] { taa.index.toChars(context), arg.type.toChars(context) })); 
    679679                    } 
    680680                } 
     
    684684                if (context.acceptsProblems()) { 
    685685                    context.acceptProblem(Problem.newSemanticTypeError( 
    686                             IProblem.ForeachValueMustBeType, this, new String[] { taa.next.toChars(context), arg.type.toChars(context) })); 
     686                            IProblem.ForeachValueMustBeType, arg, new String[] { taa.next.toChars(context), arg.type.toChars(context) })); 
    687687                } 
    688688            } 
  • trunk/descent.core/src/descent/internal/compiler/parser/FuncDeclaration.java

    r1198 r1200  
    13321332                            f2 = s.isFuncDeclaration(); 
    13331333                        } 
    1334                         if (f2 == null) { 
    1335                             System.out.println(123456); 
    1336                         } 
    13371334                        f2 = f2.overloadExactMatch(type, context); 
    13381335                        if (f2 != null && f2.isFinal() 
  • trunk/descent.core/src/descent/internal/compiler/parser/Module.java

    r1198 r1200  
    389389         */ 
    390390         
    391         if ("_P_WAIT".equals(new String(ident))) { 
    392             System.out.println(123456); 
    393         } 
    394  
    395391        Dsymbol s = null; 
    396392        if (insearch) { 
  • trunk/descent.core/src/descent/internal/compiler/parser/TemplateDeclaration.java

    r1198 r1200  
    803803        } 
    804804         
    805         if (f == beforePf) { 
    806             System.out.println(123456); 
    807         } 
    808  
    809805        beforePf.overnext = f; 
    810806        f.overprevious = beforePf; 
  • trunk/descent.core/src/descent/internal/compiler/parser/Type.java

    r1189 r1200  
    953953 
    954954        // deco strings are unique and semantic() has been run 
    955         if (this.singleton == t.singleton || (t != null && singleton.deco != null && singleton.deco.equals(t.singleton.deco))) { 
     955        if (this.singleton == t.singleton || 
     956                (t != null && deco != null && t.deco != null && deco.equals(t.deco)) || 
     957                (t != null && singleton.deco != null && singleton.deco.equals(t.singleton.deco))) { 
    956958            return true; 
    957959        } 
  • trunk/descent.core/src/descent/internal/compiler/parser/TypeAArray.java

    r1167 r1200  
    2828        boolean children = visitor.visit(this); 
    2929        if (children) { 
    30             TreeVisitor.acceptChildren(visitor, sourceIndex); 
    31             TreeVisitor.acceptChildren(visitor, key); 
     30            TreeVisitor.acceptChildren(visitor, sourceNext); 
     31            TreeVisitor.acceptChildren(visitor, sourceIndex);           
    3232        } 
    3333        visitor.endVisit(this); 
  • trunk/descent.core/src/descent/internal/compiler/parser/TypeClass.java

    r1189 r1200  
    360360 
    361361        de = new DotVarExp(e.loc, e, d); 
    362         de.start = e.start; 
    363         de.length = e.length
     362        de.ident = ident; // Descent: for better error reporting 
     363        de.copySourceRange(e)
    364364        return de.semantic(sc, context); 
    365365    } 
  • trunk/descent.core/src/descent/internal/compiler/parser/ast/ASTNode.java

    r1171 r1200  
    8989    /** {@inheritDoc} */ 
    9090    public final void accept(IASTVisitor visitor) { 
    91         AssertIn.isNotNull(visitor); 
    92  
    9391        // begin with the generic pre-visit 
    9492        visitor.preVisit(this); 
  • trunk/descent.ui/src/descent/internal/ui/text/java/hover/JavadocHover.java

    r1131 r1200  
    2222 
    2323import descent.core.ICompilationUnit; 
     24import descent.core.IImportDeclaration; 
    2425import descent.core.IJavaElement; 
    2526import descent.core.IMember; 
     
    185186                    return null; 
    186187                } 
     188            } else if (curr instanceof IImportDeclaration) { 
     189                HTMLPrinter.addSmallHeader(buffer, "import " + ((IImportDeclaration) curr).getElementName()); 
     190                hasContents= true; 
    187191            } 
    188192        }