Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Decl #1052: Added a method to get the Module for a declaration

  • Loading branch information...
commit 8662770718d5636877d86ffa0e78dad130d920c5 1 parent 3e8067a
@FroMage FroMage authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/com/redhat/ceylon/compiler/java/codegen/Decl.java
View
6 src/com/redhat/ceylon/compiler/java/codegen/Decl.java
@@ -38,6 +38,7 @@
import com.redhat.ceylon.compiler.typechecker.model.LiteralAnnotationArgument;
import com.redhat.ceylon.compiler.typechecker.model.Method;
import com.redhat.ceylon.compiler.typechecker.model.MethodOrValue;
+import com.redhat.ceylon.compiler.typechecker.model.Module;
import com.redhat.ceylon.compiler.typechecker.model.NamedArgumentList;
import com.redhat.ceylon.compiler.typechecker.model.Package;
import com.redhat.ceylon.compiler.typechecker.model.Parameter;
@@ -448,6 +449,11 @@ public static Package getPackageContainer(Scope scope){
return (Package) scope;
}
+ public static Module getModuleContainer(Scope scope) {
+ Package pkg = Decl.getPackageContainer(scope);
+ return pkg != null ? pkg.getModule() : null;
+ }
+
public static boolean isValueTypeDecl(Tree.Term decl) {
if (decl != null){
return isValueTypeDecl(decl.getTypeModel());
Please sign in to comment.
Something went wrong with that request. Please try again.