use of com.redhat.ceylon.model.typechecker.model.Declaration in project ceylon-compiler by ceylon.
the class NamingTests method findDecl.
protected Declaration findDecl(String resource, String declName) throws Exception {
List<Declaration> members = getDecls(resource);
Declaration found = null;
outer: for (String name : declName.split("\\.")) {
for (Declaration decl : members) {
if (name.equals(decl.getName())) {
found = decl;
members = found.getMembers();
continue outer;
}
}
break;
}
if (found == null) {
throw new RuntimeException("Unable to find declaration");
}
return found;
}
use of com.redhat.ceylon.model.typechecker.model.Declaration in project ceylon-compiler by ceylon.
the class NamingTests method testCa.
@Test
public void testCa() throws Exception {
final Declaration decl = findDecl("Ca.ceylon", "Ca.a");
assertEquals("com.redhat.ceylon.compiler.java.codegen.Ca.getA", CodegenUtil.getJavaNameOfDeclaration(decl));
}
use of com.redhat.ceylon.model.typechecker.model.Declaration in project ceylon-compiler by ceylon.
the class NamingTests method testg.
@Test
public void testg() throws Exception {
final Declaration decl = findDecl("g.ceylon", "g");
assertEquals("com.redhat.ceylon.compiler.java.codegen.g_.get_", CodegenUtil.getJavaNameOfDeclaration(decl));
}
use of com.redhat.ceylon.model.typechecker.model.Declaration in project ceylon-compiler by ceylon.
the class NamingTests method testv.
@Test
public void testv() throws Exception {
final Declaration decl = findDecl("v.ceylon", "v");
assertEquals("com.redhat.ceylon.compiler.java.codegen.v_.get_", CodegenUtil.getJavaNameOfDeclaration(decl));
}
use of com.redhat.ceylon.model.typechecker.model.Declaration in project ceylon-compiler by ceylon.
the class ClassTransformer method makeLocalContainerPath.
private List<JCAnnotation> makeLocalContainerPath(Interface model) {
List<String> path = List.nil();
Scope container = model.getContainer();
while (container != null && container instanceof Package == false) {
if (container instanceof Declaration)
path = path.prepend(((Declaration) container).getPrefixedName());
container = container.getContainer();
}
return makeAtLocalContainer(path, model.isCompanionClassNeeded() ? model.getJavaCompanionClassName() : null);
}
Aggregations