Search in sources :

Example 1 with Primary

use of org.eclipse.ceylon.compiler.typechecker.tree.Tree.Primary in project ceylon by eclipse.

the class WarningSuppressionVisitor method getSuppressWarnings.

private static Tree.Annotation getSuppressWarnings(Tree.Annotation anno) {
    Primary primary = anno.getPrimary();
    if (primary instanceof Tree.MemberOrTypeExpression) {
        Tree.MemberOrTypeExpression mte = (Tree.MemberOrTypeExpression) primary;
        Declaration declaration = mte.getDeclaration();
        if (declaration != null && declaration.equals(anno.getUnit().getLanguageModuleDeclaration("suppressWarnings"))) {
            return anno;
        }
    }
    return null;
}
Also used : Primary(org.eclipse.ceylon.compiler.typechecker.tree.Tree.Primary) Tree(org.eclipse.ceylon.compiler.typechecker.tree.Tree) Declaration(org.eclipse.ceylon.model.typechecker.model.Declaration)

Aggregations

Tree (org.eclipse.ceylon.compiler.typechecker.tree.Tree)1 Primary (org.eclipse.ceylon.compiler.typechecker.tree.Tree.Primary)1 Declaration (org.eclipse.ceylon.model.typechecker.model.Declaration)1